diff --git a/clients/client-accessanalyzer/.gitignore b/clients/client-accessanalyzer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-accessanalyzer/.gitignore +++ b/clients/client-accessanalyzer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-accessanalyzer/package.json b/clients/client-accessanalyzer/package.json index 870d3c61d346..b1e8f786f673 100644 --- a/clients/client-accessanalyzer/package.json +++ b/clients/client-accessanalyzer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-accessanalyzer", "repository": { "type": "git", diff --git a/clients/client-accessanalyzer/runtimeConfig.browser.ts b/clients/client-accessanalyzer/runtimeConfig.browser.ts deleted file mode 100644 index 0f70666daaea..000000000000 --- a/clients/client-accessanalyzer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-accessanalyzer/runtimeConfig.ts b/clients/client-accessanalyzer/runtimeConfig.ts deleted file mode 100644 index b05628995221..000000000000 --- a/clients/client-accessanalyzer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-accessanalyzer/AccessAnalyzer.ts b/clients/client-accessanalyzer/src/AccessAnalyzer.ts similarity index 100% rename from clients/client-accessanalyzer/AccessAnalyzer.ts rename to clients/client-accessanalyzer/src/AccessAnalyzer.ts diff --git a/clients/client-accessanalyzer/AccessAnalyzerClient.ts b/clients/client-accessanalyzer/src/AccessAnalyzerClient.ts similarity index 100% rename from clients/client-accessanalyzer/AccessAnalyzerClient.ts rename to clients/client-accessanalyzer/src/AccessAnalyzerClient.ts diff --git a/clients/client-accessanalyzer/commands/ApplyArchiveRuleCommand.ts b/clients/client-accessanalyzer/src/commands/ApplyArchiveRuleCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ApplyArchiveRuleCommand.ts rename to clients/client-accessanalyzer/src/commands/ApplyArchiveRuleCommand.ts diff --git a/clients/client-accessanalyzer/commands/CancelPolicyGenerationCommand.ts b/clients/client-accessanalyzer/src/commands/CancelPolicyGenerationCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/CancelPolicyGenerationCommand.ts rename to clients/client-accessanalyzer/src/commands/CancelPolicyGenerationCommand.ts diff --git a/clients/client-accessanalyzer/commands/CreateAccessPreviewCommand.ts b/clients/client-accessanalyzer/src/commands/CreateAccessPreviewCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/CreateAccessPreviewCommand.ts rename to clients/client-accessanalyzer/src/commands/CreateAccessPreviewCommand.ts diff --git a/clients/client-accessanalyzer/commands/CreateAnalyzerCommand.ts b/clients/client-accessanalyzer/src/commands/CreateAnalyzerCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/CreateAnalyzerCommand.ts rename to clients/client-accessanalyzer/src/commands/CreateAnalyzerCommand.ts diff --git a/clients/client-accessanalyzer/commands/CreateArchiveRuleCommand.ts b/clients/client-accessanalyzer/src/commands/CreateArchiveRuleCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/CreateArchiveRuleCommand.ts rename to clients/client-accessanalyzer/src/commands/CreateArchiveRuleCommand.ts diff --git a/clients/client-accessanalyzer/commands/DeleteAnalyzerCommand.ts b/clients/client-accessanalyzer/src/commands/DeleteAnalyzerCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/DeleteAnalyzerCommand.ts rename to clients/client-accessanalyzer/src/commands/DeleteAnalyzerCommand.ts diff --git a/clients/client-accessanalyzer/commands/DeleteArchiveRuleCommand.ts b/clients/client-accessanalyzer/src/commands/DeleteArchiveRuleCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/DeleteArchiveRuleCommand.ts rename to clients/client-accessanalyzer/src/commands/DeleteArchiveRuleCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetAccessPreviewCommand.ts b/clients/client-accessanalyzer/src/commands/GetAccessPreviewCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetAccessPreviewCommand.ts rename to clients/client-accessanalyzer/src/commands/GetAccessPreviewCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetAnalyzedResourceCommand.ts b/clients/client-accessanalyzer/src/commands/GetAnalyzedResourceCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetAnalyzedResourceCommand.ts rename to clients/client-accessanalyzer/src/commands/GetAnalyzedResourceCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetAnalyzerCommand.ts b/clients/client-accessanalyzer/src/commands/GetAnalyzerCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetAnalyzerCommand.ts rename to clients/client-accessanalyzer/src/commands/GetAnalyzerCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetArchiveRuleCommand.ts b/clients/client-accessanalyzer/src/commands/GetArchiveRuleCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetArchiveRuleCommand.ts rename to clients/client-accessanalyzer/src/commands/GetArchiveRuleCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetFindingCommand.ts b/clients/client-accessanalyzer/src/commands/GetFindingCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetFindingCommand.ts rename to clients/client-accessanalyzer/src/commands/GetFindingCommand.ts diff --git a/clients/client-accessanalyzer/commands/GetGeneratedPolicyCommand.ts b/clients/client-accessanalyzer/src/commands/GetGeneratedPolicyCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/GetGeneratedPolicyCommand.ts rename to clients/client-accessanalyzer/src/commands/GetGeneratedPolicyCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListAccessPreviewFindingsCommand.ts b/clients/client-accessanalyzer/src/commands/ListAccessPreviewFindingsCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListAccessPreviewFindingsCommand.ts rename to clients/client-accessanalyzer/src/commands/ListAccessPreviewFindingsCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListAccessPreviewsCommand.ts b/clients/client-accessanalyzer/src/commands/ListAccessPreviewsCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListAccessPreviewsCommand.ts rename to clients/client-accessanalyzer/src/commands/ListAccessPreviewsCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListAnalyzedResourcesCommand.ts b/clients/client-accessanalyzer/src/commands/ListAnalyzedResourcesCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListAnalyzedResourcesCommand.ts rename to clients/client-accessanalyzer/src/commands/ListAnalyzedResourcesCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListAnalyzersCommand.ts b/clients/client-accessanalyzer/src/commands/ListAnalyzersCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListAnalyzersCommand.ts rename to clients/client-accessanalyzer/src/commands/ListAnalyzersCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListArchiveRulesCommand.ts b/clients/client-accessanalyzer/src/commands/ListArchiveRulesCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListArchiveRulesCommand.ts rename to clients/client-accessanalyzer/src/commands/ListArchiveRulesCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListFindingsCommand.ts b/clients/client-accessanalyzer/src/commands/ListFindingsCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListFindingsCommand.ts rename to clients/client-accessanalyzer/src/commands/ListFindingsCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListPolicyGenerationsCommand.ts b/clients/client-accessanalyzer/src/commands/ListPolicyGenerationsCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListPolicyGenerationsCommand.ts rename to clients/client-accessanalyzer/src/commands/ListPolicyGenerationsCommand.ts diff --git a/clients/client-accessanalyzer/commands/ListTagsForResourceCommand.ts b/clients/client-accessanalyzer/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ListTagsForResourceCommand.ts rename to clients/client-accessanalyzer/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-accessanalyzer/commands/StartPolicyGenerationCommand.ts b/clients/client-accessanalyzer/src/commands/StartPolicyGenerationCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/StartPolicyGenerationCommand.ts rename to clients/client-accessanalyzer/src/commands/StartPolicyGenerationCommand.ts diff --git a/clients/client-accessanalyzer/commands/StartResourceScanCommand.ts b/clients/client-accessanalyzer/src/commands/StartResourceScanCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/StartResourceScanCommand.ts rename to clients/client-accessanalyzer/src/commands/StartResourceScanCommand.ts diff --git a/clients/client-accessanalyzer/commands/TagResourceCommand.ts b/clients/client-accessanalyzer/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/TagResourceCommand.ts rename to clients/client-accessanalyzer/src/commands/TagResourceCommand.ts diff --git a/clients/client-accessanalyzer/commands/UntagResourceCommand.ts b/clients/client-accessanalyzer/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/UntagResourceCommand.ts rename to clients/client-accessanalyzer/src/commands/UntagResourceCommand.ts diff --git a/clients/client-accessanalyzer/commands/UpdateArchiveRuleCommand.ts b/clients/client-accessanalyzer/src/commands/UpdateArchiveRuleCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/UpdateArchiveRuleCommand.ts rename to clients/client-accessanalyzer/src/commands/UpdateArchiveRuleCommand.ts diff --git a/clients/client-accessanalyzer/commands/UpdateFindingsCommand.ts b/clients/client-accessanalyzer/src/commands/UpdateFindingsCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/UpdateFindingsCommand.ts rename to clients/client-accessanalyzer/src/commands/UpdateFindingsCommand.ts diff --git a/clients/client-accessanalyzer/commands/ValidatePolicyCommand.ts b/clients/client-accessanalyzer/src/commands/ValidatePolicyCommand.ts similarity index 100% rename from clients/client-accessanalyzer/commands/ValidatePolicyCommand.ts rename to clients/client-accessanalyzer/src/commands/ValidatePolicyCommand.ts diff --git a/clients/client-accessanalyzer/endpoints.ts b/clients/client-accessanalyzer/src/endpoints.ts similarity index 100% rename from clients/client-accessanalyzer/endpoints.ts rename to clients/client-accessanalyzer/src/endpoints.ts diff --git a/clients/client-accessanalyzer/index.ts b/clients/client-accessanalyzer/src/index.ts similarity index 100% rename from clients/client-accessanalyzer/index.ts rename to clients/client-accessanalyzer/src/index.ts diff --git a/clients/client-accessanalyzer/models/index.ts b/clients/client-accessanalyzer/src/models/index.ts similarity index 100% rename from clients/client-accessanalyzer/models/index.ts rename to clients/client-accessanalyzer/src/models/index.ts diff --git a/clients/client-accessanalyzer/models/models_0.ts b/clients/client-accessanalyzer/src/models/models_0.ts similarity index 100% rename from clients/client-accessanalyzer/models/models_0.ts rename to clients/client-accessanalyzer/src/models/models_0.ts diff --git a/clients/client-accessanalyzer/pagination/Interfaces.ts b/clients/client-accessanalyzer/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/Interfaces.ts rename to clients/client-accessanalyzer/src/pagination/Interfaces.ts diff --git a/clients/client-accessanalyzer/pagination/ListAccessPreviewFindingsPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListAccessPreviewFindingsPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListAccessPreviewFindingsPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListAccessPreviewFindingsPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListAccessPreviewsPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListAccessPreviewsPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListAccessPreviewsPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListAccessPreviewsPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListAnalyzedResourcesPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListAnalyzedResourcesPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListAnalyzedResourcesPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListAnalyzersPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListAnalyzersPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListAnalyzersPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListArchiveRulesPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListArchiveRulesPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListArchiveRulesPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListFindingsPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListFindingsPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListFindingsPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ListPolicyGenerationsPaginator.ts b/clients/client-accessanalyzer/src/pagination/ListPolicyGenerationsPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ListPolicyGenerationsPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ListPolicyGenerationsPaginator.ts diff --git a/clients/client-accessanalyzer/pagination/ValidatePolicyPaginator.ts b/clients/client-accessanalyzer/src/pagination/ValidatePolicyPaginator.ts similarity index 100% rename from clients/client-accessanalyzer/pagination/ValidatePolicyPaginator.ts rename to clients/client-accessanalyzer/src/pagination/ValidatePolicyPaginator.ts diff --git a/clients/client-accessanalyzer/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-accessanalyzer/protocols/Aws_restJson1.ts rename to clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts diff --git a/clients/client-accessanalyzer/src/runtimeConfig.browser.ts b/clients/client-accessanalyzer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..776a4a6e19d8 --- /dev/null +++ b/clients/client-accessanalyzer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-accessanalyzer/runtimeConfig.native.ts b/clients/client-accessanalyzer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-accessanalyzer/runtimeConfig.native.ts rename to clients/client-accessanalyzer/src/runtimeConfig.native.ts diff --git a/clients/client-accessanalyzer/runtimeConfig.shared.ts b/clients/client-accessanalyzer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-accessanalyzer/runtimeConfig.shared.ts rename to clients/client-accessanalyzer/src/runtimeConfig.shared.ts diff --git a/clients/client-accessanalyzer/src/runtimeConfig.ts b/clients/client-accessanalyzer/src/runtimeConfig.ts new file mode 100644 index 000000000000..fd6cf07dda67 --- /dev/null +++ b/clients/client-accessanalyzer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AccessAnalyzerClientConfig } from "./AccessAnalyzerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-accessanalyzer/tsconfig.es.json b/clients/client-accessanalyzer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-accessanalyzer/tsconfig.es.json +++ b/clients/client-accessanalyzer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-accessanalyzer/tsconfig.json b/clients/client-accessanalyzer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-accessanalyzer/tsconfig.json +++ b/clients/client-accessanalyzer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-accessanalyzer/tsconfig.types.json b/clients/client-accessanalyzer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-accessanalyzer/tsconfig.types.json +++ b/clients/client-accessanalyzer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-acm-pca/.gitignore b/clients/client-acm-pca/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-acm-pca/.gitignore +++ b/clients/client-acm-pca/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-acm-pca/package.json b/clients/client-acm-pca/package.json index ae9dd36e0b89..4e2d463c25aa 100644 --- a/clients/client-acm-pca/package.json +++ b/clients/client-acm-pca/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-acm-pca", "repository": { "type": "git", diff --git a/clients/client-acm-pca/runtimeConfig.browser.ts b/clients/client-acm-pca/runtimeConfig.browser.ts deleted file mode 100644 index 97c7e7fe1afe..000000000000 --- a/clients/client-acm-pca/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ACMPCAClientConfig } from "./ACMPCAClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ACMPCAClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-acm-pca/runtimeConfig.ts b/clients/client-acm-pca/runtimeConfig.ts deleted file mode 100644 index 527a8de23c9a..000000000000 --- a/clients/client-acm-pca/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ACMPCAClientConfig } from "./ACMPCAClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ACMPCAClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-acm-pca/ACMPCA.ts b/clients/client-acm-pca/src/ACMPCA.ts similarity index 100% rename from clients/client-acm-pca/ACMPCA.ts rename to clients/client-acm-pca/src/ACMPCA.ts diff --git a/clients/client-acm-pca/ACMPCAClient.ts b/clients/client-acm-pca/src/ACMPCAClient.ts similarity index 100% rename from clients/client-acm-pca/ACMPCAClient.ts rename to clients/client-acm-pca/src/ACMPCAClient.ts diff --git a/clients/client-acm-pca/commands/CreateCertificateAuthorityAuditReportCommand.ts b/clients/client-acm-pca/src/commands/CreateCertificateAuthorityAuditReportCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/CreateCertificateAuthorityAuditReportCommand.ts rename to clients/client-acm-pca/src/commands/CreateCertificateAuthorityAuditReportCommand.ts diff --git a/clients/client-acm-pca/commands/CreateCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/CreateCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/CreateCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/CreateCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/CreatePermissionCommand.ts b/clients/client-acm-pca/src/commands/CreatePermissionCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/CreatePermissionCommand.ts rename to clients/client-acm-pca/src/commands/CreatePermissionCommand.ts diff --git a/clients/client-acm-pca/commands/DeleteCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/DeleteCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/DeleteCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/DeleteCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/DeletePermissionCommand.ts b/clients/client-acm-pca/src/commands/DeletePermissionCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/DeletePermissionCommand.ts rename to clients/client-acm-pca/src/commands/DeletePermissionCommand.ts diff --git a/clients/client-acm-pca/commands/DeletePolicyCommand.ts b/clients/client-acm-pca/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/DeletePolicyCommand.ts rename to clients/client-acm-pca/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-acm-pca/commands/DescribeCertificateAuthorityAuditReportCommand.ts b/clients/client-acm-pca/src/commands/DescribeCertificateAuthorityAuditReportCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/DescribeCertificateAuthorityAuditReportCommand.ts rename to clients/client-acm-pca/src/commands/DescribeCertificateAuthorityAuditReportCommand.ts diff --git a/clients/client-acm-pca/commands/DescribeCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/DescribeCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/DescribeCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/DescribeCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/GetCertificateAuthorityCertificateCommand.ts b/clients/client-acm-pca/src/commands/GetCertificateAuthorityCertificateCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/GetCertificateAuthorityCertificateCommand.ts rename to clients/client-acm-pca/src/commands/GetCertificateAuthorityCertificateCommand.ts diff --git a/clients/client-acm-pca/commands/GetCertificateAuthorityCsrCommand.ts b/clients/client-acm-pca/src/commands/GetCertificateAuthorityCsrCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/GetCertificateAuthorityCsrCommand.ts rename to clients/client-acm-pca/src/commands/GetCertificateAuthorityCsrCommand.ts diff --git a/clients/client-acm-pca/commands/GetCertificateCommand.ts b/clients/client-acm-pca/src/commands/GetCertificateCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/GetCertificateCommand.ts rename to clients/client-acm-pca/src/commands/GetCertificateCommand.ts diff --git a/clients/client-acm-pca/commands/GetPolicyCommand.ts b/clients/client-acm-pca/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/GetPolicyCommand.ts rename to clients/client-acm-pca/src/commands/GetPolicyCommand.ts diff --git a/clients/client-acm-pca/commands/ImportCertificateAuthorityCertificateCommand.ts b/clients/client-acm-pca/src/commands/ImportCertificateAuthorityCertificateCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/ImportCertificateAuthorityCertificateCommand.ts rename to clients/client-acm-pca/src/commands/ImportCertificateAuthorityCertificateCommand.ts diff --git a/clients/client-acm-pca/commands/IssueCertificateCommand.ts b/clients/client-acm-pca/src/commands/IssueCertificateCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/IssueCertificateCommand.ts rename to clients/client-acm-pca/src/commands/IssueCertificateCommand.ts diff --git a/clients/client-acm-pca/commands/ListCertificateAuthoritiesCommand.ts b/clients/client-acm-pca/src/commands/ListCertificateAuthoritiesCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/ListCertificateAuthoritiesCommand.ts rename to clients/client-acm-pca/src/commands/ListCertificateAuthoritiesCommand.ts diff --git a/clients/client-acm-pca/commands/ListPermissionsCommand.ts b/clients/client-acm-pca/src/commands/ListPermissionsCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/ListPermissionsCommand.ts rename to clients/client-acm-pca/src/commands/ListPermissionsCommand.ts diff --git a/clients/client-acm-pca/commands/ListTagsCommand.ts b/clients/client-acm-pca/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/ListTagsCommand.ts rename to clients/client-acm-pca/src/commands/ListTagsCommand.ts diff --git a/clients/client-acm-pca/commands/PutPolicyCommand.ts b/clients/client-acm-pca/src/commands/PutPolicyCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/PutPolicyCommand.ts rename to clients/client-acm-pca/src/commands/PutPolicyCommand.ts diff --git a/clients/client-acm-pca/commands/RestoreCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/RestoreCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/RestoreCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/RestoreCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/RevokeCertificateCommand.ts b/clients/client-acm-pca/src/commands/RevokeCertificateCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/RevokeCertificateCommand.ts rename to clients/client-acm-pca/src/commands/RevokeCertificateCommand.ts diff --git a/clients/client-acm-pca/commands/TagCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/TagCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/TagCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/TagCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/UntagCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/UntagCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/UntagCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/UntagCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/commands/UpdateCertificateAuthorityCommand.ts b/clients/client-acm-pca/src/commands/UpdateCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-acm-pca/commands/UpdateCertificateAuthorityCommand.ts rename to clients/client-acm-pca/src/commands/UpdateCertificateAuthorityCommand.ts diff --git a/clients/client-acm-pca/endpoints.ts b/clients/client-acm-pca/src/endpoints.ts similarity index 100% rename from clients/client-acm-pca/endpoints.ts rename to clients/client-acm-pca/src/endpoints.ts diff --git a/clients/client-acm-pca/index.ts b/clients/client-acm-pca/src/index.ts similarity index 100% rename from clients/client-acm-pca/index.ts rename to clients/client-acm-pca/src/index.ts diff --git a/clients/client-acm-pca/models/index.ts b/clients/client-acm-pca/src/models/index.ts similarity index 100% rename from clients/client-acm-pca/models/index.ts rename to clients/client-acm-pca/src/models/index.ts diff --git a/clients/client-acm-pca/models/models_0.ts b/clients/client-acm-pca/src/models/models_0.ts similarity index 100% rename from clients/client-acm-pca/models/models_0.ts rename to clients/client-acm-pca/src/models/models_0.ts diff --git a/clients/client-acm-pca/pagination/Interfaces.ts b/clients/client-acm-pca/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-acm-pca/pagination/Interfaces.ts rename to clients/client-acm-pca/src/pagination/Interfaces.ts diff --git a/clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts b/clients/client-acm-pca/src/pagination/ListCertificateAuthoritiesPaginator.ts similarity index 100% rename from clients/client-acm-pca/pagination/ListCertificateAuthoritiesPaginator.ts rename to clients/client-acm-pca/src/pagination/ListCertificateAuthoritiesPaginator.ts diff --git a/clients/client-acm-pca/pagination/ListPermissionsPaginator.ts b/clients/client-acm-pca/src/pagination/ListPermissionsPaginator.ts similarity index 100% rename from clients/client-acm-pca/pagination/ListPermissionsPaginator.ts rename to clients/client-acm-pca/src/pagination/ListPermissionsPaginator.ts diff --git a/clients/client-acm-pca/pagination/ListTagsPaginator.ts b/clients/client-acm-pca/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-acm-pca/pagination/ListTagsPaginator.ts rename to clients/client-acm-pca/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-acm-pca/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-acm-pca/protocols/Aws_json1_1.ts rename to clients/client-acm-pca/src/protocols/Aws_json1_1.ts diff --git a/clients/client-acm-pca/src/runtimeConfig.browser.ts b/clients/client-acm-pca/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d2af315cff2d --- /dev/null +++ b/clients/client-acm-pca/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ACMPCAClientConfig } from "./ACMPCAClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ACMPCAClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-acm-pca/runtimeConfig.native.ts b/clients/client-acm-pca/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-acm-pca/runtimeConfig.native.ts rename to clients/client-acm-pca/src/runtimeConfig.native.ts diff --git a/clients/client-acm-pca/runtimeConfig.shared.ts b/clients/client-acm-pca/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-acm-pca/runtimeConfig.shared.ts rename to clients/client-acm-pca/src/runtimeConfig.shared.ts diff --git a/clients/client-acm-pca/src/runtimeConfig.ts b/clients/client-acm-pca/src/runtimeConfig.ts new file mode 100644 index 000000000000..bf122402f40d --- /dev/null +++ b/clients/client-acm-pca/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ACMPCAClientConfig } from "./ACMPCAClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ACMPCAClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-acm-pca/waiters/waitForAuditReportCreated.ts b/clients/client-acm-pca/src/waiters/waitForAuditReportCreated.ts similarity index 100% rename from clients/client-acm-pca/waiters/waitForAuditReportCreated.ts rename to clients/client-acm-pca/src/waiters/waitForAuditReportCreated.ts diff --git a/clients/client-acm-pca/waiters/waitForCertificateAuthorityCSRCreated.ts b/clients/client-acm-pca/src/waiters/waitForCertificateAuthorityCSRCreated.ts similarity index 100% rename from clients/client-acm-pca/waiters/waitForCertificateAuthorityCSRCreated.ts rename to clients/client-acm-pca/src/waiters/waitForCertificateAuthorityCSRCreated.ts diff --git a/clients/client-acm-pca/waiters/waitForCertificateIssued.ts b/clients/client-acm-pca/src/waiters/waitForCertificateIssued.ts similarity index 100% rename from clients/client-acm-pca/waiters/waitForCertificateIssued.ts rename to clients/client-acm-pca/src/waiters/waitForCertificateIssued.ts diff --git a/clients/client-acm-pca/tsconfig.es.json b/clients/client-acm-pca/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-acm-pca/tsconfig.es.json +++ b/clients/client-acm-pca/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-acm-pca/tsconfig.json b/clients/client-acm-pca/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-acm-pca/tsconfig.json +++ b/clients/client-acm-pca/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-acm-pca/tsconfig.types.json b/clients/client-acm-pca/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-acm-pca/tsconfig.types.json +++ b/clients/client-acm-pca/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-acm/.gitignore b/clients/client-acm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-acm/.gitignore +++ b/clients/client-acm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-acm/package.json b/clients/client-acm/package.json index b0f629966682..1e3b42b0d037 100644 --- a/clients/client-acm/package.json +++ b/clients/client-acm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-acm", "repository": { "type": "git", diff --git a/clients/client-acm/runtimeConfig.browser.ts b/clients/client-acm/runtimeConfig.browser.ts deleted file mode 100644 index 00546adb1049..000000000000 --- a/clients/client-acm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ACMClientConfig } from "./ACMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ACMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-acm/runtimeConfig.ts b/clients/client-acm/runtimeConfig.ts deleted file mode 100644 index 76c295ed9ddc..000000000000 --- a/clients/client-acm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ACMClientConfig } from "./ACMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ACMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-acm/ACM.ts b/clients/client-acm/src/ACM.ts similarity index 100% rename from clients/client-acm/ACM.ts rename to clients/client-acm/src/ACM.ts diff --git a/clients/client-acm/ACMClient.ts b/clients/client-acm/src/ACMClient.ts similarity index 100% rename from clients/client-acm/ACMClient.ts rename to clients/client-acm/src/ACMClient.ts diff --git a/clients/client-acm/commands/AddTagsToCertificateCommand.ts b/clients/client-acm/src/commands/AddTagsToCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/AddTagsToCertificateCommand.ts rename to clients/client-acm/src/commands/AddTagsToCertificateCommand.ts diff --git a/clients/client-acm/commands/DeleteCertificateCommand.ts b/clients/client-acm/src/commands/DeleteCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/DeleteCertificateCommand.ts rename to clients/client-acm/src/commands/DeleteCertificateCommand.ts diff --git a/clients/client-acm/commands/DescribeCertificateCommand.ts b/clients/client-acm/src/commands/DescribeCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/DescribeCertificateCommand.ts rename to clients/client-acm/src/commands/DescribeCertificateCommand.ts diff --git a/clients/client-acm/commands/ExportCertificateCommand.ts b/clients/client-acm/src/commands/ExportCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/ExportCertificateCommand.ts rename to clients/client-acm/src/commands/ExportCertificateCommand.ts diff --git a/clients/client-acm/commands/GetAccountConfigurationCommand.ts b/clients/client-acm/src/commands/GetAccountConfigurationCommand.ts similarity index 100% rename from clients/client-acm/commands/GetAccountConfigurationCommand.ts rename to clients/client-acm/src/commands/GetAccountConfigurationCommand.ts diff --git a/clients/client-acm/commands/GetCertificateCommand.ts b/clients/client-acm/src/commands/GetCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/GetCertificateCommand.ts rename to clients/client-acm/src/commands/GetCertificateCommand.ts diff --git a/clients/client-acm/commands/ImportCertificateCommand.ts b/clients/client-acm/src/commands/ImportCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/ImportCertificateCommand.ts rename to clients/client-acm/src/commands/ImportCertificateCommand.ts diff --git a/clients/client-acm/commands/ListCertificatesCommand.ts b/clients/client-acm/src/commands/ListCertificatesCommand.ts similarity index 100% rename from clients/client-acm/commands/ListCertificatesCommand.ts rename to clients/client-acm/src/commands/ListCertificatesCommand.ts diff --git a/clients/client-acm/commands/ListTagsForCertificateCommand.ts b/clients/client-acm/src/commands/ListTagsForCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/ListTagsForCertificateCommand.ts rename to clients/client-acm/src/commands/ListTagsForCertificateCommand.ts diff --git a/clients/client-acm/commands/PutAccountConfigurationCommand.ts b/clients/client-acm/src/commands/PutAccountConfigurationCommand.ts similarity index 100% rename from clients/client-acm/commands/PutAccountConfigurationCommand.ts rename to clients/client-acm/src/commands/PutAccountConfigurationCommand.ts diff --git a/clients/client-acm/commands/RemoveTagsFromCertificateCommand.ts b/clients/client-acm/src/commands/RemoveTagsFromCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/RemoveTagsFromCertificateCommand.ts rename to clients/client-acm/src/commands/RemoveTagsFromCertificateCommand.ts diff --git a/clients/client-acm/commands/RenewCertificateCommand.ts b/clients/client-acm/src/commands/RenewCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/RenewCertificateCommand.ts rename to clients/client-acm/src/commands/RenewCertificateCommand.ts diff --git a/clients/client-acm/commands/RequestCertificateCommand.ts b/clients/client-acm/src/commands/RequestCertificateCommand.ts similarity index 100% rename from clients/client-acm/commands/RequestCertificateCommand.ts rename to clients/client-acm/src/commands/RequestCertificateCommand.ts diff --git a/clients/client-acm/commands/ResendValidationEmailCommand.ts b/clients/client-acm/src/commands/ResendValidationEmailCommand.ts similarity index 100% rename from clients/client-acm/commands/ResendValidationEmailCommand.ts rename to clients/client-acm/src/commands/ResendValidationEmailCommand.ts diff --git a/clients/client-acm/commands/UpdateCertificateOptionsCommand.ts b/clients/client-acm/src/commands/UpdateCertificateOptionsCommand.ts similarity index 100% rename from clients/client-acm/commands/UpdateCertificateOptionsCommand.ts rename to clients/client-acm/src/commands/UpdateCertificateOptionsCommand.ts diff --git a/clients/client-acm/endpoints.ts b/clients/client-acm/src/endpoints.ts similarity index 100% rename from clients/client-acm/endpoints.ts rename to clients/client-acm/src/endpoints.ts diff --git a/clients/client-acm/index.ts b/clients/client-acm/src/index.ts similarity index 100% rename from clients/client-acm/index.ts rename to clients/client-acm/src/index.ts diff --git a/clients/client-acm/models/index.ts b/clients/client-acm/src/models/index.ts similarity index 100% rename from clients/client-acm/models/index.ts rename to clients/client-acm/src/models/index.ts diff --git a/clients/client-acm/models/models_0.ts b/clients/client-acm/src/models/models_0.ts similarity index 100% rename from clients/client-acm/models/models_0.ts rename to clients/client-acm/src/models/models_0.ts diff --git a/clients/client-acm/pagination/Interfaces.ts b/clients/client-acm/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-acm/pagination/Interfaces.ts rename to clients/client-acm/src/pagination/Interfaces.ts diff --git a/clients/client-acm/pagination/ListCertificatesPaginator.ts b/clients/client-acm/src/pagination/ListCertificatesPaginator.ts similarity index 100% rename from clients/client-acm/pagination/ListCertificatesPaginator.ts rename to clients/client-acm/src/pagination/ListCertificatesPaginator.ts diff --git a/clients/client-acm/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-acm/protocols/Aws_json1_1.ts rename to clients/client-acm/src/protocols/Aws_json1_1.ts diff --git a/clients/client-acm/src/runtimeConfig.browser.ts b/clients/client-acm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7daeeba03236 --- /dev/null +++ b/clients/client-acm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ACMClientConfig } from "./ACMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ACMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-acm/runtimeConfig.native.ts b/clients/client-acm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-acm/runtimeConfig.native.ts rename to clients/client-acm/src/runtimeConfig.native.ts diff --git a/clients/client-acm/runtimeConfig.shared.ts b/clients/client-acm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-acm/runtimeConfig.shared.ts rename to clients/client-acm/src/runtimeConfig.shared.ts diff --git a/clients/client-acm/src/runtimeConfig.ts b/clients/client-acm/src/runtimeConfig.ts new file mode 100644 index 000000000000..b1ca75f9dd87 --- /dev/null +++ b/clients/client-acm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ACMClientConfig } from "./ACMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ACMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-acm/waiters/waitForCertificateValidated.ts b/clients/client-acm/src/waiters/waitForCertificateValidated.ts similarity index 100% rename from clients/client-acm/waiters/waitForCertificateValidated.ts rename to clients/client-acm/src/waiters/waitForCertificateValidated.ts diff --git a/clients/client-acm/tsconfig.es.json b/clients/client-acm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-acm/tsconfig.es.json +++ b/clients/client-acm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-acm/tsconfig.json b/clients/client-acm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-acm/tsconfig.json +++ b/clients/client-acm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-acm/tsconfig.types.json b/clients/client-acm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-acm/tsconfig.types.json +++ b/clients/client-acm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-alexa-for-business/.gitignore b/clients/client-alexa-for-business/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-alexa-for-business/.gitignore +++ b/clients/client-alexa-for-business/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-alexa-for-business/package.json b/clients/client-alexa-for-business/package.json index b01feb527470..37f627f92168 100644 --- a/clients/client-alexa-for-business/package.json +++ b/clients/client-alexa-for-business/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-alexa-for-business", "repository": { "type": "git", diff --git a/clients/client-alexa-for-business/runtimeConfig.browser.ts b/clients/client-alexa-for-business/runtimeConfig.browser.ts deleted file mode 100644 index 95e09d4290d0..000000000000 --- a/clients/client-alexa-for-business/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AlexaForBusinessClientConfig } from "./AlexaForBusinessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AlexaForBusinessClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-alexa-for-business/runtimeConfig.ts b/clients/client-alexa-for-business/runtimeConfig.ts deleted file mode 100644 index 24e62e980059..000000000000 --- a/clients/client-alexa-for-business/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AlexaForBusinessClientConfig } from "./AlexaForBusinessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AlexaForBusinessClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-alexa-for-business/AlexaForBusiness.ts b/clients/client-alexa-for-business/src/AlexaForBusiness.ts similarity index 100% rename from clients/client-alexa-for-business/AlexaForBusiness.ts rename to clients/client-alexa-for-business/src/AlexaForBusiness.ts diff --git a/clients/client-alexa-for-business/AlexaForBusinessClient.ts b/clients/client-alexa-for-business/src/AlexaForBusinessClient.ts similarity index 100% rename from clients/client-alexa-for-business/AlexaForBusinessClient.ts rename to clients/client-alexa-for-business/src/AlexaForBusinessClient.ts diff --git a/clients/client-alexa-for-business/commands/ApproveSkillCommand.ts b/clients/client-alexa-for-business/src/commands/ApproveSkillCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ApproveSkillCommand.ts rename to clients/client-alexa-for-business/src/commands/ApproveSkillCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateContactWithAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateContactWithAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateContactWithAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateContactWithAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateDeviceWithNetworkProfileCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateDeviceWithNetworkProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateDeviceWithNetworkProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateDeviceWithNetworkProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateDeviceWithRoomCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateDeviceWithRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateDeviceWithRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateDeviceWithRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateSkillGroupWithRoomCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateSkillGroupWithRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateSkillGroupWithRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateSkillGroupWithRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateSkillWithSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateSkillWithSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateSkillWithSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateSkillWithSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/AssociateSkillWithUsersCommand.ts b/clients/client-alexa-for-business/src/commands/AssociateSkillWithUsersCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/AssociateSkillWithUsersCommand.ts rename to clients/client-alexa-for-business/src/commands/AssociateSkillWithUsersCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/CreateAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateBusinessReportScheduleCommand.ts b/clients/client-alexa-for-business/src/commands/CreateBusinessReportScheduleCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateBusinessReportScheduleCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateBusinessReportScheduleCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateConferenceProviderCommand.ts b/clients/client-alexa-for-business/src/commands/CreateConferenceProviderCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateConferenceProviderCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateConferenceProviderCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateContactCommand.ts b/clients/client-alexa-for-business/src/commands/CreateContactCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateContactCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateContactCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateGatewayGroupCommand.ts b/clients/client-alexa-for-business/src/commands/CreateGatewayGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateGatewayGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateGatewayGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateNetworkProfileCommand.ts b/clients/client-alexa-for-business/src/commands/CreateNetworkProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateNetworkProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateNetworkProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateProfileCommand.ts b/clients/client-alexa-for-business/src/commands/CreateProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateRoomCommand.ts b/clients/client-alexa-for-business/src/commands/CreateRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/CreateSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/CreateUserCommand.ts b/clients/client-alexa-for-business/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/CreateUserCommand.ts rename to clients/client-alexa-for-business/src/commands/CreateUserCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteBusinessReportScheduleCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteBusinessReportScheduleCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteBusinessReportScheduleCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteBusinessReportScheduleCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteConferenceProviderCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteConferenceProviderCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteConferenceProviderCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteConferenceProviderCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteContactCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteContactCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteContactCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteContactCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteDeviceCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteDeviceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteDeviceCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteDeviceCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteDeviceUsageDataCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteDeviceUsageDataCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteDeviceUsageDataCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteDeviceUsageDataCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteGatewayGroupCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteGatewayGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteGatewayGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteGatewayGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteNetworkProfileCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteNetworkProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteNetworkProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteNetworkProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteProfileCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteRoomCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteRoomSkillParameterCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteRoomSkillParameterCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteRoomSkillParameterCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteRoomSkillParameterCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteSkillAuthorizationCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteSkillAuthorizationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteSkillAuthorizationCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteSkillAuthorizationCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/DeleteUserCommand.ts b/clients/client-alexa-for-business/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DeleteUserCommand.ts rename to clients/client-alexa-for-business/src/commands/DeleteUserCommand.ts diff --git a/clients/client-alexa-for-business/commands/DisassociateContactFromAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/DisassociateContactFromAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DisassociateContactFromAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/DisassociateContactFromAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/DisassociateDeviceFromRoomCommand.ts b/clients/client-alexa-for-business/src/commands/DisassociateDeviceFromRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DisassociateDeviceFromRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/DisassociateDeviceFromRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/DisassociateSkillFromSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/DisassociateSkillFromSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DisassociateSkillFromSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/DisassociateSkillFromSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/DisassociateSkillFromUsersCommand.ts b/clients/client-alexa-for-business/src/commands/DisassociateSkillFromUsersCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DisassociateSkillFromUsersCommand.ts rename to clients/client-alexa-for-business/src/commands/DisassociateSkillFromUsersCommand.ts diff --git a/clients/client-alexa-for-business/commands/DisassociateSkillGroupFromRoomCommand.ts b/clients/client-alexa-for-business/src/commands/DisassociateSkillGroupFromRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/DisassociateSkillGroupFromRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/DisassociateSkillGroupFromRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/ForgetSmartHomeAppliancesCommand.ts b/clients/client-alexa-for-business/src/commands/ForgetSmartHomeAppliancesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ForgetSmartHomeAppliancesCommand.ts rename to clients/client-alexa-for-business/src/commands/ForgetSmartHomeAppliancesCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/GetAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/GetAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetConferencePreferenceCommand.ts b/clients/client-alexa-for-business/src/commands/GetConferencePreferenceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetConferencePreferenceCommand.ts rename to clients/client-alexa-for-business/src/commands/GetConferencePreferenceCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetConferenceProviderCommand.ts b/clients/client-alexa-for-business/src/commands/GetConferenceProviderCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetConferenceProviderCommand.ts rename to clients/client-alexa-for-business/src/commands/GetConferenceProviderCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetContactCommand.ts b/clients/client-alexa-for-business/src/commands/GetContactCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetContactCommand.ts rename to clients/client-alexa-for-business/src/commands/GetContactCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetDeviceCommand.ts b/clients/client-alexa-for-business/src/commands/GetDeviceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetDeviceCommand.ts rename to clients/client-alexa-for-business/src/commands/GetDeviceCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetGatewayCommand.ts b/clients/client-alexa-for-business/src/commands/GetGatewayCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetGatewayCommand.ts rename to clients/client-alexa-for-business/src/commands/GetGatewayCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetGatewayGroupCommand.ts b/clients/client-alexa-for-business/src/commands/GetGatewayGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetGatewayGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/GetGatewayGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetInvitationConfigurationCommand.ts b/clients/client-alexa-for-business/src/commands/GetInvitationConfigurationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetInvitationConfigurationCommand.ts rename to clients/client-alexa-for-business/src/commands/GetInvitationConfigurationCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetNetworkProfileCommand.ts b/clients/client-alexa-for-business/src/commands/GetNetworkProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetNetworkProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/GetNetworkProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetProfileCommand.ts b/clients/client-alexa-for-business/src/commands/GetProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/GetProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetRoomCommand.ts b/clients/client-alexa-for-business/src/commands/GetRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/GetRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetRoomSkillParameterCommand.ts b/clients/client-alexa-for-business/src/commands/GetRoomSkillParameterCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetRoomSkillParameterCommand.ts rename to clients/client-alexa-for-business/src/commands/GetRoomSkillParameterCommand.ts diff --git a/clients/client-alexa-for-business/commands/GetSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/GetSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/GetSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/GetSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListBusinessReportSchedulesCommand.ts b/clients/client-alexa-for-business/src/commands/ListBusinessReportSchedulesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListBusinessReportSchedulesCommand.ts rename to clients/client-alexa-for-business/src/commands/ListBusinessReportSchedulesCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListConferenceProvidersCommand.ts b/clients/client-alexa-for-business/src/commands/ListConferenceProvidersCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListConferenceProvidersCommand.ts rename to clients/client-alexa-for-business/src/commands/ListConferenceProvidersCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListDeviceEventsCommand.ts b/clients/client-alexa-for-business/src/commands/ListDeviceEventsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListDeviceEventsCommand.ts rename to clients/client-alexa-for-business/src/commands/ListDeviceEventsCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListGatewayGroupsCommand.ts b/clients/client-alexa-for-business/src/commands/ListGatewayGroupsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListGatewayGroupsCommand.ts rename to clients/client-alexa-for-business/src/commands/ListGatewayGroupsCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListGatewaysCommand.ts b/clients/client-alexa-for-business/src/commands/ListGatewaysCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListGatewaysCommand.ts rename to clients/client-alexa-for-business/src/commands/ListGatewaysCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListSkillsCommand.ts b/clients/client-alexa-for-business/src/commands/ListSkillsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListSkillsCommand.ts rename to clients/client-alexa-for-business/src/commands/ListSkillsCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListSkillsStoreCategoriesCommand.ts b/clients/client-alexa-for-business/src/commands/ListSkillsStoreCategoriesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListSkillsStoreCategoriesCommand.ts rename to clients/client-alexa-for-business/src/commands/ListSkillsStoreCategoriesCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListSkillsStoreSkillsByCategoryCommand.ts b/clients/client-alexa-for-business/src/commands/ListSkillsStoreSkillsByCategoryCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListSkillsStoreSkillsByCategoryCommand.ts rename to clients/client-alexa-for-business/src/commands/ListSkillsStoreSkillsByCategoryCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListSmartHomeAppliancesCommand.ts b/clients/client-alexa-for-business/src/commands/ListSmartHomeAppliancesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListSmartHomeAppliancesCommand.ts rename to clients/client-alexa-for-business/src/commands/ListSmartHomeAppliancesCommand.ts diff --git a/clients/client-alexa-for-business/commands/ListTagsCommand.ts b/clients/client-alexa-for-business/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ListTagsCommand.ts rename to clients/client-alexa-for-business/src/commands/ListTagsCommand.ts diff --git a/clients/client-alexa-for-business/commands/PutConferencePreferenceCommand.ts b/clients/client-alexa-for-business/src/commands/PutConferencePreferenceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/PutConferencePreferenceCommand.ts rename to clients/client-alexa-for-business/src/commands/PutConferencePreferenceCommand.ts diff --git a/clients/client-alexa-for-business/commands/PutInvitationConfigurationCommand.ts b/clients/client-alexa-for-business/src/commands/PutInvitationConfigurationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/PutInvitationConfigurationCommand.ts rename to clients/client-alexa-for-business/src/commands/PutInvitationConfigurationCommand.ts diff --git a/clients/client-alexa-for-business/commands/PutRoomSkillParameterCommand.ts b/clients/client-alexa-for-business/src/commands/PutRoomSkillParameterCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/PutRoomSkillParameterCommand.ts rename to clients/client-alexa-for-business/src/commands/PutRoomSkillParameterCommand.ts diff --git a/clients/client-alexa-for-business/commands/PutSkillAuthorizationCommand.ts b/clients/client-alexa-for-business/src/commands/PutSkillAuthorizationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/PutSkillAuthorizationCommand.ts rename to clients/client-alexa-for-business/src/commands/PutSkillAuthorizationCommand.ts diff --git a/clients/client-alexa-for-business/commands/RegisterAVSDeviceCommand.ts b/clients/client-alexa-for-business/src/commands/RegisterAVSDeviceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/RegisterAVSDeviceCommand.ts rename to clients/client-alexa-for-business/src/commands/RegisterAVSDeviceCommand.ts diff --git a/clients/client-alexa-for-business/commands/RejectSkillCommand.ts b/clients/client-alexa-for-business/src/commands/RejectSkillCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/RejectSkillCommand.ts rename to clients/client-alexa-for-business/src/commands/RejectSkillCommand.ts diff --git a/clients/client-alexa-for-business/commands/ResolveRoomCommand.ts b/clients/client-alexa-for-business/src/commands/ResolveRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/ResolveRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/ResolveRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/RevokeInvitationCommand.ts b/clients/client-alexa-for-business/src/commands/RevokeInvitationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/RevokeInvitationCommand.ts rename to clients/client-alexa-for-business/src/commands/RevokeInvitationCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchAddressBooksCommand.ts b/clients/client-alexa-for-business/src/commands/SearchAddressBooksCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchAddressBooksCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchAddressBooksCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchContactsCommand.ts b/clients/client-alexa-for-business/src/commands/SearchContactsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchContactsCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchContactsCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchDevicesCommand.ts b/clients/client-alexa-for-business/src/commands/SearchDevicesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchDevicesCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchDevicesCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchNetworkProfilesCommand.ts b/clients/client-alexa-for-business/src/commands/SearchNetworkProfilesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchNetworkProfilesCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchNetworkProfilesCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchProfilesCommand.ts b/clients/client-alexa-for-business/src/commands/SearchProfilesCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchProfilesCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchProfilesCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchRoomsCommand.ts b/clients/client-alexa-for-business/src/commands/SearchRoomsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchRoomsCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchRoomsCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchSkillGroupsCommand.ts b/clients/client-alexa-for-business/src/commands/SearchSkillGroupsCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchSkillGroupsCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchSkillGroupsCommand.ts diff --git a/clients/client-alexa-for-business/commands/SearchUsersCommand.ts b/clients/client-alexa-for-business/src/commands/SearchUsersCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SearchUsersCommand.ts rename to clients/client-alexa-for-business/src/commands/SearchUsersCommand.ts diff --git a/clients/client-alexa-for-business/commands/SendAnnouncementCommand.ts b/clients/client-alexa-for-business/src/commands/SendAnnouncementCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SendAnnouncementCommand.ts rename to clients/client-alexa-for-business/src/commands/SendAnnouncementCommand.ts diff --git a/clients/client-alexa-for-business/commands/SendInvitationCommand.ts b/clients/client-alexa-for-business/src/commands/SendInvitationCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/SendInvitationCommand.ts rename to clients/client-alexa-for-business/src/commands/SendInvitationCommand.ts diff --git a/clients/client-alexa-for-business/commands/StartDeviceSyncCommand.ts b/clients/client-alexa-for-business/src/commands/StartDeviceSyncCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/StartDeviceSyncCommand.ts rename to clients/client-alexa-for-business/src/commands/StartDeviceSyncCommand.ts diff --git a/clients/client-alexa-for-business/commands/StartSmartHomeApplianceDiscoveryCommand.ts b/clients/client-alexa-for-business/src/commands/StartSmartHomeApplianceDiscoveryCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/StartSmartHomeApplianceDiscoveryCommand.ts rename to clients/client-alexa-for-business/src/commands/StartSmartHomeApplianceDiscoveryCommand.ts diff --git a/clients/client-alexa-for-business/commands/TagResourceCommand.ts b/clients/client-alexa-for-business/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/TagResourceCommand.ts rename to clients/client-alexa-for-business/src/commands/TagResourceCommand.ts diff --git a/clients/client-alexa-for-business/commands/UntagResourceCommand.ts b/clients/client-alexa-for-business/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UntagResourceCommand.ts rename to clients/client-alexa-for-business/src/commands/UntagResourceCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateAddressBookCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateAddressBookCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateAddressBookCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateAddressBookCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateBusinessReportScheduleCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateBusinessReportScheduleCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateBusinessReportScheduleCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateBusinessReportScheduleCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateConferenceProviderCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateConferenceProviderCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateConferenceProviderCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateConferenceProviderCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateContactCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateContactCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateContactCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateContactCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateDeviceCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateDeviceCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateDeviceCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateDeviceCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateGatewayCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateGatewayCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateGatewayCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateGatewayCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateGatewayGroupCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateGatewayGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateGatewayGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateGatewayGroupCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateNetworkProfileCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateNetworkProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateNetworkProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateNetworkProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateProfileCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateProfileCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateProfileCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateProfileCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateRoomCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateRoomCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateRoomCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateRoomCommand.ts diff --git a/clients/client-alexa-for-business/commands/UpdateSkillGroupCommand.ts b/clients/client-alexa-for-business/src/commands/UpdateSkillGroupCommand.ts similarity index 100% rename from clients/client-alexa-for-business/commands/UpdateSkillGroupCommand.ts rename to clients/client-alexa-for-business/src/commands/UpdateSkillGroupCommand.ts diff --git a/clients/client-alexa-for-business/endpoints.ts b/clients/client-alexa-for-business/src/endpoints.ts similarity index 100% rename from clients/client-alexa-for-business/endpoints.ts rename to clients/client-alexa-for-business/src/endpoints.ts diff --git a/clients/client-alexa-for-business/index.ts b/clients/client-alexa-for-business/src/index.ts similarity index 100% rename from clients/client-alexa-for-business/index.ts rename to clients/client-alexa-for-business/src/index.ts diff --git a/clients/client-alexa-for-business/models/index.ts b/clients/client-alexa-for-business/src/models/index.ts similarity index 100% rename from clients/client-alexa-for-business/models/index.ts rename to clients/client-alexa-for-business/src/models/index.ts diff --git a/clients/client-alexa-for-business/models/models_0.ts b/clients/client-alexa-for-business/src/models/models_0.ts similarity index 100% rename from clients/client-alexa-for-business/models/models_0.ts rename to clients/client-alexa-for-business/src/models/models_0.ts diff --git a/clients/client-alexa-for-business/pagination/Interfaces.ts b/clients/client-alexa-for-business/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/Interfaces.ts rename to clients/client-alexa-for-business/src/pagination/Interfaces.ts diff --git a/clients/client-alexa-for-business/pagination/ListBusinessReportSchedulesPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListBusinessReportSchedulesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListBusinessReportSchedulesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListBusinessReportSchedulesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListConferenceProvidersPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListConferenceProvidersPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListConferenceProvidersPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListConferenceProvidersPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListDeviceEventsPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListDeviceEventsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListDeviceEventsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListDeviceEventsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListGatewayGroupsPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListGatewayGroupsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListGatewayGroupsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListGatewayGroupsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListGatewaysPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListGatewaysPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListGatewaysPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListGatewaysPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListSkillsPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListSkillsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListSkillsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListSkillsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListSkillsStoreCategoriesPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListSkillsStoreCategoriesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListSkillsStoreCategoriesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListSkillsStoreCategoriesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListSkillsStoreSkillsByCategoryPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListSmartHomeAppliancesPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListSmartHomeAppliancesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListSmartHomeAppliancesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListSmartHomeAppliancesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/ListTagsPaginator.ts b/clients/client-alexa-for-business/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/ListTagsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchAddressBooksPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchAddressBooksPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchAddressBooksPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchAddressBooksPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchContactsPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchContactsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchContactsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchContactsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchDevicesPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchDevicesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchDevicesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchDevicesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchNetworkProfilesPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchNetworkProfilesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchNetworkProfilesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchNetworkProfilesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchProfilesPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchProfilesPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchProfilesPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchProfilesPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchRoomsPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchRoomsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchRoomsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchRoomsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchSkillGroupsPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchSkillGroupsPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchSkillGroupsPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchSkillGroupsPaginator.ts diff --git a/clients/client-alexa-for-business/pagination/SearchUsersPaginator.ts b/clients/client-alexa-for-business/src/pagination/SearchUsersPaginator.ts similarity index 100% rename from clients/client-alexa-for-business/pagination/SearchUsersPaginator.ts rename to clients/client-alexa-for-business/src/pagination/SearchUsersPaginator.ts diff --git a/clients/client-alexa-for-business/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-alexa-for-business/protocols/Aws_json1_1.ts rename to clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts diff --git a/clients/client-alexa-for-business/src/runtimeConfig.browser.ts b/clients/client-alexa-for-business/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a17946957eae --- /dev/null +++ b/clients/client-alexa-for-business/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AlexaForBusinessClientConfig } from "./AlexaForBusinessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AlexaForBusinessClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-alexa-for-business/runtimeConfig.native.ts b/clients/client-alexa-for-business/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-alexa-for-business/runtimeConfig.native.ts rename to clients/client-alexa-for-business/src/runtimeConfig.native.ts diff --git a/clients/client-alexa-for-business/runtimeConfig.shared.ts b/clients/client-alexa-for-business/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-alexa-for-business/runtimeConfig.shared.ts rename to clients/client-alexa-for-business/src/runtimeConfig.shared.ts diff --git a/clients/client-alexa-for-business/src/runtimeConfig.ts b/clients/client-alexa-for-business/src/runtimeConfig.ts new file mode 100644 index 000000000000..ad3d9e20e9f9 --- /dev/null +++ b/clients/client-alexa-for-business/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AlexaForBusinessClientConfig } from "./AlexaForBusinessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AlexaForBusinessClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-alexa-for-business/tsconfig.es.json b/clients/client-alexa-for-business/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-alexa-for-business/tsconfig.es.json +++ b/clients/client-alexa-for-business/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-alexa-for-business/tsconfig.json b/clients/client-alexa-for-business/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-alexa-for-business/tsconfig.json +++ b/clients/client-alexa-for-business/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-alexa-for-business/tsconfig.types.json b/clients/client-alexa-for-business/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-alexa-for-business/tsconfig.types.json +++ b/clients/client-alexa-for-business/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-amp/.gitignore b/clients/client-amp/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-amp/.gitignore +++ b/clients/client-amp/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-amp/package.json b/clients/client-amp/package.json index 1254fbfd6e76..32f928355853 100644 --- a/clients/client-amp/package.json +++ b/clients/client-amp/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-amp", "repository": { "type": "git", diff --git a/clients/client-amp/runtimeConfig.browser.ts b/clients/client-amp/runtimeConfig.browser.ts deleted file mode 100644 index 0ec674019e57..000000000000 --- a/clients/client-amp/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AmpClientConfig } from "./AmpClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmpClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amp/runtimeConfig.ts b/clients/client-amp/runtimeConfig.ts deleted file mode 100644 index 1511516e9bae..000000000000 --- a/clients/client-amp/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AmpClientConfig } from "./AmpClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmpClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amp/Amp.ts b/clients/client-amp/src/Amp.ts similarity index 100% rename from clients/client-amp/Amp.ts rename to clients/client-amp/src/Amp.ts diff --git a/clients/client-amp/AmpClient.ts b/clients/client-amp/src/AmpClient.ts similarity index 100% rename from clients/client-amp/AmpClient.ts rename to clients/client-amp/src/AmpClient.ts diff --git a/clients/client-amp/commands/CreateWorkspaceCommand.ts b/clients/client-amp/src/commands/CreateWorkspaceCommand.ts similarity index 100% rename from clients/client-amp/commands/CreateWorkspaceCommand.ts rename to clients/client-amp/src/commands/CreateWorkspaceCommand.ts diff --git a/clients/client-amp/commands/DeleteWorkspaceCommand.ts b/clients/client-amp/src/commands/DeleteWorkspaceCommand.ts similarity index 100% rename from clients/client-amp/commands/DeleteWorkspaceCommand.ts rename to clients/client-amp/src/commands/DeleteWorkspaceCommand.ts diff --git a/clients/client-amp/commands/DescribeWorkspaceCommand.ts b/clients/client-amp/src/commands/DescribeWorkspaceCommand.ts similarity index 100% rename from clients/client-amp/commands/DescribeWorkspaceCommand.ts rename to clients/client-amp/src/commands/DescribeWorkspaceCommand.ts diff --git a/clients/client-amp/commands/ListTagsForResourceCommand.ts b/clients/client-amp/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-amp/commands/ListTagsForResourceCommand.ts rename to clients/client-amp/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-amp/commands/ListWorkspacesCommand.ts b/clients/client-amp/src/commands/ListWorkspacesCommand.ts similarity index 100% rename from clients/client-amp/commands/ListWorkspacesCommand.ts rename to clients/client-amp/src/commands/ListWorkspacesCommand.ts diff --git a/clients/client-amp/commands/TagResourceCommand.ts b/clients/client-amp/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-amp/commands/TagResourceCommand.ts rename to clients/client-amp/src/commands/TagResourceCommand.ts diff --git a/clients/client-amp/commands/UntagResourceCommand.ts b/clients/client-amp/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-amp/commands/UntagResourceCommand.ts rename to clients/client-amp/src/commands/UntagResourceCommand.ts diff --git a/clients/client-amp/commands/UpdateWorkspaceAliasCommand.ts b/clients/client-amp/src/commands/UpdateWorkspaceAliasCommand.ts similarity index 100% rename from clients/client-amp/commands/UpdateWorkspaceAliasCommand.ts rename to clients/client-amp/src/commands/UpdateWorkspaceAliasCommand.ts diff --git a/clients/client-amp/endpoints.ts b/clients/client-amp/src/endpoints.ts similarity index 100% rename from clients/client-amp/endpoints.ts rename to clients/client-amp/src/endpoints.ts diff --git a/clients/client-amp/index.ts b/clients/client-amp/src/index.ts similarity index 100% rename from clients/client-amp/index.ts rename to clients/client-amp/src/index.ts diff --git a/clients/client-amp/models/index.ts b/clients/client-amp/src/models/index.ts similarity index 100% rename from clients/client-amp/models/index.ts rename to clients/client-amp/src/models/index.ts diff --git a/clients/client-amp/models/models_0.ts b/clients/client-amp/src/models/models_0.ts similarity index 100% rename from clients/client-amp/models/models_0.ts rename to clients/client-amp/src/models/models_0.ts diff --git a/clients/client-amp/pagination/Interfaces.ts b/clients/client-amp/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-amp/pagination/Interfaces.ts rename to clients/client-amp/src/pagination/Interfaces.ts diff --git a/clients/client-amp/pagination/ListWorkspacesPaginator.ts b/clients/client-amp/src/pagination/ListWorkspacesPaginator.ts similarity index 100% rename from clients/client-amp/pagination/ListWorkspacesPaginator.ts rename to clients/client-amp/src/pagination/ListWorkspacesPaginator.ts diff --git a/clients/client-amp/protocols/Aws_restJson1.ts b/clients/client-amp/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-amp/protocols/Aws_restJson1.ts rename to clients/client-amp/src/protocols/Aws_restJson1.ts diff --git a/clients/client-amp/src/runtimeConfig.browser.ts b/clients/client-amp/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3257d531fe4e --- /dev/null +++ b/clients/client-amp/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AmpClientConfig } from "./AmpClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmpClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amp/runtimeConfig.native.ts b/clients/client-amp/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-amp/runtimeConfig.native.ts rename to clients/client-amp/src/runtimeConfig.native.ts diff --git a/clients/client-amp/runtimeConfig.shared.ts b/clients/client-amp/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-amp/runtimeConfig.shared.ts rename to clients/client-amp/src/runtimeConfig.shared.ts diff --git a/clients/client-amp/src/runtimeConfig.ts b/clients/client-amp/src/runtimeConfig.ts new file mode 100644 index 000000000000..b8fed8c62b21 --- /dev/null +++ b/clients/client-amp/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AmpClientConfig } from "./AmpClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmpClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amp/tsconfig.es.json b/clients/client-amp/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-amp/tsconfig.es.json +++ b/clients/client-amp/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-amp/tsconfig.json b/clients/client-amp/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-amp/tsconfig.json +++ b/clients/client-amp/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-amp/tsconfig.types.json b/clients/client-amp/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-amp/tsconfig.types.json +++ b/clients/client-amp/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-amplify/.gitignore b/clients/client-amplify/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-amplify/.gitignore +++ b/clients/client-amplify/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-amplify/package.json b/clients/client-amplify/package.json index e7b2a0bcfa72..64ac7a9a5f73 100644 --- a/clients/client-amplify/package.json +++ b/clients/client-amplify/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-amplify", "repository": { "type": "git", diff --git a/clients/client-amplify/runtimeConfig.browser.ts b/clients/client-amplify/runtimeConfig.browser.ts deleted file mode 100644 index bf9a3c24c07f..000000000000 --- a/clients/client-amplify/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AmplifyClientConfig } from "./AmplifyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmplifyClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amplify/runtimeConfig.ts b/clients/client-amplify/runtimeConfig.ts deleted file mode 100644 index cab2b9d2a2cc..000000000000 --- a/clients/client-amplify/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AmplifyClientConfig } from "./AmplifyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmplifyClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amplify/Amplify.ts b/clients/client-amplify/src/Amplify.ts similarity index 100% rename from clients/client-amplify/Amplify.ts rename to clients/client-amplify/src/Amplify.ts diff --git a/clients/client-amplify/AmplifyClient.ts b/clients/client-amplify/src/AmplifyClient.ts similarity index 100% rename from clients/client-amplify/AmplifyClient.ts rename to clients/client-amplify/src/AmplifyClient.ts diff --git a/clients/client-amplify/commands/CreateAppCommand.ts b/clients/client-amplify/src/commands/CreateAppCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateAppCommand.ts rename to clients/client-amplify/src/commands/CreateAppCommand.ts diff --git a/clients/client-amplify/commands/CreateBackendEnvironmentCommand.ts b/clients/client-amplify/src/commands/CreateBackendEnvironmentCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateBackendEnvironmentCommand.ts rename to clients/client-amplify/src/commands/CreateBackendEnvironmentCommand.ts diff --git a/clients/client-amplify/commands/CreateBranchCommand.ts b/clients/client-amplify/src/commands/CreateBranchCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateBranchCommand.ts rename to clients/client-amplify/src/commands/CreateBranchCommand.ts diff --git a/clients/client-amplify/commands/CreateDeploymentCommand.ts b/clients/client-amplify/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateDeploymentCommand.ts rename to clients/client-amplify/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-amplify/commands/CreateDomainAssociationCommand.ts b/clients/client-amplify/src/commands/CreateDomainAssociationCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateDomainAssociationCommand.ts rename to clients/client-amplify/src/commands/CreateDomainAssociationCommand.ts diff --git a/clients/client-amplify/commands/CreateWebhookCommand.ts b/clients/client-amplify/src/commands/CreateWebhookCommand.ts similarity index 100% rename from clients/client-amplify/commands/CreateWebhookCommand.ts rename to clients/client-amplify/src/commands/CreateWebhookCommand.ts diff --git a/clients/client-amplify/commands/DeleteAppCommand.ts b/clients/client-amplify/src/commands/DeleteAppCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteAppCommand.ts rename to clients/client-amplify/src/commands/DeleteAppCommand.ts diff --git a/clients/client-amplify/commands/DeleteBackendEnvironmentCommand.ts b/clients/client-amplify/src/commands/DeleteBackendEnvironmentCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteBackendEnvironmentCommand.ts rename to clients/client-amplify/src/commands/DeleteBackendEnvironmentCommand.ts diff --git a/clients/client-amplify/commands/DeleteBranchCommand.ts b/clients/client-amplify/src/commands/DeleteBranchCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteBranchCommand.ts rename to clients/client-amplify/src/commands/DeleteBranchCommand.ts diff --git a/clients/client-amplify/commands/DeleteDomainAssociationCommand.ts b/clients/client-amplify/src/commands/DeleteDomainAssociationCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteDomainAssociationCommand.ts rename to clients/client-amplify/src/commands/DeleteDomainAssociationCommand.ts diff --git a/clients/client-amplify/commands/DeleteJobCommand.ts b/clients/client-amplify/src/commands/DeleteJobCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteJobCommand.ts rename to clients/client-amplify/src/commands/DeleteJobCommand.ts diff --git a/clients/client-amplify/commands/DeleteWebhookCommand.ts b/clients/client-amplify/src/commands/DeleteWebhookCommand.ts similarity index 100% rename from clients/client-amplify/commands/DeleteWebhookCommand.ts rename to clients/client-amplify/src/commands/DeleteWebhookCommand.ts diff --git a/clients/client-amplify/commands/GenerateAccessLogsCommand.ts b/clients/client-amplify/src/commands/GenerateAccessLogsCommand.ts similarity index 100% rename from clients/client-amplify/commands/GenerateAccessLogsCommand.ts rename to clients/client-amplify/src/commands/GenerateAccessLogsCommand.ts diff --git a/clients/client-amplify/commands/GetAppCommand.ts b/clients/client-amplify/src/commands/GetAppCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetAppCommand.ts rename to clients/client-amplify/src/commands/GetAppCommand.ts diff --git a/clients/client-amplify/commands/GetArtifactUrlCommand.ts b/clients/client-amplify/src/commands/GetArtifactUrlCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetArtifactUrlCommand.ts rename to clients/client-amplify/src/commands/GetArtifactUrlCommand.ts diff --git a/clients/client-amplify/commands/GetBackendEnvironmentCommand.ts b/clients/client-amplify/src/commands/GetBackendEnvironmentCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetBackendEnvironmentCommand.ts rename to clients/client-amplify/src/commands/GetBackendEnvironmentCommand.ts diff --git a/clients/client-amplify/commands/GetBranchCommand.ts b/clients/client-amplify/src/commands/GetBranchCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetBranchCommand.ts rename to clients/client-amplify/src/commands/GetBranchCommand.ts diff --git a/clients/client-amplify/commands/GetDomainAssociationCommand.ts b/clients/client-amplify/src/commands/GetDomainAssociationCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetDomainAssociationCommand.ts rename to clients/client-amplify/src/commands/GetDomainAssociationCommand.ts diff --git a/clients/client-amplify/commands/GetJobCommand.ts b/clients/client-amplify/src/commands/GetJobCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetJobCommand.ts rename to clients/client-amplify/src/commands/GetJobCommand.ts diff --git a/clients/client-amplify/commands/GetWebhookCommand.ts b/clients/client-amplify/src/commands/GetWebhookCommand.ts similarity index 100% rename from clients/client-amplify/commands/GetWebhookCommand.ts rename to clients/client-amplify/src/commands/GetWebhookCommand.ts diff --git a/clients/client-amplify/commands/ListAppsCommand.ts b/clients/client-amplify/src/commands/ListAppsCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListAppsCommand.ts rename to clients/client-amplify/src/commands/ListAppsCommand.ts diff --git a/clients/client-amplify/commands/ListArtifactsCommand.ts b/clients/client-amplify/src/commands/ListArtifactsCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListArtifactsCommand.ts rename to clients/client-amplify/src/commands/ListArtifactsCommand.ts diff --git a/clients/client-amplify/commands/ListBackendEnvironmentsCommand.ts b/clients/client-amplify/src/commands/ListBackendEnvironmentsCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListBackendEnvironmentsCommand.ts rename to clients/client-amplify/src/commands/ListBackendEnvironmentsCommand.ts diff --git a/clients/client-amplify/commands/ListBranchesCommand.ts b/clients/client-amplify/src/commands/ListBranchesCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListBranchesCommand.ts rename to clients/client-amplify/src/commands/ListBranchesCommand.ts diff --git a/clients/client-amplify/commands/ListDomainAssociationsCommand.ts b/clients/client-amplify/src/commands/ListDomainAssociationsCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListDomainAssociationsCommand.ts rename to clients/client-amplify/src/commands/ListDomainAssociationsCommand.ts diff --git a/clients/client-amplify/commands/ListJobsCommand.ts b/clients/client-amplify/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListJobsCommand.ts rename to clients/client-amplify/src/commands/ListJobsCommand.ts diff --git a/clients/client-amplify/commands/ListTagsForResourceCommand.ts b/clients/client-amplify/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListTagsForResourceCommand.ts rename to clients/client-amplify/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-amplify/commands/ListWebhooksCommand.ts b/clients/client-amplify/src/commands/ListWebhooksCommand.ts similarity index 100% rename from clients/client-amplify/commands/ListWebhooksCommand.ts rename to clients/client-amplify/src/commands/ListWebhooksCommand.ts diff --git a/clients/client-amplify/commands/StartDeploymentCommand.ts b/clients/client-amplify/src/commands/StartDeploymentCommand.ts similarity index 100% rename from clients/client-amplify/commands/StartDeploymentCommand.ts rename to clients/client-amplify/src/commands/StartDeploymentCommand.ts diff --git a/clients/client-amplify/commands/StartJobCommand.ts b/clients/client-amplify/src/commands/StartJobCommand.ts similarity index 100% rename from clients/client-amplify/commands/StartJobCommand.ts rename to clients/client-amplify/src/commands/StartJobCommand.ts diff --git a/clients/client-amplify/commands/StopJobCommand.ts b/clients/client-amplify/src/commands/StopJobCommand.ts similarity index 100% rename from clients/client-amplify/commands/StopJobCommand.ts rename to clients/client-amplify/src/commands/StopJobCommand.ts diff --git a/clients/client-amplify/commands/TagResourceCommand.ts b/clients/client-amplify/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-amplify/commands/TagResourceCommand.ts rename to clients/client-amplify/src/commands/TagResourceCommand.ts diff --git a/clients/client-amplify/commands/UntagResourceCommand.ts b/clients/client-amplify/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-amplify/commands/UntagResourceCommand.ts rename to clients/client-amplify/src/commands/UntagResourceCommand.ts diff --git a/clients/client-amplify/commands/UpdateAppCommand.ts b/clients/client-amplify/src/commands/UpdateAppCommand.ts similarity index 100% rename from clients/client-amplify/commands/UpdateAppCommand.ts rename to clients/client-amplify/src/commands/UpdateAppCommand.ts diff --git a/clients/client-amplify/commands/UpdateBranchCommand.ts b/clients/client-amplify/src/commands/UpdateBranchCommand.ts similarity index 100% rename from clients/client-amplify/commands/UpdateBranchCommand.ts rename to clients/client-amplify/src/commands/UpdateBranchCommand.ts diff --git a/clients/client-amplify/commands/UpdateDomainAssociationCommand.ts b/clients/client-amplify/src/commands/UpdateDomainAssociationCommand.ts similarity index 100% rename from clients/client-amplify/commands/UpdateDomainAssociationCommand.ts rename to clients/client-amplify/src/commands/UpdateDomainAssociationCommand.ts diff --git a/clients/client-amplify/commands/UpdateWebhookCommand.ts b/clients/client-amplify/src/commands/UpdateWebhookCommand.ts similarity index 100% rename from clients/client-amplify/commands/UpdateWebhookCommand.ts rename to clients/client-amplify/src/commands/UpdateWebhookCommand.ts diff --git a/clients/client-amplify/endpoints.ts b/clients/client-amplify/src/endpoints.ts similarity index 100% rename from clients/client-amplify/endpoints.ts rename to clients/client-amplify/src/endpoints.ts diff --git a/clients/client-amplify/index.ts b/clients/client-amplify/src/index.ts similarity index 100% rename from clients/client-amplify/index.ts rename to clients/client-amplify/src/index.ts diff --git a/clients/client-amplify/models/index.ts b/clients/client-amplify/src/models/index.ts similarity index 100% rename from clients/client-amplify/models/index.ts rename to clients/client-amplify/src/models/index.ts diff --git a/clients/client-amplify/models/models_0.ts b/clients/client-amplify/src/models/models_0.ts similarity index 100% rename from clients/client-amplify/models/models_0.ts rename to clients/client-amplify/src/models/models_0.ts diff --git a/clients/client-amplify/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-amplify/protocols/Aws_restJson1.ts rename to clients/client-amplify/src/protocols/Aws_restJson1.ts diff --git a/clients/client-amplify/src/runtimeConfig.browser.ts b/clients/client-amplify/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6db48afc5f6d --- /dev/null +++ b/clients/client-amplify/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AmplifyClientConfig } from "./AmplifyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmplifyClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amplify/runtimeConfig.native.ts b/clients/client-amplify/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-amplify/runtimeConfig.native.ts rename to clients/client-amplify/src/runtimeConfig.native.ts diff --git a/clients/client-amplify/runtimeConfig.shared.ts b/clients/client-amplify/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-amplify/runtimeConfig.shared.ts rename to clients/client-amplify/src/runtimeConfig.shared.ts diff --git a/clients/client-amplify/src/runtimeConfig.ts b/clients/client-amplify/src/runtimeConfig.ts new file mode 100644 index 000000000000..1d240e6582e7 --- /dev/null +++ b/clients/client-amplify/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AmplifyClientConfig } from "./AmplifyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmplifyClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amplify/tsconfig.es.json b/clients/client-amplify/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-amplify/tsconfig.es.json +++ b/clients/client-amplify/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-amplify/tsconfig.json b/clients/client-amplify/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-amplify/tsconfig.json +++ b/clients/client-amplify/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-amplify/tsconfig.types.json b/clients/client-amplify/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-amplify/tsconfig.types.json +++ b/clients/client-amplify/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-amplifybackend/.gitignore b/clients/client-amplifybackend/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-amplifybackend/.gitignore +++ b/clients/client-amplifybackend/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-amplifybackend/package.json b/clients/client-amplifybackend/package.json index 77cd68fa06dc..ac0415da9184 100644 --- a/clients/client-amplifybackend/package.json +++ b/clients/client-amplifybackend/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-amplifybackend", "repository": { "type": "git", diff --git a/clients/client-amplifybackend/runtimeConfig.browser.ts b/clients/client-amplifybackend/runtimeConfig.browser.ts deleted file mode 100644 index c83cd06a17d3..000000000000 --- a/clients/client-amplifybackend/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AmplifyBackendClientConfig } from "./AmplifyBackendClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amplifybackend/runtimeConfig.ts b/clients/client-amplifybackend/runtimeConfig.ts deleted file mode 100644 index 478b5aa7cafe..000000000000 --- a/clients/client-amplifybackend/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AmplifyBackendClientConfig } from "./AmplifyBackendClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-amplifybackend/AmplifyBackend.ts b/clients/client-amplifybackend/src/AmplifyBackend.ts similarity index 100% rename from clients/client-amplifybackend/AmplifyBackend.ts rename to clients/client-amplifybackend/src/AmplifyBackend.ts diff --git a/clients/client-amplifybackend/AmplifyBackendClient.ts b/clients/client-amplifybackend/src/AmplifyBackendClient.ts similarity index 100% rename from clients/client-amplifybackend/AmplifyBackendClient.ts rename to clients/client-amplifybackend/src/AmplifyBackendClient.ts diff --git a/clients/client-amplifybackend/commands/CloneBackendCommand.ts b/clients/client-amplifybackend/src/commands/CloneBackendCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CloneBackendCommand.ts rename to clients/client-amplifybackend/src/commands/CloneBackendCommand.ts diff --git a/clients/client-amplifybackend/commands/CreateBackendAPICommand.ts b/clients/client-amplifybackend/src/commands/CreateBackendAPICommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CreateBackendAPICommand.ts rename to clients/client-amplifybackend/src/commands/CreateBackendAPICommand.ts diff --git a/clients/client-amplifybackend/commands/CreateBackendAuthCommand.ts b/clients/client-amplifybackend/src/commands/CreateBackendAuthCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CreateBackendAuthCommand.ts rename to clients/client-amplifybackend/src/commands/CreateBackendAuthCommand.ts diff --git a/clients/client-amplifybackend/commands/CreateBackendCommand.ts b/clients/client-amplifybackend/src/commands/CreateBackendCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CreateBackendCommand.ts rename to clients/client-amplifybackend/src/commands/CreateBackendCommand.ts diff --git a/clients/client-amplifybackend/commands/CreateBackendConfigCommand.ts b/clients/client-amplifybackend/src/commands/CreateBackendConfigCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CreateBackendConfigCommand.ts rename to clients/client-amplifybackend/src/commands/CreateBackendConfigCommand.ts diff --git a/clients/client-amplifybackend/commands/CreateTokenCommand.ts b/clients/client-amplifybackend/src/commands/CreateTokenCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/CreateTokenCommand.ts rename to clients/client-amplifybackend/src/commands/CreateTokenCommand.ts diff --git a/clients/client-amplifybackend/commands/DeleteBackendAPICommand.ts b/clients/client-amplifybackend/src/commands/DeleteBackendAPICommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/DeleteBackendAPICommand.ts rename to clients/client-amplifybackend/src/commands/DeleteBackendAPICommand.ts diff --git a/clients/client-amplifybackend/commands/DeleteBackendAuthCommand.ts b/clients/client-amplifybackend/src/commands/DeleteBackendAuthCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/DeleteBackendAuthCommand.ts rename to clients/client-amplifybackend/src/commands/DeleteBackendAuthCommand.ts diff --git a/clients/client-amplifybackend/commands/DeleteBackendCommand.ts b/clients/client-amplifybackend/src/commands/DeleteBackendCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/DeleteBackendCommand.ts rename to clients/client-amplifybackend/src/commands/DeleteBackendCommand.ts diff --git a/clients/client-amplifybackend/commands/DeleteTokenCommand.ts b/clients/client-amplifybackend/src/commands/DeleteTokenCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/DeleteTokenCommand.ts rename to clients/client-amplifybackend/src/commands/DeleteTokenCommand.ts diff --git a/clients/client-amplifybackend/commands/GenerateBackendAPIModelsCommand.ts b/clients/client-amplifybackend/src/commands/GenerateBackendAPIModelsCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GenerateBackendAPIModelsCommand.ts rename to clients/client-amplifybackend/src/commands/GenerateBackendAPIModelsCommand.ts diff --git a/clients/client-amplifybackend/commands/GetBackendAPICommand.ts b/clients/client-amplifybackend/src/commands/GetBackendAPICommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetBackendAPICommand.ts rename to clients/client-amplifybackend/src/commands/GetBackendAPICommand.ts diff --git a/clients/client-amplifybackend/commands/GetBackendAPIModelsCommand.ts b/clients/client-amplifybackend/src/commands/GetBackendAPIModelsCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetBackendAPIModelsCommand.ts rename to clients/client-amplifybackend/src/commands/GetBackendAPIModelsCommand.ts diff --git a/clients/client-amplifybackend/commands/GetBackendAuthCommand.ts b/clients/client-amplifybackend/src/commands/GetBackendAuthCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetBackendAuthCommand.ts rename to clients/client-amplifybackend/src/commands/GetBackendAuthCommand.ts diff --git a/clients/client-amplifybackend/commands/GetBackendCommand.ts b/clients/client-amplifybackend/src/commands/GetBackendCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetBackendCommand.ts rename to clients/client-amplifybackend/src/commands/GetBackendCommand.ts diff --git a/clients/client-amplifybackend/commands/GetBackendJobCommand.ts b/clients/client-amplifybackend/src/commands/GetBackendJobCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetBackendJobCommand.ts rename to clients/client-amplifybackend/src/commands/GetBackendJobCommand.ts diff --git a/clients/client-amplifybackend/commands/GetTokenCommand.ts b/clients/client-amplifybackend/src/commands/GetTokenCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/GetTokenCommand.ts rename to clients/client-amplifybackend/src/commands/GetTokenCommand.ts diff --git a/clients/client-amplifybackend/commands/ImportBackendAuthCommand.ts b/clients/client-amplifybackend/src/commands/ImportBackendAuthCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/ImportBackendAuthCommand.ts rename to clients/client-amplifybackend/src/commands/ImportBackendAuthCommand.ts diff --git a/clients/client-amplifybackend/commands/ListBackendJobsCommand.ts b/clients/client-amplifybackend/src/commands/ListBackendJobsCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/ListBackendJobsCommand.ts rename to clients/client-amplifybackend/src/commands/ListBackendJobsCommand.ts diff --git a/clients/client-amplifybackend/commands/RemoveAllBackendsCommand.ts b/clients/client-amplifybackend/src/commands/RemoveAllBackendsCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/RemoveAllBackendsCommand.ts rename to clients/client-amplifybackend/src/commands/RemoveAllBackendsCommand.ts diff --git a/clients/client-amplifybackend/commands/RemoveBackendConfigCommand.ts b/clients/client-amplifybackend/src/commands/RemoveBackendConfigCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/RemoveBackendConfigCommand.ts rename to clients/client-amplifybackend/src/commands/RemoveBackendConfigCommand.ts diff --git a/clients/client-amplifybackend/commands/UpdateBackendAPICommand.ts b/clients/client-amplifybackend/src/commands/UpdateBackendAPICommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/UpdateBackendAPICommand.ts rename to clients/client-amplifybackend/src/commands/UpdateBackendAPICommand.ts diff --git a/clients/client-amplifybackend/commands/UpdateBackendAuthCommand.ts b/clients/client-amplifybackend/src/commands/UpdateBackendAuthCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/UpdateBackendAuthCommand.ts rename to clients/client-amplifybackend/src/commands/UpdateBackendAuthCommand.ts diff --git a/clients/client-amplifybackend/commands/UpdateBackendConfigCommand.ts b/clients/client-amplifybackend/src/commands/UpdateBackendConfigCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/UpdateBackendConfigCommand.ts rename to clients/client-amplifybackend/src/commands/UpdateBackendConfigCommand.ts diff --git a/clients/client-amplifybackend/commands/UpdateBackendJobCommand.ts b/clients/client-amplifybackend/src/commands/UpdateBackendJobCommand.ts similarity index 100% rename from clients/client-amplifybackend/commands/UpdateBackendJobCommand.ts rename to clients/client-amplifybackend/src/commands/UpdateBackendJobCommand.ts diff --git a/clients/client-amplifybackend/endpoints.ts b/clients/client-amplifybackend/src/endpoints.ts similarity index 100% rename from clients/client-amplifybackend/endpoints.ts rename to clients/client-amplifybackend/src/endpoints.ts diff --git a/clients/client-amplifybackend/index.ts b/clients/client-amplifybackend/src/index.ts similarity index 100% rename from clients/client-amplifybackend/index.ts rename to clients/client-amplifybackend/src/index.ts diff --git a/clients/client-amplifybackend/models/index.ts b/clients/client-amplifybackend/src/models/index.ts similarity index 100% rename from clients/client-amplifybackend/models/index.ts rename to clients/client-amplifybackend/src/models/index.ts diff --git a/clients/client-amplifybackend/models/models_0.ts b/clients/client-amplifybackend/src/models/models_0.ts similarity index 100% rename from clients/client-amplifybackend/models/models_0.ts rename to clients/client-amplifybackend/src/models/models_0.ts diff --git a/clients/client-amplifybackend/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-amplifybackend/protocols/Aws_restJson1.ts rename to clients/client-amplifybackend/src/protocols/Aws_restJson1.ts diff --git a/clients/client-amplifybackend/src/runtimeConfig.browser.ts b/clients/client-amplifybackend/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6835236e3850 --- /dev/null +++ b/clients/client-amplifybackend/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AmplifyBackendClientConfig } from "./AmplifyBackendClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amplifybackend/runtimeConfig.native.ts b/clients/client-amplifybackend/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-amplifybackend/runtimeConfig.native.ts rename to clients/client-amplifybackend/src/runtimeConfig.native.ts diff --git a/clients/client-amplifybackend/runtimeConfig.shared.ts b/clients/client-amplifybackend/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-amplifybackend/runtimeConfig.shared.ts rename to clients/client-amplifybackend/src/runtimeConfig.shared.ts diff --git a/clients/client-amplifybackend/src/runtimeConfig.ts b/clients/client-amplifybackend/src/runtimeConfig.ts new file mode 100644 index 000000000000..4aa7f807ed63 --- /dev/null +++ b/clients/client-amplifybackend/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AmplifyBackendClientConfig } from "./AmplifyBackendClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-amplifybackend/tsconfig.es.json b/clients/client-amplifybackend/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-amplifybackend/tsconfig.es.json +++ b/clients/client-amplifybackend/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-amplifybackend/tsconfig.json b/clients/client-amplifybackend/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-amplifybackend/tsconfig.json +++ b/clients/client-amplifybackend/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-amplifybackend/tsconfig.types.json b/clients/client-amplifybackend/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-amplifybackend/tsconfig.types.json +++ b/clients/client-amplifybackend/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-api-gateway/.gitignore b/clients/client-api-gateway/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-api-gateway/.gitignore +++ b/clients/client-api-gateway/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-api-gateway/package.json b/clients/client-api-gateway/package.json index 79da6da2d1f8..b9f96568c8ec 100644 --- a/clients/client-api-gateway/package.json +++ b/clients/client-api-gateway/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-api-gateway", "repository": { "type": "git", diff --git a/clients/client-api-gateway/runtimeConfig.browser.ts b/clients/client-api-gateway/runtimeConfig.browser.ts deleted file mode 100644 index b6273e005050..000000000000 --- a/clients/client-api-gateway/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { APIGatewayClientConfig } from "./APIGatewayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: APIGatewayClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-api-gateway/runtimeConfig.ts b/clients/client-api-gateway/runtimeConfig.ts deleted file mode 100644 index f409207d4617..000000000000 --- a/clients/client-api-gateway/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { APIGatewayClientConfig } from "./APIGatewayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: APIGatewayClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-api-gateway/APIGateway.ts b/clients/client-api-gateway/src/APIGateway.ts similarity index 100% rename from clients/client-api-gateway/APIGateway.ts rename to clients/client-api-gateway/src/APIGateway.ts diff --git a/clients/client-api-gateway/APIGatewayClient.ts b/clients/client-api-gateway/src/APIGatewayClient.ts similarity index 100% rename from clients/client-api-gateway/APIGatewayClient.ts rename to clients/client-api-gateway/src/APIGatewayClient.ts diff --git a/clients/client-api-gateway/commands/CreateApiKeyCommand.ts b/clients/client-api-gateway/src/commands/CreateApiKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateApiKeyCommand.ts rename to clients/client-api-gateway/src/commands/CreateApiKeyCommand.ts diff --git a/clients/client-api-gateway/commands/CreateAuthorizerCommand.ts b/clients/client-api-gateway/src/commands/CreateAuthorizerCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateAuthorizerCommand.ts rename to clients/client-api-gateway/src/commands/CreateAuthorizerCommand.ts diff --git a/clients/client-api-gateway/commands/CreateBasePathMappingCommand.ts b/clients/client-api-gateway/src/commands/CreateBasePathMappingCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateBasePathMappingCommand.ts rename to clients/client-api-gateway/src/commands/CreateBasePathMappingCommand.ts diff --git a/clients/client-api-gateway/commands/CreateDeploymentCommand.ts b/clients/client-api-gateway/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateDeploymentCommand.ts rename to clients/client-api-gateway/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-api-gateway/commands/CreateDocumentationPartCommand.ts b/clients/client-api-gateway/src/commands/CreateDocumentationPartCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateDocumentationPartCommand.ts rename to clients/client-api-gateway/src/commands/CreateDocumentationPartCommand.ts diff --git a/clients/client-api-gateway/commands/CreateDocumentationVersionCommand.ts b/clients/client-api-gateway/src/commands/CreateDocumentationVersionCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateDocumentationVersionCommand.ts rename to clients/client-api-gateway/src/commands/CreateDocumentationVersionCommand.ts diff --git a/clients/client-api-gateway/commands/CreateDomainNameCommand.ts b/clients/client-api-gateway/src/commands/CreateDomainNameCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateDomainNameCommand.ts rename to clients/client-api-gateway/src/commands/CreateDomainNameCommand.ts diff --git a/clients/client-api-gateway/commands/CreateModelCommand.ts b/clients/client-api-gateway/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateModelCommand.ts rename to clients/client-api-gateway/src/commands/CreateModelCommand.ts diff --git a/clients/client-api-gateway/commands/CreateRequestValidatorCommand.ts b/clients/client-api-gateway/src/commands/CreateRequestValidatorCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateRequestValidatorCommand.ts rename to clients/client-api-gateway/src/commands/CreateRequestValidatorCommand.ts diff --git a/clients/client-api-gateway/commands/CreateResourceCommand.ts b/clients/client-api-gateway/src/commands/CreateResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateResourceCommand.ts rename to clients/client-api-gateway/src/commands/CreateResourceCommand.ts diff --git a/clients/client-api-gateway/commands/CreateRestApiCommand.ts b/clients/client-api-gateway/src/commands/CreateRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateRestApiCommand.ts rename to clients/client-api-gateway/src/commands/CreateRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/CreateStageCommand.ts b/clients/client-api-gateway/src/commands/CreateStageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateStageCommand.ts rename to clients/client-api-gateway/src/commands/CreateStageCommand.ts diff --git a/clients/client-api-gateway/commands/CreateUsagePlanCommand.ts b/clients/client-api-gateway/src/commands/CreateUsagePlanCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateUsagePlanCommand.ts rename to clients/client-api-gateway/src/commands/CreateUsagePlanCommand.ts diff --git a/clients/client-api-gateway/commands/CreateUsagePlanKeyCommand.ts b/clients/client-api-gateway/src/commands/CreateUsagePlanKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateUsagePlanKeyCommand.ts rename to clients/client-api-gateway/src/commands/CreateUsagePlanKeyCommand.ts diff --git a/clients/client-api-gateway/commands/CreateVpcLinkCommand.ts b/clients/client-api-gateway/src/commands/CreateVpcLinkCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/CreateVpcLinkCommand.ts rename to clients/client-api-gateway/src/commands/CreateVpcLinkCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteApiKeyCommand.ts b/clients/client-api-gateway/src/commands/DeleteApiKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteApiKeyCommand.ts rename to clients/client-api-gateway/src/commands/DeleteApiKeyCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteAuthorizerCommand.ts b/clients/client-api-gateway/src/commands/DeleteAuthorizerCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteAuthorizerCommand.ts rename to clients/client-api-gateway/src/commands/DeleteAuthorizerCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteBasePathMappingCommand.ts b/clients/client-api-gateway/src/commands/DeleteBasePathMappingCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteBasePathMappingCommand.ts rename to clients/client-api-gateway/src/commands/DeleteBasePathMappingCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteClientCertificateCommand.ts b/clients/client-api-gateway/src/commands/DeleteClientCertificateCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteClientCertificateCommand.ts rename to clients/client-api-gateway/src/commands/DeleteClientCertificateCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteDeploymentCommand.ts b/clients/client-api-gateway/src/commands/DeleteDeploymentCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteDeploymentCommand.ts rename to clients/client-api-gateway/src/commands/DeleteDeploymentCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteDocumentationPartCommand.ts b/clients/client-api-gateway/src/commands/DeleteDocumentationPartCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteDocumentationPartCommand.ts rename to clients/client-api-gateway/src/commands/DeleteDocumentationPartCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteDocumentationVersionCommand.ts b/clients/client-api-gateway/src/commands/DeleteDocumentationVersionCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteDocumentationVersionCommand.ts rename to clients/client-api-gateway/src/commands/DeleteDocumentationVersionCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteDomainNameCommand.ts b/clients/client-api-gateway/src/commands/DeleteDomainNameCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteDomainNameCommand.ts rename to clients/client-api-gateway/src/commands/DeleteDomainNameCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteGatewayResponseCommand.ts b/clients/client-api-gateway/src/commands/DeleteGatewayResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteGatewayResponseCommand.ts rename to clients/client-api-gateway/src/commands/DeleteGatewayResponseCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteIntegrationCommand.ts b/clients/client-api-gateway/src/commands/DeleteIntegrationCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteIntegrationCommand.ts rename to clients/client-api-gateway/src/commands/DeleteIntegrationCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteIntegrationResponseCommand.ts b/clients/client-api-gateway/src/commands/DeleteIntegrationResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteIntegrationResponseCommand.ts rename to clients/client-api-gateway/src/commands/DeleteIntegrationResponseCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteMethodCommand.ts b/clients/client-api-gateway/src/commands/DeleteMethodCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteMethodCommand.ts rename to clients/client-api-gateway/src/commands/DeleteMethodCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteMethodResponseCommand.ts b/clients/client-api-gateway/src/commands/DeleteMethodResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteMethodResponseCommand.ts rename to clients/client-api-gateway/src/commands/DeleteMethodResponseCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteModelCommand.ts b/clients/client-api-gateway/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteModelCommand.ts rename to clients/client-api-gateway/src/commands/DeleteModelCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteRequestValidatorCommand.ts b/clients/client-api-gateway/src/commands/DeleteRequestValidatorCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteRequestValidatorCommand.ts rename to clients/client-api-gateway/src/commands/DeleteRequestValidatorCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteResourceCommand.ts b/clients/client-api-gateway/src/commands/DeleteResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteResourceCommand.ts rename to clients/client-api-gateway/src/commands/DeleteResourceCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteRestApiCommand.ts b/clients/client-api-gateway/src/commands/DeleteRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteRestApiCommand.ts rename to clients/client-api-gateway/src/commands/DeleteRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteStageCommand.ts b/clients/client-api-gateway/src/commands/DeleteStageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteStageCommand.ts rename to clients/client-api-gateway/src/commands/DeleteStageCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteUsagePlanCommand.ts b/clients/client-api-gateway/src/commands/DeleteUsagePlanCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteUsagePlanCommand.ts rename to clients/client-api-gateway/src/commands/DeleteUsagePlanCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteUsagePlanKeyCommand.ts b/clients/client-api-gateway/src/commands/DeleteUsagePlanKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteUsagePlanKeyCommand.ts rename to clients/client-api-gateway/src/commands/DeleteUsagePlanKeyCommand.ts diff --git a/clients/client-api-gateway/commands/DeleteVpcLinkCommand.ts b/clients/client-api-gateway/src/commands/DeleteVpcLinkCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/DeleteVpcLinkCommand.ts rename to clients/client-api-gateway/src/commands/DeleteVpcLinkCommand.ts diff --git a/clients/client-api-gateway/commands/FlushStageAuthorizersCacheCommand.ts b/clients/client-api-gateway/src/commands/FlushStageAuthorizersCacheCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/FlushStageAuthorizersCacheCommand.ts rename to clients/client-api-gateway/src/commands/FlushStageAuthorizersCacheCommand.ts diff --git a/clients/client-api-gateway/commands/FlushStageCacheCommand.ts b/clients/client-api-gateway/src/commands/FlushStageCacheCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/FlushStageCacheCommand.ts rename to clients/client-api-gateway/src/commands/FlushStageCacheCommand.ts diff --git a/clients/client-api-gateway/commands/GenerateClientCertificateCommand.ts b/clients/client-api-gateway/src/commands/GenerateClientCertificateCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GenerateClientCertificateCommand.ts rename to clients/client-api-gateway/src/commands/GenerateClientCertificateCommand.ts diff --git a/clients/client-api-gateway/commands/GetAccountCommand.ts b/clients/client-api-gateway/src/commands/GetAccountCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetAccountCommand.ts rename to clients/client-api-gateway/src/commands/GetAccountCommand.ts diff --git a/clients/client-api-gateway/commands/GetApiKeyCommand.ts b/clients/client-api-gateway/src/commands/GetApiKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetApiKeyCommand.ts rename to clients/client-api-gateway/src/commands/GetApiKeyCommand.ts diff --git a/clients/client-api-gateway/commands/GetApiKeysCommand.ts b/clients/client-api-gateway/src/commands/GetApiKeysCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetApiKeysCommand.ts rename to clients/client-api-gateway/src/commands/GetApiKeysCommand.ts diff --git a/clients/client-api-gateway/commands/GetAuthorizerCommand.ts b/clients/client-api-gateway/src/commands/GetAuthorizerCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetAuthorizerCommand.ts rename to clients/client-api-gateway/src/commands/GetAuthorizerCommand.ts diff --git a/clients/client-api-gateway/commands/GetAuthorizersCommand.ts b/clients/client-api-gateway/src/commands/GetAuthorizersCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetAuthorizersCommand.ts rename to clients/client-api-gateway/src/commands/GetAuthorizersCommand.ts diff --git a/clients/client-api-gateway/commands/GetBasePathMappingCommand.ts b/clients/client-api-gateway/src/commands/GetBasePathMappingCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetBasePathMappingCommand.ts rename to clients/client-api-gateway/src/commands/GetBasePathMappingCommand.ts diff --git a/clients/client-api-gateway/commands/GetBasePathMappingsCommand.ts b/clients/client-api-gateway/src/commands/GetBasePathMappingsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetBasePathMappingsCommand.ts rename to clients/client-api-gateway/src/commands/GetBasePathMappingsCommand.ts diff --git a/clients/client-api-gateway/commands/GetClientCertificateCommand.ts b/clients/client-api-gateway/src/commands/GetClientCertificateCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetClientCertificateCommand.ts rename to clients/client-api-gateway/src/commands/GetClientCertificateCommand.ts diff --git a/clients/client-api-gateway/commands/GetClientCertificatesCommand.ts b/clients/client-api-gateway/src/commands/GetClientCertificatesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetClientCertificatesCommand.ts rename to clients/client-api-gateway/src/commands/GetClientCertificatesCommand.ts diff --git a/clients/client-api-gateway/commands/GetDeploymentCommand.ts b/clients/client-api-gateway/src/commands/GetDeploymentCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDeploymentCommand.ts rename to clients/client-api-gateway/src/commands/GetDeploymentCommand.ts diff --git a/clients/client-api-gateway/commands/GetDeploymentsCommand.ts b/clients/client-api-gateway/src/commands/GetDeploymentsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDeploymentsCommand.ts rename to clients/client-api-gateway/src/commands/GetDeploymentsCommand.ts diff --git a/clients/client-api-gateway/commands/GetDocumentationPartCommand.ts b/clients/client-api-gateway/src/commands/GetDocumentationPartCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDocumentationPartCommand.ts rename to clients/client-api-gateway/src/commands/GetDocumentationPartCommand.ts diff --git a/clients/client-api-gateway/commands/GetDocumentationPartsCommand.ts b/clients/client-api-gateway/src/commands/GetDocumentationPartsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDocumentationPartsCommand.ts rename to clients/client-api-gateway/src/commands/GetDocumentationPartsCommand.ts diff --git a/clients/client-api-gateway/commands/GetDocumentationVersionCommand.ts b/clients/client-api-gateway/src/commands/GetDocumentationVersionCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDocumentationVersionCommand.ts rename to clients/client-api-gateway/src/commands/GetDocumentationVersionCommand.ts diff --git a/clients/client-api-gateway/commands/GetDocumentationVersionsCommand.ts b/clients/client-api-gateway/src/commands/GetDocumentationVersionsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDocumentationVersionsCommand.ts rename to clients/client-api-gateway/src/commands/GetDocumentationVersionsCommand.ts diff --git a/clients/client-api-gateway/commands/GetDomainNameCommand.ts b/clients/client-api-gateway/src/commands/GetDomainNameCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDomainNameCommand.ts rename to clients/client-api-gateway/src/commands/GetDomainNameCommand.ts diff --git a/clients/client-api-gateway/commands/GetDomainNamesCommand.ts b/clients/client-api-gateway/src/commands/GetDomainNamesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetDomainNamesCommand.ts rename to clients/client-api-gateway/src/commands/GetDomainNamesCommand.ts diff --git a/clients/client-api-gateway/commands/GetExportCommand.ts b/clients/client-api-gateway/src/commands/GetExportCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetExportCommand.ts rename to clients/client-api-gateway/src/commands/GetExportCommand.ts diff --git a/clients/client-api-gateway/commands/GetGatewayResponseCommand.ts b/clients/client-api-gateway/src/commands/GetGatewayResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetGatewayResponseCommand.ts rename to clients/client-api-gateway/src/commands/GetGatewayResponseCommand.ts diff --git a/clients/client-api-gateway/commands/GetGatewayResponsesCommand.ts b/clients/client-api-gateway/src/commands/GetGatewayResponsesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetGatewayResponsesCommand.ts rename to clients/client-api-gateway/src/commands/GetGatewayResponsesCommand.ts diff --git a/clients/client-api-gateway/commands/GetIntegrationCommand.ts b/clients/client-api-gateway/src/commands/GetIntegrationCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetIntegrationCommand.ts rename to clients/client-api-gateway/src/commands/GetIntegrationCommand.ts diff --git a/clients/client-api-gateway/commands/GetIntegrationResponseCommand.ts b/clients/client-api-gateway/src/commands/GetIntegrationResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetIntegrationResponseCommand.ts rename to clients/client-api-gateway/src/commands/GetIntegrationResponseCommand.ts diff --git a/clients/client-api-gateway/commands/GetMethodCommand.ts b/clients/client-api-gateway/src/commands/GetMethodCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetMethodCommand.ts rename to clients/client-api-gateway/src/commands/GetMethodCommand.ts diff --git a/clients/client-api-gateway/commands/GetMethodResponseCommand.ts b/clients/client-api-gateway/src/commands/GetMethodResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetMethodResponseCommand.ts rename to clients/client-api-gateway/src/commands/GetMethodResponseCommand.ts diff --git a/clients/client-api-gateway/commands/GetModelCommand.ts b/clients/client-api-gateway/src/commands/GetModelCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetModelCommand.ts rename to clients/client-api-gateway/src/commands/GetModelCommand.ts diff --git a/clients/client-api-gateway/commands/GetModelTemplateCommand.ts b/clients/client-api-gateway/src/commands/GetModelTemplateCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetModelTemplateCommand.ts rename to clients/client-api-gateway/src/commands/GetModelTemplateCommand.ts diff --git a/clients/client-api-gateway/commands/GetModelsCommand.ts b/clients/client-api-gateway/src/commands/GetModelsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetModelsCommand.ts rename to clients/client-api-gateway/src/commands/GetModelsCommand.ts diff --git a/clients/client-api-gateway/commands/GetRequestValidatorCommand.ts b/clients/client-api-gateway/src/commands/GetRequestValidatorCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetRequestValidatorCommand.ts rename to clients/client-api-gateway/src/commands/GetRequestValidatorCommand.ts diff --git a/clients/client-api-gateway/commands/GetRequestValidatorsCommand.ts b/clients/client-api-gateway/src/commands/GetRequestValidatorsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetRequestValidatorsCommand.ts rename to clients/client-api-gateway/src/commands/GetRequestValidatorsCommand.ts diff --git a/clients/client-api-gateway/commands/GetResourceCommand.ts b/clients/client-api-gateway/src/commands/GetResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetResourceCommand.ts rename to clients/client-api-gateway/src/commands/GetResourceCommand.ts diff --git a/clients/client-api-gateway/commands/GetResourcesCommand.ts b/clients/client-api-gateway/src/commands/GetResourcesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetResourcesCommand.ts rename to clients/client-api-gateway/src/commands/GetResourcesCommand.ts diff --git a/clients/client-api-gateway/commands/GetRestApiCommand.ts b/clients/client-api-gateway/src/commands/GetRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetRestApiCommand.ts rename to clients/client-api-gateway/src/commands/GetRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/GetRestApisCommand.ts b/clients/client-api-gateway/src/commands/GetRestApisCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetRestApisCommand.ts rename to clients/client-api-gateway/src/commands/GetRestApisCommand.ts diff --git a/clients/client-api-gateway/commands/GetSdkCommand.ts b/clients/client-api-gateway/src/commands/GetSdkCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetSdkCommand.ts rename to clients/client-api-gateway/src/commands/GetSdkCommand.ts diff --git a/clients/client-api-gateway/commands/GetSdkTypeCommand.ts b/clients/client-api-gateway/src/commands/GetSdkTypeCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetSdkTypeCommand.ts rename to clients/client-api-gateway/src/commands/GetSdkTypeCommand.ts diff --git a/clients/client-api-gateway/commands/GetSdkTypesCommand.ts b/clients/client-api-gateway/src/commands/GetSdkTypesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetSdkTypesCommand.ts rename to clients/client-api-gateway/src/commands/GetSdkTypesCommand.ts diff --git a/clients/client-api-gateway/commands/GetStageCommand.ts b/clients/client-api-gateway/src/commands/GetStageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetStageCommand.ts rename to clients/client-api-gateway/src/commands/GetStageCommand.ts diff --git a/clients/client-api-gateway/commands/GetStagesCommand.ts b/clients/client-api-gateway/src/commands/GetStagesCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetStagesCommand.ts rename to clients/client-api-gateway/src/commands/GetStagesCommand.ts diff --git a/clients/client-api-gateway/commands/GetTagsCommand.ts b/clients/client-api-gateway/src/commands/GetTagsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetTagsCommand.ts rename to clients/client-api-gateway/src/commands/GetTagsCommand.ts diff --git a/clients/client-api-gateway/commands/GetUsageCommand.ts b/clients/client-api-gateway/src/commands/GetUsageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetUsageCommand.ts rename to clients/client-api-gateway/src/commands/GetUsageCommand.ts diff --git a/clients/client-api-gateway/commands/GetUsagePlanCommand.ts b/clients/client-api-gateway/src/commands/GetUsagePlanCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetUsagePlanCommand.ts rename to clients/client-api-gateway/src/commands/GetUsagePlanCommand.ts diff --git a/clients/client-api-gateway/commands/GetUsagePlanKeyCommand.ts b/clients/client-api-gateway/src/commands/GetUsagePlanKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetUsagePlanKeyCommand.ts rename to clients/client-api-gateway/src/commands/GetUsagePlanKeyCommand.ts diff --git a/clients/client-api-gateway/commands/GetUsagePlanKeysCommand.ts b/clients/client-api-gateway/src/commands/GetUsagePlanKeysCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetUsagePlanKeysCommand.ts rename to clients/client-api-gateway/src/commands/GetUsagePlanKeysCommand.ts diff --git a/clients/client-api-gateway/commands/GetUsagePlansCommand.ts b/clients/client-api-gateway/src/commands/GetUsagePlansCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetUsagePlansCommand.ts rename to clients/client-api-gateway/src/commands/GetUsagePlansCommand.ts diff --git a/clients/client-api-gateway/commands/GetVpcLinkCommand.ts b/clients/client-api-gateway/src/commands/GetVpcLinkCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetVpcLinkCommand.ts rename to clients/client-api-gateway/src/commands/GetVpcLinkCommand.ts diff --git a/clients/client-api-gateway/commands/GetVpcLinksCommand.ts b/clients/client-api-gateway/src/commands/GetVpcLinksCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/GetVpcLinksCommand.ts rename to clients/client-api-gateway/src/commands/GetVpcLinksCommand.ts diff --git a/clients/client-api-gateway/commands/ImportApiKeysCommand.ts b/clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/ImportApiKeysCommand.ts rename to clients/client-api-gateway/src/commands/ImportApiKeysCommand.ts diff --git a/clients/client-api-gateway/commands/ImportDocumentationPartsCommand.ts b/clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/ImportDocumentationPartsCommand.ts rename to clients/client-api-gateway/src/commands/ImportDocumentationPartsCommand.ts diff --git a/clients/client-api-gateway/commands/ImportRestApiCommand.ts b/clients/client-api-gateway/src/commands/ImportRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/ImportRestApiCommand.ts rename to clients/client-api-gateway/src/commands/ImportRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/PutGatewayResponseCommand.ts b/clients/client-api-gateway/src/commands/PutGatewayResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutGatewayResponseCommand.ts rename to clients/client-api-gateway/src/commands/PutGatewayResponseCommand.ts diff --git a/clients/client-api-gateway/commands/PutIntegrationCommand.ts b/clients/client-api-gateway/src/commands/PutIntegrationCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutIntegrationCommand.ts rename to clients/client-api-gateway/src/commands/PutIntegrationCommand.ts diff --git a/clients/client-api-gateway/commands/PutIntegrationResponseCommand.ts b/clients/client-api-gateway/src/commands/PutIntegrationResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutIntegrationResponseCommand.ts rename to clients/client-api-gateway/src/commands/PutIntegrationResponseCommand.ts diff --git a/clients/client-api-gateway/commands/PutMethodCommand.ts b/clients/client-api-gateway/src/commands/PutMethodCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutMethodCommand.ts rename to clients/client-api-gateway/src/commands/PutMethodCommand.ts diff --git a/clients/client-api-gateway/commands/PutMethodResponseCommand.ts b/clients/client-api-gateway/src/commands/PutMethodResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutMethodResponseCommand.ts rename to clients/client-api-gateway/src/commands/PutMethodResponseCommand.ts diff --git a/clients/client-api-gateway/commands/PutRestApiCommand.ts b/clients/client-api-gateway/src/commands/PutRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/PutRestApiCommand.ts rename to clients/client-api-gateway/src/commands/PutRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/TagResourceCommand.ts b/clients/client-api-gateway/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/TagResourceCommand.ts rename to clients/client-api-gateway/src/commands/TagResourceCommand.ts diff --git a/clients/client-api-gateway/commands/TestInvokeAuthorizerCommand.ts b/clients/client-api-gateway/src/commands/TestInvokeAuthorizerCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/TestInvokeAuthorizerCommand.ts rename to clients/client-api-gateway/src/commands/TestInvokeAuthorizerCommand.ts diff --git a/clients/client-api-gateway/commands/TestInvokeMethodCommand.ts b/clients/client-api-gateway/src/commands/TestInvokeMethodCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/TestInvokeMethodCommand.ts rename to clients/client-api-gateway/src/commands/TestInvokeMethodCommand.ts diff --git a/clients/client-api-gateway/commands/UntagResourceCommand.ts b/clients/client-api-gateway/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UntagResourceCommand.ts rename to clients/client-api-gateway/src/commands/UntagResourceCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateAccountCommand.ts b/clients/client-api-gateway/src/commands/UpdateAccountCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateAccountCommand.ts rename to clients/client-api-gateway/src/commands/UpdateAccountCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateApiKeyCommand.ts b/clients/client-api-gateway/src/commands/UpdateApiKeyCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateApiKeyCommand.ts rename to clients/client-api-gateway/src/commands/UpdateApiKeyCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateAuthorizerCommand.ts b/clients/client-api-gateway/src/commands/UpdateAuthorizerCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateAuthorizerCommand.ts rename to clients/client-api-gateway/src/commands/UpdateAuthorizerCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateBasePathMappingCommand.ts b/clients/client-api-gateway/src/commands/UpdateBasePathMappingCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateBasePathMappingCommand.ts rename to clients/client-api-gateway/src/commands/UpdateBasePathMappingCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateClientCertificateCommand.ts b/clients/client-api-gateway/src/commands/UpdateClientCertificateCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateClientCertificateCommand.ts rename to clients/client-api-gateway/src/commands/UpdateClientCertificateCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateDeploymentCommand.ts b/clients/client-api-gateway/src/commands/UpdateDeploymentCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateDeploymentCommand.ts rename to clients/client-api-gateway/src/commands/UpdateDeploymentCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateDocumentationPartCommand.ts b/clients/client-api-gateway/src/commands/UpdateDocumentationPartCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateDocumentationPartCommand.ts rename to clients/client-api-gateway/src/commands/UpdateDocumentationPartCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateDocumentationVersionCommand.ts b/clients/client-api-gateway/src/commands/UpdateDocumentationVersionCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateDocumentationVersionCommand.ts rename to clients/client-api-gateway/src/commands/UpdateDocumentationVersionCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateDomainNameCommand.ts b/clients/client-api-gateway/src/commands/UpdateDomainNameCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateDomainNameCommand.ts rename to clients/client-api-gateway/src/commands/UpdateDomainNameCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateGatewayResponseCommand.ts b/clients/client-api-gateway/src/commands/UpdateGatewayResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateGatewayResponseCommand.ts rename to clients/client-api-gateway/src/commands/UpdateGatewayResponseCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateIntegrationCommand.ts b/clients/client-api-gateway/src/commands/UpdateIntegrationCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateIntegrationCommand.ts rename to clients/client-api-gateway/src/commands/UpdateIntegrationCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateIntegrationResponseCommand.ts b/clients/client-api-gateway/src/commands/UpdateIntegrationResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateIntegrationResponseCommand.ts rename to clients/client-api-gateway/src/commands/UpdateIntegrationResponseCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateMethodCommand.ts b/clients/client-api-gateway/src/commands/UpdateMethodCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateMethodCommand.ts rename to clients/client-api-gateway/src/commands/UpdateMethodCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateMethodResponseCommand.ts b/clients/client-api-gateway/src/commands/UpdateMethodResponseCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateMethodResponseCommand.ts rename to clients/client-api-gateway/src/commands/UpdateMethodResponseCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateModelCommand.ts b/clients/client-api-gateway/src/commands/UpdateModelCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateModelCommand.ts rename to clients/client-api-gateway/src/commands/UpdateModelCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateRequestValidatorCommand.ts b/clients/client-api-gateway/src/commands/UpdateRequestValidatorCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateRequestValidatorCommand.ts rename to clients/client-api-gateway/src/commands/UpdateRequestValidatorCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateResourceCommand.ts b/clients/client-api-gateway/src/commands/UpdateResourceCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateResourceCommand.ts rename to clients/client-api-gateway/src/commands/UpdateResourceCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateRestApiCommand.ts b/clients/client-api-gateway/src/commands/UpdateRestApiCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateRestApiCommand.ts rename to clients/client-api-gateway/src/commands/UpdateRestApiCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateStageCommand.ts b/clients/client-api-gateway/src/commands/UpdateStageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateStageCommand.ts rename to clients/client-api-gateway/src/commands/UpdateStageCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateUsageCommand.ts b/clients/client-api-gateway/src/commands/UpdateUsageCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateUsageCommand.ts rename to clients/client-api-gateway/src/commands/UpdateUsageCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateUsagePlanCommand.ts b/clients/client-api-gateway/src/commands/UpdateUsagePlanCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateUsagePlanCommand.ts rename to clients/client-api-gateway/src/commands/UpdateUsagePlanCommand.ts diff --git a/clients/client-api-gateway/commands/UpdateVpcLinkCommand.ts b/clients/client-api-gateway/src/commands/UpdateVpcLinkCommand.ts similarity index 100% rename from clients/client-api-gateway/commands/UpdateVpcLinkCommand.ts rename to clients/client-api-gateway/src/commands/UpdateVpcLinkCommand.ts diff --git a/clients/client-api-gateway/endpoints.ts b/clients/client-api-gateway/src/endpoints.ts similarity index 100% rename from clients/client-api-gateway/endpoints.ts rename to clients/client-api-gateway/src/endpoints.ts diff --git a/clients/client-api-gateway/index.ts b/clients/client-api-gateway/src/index.ts similarity index 100% rename from clients/client-api-gateway/index.ts rename to clients/client-api-gateway/src/index.ts diff --git a/clients/client-api-gateway/models/index.ts b/clients/client-api-gateway/src/models/index.ts similarity index 100% rename from clients/client-api-gateway/models/index.ts rename to clients/client-api-gateway/src/models/index.ts diff --git a/clients/client-api-gateway/models/models_0.ts b/clients/client-api-gateway/src/models/models_0.ts similarity index 100% rename from clients/client-api-gateway/models/models_0.ts rename to clients/client-api-gateway/src/models/models_0.ts diff --git a/clients/client-api-gateway/pagination/GetApiKeysPaginator.ts b/clients/client-api-gateway/src/pagination/GetApiKeysPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetApiKeysPaginator.ts rename to clients/client-api-gateway/src/pagination/GetApiKeysPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetBasePathMappingsPaginator.ts b/clients/client-api-gateway/src/pagination/GetBasePathMappingsPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetBasePathMappingsPaginator.ts rename to clients/client-api-gateway/src/pagination/GetBasePathMappingsPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetClientCertificatesPaginator.ts b/clients/client-api-gateway/src/pagination/GetClientCertificatesPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetClientCertificatesPaginator.ts rename to clients/client-api-gateway/src/pagination/GetClientCertificatesPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetDeploymentsPaginator.ts b/clients/client-api-gateway/src/pagination/GetDeploymentsPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetDeploymentsPaginator.ts rename to clients/client-api-gateway/src/pagination/GetDeploymentsPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetDomainNamesPaginator.ts b/clients/client-api-gateway/src/pagination/GetDomainNamesPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetDomainNamesPaginator.ts rename to clients/client-api-gateway/src/pagination/GetDomainNamesPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetModelsPaginator.ts b/clients/client-api-gateway/src/pagination/GetModelsPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetModelsPaginator.ts rename to clients/client-api-gateway/src/pagination/GetModelsPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetResourcesPaginator.ts b/clients/client-api-gateway/src/pagination/GetResourcesPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetResourcesPaginator.ts rename to clients/client-api-gateway/src/pagination/GetResourcesPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetRestApisPaginator.ts b/clients/client-api-gateway/src/pagination/GetRestApisPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetRestApisPaginator.ts rename to clients/client-api-gateway/src/pagination/GetRestApisPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetUsagePaginator.ts b/clients/client-api-gateway/src/pagination/GetUsagePaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetUsagePaginator.ts rename to clients/client-api-gateway/src/pagination/GetUsagePaginator.ts diff --git a/clients/client-api-gateway/pagination/GetUsagePlanKeysPaginator.ts b/clients/client-api-gateway/src/pagination/GetUsagePlanKeysPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetUsagePlanKeysPaginator.ts rename to clients/client-api-gateway/src/pagination/GetUsagePlanKeysPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetUsagePlansPaginator.ts b/clients/client-api-gateway/src/pagination/GetUsagePlansPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetUsagePlansPaginator.ts rename to clients/client-api-gateway/src/pagination/GetUsagePlansPaginator.ts diff --git a/clients/client-api-gateway/pagination/GetVpcLinksPaginator.ts b/clients/client-api-gateway/src/pagination/GetVpcLinksPaginator.ts similarity index 100% rename from clients/client-api-gateway/pagination/GetVpcLinksPaginator.ts rename to clients/client-api-gateway/src/pagination/GetVpcLinksPaginator.ts diff --git a/clients/client-api-gateway/pagination/Interfaces.ts b/clients/client-api-gateway/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-api-gateway/pagination/Interfaces.ts rename to clients/client-api-gateway/src/pagination/Interfaces.ts diff --git a/clients/client-api-gateway/protocols/Aws_restJson1.ts b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-api-gateway/protocols/Aws_restJson1.ts rename to clients/client-api-gateway/src/protocols/Aws_restJson1.ts diff --git a/clients/client-api-gateway/src/runtimeConfig.browser.ts b/clients/client-api-gateway/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5ac9fa9e6b95 --- /dev/null +++ b/clients/client-api-gateway/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { APIGatewayClientConfig } from "./APIGatewayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: APIGatewayClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-api-gateway/runtimeConfig.native.ts b/clients/client-api-gateway/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-api-gateway/runtimeConfig.native.ts rename to clients/client-api-gateway/src/runtimeConfig.native.ts diff --git a/clients/client-api-gateway/runtimeConfig.shared.ts b/clients/client-api-gateway/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-api-gateway/runtimeConfig.shared.ts rename to clients/client-api-gateway/src/runtimeConfig.shared.ts diff --git a/clients/client-api-gateway/src/runtimeConfig.ts b/clients/client-api-gateway/src/runtimeConfig.ts new file mode 100644 index 000000000000..e48fb4b70e3a --- /dev/null +++ b/clients/client-api-gateway/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { APIGatewayClientConfig } from "./APIGatewayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: APIGatewayClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-api-gateway/tsconfig.es.json b/clients/client-api-gateway/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-api-gateway/tsconfig.es.json +++ b/clients/client-api-gateway/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-api-gateway/tsconfig.json b/clients/client-api-gateway/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-api-gateway/tsconfig.json +++ b/clients/client-api-gateway/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-api-gateway/tsconfig.types.json b/clients/client-api-gateway/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-api-gateway/tsconfig.types.json +++ b/clients/client-api-gateway/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-apigatewaymanagementapi/.gitignore b/clients/client-apigatewaymanagementapi/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-apigatewaymanagementapi/.gitignore +++ b/clients/client-apigatewaymanagementapi/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-apigatewaymanagementapi/package.json b/clients/client-apigatewaymanagementapi/package.json index bb4f4305cf89..1d6dac768a0a 100644 --- a/clients/client-apigatewaymanagementapi/package.json +++ b/clients/client-apigatewaymanagementapi/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-apigatewaymanagementapi", "repository": { "type": "git", diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts deleted file mode 100644 index a2060d50a0dd..000000000000 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/runtimeConfig.ts deleted file mode 100644 index 23e5cf8b0b2d..000000000000 --- a/clients/client-apigatewaymanagementapi/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApi.ts b/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApi.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/ApiGatewayManagementApi.ts rename to clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApi.ts diff --git a/clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts b/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/ApiGatewayManagementApiClient.ts rename to clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts diff --git a/clients/client-apigatewaymanagementapi/commands/DeleteConnectionCommand.ts b/clients/client-apigatewaymanagementapi/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/commands/DeleteConnectionCommand.ts rename to clients/client-apigatewaymanagementapi/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-apigatewaymanagementapi/commands/GetConnectionCommand.ts b/clients/client-apigatewaymanagementapi/src/commands/GetConnectionCommand.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/commands/GetConnectionCommand.ts rename to clients/client-apigatewaymanagementapi/src/commands/GetConnectionCommand.ts diff --git a/clients/client-apigatewaymanagementapi/commands/PostToConnectionCommand.ts b/clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/commands/PostToConnectionCommand.ts rename to clients/client-apigatewaymanagementapi/src/commands/PostToConnectionCommand.ts diff --git a/clients/client-apigatewaymanagementapi/endpoints.ts b/clients/client-apigatewaymanagementapi/src/endpoints.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/endpoints.ts rename to clients/client-apigatewaymanagementapi/src/endpoints.ts diff --git a/clients/client-apigatewaymanagementapi/index.ts b/clients/client-apigatewaymanagementapi/src/index.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/index.ts rename to clients/client-apigatewaymanagementapi/src/index.ts diff --git a/clients/client-apigatewaymanagementapi/models/index.ts b/clients/client-apigatewaymanagementapi/src/models/index.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/models/index.ts rename to clients/client-apigatewaymanagementapi/src/models/index.ts diff --git a/clients/client-apigatewaymanagementapi/models/models_0.ts b/clients/client-apigatewaymanagementapi/src/models/models_0.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/models/models_0.ts rename to clients/client-apigatewaymanagementapi/src/models/models_0.ts diff --git a/clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/protocols/Aws_restJson1.ts rename to clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts diff --git a/clients/client-apigatewaymanagementapi/src/runtimeConfig.browser.ts b/clients/client-apigatewaymanagementapi/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..42c42bf9191f --- /dev/null +++ b/clients/client-apigatewaymanagementapi/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.native.ts b/clients/client-apigatewaymanagementapi/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/runtimeConfig.native.ts rename to clients/client-apigatewaymanagementapi/src/runtimeConfig.native.ts diff --git a/clients/client-apigatewaymanagementapi/runtimeConfig.shared.ts b/clients/client-apigatewaymanagementapi/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-apigatewaymanagementapi/runtimeConfig.shared.ts rename to clients/client-apigatewaymanagementapi/src/runtimeConfig.shared.ts diff --git a/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts new file mode 100644 index 000000000000..2424feb03ef2 --- /dev/null +++ b/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apigatewaymanagementapi/tsconfig.es.json b/clients/client-apigatewaymanagementapi/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-apigatewaymanagementapi/tsconfig.es.json +++ b/clients/client-apigatewaymanagementapi/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-apigatewaymanagementapi/tsconfig.json b/clients/client-apigatewaymanagementapi/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-apigatewaymanagementapi/tsconfig.json +++ b/clients/client-apigatewaymanagementapi/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-apigatewaymanagementapi/tsconfig.types.json b/clients/client-apigatewaymanagementapi/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-apigatewaymanagementapi/tsconfig.types.json +++ b/clients/client-apigatewaymanagementapi/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-apigatewayv2/.gitignore b/clients/client-apigatewayv2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-apigatewayv2/.gitignore +++ b/clients/client-apigatewayv2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-apigatewayv2/package.json b/clients/client-apigatewayv2/package.json index 09a24f0c271b..5043b10b1274 100644 --- a/clients/client-apigatewayv2/package.json +++ b/clients/client-apigatewayv2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-apigatewayv2", "repository": { "type": "git", diff --git a/clients/client-apigatewayv2/runtimeConfig.browser.ts b/clients/client-apigatewayv2/runtimeConfig.browser.ts deleted file mode 100644 index 9a6633a36660..000000000000 --- a/clients/client-apigatewayv2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApiGatewayV2ClientConfig } from "./ApiGatewayV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apigatewayv2/runtimeConfig.ts b/clients/client-apigatewayv2/runtimeConfig.ts deleted file mode 100644 index f87995b88dcf..000000000000 --- a/clients/client-apigatewayv2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApiGatewayV2ClientConfig } from "./ApiGatewayV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apigatewayv2/ApiGatewayV2.ts b/clients/client-apigatewayv2/src/ApiGatewayV2.ts similarity index 100% rename from clients/client-apigatewayv2/ApiGatewayV2.ts rename to clients/client-apigatewayv2/src/ApiGatewayV2.ts diff --git a/clients/client-apigatewayv2/ApiGatewayV2Client.ts b/clients/client-apigatewayv2/src/ApiGatewayV2Client.ts similarity index 100% rename from clients/client-apigatewayv2/ApiGatewayV2Client.ts rename to clients/client-apigatewayv2/src/ApiGatewayV2Client.ts diff --git a/clients/client-apigatewayv2/commands/CreateApiCommand.ts b/clients/client-apigatewayv2/src/commands/CreateApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateApiCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateApiMappingCommand.ts b/clients/client-apigatewayv2/src/commands/CreateApiMappingCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateApiMappingCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateApiMappingCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateAuthorizerCommand.ts b/clients/client-apigatewayv2/src/commands/CreateAuthorizerCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateAuthorizerCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateAuthorizerCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateDeploymentCommand.ts b/clients/client-apigatewayv2/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateDeploymentCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateDomainNameCommand.ts b/clients/client-apigatewayv2/src/commands/CreateDomainNameCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateDomainNameCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateDomainNameCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateIntegrationCommand.ts b/clients/client-apigatewayv2/src/commands/CreateIntegrationCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateIntegrationCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateIntegrationCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateIntegrationResponseCommand.ts b/clients/client-apigatewayv2/src/commands/CreateIntegrationResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateIntegrationResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateIntegrationResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateModelCommand.ts b/clients/client-apigatewayv2/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateModelCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateModelCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateRouteCommand.ts b/clients/client-apigatewayv2/src/commands/CreateRouteCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateRouteCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateRouteCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateRouteResponseCommand.ts b/clients/client-apigatewayv2/src/commands/CreateRouteResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateRouteResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateRouteResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateStageCommand.ts b/clients/client-apigatewayv2/src/commands/CreateStageCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateStageCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateStageCommand.ts diff --git a/clients/client-apigatewayv2/commands/CreateVpcLinkCommand.ts b/clients/client-apigatewayv2/src/commands/CreateVpcLinkCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/CreateVpcLinkCommand.ts rename to clients/client-apigatewayv2/src/commands/CreateVpcLinkCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteAccessLogSettingsCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteAccessLogSettingsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteAccessLogSettingsCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteAccessLogSettingsCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteApiCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteApiCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteApiMappingCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteApiMappingCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteApiMappingCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteApiMappingCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteAuthorizerCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteAuthorizerCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteAuthorizerCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteAuthorizerCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteCorsConfigurationCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteCorsConfigurationCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteCorsConfigurationCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteCorsConfigurationCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteDeploymentCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteDeploymentCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteDeploymentCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteDeploymentCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteDomainNameCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteDomainNameCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteDomainNameCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteDomainNameCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteIntegrationCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteIntegrationCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteIntegrationCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteIntegrationCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteIntegrationResponseCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteIntegrationResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteIntegrationResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteIntegrationResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteModelCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteModelCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteModelCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteRouteCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteRouteCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteRouteCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteRouteCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteRouteRequestParameterCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteRouteRequestParameterCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteRouteRequestParameterCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteRouteRequestParameterCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteRouteResponseCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteRouteResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteRouteResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteRouteResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteRouteSettingsCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteRouteSettingsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteRouteSettingsCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteRouteSettingsCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteStageCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteStageCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteStageCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteStageCommand.ts diff --git a/clients/client-apigatewayv2/commands/DeleteVpcLinkCommand.ts b/clients/client-apigatewayv2/src/commands/DeleteVpcLinkCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/DeleteVpcLinkCommand.ts rename to clients/client-apigatewayv2/src/commands/DeleteVpcLinkCommand.ts diff --git a/clients/client-apigatewayv2/commands/ExportApiCommand.ts b/clients/client-apigatewayv2/src/commands/ExportApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/ExportApiCommand.ts rename to clients/client-apigatewayv2/src/commands/ExportApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetApiCommand.ts b/clients/client-apigatewayv2/src/commands/GetApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetApiCommand.ts rename to clients/client-apigatewayv2/src/commands/GetApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetApiMappingCommand.ts b/clients/client-apigatewayv2/src/commands/GetApiMappingCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetApiMappingCommand.ts rename to clients/client-apigatewayv2/src/commands/GetApiMappingCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetApiMappingsCommand.ts b/clients/client-apigatewayv2/src/commands/GetApiMappingsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetApiMappingsCommand.ts rename to clients/client-apigatewayv2/src/commands/GetApiMappingsCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetApisCommand.ts b/clients/client-apigatewayv2/src/commands/GetApisCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetApisCommand.ts rename to clients/client-apigatewayv2/src/commands/GetApisCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetAuthorizerCommand.ts b/clients/client-apigatewayv2/src/commands/GetAuthorizerCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetAuthorizerCommand.ts rename to clients/client-apigatewayv2/src/commands/GetAuthorizerCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetAuthorizersCommand.ts b/clients/client-apigatewayv2/src/commands/GetAuthorizersCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetAuthorizersCommand.ts rename to clients/client-apigatewayv2/src/commands/GetAuthorizersCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetDeploymentCommand.ts b/clients/client-apigatewayv2/src/commands/GetDeploymentCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetDeploymentCommand.ts rename to clients/client-apigatewayv2/src/commands/GetDeploymentCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetDeploymentsCommand.ts b/clients/client-apigatewayv2/src/commands/GetDeploymentsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetDeploymentsCommand.ts rename to clients/client-apigatewayv2/src/commands/GetDeploymentsCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetDomainNameCommand.ts b/clients/client-apigatewayv2/src/commands/GetDomainNameCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetDomainNameCommand.ts rename to clients/client-apigatewayv2/src/commands/GetDomainNameCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetDomainNamesCommand.ts b/clients/client-apigatewayv2/src/commands/GetDomainNamesCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetDomainNamesCommand.ts rename to clients/client-apigatewayv2/src/commands/GetDomainNamesCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetIntegrationCommand.ts b/clients/client-apigatewayv2/src/commands/GetIntegrationCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetIntegrationCommand.ts rename to clients/client-apigatewayv2/src/commands/GetIntegrationCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetIntegrationResponseCommand.ts b/clients/client-apigatewayv2/src/commands/GetIntegrationResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetIntegrationResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/GetIntegrationResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetIntegrationResponsesCommand.ts b/clients/client-apigatewayv2/src/commands/GetIntegrationResponsesCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetIntegrationResponsesCommand.ts rename to clients/client-apigatewayv2/src/commands/GetIntegrationResponsesCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetIntegrationsCommand.ts b/clients/client-apigatewayv2/src/commands/GetIntegrationsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetIntegrationsCommand.ts rename to clients/client-apigatewayv2/src/commands/GetIntegrationsCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetModelCommand.ts b/clients/client-apigatewayv2/src/commands/GetModelCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetModelCommand.ts rename to clients/client-apigatewayv2/src/commands/GetModelCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetModelTemplateCommand.ts b/clients/client-apigatewayv2/src/commands/GetModelTemplateCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetModelTemplateCommand.ts rename to clients/client-apigatewayv2/src/commands/GetModelTemplateCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetModelsCommand.ts b/clients/client-apigatewayv2/src/commands/GetModelsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetModelsCommand.ts rename to clients/client-apigatewayv2/src/commands/GetModelsCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetRouteCommand.ts b/clients/client-apigatewayv2/src/commands/GetRouteCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetRouteCommand.ts rename to clients/client-apigatewayv2/src/commands/GetRouteCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetRouteResponseCommand.ts b/clients/client-apigatewayv2/src/commands/GetRouteResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetRouteResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/GetRouteResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetRouteResponsesCommand.ts b/clients/client-apigatewayv2/src/commands/GetRouteResponsesCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetRouteResponsesCommand.ts rename to clients/client-apigatewayv2/src/commands/GetRouteResponsesCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetRoutesCommand.ts b/clients/client-apigatewayv2/src/commands/GetRoutesCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetRoutesCommand.ts rename to clients/client-apigatewayv2/src/commands/GetRoutesCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetStageCommand.ts b/clients/client-apigatewayv2/src/commands/GetStageCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetStageCommand.ts rename to clients/client-apigatewayv2/src/commands/GetStageCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetStagesCommand.ts b/clients/client-apigatewayv2/src/commands/GetStagesCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetStagesCommand.ts rename to clients/client-apigatewayv2/src/commands/GetStagesCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetTagsCommand.ts b/clients/client-apigatewayv2/src/commands/GetTagsCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetTagsCommand.ts rename to clients/client-apigatewayv2/src/commands/GetTagsCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetVpcLinkCommand.ts b/clients/client-apigatewayv2/src/commands/GetVpcLinkCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetVpcLinkCommand.ts rename to clients/client-apigatewayv2/src/commands/GetVpcLinkCommand.ts diff --git a/clients/client-apigatewayv2/commands/GetVpcLinksCommand.ts b/clients/client-apigatewayv2/src/commands/GetVpcLinksCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/GetVpcLinksCommand.ts rename to clients/client-apigatewayv2/src/commands/GetVpcLinksCommand.ts diff --git a/clients/client-apigatewayv2/commands/ImportApiCommand.ts b/clients/client-apigatewayv2/src/commands/ImportApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/ImportApiCommand.ts rename to clients/client-apigatewayv2/src/commands/ImportApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/ReimportApiCommand.ts b/clients/client-apigatewayv2/src/commands/ReimportApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/ReimportApiCommand.ts rename to clients/client-apigatewayv2/src/commands/ReimportApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/ResetAuthorizersCacheCommand.ts b/clients/client-apigatewayv2/src/commands/ResetAuthorizersCacheCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/ResetAuthorizersCacheCommand.ts rename to clients/client-apigatewayv2/src/commands/ResetAuthorizersCacheCommand.ts diff --git a/clients/client-apigatewayv2/commands/TagResourceCommand.ts b/clients/client-apigatewayv2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/TagResourceCommand.ts rename to clients/client-apigatewayv2/src/commands/TagResourceCommand.ts diff --git a/clients/client-apigatewayv2/commands/UntagResourceCommand.ts b/clients/client-apigatewayv2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UntagResourceCommand.ts rename to clients/client-apigatewayv2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateApiCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateApiCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateApiCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateApiCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateApiMappingCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateApiMappingCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateApiMappingCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateApiMappingCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateAuthorizerCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateAuthorizerCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateAuthorizerCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateAuthorizerCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateDeploymentCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateDeploymentCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateDeploymentCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateDeploymentCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateDomainNameCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateDomainNameCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateDomainNameCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateDomainNameCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateIntegrationCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateIntegrationCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateIntegrationCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateIntegrationCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateIntegrationResponseCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateIntegrationResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateIntegrationResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateIntegrationResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateModelCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateModelCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateModelCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateModelCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateRouteCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateRouteCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateRouteCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateRouteCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateRouteResponseCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateRouteResponseCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateRouteResponseCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateRouteResponseCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateStageCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateStageCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateStageCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateStageCommand.ts diff --git a/clients/client-apigatewayv2/commands/UpdateVpcLinkCommand.ts b/clients/client-apigatewayv2/src/commands/UpdateVpcLinkCommand.ts similarity index 100% rename from clients/client-apigatewayv2/commands/UpdateVpcLinkCommand.ts rename to clients/client-apigatewayv2/src/commands/UpdateVpcLinkCommand.ts diff --git a/clients/client-apigatewayv2/endpoints.ts b/clients/client-apigatewayv2/src/endpoints.ts similarity index 100% rename from clients/client-apigatewayv2/endpoints.ts rename to clients/client-apigatewayv2/src/endpoints.ts diff --git a/clients/client-apigatewayv2/index.ts b/clients/client-apigatewayv2/src/index.ts similarity index 100% rename from clients/client-apigatewayv2/index.ts rename to clients/client-apigatewayv2/src/index.ts diff --git a/clients/client-apigatewayv2/models/index.ts b/clients/client-apigatewayv2/src/models/index.ts similarity index 100% rename from clients/client-apigatewayv2/models/index.ts rename to clients/client-apigatewayv2/src/models/index.ts diff --git a/clients/client-apigatewayv2/models/models_0.ts b/clients/client-apigatewayv2/src/models/models_0.ts similarity index 100% rename from clients/client-apigatewayv2/models/models_0.ts rename to clients/client-apigatewayv2/src/models/models_0.ts diff --git a/clients/client-apigatewayv2/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-apigatewayv2/protocols/Aws_restJson1.ts rename to clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-apigatewayv2/src/runtimeConfig.browser.ts b/clients/client-apigatewayv2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cea475c5ff1b --- /dev/null +++ b/clients/client-apigatewayv2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApiGatewayV2ClientConfig } from "./ApiGatewayV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apigatewayv2/runtimeConfig.native.ts b/clients/client-apigatewayv2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-apigatewayv2/runtimeConfig.native.ts rename to clients/client-apigatewayv2/src/runtimeConfig.native.ts diff --git a/clients/client-apigatewayv2/runtimeConfig.shared.ts b/clients/client-apigatewayv2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-apigatewayv2/runtimeConfig.shared.ts rename to clients/client-apigatewayv2/src/runtimeConfig.shared.ts diff --git a/clients/client-apigatewayv2/src/runtimeConfig.ts b/clients/client-apigatewayv2/src/runtimeConfig.ts new file mode 100644 index 000000000000..5daf6d7d0fe9 --- /dev/null +++ b/clients/client-apigatewayv2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApiGatewayV2ClientConfig } from "./ApiGatewayV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apigatewayv2/tsconfig.es.json b/clients/client-apigatewayv2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-apigatewayv2/tsconfig.es.json +++ b/clients/client-apigatewayv2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-apigatewayv2/tsconfig.json b/clients/client-apigatewayv2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-apigatewayv2/tsconfig.json +++ b/clients/client-apigatewayv2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-apigatewayv2/tsconfig.types.json b/clients/client-apigatewayv2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-apigatewayv2/tsconfig.types.json +++ b/clients/client-apigatewayv2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-app-mesh/.gitignore b/clients/client-app-mesh/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-app-mesh/.gitignore +++ b/clients/client-app-mesh/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-app-mesh/package.json b/clients/client-app-mesh/package.json index 0bc6f5f5c4a5..f6356a716751 100644 --- a/clients/client-app-mesh/package.json +++ b/clients/client-app-mesh/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-app-mesh", "repository": { "type": "git", diff --git a/clients/client-app-mesh/runtimeConfig.browser.ts b/clients/client-app-mesh/runtimeConfig.browser.ts deleted file mode 100644 index 7730023bd39c..000000000000 --- a/clients/client-app-mesh/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppMeshClientConfig } from "./AppMeshClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppMeshClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-app-mesh/runtimeConfig.ts b/clients/client-app-mesh/runtimeConfig.ts deleted file mode 100644 index 9af2760e6b50..000000000000 --- a/clients/client-app-mesh/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppMeshClientConfig } from "./AppMeshClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppMeshClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-app-mesh/AppMesh.ts b/clients/client-app-mesh/src/AppMesh.ts similarity index 100% rename from clients/client-app-mesh/AppMesh.ts rename to clients/client-app-mesh/src/AppMesh.ts diff --git a/clients/client-app-mesh/AppMeshClient.ts b/clients/client-app-mesh/src/AppMeshClient.ts similarity index 100% rename from clients/client-app-mesh/AppMeshClient.ts rename to clients/client-app-mesh/src/AppMeshClient.ts diff --git a/clients/client-app-mesh/commands/CreateGatewayRouteCommand.ts b/clients/client-app-mesh/src/commands/CreateGatewayRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateGatewayRouteCommand.ts rename to clients/client-app-mesh/src/commands/CreateGatewayRouteCommand.ts diff --git a/clients/client-app-mesh/commands/CreateMeshCommand.ts b/clients/client-app-mesh/src/commands/CreateMeshCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateMeshCommand.ts rename to clients/client-app-mesh/src/commands/CreateMeshCommand.ts diff --git a/clients/client-app-mesh/commands/CreateRouteCommand.ts b/clients/client-app-mesh/src/commands/CreateRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateRouteCommand.ts rename to clients/client-app-mesh/src/commands/CreateRouteCommand.ts diff --git a/clients/client-app-mesh/commands/CreateVirtualGatewayCommand.ts b/clients/client-app-mesh/src/commands/CreateVirtualGatewayCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateVirtualGatewayCommand.ts rename to clients/client-app-mesh/src/commands/CreateVirtualGatewayCommand.ts diff --git a/clients/client-app-mesh/commands/CreateVirtualNodeCommand.ts b/clients/client-app-mesh/src/commands/CreateVirtualNodeCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateVirtualNodeCommand.ts rename to clients/client-app-mesh/src/commands/CreateVirtualNodeCommand.ts diff --git a/clients/client-app-mesh/commands/CreateVirtualRouterCommand.ts b/clients/client-app-mesh/src/commands/CreateVirtualRouterCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateVirtualRouterCommand.ts rename to clients/client-app-mesh/src/commands/CreateVirtualRouterCommand.ts diff --git a/clients/client-app-mesh/commands/CreateVirtualServiceCommand.ts b/clients/client-app-mesh/src/commands/CreateVirtualServiceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/CreateVirtualServiceCommand.ts rename to clients/client-app-mesh/src/commands/CreateVirtualServiceCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteGatewayRouteCommand.ts b/clients/client-app-mesh/src/commands/DeleteGatewayRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteGatewayRouteCommand.ts rename to clients/client-app-mesh/src/commands/DeleteGatewayRouteCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteMeshCommand.ts b/clients/client-app-mesh/src/commands/DeleteMeshCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteMeshCommand.ts rename to clients/client-app-mesh/src/commands/DeleteMeshCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteRouteCommand.ts b/clients/client-app-mesh/src/commands/DeleteRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteRouteCommand.ts rename to clients/client-app-mesh/src/commands/DeleteRouteCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteVirtualGatewayCommand.ts b/clients/client-app-mesh/src/commands/DeleteVirtualGatewayCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteVirtualGatewayCommand.ts rename to clients/client-app-mesh/src/commands/DeleteVirtualGatewayCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteVirtualNodeCommand.ts b/clients/client-app-mesh/src/commands/DeleteVirtualNodeCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteVirtualNodeCommand.ts rename to clients/client-app-mesh/src/commands/DeleteVirtualNodeCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteVirtualRouterCommand.ts b/clients/client-app-mesh/src/commands/DeleteVirtualRouterCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteVirtualRouterCommand.ts rename to clients/client-app-mesh/src/commands/DeleteVirtualRouterCommand.ts diff --git a/clients/client-app-mesh/commands/DeleteVirtualServiceCommand.ts b/clients/client-app-mesh/src/commands/DeleteVirtualServiceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DeleteVirtualServiceCommand.ts rename to clients/client-app-mesh/src/commands/DeleteVirtualServiceCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeGatewayRouteCommand.ts b/clients/client-app-mesh/src/commands/DescribeGatewayRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeGatewayRouteCommand.ts rename to clients/client-app-mesh/src/commands/DescribeGatewayRouteCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeMeshCommand.ts b/clients/client-app-mesh/src/commands/DescribeMeshCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeMeshCommand.ts rename to clients/client-app-mesh/src/commands/DescribeMeshCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeRouteCommand.ts b/clients/client-app-mesh/src/commands/DescribeRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeRouteCommand.ts rename to clients/client-app-mesh/src/commands/DescribeRouteCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeVirtualGatewayCommand.ts b/clients/client-app-mesh/src/commands/DescribeVirtualGatewayCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeVirtualGatewayCommand.ts rename to clients/client-app-mesh/src/commands/DescribeVirtualGatewayCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeVirtualNodeCommand.ts b/clients/client-app-mesh/src/commands/DescribeVirtualNodeCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeVirtualNodeCommand.ts rename to clients/client-app-mesh/src/commands/DescribeVirtualNodeCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeVirtualRouterCommand.ts b/clients/client-app-mesh/src/commands/DescribeVirtualRouterCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeVirtualRouterCommand.ts rename to clients/client-app-mesh/src/commands/DescribeVirtualRouterCommand.ts diff --git a/clients/client-app-mesh/commands/DescribeVirtualServiceCommand.ts b/clients/client-app-mesh/src/commands/DescribeVirtualServiceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/DescribeVirtualServiceCommand.ts rename to clients/client-app-mesh/src/commands/DescribeVirtualServiceCommand.ts diff --git a/clients/client-app-mesh/commands/ListGatewayRoutesCommand.ts b/clients/client-app-mesh/src/commands/ListGatewayRoutesCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListGatewayRoutesCommand.ts rename to clients/client-app-mesh/src/commands/ListGatewayRoutesCommand.ts diff --git a/clients/client-app-mesh/commands/ListMeshesCommand.ts b/clients/client-app-mesh/src/commands/ListMeshesCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListMeshesCommand.ts rename to clients/client-app-mesh/src/commands/ListMeshesCommand.ts diff --git a/clients/client-app-mesh/commands/ListRoutesCommand.ts b/clients/client-app-mesh/src/commands/ListRoutesCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListRoutesCommand.ts rename to clients/client-app-mesh/src/commands/ListRoutesCommand.ts diff --git a/clients/client-app-mesh/commands/ListTagsForResourceCommand.ts b/clients/client-app-mesh/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListTagsForResourceCommand.ts rename to clients/client-app-mesh/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-app-mesh/commands/ListVirtualGatewaysCommand.ts b/clients/client-app-mesh/src/commands/ListVirtualGatewaysCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListVirtualGatewaysCommand.ts rename to clients/client-app-mesh/src/commands/ListVirtualGatewaysCommand.ts diff --git a/clients/client-app-mesh/commands/ListVirtualNodesCommand.ts b/clients/client-app-mesh/src/commands/ListVirtualNodesCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListVirtualNodesCommand.ts rename to clients/client-app-mesh/src/commands/ListVirtualNodesCommand.ts diff --git a/clients/client-app-mesh/commands/ListVirtualRoutersCommand.ts b/clients/client-app-mesh/src/commands/ListVirtualRoutersCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListVirtualRoutersCommand.ts rename to clients/client-app-mesh/src/commands/ListVirtualRoutersCommand.ts diff --git a/clients/client-app-mesh/commands/ListVirtualServicesCommand.ts b/clients/client-app-mesh/src/commands/ListVirtualServicesCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/ListVirtualServicesCommand.ts rename to clients/client-app-mesh/src/commands/ListVirtualServicesCommand.ts diff --git a/clients/client-app-mesh/commands/TagResourceCommand.ts b/clients/client-app-mesh/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/TagResourceCommand.ts rename to clients/client-app-mesh/src/commands/TagResourceCommand.ts diff --git a/clients/client-app-mesh/commands/UntagResourceCommand.ts b/clients/client-app-mesh/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UntagResourceCommand.ts rename to clients/client-app-mesh/src/commands/UntagResourceCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateGatewayRouteCommand.ts b/clients/client-app-mesh/src/commands/UpdateGatewayRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateGatewayRouteCommand.ts rename to clients/client-app-mesh/src/commands/UpdateGatewayRouteCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateMeshCommand.ts b/clients/client-app-mesh/src/commands/UpdateMeshCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateMeshCommand.ts rename to clients/client-app-mesh/src/commands/UpdateMeshCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateRouteCommand.ts b/clients/client-app-mesh/src/commands/UpdateRouteCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateRouteCommand.ts rename to clients/client-app-mesh/src/commands/UpdateRouteCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateVirtualGatewayCommand.ts b/clients/client-app-mesh/src/commands/UpdateVirtualGatewayCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateVirtualGatewayCommand.ts rename to clients/client-app-mesh/src/commands/UpdateVirtualGatewayCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateVirtualNodeCommand.ts b/clients/client-app-mesh/src/commands/UpdateVirtualNodeCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateVirtualNodeCommand.ts rename to clients/client-app-mesh/src/commands/UpdateVirtualNodeCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateVirtualRouterCommand.ts b/clients/client-app-mesh/src/commands/UpdateVirtualRouterCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateVirtualRouterCommand.ts rename to clients/client-app-mesh/src/commands/UpdateVirtualRouterCommand.ts diff --git a/clients/client-app-mesh/commands/UpdateVirtualServiceCommand.ts b/clients/client-app-mesh/src/commands/UpdateVirtualServiceCommand.ts similarity index 100% rename from clients/client-app-mesh/commands/UpdateVirtualServiceCommand.ts rename to clients/client-app-mesh/src/commands/UpdateVirtualServiceCommand.ts diff --git a/clients/client-app-mesh/endpoints.ts b/clients/client-app-mesh/src/endpoints.ts similarity index 100% rename from clients/client-app-mesh/endpoints.ts rename to clients/client-app-mesh/src/endpoints.ts diff --git a/clients/client-app-mesh/index.ts b/clients/client-app-mesh/src/index.ts similarity index 100% rename from clients/client-app-mesh/index.ts rename to clients/client-app-mesh/src/index.ts diff --git a/clients/client-app-mesh/models/index.ts b/clients/client-app-mesh/src/models/index.ts similarity index 100% rename from clients/client-app-mesh/models/index.ts rename to clients/client-app-mesh/src/models/index.ts diff --git a/clients/client-app-mesh/models/models_0.ts b/clients/client-app-mesh/src/models/models_0.ts similarity index 100% rename from clients/client-app-mesh/models/models_0.ts rename to clients/client-app-mesh/src/models/models_0.ts diff --git a/clients/client-app-mesh/pagination/Interfaces.ts b/clients/client-app-mesh/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-app-mesh/pagination/Interfaces.ts rename to clients/client-app-mesh/src/pagination/Interfaces.ts diff --git a/clients/client-app-mesh/pagination/ListGatewayRoutesPaginator.ts b/clients/client-app-mesh/src/pagination/ListGatewayRoutesPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListGatewayRoutesPaginator.ts rename to clients/client-app-mesh/src/pagination/ListGatewayRoutesPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListMeshesPaginator.ts b/clients/client-app-mesh/src/pagination/ListMeshesPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListMeshesPaginator.ts rename to clients/client-app-mesh/src/pagination/ListMeshesPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListRoutesPaginator.ts b/clients/client-app-mesh/src/pagination/ListRoutesPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListRoutesPaginator.ts rename to clients/client-app-mesh/src/pagination/ListRoutesPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListTagsForResourcePaginator.ts b/clients/client-app-mesh/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListTagsForResourcePaginator.ts rename to clients/client-app-mesh/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-app-mesh/pagination/ListVirtualGatewaysPaginator.ts b/clients/client-app-mesh/src/pagination/ListVirtualGatewaysPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListVirtualGatewaysPaginator.ts rename to clients/client-app-mesh/src/pagination/ListVirtualGatewaysPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListVirtualNodesPaginator.ts b/clients/client-app-mesh/src/pagination/ListVirtualNodesPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListVirtualNodesPaginator.ts rename to clients/client-app-mesh/src/pagination/ListVirtualNodesPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListVirtualRoutersPaginator.ts b/clients/client-app-mesh/src/pagination/ListVirtualRoutersPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListVirtualRoutersPaginator.ts rename to clients/client-app-mesh/src/pagination/ListVirtualRoutersPaginator.ts diff --git a/clients/client-app-mesh/pagination/ListVirtualServicesPaginator.ts b/clients/client-app-mesh/src/pagination/ListVirtualServicesPaginator.ts similarity index 100% rename from clients/client-app-mesh/pagination/ListVirtualServicesPaginator.ts rename to clients/client-app-mesh/src/pagination/ListVirtualServicesPaginator.ts diff --git a/clients/client-app-mesh/protocols/Aws_restJson1.ts b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-app-mesh/protocols/Aws_restJson1.ts rename to clients/client-app-mesh/src/protocols/Aws_restJson1.ts diff --git a/clients/client-app-mesh/src/runtimeConfig.browser.ts b/clients/client-app-mesh/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b883bebea5a0 --- /dev/null +++ b/clients/client-app-mesh/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppMeshClientConfig } from "./AppMeshClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppMeshClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-app-mesh/runtimeConfig.native.ts b/clients/client-app-mesh/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-app-mesh/runtimeConfig.native.ts rename to clients/client-app-mesh/src/runtimeConfig.native.ts diff --git a/clients/client-app-mesh/runtimeConfig.shared.ts b/clients/client-app-mesh/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-app-mesh/runtimeConfig.shared.ts rename to clients/client-app-mesh/src/runtimeConfig.shared.ts diff --git a/clients/client-app-mesh/src/runtimeConfig.ts b/clients/client-app-mesh/src/runtimeConfig.ts new file mode 100644 index 000000000000..793a8a018723 --- /dev/null +++ b/clients/client-app-mesh/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppMeshClientConfig } from "./AppMeshClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppMeshClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-app-mesh/tsconfig.es.json b/clients/client-app-mesh/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-app-mesh/tsconfig.es.json +++ b/clients/client-app-mesh/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-app-mesh/tsconfig.json b/clients/client-app-mesh/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-app-mesh/tsconfig.json +++ b/clients/client-app-mesh/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-app-mesh/tsconfig.types.json b/clients/client-app-mesh/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-app-mesh/tsconfig.types.json +++ b/clients/client-app-mesh/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-appconfig/.gitignore b/clients/client-appconfig/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-appconfig/.gitignore +++ b/clients/client-appconfig/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-appconfig/package.json b/clients/client-appconfig/package.json index fed2e5c672c0..9a21ac767ac8 100644 --- a/clients/client-appconfig/package.json +++ b/clients/client-appconfig/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-appconfig", "repository": { "type": "git", diff --git a/clients/client-appconfig/runtimeConfig.browser.ts b/clients/client-appconfig/runtimeConfig.browser.ts deleted file mode 100644 index 8d5f0261c3b4..000000000000 --- a/clients/client-appconfig/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppConfigClientConfig } from "./AppConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppConfigClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appconfig/runtimeConfig.ts b/clients/client-appconfig/runtimeConfig.ts deleted file mode 100644 index 1ad6702c8da2..000000000000 --- a/clients/client-appconfig/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppConfigClientConfig } from "./AppConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppConfigClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appconfig/AppConfig.ts b/clients/client-appconfig/src/AppConfig.ts similarity index 100% rename from clients/client-appconfig/AppConfig.ts rename to clients/client-appconfig/src/AppConfig.ts diff --git a/clients/client-appconfig/AppConfigClient.ts b/clients/client-appconfig/src/AppConfigClient.ts similarity index 100% rename from clients/client-appconfig/AppConfigClient.ts rename to clients/client-appconfig/src/AppConfigClient.ts diff --git a/clients/client-appconfig/commands/CreateApplicationCommand.ts b/clients/client-appconfig/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/CreateApplicationCommand.ts rename to clients/client-appconfig/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-appconfig/commands/CreateConfigurationProfileCommand.ts b/clients/client-appconfig/src/commands/CreateConfigurationProfileCommand.ts similarity index 100% rename from clients/client-appconfig/commands/CreateConfigurationProfileCommand.ts rename to clients/client-appconfig/src/commands/CreateConfigurationProfileCommand.ts diff --git a/clients/client-appconfig/commands/CreateDeploymentStrategyCommand.ts b/clients/client-appconfig/src/commands/CreateDeploymentStrategyCommand.ts similarity index 100% rename from clients/client-appconfig/commands/CreateDeploymentStrategyCommand.ts rename to clients/client-appconfig/src/commands/CreateDeploymentStrategyCommand.ts diff --git a/clients/client-appconfig/commands/CreateEnvironmentCommand.ts b/clients/client-appconfig/src/commands/CreateEnvironmentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/CreateEnvironmentCommand.ts rename to clients/client-appconfig/src/commands/CreateEnvironmentCommand.ts diff --git a/clients/client-appconfig/commands/CreateHostedConfigurationVersionCommand.ts b/clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts similarity index 100% rename from clients/client-appconfig/commands/CreateHostedConfigurationVersionCommand.ts rename to clients/client-appconfig/src/commands/CreateHostedConfigurationVersionCommand.ts diff --git a/clients/client-appconfig/commands/DeleteApplicationCommand.ts b/clients/client-appconfig/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/DeleteApplicationCommand.ts rename to clients/client-appconfig/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-appconfig/commands/DeleteConfigurationProfileCommand.ts b/clients/client-appconfig/src/commands/DeleteConfigurationProfileCommand.ts similarity index 100% rename from clients/client-appconfig/commands/DeleteConfigurationProfileCommand.ts rename to clients/client-appconfig/src/commands/DeleteConfigurationProfileCommand.ts diff --git a/clients/client-appconfig/commands/DeleteDeploymentStrategyCommand.ts b/clients/client-appconfig/src/commands/DeleteDeploymentStrategyCommand.ts similarity index 100% rename from clients/client-appconfig/commands/DeleteDeploymentStrategyCommand.ts rename to clients/client-appconfig/src/commands/DeleteDeploymentStrategyCommand.ts diff --git a/clients/client-appconfig/commands/DeleteEnvironmentCommand.ts b/clients/client-appconfig/src/commands/DeleteEnvironmentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/DeleteEnvironmentCommand.ts rename to clients/client-appconfig/src/commands/DeleteEnvironmentCommand.ts diff --git a/clients/client-appconfig/commands/DeleteHostedConfigurationVersionCommand.ts b/clients/client-appconfig/src/commands/DeleteHostedConfigurationVersionCommand.ts similarity index 100% rename from clients/client-appconfig/commands/DeleteHostedConfigurationVersionCommand.ts rename to clients/client-appconfig/src/commands/DeleteHostedConfigurationVersionCommand.ts diff --git a/clients/client-appconfig/commands/GetApplicationCommand.ts b/clients/client-appconfig/src/commands/GetApplicationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetApplicationCommand.ts rename to clients/client-appconfig/src/commands/GetApplicationCommand.ts diff --git a/clients/client-appconfig/commands/GetConfigurationCommand.ts b/clients/client-appconfig/src/commands/GetConfigurationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetConfigurationCommand.ts rename to clients/client-appconfig/src/commands/GetConfigurationCommand.ts diff --git a/clients/client-appconfig/commands/GetConfigurationProfileCommand.ts b/clients/client-appconfig/src/commands/GetConfigurationProfileCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetConfigurationProfileCommand.ts rename to clients/client-appconfig/src/commands/GetConfigurationProfileCommand.ts diff --git a/clients/client-appconfig/commands/GetDeploymentCommand.ts b/clients/client-appconfig/src/commands/GetDeploymentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetDeploymentCommand.ts rename to clients/client-appconfig/src/commands/GetDeploymentCommand.ts diff --git a/clients/client-appconfig/commands/GetDeploymentStrategyCommand.ts b/clients/client-appconfig/src/commands/GetDeploymentStrategyCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetDeploymentStrategyCommand.ts rename to clients/client-appconfig/src/commands/GetDeploymentStrategyCommand.ts diff --git a/clients/client-appconfig/commands/GetEnvironmentCommand.ts b/clients/client-appconfig/src/commands/GetEnvironmentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetEnvironmentCommand.ts rename to clients/client-appconfig/src/commands/GetEnvironmentCommand.ts diff --git a/clients/client-appconfig/commands/GetHostedConfigurationVersionCommand.ts b/clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts similarity index 100% rename from clients/client-appconfig/commands/GetHostedConfigurationVersionCommand.ts rename to clients/client-appconfig/src/commands/GetHostedConfigurationVersionCommand.ts diff --git a/clients/client-appconfig/commands/ListApplicationsCommand.ts b/clients/client-appconfig/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListApplicationsCommand.ts rename to clients/client-appconfig/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-appconfig/commands/ListConfigurationProfilesCommand.ts b/clients/client-appconfig/src/commands/ListConfigurationProfilesCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListConfigurationProfilesCommand.ts rename to clients/client-appconfig/src/commands/ListConfigurationProfilesCommand.ts diff --git a/clients/client-appconfig/commands/ListDeploymentStrategiesCommand.ts b/clients/client-appconfig/src/commands/ListDeploymentStrategiesCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListDeploymentStrategiesCommand.ts rename to clients/client-appconfig/src/commands/ListDeploymentStrategiesCommand.ts diff --git a/clients/client-appconfig/commands/ListDeploymentsCommand.ts b/clients/client-appconfig/src/commands/ListDeploymentsCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListDeploymentsCommand.ts rename to clients/client-appconfig/src/commands/ListDeploymentsCommand.ts diff --git a/clients/client-appconfig/commands/ListEnvironmentsCommand.ts b/clients/client-appconfig/src/commands/ListEnvironmentsCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListEnvironmentsCommand.ts rename to clients/client-appconfig/src/commands/ListEnvironmentsCommand.ts diff --git a/clients/client-appconfig/commands/ListHostedConfigurationVersionsCommand.ts b/clients/client-appconfig/src/commands/ListHostedConfigurationVersionsCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListHostedConfigurationVersionsCommand.ts rename to clients/client-appconfig/src/commands/ListHostedConfigurationVersionsCommand.ts diff --git a/clients/client-appconfig/commands/ListTagsForResourceCommand.ts b/clients/client-appconfig/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ListTagsForResourceCommand.ts rename to clients/client-appconfig/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-appconfig/commands/StartDeploymentCommand.ts b/clients/client-appconfig/src/commands/StartDeploymentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/StartDeploymentCommand.ts rename to clients/client-appconfig/src/commands/StartDeploymentCommand.ts diff --git a/clients/client-appconfig/commands/StopDeploymentCommand.ts b/clients/client-appconfig/src/commands/StopDeploymentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/StopDeploymentCommand.ts rename to clients/client-appconfig/src/commands/StopDeploymentCommand.ts diff --git a/clients/client-appconfig/commands/TagResourceCommand.ts b/clients/client-appconfig/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-appconfig/commands/TagResourceCommand.ts rename to clients/client-appconfig/src/commands/TagResourceCommand.ts diff --git a/clients/client-appconfig/commands/UntagResourceCommand.ts b/clients/client-appconfig/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-appconfig/commands/UntagResourceCommand.ts rename to clients/client-appconfig/src/commands/UntagResourceCommand.ts diff --git a/clients/client-appconfig/commands/UpdateApplicationCommand.ts b/clients/client-appconfig/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/UpdateApplicationCommand.ts rename to clients/client-appconfig/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-appconfig/commands/UpdateConfigurationProfileCommand.ts b/clients/client-appconfig/src/commands/UpdateConfigurationProfileCommand.ts similarity index 100% rename from clients/client-appconfig/commands/UpdateConfigurationProfileCommand.ts rename to clients/client-appconfig/src/commands/UpdateConfigurationProfileCommand.ts diff --git a/clients/client-appconfig/commands/UpdateDeploymentStrategyCommand.ts b/clients/client-appconfig/src/commands/UpdateDeploymentStrategyCommand.ts similarity index 100% rename from clients/client-appconfig/commands/UpdateDeploymentStrategyCommand.ts rename to clients/client-appconfig/src/commands/UpdateDeploymentStrategyCommand.ts diff --git a/clients/client-appconfig/commands/UpdateEnvironmentCommand.ts b/clients/client-appconfig/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-appconfig/commands/UpdateEnvironmentCommand.ts rename to clients/client-appconfig/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-appconfig/commands/ValidateConfigurationCommand.ts b/clients/client-appconfig/src/commands/ValidateConfigurationCommand.ts similarity index 100% rename from clients/client-appconfig/commands/ValidateConfigurationCommand.ts rename to clients/client-appconfig/src/commands/ValidateConfigurationCommand.ts diff --git a/clients/client-appconfig/endpoints.ts b/clients/client-appconfig/src/endpoints.ts similarity index 100% rename from clients/client-appconfig/endpoints.ts rename to clients/client-appconfig/src/endpoints.ts diff --git a/clients/client-appconfig/index.ts b/clients/client-appconfig/src/index.ts similarity index 100% rename from clients/client-appconfig/index.ts rename to clients/client-appconfig/src/index.ts diff --git a/clients/client-appconfig/models/index.ts b/clients/client-appconfig/src/models/index.ts similarity index 100% rename from clients/client-appconfig/models/index.ts rename to clients/client-appconfig/src/models/index.ts diff --git a/clients/client-appconfig/models/models_0.ts b/clients/client-appconfig/src/models/models_0.ts similarity index 100% rename from clients/client-appconfig/models/models_0.ts rename to clients/client-appconfig/src/models/models_0.ts diff --git a/clients/client-appconfig/pagination/Interfaces.ts b/clients/client-appconfig/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-appconfig/pagination/Interfaces.ts rename to clients/client-appconfig/src/pagination/Interfaces.ts diff --git a/clients/client-appconfig/pagination/ListApplicationsPaginator.ts b/clients/client-appconfig/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListApplicationsPaginator.ts rename to clients/client-appconfig/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-appconfig/pagination/ListConfigurationProfilesPaginator.ts b/clients/client-appconfig/src/pagination/ListConfigurationProfilesPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListConfigurationProfilesPaginator.ts rename to clients/client-appconfig/src/pagination/ListConfigurationProfilesPaginator.ts diff --git a/clients/client-appconfig/pagination/ListDeploymentStrategiesPaginator.ts b/clients/client-appconfig/src/pagination/ListDeploymentStrategiesPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListDeploymentStrategiesPaginator.ts rename to clients/client-appconfig/src/pagination/ListDeploymentStrategiesPaginator.ts diff --git a/clients/client-appconfig/pagination/ListDeploymentsPaginator.ts b/clients/client-appconfig/src/pagination/ListDeploymentsPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListDeploymentsPaginator.ts rename to clients/client-appconfig/src/pagination/ListDeploymentsPaginator.ts diff --git a/clients/client-appconfig/pagination/ListEnvironmentsPaginator.ts b/clients/client-appconfig/src/pagination/ListEnvironmentsPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListEnvironmentsPaginator.ts rename to clients/client-appconfig/src/pagination/ListEnvironmentsPaginator.ts diff --git a/clients/client-appconfig/pagination/ListHostedConfigurationVersionsPaginator.ts b/clients/client-appconfig/src/pagination/ListHostedConfigurationVersionsPaginator.ts similarity index 100% rename from clients/client-appconfig/pagination/ListHostedConfigurationVersionsPaginator.ts rename to clients/client-appconfig/src/pagination/ListHostedConfigurationVersionsPaginator.ts diff --git a/clients/client-appconfig/protocols/Aws_restJson1.ts b/clients/client-appconfig/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-appconfig/protocols/Aws_restJson1.ts rename to clients/client-appconfig/src/protocols/Aws_restJson1.ts diff --git a/clients/client-appconfig/src/runtimeConfig.browser.ts b/clients/client-appconfig/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f811eb43dde5 --- /dev/null +++ b/clients/client-appconfig/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppConfigClientConfig } from "./AppConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppConfigClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appconfig/runtimeConfig.native.ts b/clients/client-appconfig/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-appconfig/runtimeConfig.native.ts rename to clients/client-appconfig/src/runtimeConfig.native.ts diff --git a/clients/client-appconfig/runtimeConfig.shared.ts b/clients/client-appconfig/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-appconfig/runtimeConfig.shared.ts rename to clients/client-appconfig/src/runtimeConfig.shared.ts diff --git a/clients/client-appconfig/src/runtimeConfig.ts b/clients/client-appconfig/src/runtimeConfig.ts new file mode 100644 index 000000000000..76bdbefb7741 --- /dev/null +++ b/clients/client-appconfig/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppConfigClientConfig } from "./AppConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppConfigClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appconfig/tsconfig.es.json b/clients/client-appconfig/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-appconfig/tsconfig.es.json +++ b/clients/client-appconfig/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-appconfig/tsconfig.json b/clients/client-appconfig/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-appconfig/tsconfig.json +++ b/clients/client-appconfig/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-appconfig/tsconfig.types.json b/clients/client-appconfig/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-appconfig/tsconfig.types.json +++ b/clients/client-appconfig/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-appflow/.gitignore b/clients/client-appflow/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-appflow/.gitignore +++ b/clients/client-appflow/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-appflow/package.json b/clients/client-appflow/package.json index 91040c7e7557..71f2ecfbdef2 100644 --- a/clients/client-appflow/package.json +++ b/clients/client-appflow/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-appflow", "repository": { "type": "git", diff --git a/clients/client-appflow/runtimeConfig.browser.ts b/clients/client-appflow/runtimeConfig.browser.ts deleted file mode 100644 index e0b67b32b30e..000000000000 --- a/clients/client-appflow/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppflowClientConfig } from "./AppflowClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppflowClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appflow/runtimeConfig.ts b/clients/client-appflow/runtimeConfig.ts deleted file mode 100644 index 99c8ccbeaff7..000000000000 --- a/clients/client-appflow/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppflowClientConfig } from "./AppflowClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppflowClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appflow/Appflow.ts b/clients/client-appflow/src/Appflow.ts similarity index 100% rename from clients/client-appflow/Appflow.ts rename to clients/client-appflow/src/Appflow.ts diff --git a/clients/client-appflow/AppflowClient.ts b/clients/client-appflow/src/AppflowClient.ts similarity index 100% rename from clients/client-appflow/AppflowClient.ts rename to clients/client-appflow/src/AppflowClient.ts diff --git a/clients/client-appflow/commands/CreateConnectorProfileCommand.ts b/clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts similarity index 100% rename from clients/client-appflow/commands/CreateConnectorProfileCommand.ts rename to clients/client-appflow/src/commands/CreateConnectorProfileCommand.ts diff --git a/clients/client-appflow/commands/CreateFlowCommand.ts b/clients/client-appflow/src/commands/CreateFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/CreateFlowCommand.ts rename to clients/client-appflow/src/commands/CreateFlowCommand.ts diff --git a/clients/client-appflow/commands/DeleteConnectorProfileCommand.ts b/clients/client-appflow/src/commands/DeleteConnectorProfileCommand.ts similarity index 100% rename from clients/client-appflow/commands/DeleteConnectorProfileCommand.ts rename to clients/client-appflow/src/commands/DeleteConnectorProfileCommand.ts diff --git a/clients/client-appflow/commands/DeleteFlowCommand.ts b/clients/client-appflow/src/commands/DeleteFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/DeleteFlowCommand.ts rename to clients/client-appflow/src/commands/DeleteFlowCommand.ts diff --git a/clients/client-appflow/commands/DescribeConnectorEntityCommand.ts b/clients/client-appflow/src/commands/DescribeConnectorEntityCommand.ts similarity index 100% rename from clients/client-appflow/commands/DescribeConnectorEntityCommand.ts rename to clients/client-appflow/src/commands/DescribeConnectorEntityCommand.ts diff --git a/clients/client-appflow/commands/DescribeConnectorProfilesCommand.ts b/clients/client-appflow/src/commands/DescribeConnectorProfilesCommand.ts similarity index 100% rename from clients/client-appflow/commands/DescribeConnectorProfilesCommand.ts rename to clients/client-appflow/src/commands/DescribeConnectorProfilesCommand.ts diff --git a/clients/client-appflow/commands/DescribeConnectorsCommand.ts b/clients/client-appflow/src/commands/DescribeConnectorsCommand.ts similarity index 100% rename from clients/client-appflow/commands/DescribeConnectorsCommand.ts rename to clients/client-appflow/src/commands/DescribeConnectorsCommand.ts diff --git a/clients/client-appflow/commands/DescribeFlowCommand.ts b/clients/client-appflow/src/commands/DescribeFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/DescribeFlowCommand.ts rename to clients/client-appflow/src/commands/DescribeFlowCommand.ts diff --git a/clients/client-appflow/commands/DescribeFlowExecutionRecordsCommand.ts b/clients/client-appflow/src/commands/DescribeFlowExecutionRecordsCommand.ts similarity index 100% rename from clients/client-appflow/commands/DescribeFlowExecutionRecordsCommand.ts rename to clients/client-appflow/src/commands/DescribeFlowExecutionRecordsCommand.ts diff --git a/clients/client-appflow/commands/ListConnectorEntitiesCommand.ts b/clients/client-appflow/src/commands/ListConnectorEntitiesCommand.ts similarity index 100% rename from clients/client-appflow/commands/ListConnectorEntitiesCommand.ts rename to clients/client-appflow/src/commands/ListConnectorEntitiesCommand.ts diff --git a/clients/client-appflow/commands/ListFlowsCommand.ts b/clients/client-appflow/src/commands/ListFlowsCommand.ts similarity index 100% rename from clients/client-appflow/commands/ListFlowsCommand.ts rename to clients/client-appflow/src/commands/ListFlowsCommand.ts diff --git a/clients/client-appflow/commands/ListTagsForResourceCommand.ts b/clients/client-appflow/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-appflow/commands/ListTagsForResourceCommand.ts rename to clients/client-appflow/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-appflow/commands/StartFlowCommand.ts b/clients/client-appflow/src/commands/StartFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/StartFlowCommand.ts rename to clients/client-appflow/src/commands/StartFlowCommand.ts diff --git a/clients/client-appflow/commands/StopFlowCommand.ts b/clients/client-appflow/src/commands/StopFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/StopFlowCommand.ts rename to clients/client-appflow/src/commands/StopFlowCommand.ts diff --git a/clients/client-appflow/commands/TagResourceCommand.ts b/clients/client-appflow/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-appflow/commands/TagResourceCommand.ts rename to clients/client-appflow/src/commands/TagResourceCommand.ts diff --git a/clients/client-appflow/commands/UntagResourceCommand.ts b/clients/client-appflow/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-appflow/commands/UntagResourceCommand.ts rename to clients/client-appflow/src/commands/UntagResourceCommand.ts diff --git a/clients/client-appflow/commands/UpdateConnectorProfileCommand.ts b/clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts similarity index 100% rename from clients/client-appflow/commands/UpdateConnectorProfileCommand.ts rename to clients/client-appflow/src/commands/UpdateConnectorProfileCommand.ts diff --git a/clients/client-appflow/commands/UpdateFlowCommand.ts b/clients/client-appflow/src/commands/UpdateFlowCommand.ts similarity index 100% rename from clients/client-appflow/commands/UpdateFlowCommand.ts rename to clients/client-appflow/src/commands/UpdateFlowCommand.ts diff --git a/clients/client-appflow/endpoints.ts b/clients/client-appflow/src/endpoints.ts similarity index 100% rename from clients/client-appflow/endpoints.ts rename to clients/client-appflow/src/endpoints.ts diff --git a/clients/client-appflow/index.ts b/clients/client-appflow/src/index.ts similarity index 100% rename from clients/client-appflow/index.ts rename to clients/client-appflow/src/index.ts diff --git a/clients/client-appflow/models/index.ts b/clients/client-appflow/src/models/index.ts similarity index 100% rename from clients/client-appflow/models/index.ts rename to clients/client-appflow/src/models/index.ts diff --git a/clients/client-appflow/models/models_0.ts b/clients/client-appflow/src/models/models_0.ts similarity index 100% rename from clients/client-appflow/models/models_0.ts rename to clients/client-appflow/src/models/models_0.ts diff --git a/clients/client-appflow/pagination/DescribeConnectorProfilesPaginator.ts b/clients/client-appflow/src/pagination/DescribeConnectorProfilesPaginator.ts similarity index 100% rename from clients/client-appflow/pagination/DescribeConnectorProfilesPaginator.ts rename to clients/client-appflow/src/pagination/DescribeConnectorProfilesPaginator.ts diff --git a/clients/client-appflow/pagination/DescribeConnectorsPaginator.ts b/clients/client-appflow/src/pagination/DescribeConnectorsPaginator.ts similarity index 100% rename from clients/client-appflow/pagination/DescribeConnectorsPaginator.ts rename to clients/client-appflow/src/pagination/DescribeConnectorsPaginator.ts diff --git a/clients/client-appflow/pagination/DescribeFlowExecutionRecordsPaginator.ts b/clients/client-appflow/src/pagination/DescribeFlowExecutionRecordsPaginator.ts similarity index 100% rename from clients/client-appflow/pagination/DescribeFlowExecutionRecordsPaginator.ts rename to clients/client-appflow/src/pagination/DescribeFlowExecutionRecordsPaginator.ts diff --git a/clients/client-appflow/pagination/Interfaces.ts b/clients/client-appflow/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-appflow/pagination/Interfaces.ts rename to clients/client-appflow/src/pagination/Interfaces.ts diff --git a/clients/client-appflow/pagination/ListFlowsPaginator.ts b/clients/client-appflow/src/pagination/ListFlowsPaginator.ts similarity index 100% rename from clients/client-appflow/pagination/ListFlowsPaginator.ts rename to clients/client-appflow/src/pagination/ListFlowsPaginator.ts diff --git a/clients/client-appflow/protocols/Aws_restJson1.ts b/clients/client-appflow/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-appflow/protocols/Aws_restJson1.ts rename to clients/client-appflow/src/protocols/Aws_restJson1.ts diff --git a/clients/client-appflow/src/runtimeConfig.browser.ts b/clients/client-appflow/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f4e6a09eff47 --- /dev/null +++ b/clients/client-appflow/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppflowClientConfig } from "./AppflowClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppflowClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appflow/runtimeConfig.native.ts b/clients/client-appflow/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-appflow/runtimeConfig.native.ts rename to clients/client-appflow/src/runtimeConfig.native.ts diff --git a/clients/client-appflow/runtimeConfig.shared.ts b/clients/client-appflow/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-appflow/runtimeConfig.shared.ts rename to clients/client-appflow/src/runtimeConfig.shared.ts diff --git a/clients/client-appflow/src/runtimeConfig.ts b/clients/client-appflow/src/runtimeConfig.ts new file mode 100644 index 000000000000..f1c07fb0a0d1 --- /dev/null +++ b/clients/client-appflow/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppflowClientConfig } from "./AppflowClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppflowClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appflow/tsconfig.es.json b/clients/client-appflow/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-appflow/tsconfig.es.json +++ b/clients/client-appflow/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-appflow/tsconfig.json b/clients/client-appflow/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-appflow/tsconfig.json +++ b/clients/client-appflow/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-appflow/tsconfig.types.json b/clients/client-appflow/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-appflow/tsconfig.types.json +++ b/clients/client-appflow/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-appintegrations/.gitignore b/clients/client-appintegrations/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-appintegrations/.gitignore +++ b/clients/client-appintegrations/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-appintegrations/package.json b/clients/client-appintegrations/package.json index 95acb1d47c31..accdc8e3d576 100644 --- a/clients/client-appintegrations/package.json +++ b/clients/client-appintegrations/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-appintegrations", "repository": { "type": "git", diff --git a/clients/client-appintegrations/runtimeConfig.browser.ts b/clients/client-appintegrations/runtimeConfig.browser.ts deleted file mode 100644 index 6f0fa000b762..000000000000 --- a/clients/client-appintegrations/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppIntegrationsClientConfig } from "./AppIntegrationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appintegrations/runtimeConfig.ts b/clients/client-appintegrations/runtimeConfig.ts deleted file mode 100644 index 03d29927befd..000000000000 --- a/clients/client-appintegrations/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppIntegrationsClientConfig } from "./AppIntegrationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appintegrations/AppIntegrations.ts b/clients/client-appintegrations/src/AppIntegrations.ts similarity index 100% rename from clients/client-appintegrations/AppIntegrations.ts rename to clients/client-appintegrations/src/AppIntegrations.ts diff --git a/clients/client-appintegrations/AppIntegrationsClient.ts b/clients/client-appintegrations/src/AppIntegrationsClient.ts similarity index 100% rename from clients/client-appintegrations/AppIntegrationsClient.ts rename to clients/client-appintegrations/src/AppIntegrationsClient.ts diff --git a/clients/client-appintegrations/commands/CreateEventIntegrationCommand.ts b/clients/client-appintegrations/src/commands/CreateEventIntegrationCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/CreateEventIntegrationCommand.ts rename to clients/client-appintegrations/src/commands/CreateEventIntegrationCommand.ts diff --git a/clients/client-appintegrations/commands/DeleteEventIntegrationCommand.ts b/clients/client-appintegrations/src/commands/DeleteEventIntegrationCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/DeleteEventIntegrationCommand.ts rename to clients/client-appintegrations/src/commands/DeleteEventIntegrationCommand.ts diff --git a/clients/client-appintegrations/commands/GetEventIntegrationCommand.ts b/clients/client-appintegrations/src/commands/GetEventIntegrationCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/GetEventIntegrationCommand.ts rename to clients/client-appintegrations/src/commands/GetEventIntegrationCommand.ts diff --git a/clients/client-appintegrations/commands/ListEventIntegrationAssociationsCommand.ts b/clients/client-appintegrations/src/commands/ListEventIntegrationAssociationsCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/ListEventIntegrationAssociationsCommand.ts rename to clients/client-appintegrations/src/commands/ListEventIntegrationAssociationsCommand.ts diff --git a/clients/client-appintegrations/commands/ListEventIntegrationsCommand.ts b/clients/client-appintegrations/src/commands/ListEventIntegrationsCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/ListEventIntegrationsCommand.ts rename to clients/client-appintegrations/src/commands/ListEventIntegrationsCommand.ts diff --git a/clients/client-appintegrations/commands/ListTagsForResourceCommand.ts b/clients/client-appintegrations/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/ListTagsForResourceCommand.ts rename to clients/client-appintegrations/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-appintegrations/commands/TagResourceCommand.ts b/clients/client-appintegrations/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/TagResourceCommand.ts rename to clients/client-appintegrations/src/commands/TagResourceCommand.ts diff --git a/clients/client-appintegrations/commands/UntagResourceCommand.ts b/clients/client-appintegrations/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/UntagResourceCommand.ts rename to clients/client-appintegrations/src/commands/UntagResourceCommand.ts diff --git a/clients/client-appintegrations/commands/UpdateEventIntegrationCommand.ts b/clients/client-appintegrations/src/commands/UpdateEventIntegrationCommand.ts similarity index 100% rename from clients/client-appintegrations/commands/UpdateEventIntegrationCommand.ts rename to clients/client-appintegrations/src/commands/UpdateEventIntegrationCommand.ts diff --git a/clients/client-appintegrations/endpoints.ts b/clients/client-appintegrations/src/endpoints.ts similarity index 100% rename from clients/client-appintegrations/endpoints.ts rename to clients/client-appintegrations/src/endpoints.ts diff --git a/clients/client-appintegrations/index.ts b/clients/client-appintegrations/src/index.ts similarity index 100% rename from clients/client-appintegrations/index.ts rename to clients/client-appintegrations/src/index.ts diff --git a/clients/client-appintegrations/models/index.ts b/clients/client-appintegrations/src/models/index.ts similarity index 100% rename from clients/client-appintegrations/models/index.ts rename to clients/client-appintegrations/src/models/index.ts diff --git a/clients/client-appintegrations/models/models_0.ts b/clients/client-appintegrations/src/models/models_0.ts similarity index 100% rename from clients/client-appintegrations/models/models_0.ts rename to clients/client-appintegrations/src/models/models_0.ts diff --git a/clients/client-appintegrations/protocols/Aws_restJson1.ts b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-appintegrations/protocols/Aws_restJson1.ts rename to clients/client-appintegrations/src/protocols/Aws_restJson1.ts diff --git a/clients/client-appintegrations/src/runtimeConfig.browser.ts b/clients/client-appintegrations/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..781176500a0f --- /dev/null +++ b/clients/client-appintegrations/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppIntegrationsClientConfig } from "./AppIntegrationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appintegrations/runtimeConfig.native.ts b/clients/client-appintegrations/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-appintegrations/runtimeConfig.native.ts rename to clients/client-appintegrations/src/runtimeConfig.native.ts diff --git a/clients/client-appintegrations/runtimeConfig.shared.ts b/clients/client-appintegrations/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-appintegrations/runtimeConfig.shared.ts rename to clients/client-appintegrations/src/runtimeConfig.shared.ts diff --git a/clients/client-appintegrations/src/runtimeConfig.ts b/clients/client-appintegrations/src/runtimeConfig.ts new file mode 100644 index 000000000000..562f7c9db1ea --- /dev/null +++ b/clients/client-appintegrations/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppIntegrationsClientConfig } from "./AppIntegrationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appintegrations/tsconfig.es.json b/clients/client-appintegrations/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-appintegrations/tsconfig.es.json +++ b/clients/client-appintegrations/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-appintegrations/tsconfig.json b/clients/client-appintegrations/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-appintegrations/tsconfig.json +++ b/clients/client-appintegrations/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-appintegrations/tsconfig.types.json b/clients/client-appintegrations/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-appintegrations/tsconfig.types.json +++ b/clients/client-appintegrations/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-application-auto-scaling/.gitignore b/clients/client-application-auto-scaling/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-application-auto-scaling/.gitignore +++ b/clients/client-application-auto-scaling/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-application-auto-scaling/package.json b/clients/client-application-auto-scaling/package.json index 0c3fd7ee5f69..b533600e7a30 100644 --- a/clients/client-application-auto-scaling/package.json +++ b/clients/client-application-auto-scaling/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-application-auto-scaling", "repository": { "type": "git", diff --git a/clients/client-application-auto-scaling/runtimeConfig.browser.ts b/clients/client-application-auto-scaling/runtimeConfig.browser.ts deleted file mode 100644 index cd112f4df191..000000000000 --- a/clients/client-application-auto-scaling/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApplicationAutoScalingClientConfig } from "./ApplicationAutoScalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-auto-scaling/runtimeConfig.ts b/clients/client-application-auto-scaling/runtimeConfig.ts deleted file mode 100644 index 59f4f21ea2c6..000000000000 --- a/clients/client-application-auto-scaling/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApplicationAutoScalingClientConfig } from "./ApplicationAutoScalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-auto-scaling/ApplicationAutoScaling.ts b/clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts similarity index 100% rename from clients/client-application-auto-scaling/ApplicationAutoScaling.ts rename to clients/client-application-auto-scaling/src/ApplicationAutoScaling.ts diff --git a/clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts similarity index 100% rename from clients/client-application-auto-scaling/ApplicationAutoScalingClient.ts rename to clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts diff --git a/clients/client-application-auto-scaling/commands/DeleteScalingPolicyCommand.ts b/clients/client-application-auto-scaling/src/commands/DeleteScalingPolicyCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DeleteScalingPolicyCommand.ts rename to clients/client-application-auto-scaling/src/commands/DeleteScalingPolicyCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DeleteScheduledActionCommand.ts b/clients/client-application-auto-scaling/src/commands/DeleteScheduledActionCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DeleteScheduledActionCommand.ts rename to clients/client-application-auto-scaling/src/commands/DeleteScheduledActionCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DeregisterScalableTargetCommand.ts b/clients/client-application-auto-scaling/src/commands/DeregisterScalableTargetCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DeregisterScalableTargetCommand.ts rename to clients/client-application-auto-scaling/src/commands/DeregisterScalableTargetCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DescribeScalableTargetsCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DescribeScalableTargetsCommand.ts rename to clients/client-application-auto-scaling/src/commands/DescribeScalableTargetsCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DescribeScalingActivitiesCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScalingActivitiesCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DescribeScalingActivitiesCommand.ts rename to clients/client-application-auto-scaling/src/commands/DescribeScalingActivitiesCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DescribeScalingPoliciesCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DescribeScalingPoliciesCommand.ts rename to clients/client-application-auto-scaling/src/commands/DescribeScalingPoliciesCommand.ts diff --git a/clients/client-application-auto-scaling/commands/DescribeScheduledActionsCommand.ts b/clients/client-application-auto-scaling/src/commands/DescribeScheduledActionsCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/DescribeScheduledActionsCommand.ts rename to clients/client-application-auto-scaling/src/commands/DescribeScheduledActionsCommand.ts diff --git a/clients/client-application-auto-scaling/commands/PutScalingPolicyCommand.ts b/clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/PutScalingPolicyCommand.ts rename to clients/client-application-auto-scaling/src/commands/PutScalingPolicyCommand.ts diff --git a/clients/client-application-auto-scaling/commands/PutScheduledActionCommand.ts b/clients/client-application-auto-scaling/src/commands/PutScheduledActionCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/PutScheduledActionCommand.ts rename to clients/client-application-auto-scaling/src/commands/PutScheduledActionCommand.ts diff --git a/clients/client-application-auto-scaling/commands/RegisterScalableTargetCommand.ts b/clients/client-application-auto-scaling/src/commands/RegisterScalableTargetCommand.ts similarity index 100% rename from clients/client-application-auto-scaling/commands/RegisterScalableTargetCommand.ts rename to clients/client-application-auto-scaling/src/commands/RegisterScalableTargetCommand.ts diff --git a/clients/client-application-auto-scaling/endpoints.ts b/clients/client-application-auto-scaling/src/endpoints.ts similarity index 100% rename from clients/client-application-auto-scaling/endpoints.ts rename to clients/client-application-auto-scaling/src/endpoints.ts diff --git a/clients/client-application-auto-scaling/index.ts b/clients/client-application-auto-scaling/src/index.ts similarity index 100% rename from clients/client-application-auto-scaling/index.ts rename to clients/client-application-auto-scaling/src/index.ts diff --git a/clients/client-application-auto-scaling/models/index.ts b/clients/client-application-auto-scaling/src/models/index.ts similarity index 100% rename from clients/client-application-auto-scaling/models/index.ts rename to clients/client-application-auto-scaling/src/models/index.ts diff --git a/clients/client-application-auto-scaling/models/models_0.ts b/clients/client-application-auto-scaling/src/models/models_0.ts similarity index 100% rename from clients/client-application-auto-scaling/models/models_0.ts rename to clients/client-application-auto-scaling/src/models/models_0.ts diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalableTargetsPaginator.ts b/clients/client-application-auto-scaling/src/pagination/DescribeScalableTargetsPaginator.ts similarity index 100% rename from clients/client-application-auto-scaling/pagination/DescribeScalableTargetsPaginator.ts rename to clients/client-application-auto-scaling/src/pagination/DescribeScalableTargetsPaginator.ts diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts b/clients/client-application-auto-scaling/src/pagination/DescribeScalingActivitiesPaginator.ts similarity index 100% rename from clients/client-application-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts rename to clients/client-application-auto-scaling/src/pagination/DescribeScalingActivitiesPaginator.ts diff --git a/clients/client-application-auto-scaling/pagination/DescribeScalingPoliciesPaginator.ts b/clients/client-application-auto-scaling/src/pagination/DescribeScalingPoliciesPaginator.ts similarity index 100% rename from clients/client-application-auto-scaling/pagination/DescribeScalingPoliciesPaginator.ts rename to clients/client-application-auto-scaling/src/pagination/DescribeScalingPoliciesPaginator.ts diff --git a/clients/client-application-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-application-auto-scaling/src/pagination/DescribeScheduledActionsPaginator.ts similarity index 100% rename from clients/client-application-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts rename to clients/client-application-auto-scaling/src/pagination/DescribeScheduledActionsPaginator.ts diff --git a/clients/client-application-auto-scaling/pagination/Interfaces.ts b/clients/client-application-auto-scaling/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-application-auto-scaling/pagination/Interfaces.ts rename to clients/client-application-auto-scaling/src/pagination/Interfaces.ts diff --git a/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-application-auto-scaling/protocols/Aws_json1_1.ts rename to clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts diff --git a/clients/client-application-auto-scaling/src/runtimeConfig.browser.ts b/clients/client-application-auto-scaling/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a66cb33bffed --- /dev/null +++ b/clients/client-application-auto-scaling/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApplicationAutoScalingClientConfig } from "./ApplicationAutoScalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-auto-scaling/runtimeConfig.native.ts b/clients/client-application-auto-scaling/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-application-auto-scaling/runtimeConfig.native.ts rename to clients/client-application-auto-scaling/src/runtimeConfig.native.ts diff --git a/clients/client-application-auto-scaling/runtimeConfig.shared.ts b/clients/client-application-auto-scaling/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-application-auto-scaling/runtimeConfig.shared.ts rename to clients/client-application-auto-scaling/src/runtimeConfig.shared.ts diff --git a/clients/client-application-auto-scaling/src/runtimeConfig.ts b/clients/client-application-auto-scaling/src/runtimeConfig.ts new file mode 100644 index 000000000000..967202c7e900 --- /dev/null +++ b/clients/client-application-auto-scaling/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApplicationAutoScalingClientConfig } from "./ApplicationAutoScalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-auto-scaling/tsconfig.es.json b/clients/client-application-auto-scaling/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-application-auto-scaling/tsconfig.es.json +++ b/clients/client-application-auto-scaling/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-application-auto-scaling/tsconfig.json b/clients/client-application-auto-scaling/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-application-auto-scaling/tsconfig.json +++ b/clients/client-application-auto-scaling/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-application-auto-scaling/tsconfig.types.json b/clients/client-application-auto-scaling/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-application-auto-scaling/tsconfig.types.json +++ b/clients/client-application-auto-scaling/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-application-discovery-service/.gitignore b/clients/client-application-discovery-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-application-discovery-service/.gitignore +++ b/clients/client-application-discovery-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-application-discovery-service/package.json b/clients/client-application-discovery-service/package.json index 56982ffa2904..1d07a0773227 100644 --- a/clients/client-application-discovery-service/package.json +++ b/clients/client-application-discovery-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-application-discovery-service", "repository": { "type": "git", diff --git a/clients/client-application-discovery-service/runtimeConfig.browser.ts b/clients/client-application-discovery-service/runtimeConfig.browser.ts deleted file mode 100644 index 7b96af20a3ae..000000000000 --- a/clients/client-application-discovery-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApplicationDiscoveryServiceClientConfig } from "./ApplicationDiscoveryServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-discovery-service/runtimeConfig.ts b/clients/client-application-discovery-service/runtimeConfig.ts deleted file mode 100644 index e241e09e796a..000000000000 --- a/clients/client-application-discovery-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApplicationDiscoveryServiceClientConfig } from "./ApplicationDiscoveryServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-discovery-service/ApplicationDiscoveryService.ts b/clients/client-application-discovery-service/src/ApplicationDiscoveryService.ts similarity index 100% rename from clients/client-application-discovery-service/ApplicationDiscoveryService.ts rename to clients/client-application-discovery-service/src/ApplicationDiscoveryService.ts diff --git a/clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts b/clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts similarity index 100% rename from clients/client-application-discovery-service/ApplicationDiscoveryServiceClient.ts rename to clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts diff --git a/clients/client-application-discovery-service/commands/AssociateConfigurationItemsToApplicationCommand.ts b/clients/client-application-discovery-service/src/commands/AssociateConfigurationItemsToApplicationCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/AssociateConfigurationItemsToApplicationCommand.ts rename to clients/client-application-discovery-service/src/commands/AssociateConfigurationItemsToApplicationCommand.ts diff --git a/clients/client-application-discovery-service/commands/BatchDeleteImportDataCommand.ts b/clients/client-application-discovery-service/src/commands/BatchDeleteImportDataCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/BatchDeleteImportDataCommand.ts rename to clients/client-application-discovery-service/src/commands/BatchDeleteImportDataCommand.ts diff --git a/clients/client-application-discovery-service/commands/CreateApplicationCommand.ts b/clients/client-application-discovery-service/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/CreateApplicationCommand.ts rename to clients/client-application-discovery-service/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-application-discovery-service/commands/CreateTagsCommand.ts b/clients/client-application-discovery-service/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/CreateTagsCommand.ts rename to clients/client-application-discovery-service/src/commands/CreateTagsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DeleteApplicationsCommand.ts b/clients/client-application-discovery-service/src/commands/DeleteApplicationsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DeleteApplicationsCommand.ts rename to clients/client-application-discovery-service/src/commands/DeleteApplicationsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DeleteTagsCommand.ts b/clients/client-application-discovery-service/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DeleteTagsCommand.ts rename to clients/client-application-discovery-service/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeAgentsCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeAgentsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeAgentsCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeAgentsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeConfigurationsCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeConfigurationsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeConfigurationsCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeConfigurationsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeContinuousExportsCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeContinuousExportsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeContinuousExportsCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeContinuousExportsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeExportConfigurationsCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeExportConfigurationsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeExportConfigurationsCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeExportConfigurationsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeExportTasksCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeExportTasksCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeExportTasksCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeExportTasksCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeImportTasksCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeImportTasksCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeImportTasksCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeImportTasksCommand.ts diff --git a/clients/client-application-discovery-service/commands/DescribeTagsCommand.ts b/clients/client-application-discovery-service/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DescribeTagsCommand.ts rename to clients/client-application-discovery-service/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-application-discovery-service/commands/DisassociateConfigurationItemsFromApplicationCommand.ts b/clients/client-application-discovery-service/src/commands/DisassociateConfigurationItemsFromApplicationCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/DisassociateConfigurationItemsFromApplicationCommand.ts rename to clients/client-application-discovery-service/src/commands/DisassociateConfigurationItemsFromApplicationCommand.ts diff --git a/clients/client-application-discovery-service/commands/ExportConfigurationsCommand.ts b/clients/client-application-discovery-service/src/commands/ExportConfigurationsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/ExportConfigurationsCommand.ts rename to clients/client-application-discovery-service/src/commands/ExportConfigurationsCommand.ts diff --git a/clients/client-application-discovery-service/commands/GetDiscoverySummaryCommand.ts b/clients/client-application-discovery-service/src/commands/GetDiscoverySummaryCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/GetDiscoverySummaryCommand.ts rename to clients/client-application-discovery-service/src/commands/GetDiscoverySummaryCommand.ts diff --git a/clients/client-application-discovery-service/commands/ListConfigurationsCommand.ts b/clients/client-application-discovery-service/src/commands/ListConfigurationsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/ListConfigurationsCommand.ts rename to clients/client-application-discovery-service/src/commands/ListConfigurationsCommand.ts diff --git a/clients/client-application-discovery-service/commands/ListServerNeighborsCommand.ts b/clients/client-application-discovery-service/src/commands/ListServerNeighborsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/ListServerNeighborsCommand.ts rename to clients/client-application-discovery-service/src/commands/ListServerNeighborsCommand.ts diff --git a/clients/client-application-discovery-service/commands/StartContinuousExportCommand.ts b/clients/client-application-discovery-service/src/commands/StartContinuousExportCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StartContinuousExportCommand.ts rename to clients/client-application-discovery-service/src/commands/StartContinuousExportCommand.ts diff --git a/clients/client-application-discovery-service/commands/StartDataCollectionByAgentIdsCommand.ts b/clients/client-application-discovery-service/src/commands/StartDataCollectionByAgentIdsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StartDataCollectionByAgentIdsCommand.ts rename to clients/client-application-discovery-service/src/commands/StartDataCollectionByAgentIdsCommand.ts diff --git a/clients/client-application-discovery-service/commands/StartExportTaskCommand.ts b/clients/client-application-discovery-service/src/commands/StartExportTaskCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StartExportTaskCommand.ts rename to clients/client-application-discovery-service/src/commands/StartExportTaskCommand.ts diff --git a/clients/client-application-discovery-service/commands/StartImportTaskCommand.ts b/clients/client-application-discovery-service/src/commands/StartImportTaskCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StartImportTaskCommand.ts rename to clients/client-application-discovery-service/src/commands/StartImportTaskCommand.ts diff --git a/clients/client-application-discovery-service/commands/StopContinuousExportCommand.ts b/clients/client-application-discovery-service/src/commands/StopContinuousExportCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StopContinuousExportCommand.ts rename to clients/client-application-discovery-service/src/commands/StopContinuousExportCommand.ts diff --git a/clients/client-application-discovery-service/commands/StopDataCollectionByAgentIdsCommand.ts b/clients/client-application-discovery-service/src/commands/StopDataCollectionByAgentIdsCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/StopDataCollectionByAgentIdsCommand.ts rename to clients/client-application-discovery-service/src/commands/StopDataCollectionByAgentIdsCommand.ts diff --git a/clients/client-application-discovery-service/commands/UpdateApplicationCommand.ts b/clients/client-application-discovery-service/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-application-discovery-service/commands/UpdateApplicationCommand.ts rename to clients/client-application-discovery-service/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-application-discovery-service/endpoints.ts b/clients/client-application-discovery-service/src/endpoints.ts similarity index 100% rename from clients/client-application-discovery-service/endpoints.ts rename to clients/client-application-discovery-service/src/endpoints.ts diff --git a/clients/client-application-discovery-service/index.ts b/clients/client-application-discovery-service/src/index.ts similarity index 100% rename from clients/client-application-discovery-service/index.ts rename to clients/client-application-discovery-service/src/index.ts diff --git a/clients/client-application-discovery-service/models/index.ts b/clients/client-application-discovery-service/src/models/index.ts similarity index 100% rename from clients/client-application-discovery-service/models/index.ts rename to clients/client-application-discovery-service/src/models/index.ts diff --git a/clients/client-application-discovery-service/models/models_0.ts b/clients/client-application-discovery-service/src/models/models_0.ts similarity index 100% rename from clients/client-application-discovery-service/models/models_0.ts rename to clients/client-application-discovery-service/src/models/models_0.ts diff --git a/clients/client-application-discovery-service/pagination/DescribeContinuousExportsPaginator.ts b/clients/client-application-discovery-service/src/pagination/DescribeContinuousExportsPaginator.ts similarity index 100% rename from clients/client-application-discovery-service/pagination/DescribeContinuousExportsPaginator.ts rename to clients/client-application-discovery-service/src/pagination/DescribeContinuousExportsPaginator.ts diff --git a/clients/client-application-discovery-service/pagination/DescribeImportTasksPaginator.ts b/clients/client-application-discovery-service/src/pagination/DescribeImportTasksPaginator.ts similarity index 100% rename from clients/client-application-discovery-service/pagination/DescribeImportTasksPaginator.ts rename to clients/client-application-discovery-service/src/pagination/DescribeImportTasksPaginator.ts diff --git a/clients/client-application-discovery-service/pagination/Interfaces.ts b/clients/client-application-discovery-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-application-discovery-service/pagination/Interfaces.ts rename to clients/client-application-discovery-service/src/pagination/Interfaces.ts diff --git a/clients/client-application-discovery-service/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-application-discovery-service/protocols/Aws_json1_1.ts rename to clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-application-discovery-service/src/runtimeConfig.browser.ts b/clients/client-application-discovery-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c6426115bfa9 --- /dev/null +++ b/clients/client-application-discovery-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApplicationDiscoveryServiceClientConfig } from "./ApplicationDiscoveryServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-discovery-service/runtimeConfig.native.ts b/clients/client-application-discovery-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-application-discovery-service/runtimeConfig.native.ts rename to clients/client-application-discovery-service/src/runtimeConfig.native.ts diff --git a/clients/client-application-discovery-service/runtimeConfig.shared.ts b/clients/client-application-discovery-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-application-discovery-service/runtimeConfig.shared.ts rename to clients/client-application-discovery-service/src/runtimeConfig.shared.ts diff --git a/clients/client-application-discovery-service/src/runtimeConfig.ts b/clients/client-application-discovery-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..6a7d417065db --- /dev/null +++ b/clients/client-application-discovery-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApplicationDiscoveryServiceClientConfig } from "./ApplicationDiscoveryServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-discovery-service/tsconfig.es.json b/clients/client-application-discovery-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-application-discovery-service/tsconfig.es.json +++ b/clients/client-application-discovery-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-application-discovery-service/tsconfig.json b/clients/client-application-discovery-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-application-discovery-service/tsconfig.json +++ b/clients/client-application-discovery-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-application-discovery-service/tsconfig.types.json b/clients/client-application-discovery-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-application-discovery-service/tsconfig.types.json +++ b/clients/client-application-discovery-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-application-insights/.gitignore b/clients/client-application-insights/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-application-insights/.gitignore +++ b/clients/client-application-insights/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-application-insights/package.json b/clients/client-application-insights/package.json index 8cefd52f0f88..95303500d3db 100644 --- a/clients/client-application-insights/package.json +++ b/clients/client-application-insights/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-application-insights", "repository": { "type": "git", diff --git a/clients/client-application-insights/runtimeConfig.browser.ts b/clients/client-application-insights/runtimeConfig.browser.ts deleted file mode 100644 index 3bd89cd4348a..000000000000 --- a/clients/client-application-insights/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApplicationInsightsClientConfig } from "./ApplicationInsightsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-insights/runtimeConfig.ts b/clients/client-application-insights/runtimeConfig.ts deleted file mode 100644 index 0f19b04bb9ed..000000000000 --- a/clients/client-application-insights/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApplicationInsightsClientConfig } from "./ApplicationInsightsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-application-insights/ApplicationInsights.ts b/clients/client-application-insights/src/ApplicationInsights.ts similarity index 100% rename from clients/client-application-insights/ApplicationInsights.ts rename to clients/client-application-insights/src/ApplicationInsights.ts diff --git a/clients/client-application-insights/ApplicationInsightsClient.ts b/clients/client-application-insights/src/ApplicationInsightsClient.ts similarity index 100% rename from clients/client-application-insights/ApplicationInsightsClient.ts rename to clients/client-application-insights/src/ApplicationInsightsClient.ts diff --git a/clients/client-application-insights/commands/CreateApplicationCommand.ts b/clients/client-application-insights/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/CreateApplicationCommand.ts rename to clients/client-application-insights/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-application-insights/commands/CreateComponentCommand.ts b/clients/client-application-insights/src/commands/CreateComponentCommand.ts similarity index 100% rename from clients/client-application-insights/commands/CreateComponentCommand.ts rename to clients/client-application-insights/src/commands/CreateComponentCommand.ts diff --git a/clients/client-application-insights/commands/CreateLogPatternCommand.ts b/clients/client-application-insights/src/commands/CreateLogPatternCommand.ts similarity index 100% rename from clients/client-application-insights/commands/CreateLogPatternCommand.ts rename to clients/client-application-insights/src/commands/CreateLogPatternCommand.ts diff --git a/clients/client-application-insights/commands/DeleteApplicationCommand.ts b/clients/client-application-insights/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DeleteApplicationCommand.ts rename to clients/client-application-insights/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-application-insights/commands/DeleteComponentCommand.ts b/clients/client-application-insights/src/commands/DeleteComponentCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DeleteComponentCommand.ts rename to clients/client-application-insights/src/commands/DeleteComponentCommand.ts diff --git a/clients/client-application-insights/commands/DeleteLogPatternCommand.ts b/clients/client-application-insights/src/commands/DeleteLogPatternCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DeleteLogPatternCommand.ts rename to clients/client-application-insights/src/commands/DeleteLogPatternCommand.ts diff --git a/clients/client-application-insights/commands/DescribeApplicationCommand.ts b/clients/client-application-insights/src/commands/DescribeApplicationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeApplicationCommand.ts rename to clients/client-application-insights/src/commands/DescribeApplicationCommand.ts diff --git a/clients/client-application-insights/commands/DescribeComponentCommand.ts b/clients/client-application-insights/src/commands/DescribeComponentCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeComponentCommand.ts rename to clients/client-application-insights/src/commands/DescribeComponentCommand.ts diff --git a/clients/client-application-insights/commands/DescribeComponentConfigurationCommand.ts b/clients/client-application-insights/src/commands/DescribeComponentConfigurationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeComponentConfigurationCommand.ts rename to clients/client-application-insights/src/commands/DescribeComponentConfigurationCommand.ts diff --git a/clients/client-application-insights/commands/DescribeComponentConfigurationRecommendationCommand.ts b/clients/client-application-insights/src/commands/DescribeComponentConfigurationRecommendationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeComponentConfigurationRecommendationCommand.ts rename to clients/client-application-insights/src/commands/DescribeComponentConfigurationRecommendationCommand.ts diff --git a/clients/client-application-insights/commands/DescribeLogPatternCommand.ts b/clients/client-application-insights/src/commands/DescribeLogPatternCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeLogPatternCommand.ts rename to clients/client-application-insights/src/commands/DescribeLogPatternCommand.ts diff --git a/clients/client-application-insights/commands/DescribeObservationCommand.ts b/clients/client-application-insights/src/commands/DescribeObservationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeObservationCommand.ts rename to clients/client-application-insights/src/commands/DescribeObservationCommand.ts diff --git a/clients/client-application-insights/commands/DescribeProblemCommand.ts b/clients/client-application-insights/src/commands/DescribeProblemCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeProblemCommand.ts rename to clients/client-application-insights/src/commands/DescribeProblemCommand.ts diff --git a/clients/client-application-insights/commands/DescribeProblemObservationsCommand.ts b/clients/client-application-insights/src/commands/DescribeProblemObservationsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/DescribeProblemObservationsCommand.ts rename to clients/client-application-insights/src/commands/DescribeProblemObservationsCommand.ts diff --git a/clients/client-application-insights/commands/ListApplicationsCommand.ts b/clients/client-application-insights/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListApplicationsCommand.ts rename to clients/client-application-insights/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-application-insights/commands/ListComponentsCommand.ts b/clients/client-application-insights/src/commands/ListComponentsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListComponentsCommand.ts rename to clients/client-application-insights/src/commands/ListComponentsCommand.ts diff --git a/clients/client-application-insights/commands/ListConfigurationHistoryCommand.ts b/clients/client-application-insights/src/commands/ListConfigurationHistoryCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListConfigurationHistoryCommand.ts rename to clients/client-application-insights/src/commands/ListConfigurationHistoryCommand.ts diff --git a/clients/client-application-insights/commands/ListLogPatternSetsCommand.ts b/clients/client-application-insights/src/commands/ListLogPatternSetsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListLogPatternSetsCommand.ts rename to clients/client-application-insights/src/commands/ListLogPatternSetsCommand.ts diff --git a/clients/client-application-insights/commands/ListLogPatternsCommand.ts b/clients/client-application-insights/src/commands/ListLogPatternsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListLogPatternsCommand.ts rename to clients/client-application-insights/src/commands/ListLogPatternsCommand.ts diff --git a/clients/client-application-insights/commands/ListProblemsCommand.ts b/clients/client-application-insights/src/commands/ListProblemsCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListProblemsCommand.ts rename to clients/client-application-insights/src/commands/ListProblemsCommand.ts diff --git a/clients/client-application-insights/commands/ListTagsForResourceCommand.ts b/clients/client-application-insights/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-application-insights/commands/ListTagsForResourceCommand.ts rename to clients/client-application-insights/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-application-insights/commands/TagResourceCommand.ts b/clients/client-application-insights/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-application-insights/commands/TagResourceCommand.ts rename to clients/client-application-insights/src/commands/TagResourceCommand.ts diff --git a/clients/client-application-insights/commands/UntagResourceCommand.ts b/clients/client-application-insights/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-application-insights/commands/UntagResourceCommand.ts rename to clients/client-application-insights/src/commands/UntagResourceCommand.ts diff --git a/clients/client-application-insights/commands/UpdateApplicationCommand.ts b/clients/client-application-insights/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/UpdateApplicationCommand.ts rename to clients/client-application-insights/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-application-insights/commands/UpdateComponentCommand.ts b/clients/client-application-insights/src/commands/UpdateComponentCommand.ts similarity index 100% rename from clients/client-application-insights/commands/UpdateComponentCommand.ts rename to clients/client-application-insights/src/commands/UpdateComponentCommand.ts diff --git a/clients/client-application-insights/commands/UpdateComponentConfigurationCommand.ts b/clients/client-application-insights/src/commands/UpdateComponentConfigurationCommand.ts similarity index 100% rename from clients/client-application-insights/commands/UpdateComponentConfigurationCommand.ts rename to clients/client-application-insights/src/commands/UpdateComponentConfigurationCommand.ts diff --git a/clients/client-application-insights/commands/UpdateLogPatternCommand.ts b/clients/client-application-insights/src/commands/UpdateLogPatternCommand.ts similarity index 100% rename from clients/client-application-insights/commands/UpdateLogPatternCommand.ts rename to clients/client-application-insights/src/commands/UpdateLogPatternCommand.ts diff --git a/clients/client-application-insights/endpoints.ts b/clients/client-application-insights/src/endpoints.ts similarity index 100% rename from clients/client-application-insights/endpoints.ts rename to clients/client-application-insights/src/endpoints.ts diff --git a/clients/client-application-insights/index.ts b/clients/client-application-insights/src/index.ts similarity index 100% rename from clients/client-application-insights/index.ts rename to clients/client-application-insights/src/index.ts diff --git a/clients/client-application-insights/models/index.ts b/clients/client-application-insights/src/models/index.ts similarity index 100% rename from clients/client-application-insights/models/index.ts rename to clients/client-application-insights/src/models/index.ts diff --git a/clients/client-application-insights/models/models_0.ts b/clients/client-application-insights/src/models/models_0.ts similarity index 100% rename from clients/client-application-insights/models/models_0.ts rename to clients/client-application-insights/src/models/models_0.ts diff --git a/clients/client-application-insights/pagination/Interfaces.ts b/clients/client-application-insights/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-application-insights/pagination/Interfaces.ts rename to clients/client-application-insights/src/pagination/Interfaces.ts diff --git a/clients/client-application-insights/pagination/ListApplicationsPaginator.ts b/clients/client-application-insights/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListApplicationsPaginator.ts rename to clients/client-application-insights/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-application-insights/pagination/ListComponentsPaginator.ts b/clients/client-application-insights/src/pagination/ListComponentsPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListComponentsPaginator.ts rename to clients/client-application-insights/src/pagination/ListComponentsPaginator.ts diff --git a/clients/client-application-insights/pagination/ListConfigurationHistoryPaginator.ts b/clients/client-application-insights/src/pagination/ListConfigurationHistoryPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListConfigurationHistoryPaginator.ts rename to clients/client-application-insights/src/pagination/ListConfigurationHistoryPaginator.ts diff --git a/clients/client-application-insights/pagination/ListLogPatternSetsPaginator.ts b/clients/client-application-insights/src/pagination/ListLogPatternSetsPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListLogPatternSetsPaginator.ts rename to clients/client-application-insights/src/pagination/ListLogPatternSetsPaginator.ts diff --git a/clients/client-application-insights/pagination/ListLogPatternsPaginator.ts b/clients/client-application-insights/src/pagination/ListLogPatternsPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListLogPatternsPaginator.ts rename to clients/client-application-insights/src/pagination/ListLogPatternsPaginator.ts diff --git a/clients/client-application-insights/pagination/ListProblemsPaginator.ts b/clients/client-application-insights/src/pagination/ListProblemsPaginator.ts similarity index 100% rename from clients/client-application-insights/pagination/ListProblemsPaginator.ts rename to clients/client-application-insights/src/pagination/ListProblemsPaginator.ts diff --git a/clients/client-application-insights/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-application-insights/protocols/Aws_json1_1.ts rename to clients/client-application-insights/src/protocols/Aws_json1_1.ts diff --git a/clients/client-application-insights/src/runtimeConfig.browser.ts b/clients/client-application-insights/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fe93066f39e4 --- /dev/null +++ b/clients/client-application-insights/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApplicationInsightsClientConfig } from "./ApplicationInsightsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-insights/runtimeConfig.native.ts b/clients/client-application-insights/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-application-insights/runtimeConfig.native.ts rename to clients/client-application-insights/src/runtimeConfig.native.ts diff --git a/clients/client-application-insights/runtimeConfig.shared.ts b/clients/client-application-insights/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-application-insights/runtimeConfig.shared.ts rename to clients/client-application-insights/src/runtimeConfig.shared.ts diff --git a/clients/client-application-insights/src/runtimeConfig.ts b/clients/client-application-insights/src/runtimeConfig.ts new file mode 100644 index 000000000000..0a01fb45a00c --- /dev/null +++ b/clients/client-application-insights/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApplicationInsightsClientConfig } from "./ApplicationInsightsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-application-insights/tsconfig.es.json b/clients/client-application-insights/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-application-insights/tsconfig.es.json +++ b/clients/client-application-insights/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-application-insights/tsconfig.json b/clients/client-application-insights/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-application-insights/tsconfig.json +++ b/clients/client-application-insights/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-application-insights/tsconfig.types.json b/clients/client-application-insights/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-application-insights/tsconfig.types.json +++ b/clients/client-application-insights/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-applicationcostprofiler/.gitignore b/clients/client-applicationcostprofiler/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-applicationcostprofiler/.gitignore +++ b/clients/client-applicationcostprofiler/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-applicationcostprofiler/package.json b/clients/client-applicationcostprofiler/package.json index 76013a8e1e55..68321549c328 100644 --- a/clients/client-applicationcostprofiler/package.json +++ b/clients/client-applicationcostprofiler/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-applicationcostprofiler", "repository": { "type": "git", diff --git a/clients/client-applicationcostprofiler/runtimeConfig.browser.ts b/clients/client-applicationcostprofiler/runtimeConfig.browser.ts deleted file mode 100644 index 651e2bf158c7..000000000000 --- a/clients/client-applicationcostprofiler/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ApplicationCostProfilerClientConfig } from "./ApplicationCostProfilerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-applicationcostprofiler/runtimeConfig.ts b/clients/client-applicationcostprofiler/runtimeConfig.ts deleted file mode 100644 index d9b1c405669d..000000000000 --- a/clients/client-applicationcostprofiler/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ApplicationCostProfilerClientConfig } from "./ApplicationCostProfilerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-applicationcostprofiler/ApplicationCostProfiler.ts b/clients/client-applicationcostprofiler/src/ApplicationCostProfiler.ts similarity index 100% rename from clients/client-applicationcostprofiler/ApplicationCostProfiler.ts rename to clients/client-applicationcostprofiler/src/ApplicationCostProfiler.ts diff --git a/clients/client-applicationcostprofiler/ApplicationCostProfilerClient.ts b/clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts similarity index 100% rename from clients/client-applicationcostprofiler/ApplicationCostProfilerClient.ts rename to clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts diff --git a/clients/client-applicationcostprofiler/commands/DeleteReportDefinitionCommand.ts b/clients/client-applicationcostprofiler/src/commands/DeleteReportDefinitionCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/DeleteReportDefinitionCommand.ts rename to clients/client-applicationcostprofiler/src/commands/DeleteReportDefinitionCommand.ts diff --git a/clients/client-applicationcostprofiler/commands/GetReportDefinitionCommand.ts b/clients/client-applicationcostprofiler/src/commands/GetReportDefinitionCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/GetReportDefinitionCommand.ts rename to clients/client-applicationcostprofiler/src/commands/GetReportDefinitionCommand.ts diff --git a/clients/client-applicationcostprofiler/commands/ImportApplicationUsageCommand.ts b/clients/client-applicationcostprofiler/src/commands/ImportApplicationUsageCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/ImportApplicationUsageCommand.ts rename to clients/client-applicationcostprofiler/src/commands/ImportApplicationUsageCommand.ts diff --git a/clients/client-applicationcostprofiler/commands/ListReportDefinitionsCommand.ts b/clients/client-applicationcostprofiler/src/commands/ListReportDefinitionsCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/ListReportDefinitionsCommand.ts rename to clients/client-applicationcostprofiler/src/commands/ListReportDefinitionsCommand.ts diff --git a/clients/client-applicationcostprofiler/commands/PutReportDefinitionCommand.ts b/clients/client-applicationcostprofiler/src/commands/PutReportDefinitionCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/PutReportDefinitionCommand.ts rename to clients/client-applicationcostprofiler/src/commands/PutReportDefinitionCommand.ts diff --git a/clients/client-applicationcostprofiler/commands/UpdateReportDefinitionCommand.ts b/clients/client-applicationcostprofiler/src/commands/UpdateReportDefinitionCommand.ts similarity index 100% rename from clients/client-applicationcostprofiler/commands/UpdateReportDefinitionCommand.ts rename to clients/client-applicationcostprofiler/src/commands/UpdateReportDefinitionCommand.ts diff --git a/clients/client-applicationcostprofiler/endpoints.ts b/clients/client-applicationcostprofiler/src/endpoints.ts similarity index 100% rename from clients/client-applicationcostprofiler/endpoints.ts rename to clients/client-applicationcostprofiler/src/endpoints.ts diff --git a/clients/client-applicationcostprofiler/index.ts b/clients/client-applicationcostprofiler/src/index.ts similarity index 100% rename from clients/client-applicationcostprofiler/index.ts rename to clients/client-applicationcostprofiler/src/index.ts diff --git a/clients/client-applicationcostprofiler/models/index.ts b/clients/client-applicationcostprofiler/src/models/index.ts similarity index 100% rename from clients/client-applicationcostprofiler/models/index.ts rename to clients/client-applicationcostprofiler/src/models/index.ts diff --git a/clients/client-applicationcostprofiler/models/models_0.ts b/clients/client-applicationcostprofiler/src/models/models_0.ts similarity index 100% rename from clients/client-applicationcostprofiler/models/models_0.ts rename to clients/client-applicationcostprofiler/src/models/models_0.ts diff --git a/clients/client-applicationcostprofiler/pagination/Interfaces.ts b/clients/client-applicationcostprofiler/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-applicationcostprofiler/pagination/Interfaces.ts rename to clients/client-applicationcostprofiler/src/pagination/Interfaces.ts diff --git a/clients/client-applicationcostprofiler/pagination/ListReportDefinitionsPaginator.ts b/clients/client-applicationcostprofiler/src/pagination/ListReportDefinitionsPaginator.ts similarity index 100% rename from clients/client-applicationcostprofiler/pagination/ListReportDefinitionsPaginator.ts rename to clients/client-applicationcostprofiler/src/pagination/ListReportDefinitionsPaginator.ts diff --git a/clients/client-applicationcostprofiler/protocols/Aws_restJson1.ts b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-applicationcostprofiler/protocols/Aws_restJson1.ts rename to clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts diff --git a/clients/client-applicationcostprofiler/src/runtimeConfig.browser.ts b/clients/client-applicationcostprofiler/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e96b260d1706 --- /dev/null +++ b/clients/client-applicationcostprofiler/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ApplicationCostProfilerClientConfig } from "./ApplicationCostProfilerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-applicationcostprofiler/runtimeConfig.native.ts b/clients/client-applicationcostprofiler/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-applicationcostprofiler/runtimeConfig.native.ts rename to clients/client-applicationcostprofiler/src/runtimeConfig.native.ts diff --git a/clients/client-applicationcostprofiler/runtimeConfig.shared.ts b/clients/client-applicationcostprofiler/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-applicationcostprofiler/runtimeConfig.shared.ts rename to clients/client-applicationcostprofiler/src/runtimeConfig.shared.ts diff --git a/clients/client-applicationcostprofiler/src/runtimeConfig.ts b/clients/client-applicationcostprofiler/src/runtimeConfig.ts new file mode 100644 index 000000000000..4614ee08de76 --- /dev/null +++ b/clients/client-applicationcostprofiler/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ApplicationCostProfilerClientConfig } from "./ApplicationCostProfilerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-applicationcostprofiler/tsconfig.es.json b/clients/client-applicationcostprofiler/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-applicationcostprofiler/tsconfig.es.json +++ b/clients/client-applicationcostprofiler/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-applicationcostprofiler/tsconfig.json b/clients/client-applicationcostprofiler/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-applicationcostprofiler/tsconfig.json +++ b/clients/client-applicationcostprofiler/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-applicationcostprofiler/tsconfig.types.json b/clients/client-applicationcostprofiler/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-applicationcostprofiler/tsconfig.types.json +++ b/clients/client-applicationcostprofiler/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-apprunner/.gitignore b/clients/client-apprunner/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-apprunner/.gitignore +++ b/clients/client-apprunner/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-apprunner/package.json b/clients/client-apprunner/package.json index d5b017bd27d8..e6c6da4b16f5 100644 --- a/clients/client-apprunner/package.json +++ b/clients/client-apprunner/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-apprunner", "repository": { "type": "git", diff --git a/clients/client-apprunner/runtimeConfig.browser.ts b/clients/client-apprunner/runtimeConfig.browser.ts deleted file mode 100644 index 88a21fff7cb8..000000000000 --- a/clients/client-apprunner/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppRunnerClientConfig } from "./AppRunnerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppRunnerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apprunner/runtimeConfig.ts b/clients/client-apprunner/runtimeConfig.ts deleted file mode 100644 index 6019b48879c9..000000000000 --- a/clients/client-apprunner/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppRunnerClientConfig } from "./AppRunnerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppRunnerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-apprunner/AppRunner.ts b/clients/client-apprunner/src/AppRunner.ts similarity index 100% rename from clients/client-apprunner/AppRunner.ts rename to clients/client-apprunner/src/AppRunner.ts diff --git a/clients/client-apprunner/AppRunnerClient.ts b/clients/client-apprunner/src/AppRunnerClient.ts similarity index 100% rename from clients/client-apprunner/AppRunnerClient.ts rename to clients/client-apprunner/src/AppRunnerClient.ts diff --git a/clients/client-apprunner/commands/AssociateCustomDomainCommand.ts b/clients/client-apprunner/src/commands/AssociateCustomDomainCommand.ts similarity index 100% rename from clients/client-apprunner/commands/AssociateCustomDomainCommand.ts rename to clients/client-apprunner/src/commands/AssociateCustomDomainCommand.ts diff --git a/clients/client-apprunner/commands/CreateAutoScalingConfigurationCommand.ts b/clients/client-apprunner/src/commands/CreateAutoScalingConfigurationCommand.ts similarity index 100% rename from clients/client-apprunner/commands/CreateAutoScalingConfigurationCommand.ts rename to clients/client-apprunner/src/commands/CreateAutoScalingConfigurationCommand.ts diff --git a/clients/client-apprunner/commands/CreateConnectionCommand.ts b/clients/client-apprunner/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-apprunner/commands/CreateConnectionCommand.ts rename to clients/client-apprunner/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-apprunner/commands/CreateServiceCommand.ts b/clients/client-apprunner/src/commands/CreateServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/CreateServiceCommand.ts rename to clients/client-apprunner/src/commands/CreateServiceCommand.ts diff --git a/clients/client-apprunner/commands/DeleteAutoScalingConfigurationCommand.ts b/clients/client-apprunner/src/commands/DeleteAutoScalingConfigurationCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DeleteAutoScalingConfigurationCommand.ts rename to clients/client-apprunner/src/commands/DeleteAutoScalingConfigurationCommand.ts diff --git a/clients/client-apprunner/commands/DeleteConnectionCommand.ts b/clients/client-apprunner/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DeleteConnectionCommand.ts rename to clients/client-apprunner/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-apprunner/commands/DeleteServiceCommand.ts b/clients/client-apprunner/src/commands/DeleteServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DeleteServiceCommand.ts rename to clients/client-apprunner/src/commands/DeleteServiceCommand.ts diff --git a/clients/client-apprunner/commands/DescribeAutoScalingConfigurationCommand.ts b/clients/client-apprunner/src/commands/DescribeAutoScalingConfigurationCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DescribeAutoScalingConfigurationCommand.ts rename to clients/client-apprunner/src/commands/DescribeAutoScalingConfigurationCommand.ts diff --git a/clients/client-apprunner/commands/DescribeCustomDomainsCommand.ts b/clients/client-apprunner/src/commands/DescribeCustomDomainsCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DescribeCustomDomainsCommand.ts rename to clients/client-apprunner/src/commands/DescribeCustomDomainsCommand.ts diff --git a/clients/client-apprunner/commands/DescribeServiceCommand.ts b/clients/client-apprunner/src/commands/DescribeServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DescribeServiceCommand.ts rename to clients/client-apprunner/src/commands/DescribeServiceCommand.ts diff --git a/clients/client-apprunner/commands/DisassociateCustomDomainCommand.ts b/clients/client-apprunner/src/commands/DisassociateCustomDomainCommand.ts similarity index 100% rename from clients/client-apprunner/commands/DisassociateCustomDomainCommand.ts rename to clients/client-apprunner/src/commands/DisassociateCustomDomainCommand.ts diff --git a/clients/client-apprunner/commands/ListAutoScalingConfigurationsCommand.ts b/clients/client-apprunner/src/commands/ListAutoScalingConfigurationsCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ListAutoScalingConfigurationsCommand.ts rename to clients/client-apprunner/src/commands/ListAutoScalingConfigurationsCommand.ts diff --git a/clients/client-apprunner/commands/ListConnectionsCommand.ts b/clients/client-apprunner/src/commands/ListConnectionsCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ListConnectionsCommand.ts rename to clients/client-apprunner/src/commands/ListConnectionsCommand.ts diff --git a/clients/client-apprunner/commands/ListOperationsCommand.ts b/clients/client-apprunner/src/commands/ListOperationsCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ListOperationsCommand.ts rename to clients/client-apprunner/src/commands/ListOperationsCommand.ts diff --git a/clients/client-apprunner/commands/ListServicesCommand.ts b/clients/client-apprunner/src/commands/ListServicesCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ListServicesCommand.ts rename to clients/client-apprunner/src/commands/ListServicesCommand.ts diff --git a/clients/client-apprunner/commands/ListTagsForResourceCommand.ts b/clients/client-apprunner/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ListTagsForResourceCommand.ts rename to clients/client-apprunner/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-apprunner/commands/PauseServiceCommand.ts b/clients/client-apprunner/src/commands/PauseServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/PauseServiceCommand.ts rename to clients/client-apprunner/src/commands/PauseServiceCommand.ts diff --git a/clients/client-apprunner/commands/ResumeServiceCommand.ts b/clients/client-apprunner/src/commands/ResumeServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/ResumeServiceCommand.ts rename to clients/client-apprunner/src/commands/ResumeServiceCommand.ts diff --git a/clients/client-apprunner/commands/StartDeploymentCommand.ts b/clients/client-apprunner/src/commands/StartDeploymentCommand.ts similarity index 100% rename from clients/client-apprunner/commands/StartDeploymentCommand.ts rename to clients/client-apprunner/src/commands/StartDeploymentCommand.ts diff --git a/clients/client-apprunner/commands/TagResourceCommand.ts b/clients/client-apprunner/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/TagResourceCommand.ts rename to clients/client-apprunner/src/commands/TagResourceCommand.ts diff --git a/clients/client-apprunner/commands/UntagResourceCommand.ts b/clients/client-apprunner/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/UntagResourceCommand.ts rename to clients/client-apprunner/src/commands/UntagResourceCommand.ts diff --git a/clients/client-apprunner/commands/UpdateServiceCommand.ts b/clients/client-apprunner/src/commands/UpdateServiceCommand.ts similarity index 100% rename from clients/client-apprunner/commands/UpdateServiceCommand.ts rename to clients/client-apprunner/src/commands/UpdateServiceCommand.ts diff --git a/clients/client-apprunner/endpoints.ts b/clients/client-apprunner/src/endpoints.ts similarity index 100% rename from clients/client-apprunner/endpoints.ts rename to clients/client-apprunner/src/endpoints.ts diff --git a/clients/client-apprunner/index.ts b/clients/client-apprunner/src/index.ts similarity index 100% rename from clients/client-apprunner/index.ts rename to clients/client-apprunner/src/index.ts diff --git a/clients/client-apprunner/models/index.ts b/clients/client-apprunner/src/models/index.ts similarity index 100% rename from clients/client-apprunner/models/index.ts rename to clients/client-apprunner/src/models/index.ts diff --git a/clients/client-apprunner/models/models_0.ts b/clients/client-apprunner/src/models/models_0.ts similarity index 100% rename from clients/client-apprunner/models/models_0.ts rename to clients/client-apprunner/src/models/models_0.ts diff --git a/clients/client-apprunner/pagination/DescribeCustomDomainsPaginator.ts b/clients/client-apprunner/src/pagination/DescribeCustomDomainsPaginator.ts similarity index 100% rename from clients/client-apprunner/pagination/DescribeCustomDomainsPaginator.ts rename to clients/client-apprunner/src/pagination/DescribeCustomDomainsPaginator.ts diff --git a/clients/client-apprunner/pagination/Interfaces.ts b/clients/client-apprunner/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-apprunner/pagination/Interfaces.ts rename to clients/client-apprunner/src/pagination/Interfaces.ts diff --git a/clients/client-apprunner/pagination/ListAutoScalingConfigurationsPaginator.ts b/clients/client-apprunner/src/pagination/ListAutoScalingConfigurationsPaginator.ts similarity index 100% rename from clients/client-apprunner/pagination/ListAutoScalingConfigurationsPaginator.ts rename to clients/client-apprunner/src/pagination/ListAutoScalingConfigurationsPaginator.ts diff --git a/clients/client-apprunner/pagination/ListConnectionsPaginator.ts b/clients/client-apprunner/src/pagination/ListConnectionsPaginator.ts similarity index 100% rename from clients/client-apprunner/pagination/ListConnectionsPaginator.ts rename to clients/client-apprunner/src/pagination/ListConnectionsPaginator.ts diff --git a/clients/client-apprunner/pagination/ListOperationsPaginator.ts b/clients/client-apprunner/src/pagination/ListOperationsPaginator.ts similarity index 100% rename from clients/client-apprunner/pagination/ListOperationsPaginator.ts rename to clients/client-apprunner/src/pagination/ListOperationsPaginator.ts diff --git a/clients/client-apprunner/pagination/ListServicesPaginator.ts b/clients/client-apprunner/src/pagination/ListServicesPaginator.ts similarity index 100% rename from clients/client-apprunner/pagination/ListServicesPaginator.ts rename to clients/client-apprunner/src/pagination/ListServicesPaginator.ts diff --git a/clients/client-apprunner/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-apprunner/protocols/Aws_json1_0.ts rename to clients/client-apprunner/src/protocols/Aws_json1_0.ts diff --git a/clients/client-apprunner/src/runtimeConfig.browser.ts b/clients/client-apprunner/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3db30de7d246 --- /dev/null +++ b/clients/client-apprunner/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppRunnerClientConfig } from "./AppRunnerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppRunnerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apprunner/runtimeConfig.native.ts b/clients/client-apprunner/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-apprunner/runtimeConfig.native.ts rename to clients/client-apprunner/src/runtimeConfig.native.ts diff --git a/clients/client-apprunner/runtimeConfig.shared.ts b/clients/client-apprunner/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-apprunner/runtimeConfig.shared.ts rename to clients/client-apprunner/src/runtimeConfig.shared.ts diff --git a/clients/client-apprunner/src/runtimeConfig.ts b/clients/client-apprunner/src/runtimeConfig.ts new file mode 100644 index 000000000000..40bd99ecd7de --- /dev/null +++ b/clients/client-apprunner/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppRunnerClientConfig } from "./AppRunnerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppRunnerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-apprunner/tsconfig.es.json b/clients/client-apprunner/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-apprunner/tsconfig.es.json +++ b/clients/client-apprunner/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-apprunner/tsconfig.json b/clients/client-apprunner/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-apprunner/tsconfig.json +++ b/clients/client-apprunner/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-apprunner/tsconfig.types.json b/clients/client-apprunner/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-apprunner/tsconfig.types.json +++ b/clients/client-apprunner/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-appstream/.gitignore b/clients/client-appstream/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-appstream/.gitignore +++ b/clients/client-appstream/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-appstream/package.json b/clients/client-appstream/package.json index 6175255d84f8..9dec4c69e381 100644 --- a/clients/client-appstream/package.json +++ b/clients/client-appstream/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-appstream", "repository": { "type": "git", diff --git a/clients/client-appstream/runtimeConfig.browser.ts b/clients/client-appstream/runtimeConfig.browser.ts deleted file mode 100644 index 1b87c639aca2..000000000000 --- a/clients/client-appstream/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppStreamClientConfig } from "./AppStreamClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppStreamClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appstream/runtimeConfig.ts b/clients/client-appstream/runtimeConfig.ts deleted file mode 100644 index 2e9873490e42..000000000000 --- a/clients/client-appstream/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppStreamClientConfig } from "./AppStreamClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppStreamClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appstream/AppStream.ts b/clients/client-appstream/src/AppStream.ts similarity index 100% rename from clients/client-appstream/AppStream.ts rename to clients/client-appstream/src/AppStream.ts diff --git a/clients/client-appstream/AppStreamClient.ts b/clients/client-appstream/src/AppStreamClient.ts similarity index 100% rename from clients/client-appstream/AppStreamClient.ts rename to clients/client-appstream/src/AppStreamClient.ts diff --git a/clients/client-appstream/commands/AssociateFleetCommand.ts b/clients/client-appstream/src/commands/AssociateFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/AssociateFleetCommand.ts rename to clients/client-appstream/src/commands/AssociateFleetCommand.ts diff --git a/clients/client-appstream/commands/BatchAssociateUserStackCommand.ts b/clients/client-appstream/src/commands/BatchAssociateUserStackCommand.ts similarity index 100% rename from clients/client-appstream/commands/BatchAssociateUserStackCommand.ts rename to clients/client-appstream/src/commands/BatchAssociateUserStackCommand.ts diff --git a/clients/client-appstream/commands/BatchDisassociateUserStackCommand.ts b/clients/client-appstream/src/commands/BatchDisassociateUserStackCommand.ts similarity index 100% rename from clients/client-appstream/commands/BatchDisassociateUserStackCommand.ts rename to clients/client-appstream/src/commands/BatchDisassociateUserStackCommand.ts diff --git a/clients/client-appstream/commands/CopyImageCommand.ts b/clients/client-appstream/src/commands/CopyImageCommand.ts similarity index 100% rename from clients/client-appstream/commands/CopyImageCommand.ts rename to clients/client-appstream/src/commands/CopyImageCommand.ts diff --git a/clients/client-appstream/commands/CreateDirectoryConfigCommand.ts b/clients/client-appstream/src/commands/CreateDirectoryConfigCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateDirectoryConfigCommand.ts rename to clients/client-appstream/src/commands/CreateDirectoryConfigCommand.ts diff --git a/clients/client-appstream/commands/CreateFleetCommand.ts b/clients/client-appstream/src/commands/CreateFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateFleetCommand.ts rename to clients/client-appstream/src/commands/CreateFleetCommand.ts diff --git a/clients/client-appstream/commands/CreateImageBuilderCommand.ts b/clients/client-appstream/src/commands/CreateImageBuilderCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateImageBuilderCommand.ts rename to clients/client-appstream/src/commands/CreateImageBuilderCommand.ts diff --git a/clients/client-appstream/commands/CreateImageBuilderStreamingURLCommand.ts b/clients/client-appstream/src/commands/CreateImageBuilderStreamingURLCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateImageBuilderStreamingURLCommand.ts rename to clients/client-appstream/src/commands/CreateImageBuilderStreamingURLCommand.ts diff --git a/clients/client-appstream/commands/CreateStackCommand.ts b/clients/client-appstream/src/commands/CreateStackCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateStackCommand.ts rename to clients/client-appstream/src/commands/CreateStackCommand.ts diff --git a/clients/client-appstream/commands/CreateStreamingURLCommand.ts b/clients/client-appstream/src/commands/CreateStreamingURLCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateStreamingURLCommand.ts rename to clients/client-appstream/src/commands/CreateStreamingURLCommand.ts diff --git a/clients/client-appstream/commands/CreateUpdatedImageCommand.ts b/clients/client-appstream/src/commands/CreateUpdatedImageCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateUpdatedImageCommand.ts rename to clients/client-appstream/src/commands/CreateUpdatedImageCommand.ts diff --git a/clients/client-appstream/commands/CreateUsageReportSubscriptionCommand.ts b/clients/client-appstream/src/commands/CreateUsageReportSubscriptionCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateUsageReportSubscriptionCommand.ts rename to clients/client-appstream/src/commands/CreateUsageReportSubscriptionCommand.ts diff --git a/clients/client-appstream/commands/CreateUserCommand.ts b/clients/client-appstream/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-appstream/commands/CreateUserCommand.ts rename to clients/client-appstream/src/commands/CreateUserCommand.ts diff --git a/clients/client-appstream/commands/DeleteDirectoryConfigCommand.ts b/clients/client-appstream/src/commands/DeleteDirectoryConfigCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteDirectoryConfigCommand.ts rename to clients/client-appstream/src/commands/DeleteDirectoryConfigCommand.ts diff --git a/clients/client-appstream/commands/DeleteFleetCommand.ts b/clients/client-appstream/src/commands/DeleteFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteFleetCommand.ts rename to clients/client-appstream/src/commands/DeleteFleetCommand.ts diff --git a/clients/client-appstream/commands/DeleteImageBuilderCommand.ts b/clients/client-appstream/src/commands/DeleteImageBuilderCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteImageBuilderCommand.ts rename to clients/client-appstream/src/commands/DeleteImageBuilderCommand.ts diff --git a/clients/client-appstream/commands/DeleteImageCommand.ts b/clients/client-appstream/src/commands/DeleteImageCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteImageCommand.ts rename to clients/client-appstream/src/commands/DeleteImageCommand.ts diff --git a/clients/client-appstream/commands/DeleteImagePermissionsCommand.ts b/clients/client-appstream/src/commands/DeleteImagePermissionsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteImagePermissionsCommand.ts rename to clients/client-appstream/src/commands/DeleteImagePermissionsCommand.ts diff --git a/clients/client-appstream/commands/DeleteStackCommand.ts b/clients/client-appstream/src/commands/DeleteStackCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteStackCommand.ts rename to clients/client-appstream/src/commands/DeleteStackCommand.ts diff --git a/clients/client-appstream/commands/DeleteUsageReportSubscriptionCommand.ts b/clients/client-appstream/src/commands/DeleteUsageReportSubscriptionCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteUsageReportSubscriptionCommand.ts rename to clients/client-appstream/src/commands/DeleteUsageReportSubscriptionCommand.ts diff --git a/clients/client-appstream/commands/DeleteUserCommand.ts b/clients/client-appstream/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-appstream/commands/DeleteUserCommand.ts rename to clients/client-appstream/src/commands/DeleteUserCommand.ts diff --git a/clients/client-appstream/commands/DescribeDirectoryConfigsCommand.ts b/clients/client-appstream/src/commands/DescribeDirectoryConfigsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeDirectoryConfigsCommand.ts rename to clients/client-appstream/src/commands/DescribeDirectoryConfigsCommand.ts diff --git a/clients/client-appstream/commands/DescribeFleetsCommand.ts b/clients/client-appstream/src/commands/DescribeFleetsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeFleetsCommand.ts rename to clients/client-appstream/src/commands/DescribeFleetsCommand.ts diff --git a/clients/client-appstream/commands/DescribeImageBuildersCommand.ts b/clients/client-appstream/src/commands/DescribeImageBuildersCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeImageBuildersCommand.ts rename to clients/client-appstream/src/commands/DescribeImageBuildersCommand.ts diff --git a/clients/client-appstream/commands/DescribeImagePermissionsCommand.ts b/clients/client-appstream/src/commands/DescribeImagePermissionsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeImagePermissionsCommand.ts rename to clients/client-appstream/src/commands/DescribeImagePermissionsCommand.ts diff --git a/clients/client-appstream/commands/DescribeImagesCommand.ts b/clients/client-appstream/src/commands/DescribeImagesCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeImagesCommand.ts rename to clients/client-appstream/src/commands/DescribeImagesCommand.ts diff --git a/clients/client-appstream/commands/DescribeSessionsCommand.ts b/clients/client-appstream/src/commands/DescribeSessionsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeSessionsCommand.ts rename to clients/client-appstream/src/commands/DescribeSessionsCommand.ts diff --git a/clients/client-appstream/commands/DescribeStacksCommand.ts b/clients/client-appstream/src/commands/DescribeStacksCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeStacksCommand.ts rename to clients/client-appstream/src/commands/DescribeStacksCommand.ts diff --git a/clients/client-appstream/commands/DescribeUsageReportSubscriptionsCommand.ts b/clients/client-appstream/src/commands/DescribeUsageReportSubscriptionsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeUsageReportSubscriptionsCommand.ts rename to clients/client-appstream/src/commands/DescribeUsageReportSubscriptionsCommand.ts diff --git a/clients/client-appstream/commands/DescribeUserStackAssociationsCommand.ts b/clients/client-appstream/src/commands/DescribeUserStackAssociationsCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeUserStackAssociationsCommand.ts rename to clients/client-appstream/src/commands/DescribeUserStackAssociationsCommand.ts diff --git a/clients/client-appstream/commands/DescribeUsersCommand.ts b/clients/client-appstream/src/commands/DescribeUsersCommand.ts similarity index 100% rename from clients/client-appstream/commands/DescribeUsersCommand.ts rename to clients/client-appstream/src/commands/DescribeUsersCommand.ts diff --git a/clients/client-appstream/commands/DisableUserCommand.ts b/clients/client-appstream/src/commands/DisableUserCommand.ts similarity index 100% rename from clients/client-appstream/commands/DisableUserCommand.ts rename to clients/client-appstream/src/commands/DisableUserCommand.ts diff --git a/clients/client-appstream/commands/DisassociateFleetCommand.ts b/clients/client-appstream/src/commands/DisassociateFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/DisassociateFleetCommand.ts rename to clients/client-appstream/src/commands/DisassociateFleetCommand.ts diff --git a/clients/client-appstream/commands/EnableUserCommand.ts b/clients/client-appstream/src/commands/EnableUserCommand.ts similarity index 100% rename from clients/client-appstream/commands/EnableUserCommand.ts rename to clients/client-appstream/src/commands/EnableUserCommand.ts diff --git a/clients/client-appstream/commands/ExpireSessionCommand.ts b/clients/client-appstream/src/commands/ExpireSessionCommand.ts similarity index 100% rename from clients/client-appstream/commands/ExpireSessionCommand.ts rename to clients/client-appstream/src/commands/ExpireSessionCommand.ts diff --git a/clients/client-appstream/commands/ListAssociatedFleetsCommand.ts b/clients/client-appstream/src/commands/ListAssociatedFleetsCommand.ts similarity index 100% rename from clients/client-appstream/commands/ListAssociatedFleetsCommand.ts rename to clients/client-appstream/src/commands/ListAssociatedFleetsCommand.ts diff --git a/clients/client-appstream/commands/ListAssociatedStacksCommand.ts b/clients/client-appstream/src/commands/ListAssociatedStacksCommand.ts similarity index 100% rename from clients/client-appstream/commands/ListAssociatedStacksCommand.ts rename to clients/client-appstream/src/commands/ListAssociatedStacksCommand.ts diff --git a/clients/client-appstream/commands/ListTagsForResourceCommand.ts b/clients/client-appstream/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-appstream/commands/ListTagsForResourceCommand.ts rename to clients/client-appstream/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-appstream/commands/StartFleetCommand.ts b/clients/client-appstream/src/commands/StartFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/StartFleetCommand.ts rename to clients/client-appstream/src/commands/StartFleetCommand.ts diff --git a/clients/client-appstream/commands/StartImageBuilderCommand.ts b/clients/client-appstream/src/commands/StartImageBuilderCommand.ts similarity index 100% rename from clients/client-appstream/commands/StartImageBuilderCommand.ts rename to clients/client-appstream/src/commands/StartImageBuilderCommand.ts diff --git a/clients/client-appstream/commands/StopFleetCommand.ts b/clients/client-appstream/src/commands/StopFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/StopFleetCommand.ts rename to clients/client-appstream/src/commands/StopFleetCommand.ts diff --git a/clients/client-appstream/commands/StopImageBuilderCommand.ts b/clients/client-appstream/src/commands/StopImageBuilderCommand.ts similarity index 100% rename from clients/client-appstream/commands/StopImageBuilderCommand.ts rename to clients/client-appstream/src/commands/StopImageBuilderCommand.ts diff --git a/clients/client-appstream/commands/TagResourceCommand.ts b/clients/client-appstream/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-appstream/commands/TagResourceCommand.ts rename to clients/client-appstream/src/commands/TagResourceCommand.ts diff --git a/clients/client-appstream/commands/UntagResourceCommand.ts b/clients/client-appstream/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-appstream/commands/UntagResourceCommand.ts rename to clients/client-appstream/src/commands/UntagResourceCommand.ts diff --git a/clients/client-appstream/commands/UpdateDirectoryConfigCommand.ts b/clients/client-appstream/src/commands/UpdateDirectoryConfigCommand.ts similarity index 100% rename from clients/client-appstream/commands/UpdateDirectoryConfigCommand.ts rename to clients/client-appstream/src/commands/UpdateDirectoryConfigCommand.ts diff --git a/clients/client-appstream/commands/UpdateFleetCommand.ts b/clients/client-appstream/src/commands/UpdateFleetCommand.ts similarity index 100% rename from clients/client-appstream/commands/UpdateFleetCommand.ts rename to clients/client-appstream/src/commands/UpdateFleetCommand.ts diff --git a/clients/client-appstream/commands/UpdateImagePermissionsCommand.ts b/clients/client-appstream/src/commands/UpdateImagePermissionsCommand.ts similarity index 100% rename from clients/client-appstream/commands/UpdateImagePermissionsCommand.ts rename to clients/client-appstream/src/commands/UpdateImagePermissionsCommand.ts diff --git a/clients/client-appstream/commands/UpdateStackCommand.ts b/clients/client-appstream/src/commands/UpdateStackCommand.ts similarity index 100% rename from clients/client-appstream/commands/UpdateStackCommand.ts rename to clients/client-appstream/src/commands/UpdateStackCommand.ts diff --git a/clients/client-appstream/endpoints.ts b/clients/client-appstream/src/endpoints.ts similarity index 100% rename from clients/client-appstream/endpoints.ts rename to clients/client-appstream/src/endpoints.ts diff --git a/clients/client-appstream/index.ts b/clients/client-appstream/src/index.ts similarity index 100% rename from clients/client-appstream/index.ts rename to clients/client-appstream/src/index.ts diff --git a/clients/client-appstream/models/index.ts b/clients/client-appstream/src/models/index.ts similarity index 100% rename from clients/client-appstream/models/index.ts rename to clients/client-appstream/src/models/index.ts diff --git a/clients/client-appstream/models/models_0.ts b/clients/client-appstream/src/models/models_0.ts similarity index 100% rename from clients/client-appstream/models/models_0.ts rename to clients/client-appstream/src/models/models_0.ts diff --git a/clients/client-appstream/pagination/DescribeImagePermissionsPaginator.ts b/clients/client-appstream/src/pagination/DescribeImagePermissionsPaginator.ts similarity index 100% rename from clients/client-appstream/pagination/DescribeImagePermissionsPaginator.ts rename to clients/client-appstream/src/pagination/DescribeImagePermissionsPaginator.ts diff --git a/clients/client-appstream/pagination/DescribeImagesPaginator.ts b/clients/client-appstream/src/pagination/DescribeImagesPaginator.ts similarity index 100% rename from clients/client-appstream/pagination/DescribeImagesPaginator.ts rename to clients/client-appstream/src/pagination/DescribeImagesPaginator.ts diff --git a/clients/client-appstream/pagination/Interfaces.ts b/clients/client-appstream/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-appstream/pagination/Interfaces.ts rename to clients/client-appstream/src/pagination/Interfaces.ts diff --git a/clients/client-appstream/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-appstream/protocols/Aws_json1_1.ts rename to clients/client-appstream/src/protocols/Aws_json1_1.ts diff --git a/clients/client-appstream/src/runtimeConfig.browser.ts b/clients/client-appstream/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9a7eeccc4229 --- /dev/null +++ b/clients/client-appstream/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppStreamClientConfig } from "./AppStreamClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppStreamClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appstream/runtimeConfig.native.ts b/clients/client-appstream/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-appstream/runtimeConfig.native.ts rename to clients/client-appstream/src/runtimeConfig.native.ts diff --git a/clients/client-appstream/runtimeConfig.shared.ts b/clients/client-appstream/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-appstream/runtimeConfig.shared.ts rename to clients/client-appstream/src/runtimeConfig.shared.ts diff --git a/clients/client-appstream/src/runtimeConfig.ts b/clients/client-appstream/src/runtimeConfig.ts new file mode 100644 index 000000000000..ad3db1926b3b --- /dev/null +++ b/clients/client-appstream/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppStreamClientConfig } from "./AppStreamClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppStreamClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appstream/waiters/waitForFleetStarted.ts b/clients/client-appstream/src/waiters/waitForFleetStarted.ts similarity index 100% rename from clients/client-appstream/waiters/waitForFleetStarted.ts rename to clients/client-appstream/src/waiters/waitForFleetStarted.ts diff --git a/clients/client-appstream/waiters/waitForFleetStopped.ts b/clients/client-appstream/src/waiters/waitForFleetStopped.ts similarity index 100% rename from clients/client-appstream/waiters/waitForFleetStopped.ts rename to clients/client-appstream/src/waiters/waitForFleetStopped.ts diff --git a/clients/client-appstream/tsconfig.es.json b/clients/client-appstream/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-appstream/tsconfig.es.json +++ b/clients/client-appstream/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-appstream/tsconfig.json b/clients/client-appstream/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-appstream/tsconfig.json +++ b/clients/client-appstream/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-appstream/tsconfig.types.json b/clients/client-appstream/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-appstream/tsconfig.types.json +++ b/clients/client-appstream/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-appsync/.gitignore b/clients/client-appsync/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-appsync/.gitignore +++ b/clients/client-appsync/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-appsync/package.json b/clients/client-appsync/package.json index 3b3942097889..96772651a710 100644 --- a/clients/client-appsync/package.json +++ b/clients/client-appsync/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-appsync", "repository": { "type": "git", diff --git a/clients/client-appsync/runtimeConfig.browser.ts b/clients/client-appsync/runtimeConfig.browser.ts deleted file mode 100644 index cbfacdbac658..000000000000 --- a/clients/client-appsync/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AppSyncClientConfig } from "./AppSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppSyncClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appsync/runtimeConfig.ts b/clients/client-appsync/runtimeConfig.ts deleted file mode 100644 index b16e84eeb110..000000000000 --- a/clients/client-appsync/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AppSyncClientConfig } from "./AppSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AppSyncClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-appsync/AppSync.ts b/clients/client-appsync/src/AppSync.ts similarity index 100% rename from clients/client-appsync/AppSync.ts rename to clients/client-appsync/src/AppSync.ts diff --git a/clients/client-appsync/AppSyncClient.ts b/clients/client-appsync/src/AppSyncClient.ts similarity index 100% rename from clients/client-appsync/AppSyncClient.ts rename to clients/client-appsync/src/AppSyncClient.ts diff --git a/clients/client-appsync/commands/CreateApiCacheCommand.ts b/clients/client-appsync/src/commands/CreateApiCacheCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateApiCacheCommand.ts rename to clients/client-appsync/src/commands/CreateApiCacheCommand.ts diff --git a/clients/client-appsync/commands/CreateApiKeyCommand.ts b/clients/client-appsync/src/commands/CreateApiKeyCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateApiKeyCommand.ts rename to clients/client-appsync/src/commands/CreateApiKeyCommand.ts diff --git a/clients/client-appsync/commands/CreateDataSourceCommand.ts b/clients/client-appsync/src/commands/CreateDataSourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateDataSourceCommand.ts rename to clients/client-appsync/src/commands/CreateDataSourceCommand.ts diff --git a/clients/client-appsync/commands/CreateFunctionCommand.ts b/clients/client-appsync/src/commands/CreateFunctionCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateFunctionCommand.ts rename to clients/client-appsync/src/commands/CreateFunctionCommand.ts diff --git a/clients/client-appsync/commands/CreateGraphqlApiCommand.ts b/clients/client-appsync/src/commands/CreateGraphqlApiCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateGraphqlApiCommand.ts rename to clients/client-appsync/src/commands/CreateGraphqlApiCommand.ts diff --git a/clients/client-appsync/commands/CreateResolverCommand.ts b/clients/client-appsync/src/commands/CreateResolverCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateResolverCommand.ts rename to clients/client-appsync/src/commands/CreateResolverCommand.ts diff --git a/clients/client-appsync/commands/CreateTypeCommand.ts b/clients/client-appsync/src/commands/CreateTypeCommand.ts similarity index 100% rename from clients/client-appsync/commands/CreateTypeCommand.ts rename to clients/client-appsync/src/commands/CreateTypeCommand.ts diff --git a/clients/client-appsync/commands/DeleteApiCacheCommand.ts b/clients/client-appsync/src/commands/DeleteApiCacheCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteApiCacheCommand.ts rename to clients/client-appsync/src/commands/DeleteApiCacheCommand.ts diff --git a/clients/client-appsync/commands/DeleteApiKeyCommand.ts b/clients/client-appsync/src/commands/DeleteApiKeyCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteApiKeyCommand.ts rename to clients/client-appsync/src/commands/DeleteApiKeyCommand.ts diff --git a/clients/client-appsync/commands/DeleteDataSourceCommand.ts b/clients/client-appsync/src/commands/DeleteDataSourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteDataSourceCommand.ts rename to clients/client-appsync/src/commands/DeleteDataSourceCommand.ts diff --git a/clients/client-appsync/commands/DeleteFunctionCommand.ts b/clients/client-appsync/src/commands/DeleteFunctionCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteFunctionCommand.ts rename to clients/client-appsync/src/commands/DeleteFunctionCommand.ts diff --git a/clients/client-appsync/commands/DeleteGraphqlApiCommand.ts b/clients/client-appsync/src/commands/DeleteGraphqlApiCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteGraphqlApiCommand.ts rename to clients/client-appsync/src/commands/DeleteGraphqlApiCommand.ts diff --git a/clients/client-appsync/commands/DeleteResolverCommand.ts b/clients/client-appsync/src/commands/DeleteResolverCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteResolverCommand.ts rename to clients/client-appsync/src/commands/DeleteResolverCommand.ts diff --git a/clients/client-appsync/commands/DeleteTypeCommand.ts b/clients/client-appsync/src/commands/DeleteTypeCommand.ts similarity index 100% rename from clients/client-appsync/commands/DeleteTypeCommand.ts rename to clients/client-appsync/src/commands/DeleteTypeCommand.ts diff --git a/clients/client-appsync/commands/FlushApiCacheCommand.ts b/clients/client-appsync/src/commands/FlushApiCacheCommand.ts similarity index 100% rename from clients/client-appsync/commands/FlushApiCacheCommand.ts rename to clients/client-appsync/src/commands/FlushApiCacheCommand.ts diff --git a/clients/client-appsync/commands/GetApiCacheCommand.ts b/clients/client-appsync/src/commands/GetApiCacheCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetApiCacheCommand.ts rename to clients/client-appsync/src/commands/GetApiCacheCommand.ts diff --git a/clients/client-appsync/commands/GetDataSourceCommand.ts b/clients/client-appsync/src/commands/GetDataSourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetDataSourceCommand.ts rename to clients/client-appsync/src/commands/GetDataSourceCommand.ts diff --git a/clients/client-appsync/commands/GetFunctionCommand.ts b/clients/client-appsync/src/commands/GetFunctionCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetFunctionCommand.ts rename to clients/client-appsync/src/commands/GetFunctionCommand.ts diff --git a/clients/client-appsync/commands/GetGraphqlApiCommand.ts b/clients/client-appsync/src/commands/GetGraphqlApiCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetGraphqlApiCommand.ts rename to clients/client-appsync/src/commands/GetGraphqlApiCommand.ts diff --git a/clients/client-appsync/commands/GetIntrospectionSchemaCommand.ts b/clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetIntrospectionSchemaCommand.ts rename to clients/client-appsync/src/commands/GetIntrospectionSchemaCommand.ts diff --git a/clients/client-appsync/commands/GetResolverCommand.ts b/clients/client-appsync/src/commands/GetResolverCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetResolverCommand.ts rename to clients/client-appsync/src/commands/GetResolverCommand.ts diff --git a/clients/client-appsync/commands/GetSchemaCreationStatusCommand.ts b/clients/client-appsync/src/commands/GetSchemaCreationStatusCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetSchemaCreationStatusCommand.ts rename to clients/client-appsync/src/commands/GetSchemaCreationStatusCommand.ts diff --git a/clients/client-appsync/commands/GetTypeCommand.ts b/clients/client-appsync/src/commands/GetTypeCommand.ts similarity index 100% rename from clients/client-appsync/commands/GetTypeCommand.ts rename to clients/client-appsync/src/commands/GetTypeCommand.ts diff --git a/clients/client-appsync/commands/ListApiKeysCommand.ts b/clients/client-appsync/src/commands/ListApiKeysCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListApiKeysCommand.ts rename to clients/client-appsync/src/commands/ListApiKeysCommand.ts diff --git a/clients/client-appsync/commands/ListDataSourcesCommand.ts b/clients/client-appsync/src/commands/ListDataSourcesCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListDataSourcesCommand.ts rename to clients/client-appsync/src/commands/ListDataSourcesCommand.ts diff --git a/clients/client-appsync/commands/ListFunctionsCommand.ts b/clients/client-appsync/src/commands/ListFunctionsCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListFunctionsCommand.ts rename to clients/client-appsync/src/commands/ListFunctionsCommand.ts diff --git a/clients/client-appsync/commands/ListGraphqlApisCommand.ts b/clients/client-appsync/src/commands/ListGraphqlApisCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListGraphqlApisCommand.ts rename to clients/client-appsync/src/commands/ListGraphqlApisCommand.ts diff --git a/clients/client-appsync/commands/ListResolversByFunctionCommand.ts b/clients/client-appsync/src/commands/ListResolversByFunctionCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListResolversByFunctionCommand.ts rename to clients/client-appsync/src/commands/ListResolversByFunctionCommand.ts diff --git a/clients/client-appsync/commands/ListResolversCommand.ts b/clients/client-appsync/src/commands/ListResolversCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListResolversCommand.ts rename to clients/client-appsync/src/commands/ListResolversCommand.ts diff --git a/clients/client-appsync/commands/ListTagsForResourceCommand.ts b/clients/client-appsync/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListTagsForResourceCommand.ts rename to clients/client-appsync/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-appsync/commands/ListTypesCommand.ts b/clients/client-appsync/src/commands/ListTypesCommand.ts similarity index 100% rename from clients/client-appsync/commands/ListTypesCommand.ts rename to clients/client-appsync/src/commands/ListTypesCommand.ts diff --git a/clients/client-appsync/commands/StartSchemaCreationCommand.ts b/clients/client-appsync/src/commands/StartSchemaCreationCommand.ts similarity index 100% rename from clients/client-appsync/commands/StartSchemaCreationCommand.ts rename to clients/client-appsync/src/commands/StartSchemaCreationCommand.ts diff --git a/clients/client-appsync/commands/TagResourceCommand.ts b/clients/client-appsync/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/TagResourceCommand.ts rename to clients/client-appsync/src/commands/TagResourceCommand.ts diff --git a/clients/client-appsync/commands/UntagResourceCommand.ts b/clients/client-appsync/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/UntagResourceCommand.ts rename to clients/client-appsync/src/commands/UntagResourceCommand.ts diff --git a/clients/client-appsync/commands/UpdateApiCacheCommand.ts b/clients/client-appsync/src/commands/UpdateApiCacheCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateApiCacheCommand.ts rename to clients/client-appsync/src/commands/UpdateApiCacheCommand.ts diff --git a/clients/client-appsync/commands/UpdateApiKeyCommand.ts b/clients/client-appsync/src/commands/UpdateApiKeyCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateApiKeyCommand.ts rename to clients/client-appsync/src/commands/UpdateApiKeyCommand.ts diff --git a/clients/client-appsync/commands/UpdateDataSourceCommand.ts b/clients/client-appsync/src/commands/UpdateDataSourceCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateDataSourceCommand.ts rename to clients/client-appsync/src/commands/UpdateDataSourceCommand.ts diff --git a/clients/client-appsync/commands/UpdateFunctionCommand.ts b/clients/client-appsync/src/commands/UpdateFunctionCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateFunctionCommand.ts rename to clients/client-appsync/src/commands/UpdateFunctionCommand.ts diff --git a/clients/client-appsync/commands/UpdateGraphqlApiCommand.ts b/clients/client-appsync/src/commands/UpdateGraphqlApiCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateGraphqlApiCommand.ts rename to clients/client-appsync/src/commands/UpdateGraphqlApiCommand.ts diff --git a/clients/client-appsync/commands/UpdateResolverCommand.ts b/clients/client-appsync/src/commands/UpdateResolverCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateResolverCommand.ts rename to clients/client-appsync/src/commands/UpdateResolverCommand.ts diff --git a/clients/client-appsync/commands/UpdateTypeCommand.ts b/clients/client-appsync/src/commands/UpdateTypeCommand.ts similarity index 100% rename from clients/client-appsync/commands/UpdateTypeCommand.ts rename to clients/client-appsync/src/commands/UpdateTypeCommand.ts diff --git a/clients/client-appsync/endpoints.ts b/clients/client-appsync/src/endpoints.ts similarity index 100% rename from clients/client-appsync/endpoints.ts rename to clients/client-appsync/src/endpoints.ts diff --git a/clients/client-appsync/index.ts b/clients/client-appsync/src/index.ts similarity index 100% rename from clients/client-appsync/index.ts rename to clients/client-appsync/src/index.ts diff --git a/clients/client-appsync/models/index.ts b/clients/client-appsync/src/models/index.ts similarity index 100% rename from clients/client-appsync/models/index.ts rename to clients/client-appsync/src/models/index.ts diff --git a/clients/client-appsync/models/models_0.ts b/clients/client-appsync/src/models/models_0.ts similarity index 100% rename from clients/client-appsync/models/models_0.ts rename to clients/client-appsync/src/models/models_0.ts diff --git a/clients/client-appsync/protocols/Aws_restJson1.ts b/clients/client-appsync/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-appsync/protocols/Aws_restJson1.ts rename to clients/client-appsync/src/protocols/Aws_restJson1.ts diff --git a/clients/client-appsync/src/runtimeConfig.browser.ts b/clients/client-appsync/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bad9d8afddea --- /dev/null +++ b/clients/client-appsync/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AppSyncClientConfig } from "./AppSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppSyncClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appsync/runtimeConfig.native.ts b/clients/client-appsync/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-appsync/runtimeConfig.native.ts rename to clients/client-appsync/src/runtimeConfig.native.ts diff --git a/clients/client-appsync/runtimeConfig.shared.ts b/clients/client-appsync/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-appsync/runtimeConfig.shared.ts rename to clients/client-appsync/src/runtimeConfig.shared.ts diff --git a/clients/client-appsync/src/runtimeConfig.ts b/clients/client-appsync/src/runtimeConfig.ts new file mode 100644 index 000000000000..b8989e3a48ab --- /dev/null +++ b/clients/client-appsync/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AppSyncClientConfig } from "./AppSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AppSyncClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-appsync/tsconfig.es.json b/clients/client-appsync/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-appsync/tsconfig.es.json +++ b/clients/client-appsync/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-appsync/tsconfig.json b/clients/client-appsync/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-appsync/tsconfig.json +++ b/clients/client-appsync/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-appsync/tsconfig.types.json b/clients/client-appsync/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-appsync/tsconfig.types.json +++ b/clients/client-appsync/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-athena/.gitignore b/clients/client-athena/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-athena/.gitignore +++ b/clients/client-athena/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-athena/package.json b/clients/client-athena/package.json index e9db825a9d46..767a8486de56 100644 --- a/clients/client-athena/package.json +++ b/clients/client-athena/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-athena", "repository": { "type": "git", diff --git a/clients/client-athena/runtimeConfig.browser.ts b/clients/client-athena/runtimeConfig.browser.ts deleted file mode 100644 index 012ab3d5fecd..000000000000 --- a/clients/client-athena/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AthenaClientConfig } from "./AthenaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AthenaClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-athena/runtimeConfig.ts b/clients/client-athena/runtimeConfig.ts deleted file mode 100644 index f8ae044a59e1..000000000000 --- a/clients/client-athena/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AthenaClientConfig } from "./AthenaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AthenaClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-athena/Athena.ts b/clients/client-athena/src/Athena.ts similarity index 100% rename from clients/client-athena/Athena.ts rename to clients/client-athena/src/Athena.ts diff --git a/clients/client-athena/AthenaClient.ts b/clients/client-athena/src/AthenaClient.ts similarity index 100% rename from clients/client-athena/AthenaClient.ts rename to clients/client-athena/src/AthenaClient.ts diff --git a/clients/client-athena/commands/BatchGetNamedQueryCommand.ts b/clients/client-athena/src/commands/BatchGetNamedQueryCommand.ts similarity index 100% rename from clients/client-athena/commands/BatchGetNamedQueryCommand.ts rename to clients/client-athena/src/commands/BatchGetNamedQueryCommand.ts diff --git a/clients/client-athena/commands/BatchGetQueryExecutionCommand.ts b/clients/client-athena/src/commands/BatchGetQueryExecutionCommand.ts similarity index 100% rename from clients/client-athena/commands/BatchGetQueryExecutionCommand.ts rename to clients/client-athena/src/commands/BatchGetQueryExecutionCommand.ts diff --git a/clients/client-athena/commands/CreateDataCatalogCommand.ts b/clients/client-athena/src/commands/CreateDataCatalogCommand.ts similarity index 100% rename from clients/client-athena/commands/CreateDataCatalogCommand.ts rename to clients/client-athena/src/commands/CreateDataCatalogCommand.ts diff --git a/clients/client-athena/commands/CreateNamedQueryCommand.ts b/clients/client-athena/src/commands/CreateNamedQueryCommand.ts similarity index 100% rename from clients/client-athena/commands/CreateNamedQueryCommand.ts rename to clients/client-athena/src/commands/CreateNamedQueryCommand.ts diff --git a/clients/client-athena/commands/CreatePreparedStatementCommand.ts b/clients/client-athena/src/commands/CreatePreparedStatementCommand.ts similarity index 100% rename from clients/client-athena/commands/CreatePreparedStatementCommand.ts rename to clients/client-athena/src/commands/CreatePreparedStatementCommand.ts diff --git a/clients/client-athena/commands/CreateWorkGroupCommand.ts b/clients/client-athena/src/commands/CreateWorkGroupCommand.ts similarity index 100% rename from clients/client-athena/commands/CreateWorkGroupCommand.ts rename to clients/client-athena/src/commands/CreateWorkGroupCommand.ts diff --git a/clients/client-athena/commands/DeleteDataCatalogCommand.ts b/clients/client-athena/src/commands/DeleteDataCatalogCommand.ts similarity index 100% rename from clients/client-athena/commands/DeleteDataCatalogCommand.ts rename to clients/client-athena/src/commands/DeleteDataCatalogCommand.ts diff --git a/clients/client-athena/commands/DeleteNamedQueryCommand.ts b/clients/client-athena/src/commands/DeleteNamedQueryCommand.ts similarity index 100% rename from clients/client-athena/commands/DeleteNamedQueryCommand.ts rename to clients/client-athena/src/commands/DeleteNamedQueryCommand.ts diff --git a/clients/client-athena/commands/DeletePreparedStatementCommand.ts b/clients/client-athena/src/commands/DeletePreparedStatementCommand.ts similarity index 100% rename from clients/client-athena/commands/DeletePreparedStatementCommand.ts rename to clients/client-athena/src/commands/DeletePreparedStatementCommand.ts diff --git a/clients/client-athena/commands/DeleteWorkGroupCommand.ts b/clients/client-athena/src/commands/DeleteWorkGroupCommand.ts similarity index 100% rename from clients/client-athena/commands/DeleteWorkGroupCommand.ts rename to clients/client-athena/src/commands/DeleteWorkGroupCommand.ts diff --git a/clients/client-athena/commands/GetDataCatalogCommand.ts b/clients/client-athena/src/commands/GetDataCatalogCommand.ts similarity index 100% rename from clients/client-athena/commands/GetDataCatalogCommand.ts rename to clients/client-athena/src/commands/GetDataCatalogCommand.ts diff --git a/clients/client-athena/commands/GetDatabaseCommand.ts b/clients/client-athena/src/commands/GetDatabaseCommand.ts similarity index 100% rename from clients/client-athena/commands/GetDatabaseCommand.ts rename to clients/client-athena/src/commands/GetDatabaseCommand.ts diff --git a/clients/client-athena/commands/GetNamedQueryCommand.ts b/clients/client-athena/src/commands/GetNamedQueryCommand.ts similarity index 100% rename from clients/client-athena/commands/GetNamedQueryCommand.ts rename to clients/client-athena/src/commands/GetNamedQueryCommand.ts diff --git a/clients/client-athena/commands/GetPreparedStatementCommand.ts b/clients/client-athena/src/commands/GetPreparedStatementCommand.ts similarity index 100% rename from clients/client-athena/commands/GetPreparedStatementCommand.ts rename to clients/client-athena/src/commands/GetPreparedStatementCommand.ts diff --git a/clients/client-athena/commands/GetQueryExecutionCommand.ts b/clients/client-athena/src/commands/GetQueryExecutionCommand.ts similarity index 100% rename from clients/client-athena/commands/GetQueryExecutionCommand.ts rename to clients/client-athena/src/commands/GetQueryExecutionCommand.ts diff --git a/clients/client-athena/commands/GetQueryResultsCommand.ts b/clients/client-athena/src/commands/GetQueryResultsCommand.ts similarity index 100% rename from clients/client-athena/commands/GetQueryResultsCommand.ts rename to clients/client-athena/src/commands/GetQueryResultsCommand.ts diff --git a/clients/client-athena/commands/GetTableMetadataCommand.ts b/clients/client-athena/src/commands/GetTableMetadataCommand.ts similarity index 100% rename from clients/client-athena/commands/GetTableMetadataCommand.ts rename to clients/client-athena/src/commands/GetTableMetadataCommand.ts diff --git a/clients/client-athena/commands/GetWorkGroupCommand.ts b/clients/client-athena/src/commands/GetWorkGroupCommand.ts similarity index 100% rename from clients/client-athena/commands/GetWorkGroupCommand.ts rename to clients/client-athena/src/commands/GetWorkGroupCommand.ts diff --git a/clients/client-athena/commands/ListDataCatalogsCommand.ts b/clients/client-athena/src/commands/ListDataCatalogsCommand.ts similarity index 100% rename from clients/client-athena/commands/ListDataCatalogsCommand.ts rename to clients/client-athena/src/commands/ListDataCatalogsCommand.ts diff --git a/clients/client-athena/commands/ListDatabasesCommand.ts b/clients/client-athena/src/commands/ListDatabasesCommand.ts similarity index 100% rename from clients/client-athena/commands/ListDatabasesCommand.ts rename to clients/client-athena/src/commands/ListDatabasesCommand.ts diff --git a/clients/client-athena/commands/ListEngineVersionsCommand.ts b/clients/client-athena/src/commands/ListEngineVersionsCommand.ts similarity index 100% rename from clients/client-athena/commands/ListEngineVersionsCommand.ts rename to clients/client-athena/src/commands/ListEngineVersionsCommand.ts diff --git a/clients/client-athena/commands/ListNamedQueriesCommand.ts b/clients/client-athena/src/commands/ListNamedQueriesCommand.ts similarity index 100% rename from clients/client-athena/commands/ListNamedQueriesCommand.ts rename to clients/client-athena/src/commands/ListNamedQueriesCommand.ts diff --git a/clients/client-athena/commands/ListPreparedStatementsCommand.ts b/clients/client-athena/src/commands/ListPreparedStatementsCommand.ts similarity index 100% rename from clients/client-athena/commands/ListPreparedStatementsCommand.ts rename to clients/client-athena/src/commands/ListPreparedStatementsCommand.ts diff --git a/clients/client-athena/commands/ListQueryExecutionsCommand.ts b/clients/client-athena/src/commands/ListQueryExecutionsCommand.ts similarity index 100% rename from clients/client-athena/commands/ListQueryExecutionsCommand.ts rename to clients/client-athena/src/commands/ListQueryExecutionsCommand.ts diff --git a/clients/client-athena/commands/ListTableMetadataCommand.ts b/clients/client-athena/src/commands/ListTableMetadataCommand.ts similarity index 100% rename from clients/client-athena/commands/ListTableMetadataCommand.ts rename to clients/client-athena/src/commands/ListTableMetadataCommand.ts diff --git a/clients/client-athena/commands/ListTagsForResourceCommand.ts b/clients/client-athena/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-athena/commands/ListTagsForResourceCommand.ts rename to clients/client-athena/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-athena/commands/ListWorkGroupsCommand.ts b/clients/client-athena/src/commands/ListWorkGroupsCommand.ts similarity index 100% rename from clients/client-athena/commands/ListWorkGroupsCommand.ts rename to clients/client-athena/src/commands/ListWorkGroupsCommand.ts diff --git a/clients/client-athena/commands/StartQueryExecutionCommand.ts b/clients/client-athena/src/commands/StartQueryExecutionCommand.ts similarity index 100% rename from clients/client-athena/commands/StartQueryExecutionCommand.ts rename to clients/client-athena/src/commands/StartQueryExecutionCommand.ts diff --git a/clients/client-athena/commands/StopQueryExecutionCommand.ts b/clients/client-athena/src/commands/StopQueryExecutionCommand.ts similarity index 100% rename from clients/client-athena/commands/StopQueryExecutionCommand.ts rename to clients/client-athena/src/commands/StopQueryExecutionCommand.ts diff --git a/clients/client-athena/commands/TagResourceCommand.ts b/clients/client-athena/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-athena/commands/TagResourceCommand.ts rename to clients/client-athena/src/commands/TagResourceCommand.ts diff --git a/clients/client-athena/commands/UntagResourceCommand.ts b/clients/client-athena/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-athena/commands/UntagResourceCommand.ts rename to clients/client-athena/src/commands/UntagResourceCommand.ts diff --git a/clients/client-athena/commands/UpdateDataCatalogCommand.ts b/clients/client-athena/src/commands/UpdateDataCatalogCommand.ts similarity index 100% rename from clients/client-athena/commands/UpdateDataCatalogCommand.ts rename to clients/client-athena/src/commands/UpdateDataCatalogCommand.ts diff --git a/clients/client-athena/commands/UpdatePreparedStatementCommand.ts b/clients/client-athena/src/commands/UpdatePreparedStatementCommand.ts similarity index 100% rename from clients/client-athena/commands/UpdatePreparedStatementCommand.ts rename to clients/client-athena/src/commands/UpdatePreparedStatementCommand.ts diff --git a/clients/client-athena/commands/UpdateWorkGroupCommand.ts b/clients/client-athena/src/commands/UpdateWorkGroupCommand.ts similarity index 100% rename from clients/client-athena/commands/UpdateWorkGroupCommand.ts rename to clients/client-athena/src/commands/UpdateWorkGroupCommand.ts diff --git a/clients/client-athena/endpoints.ts b/clients/client-athena/src/endpoints.ts similarity index 100% rename from clients/client-athena/endpoints.ts rename to clients/client-athena/src/endpoints.ts diff --git a/clients/client-athena/index.ts b/clients/client-athena/src/index.ts similarity index 100% rename from clients/client-athena/index.ts rename to clients/client-athena/src/index.ts diff --git a/clients/client-athena/models/index.ts b/clients/client-athena/src/models/index.ts similarity index 100% rename from clients/client-athena/models/index.ts rename to clients/client-athena/src/models/index.ts diff --git a/clients/client-athena/models/models_0.ts b/clients/client-athena/src/models/models_0.ts similarity index 100% rename from clients/client-athena/models/models_0.ts rename to clients/client-athena/src/models/models_0.ts diff --git a/clients/client-athena/pagination/GetQueryResultsPaginator.ts b/clients/client-athena/src/pagination/GetQueryResultsPaginator.ts similarity index 100% rename from clients/client-athena/pagination/GetQueryResultsPaginator.ts rename to clients/client-athena/src/pagination/GetQueryResultsPaginator.ts diff --git a/clients/client-athena/pagination/Interfaces.ts b/clients/client-athena/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-athena/pagination/Interfaces.ts rename to clients/client-athena/src/pagination/Interfaces.ts diff --git a/clients/client-athena/pagination/ListDataCatalogsPaginator.ts b/clients/client-athena/src/pagination/ListDataCatalogsPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListDataCatalogsPaginator.ts rename to clients/client-athena/src/pagination/ListDataCatalogsPaginator.ts diff --git a/clients/client-athena/pagination/ListDatabasesPaginator.ts b/clients/client-athena/src/pagination/ListDatabasesPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListDatabasesPaginator.ts rename to clients/client-athena/src/pagination/ListDatabasesPaginator.ts diff --git a/clients/client-athena/pagination/ListNamedQueriesPaginator.ts b/clients/client-athena/src/pagination/ListNamedQueriesPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListNamedQueriesPaginator.ts rename to clients/client-athena/src/pagination/ListNamedQueriesPaginator.ts diff --git a/clients/client-athena/pagination/ListPreparedStatementsPaginator.ts b/clients/client-athena/src/pagination/ListPreparedStatementsPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListPreparedStatementsPaginator.ts rename to clients/client-athena/src/pagination/ListPreparedStatementsPaginator.ts diff --git a/clients/client-athena/pagination/ListQueryExecutionsPaginator.ts b/clients/client-athena/src/pagination/ListQueryExecutionsPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListQueryExecutionsPaginator.ts rename to clients/client-athena/src/pagination/ListQueryExecutionsPaginator.ts diff --git a/clients/client-athena/pagination/ListTableMetadataPaginator.ts b/clients/client-athena/src/pagination/ListTableMetadataPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListTableMetadataPaginator.ts rename to clients/client-athena/src/pagination/ListTableMetadataPaginator.ts diff --git a/clients/client-athena/pagination/ListTagsForResourcePaginator.ts b/clients/client-athena/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListTagsForResourcePaginator.ts rename to clients/client-athena/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-athena/pagination/ListWorkGroupsPaginator.ts b/clients/client-athena/src/pagination/ListWorkGroupsPaginator.ts similarity index 100% rename from clients/client-athena/pagination/ListWorkGroupsPaginator.ts rename to clients/client-athena/src/pagination/ListWorkGroupsPaginator.ts diff --git a/clients/client-athena/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-athena/protocols/Aws_json1_1.ts rename to clients/client-athena/src/protocols/Aws_json1_1.ts diff --git a/clients/client-athena/src/runtimeConfig.browser.ts b/clients/client-athena/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d75745840d70 --- /dev/null +++ b/clients/client-athena/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AthenaClientConfig } from "./AthenaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AthenaClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-athena/runtimeConfig.native.ts b/clients/client-athena/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-athena/runtimeConfig.native.ts rename to clients/client-athena/src/runtimeConfig.native.ts diff --git a/clients/client-athena/runtimeConfig.shared.ts b/clients/client-athena/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-athena/runtimeConfig.shared.ts rename to clients/client-athena/src/runtimeConfig.shared.ts diff --git a/clients/client-athena/src/runtimeConfig.ts b/clients/client-athena/src/runtimeConfig.ts new file mode 100644 index 000000000000..9e9bf854aefd --- /dev/null +++ b/clients/client-athena/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AthenaClientConfig } from "./AthenaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AthenaClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-athena/tsconfig.es.json b/clients/client-athena/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-athena/tsconfig.es.json +++ b/clients/client-athena/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-athena/tsconfig.json b/clients/client-athena/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-athena/tsconfig.json +++ b/clients/client-athena/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-athena/tsconfig.types.json b/clients/client-athena/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-athena/tsconfig.types.json +++ b/clients/client-athena/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-auditmanager/.gitignore b/clients/client-auditmanager/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-auditmanager/.gitignore +++ b/clients/client-auditmanager/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-auditmanager/package.json b/clients/client-auditmanager/package.json index 3652d58e5572..9c3706c7cb8d 100644 --- a/clients/client-auditmanager/package.json +++ b/clients/client-auditmanager/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-auditmanager", "repository": { "type": "git", diff --git a/clients/client-auditmanager/runtimeConfig.browser.ts b/clients/client-auditmanager/runtimeConfig.browser.ts deleted file mode 100644 index 44e4b6822715..000000000000 --- a/clients/client-auditmanager/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AuditManagerClientConfig } from "./AuditManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AuditManagerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auditmanager/runtimeConfig.ts b/clients/client-auditmanager/runtimeConfig.ts deleted file mode 100644 index caee59ba555d..000000000000 --- a/clients/client-auditmanager/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AuditManagerClientConfig } from "./AuditManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AuditManagerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auditmanager/AuditManager.ts b/clients/client-auditmanager/src/AuditManager.ts similarity index 100% rename from clients/client-auditmanager/AuditManager.ts rename to clients/client-auditmanager/src/AuditManager.ts diff --git a/clients/client-auditmanager/AuditManagerClient.ts b/clients/client-auditmanager/src/AuditManagerClient.ts similarity index 100% rename from clients/client-auditmanager/AuditManagerClient.ts rename to clients/client-auditmanager/src/AuditManagerClient.ts diff --git a/clients/client-auditmanager/commands/AssociateAssessmentReportEvidenceFolderCommand.ts b/clients/client-auditmanager/src/commands/AssociateAssessmentReportEvidenceFolderCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/AssociateAssessmentReportEvidenceFolderCommand.ts rename to clients/client-auditmanager/src/commands/AssociateAssessmentReportEvidenceFolderCommand.ts diff --git a/clients/client-auditmanager/commands/BatchAssociateAssessmentReportEvidenceCommand.ts b/clients/client-auditmanager/src/commands/BatchAssociateAssessmentReportEvidenceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/BatchAssociateAssessmentReportEvidenceCommand.ts rename to clients/client-auditmanager/src/commands/BatchAssociateAssessmentReportEvidenceCommand.ts diff --git a/clients/client-auditmanager/commands/BatchCreateDelegationByAssessmentCommand.ts b/clients/client-auditmanager/src/commands/BatchCreateDelegationByAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/BatchCreateDelegationByAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/BatchCreateDelegationByAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/BatchDeleteDelegationByAssessmentCommand.ts b/clients/client-auditmanager/src/commands/BatchDeleteDelegationByAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/BatchDeleteDelegationByAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/BatchDeleteDelegationByAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/BatchDisassociateAssessmentReportEvidenceCommand.ts b/clients/client-auditmanager/src/commands/BatchDisassociateAssessmentReportEvidenceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/BatchDisassociateAssessmentReportEvidenceCommand.ts rename to clients/client-auditmanager/src/commands/BatchDisassociateAssessmentReportEvidenceCommand.ts diff --git a/clients/client-auditmanager/commands/BatchImportEvidenceToAssessmentControlCommand.ts b/clients/client-auditmanager/src/commands/BatchImportEvidenceToAssessmentControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/BatchImportEvidenceToAssessmentControlCommand.ts rename to clients/client-auditmanager/src/commands/BatchImportEvidenceToAssessmentControlCommand.ts diff --git a/clients/client-auditmanager/commands/CreateAssessmentCommand.ts b/clients/client-auditmanager/src/commands/CreateAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/CreateAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/CreateAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/CreateAssessmentFrameworkCommand.ts b/clients/client-auditmanager/src/commands/CreateAssessmentFrameworkCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/CreateAssessmentFrameworkCommand.ts rename to clients/client-auditmanager/src/commands/CreateAssessmentFrameworkCommand.ts diff --git a/clients/client-auditmanager/commands/CreateAssessmentReportCommand.ts b/clients/client-auditmanager/src/commands/CreateAssessmentReportCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/CreateAssessmentReportCommand.ts rename to clients/client-auditmanager/src/commands/CreateAssessmentReportCommand.ts diff --git a/clients/client-auditmanager/commands/CreateControlCommand.ts b/clients/client-auditmanager/src/commands/CreateControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/CreateControlCommand.ts rename to clients/client-auditmanager/src/commands/CreateControlCommand.ts diff --git a/clients/client-auditmanager/commands/DeleteAssessmentCommand.ts b/clients/client-auditmanager/src/commands/DeleteAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeleteAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/DeleteAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/DeleteAssessmentFrameworkCommand.ts b/clients/client-auditmanager/src/commands/DeleteAssessmentFrameworkCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeleteAssessmentFrameworkCommand.ts rename to clients/client-auditmanager/src/commands/DeleteAssessmentFrameworkCommand.ts diff --git a/clients/client-auditmanager/commands/DeleteAssessmentReportCommand.ts b/clients/client-auditmanager/src/commands/DeleteAssessmentReportCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeleteAssessmentReportCommand.ts rename to clients/client-auditmanager/src/commands/DeleteAssessmentReportCommand.ts diff --git a/clients/client-auditmanager/commands/DeleteControlCommand.ts b/clients/client-auditmanager/src/commands/DeleteControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeleteControlCommand.ts rename to clients/client-auditmanager/src/commands/DeleteControlCommand.ts diff --git a/clients/client-auditmanager/commands/DeregisterAccountCommand.ts b/clients/client-auditmanager/src/commands/DeregisterAccountCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeregisterAccountCommand.ts rename to clients/client-auditmanager/src/commands/DeregisterAccountCommand.ts diff --git a/clients/client-auditmanager/commands/DeregisterOrganizationAdminAccountCommand.ts b/clients/client-auditmanager/src/commands/DeregisterOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DeregisterOrganizationAdminAccountCommand.ts rename to clients/client-auditmanager/src/commands/DeregisterOrganizationAdminAccountCommand.ts diff --git a/clients/client-auditmanager/commands/DisassociateAssessmentReportEvidenceFolderCommand.ts b/clients/client-auditmanager/src/commands/DisassociateAssessmentReportEvidenceFolderCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/DisassociateAssessmentReportEvidenceFolderCommand.ts rename to clients/client-auditmanager/src/commands/DisassociateAssessmentReportEvidenceFolderCommand.ts diff --git a/clients/client-auditmanager/commands/GetAccountStatusCommand.ts b/clients/client-auditmanager/src/commands/GetAccountStatusCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetAccountStatusCommand.ts rename to clients/client-auditmanager/src/commands/GetAccountStatusCommand.ts diff --git a/clients/client-auditmanager/commands/GetAssessmentCommand.ts b/clients/client-auditmanager/src/commands/GetAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/GetAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/GetAssessmentFrameworkCommand.ts b/clients/client-auditmanager/src/commands/GetAssessmentFrameworkCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetAssessmentFrameworkCommand.ts rename to clients/client-auditmanager/src/commands/GetAssessmentFrameworkCommand.ts diff --git a/clients/client-auditmanager/commands/GetAssessmentReportUrlCommand.ts b/clients/client-auditmanager/src/commands/GetAssessmentReportUrlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetAssessmentReportUrlCommand.ts rename to clients/client-auditmanager/src/commands/GetAssessmentReportUrlCommand.ts diff --git a/clients/client-auditmanager/commands/GetChangeLogsCommand.ts b/clients/client-auditmanager/src/commands/GetChangeLogsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetChangeLogsCommand.ts rename to clients/client-auditmanager/src/commands/GetChangeLogsCommand.ts diff --git a/clients/client-auditmanager/commands/GetControlCommand.ts b/clients/client-auditmanager/src/commands/GetControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetControlCommand.ts rename to clients/client-auditmanager/src/commands/GetControlCommand.ts diff --git a/clients/client-auditmanager/commands/GetDelegationsCommand.ts b/clients/client-auditmanager/src/commands/GetDelegationsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetDelegationsCommand.ts rename to clients/client-auditmanager/src/commands/GetDelegationsCommand.ts diff --git a/clients/client-auditmanager/commands/GetEvidenceByEvidenceFolderCommand.ts b/clients/client-auditmanager/src/commands/GetEvidenceByEvidenceFolderCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetEvidenceByEvidenceFolderCommand.ts rename to clients/client-auditmanager/src/commands/GetEvidenceByEvidenceFolderCommand.ts diff --git a/clients/client-auditmanager/commands/GetEvidenceCommand.ts b/clients/client-auditmanager/src/commands/GetEvidenceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetEvidenceCommand.ts rename to clients/client-auditmanager/src/commands/GetEvidenceCommand.ts diff --git a/clients/client-auditmanager/commands/GetEvidenceFolderCommand.ts b/clients/client-auditmanager/src/commands/GetEvidenceFolderCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetEvidenceFolderCommand.ts rename to clients/client-auditmanager/src/commands/GetEvidenceFolderCommand.ts diff --git a/clients/client-auditmanager/commands/GetEvidenceFoldersByAssessmentCommand.ts b/clients/client-auditmanager/src/commands/GetEvidenceFoldersByAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetEvidenceFoldersByAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/GetEvidenceFoldersByAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/GetEvidenceFoldersByAssessmentControlCommand.ts b/clients/client-auditmanager/src/commands/GetEvidenceFoldersByAssessmentControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetEvidenceFoldersByAssessmentControlCommand.ts rename to clients/client-auditmanager/src/commands/GetEvidenceFoldersByAssessmentControlCommand.ts diff --git a/clients/client-auditmanager/commands/GetOrganizationAdminAccountCommand.ts b/clients/client-auditmanager/src/commands/GetOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetOrganizationAdminAccountCommand.ts rename to clients/client-auditmanager/src/commands/GetOrganizationAdminAccountCommand.ts diff --git a/clients/client-auditmanager/commands/GetServicesInScopeCommand.ts b/clients/client-auditmanager/src/commands/GetServicesInScopeCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetServicesInScopeCommand.ts rename to clients/client-auditmanager/src/commands/GetServicesInScopeCommand.ts diff --git a/clients/client-auditmanager/commands/GetSettingsCommand.ts b/clients/client-auditmanager/src/commands/GetSettingsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/GetSettingsCommand.ts rename to clients/client-auditmanager/src/commands/GetSettingsCommand.ts diff --git a/clients/client-auditmanager/commands/ListAssessmentFrameworksCommand.ts b/clients/client-auditmanager/src/commands/ListAssessmentFrameworksCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListAssessmentFrameworksCommand.ts rename to clients/client-auditmanager/src/commands/ListAssessmentFrameworksCommand.ts diff --git a/clients/client-auditmanager/commands/ListAssessmentReportsCommand.ts b/clients/client-auditmanager/src/commands/ListAssessmentReportsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListAssessmentReportsCommand.ts rename to clients/client-auditmanager/src/commands/ListAssessmentReportsCommand.ts diff --git a/clients/client-auditmanager/commands/ListAssessmentsCommand.ts b/clients/client-auditmanager/src/commands/ListAssessmentsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListAssessmentsCommand.ts rename to clients/client-auditmanager/src/commands/ListAssessmentsCommand.ts diff --git a/clients/client-auditmanager/commands/ListControlsCommand.ts b/clients/client-auditmanager/src/commands/ListControlsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListControlsCommand.ts rename to clients/client-auditmanager/src/commands/ListControlsCommand.ts diff --git a/clients/client-auditmanager/commands/ListKeywordsForDataSourceCommand.ts b/clients/client-auditmanager/src/commands/ListKeywordsForDataSourceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListKeywordsForDataSourceCommand.ts rename to clients/client-auditmanager/src/commands/ListKeywordsForDataSourceCommand.ts diff --git a/clients/client-auditmanager/commands/ListNotificationsCommand.ts b/clients/client-auditmanager/src/commands/ListNotificationsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListNotificationsCommand.ts rename to clients/client-auditmanager/src/commands/ListNotificationsCommand.ts diff --git a/clients/client-auditmanager/commands/ListTagsForResourceCommand.ts b/clients/client-auditmanager/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ListTagsForResourceCommand.ts rename to clients/client-auditmanager/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-auditmanager/commands/RegisterAccountCommand.ts b/clients/client-auditmanager/src/commands/RegisterAccountCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/RegisterAccountCommand.ts rename to clients/client-auditmanager/src/commands/RegisterAccountCommand.ts diff --git a/clients/client-auditmanager/commands/RegisterOrganizationAdminAccountCommand.ts b/clients/client-auditmanager/src/commands/RegisterOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/RegisterOrganizationAdminAccountCommand.ts rename to clients/client-auditmanager/src/commands/RegisterOrganizationAdminAccountCommand.ts diff --git a/clients/client-auditmanager/commands/TagResourceCommand.ts b/clients/client-auditmanager/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/TagResourceCommand.ts rename to clients/client-auditmanager/src/commands/TagResourceCommand.ts diff --git a/clients/client-auditmanager/commands/UntagResourceCommand.ts b/clients/client-auditmanager/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UntagResourceCommand.ts rename to clients/client-auditmanager/src/commands/UntagResourceCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateAssessmentCommand.ts b/clients/client-auditmanager/src/commands/UpdateAssessmentCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateAssessmentCommand.ts rename to clients/client-auditmanager/src/commands/UpdateAssessmentCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateAssessmentControlCommand.ts b/clients/client-auditmanager/src/commands/UpdateAssessmentControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateAssessmentControlCommand.ts rename to clients/client-auditmanager/src/commands/UpdateAssessmentControlCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateAssessmentControlSetStatusCommand.ts b/clients/client-auditmanager/src/commands/UpdateAssessmentControlSetStatusCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateAssessmentControlSetStatusCommand.ts rename to clients/client-auditmanager/src/commands/UpdateAssessmentControlSetStatusCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateAssessmentFrameworkCommand.ts b/clients/client-auditmanager/src/commands/UpdateAssessmentFrameworkCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateAssessmentFrameworkCommand.ts rename to clients/client-auditmanager/src/commands/UpdateAssessmentFrameworkCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateAssessmentStatusCommand.ts b/clients/client-auditmanager/src/commands/UpdateAssessmentStatusCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateAssessmentStatusCommand.ts rename to clients/client-auditmanager/src/commands/UpdateAssessmentStatusCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateControlCommand.ts b/clients/client-auditmanager/src/commands/UpdateControlCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateControlCommand.ts rename to clients/client-auditmanager/src/commands/UpdateControlCommand.ts diff --git a/clients/client-auditmanager/commands/UpdateSettingsCommand.ts b/clients/client-auditmanager/src/commands/UpdateSettingsCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/UpdateSettingsCommand.ts rename to clients/client-auditmanager/src/commands/UpdateSettingsCommand.ts diff --git a/clients/client-auditmanager/commands/ValidateAssessmentReportIntegrityCommand.ts b/clients/client-auditmanager/src/commands/ValidateAssessmentReportIntegrityCommand.ts similarity index 100% rename from clients/client-auditmanager/commands/ValidateAssessmentReportIntegrityCommand.ts rename to clients/client-auditmanager/src/commands/ValidateAssessmentReportIntegrityCommand.ts diff --git a/clients/client-auditmanager/endpoints.ts b/clients/client-auditmanager/src/endpoints.ts similarity index 100% rename from clients/client-auditmanager/endpoints.ts rename to clients/client-auditmanager/src/endpoints.ts diff --git a/clients/client-auditmanager/index.ts b/clients/client-auditmanager/src/index.ts similarity index 100% rename from clients/client-auditmanager/index.ts rename to clients/client-auditmanager/src/index.ts diff --git a/clients/client-auditmanager/models/index.ts b/clients/client-auditmanager/src/models/index.ts similarity index 100% rename from clients/client-auditmanager/models/index.ts rename to clients/client-auditmanager/src/models/index.ts diff --git a/clients/client-auditmanager/models/models_0.ts b/clients/client-auditmanager/src/models/models_0.ts similarity index 100% rename from clients/client-auditmanager/models/models_0.ts rename to clients/client-auditmanager/src/models/models_0.ts diff --git a/clients/client-auditmanager/pagination/GetChangeLogsPaginator.ts b/clients/client-auditmanager/src/pagination/GetChangeLogsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/GetChangeLogsPaginator.ts rename to clients/client-auditmanager/src/pagination/GetChangeLogsPaginator.ts diff --git a/clients/client-auditmanager/pagination/GetDelegationsPaginator.ts b/clients/client-auditmanager/src/pagination/GetDelegationsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/GetDelegationsPaginator.ts rename to clients/client-auditmanager/src/pagination/GetDelegationsPaginator.ts diff --git a/clients/client-auditmanager/pagination/GetEvidenceByEvidenceFolderPaginator.ts b/clients/client-auditmanager/src/pagination/GetEvidenceByEvidenceFolderPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/GetEvidenceByEvidenceFolderPaginator.ts rename to clients/client-auditmanager/src/pagination/GetEvidenceByEvidenceFolderPaginator.ts diff --git a/clients/client-auditmanager/pagination/GetEvidenceFoldersByAssessmentControlPaginator.ts b/clients/client-auditmanager/src/pagination/GetEvidenceFoldersByAssessmentControlPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/GetEvidenceFoldersByAssessmentControlPaginator.ts rename to clients/client-auditmanager/src/pagination/GetEvidenceFoldersByAssessmentControlPaginator.ts diff --git a/clients/client-auditmanager/pagination/GetEvidenceFoldersByAssessmentPaginator.ts b/clients/client-auditmanager/src/pagination/GetEvidenceFoldersByAssessmentPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/GetEvidenceFoldersByAssessmentPaginator.ts rename to clients/client-auditmanager/src/pagination/GetEvidenceFoldersByAssessmentPaginator.ts diff --git a/clients/client-auditmanager/pagination/Interfaces.ts b/clients/client-auditmanager/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-auditmanager/pagination/Interfaces.ts rename to clients/client-auditmanager/src/pagination/Interfaces.ts diff --git a/clients/client-auditmanager/pagination/ListAssessmentFrameworksPaginator.ts b/clients/client-auditmanager/src/pagination/ListAssessmentFrameworksPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListAssessmentFrameworksPaginator.ts rename to clients/client-auditmanager/src/pagination/ListAssessmentFrameworksPaginator.ts diff --git a/clients/client-auditmanager/pagination/ListAssessmentReportsPaginator.ts b/clients/client-auditmanager/src/pagination/ListAssessmentReportsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListAssessmentReportsPaginator.ts rename to clients/client-auditmanager/src/pagination/ListAssessmentReportsPaginator.ts diff --git a/clients/client-auditmanager/pagination/ListAssessmentsPaginator.ts b/clients/client-auditmanager/src/pagination/ListAssessmentsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListAssessmentsPaginator.ts rename to clients/client-auditmanager/src/pagination/ListAssessmentsPaginator.ts diff --git a/clients/client-auditmanager/pagination/ListControlsPaginator.ts b/clients/client-auditmanager/src/pagination/ListControlsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListControlsPaginator.ts rename to clients/client-auditmanager/src/pagination/ListControlsPaginator.ts diff --git a/clients/client-auditmanager/pagination/ListKeywordsForDataSourcePaginator.ts b/clients/client-auditmanager/src/pagination/ListKeywordsForDataSourcePaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListKeywordsForDataSourcePaginator.ts rename to clients/client-auditmanager/src/pagination/ListKeywordsForDataSourcePaginator.ts diff --git a/clients/client-auditmanager/pagination/ListNotificationsPaginator.ts b/clients/client-auditmanager/src/pagination/ListNotificationsPaginator.ts similarity index 100% rename from clients/client-auditmanager/pagination/ListNotificationsPaginator.ts rename to clients/client-auditmanager/src/pagination/ListNotificationsPaginator.ts diff --git a/clients/client-auditmanager/protocols/Aws_restJson1.ts b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-auditmanager/protocols/Aws_restJson1.ts rename to clients/client-auditmanager/src/protocols/Aws_restJson1.ts diff --git a/clients/client-auditmanager/src/runtimeConfig.browser.ts b/clients/client-auditmanager/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f59cdb90b2ca --- /dev/null +++ b/clients/client-auditmanager/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AuditManagerClientConfig } from "./AuditManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AuditManagerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auditmanager/runtimeConfig.native.ts b/clients/client-auditmanager/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-auditmanager/runtimeConfig.native.ts rename to clients/client-auditmanager/src/runtimeConfig.native.ts diff --git a/clients/client-auditmanager/runtimeConfig.shared.ts b/clients/client-auditmanager/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-auditmanager/runtimeConfig.shared.ts rename to clients/client-auditmanager/src/runtimeConfig.shared.ts diff --git a/clients/client-auditmanager/src/runtimeConfig.ts b/clients/client-auditmanager/src/runtimeConfig.ts new file mode 100644 index 000000000000..b27672a67b62 --- /dev/null +++ b/clients/client-auditmanager/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AuditManagerClientConfig } from "./AuditManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AuditManagerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auditmanager/tsconfig.es.json b/clients/client-auditmanager/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-auditmanager/tsconfig.es.json +++ b/clients/client-auditmanager/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-auditmanager/tsconfig.json b/clients/client-auditmanager/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-auditmanager/tsconfig.json +++ b/clients/client-auditmanager/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-auditmanager/tsconfig.types.json b/clients/client-auditmanager/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-auditmanager/tsconfig.types.json +++ b/clients/client-auditmanager/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-auto-scaling-plans/.gitignore b/clients/client-auto-scaling-plans/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-auto-scaling-plans/.gitignore +++ b/clients/client-auto-scaling-plans/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-auto-scaling-plans/package.json b/clients/client-auto-scaling-plans/package.json index 4dacc1ccb2f0..9de3be8bb811 100644 --- a/clients/client-auto-scaling-plans/package.json +++ b/clients/client-auto-scaling-plans/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-auto-scaling-plans", "repository": { "type": "git", diff --git a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts deleted file mode 100644 index 0c30a15206e5..000000000000 --- a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AutoScalingPlansClientConfig } from "./AutoScalingPlansClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.ts b/clients/client-auto-scaling-plans/runtimeConfig.ts deleted file mode 100644 index 0ac7fb81ce9e..000000000000 --- a/clients/client-auto-scaling-plans/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AutoScalingPlansClientConfig } from "./AutoScalingPlansClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auto-scaling-plans/AutoScalingPlans.ts b/clients/client-auto-scaling-plans/src/AutoScalingPlans.ts similarity index 100% rename from clients/client-auto-scaling-plans/AutoScalingPlans.ts rename to clients/client-auto-scaling-plans/src/AutoScalingPlans.ts diff --git a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts similarity index 100% rename from clients/client-auto-scaling-plans/AutoScalingPlansClient.ts rename to clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts diff --git a/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts b/clients/client-auto-scaling-plans/src/commands/CreateScalingPlanCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts rename to clients/client-auto-scaling-plans/src/commands/CreateScalingPlanCommand.ts diff --git a/clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts b/clients/client-auto-scaling-plans/src/commands/DeleteScalingPlanCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts rename to clients/client-auto-scaling-plans/src/commands/DeleteScalingPlanCommand.ts diff --git a/clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts b/clients/client-auto-scaling-plans/src/commands/DescribeScalingPlanResourcesCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts rename to clients/client-auto-scaling-plans/src/commands/DescribeScalingPlanResourcesCommand.ts diff --git a/clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts b/clients/client-auto-scaling-plans/src/commands/DescribeScalingPlansCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts rename to clients/client-auto-scaling-plans/src/commands/DescribeScalingPlansCommand.ts diff --git a/clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts b/clients/client-auto-scaling-plans/src/commands/GetScalingPlanResourceForecastDataCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts rename to clients/client-auto-scaling-plans/src/commands/GetScalingPlanResourceForecastDataCommand.ts diff --git a/clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts b/clients/client-auto-scaling-plans/src/commands/UpdateScalingPlanCommand.ts similarity index 100% rename from clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts rename to clients/client-auto-scaling-plans/src/commands/UpdateScalingPlanCommand.ts diff --git a/clients/client-auto-scaling-plans/endpoints.ts b/clients/client-auto-scaling-plans/src/endpoints.ts similarity index 100% rename from clients/client-auto-scaling-plans/endpoints.ts rename to clients/client-auto-scaling-plans/src/endpoints.ts diff --git a/clients/client-auto-scaling-plans/index.ts b/clients/client-auto-scaling-plans/src/index.ts similarity index 100% rename from clients/client-auto-scaling-plans/index.ts rename to clients/client-auto-scaling-plans/src/index.ts diff --git a/clients/client-auto-scaling-plans/models/index.ts b/clients/client-auto-scaling-plans/src/models/index.ts similarity index 100% rename from clients/client-auto-scaling-plans/models/index.ts rename to clients/client-auto-scaling-plans/src/models/index.ts diff --git a/clients/client-auto-scaling-plans/models/models_0.ts b/clients/client-auto-scaling-plans/src/models/models_0.ts similarity index 100% rename from clients/client-auto-scaling-plans/models/models_0.ts rename to clients/client-auto-scaling-plans/src/models/models_0.ts diff --git a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts rename to clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts diff --git a/clients/client-auto-scaling-plans/src/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..aa1754194527 --- /dev/null +++ b/clients/client-auto-scaling-plans/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AutoScalingPlansClientConfig } from "./AutoScalingPlansClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.native.ts b/clients/client-auto-scaling-plans/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-auto-scaling-plans/runtimeConfig.native.ts rename to clients/client-auto-scaling-plans/src/runtimeConfig.native.ts diff --git a/clients/client-auto-scaling-plans/runtimeConfig.shared.ts b/clients/client-auto-scaling-plans/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-auto-scaling-plans/runtimeConfig.shared.ts rename to clients/client-auto-scaling-plans/src/runtimeConfig.shared.ts diff --git a/clients/client-auto-scaling-plans/src/runtimeConfig.ts b/clients/client-auto-scaling-plans/src/runtimeConfig.ts new file mode 100644 index 000000000000..0e1090d49cd6 --- /dev/null +++ b/clients/client-auto-scaling-plans/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AutoScalingPlansClientConfig } from "./AutoScalingPlansClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auto-scaling-plans/tsconfig.es.json b/clients/client-auto-scaling-plans/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-auto-scaling-plans/tsconfig.es.json +++ b/clients/client-auto-scaling-plans/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-auto-scaling-plans/tsconfig.json b/clients/client-auto-scaling-plans/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-auto-scaling-plans/tsconfig.json +++ b/clients/client-auto-scaling-plans/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-auto-scaling-plans/tsconfig.types.json b/clients/client-auto-scaling-plans/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-auto-scaling-plans/tsconfig.types.json +++ b/clients/client-auto-scaling-plans/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-auto-scaling/.gitignore b/clients/client-auto-scaling/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-auto-scaling/.gitignore +++ b/clients/client-auto-scaling/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-auto-scaling/package.json b/clients/client-auto-scaling/package.json index ecd8e07ebbc3..d8fa9d047dc6 100644 --- a/clients/client-auto-scaling/package.json +++ b/clients/client-auto-scaling/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-auto-scaling", "repository": { "type": "git", diff --git a/clients/client-auto-scaling/runtimeConfig.browser.ts b/clients/client-auto-scaling/runtimeConfig.browser.ts deleted file mode 100644 index 6cc9dba503d2..000000000000 --- a/clients/client-auto-scaling/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { AutoScalingClientConfig } from "./AutoScalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AutoScalingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auto-scaling/runtimeConfig.ts b/clients/client-auto-scaling/runtimeConfig.ts deleted file mode 100644 index e00dba1663aa..000000000000 --- a/clients/client-auto-scaling/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { AutoScalingClientConfig } from "./AutoScalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: AutoScalingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-auto-scaling/AutoScaling.ts b/clients/client-auto-scaling/src/AutoScaling.ts similarity index 100% rename from clients/client-auto-scaling/AutoScaling.ts rename to clients/client-auto-scaling/src/AutoScaling.ts diff --git a/clients/client-auto-scaling/AutoScalingClient.ts b/clients/client-auto-scaling/src/AutoScalingClient.ts similarity index 100% rename from clients/client-auto-scaling/AutoScalingClient.ts rename to clients/client-auto-scaling/src/AutoScalingClient.ts diff --git a/clients/client-auto-scaling/commands/AttachInstancesCommand.ts b/clients/client-auto-scaling/src/commands/AttachInstancesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/AttachInstancesCommand.ts rename to clients/client-auto-scaling/src/commands/AttachInstancesCommand.ts diff --git a/clients/client-auto-scaling/commands/AttachLoadBalancerTargetGroupsCommand.ts b/clients/client-auto-scaling/src/commands/AttachLoadBalancerTargetGroupsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/AttachLoadBalancerTargetGroupsCommand.ts rename to clients/client-auto-scaling/src/commands/AttachLoadBalancerTargetGroupsCommand.ts diff --git a/clients/client-auto-scaling/commands/AttachLoadBalancersCommand.ts b/clients/client-auto-scaling/src/commands/AttachLoadBalancersCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/AttachLoadBalancersCommand.ts rename to clients/client-auto-scaling/src/commands/AttachLoadBalancersCommand.ts diff --git a/clients/client-auto-scaling/commands/BatchDeleteScheduledActionCommand.ts b/clients/client-auto-scaling/src/commands/BatchDeleteScheduledActionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/BatchDeleteScheduledActionCommand.ts rename to clients/client-auto-scaling/src/commands/BatchDeleteScheduledActionCommand.ts diff --git a/clients/client-auto-scaling/commands/BatchPutScheduledUpdateGroupActionCommand.ts b/clients/client-auto-scaling/src/commands/BatchPutScheduledUpdateGroupActionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/BatchPutScheduledUpdateGroupActionCommand.ts rename to clients/client-auto-scaling/src/commands/BatchPutScheduledUpdateGroupActionCommand.ts diff --git a/clients/client-auto-scaling/commands/CancelInstanceRefreshCommand.ts b/clients/client-auto-scaling/src/commands/CancelInstanceRefreshCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/CancelInstanceRefreshCommand.ts rename to clients/client-auto-scaling/src/commands/CancelInstanceRefreshCommand.ts diff --git a/clients/client-auto-scaling/commands/CompleteLifecycleActionCommand.ts b/clients/client-auto-scaling/src/commands/CompleteLifecycleActionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/CompleteLifecycleActionCommand.ts rename to clients/client-auto-scaling/src/commands/CompleteLifecycleActionCommand.ts diff --git a/clients/client-auto-scaling/commands/CreateAutoScalingGroupCommand.ts b/clients/client-auto-scaling/src/commands/CreateAutoScalingGroupCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/CreateAutoScalingGroupCommand.ts rename to clients/client-auto-scaling/src/commands/CreateAutoScalingGroupCommand.ts diff --git a/clients/client-auto-scaling/commands/CreateLaunchConfigurationCommand.ts b/clients/client-auto-scaling/src/commands/CreateLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/CreateLaunchConfigurationCommand.ts rename to clients/client-auto-scaling/src/commands/CreateLaunchConfigurationCommand.ts diff --git a/clients/client-auto-scaling/commands/CreateOrUpdateTagsCommand.ts b/clients/client-auto-scaling/src/commands/CreateOrUpdateTagsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/CreateOrUpdateTagsCommand.ts rename to clients/client-auto-scaling/src/commands/CreateOrUpdateTagsCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteAutoScalingGroupCommand.ts b/clients/client-auto-scaling/src/commands/DeleteAutoScalingGroupCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteAutoScalingGroupCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteAutoScalingGroupCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteLaunchConfigurationCommand.ts b/clients/client-auto-scaling/src/commands/DeleteLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteLaunchConfigurationCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteLaunchConfigurationCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteLifecycleHookCommand.ts b/clients/client-auto-scaling/src/commands/DeleteLifecycleHookCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteLifecycleHookCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteLifecycleHookCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteNotificationConfigurationCommand.ts b/clients/client-auto-scaling/src/commands/DeleteNotificationConfigurationCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteNotificationConfigurationCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteNotificationConfigurationCommand.ts diff --git a/clients/client-auto-scaling/commands/DeletePolicyCommand.ts b/clients/client-auto-scaling/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeletePolicyCommand.ts rename to clients/client-auto-scaling/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteScheduledActionCommand.ts b/clients/client-auto-scaling/src/commands/DeleteScheduledActionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteScheduledActionCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteScheduledActionCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteTagsCommand.ts b/clients/client-auto-scaling/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteTagsCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-auto-scaling/commands/DeleteWarmPoolCommand.ts b/clients/client-auto-scaling/src/commands/DeleteWarmPoolCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DeleteWarmPoolCommand.ts rename to clients/client-auto-scaling/src/commands/DeleteWarmPoolCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeAccountLimitsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeAccountLimitsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeAccountLimitsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeAccountLimitsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeAdjustmentTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeAdjustmentTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeAdjustmentTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeAdjustmentTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeAutoScalingGroupsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeAutoScalingGroupsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeAutoScalingGroupsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeAutoScalingGroupsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeAutoScalingInstancesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeAutoScalingInstancesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeAutoScalingInstancesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeAutoScalingInstancesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeAutoScalingNotificationTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeAutoScalingNotificationTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeAutoScalingNotificationTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeAutoScalingNotificationTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeInstanceRefreshesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeInstanceRefreshesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeInstanceRefreshesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeInstanceRefreshesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeLaunchConfigurationsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeLaunchConfigurationsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeLaunchConfigurationsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeLaunchConfigurationsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeLifecycleHookTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeLifecycleHookTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeLifecycleHookTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeLifecycleHookTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeLifecycleHooksCommand.ts b/clients/client-auto-scaling/src/commands/DescribeLifecycleHooksCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeLifecycleHooksCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeLifecycleHooksCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeLoadBalancerTargetGroupsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeLoadBalancerTargetGroupsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeLoadBalancerTargetGroupsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeLoadBalancerTargetGroupsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeLoadBalancersCommand.ts b/clients/client-auto-scaling/src/commands/DescribeLoadBalancersCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeLoadBalancersCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeLoadBalancersCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeMetricCollectionTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeMetricCollectionTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeMetricCollectionTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeMetricCollectionTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeNotificationConfigurationsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeNotificationConfigurationsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeNotificationConfigurationsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeNotificationConfigurationsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribePoliciesCommand.ts b/clients/client-auto-scaling/src/commands/DescribePoliciesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribePoliciesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribePoliciesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeScalingActivitiesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeScalingActivitiesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeScalingActivitiesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeScalingActivitiesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeScalingProcessTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeScalingProcessTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeScalingProcessTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeScalingProcessTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeScheduledActionsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeScheduledActionsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeScheduledActionsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeScheduledActionsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeTagsCommand.ts b/clients/client-auto-scaling/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeTagsCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeTerminationPolicyTypesCommand.ts b/clients/client-auto-scaling/src/commands/DescribeTerminationPolicyTypesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeTerminationPolicyTypesCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeTerminationPolicyTypesCommand.ts diff --git a/clients/client-auto-scaling/commands/DescribeWarmPoolCommand.ts b/clients/client-auto-scaling/src/commands/DescribeWarmPoolCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DescribeWarmPoolCommand.ts rename to clients/client-auto-scaling/src/commands/DescribeWarmPoolCommand.ts diff --git a/clients/client-auto-scaling/commands/DetachInstancesCommand.ts b/clients/client-auto-scaling/src/commands/DetachInstancesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DetachInstancesCommand.ts rename to clients/client-auto-scaling/src/commands/DetachInstancesCommand.ts diff --git a/clients/client-auto-scaling/commands/DetachLoadBalancerTargetGroupsCommand.ts b/clients/client-auto-scaling/src/commands/DetachLoadBalancerTargetGroupsCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DetachLoadBalancerTargetGroupsCommand.ts rename to clients/client-auto-scaling/src/commands/DetachLoadBalancerTargetGroupsCommand.ts diff --git a/clients/client-auto-scaling/commands/DetachLoadBalancersCommand.ts b/clients/client-auto-scaling/src/commands/DetachLoadBalancersCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DetachLoadBalancersCommand.ts rename to clients/client-auto-scaling/src/commands/DetachLoadBalancersCommand.ts diff --git a/clients/client-auto-scaling/commands/DisableMetricsCollectionCommand.ts b/clients/client-auto-scaling/src/commands/DisableMetricsCollectionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/DisableMetricsCollectionCommand.ts rename to clients/client-auto-scaling/src/commands/DisableMetricsCollectionCommand.ts diff --git a/clients/client-auto-scaling/commands/EnableMetricsCollectionCommand.ts b/clients/client-auto-scaling/src/commands/EnableMetricsCollectionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/EnableMetricsCollectionCommand.ts rename to clients/client-auto-scaling/src/commands/EnableMetricsCollectionCommand.ts diff --git a/clients/client-auto-scaling/commands/EnterStandbyCommand.ts b/clients/client-auto-scaling/src/commands/EnterStandbyCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/EnterStandbyCommand.ts rename to clients/client-auto-scaling/src/commands/EnterStandbyCommand.ts diff --git a/clients/client-auto-scaling/commands/ExecutePolicyCommand.ts b/clients/client-auto-scaling/src/commands/ExecutePolicyCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/ExecutePolicyCommand.ts rename to clients/client-auto-scaling/src/commands/ExecutePolicyCommand.ts diff --git a/clients/client-auto-scaling/commands/ExitStandbyCommand.ts b/clients/client-auto-scaling/src/commands/ExitStandbyCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/ExitStandbyCommand.ts rename to clients/client-auto-scaling/src/commands/ExitStandbyCommand.ts diff --git a/clients/client-auto-scaling/commands/GetPredictiveScalingForecastCommand.ts b/clients/client-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/GetPredictiveScalingForecastCommand.ts rename to clients/client-auto-scaling/src/commands/GetPredictiveScalingForecastCommand.ts diff --git a/clients/client-auto-scaling/commands/PutLifecycleHookCommand.ts b/clients/client-auto-scaling/src/commands/PutLifecycleHookCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/PutLifecycleHookCommand.ts rename to clients/client-auto-scaling/src/commands/PutLifecycleHookCommand.ts diff --git a/clients/client-auto-scaling/commands/PutNotificationConfigurationCommand.ts b/clients/client-auto-scaling/src/commands/PutNotificationConfigurationCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/PutNotificationConfigurationCommand.ts rename to clients/client-auto-scaling/src/commands/PutNotificationConfigurationCommand.ts diff --git a/clients/client-auto-scaling/commands/PutScalingPolicyCommand.ts b/clients/client-auto-scaling/src/commands/PutScalingPolicyCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/PutScalingPolicyCommand.ts rename to clients/client-auto-scaling/src/commands/PutScalingPolicyCommand.ts diff --git a/clients/client-auto-scaling/commands/PutScheduledUpdateGroupActionCommand.ts b/clients/client-auto-scaling/src/commands/PutScheduledUpdateGroupActionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/PutScheduledUpdateGroupActionCommand.ts rename to clients/client-auto-scaling/src/commands/PutScheduledUpdateGroupActionCommand.ts diff --git a/clients/client-auto-scaling/commands/PutWarmPoolCommand.ts b/clients/client-auto-scaling/src/commands/PutWarmPoolCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/PutWarmPoolCommand.ts rename to clients/client-auto-scaling/src/commands/PutWarmPoolCommand.ts diff --git a/clients/client-auto-scaling/commands/RecordLifecycleActionHeartbeatCommand.ts b/clients/client-auto-scaling/src/commands/RecordLifecycleActionHeartbeatCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/RecordLifecycleActionHeartbeatCommand.ts rename to clients/client-auto-scaling/src/commands/RecordLifecycleActionHeartbeatCommand.ts diff --git a/clients/client-auto-scaling/commands/ResumeProcessesCommand.ts b/clients/client-auto-scaling/src/commands/ResumeProcessesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/ResumeProcessesCommand.ts rename to clients/client-auto-scaling/src/commands/ResumeProcessesCommand.ts diff --git a/clients/client-auto-scaling/commands/SetDesiredCapacityCommand.ts b/clients/client-auto-scaling/src/commands/SetDesiredCapacityCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/SetDesiredCapacityCommand.ts rename to clients/client-auto-scaling/src/commands/SetDesiredCapacityCommand.ts diff --git a/clients/client-auto-scaling/commands/SetInstanceHealthCommand.ts b/clients/client-auto-scaling/src/commands/SetInstanceHealthCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/SetInstanceHealthCommand.ts rename to clients/client-auto-scaling/src/commands/SetInstanceHealthCommand.ts diff --git a/clients/client-auto-scaling/commands/SetInstanceProtectionCommand.ts b/clients/client-auto-scaling/src/commands/SetInstanceProtectionCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/SetInstanceProtectionCommand.ts rename to clients/client-auto-scaling/src/commands/SetInstanceProtectionCommand.ts diff --git a/clients/client-auto-scaling/commands/StartInstanceRefreshCommand.ts b/clients/client-auto-scaling/src/commands/StartInstanceRefreshCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/StartInstanceRefreshCommand.ts rename to clients/client-auto-scaling/src/commands/StartInstanceRefreshCommand.ts diff --git a/clients/client-auto-scaling/commands/SuspendProcessesCommand.ts b/clients/client-auto-scaling/src/commands/SuspendProcessesCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/SuspendProcessesCommand.ts rename to clients/client-auto-scaling/src/commands/SuspendProcessesCommand.ts diff --git a/clients/client-auto-scaling/commands/TerminateInstanceInAutoScalingGroupCommand.ts b/clients/client-auto-scaling/src/commands/TerminateInstanceInAutoScalingGroupCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/TerminateInstanceInAutoScalingGroupCommand.ts rename to clients/client-auto-scaling/src/commands/TerminateInstanceInAutoScalingGroupCommand.ts diff --git a/clients/client-auto-scaling/commands/UpdateAutoScalingGroupCommand.ts b/clients/client-auto-scaling/src/commands/UpdateAutoScalingGroupCommand.ts similarity index 100% rename from clients/client-auto-scaling/commands/UpdateAutoScalingGroupCommand.ts rename to clients/client-auto-scaling/src/commands/UpdateAutoScalingGroupCommand.ts diff --git a/clients/client-auto-scaling/endpoints.ts b/clients/client-auto-scaling/src/endpoints.ts similarity index 100% rename from clients/client-auto-scaling/endpoints.ts rename to clients/client-auto-scaling/src/endpoints.ts diff --git a/clients/client-auto-scaling/index.ts b/clients/client-auto-scaling/src/index.ts similarity index 100% rename from clients/client-auto-scaling/index.ts rename to clients/client-auto-scaling/src/index.ts diff --git a/clients/client-auto-scaling/models/index.ts b/clients/client-auto-scaling/src/models/index.ts similarity index 100% rename from clients/client-auto-scaling/models/index.ts rename to clients/client-auto-scaling/src/models/index.ts diff --git a/clients/client-auto-scaling/models/models_0.ts b/clients/client-auto-scaling/src/models/models_0.ts similarity index 100% rename from clients/client-auto-scaling/models/models_0.ts rename to clients/client-auto-scaling/src/models/models_0.ts diff --git a/clients/client-auto-scaling/pagination/DescribeAutoScalingGroupsPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeAutoScalingGroupsPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeAutoScalingGroupsPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeAutoScalingGroupsPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeAutoScalingInstancesPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeAutoScalingInstancesPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeAutoScalingInstancesPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeAutoScalingInstancesPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeLaunchConfigurationsPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeLaunchConfigurationsPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeLaunchConfigurationsPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeLaunchConfigurationsPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeNotificationConfigurationsPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeNotificationConfigurationsPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeNotificationConfigurationsPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeNotificationConfigurationsPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribePoliciesPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribePoliciesPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribePoliciesPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribePoliciesPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeScalingActivitiesPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeScalingActivitiesPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeScalingActivitiesPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeScheduledActionsPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeScheduledActionsPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeScheduledActionsPaginator.ts diff --git a/clients/client-auto-scaling/pagination/DescribeTagsPaginator.ts b/clients/client-auto-scaling/src/pagination/DescribeTagsPaginator.ts similarity index 100% rename from clients/client-auto-scaling/pagination/DescribeTagsPaginator.ts rename to clients/client-auto-scaling/src/pagination/DescribeTagsPaginator.ts diff --git a/clients/client-auto-scaling/pagination/Interfaces.ts b/clients/client-auto-scaling/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-auto-scaling/pagination/Interfaces.ts rename to clients/client-auto-scaling/src/pagination/Interfaces.ts diff --git a/clients/client-auto-scaling/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-auto-scaling/protocols/Aws_query.ts rename to clients/client-auto-scaling/src/protocols/Aws_query.ts diff --git a/clients/client-auto-scaling/src/runtimeConfig.browser.ts b/clients/client-auto-scaling/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b6bce5e86002 --- /dev/null +++ b/clients/client-auto-scaling/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { AutoScalingClientConfig } from "./AutoScalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AutoScalingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auto-scaling/runtimeConfig.native.ts b/clients/client-auto-scaling/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-auto-scaling/runtimeConfig.native.ts rename to clients/client-auto-scaling/src/runtimeConfig.native.ts diff --git a/clients/client-auto-scaling/runtimeConfig.shared.ts b/clients/client-auto-scaling/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-auto-scaling/runtimeConfig.shared.ts rename to clients/client-auto-scaling/src/runtimeConfig.shared.ts diff --git a/clients/client-auto-scaling/src/runtimeConfig.ts b/clients/client-auto-scaling/src/runtimeConfig.ts new file mode 100644 index 000000000000..02f3991f7f1a --- /dev/null +++ b/clients/client-auto-scaling/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { AutoScalingClientConfig } from "./AutoScalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: AutoScalingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-auto-scaling/waiters/waitForGroupExists.ts b/clients/client-auto-scaling/src/waiters/waitForGroupExists.ts similarity index 100% rename from clients/client-auto-scaling/waiters/waitForGroupExists.ts rename to clients/client-auto-scaling/src/waiters/waitForGroupExists.ts diff --git a/clients/client-auto-scaling/waiters/waitForGroupInService.ts b/clients/client-auto-scaling/src/waiters/waitForGroupInService.ts similarity index 100% rename from clients/client-auto-scaling/waiters/waitForGroupInService.ts rename to clients/client-auto-scaling/src/waiters/waitForGroupInService.ts diff --git a/clients/client-auto-scaling/waiters/waitForGroupNotExists.ts b/clients/client-auto-scaling/src/waiters/waitForGroupNotExists.ts similarity index 100% rename from clients/client-auto-scaling/waiters/waitForGroupNotExists.ts rename to clients/client-auto-scaling/src/waiters/waitForGroupNotExists.ts diff --git a/clients/client-auto-scaling/tsconfig.es.json b/clients/client-auto-scaling/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-auto-scaling/tsconfig.es.json +++ b/clients/client-auto-scaling/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-auto-scaling/tsconfig.json b/clients/client-auto-scaling/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-auto-scaling/tsconfig.json +++ b/clients/client-auto-scaling/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-auto-scaling/tsconfig.types.json b/clients/client-auto-scaling/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-auto-scaling/tsconfig.types.json +++ b/clients/client-auto-scaling/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-backup/.gitignore b/clients/client-backup/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-backup/.gitignore +++ b/clients/client-backup/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-backup/package.json b/clients/client-backup/package.json index eb0d9f8b43c0..eb814eebfe66 100644 --- a/clients/client-backup/package.json +++ b/clients/client-backup/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-backup", "repository": { "type": "git", diff --git a/clients/client-backup/runtimeConfig.browser.ts b/clients/client-backup/runtimeConfig.browser.ts deleted file mode 100644 index 73b2caf5ffcd..000000000000 --- a/clients/client-backup/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { BackupClientConfig } from "./BackupClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BackupClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-backup/runtimeConfig.ts b/clients/client-backup/runtimeConfig.ts deleted file mode 100644 index 10947eb7bf10..000000000000 --- a/clients/client-backup/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { BackupClientConfig } from "./BackupClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BackupClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-backup/Backup.ts b/clients/client-backup/src/Backup.ts similarity index 100% rename from clients/client-backup/Backup.ts rename to clients/client-backup/src/Backup.ts diff --git a/clients/client-backup/BackupClient.ts b/clients/client-backup/src/BackupClient.ts similarity index 100% rename from clients/client-backup/BackupClient.ts rename to clients/client-backup/src/BackupClient.ts diff --git a/clients/client-backup/commands/CreateBackupPlanCommand.ts b/clients/client-backup/src/commands/CreateBackupPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/CreateBackupPlanCommand.ts rename to clients/client-backup/src/commands/CreateBackupPlanCommand.ts diff --git a/clients/client-backup/commands/CreateBackupSelectionCommand.ts b/clients/client-backup/src/commands/CreateBackupSelectionCommand.ts similarity index 100% rename from clients/client-backup/commands/CreateBackupSelectionCommand.ts rename to clients/client-backup/src/commands/CreateBackupSelectionCommand.ts diff --git a/clients/client-backup/commands/CreateBackupVaultCommand.ts b/clients/client-backup/src/commands/CreateBackupVaultCommand.ts similarity index 100% rename from clients/client-backup/commands/CreateBackupVaultCommand.ts rename to clients/client-backup/src/commands/CreateBackupVaultCommand.ts diff --git a/clients/client-backup/commands/CreateFrameworkCommand.ts b/clients/client-backup/src/commands/CreateFrameworkCommand.ts similarity index 100% rename from clients/client-backup/commands/CreateFrameworkCommand.ts rename to clients/client-backup/src/commands/CreateFrameworkCommand.ts diff --git a/clients/client-backup/commands/CreateReportPlanCommand.ts b/clients/client-backup/src/commands/CreateReportPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/CreateReportPlanCommand.ts rename to clients/client-backup/src/commands/CreateReportPlanCommand.ts diff --git a/clients/client-backup/commands/DeleteBackupPlanCommand.ts b/clients/client-backup/src/commands/DeleteBackupPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteBackupPlanCommand.ts rename to clients/client-backup/src/commands/DeleteBackupPlanCommand.ts diff --git a/clients/client-backup/commands/DeleteBackupSelectionCommand.ts b/clients/client-backup/src/commands/DeleteBackupSelectionCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteBackupSelectionCommand.ts rename to clients/client-backup/src/commands/DeleteBackupSelectionCommand.ts diff --git a/clients/client-backup/commands/DeleteBackupVaultAccessPolicyCommand.ts b/clients/client-backup/src/commands/DeleteBackupVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteBackupVaultAccessPolicyCommand.ts rename to clients/client-backup/src/commands/DeleteBackupVaultAccessPolicyCommand.ts diff --git a/clients/client-backup/commands/DeleteBackupVaultCommand.ts b/clients/client-backup/src/commands/DeleteBackupVaultCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteBackupVaultCommand.ts rename to clients/client-backup/src/commands/DeleteBackupVaultCommand.ts diff --git a/clients/client-backup/commands/DeleteBackupVaultNotificationsCommand.ts b/clients/client-backup/src/commands/DeleteBackupVaultNotificationsCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteBackupVaultNotificationsCommand.ts rename to clients/client-backup/src/commands/DeleteBackupVaultNotificationsCommand.ts diff --git a/clients/client-backup/commands/DeleteFrameworkCommand.ts b/clients/client-backup/src/commands/DeleteFrameworkCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteFrameworkCommand.ts rename to clients/client-backup/src/commands/DeleteFrameworkCommand.ts diff --git a/clients/client-backup/commands/DeleteRecoveryPointCommand.ts b/clients/client-backup/src/commands/DeleteRecoveryPointCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteRecoveryPointCommand.ts rename to clients/client-backup/src/commands/DeleteRecoveryPointCommand.ts diff --git a/clients/client-backup/commands/DeleteReportPlanCommand.ts b/clients/client-backup/src/commands/DeleteReportPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/DeleteReportPlanCommand.ts rename to clients/client-backup/src/commands/DeleteReportPlanCommand.ts diff --git a/clients/client-backup/commands/DescribeBackupJobCommand.ts b/clients/client-backup/src/commands/DescribeBackupJobCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeBackupJobCommand.ts rename to clients/client-backup/src/commands/DescribeBackupJobCommand.ts diff --git a/clients/client-backup/commands/DescribeBackupVaultCommand.ts b/clients/client-backup/src/commands/DescribeBackupVaultCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeBackupVaultCommand.ts rename to clients/client-backup/src/commands/DescribeBackupVaultCommand.ts diff --git a/clients/client-backup/commands/DescribeCopyJobCommand.ts b/clients/client-backup/src/commands/DescribeCopyJobCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeCopyJobCommand.ts rename to clients/client-backup/src/commands/DescribeCopyJobCommand.ts diff --git a/clients/client-backup/commands/DescribeFrameworkCommand.ts b/clients/client-backup/src/commands/DescribeFrameworkCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeFrameworkCommand.ts rename to clients/client-backup/src/commands/DescribeFrameworkCommand.ts diff --git a/clients/client-backup/commands/DescribeGlobalSettingsCommand.ts b/clients/client-backup/src/commands/DescribeGlobalSettingsCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeGlobalSettingsCommand.ts rename to clients/client-backup/src/commands/DescribeGlobalSettingsCommand.ts diff --git a/clients/client-backup/commands/DescribeProtectedResourceCommand.ts b/clients/client-backup/src/commands/DescribeProtectedResourceCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeProtectedResourceCommand.ts rename to clients/client-backup/src/commands/DescribeProtectedResourceCommand.ts diff --git a/clients/client-backup/commands/DescribeRecoveryPointCommand.ts b/clients/client-backup/src/commands/DescribeRecoveryPointCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeRecoveryPointCommand.ts rename to clients/client-backup/src/commands/DescribeRecoveryPointCommand.ts diff --git a/clients/client-backup/commands/DescribeRegionSettingsCommand.ts b/clients/client-backup/src/commands/DescribeRegionSettingsCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeRegionSettingsCommand.ts rename to clients/client-backup/src/commands/DescribeRegionSettingsCommand.ts diff --git a/clients/client-backup/commands/DescribeReportJobCommand.ts b/clients/client-backup/src/commands/DescribeReportJobCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeReportJobCommand.ts rename to clients/client-backup/src/commands/DescribeReportJobCommand.ts diff --git a/clients/client-backup/commands/DescribeReportPlanCommand.ts b/clients/client-backup/src/commands/DescribeReportPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeReportPlanCommand.ts rename to clients/client-backup/src/commands/DescribeReportPlanCommand.ts diff --git a/clients/client-backup/commands/DescribeRestoreJobCommand.ts b/clients/client-backup/src/commands/DescribeRestoreJobCommand.ts similarity index 100% rename from clients/client-backup/commands/DescribeRestoreJobCommand.ts rename to clients/client-backup/src/commands/DescribeRestoreJobCommand.ts diff --git a/clients/client-backup/commands/DisassociateRecoveryPointCommand.ts b/clients/client-backup/src/commands/DisassociateRecoveryPointCommand.ts similarity index 100% rename from clients/client-backup/commands/DisassociateRecoveryPointCommand.ts rename to clients/client-backup/src/commands/DisassociateRecoveryPointCommand.ts diff --git a/clients/client-backup/commands/ExportBackupPlanTemplateCommand.ts b/clients/client-backup/src/commands/ExportBackupPlanTemplateCommand.ts similarity index 100% rename from clients/client-backup/commands/ExportBackupPlanTemplateCommand.ts rename to clients/client-backup/src/commands/ExportBackupPlanTemplateCommand.ts diff --git a/clients/client-backup/commands/GetBackupPlanCommand.ts b/clients/client-backup/src/commands/GetBackupPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupPlanCommand.ts rename to clients/client-backup/src/commands/GetBackupPlanCommand.ts diff --git a/clients/client-backup/commands/GetBackupPlanFromJSONCommand.ts b/clients/client-backup/src/commands/GetBackupPlanFromJSONCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupPlanFromJSONCommand.ts rename to clients/client-backup/src/commands/GetBackupPlanFromJSONCommand.ts diff --git a/clients/client-backup/commands/GetBackupPlanFromTemplateCommand.ts b/clients/client-backup/src/commands/GetBackupPlanFromTemplateCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupPlanFromTemplateCommand.ts rename to clients/client-backup/src/commands/GetBackupPlanFromTemplateCommand.ts diff --git a/clients/client-backup/commands/GetBackupSelectionCommand.ts b/clients/client-backup/src/commands/GetBackupSelectionCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupSelectionCommand.ts rename to clients/client-backup/src/commands/GetBackupSelectionCommand.ts diff --git a/clients/client-backup/commands/GetBackupVaultAccessPolicyCommand.ts b/clients/client-backup/src/commands/GetBackupVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupVaultAccessPolicyCommand.ts rename to clients/client-backup/src/commands/GetBackupVaultAccessPolicyCommand.ts diff --git a/clients/client-backup/commands/GetBackupVaultNotificationsCommand.ts b/clients/client-backup/src/commands/GetBackupVaultNotificationsCommand.ts similarity index 100% rename from clients/client-backup/commands/GetBackupVaultNotificationsCommand.ts rename to clients/client-backup/src/commands/GetBackupVaultNotificationsCommand.ts diff --git a/clients/client-backup/commands/GetRecoveryPointRestoreMetadataCommand.ts b/clients/client-backup/src/commands/GetRecoveryPointRestoreMetadataCommand.ts similarity index 100% rename from clients/client-backup/commands/GetRecoveryPointRestoreMetadataCommand.ts rename to clients/client-backup/src/commands/GetRecoveryPointRestoreMetadataCommand.ts diff --git a/clients/client-backup/commands/GetSupportedResourceTypesCommand.ts b/clients/client-backup/src/commands/GetSupportedResourceTypesCommand.ts similarity index 100% rename from clients/client-backup/commands/GetSupportedResourceTypesCommand.ts rename to clients/client-backup/src/commands/GetSupportedResourceTypesCommand.ts diff --git a/clients/client-backup/commands/ListBackupJobsCommand.ts b/clients/client-backup/src/commands/ListBackupJobsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupJobsCommand.ts rename to clients/client-backup/src/commands/ListBackupJobsCommand.ts diff --git a/clients/client-backup/commands/ListBackupPlanTemplatesCommand.ts b/clients/client-backup/src/commands/ListBackupPlanTemplatesCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupPlanTemplatesCommand.ts rename to clients/client-backup/src/commands/ListBackupPlanTemplatesCommand.ts diff --git a/clients/client-backup/commands/ListBackupPlanVersionsCommand.ts b/clients/client-backup/src/commands/ListBackupPlanVersionsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupPlanVersionsCommand.ts rename to clients/client-backup/src/commands/ListBackupPlanVersionsCommand.ts diff --git a/clients/client-backup/commands/ListBackupPlansCommand.ts b/clients/client-backup/src/commands/ListBackupPlansCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupPlansCommand.ts rename to clients/client-backup/src/commands/ListBackupPlansCommand.ts diff --git a/clients/client-backup/commands/ListBackupSelectionsCommand.ts b/clients/client-backup/src/commands/ListBackupSelectionsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupSelectionsCommand.ts rename to clients/client-backup/src/commands/ListBackupSelectionsCommand.ts diff --git a/clients/client-backup/commands/ListBackupVaultsCommand.ts b/clients/client-backup/src/commands/ListBackupVaultsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListBackupVaultsCommand.ts rename to clients/client-backup/src/commands/ListBackupVaultsCommand.ts diff --git a/clients/client-backup/commands/ListCopyJobsCommand.ts b/clients/client-backup/src/commands/ListCopyJobsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListCopyJobsCommand.ts rename to clients/client-backup/src/commands/ListCopyJobsCommand.ts diff --git a/clients/client-backup/commands/ListFrameworksCommand.ts b/clients/client-backup/src/commands/ListFrameworksCommand.ts similarity index 100% rename from clients/client-backup/commands/ListFrameworksCommand.ts rename to clients/client-backup/src/commands/ListFrameworksCommand.ts diff --git a/clients/client-backup/commands/ListProtectedResourcesCommand.ts b/clients/client-backup/src/commands/ListProtectedResourcesCommand.ts similarity index 100% rename from clients/client-backup/commands/ListProtectedResourcesCommand.ts rename to clients/client-backup/src/commands/ListProtectedResourcesCommand.ts diff --git a/clients/client-backup/commands/ListRecoveryPointsByBackupVaultCommand.ts b/clients/client-backup/src/commands/ListRecoveryPointsByBackupVaultCommand.ts similarity index 100% rename from clients/client-backup/commands/ListRecoveryPointsByBackupVaultCommand.ts rename to clients/client-backup/src/commands/ListRecoveryPointsByBackupVaultCommand.ts diff --git a/clients/client-backup/commands/ListRecoveryPointsByResourceCommand.ts b/clients/client-backup/src/commands/ListRecoveryPointsByResourceCommand.ts similarity index 100% rename from clients/client-backup/commands/ListRecoveryPointsByResourceCommand.ts rename to clients/client-backup/src/commands/ListRecoveryPointsByResourceCommand.ts diff --git a/clients/client-backup/commands/ListReportJobsCommand.ts b/clients/client-backup/src/commands/ListReportJobsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListReportJobsCommand.ts rename to clients/client-backup/src/commands/ListReportJobsCommand.ts diff --git a/clients/client-backup/commands/ListReportPlansCommand.ts b/clients/client-backup/src/commands/ListReportPlansCommand.ts similarity index 100% rename from clients/client-backup/commands/ListReportPlansCommand.ts rename to clients/client-backup/src/commands/ListReportPlansCommand.ts diff --git a/clients/client-backup/commands/ListRestoreJobsCommand.ts b/clients/client-backup/src/commands/ListRestoreJobsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListRestoreJobsCommand.ts rename to clients/client-backup/src/commands/ListRestoreJobsCommand.ts diff --git a/clients/client-backup/commands/ListTagsCommand.ts b/clients/client-backup/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-backup/commands/ListTagsCommand.ts rename to clients/client-backup/src/commands/ListTagsCommand.ts diff --git a/clients/client-backup/commands/PutBackupVaultAccessPolicyCommand.ts b/clients/client-backup/src/commands/PutBackupVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-backup/commands/PutBackupVaultAccessPolicyCommand.ts rename to clients/client-backup/src/commands/PutBackupVaultAccessPolicyCommand.ts diff --git a/clients/client-backup/commands/PutBackupVaultNotificationsCommand.ts b/clients/client-backup/src/commands/PutBackupVaultNotificationsCommand.ts similarity index 100% rename from clients/client-backup/commands/PutBackupVaultNotificationsCommand.ts rename to clients/client-backup/src/commands/PutBackupVaultNotificationsCommand.ts diff --git a/clients/client-backup/commands/StartBackupJobCommand.ts b/clients/client-backup/src/commands/StartBackupJobCommand.ts similarity index 100% rename from clients/client-backup/commands/StartBackupJobCommand.ts rename to clients/client-backup/src/commands/StartBackupJobCommand.ts diff --git a/clients/client-backup/commands/StartCopyJobCommand.ts b/clients/client-backup/src/commands/StartCopyJobCommand.ts similarity index 100% rename from clients/client-backup/commands/StartCopyJobCommand.ts rename to clients/client-backup/src/commands/StartCopyJobCommand.ts diff --git a/clients/client-backup/commands/StartReportJobCommand.ts b/clients/client-backup/src/commands/StartReportJobCommand.ts similarity index 100% rename from clients/client-backup/commands/StartReportJobCommand.ts rename to clients/client-backup/src/commands/StartReportJobCommand.ts diff --git a/clients/client-backup/commands/StartRestoreJobCommand.ts b/clients/client-backup/src/commands/StartRestoreJobCommand.ts similarity index 100% rename from clients/client-backup/commands/StartRestoreJobCommand.ts rename to clients/client-backup/src/commands/StartRestoreJobCommand.ts diff --git a/clients/client-backup/commands/StopBackupJobCommand.ts b/clients/client-backup/src/commands/StopBackupJobCommand.ts similarity index 100% rename from clients/client-backup/commands/StopBackupJobCommand.ts rename to clients/client-backup/src/commands/StopBackupJobCommand.ts diff --git a/clients/client-backup/commands/TagResourceCommand.ts b/clients/client-backup/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-backup/commands/TagResourceCommand.ts rename to clients/client-backup/src/commands/TagResourceCommand.ts diff --git a/clients/client-backup/commands/UntagResourceCommand.ts b/clients/client-backup/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-backup/commands/UntagResourceCommand.ts rename to clients/client-backup/src/commands/UntagResourceCommand.ts diff --git a/clients/client-backup/commands/UpdateBackupPlanCommand.ts b/clients/client-backup/src/commands/UpdateBackupPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateBackupPlanCommand.ts rename to clients/client-backup/src/commands/UpdateBackupPlanCommand.ts diff --git a/clients/client-backup/commands/UpdateFrameworkCommand.ts b/clients/client-backup/src/commands/UpdateFrameworkCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateFrameworkCommand.ts rename to clients/client-backup/src/commands/UpdateFrameworkCommand.ts diff --git a/clients/client-backup/commands/UpdateGlobalSettingsCommand.ts b/clients/client-backup/src/commands/UpdateGlobalSettingsCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateGlobalSettingsCommand.ts rename to clients/client-backup/src/commands/UpdateGlobalSettingsCommand.ts diff --git a/clients/client-backup/commands/UpdateRecoveryPointLifecycleCommand.ts b/clients/client-backup/src/commands/UpdateRecoveryPointLifecycleCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateRecoveryPointLifecycleCommand.ts rename to clients/client-backup/src/commands/UpdateRecoveryPointLifecycleCommand.ts diff --git a/clients/client-backup/commands/UpdateRegionSettingsCommand.ts b/clients/client-backup/src/commands/UpdateRegionSettingsCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateRegionSettingsCommand.ts rename to clients/client-backup/src/commands/UpdateRegionSettingsCommand.ts diff --git a/clients/client-backup/commands/UpdateReportPlanCommand.ts b/clients/client-backup/src/commands/UpdateReportPlanCommand.ts similarity index 100% rename from clients/client-backup/commands/UpdateReportPlanCommand.ts rename to clients/client-backup/src/commands/UpdateReportPlanCommand.ts diff --git a/clients/client-backup/endpoints.ts b/clients/client-backup/src/endpoints.ts similarity index 100% rename from clients/client-backup/endpoints.ts rename to clients/client-backup/src/endpoints.ts diff --git a/clients/client-backup/index.ts b/clients/client-backup/src/index.ts similarity index 100% rename from clients/client-backup/index.ts rename to clients/client-backup/src/index.ts diff --git a/clients/client-backup/models/index.ts b/clients/client-backup/src/models/index.ts similarity index 100% rename from clients/client-backup/models/index.ts rename to clients/client-backup/src/models/index.ts diff --git a/clients/client-backup/models/models_0.ts b/clients/client-backup/src/models/models_0.ts similarity index 100% rename from clients/client-backup/models/models_0.ts rename to clients/client-backup/src/models/models_0.ts diff --git a/clients/client-backup/pagination/Interfaces.ts b/clients/client-backup/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-backup/pagination/Interfaces.ts rename to clients/client-backup/src/pagination/Interfaces.ts diff --git a/clients/client-backup/pagination/ListBackupJobsPaginator.ts b/clients/client-backup/src/pagination/ListBackupJobsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupJobsPaginator.ts rename to clients/client-backup/src/pagination/ListBackupJobsPaginator.ts diff --git a/clients/client-backup/pagination/ListBackupPlanTemplatesPaginator.ts b/clients/client-backup/src/pagination/ListBackupPlanTemplatesPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupPlanTemplatesPaginator.ts rename to clients/client-backup/src/pagination/ListBackupPlanTemplatesPaginator.ts diff --git a/clients/client-backup/pagination/ListBackupPlanVersionsPaginator.ts b/clients/client-backup/src/pagination/ListBackupPlanVersionsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupPlanVersionsPaginator.ts rename to clients/client-backup/src/pagination/ListBackupPlanVersionsPaginator.ts diff --git a/clients/client-backup/pagination/ListBackupPlansPaginator.ts b/clients/client-backup/src/pagination/ListBackupPlansPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupPlansPaginator.ts rename to clients/client-backup/src/pagination/ListBackupPlansPaginator.ts diff --git a/clients/client-backup/pagination/ListBackupSelectionsPaginator.ts b/clients/client-backup/src/pagination/ListBackupSelectionsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupSelectionsPaginator.ts rename to clients/client-backup/src/pagination/ListBackupSelectionsPaginator.ts diff --git a/clients/client-backup/pagination/ListBackupVaultsPaginator.ts b/clients/client-backup/src/pagination/ListBackupVaultsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListBackupVaultsPaginator.ts rename to clients/client-backup/src/pagination/ListBackupVaultsPaginator.ts diff --git a/clients/client-backup/pagination/ListCopyJobsPaginator.ts b/clients/client-backup/src/pagination/ListCopyJobsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListCopyJobsPaginator.ts rename to clients/client-backup/src/pagination/ListCopyJobsPaginator.ts diff --git a/clients/client-backup/pagination/ListFrameworksPaginator.ts b/clients/client-backup/src/pagination/ListFrameworksPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListFrameworksPaginator.ts rename to clients/client-backup/src/pagination/ListFrameworksPaginator.ts diff --git a/clients/client-backup/pagination/ListProtectedResourcesPaginator.ts b/clients/client-backup/src/pagination/ListProtectedResourcesPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListProtectedResourcesPaginator.ts rename to clients/client-backup/src/pagination/ListProtectedResourcesPaginator.ts diff --git a/clients/client-backup/pagination/ListRecoveryPointsByBackupVaultPaginator.ts b/clients/client-backup/src/pagination/ListRecoveryPointsByBackupVaultPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListRecoveryPointsByBackupVaultPaginator.ts rename to clients/client-backup/src/pagination/ListRecoveryPointsByBackupVaultPaginator.ts diff --git a/clients/client-backup/pagination/ListRecoveryPointsByResourcePaginator.ts b/clients/client-backup/src/pagination/ListRecoveryPointsByResourcePaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListRecoveryPointsByResourcePaginator.ts rename to clients/client-backup/src/pagination/ListRecoveryPointsByResourcePaginator.ts diff --git a/clients/client-backup/pagination/ListReportJobsPaginator.ts b/clients/client-backup/src/pagination/ListReportJobsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListReportJobsPaginator.ts rename to clients/client-backup/src/pagination/ListReportJobsPaginator.ts diff --git a/clients/client-backup/pagination/ListReportPlansPaginator.ts b/clients/client-backup/src/pagination/ListReportPlansPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListReportPlansPaginator.ts rename to clients/client-backup/src/pagination/ListReportPlansPaginator.ts diff --git a/clients/client-backup/pagination/ListRestoreJobsPaginator.ts b/clients/client-backup/src/pagination/ListRestoreJobsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListRestoreJobsPaginator.ts rename to clients/client-backup/src/pagination/ListRestoreJobsPaginator.ts diff --git a/clients/client-backup/pagination/ListTagsPaginator.ts b/clients/client-backup/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-backup/pagination/ListTagsPaginator.ts rename to clients/client-backup/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-backup/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-backup/protocols/Aws_restJson1.ts rename to clients/client-backup/src/protocols/Aws_restJson1.ts diff --git a/clients/client-backup/src/runtimeConfig.browser.ts b/clients/client-backup/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..134334c8378d --- /dev/null +++ b/clients/client-backup/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { BackupClientConfig } from "./BackupClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BackupClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-backup/runtimeConfig.native.ts b/clients/client-backup/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-backup/runtimeConfig.native.ts rename to clients/client-backup/src/runtimeConfig.native.ts diff --git a/clients/client-backup/runtimeConfig.shared.ts b/clients/client-backup/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-backup/runtimeConfig.shared.ts rename to clients/client-backup/src/runtimeConfig.shared.ts diff --git a/clients/client-backup/src/runtimeConfig.ts b/clients/client-backup/src/runtimeConfig.ts new file mode 100644 index 000000000000..ed67eb6af42a --- /dev/null +++ b/clients/client-backup/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { BackupClientConfig } from "./BackupClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BackupClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-backup/tsconfig.es.json b/clients/client-backup/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-backup/tsconfig.es.json +++ b/clients/client-backup/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-backup/tsconfig.json b/clients/client-backup/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-backup/tsconfig.json +++ b/clients/client-backup/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-backup/tsconfig.types.json b/clients/client-backup/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-backup/tsconfig.types.json +++ b/clients/client-backup/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-batch/.gitignore b/clients/client-batch/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-batch/.gitignore +++ b/clients/client-batch/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-batch/package.json b/clients/client-batch/package.json index 61e8894b1c87..2831220babb7 100644 --- a/clients/client-batch/package.json +++ b/clients/client-batch/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-batch", "repository": { "type": "git", diff --git a/clients/client-batch/runtimeConfig.browser.ts b/clients/client-batch/runtimeConfig.browser.ts deleted file mode 100644 index 0ff82e8b2a47..000000000000 --- a/clients/client-batch/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { BatchClientConfig } from "./BatchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BatchClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-batch/runtimeConfig.ts b/clients/client-batch/runtimeConfig.ts deleted file mode 100644 index 07076b881fe4..000000000000 --- a/clients/client-batch/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { BatchClientConfig } from "./BatchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BatchClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-batch/Batch.ts b/clients/client-batch/src/Batch.ts similarity index 100% rename from clients/client-batch/Batch.ts rename to clients/client-batch/src/Batch.ts diff --git a/clients/client-batch/BatchClient.ts b/clients/client-batch/src/BatchClient.ts similarity index 100% rename from clients/client-batch/BatchClient.ts rename to clients/client-batch/src/BatchClient.ts diff --git a/clients/client-batch/commands/CancelJobCommand.ts b/clients/client-batch/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-batch/commands/CancelJobCommand.ts rename to clients/client-batch/src/commands/CancelJobCommand.ts diff --git a/clients/client-batch/commands/CreateComputeEnvironmentCommand.ts b/clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts similarity index 100% rename from clients/client-batch/commands/CreateComputeEnvironmentCommand.ts rename to clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts diff --git a/clients/client-batch/commands/CreateJobQueueCommand.ts b/clients/client-batch/src/commands/CreateJobQueueCommand.ts similarity index 100% rename from clients/client-batch/commands/CreateJobQueueCommand.ts rename to clients/client-batch/src/commands/CreateJobQueueCommand.ts diff --git a/clients/client-batch/commands/DeleteComputeEnvironmentCommand.ts b/clients/client-batch/src/commands/DeleteComputeEnvironmentCommand.ts similarity index 100% rename from clients/client-batch/commands/DeleteComputeEnvironmentCommand.ts rename to clients/client-batch/src/commands/DeleteComputeEnvironmentCommand.ts diff --git a/clients/client-batch/commands/DeleteJobQueueCommand.ts b/clients/client-batch/src/commands/DeleteJobQueueCommand.ts similarity index 100% rename from clients/client-batch/commands/DeleteJobQueueCommand.ts rename to clients/client-batch/src/commands/DeleteJobQueueCommand.ts diff --git a/clients/client-batch/commands/DeregisterJobDefinitionCommand.ts b/clients/client-batch/src/commands/DeregisterJobDefinitionCommand.ts similarity index 100% rename from clients/client-batch/commands/DeregisterJobDefinitionCommand.ts rename to clients/client-batch/src/commands/DeregisterJobDefinitionCommand.ts diff --git a/clients/client-batch/commands/DescribeComputeEnvironmentsCommand.ts b/clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts similarity index 100% rename from clients/client-batch/commands/DescribeComputeEnvironmentsCommand.ts rename to clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts diff --git a/clients/client-batch/commands/DescribeJobDefinitionsCommand.ts b/clients/client-batch/src/commands/DescribeJobDefinitionsCommand.ts similarity index 100% rename from clients/client-batch/commands/DescribeJobDefinitionsCommand.ts rename to clients/client-batch/src/commands/DescribeJobDefinitionsCommand.ts diff --git a/clients/client-batch/commands/DescribeJobQueuesCommand.ts b/clients/client-batch/src/commands/DescribeJobQueuesCommand.ts similarity index 100% rename from clients/client-batch/commands/DescribeJobQueuesCommand.ts rename to clients/client-batch/src/commands/DescribeJobQueuesCommand.ts diff --git a/clients/client-batch/commands/DescribeJobsCommand.ts b/clients/client-batch/src/commands/DescribeJobsCommand.ts similarity index 100% rename from clients/client-batch/commands/DescribeJobsCommand.ts rename to clients/client-batch/src/commands/DescribeJobsCommand.ts diff --git a/clients/client-batch/commands/ListJobsCommand.ts b/clients/client-batch/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-batch/commands/ListJobsCommand.ts rename to clients/client-batch/src/commands/ListJobsCommand.ts diff --git a/clients/client-batch/commands/ListTagsForResourceCommand.ts b/clients/client-batch/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-batch/commands/ListTagsForResourceCommand.ts rename to clients/client-batch/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-batch/commands/RegisterJobDefinitionCommand.ts b/clients/client-batch/src/commands/RegisterJobDefinitionCommand.ts similarity index 100% rename from clients/client-batch/commands/RegisterJobDefinitionCommand.ts rename to clients/client-batch/src/commands/RegisterJobDefinitionCommand.ts diff --git a/clients/client-batch/commands/SubmitJobCommand.ts b/clients/client-batch/src/commands/SubmitJobCommand.ts similarity index 100% rename from clients/client-batch/commands/SubmitJobCommand.ts rename to clients/client-batch/src/commands/SubmitJobCommand.ts diff --git a/clients/client-batch/commands/TagResourceCommand.ts b/clients/client-batch/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-batch/commands/TagResourceCommand.ts rename to clients/client-batch/src/commands/TagResourceCommand.ts diff --git a/clients/client-batch/commands/TerminateJobCommand.ts b/clients/client-batch/src/commands/TerminateJobCommand.ts similarity index 100% rename from clients/client-batch/commands/TerminateJobCommand.ts rename to clients/client-batch/src/commands/TerminateJobCommand.ts diff --git a/clients/client-batch/commands/UntagResourceCommand.ts b/clients/client-batch/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-batch/commands/UntagResourceCommand.ts rename to clients/client-batch/src/commands/UntagResourceCommand.ts diff --git a/clients/client-batch/commands/UpdateComputeEnvironmentCommand.ts b/clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts similarity index 100% rename from clients/client-batch/commands/UpdateComputeEnvironmentCommand.ts rename to clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts diff --git a/clients/client-batch/commands/UpdateJobQueueCommand.ts b/clients/client-batch/src/commands/UpdateJobQueueCommand.ts similarity index 100% rename from clients/client-batch/commands/UpdateJobQueueCommand.ts rename to clients/client-batch/src/commands/UpdateJobQueueCommand.ts diff --git a/clients/client-batch/endpoints.ts b/clients/client-batch/src/endpoints.ts similarity index 100% rename from clients/client-batch/endpoints.ts rename to clients/client-batch/src/endpoints.ts diff --git a/clients/client-batch/index.ts b/clients/client-batch/src/index.ts similarity index 100% rename from clients/client-batch/index.ts rename to clients/client-batch/src/index.ts diff --git a/clients/client-batch/models/index.ts b/clients/client-batch/src/models/index.ts similarity index 100% rename from clients/client-batch/models/index.ts rename to clients/client-batch/src/models/index.ts diff --git a/clients/client-batch/models/models_0.ts b/clients/client-batch/src/models/models_0.ts similarity index 100% rename from clients/client-batch/models/models_0.ts rename to clients/client-batch/src/models/models_0.ts diff --git a/clients/client-batch/pagination/DescribeComputeEnvironmentsPaginator.ts b/clients/client-batch/src/pagination/DescribeComputeEnvironmentsPaginator.ts similarity index 100% rename from clients/client-batch/pagination/DescribeComputeEnvironmentsPaginator.ts rename to clients/client-batch/src/pagination/DescribeComputeEnvironmentsPaginator.ts diff --git a/clients/client-batch/pagination/DescribeJobDefinitionsPaginator.ts b/clients/client-batch/src/pagination/DescribeJobDefinitionsPaginator.ts similarity index 100% rename from clients/client-batch/pagination/DescribeJobDefinitionsPaginator.ts rename to clients/client-batch/src/pagination/DescribeJobDefinitionsPaginator.ts diff --git a/clients/client-batch/pagination/DescribeJobQueuesPaginator.ts b/clients/client-batch/src/pagination/DescribeJobQueuesPaginator.ts similarity index 100% rename from clients/client-batch/pagination/DescribeJobQueuesPaginator.ts rename to clients/client-batch/src/pagination/DescribeJobQueuesPaginator.ts diff --git a/clients/client-batch/pagination/Interfaces.ts b/clients/client-batch/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-batch/pagination/Interfaces.ts rename to clients/client-batch/src/pagination/Interfaces.ts diff --git a/clients/client-batch/pagination/ListJobsPaginator.ts b/clients/client-batch/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-batch/pagination/ListJobsPaginator.ts rename to clients/client-batch/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-batch/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-batch/protocols/Aws_restJson1.ts rename to clients/client-batch/src/protocols/Aws_restJson1.ts diff --git a/clients/client-batch/src/runtimeConfig.browser.ts b/clients/client-batch/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1d0b40934d24 --- /dev/null +++ b/clients/client-batch/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { BatchClientConfig } from "./BatchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BatchClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-batch/runtimeConfig.native.ts b/clients/client-batch/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-batch/runtimeConfig.native.ts rename to clients/client-batch/src/runtimeConfig.native.ts diff --git a/clients/client-batch/runtimeConfig.shared.ts b/clients/client-batch/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-batch/runtimeConfig.shared.ts rename to clients/client-batch/src/runtimeConfig.shared.ts diff --git a/clients/client-batch/src/runtimeConfig.ts b/clients/client-batch/src/runtimeConfig.ts new file mode 100644 index 000000000000..73bfe08b7ffe --- /dev/null +++ b/clients/client-batch/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { BatchClientConfig } from "./BatchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BatchClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-batch/tsconfig.es.json b/clients/client-batch/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-batch/tsconfig.es.json +++ b/clients/client-batch/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-batch/tsconfig.json b/clients/client-batch/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-batch/tsconfig.json +++ b/clients/client-batch/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-batch/tsconfig.types.json b/clients/client-batch/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-batch/tsconfig.types.json +++ b/clients/client-batch/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-braket/.gitignore b/clients/client-braket/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-braket/.gitignore +++ b/clients/client-braket/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-braket/package.json b/clients/client-braket/package.json index b7f6c1e661c0..527526868a90 100644 --- a/clients/client-braket/package.json +++ b/clients/client-braket/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-braket", "repository": { "type": "git", diff --git a/clients/client-braket/runtimeConfig.browser.ts b/clients/client-braket/runtimeConfig.browser.ts deleted file mode 100644 index dc0284676928..000000000000 --- a/clients/client-braket/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { BraketClientConfig } from "./BraketClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BraketClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-braket/runtimeConfig.ts b/clients/client-braket/runtimeConfig.ts deleted file mode 100644 index b4876ab2bb93..000000000000 --- a/clients/client-braket/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { BraketClientConfig } from "./BraketClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BraketClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-braket/Braket.ts b/clients/client-braket/src/Braket.ts similarity index 100% rename from clients/client-braket/Braket.ts rename to clients/client-braket/src/Braket.ts diff --git a/clients/client-braket/BraketClient.ts b/clients/client-braket/src/BraketClient.ts similarity index 100% rename from clients/client-braket/BraketClient.ts rename to clients/client-braket/src/BraketClient.ts diff --git a/clients/client-braket/commands/CancelQuantumTaskCommand.ts b/clients/client-braket/src/commands/CancelQuantumTaskCommand.ts similarity index 100% rename from clients/client-braket/commands/CancelQuantumTaskCommand.ts rename to clients/client-braket/src/commands/CancelQuantumTaskCommand.ts diff --git a/clients/client-braket/commands/CreateQuantumTaskCommand.ts b/clients/client-braket/src/commands/CreateQuantumTaskCommand.ts similarity index 100% rename from clients/client-braket/commands/CreateQuantumTaskCommand.ts rename to clients/client-braket/src/commands/CreateQuantumTaskCommand.ts diff --git a/clients/client-braket/commands/GetDeviceCommand.ts b/clients/client-braket/src/commands/GetDeviceCommand.ts similarity index 100% rename from clients/client-braket/commands/GetDeviceCommand.ts rename to clients/client-braket/src/commands/GetDeviceCommand.ts diff --git a/clients/client-braket/commands/GetQuantumTaskCommand.ts b/clients/client-braket/src/commands/GetQuantumTaskCommand.ts similarity index 100% rename from clients/client-braket/commands/GetQuantumTaskCommand.ts rename to clients/client-braket/src/commands/GetQuantumTaskCommand.ts diff --git a/clients/client-braket/commands/ListTagsForResourceCommand.ts b/clients/client-braket/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-braket/commands/ListTagsForResourceCommand.ts rename to clients/client-braket/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-braket/commands/SearchDevicesCommand.ts b/clients/client-braket/src/commands/SearchDevicesCommand.ts similarity index 100% rename from clients/client-braket/commands/SearchDevicesCommand.ts rename to clients/client-braket/src/commands/SearchDevicesCommand.ts diff --git a/clients/client-braket/commands/SearchQuantumTasksCommand.ts b/clients/client-braket/src/commands/SearchQuantumTasksCommand.ts similarity index 100% rename from clients/client-braket/commands/SearchQuantumTasksCommand.ts rename to clients/client-braket/src/commands/SearchQuantumTasksCommand.ts diff --git a/clients/client-braket/commands/TagResourceCommand.ts b/clients/client-braket/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-braket/commands/TagResourceCommand.ts rename to clients/client-braket/src/commands/TagResourceCommand.ts diff --git a/clients/client-braket/commands/UntagResourceCommand.ts b/clients/client-braket/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-braket/commands/UntagResourceCommand.ts rename to clients/client-braket/src/commands/UntagResourceCommand.ts diff --git a/clients/client-braket/endpoints.ts b/clients/client-braket/src/endpoints.ts similarity index 100% rename from clients/client-braket/endpoints.ts rename to clients/client-braket/src/endpoints.ts diff --git a/clients/client-braket/index.ts b/clients/client-braket/src/index.ts similarity index 100% rename from clients/client-braket/index.ts rename to clients/client-braket/src/index.ts diff --git a/clients/client-braket/models/index.ts b/clients/client-braket/src/models/index.ts similarity index 100% rename from clients/client-braket/models/index.ts rename to clients/client-braket/src/models/index.ts diff --git a/clients/client-braket/models/models_0.ts b/clients/client-braket/src/models/models_0.ts similarity index 100% rename from clients/client-braket/models/models_0.ts rename to clients/client-braket/src/models/models_0.ts diff --git a/clients/client-braket/pagination/Interfaces.ts b/clients/client-braket/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-braket/pagination/Interfaces.ts rename to clients/client-braket/src/pagination/Interfaces.ts diff --git a/clients/client-braket/pagination/SearchDevicesPaginator.ts b/clients/client-braket/src/pagination/SearchDevicesPaginator.ts similarity index 100% rename from clients/client-braket/pagination/SearchDevicesPaginator.ts rename to clients/client-braket/src/pagination/SearchDevicesPaginator.ts diff --git a/clients/client-braket/pagination/SearchQuantumTasksPaginator.ts b/clients/client-braket/src/pagination/SearchQuantumTasksPaginator.ts similarity index 100% rename from clients/client-braket/pagination/SearchQuantumTasksPaginator.ts rename to clients/client-braket/src/pagination/SearchQuantumTasksPaginator.ts diff --git a/clients/client-braket/protocols/Aws_restJson1.ts b/clients/client-braket/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-braket/protocols/Aws_restJson1.ts rename to clients/client-braket/src/protocols/Aws_restJson1.ts diff --git a/clients/client-braket/src/runtimeConfig.browser.ts b/clients/client-braket/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3fe789e0dca3 --- /dev/null +++ b/clients/client-braket/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { BraketClientConfig } from "./BraketClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BraketClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-braket/runtimeConfig.native.ts b/clients/client-braket/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-braket/runtimeConfig.native.ts rename to clients/client-braket/src/runtimeConfig.native.ts diff --git a/clients/client-braket/runtimeConfig.shared.ts b/clients/client-braket/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-braket/runtimeConfig.shared.ts rename to clients/client-braket/src/runtimeConfig.shared.ts diff --git a/clients/client-braket/src/runtimeConfig.ts b/clients/client-braket/src/runtimeConfig.ts new file mode 100644 index 000000000000..2fe0b32351fd --- /dev/null +++ b/clients/client-braket/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { BraketClientConfig } from "./BraketClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BraketClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-braket/tsconfig.es.json b/clients/client-braket/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-braket/tsconfig.es.json +++ b/clients/client-braket/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-braket/tsconfig.json b/clients/client-braket/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-braket/tsconfig.json +++ b/clients/client-braket/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-braket/tsconfig.types.json b/clients/client-braket/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-braket/tsconfig.types.json +++ b/clients/client-braket/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-budgets/.gitignore b/clients/client-budgets/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-budgets/.gitignore +++ b/clients/client-budgets/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-budgets/package.json b/clients/client-budgets/package.json index b98a9928606e..95f7ead2f9f1 100644 --- a/clients/client-budgets/package.json +++ b/clients/client-budgets/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-budgets", "repository": { "type": "git", diff --git a/clients/client-budgets/runtimeConfig.browser.ts b/clients/client-budgets/runtimeConfig.browser.ts deleted file mode 100644 index 600eb81fb668..000000000000 --- a/clients/client-budgets/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { BudgetsClientConfig } from "./BudgetsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BudgetsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-budgets/runtimeConfig.ts b/clients/client-budgets/runtimeConfig.ts deleted file mode 100644 index c589283e9925..000000000000 --- a/clients/client-budgets/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { BudgetsClientConfig } from "./BudgetsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: BudgetsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-budgets/Budgets.ts b/clients/client-budgets/src/Budgets.ts similarity index 100% rename from clients/client-budgets/Budgets.ts rename to clients/client-budgets/src/Budgets.ts diff --git a/clients/client-budgets/BudgetsClient.ts b/clients/client-budgets/src/BudgetsClient.ts similarity index 100% rename from clients/client-budgets/BudgetsClient.ts rename to clients/client-budgets/src/BudgetsClient.ts diff --git a/clients/client-budgets/commands/CreateBudgetActionCommand.ts b/clients/client-budgets/src/commands/CreateBudgetActionCommand.ts similarity index 100% rename from clients/client-budgets/commands/CreateBudgetActionCommand.ts rename to clients/client-budgets/src/commands/CreateBudgetActionCommand.ts diff --git a/clients/client-budgets/commands/CreateBudgetCommand.ts b/clients/client-budgets/src/commands/CreateBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/CreateBudgetCommand.ts rename to clients/client-budgets/src/commands/CreateBudgetCommand.ts diff --git a/clients/client-budgets/commands/CreateNotificationCommand.ts b/clients/client-budgets/src/commands/CreateNotificationCommand.ts similarity index 100% rename from clients/client-budgets/commands/CreateNotificationCommand.ts rename to clients/client-budgets/src/commands/CreateNotificationCommand.ts diff --git a/clients/client-budgets/commands/CreateSubscriberCommand.ts b/clients/client-budgets/src/commands/CreateSubscriberCommand.ts similarity index 100% rename from clients/client-budgets/commands/CreateSubscriberCommand.ts rename to clients/client-budgets/src/commands/CreateSubscriberCommand.ts diff --git a/clients/client-budgets/commands/DeleteBudgetActionCommand.ts b/clients/client-budgets/src/commands/DeleteBudgetActionCommand.ts similarity index 100% rename from clients/client-budgets/commands/DeleteBudgetActionCommand.ts rename to clients/client-budgets/src/commands/DeleteBudgetActionCommand.ts diff --git a/clients/client-budgets/commands/DeleteBudgetCommand.ts b/clients/client-budgets/src/commands/DeleteBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/DeleteBudgetCommand.ts rename to clients/client-budgets/src/commands/DeleteBudgetCommand.ts diff --git a/clients/client-budgets/commands/DeleteNotificationCommand.ts b/clients/client-budgets/src/commands/DeleteNotificationCommand.ts similarity index 100% rename from clients/client-budgets/commands/DeleteNotificationCommand.ts rename to clients/client-budgets/src/commands/DeleteNotificationCommand.ts diff --git a/clients/client-budgets/commands/DeleteSubscriberCommand.ts b/clients/client-budgets/src/commands/DeleteSubscriberCommand.ts similarity index 100% rename from clients/client-budgets/commands/DeleteSubscriberCommand.ts rename to clients/client-budgets/src/commands/DeleteSubscriberCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetActionCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetActionCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetActionCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetActionCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetActionHistoriesCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetActionHistoriesCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetActionHistoriesCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetActionHistoriesCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetActionsForAccountCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetActionsForAccountCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetActionsForAccountCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetActionsForAccountCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetActionsForBudgetCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetActionsForBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetActionsForBudgetCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetActionsForBudgetCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetPerformanceHistoryCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetPerformanceHistoryCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetPerformanceHistoryCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetPerformanceHistoryCommand.ts diff --git a/clients/client-budgets/commands/DescribeBudgetsCommand.ts b/clients/client-budgets/src/commands/DescribeBudgetsCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeBudgetsCommand.ts rename to clients/client-budgets/src/commands/DescribeBudgetsCommand.ts diff --git a/clients/client-budgets/commands/DescribeNotificationsForBudgetCommand.ts b/clients/client-budgets/src/commands/DescribeNotificationsForBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeNotificationsForBudgetCommand.ts rename to clients/client-budgets/src/commands/DescribeNotificationsForBudgetCommand.ts diff --git a/clients/client-budgets/commands/DescribeSubscribersForNotificationCommand.ts b/clients/client-budgets/src/commands/DescribeSubscribersForNotificationCommand.ts similarity index 100% rename from clients/client-budgets/commands/DescribeSubscribersForNotificationCommand.ts rename to clients/client-budgets/src/commands/DescribeSubscribersForNotificationCommand.ts diff --git a/clients/client-budgets/commands/ExecuteBudgetActionCommand.ts b/clients/client-budgets/src/commands/ExecuteBudgetActionCommand.ts similarity index 100% rename from clients/client-budgets/commands/ExecuteBudgetActionCommand.ts rename to clients/client-budgets/src/commands/ExecuteBudgetActionCommand.ts diff --git a/clients/client-budgets/commands/UpdateBudgetActionCommand.ts b/clients/client-budgets/src/commands/UpdateBudgetActionCommand.ts similarity index 100% rename from clients/client-budgets/commands/UpdateBudgetActionCommand.ts rename to clients/client-budgets/src/commands/UpdateBudgetActionCommand.ts diff --git a/clients/client-budgets/commands/UpdateBudgetCommand.ts b/clients/client-budgets/src/commands/UpdateBudgetCommand.ts similarity index 100% rename from clients/client-budgets/commands/UpdateBudgetCommand.ts rename to clients/client-budgets/src/commands/UpdateBudgetCommand.ts diff --git a/clients/client-budgets/commands/UpdateNotificationCommand.ts b/clients/client-budgets/src/commands/UpdateNotificationCommand.ts similarity index 100% rename from clients/client-budgets/commands/UpdateNotificationCommand.ts rename to clients/client-budgets/src/commands/UpdateNotificationCommand.ts diff --git a/clients/client-budgets/commands/UpdateSubscriberCommand.ts b/clients/client-budgets/src/commands/UpdateSubscriberCommand.ts similarity index 100% rename from clients/client-budgets/commands/UpdateSubscriberCommand.ts rename to clients/client-budgets/src/commands/UpdateSubscriberCommand.ts diff --git a/clients/client-budgets/endpoints.ts b/clients/client-budgets/src/endpoints.ts similarity index 100% rename from clients/client-budgets/endpoints.ts rename to clients/client-budgets/src/endpoints.ts diff --git a/clients/client-budgets/index.ts b/clients/client-budgets/src/index.ts similarity index 100% rename from clients/client-budgets/index.ts rename to clients/client-budgets/src/index.ts diff --git a/clients/client-budgets/models/index.ts b/clients/client-budgets/src/models/index.ts similarity index 100% rename from clients/client-budgets/models/index.ts rename to clients/client-budgets/src/models/index.ts diff --git a/clients/client-budgets/models/models_0.ts b/clients/client-budgets/src/models/models_0.ts similarity index 100% rename from clients/client-budgets/models/models_0.ts rename to clients/client-budgets/src/models/models_0.ts diff --git a/clients/client-budgets/pagination/DescribeBudgetActionHistoriesPaginator.ts b/clients/client-budgets/src/pagination/DescribeBudgetActionHistoriesPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeBudgetActionHistoriesPaginator.ts rename to clients/client-budgets/src/pagination/DescribeBudgetActionHistoriesPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeBudgetActionsForAccountPaginator.ts b/clients/client-budgets/src/pagination/DescribeBudgetActionsForAccountPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeBudgetActionsForAccountPaginator.ts rename to clients/client-budgets/src/pagination/DescribeBudgetActionsForAccountPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeBudgetActionsForBudgetPaginator.ts b/clients/client-budgets/src/pagination/DescribeBudgetActionsForBudgetPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeBudgetActionsForBudgetPaginator.ts rename to clients/client-budgets/src/pagination/DescribeBudgetActionsForBudgetPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeBudgetPerformanceHistoryPaginator.ts b/clients/client-budgets/src/pagination/DescribeBudgetPerformanceHistoryPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeBudgetPerformanceHistoryPaginator.ts rename to clients/client-budgets/src/pagination/DescribeBudgetPerformanceHistoryPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeBudgetsPaginator.ts b/clients/client-budgets/src/pagination/DescribeBudgetsPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeBudgetsPaginator.ts rename to clients/client-budgets/src/pagination/DescribeBudgetsPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeNotificationsForBudgetPaginator.ts b/clients/client-budgets/src/pagination/DescribeNotificationsForBudgetPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeNotificationsForBudgetPaginator.ts rename to clients/client-budgets/src/pagination/DescribeNotificationsForBudgetPaginator.ts diff --git a/clients/client-budgets/pagination/DescribeSubscribersForNotificationPaginator.ts b/clients/client-budgets/src/pagination/DescribeSubscribersForNotificationPaginator.ts similarity index 100% rename from clients/client-budgets/pagination/DescribeSubscribersForNotificationPaginator.ts rename to clients/client-budgets/src/pagination/DescribeSubscribersForNotificationPaginator.ts diff --git a/clients/client-budgets/pagination/Interfaces.ts b/clients/client-budgets/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-budgets/pagination/Interfaces.ts rename to clients/client-budgets/src/pagination/Interfaces.ts diff --git a/clients/client-budgets/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-budgets/protocols/Aws_json1_1.ts rename to clients/client-budgets/src/protocols/Aws_json1_1.ts diff --git a/clients/client-budgets/src/runtimeConfig.browser.ts b/clients/client-budgets/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3168a1f1adb1 --- /dev/null +++ b/clients/client-budgets/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { BudgetsClientConfig } from "./BudgetsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BudgetsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-budgets/runtimeConfig.native.ts b/clients/client-budgets/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-budgets/runtimeConfig.native.ts rename to clients/client-budgets/src/runtimeConfig.native.ts diff --git a/clients/client-budgets/runtimeConfig.shared.ts b/clients/client-budgets/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-budgets/runtimeConfig.shared.ts rename to clients/client-budgets/src/runtimeConfig.shared.ts diff --git a/clients/client-budgets/src/runtimeConfig.ts b/clients/client-budgets/src/runtimeConfig.ts new file mode 100644 index 000000000000..b69382d8a9a4 --- /dev/null +++ b/clients/client-budgets/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { BudgetsClientConfig } from "./BudgetsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: BudgetsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-budgets/tsconfig.es.json b/clients/client-budgets/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-budgets/tsconfig.es.json +++ b/clients/client-budgets/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-budgets/tsconfig.json b/clients/client-budgets/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-budgets/tsconfig.json +++ b/clients/client-budgets/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-budgets/tsconfig.types.json b/clients/client-budgets/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-budgets/tsconfig.types.json +++ b/clients/client-budgets/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-chime-sdk-identity/.gitignore b/clients/client-chime-sdk-identity/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-chime-sdk-identity/.gitignore +++ b/clients/client-chime-sdk-identity/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-chime-sdk-identity/package.json b/clients/client-chime-sdk-identity/package.json index a1419d930eb0..51bff7d8f824 100644 --- a/clients/client-chime-sdk-identity/package.json +++ b/clients/client-chime-sdk-identity/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-chime-sdk-identity", "repository": { "type": "git", diff --git a/clients/client-chime-sdk-identity/runtimeConfig.browser.ts b/clients/client-chime-sdk-identity/runtimeConfig.browser.ts deleted file mode 100644 index ca90a950aeb8..000000000000 --- a/clients/client-chime-sdk-identity/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ChimeSDKIdentityClientConfig } from "./ChimeSDKIdentityClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime-sdk-identity/runtimeConfig.ts b/clients/client-chime-sdk-identity/runtimeConfig.ts deleted file mode 100644 index 28d45be99dd1..000000000000 --- a/clients/client-chime-sdk-identity/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ChimeSDKIdentityClientConfig } from "./ChimeSDKIdentityClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime-sdk-identity/ChimeSDKIdentity.ts b/clients/client-chime-sdk-identity/src/ChimeSDKIdentity.ts similarity index 100% rename from clients/client-chime-sdk-identity/ChimeSDKIdentity.ts rename to clients/client-chime-sdk-identity/src/ChimeSDKIdentity.ts diff --git a/clients/client-chime-sdk-identity/ChimeSDKIdentityClient.ts b/clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts similarity index 100% rename from clients/client-chime-sdk-identity/ChimeSDKIdentityClient.ts rename to clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts diff --git a/clients/client-chime-sdk-identity/commands/CreateAppInstanceAdminCommand.ts b/clients/client-chime-sdk-identity/src/commands/CreateAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/CreateAppInstanceAdminCommand.ts rename to clients/client-chime-sdk-identity/src/commands/CreateAppInstanceAdminCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/CreateAppInstanceCommand.ts b/clients/client-chime-sdk-identity/src/commands/CreateAppInstanceCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/CreateAppInstanceCommand.ts rename to clients/client-chime-sdk-identity/src/commands/CreateAppInstanceCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/CreateAppInstanceUserCommand.ts b/clients/client-chime-sdk-identity/src/commands/CreateAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/CreateAppInstanceUserCommand.ts rename to clients/client-chime-sdk-identity/src/commands/CreateAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DeleteAppInstanceAdminCommand.ts b/clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DeleteAppInstanceAdminCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceAdminCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DeleteAppInstanceCommand.ts b/clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DeleteAppInstanceCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DeleteAppInstanceUserCommand.ts b/clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DeleteAppInstanceUserCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DeleteAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DescribeAppInstanceAdminCommand.ts b/clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DescribeAppInstanceAdminCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceAdminCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DescribeAppInstanceCommand.ts b/clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DescribeAppInstanceCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/DescribeAppInstanceUserCommand.ts b/clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/DescribeAppInstanceUserCommand.ts rename to clients/client-chime-sdk-identity/src/commands/DescribeAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/GetAppInstanceRetentionSettingsCommand.ts b/clients/client-chime-sdk-identity/src/commands/GetAppInstanceRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/GetAppInstanceRetentionSettingsCommand.ts rename to clients/client-chime-sdk-identity/src/commands/GetAppInstanceRetentionSettingsCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/ListAppInstanceAdminsCommand.ts b/clients/client-chime-sdk-identity/src/commands/ListAppInstanceAdminsCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/ListAppInstanceAdminsCommand.ts rename to clients/client-chime-sdk-identity/src/commands/ListAppInstanceAdminsCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/ListAppInstanceUsersCommand.ts b/clients/client-chime-sdk-identity/src/commands/ListAppInstanceUsersCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/ListAppInstanceUsersCommand.ts rename to clients/client-chime-sdk-identity/src/commands/ListAppInstanceUsersCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/ListAppInstancesCommand.ts b/clients/client-chime-sdk-identity/src/commands/ListAppInstancesCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/ListAppInstancesCommand.ts rename to clients/client-chime-sdk-identity/src/commands/ListAppInstancesCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/PutAppInstanceRetentionSettingsCommand.ts b/clients/client-chime-sdk-identity/src/commands/PutAppInstanceRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/PutAppInstanceRetentionSettingsCommand.ts rename to clients/client-chime-sdk-identity/src/commands/PutAppInstanceRetentionSettingsCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/UpdateAppInstanceCommand.ts b/clients/client-chime-sdk-identity/src/commands/UpdateAppInstanceCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/UpdateAppInstanceCommand.ts rename to clients/client-chime-sdk-identity/src/commands/UpdateAppInstanceCommand.ts diff --git a/clients/client-chime-sdk-identity/commands/UpdateAppInstanceUserCommand.ts b/clients/client-chime-sdk-identity/src/commands/UpdateAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-identity/commands/UpdateAppInstanceUserCommand.ts rename to clients/client-chime-sdk-identity/src/commands/UpdateAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-identity/endpoints.ts b/clients/client-chime-sdk-identity/src/endpoints.ts similarity index 100% rename from clients/client-chime-sdk-identity/endpoints.ts rename to clients/client-chime-sdk-identity/src/endpoints.ts diff --git a/clients/client-chime-sdk-identity/index.ts b/clients/client-chime-sdk-identity/src/index.ts similarity index 100% rename from clients/client-chime-sdk-identity/index.ts rename to clients/client-chime-sdk-identity/src/index.ts diff --git a/clients/client-chime-sdk-identity/models/index.ts b/clients/client-chime-sdk-identity/src/models/index.ts similarity index 100% rename from clients/client-chime-sdk-identity/models/index.ts rename to clients/client-chime-sdk-identity/src/models/index.ts diff --git a/clients/client-chime-sdk-identity/models/models_0.ts b/clients/client-chime-sdk-identity/src/models/models_0.ts similarity index 100% rename from clients/client-chime-sdk-identity/models/models_0.ts rename to clients/client-chime-sdk-identity/src/models/models_0.ts diff --git a/clients/client-chime-sdk-identity/pagination/Interfaces.ts b/clients/client-chime-sdk-identity/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-chime-sdk-identity/pagination/Interfaces.ts rename to clients/client-chime-sdk-identity/src/pagination/Interfaces.ts diff --git a/clients/client-chime-sdk-identity/pagination/ListAppInstanceAdminsPaginator.ts b/clients/client-chime-sdk-identity/src/pagination/ListAppInstanceAdminsPaginator.ts similarity index 100% rename from clients/client-chime-sdk-identity/pagination/ListAppInstanceAdminsPaginator.ts rename to clients/client-chime-sdk-identity/src/pagination/ListAppInstanceAdminsPaginator.ts diff --git a/clients/client-chime-sdk-identity/pagination/ListAppInstanceUsersPaginator.ts b/clients/client-chime-sdk-identity/src/pagination/ListAppInstanceUsersPaginator.ts similarity index 100% rename from clients/client-chime-sdk-identity/pagination/ListAppInstanceUsersPaginator.ts rename to clients/client-chime-sdk-identity/src/pagination/ListAppInstanceUsersPaginator.ts diff --git a/clients/client-chime-sdk-identity/pagination/ListAppInstancesPaginator.ts b/clients/client-chime-sdk-identity/src/pagination/ListAppInstancesPaginator.ts similarity index 100% rename from clients/client-chime-sdk-identity/pagination/ListAppInstancesPaginator.ts rename to clients/client-chime-sdk-identity/src/pagination/ListAppInstancesPaginator.ts diff --git a/clients/client-chime-sdk-identity/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-chime-sdk-identity/protocols/Aws_restJson1.ts rename to clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts diff --git a/clients/client-chime-sdk-identity/src/runtimeConfig.browser.ts b/clients/client-chime-sdk-identity/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..dac3346c4c7c --- /dev/null +++ b/clients/client-chime-sdk-identity/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ChimeSDKIdentityClientConfig } from "./ChimeSDKIdentityClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime-sdk-identity/runtimeConfig.native.ts b/clients/client-chime-sdk-identity/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-chime-sdk-identity/runtimeConfig.native.ts rename to clients/client-chime-sdk-identity/src/runtimeConfig.native.ts diff --git a/clients/client-chime-sdk-identity/runtimeConfig.shared.ts b/clients/client-chime-sdk-identity/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-chime-sdk-identity/runtimeConfig.shared.ts rename to clients/client-chime-sdk-identity/src/runtimeConfig.shared.ts diff --git a/clients/client-chime-sdk-identity/src/runtimeConfig.ts b/clients/client-chime-sdk-identity/src/runtimeConfig.ts new file mode 100644 index 000000000000..48ec9166537e --- /dev/null +++ b/clients/client-chime-sdk-identity/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ChimeSDKIdentityClientConfig } from "./ChimeSDKIdentityClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime-sdk-identity/tsconfig.es.json b/clients/client-chime-sdk-identity/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-chime-sdk-identity/tsconfig.es.json +++ b/clients/client-chime-sdk-identity/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-chime-sdk-identity/tsconfig.json b/clients/client-chime-sdk-identity/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-chime-sdk-identity/tsconfig.json +++ b/clients/client-chime-sdk-identity/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-chime-sdk-identity/tsconfig.types.json b/clients/client-chime-sdk-identity/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-chime-sdk-identity/tsconfig.types.json +++ b/clients/client-chime-sdk-identity/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-chime-sdk-messaging/.gitignore b/clients/client-chime-sdk-messaging/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-chime-sdk-messaging/.gitignore +++ b/clients/client-chime-sdk-messaging/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-chime-sdk-messaging/package.json b/clients/client-chime-sdk-messaging/package.json index 245ed061006a..4b8247e16907 100644 --- a/clients/client-chime-sdk-messaging/package.json +++ b/clients/client-chime-sdk-messaging/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-chime-sdk-messaging", "repository": { "type": "git", diff --git a/clients/client-chime-sdk-messaging/runtimeConfig.browser.ts b/clients/client-chime-sdk-messaging/runtimeConfig.browser.ts deleted file mode 100644 index ce1489ab354f..000000000000 --- a/clients/client-chime-sdk-messaging/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ChimeSDKMessagingClientConfig } from "./ChimeSDKMessagingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime-sdk-messaging/runtimeConfig.ts b/clients/client-chime-sdk-messaging/runtimeConfig.ts deleted file mode 100644 index 732708ef0f2c..000000000000 --- a/clients/client-chime-sdk-messaging/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ChimeSDKMessagingClientConfig } from "./ChimeSDKMessagingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime-sdk-messaging/ChimeSDKMessaging.ts b/clients/client-chime-sdk-messaging/src/ChimeSDKMessaging.ts similarity index 100% rename from clients/client-chime-sdk-messaging/ChimeSDKMessaging.ts rename to clients/client-chime-sdk-messaging/src/ChimeSDKMessaging.ts diff --git a/clients/client-chime-sdk-messaging/ChimeSDKMessagingClient.ts b/clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts similarity index 100% rename from clients/client-chime-sdk-messaging/ChimeSDKMessagingClient.ts rename to clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts diff --git a/clients/client-chime-sdk-messaging/commands/BatchCreateChannelMembershipCommand.ts b/clients/client-chime-sdk-messaging/src/commands/BatchCreateChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/BatchCreateChannelMembershipCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/BatchCreateChannelMembershipCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/CreateChannelBanCommand.ts b/clients/client-chime-sdk-messaging/src/commands/CreateChannelBanCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/CreateChannelBanCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/CreateChannelBanCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/CreateChannelCommand.ts b/clients/client-chime-sdk-messaging/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/CreateChannelCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/CreateChannelCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/CreateChannelMembershipCommand.ts b/clients/client-chime-sdk-messaging/src/commands/CreateChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/CreateChannelMembershipCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/CreateChannelMembershipCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/CreateChannelModeratorCommand.ts b/clients/client-chime-sdk-messaging/src/commands/CreateChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/CreateChannelModeratorCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/CreateChannelModeratorCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DeleteChannelBanCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DeleteChannelBanCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DeleteChannelBanCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DeleteChannelBanCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DeleteChannelCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DeleteChannelCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DeleteChannelMembershipCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DeleteChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DeleteChannelMembershipCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DeleteChannelMembershipCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DeleteChannelMessageCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DeleteChannelMessageCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DeleteChannelMessageCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DeleteChannelMessageCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DeleteChannelModeratorCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DeleteChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DeleteChannelModeratorCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DeleteChannelModeratorCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelBanCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelBanCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelBanCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelBanCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelMembershipCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelMembershipCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelMembershipCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/DescribeChannelModeratorCommand.ts b/clients/client-chime-sdk-messaging/src/commands/DescribeChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/DescribeChannelModeratorCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/DescribeChannelModeratorCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/GetChannelMessageCommand.ts b/clients/client-chime-sdk-messaging/src/commands/GetChannelMessageCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/GetChannelMessageCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/GetChannelMessageCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/GetMessagingSessionEndpointCommand.ts b/clients/client-chime-sdk-messaging/src/commands/GetMessagingSessionEndpointCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/GetMessagingSessionEndpointCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/GetMessagingSessionEndpointCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelBansCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelBansCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelBansCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelBansCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelMembershipsCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelMembershipsCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelMembershipsCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelMembershipsCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelMembershipsForAppInstanceUserCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelMembershipsForAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelMembershipsForAppInstanceUserCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelMembershipsForAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelMessagesCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelMessagesCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelMessagesCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelMessagesCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelModeratorsCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelModeratorsCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelModeratorsCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelModeratorsCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelsCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelsCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelsCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/ListChannelsModeratedByAppInstanceUserCommand.ts b/clients/client-chime-sdk-messaging/src/commands/ListChannelsModeratedByAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/ListChannelsModeratedByAppInstanceUserCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/ListChannelsModeratedByAppInstanceUserCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/RedactChannelMessageCommand.ts b/clients/client-chime-sdk-messaging/src/commands/RedactChannelMessageCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/RedactChannelMessageCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/RedactChannelMessageCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/SendChannelMessageCommand.ts b/clients/client-chime-sdk-messaging/src/commands/SendChannelMessageCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/SendChannelMessageCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/SendChannelMessageCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/UpdateChannelCommand.ts b/clients/client-chime-sdk-messaging/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/UpdateChannelCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/UpdateChannelMessageCommand.ts b/clients/client-chime-sdk-messaging/src/commands/UpdateChannelMessageCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/UpdateChannelMessageCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/UpdateChannelMessageCommand.ts diff --git a/clients/client-chime-sdk-messaging/commands/UpdateChannelReadMarkerCommand.ts b/clients/client-chime-sdk-messaging/src/commands/UpdateChannelReadMarkerCommand.ts similarity index 100% rename from clients/client-chime-sdk-messaging/commands/UpdateChannelReadMarkerCommand.ts rename to clients/client-chime-sdk-messaging/src/commands/UpdateChannelReadMarkerCommand.ts diff --git a/clients/client-chime-sdk-messaging/endpoints.ts b/clients/client-chime-sdk-messaging/src/endpoints.ts similarity index 100% rename from clients/client-chime-sdk-messaging/endpoints.ts rename to clients/client-chime-sdk-messaging/src/endpoints.ts diff --git a/clients/client-chime-sdk-messaging/index.ts b/clients/client-chime-sdk-messaging/src/index.ts similarity index 100% rename from clients/client-chime-sdk-messaging/index.ts rename to clients/client-chime-sdk-messaging/src/index.ts diff --git a/clients/client-chime-sdk-messaging/models/index.ts b/clients/client-chime-sdk-messaging/src/models/index.ts similarity index 100% rename from clients/client-chime-sdk-messaging/models/index.ts rename to clients/client-chime-sdk-messaging/src/models/index.ts diff --git a/clients/client-chime-sdk-messaging/models/models_0.ts b/clients/client-chime-sdk-messaging/src/models/models_0.ts similarity index 100% rename from clients/client-chime-sdk-messaging/models/models_0.ts rename to clients/client-chime-sdk-messaging/src/models/models_0.ts diff --git a/clients/client-chime-sdk-messaging/pagination/Interfaces.ts b/clients/client-chime-sdk-messaging/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/Interfaces.ts rename to clients/client-chime-sdk-messaging/src/pagination/Interfaces.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelBansPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelBansPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelBansPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelBansPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelMembershipsPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelMembershipsPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelMembershipsPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelMembershipsPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelMessagesPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelMessagesPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelMessagesPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelMessagesPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelModeratorsPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelModeratorsPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelModeratorsPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelModeratorsPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts diff --git a/clients/client-chime-sdk-messaging/pagination/ListChannelsPaginator.ts b/clients/client-chime-sdk-messaging/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-chime-sdk-messaging/pagination/ListChannelsPaginator.ts rename to clients/client-chime-sdk-messaging/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-chime-sdk-messaging/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-chime-sdk-messaging/protocols/Aws_restJson1.ts rename to clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts diff --git a/clients/client-chime-sdk-messaging/src/runtimeConfig.browser.ts b/clients/client-chime-sdk-messaging/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c007720a142e --- /dev/null +++ b/clients/client-chime-sdk-messaging/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ChimeSDKMessagingClientConfig } from "./ChimeSDKMessagingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime-sdk-messaging/runtimeConfig.native.ts b/clients/client-chime-sdk-messaging/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-chime-sdk-messaging/runtimeConfig.native.ts rename to clients/client-chime-sdk-messaging/src/runtimeConfig.native.ts diff --git a/clients/client-chime-sdk-messaging/runtimeConfig.shared.ts b/clients/client-chime-sdk-messaging/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-chime-sdk-messaging/runtimeConfig.shared.ts rename to clients/client-chime-sdk-messaging/src/runtimeConfig.shared.ts diff --git a/clients/client-chime-sdk-messaging/src/runtimeConfig.ts b/clients/client-chime-sdk-messaging/src/runtimeConfig.ts new file mode 100644 index 000000000000..a864c9d53070 --- /dev/null +++ b/clients/client-chime-sdk-messaging/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ChimeSDKMessagingClientConfig } from "./ChimeSDKMessagingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime-sdk-messaging/tsconfig.es.json b/clients/client-chime-sdk-messaging/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-chime-sdk-messaging/tsconfig.es.json +++ b/clients/client-chime-sdk-messaging/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-chime-sdk-messaging/tsconfig.json b/clients/client-chime-sdk-messaging/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-chime-sdk-messaging/tsconfig.json +++ b/clients/client-chime-sdk-messaging/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-chime-sdk-messaging/tsconfig.types.json b/clients/client-chime-sdk-messaging/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-chime-sdk-messaging/tsconfig.types.json +++ b/clients/client-chime-sdk-messaging/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-chime/.gitignore b/clients/client-chime/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-chime/.gitignore +++ b/clients/client-chime/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-chime/package.json b/clients/client-chime/package.json index 8e1f3e6fcd28..1a664d5f88a0 100644 --- a/clients/client-chime/package.json +++ b/clients/client-chime/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-chime", "repository": { "type": "git", diff --git a/clients/client-chime/runtimeConfig.browser.ts b/clients/client-chime/runtimeConfig.browser.ts deleted file mode 100644 index 653c0bab328a..000000000000 --- a/clients/client-chime/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ChimeClientConfig } from "./ChimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime/runtimeConfig.ts b/clients/client-chime/runtimeConfig.ts deleted file mode 100644 index cabcbdf6d7d0..000000000000 --- a/clients/client-chime/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ChimeClientConfig } from "./ChimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ChimeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-chime/Chime.ts b/clients/client-chime/src/Chime.ts similarity index 100% rename from clients/client-chime/Chime.ts rename to clients/client-chime/src/Chime.ts diff --git a/clients/client-chime/ChimeClient.ts b/clients/client-chime/src/ChimeClient.ts similarity index 100% rename from clients/client-chime/ChimeClient.ts rename to clients/client-chime/src/ChimeClient.ts diff --git a/clients/client-chime/commands/AssociatePhoneNumberWithUserCommand.ts b/clients/client-chime/src/commands/AssociatePhoneNumberWithUserCommand.ts similarity index 100% rename from clients/client-chime/commands/AssociatePhoneNumberWithUserCommand.ts rename to clients/client-chime/src/commands/AssociatePhoneNumberWithUserCommand.ts diff --git a/clients/client-chime/commands/AssociatePhoneNumbersWithVoiceConnectorCommand.ts b/clients/client-chime/src/commands/AssociatePhoneNumbersWithVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/AssociatePhoneNumbersWithVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/AssociatePhoneNumbersWithVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/AssociatePhoneNumbersWithVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/AssociatePhoneNumbersWithVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/AssociatePhoneNumbersWithVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/AssociatePhoneNumbersWithVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/commands/AssociateSigninDelegateGroupsWithAccountCommand.ts b/clients/client-chime/src/commands/AssociateSigninDelegateGroupsWithAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/AssociateSigninDelegateGroupsWithAccountCommand.ts rename to clients/client-chime/src/commands/AssociateSigninDelegateGroupsWithAccountCommand.ts diff --git a/clients/client-chime/commands/BatchCreateAttendeeCommand.ts b/clients/client-chime/src/commands/BatchCreateAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchCreateAttendeeCommand.ts rename to clients/client-chime/src/commands/BatchCreateAttendeeCommand.ts diff --git a/clients/client-chime/commands/BatchCreateChannelMembershipCommand.ts b/clients/client-chime/src/commands/BatchCreateChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchCreateChannelMembershipCommand.ts rename to clients/client-chime/src/commands/BatchCreateChannelMembershipCommand.ts diff --git a/clients/client-chime/commands/BatchCreateRoomMembershipCommand.ts b/clients/client-chime/src/commands/BatchCreateRoomMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchCreateRoomMembershipCommand.ts rename to clients/client-chime/src/commands/BatchCreateRoomMembershipCommand.ts diff --git a/clients/client-chime/commands/BatchDeletePhoneNumberCommand.ts b/clients/client-chime/src/commands/BatchDeletePhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchDeletePhoneNumberCommand.ts rename to clients/client-chime/src/commands/BatchDeletePhoneNumberCommand.ts diff --git a/clients/client-chime/commands/BatchSuspendUserCommand.ts b/clients/client-chime/src/commands/BatchSuspendUserCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchSuspendUserCommand.ts rename to clients/client-chime/src/commands/BatchSuspendUserCommand.ts diff --git a/clients/client-chime/commands/BatchUnsuspendUserCommand.ts b/clients/client-chime/src/commands/BatchUnsuspendUserCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchUnsuspendUserCommand.ts rename to clients/client-chime/src/commands/BatchUnsuspendUserCommand.ts diff --git a/clients/client-chime/commands/BatchUpdatePhoneNumberCommand.ts b/clients/client-chime/src/commands/BatchUpdatePhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchUpdatePhoneNumberCommand.ts rename to clients/client-chime/src/commands/BatchUpdatePhoneNumberCommand.ts diff --git a/clients/client-chime/commands/BatchUpdateUserCommand.ts b/clients/client-chime/src/commands/BatchUpdateUserCommand.ts similarity index 100% rename from clients/client-chime/commands/BatchUpdateUserCommand.ts rename to clients/client-chime/src/commands/BatchUpdateUserCommand.ts diff --git a/clients/client-chime/commands/CreateAccountCommand.ts b/clients/client-chime/src/commands/CreateAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateAccountCommand.ts rename to clients/client-chime/src/commands/CreateAccountCommand.ts diff --git a/clients/client-chime/commands/CreateAppInstanceAdminCommand.ts b/clients/client-chime/src/commands/CreateAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateAppInstanceAdminCommand.ts rename to clients/client-chime/src/commands/CreateAppInstanceAdminCommand.ts diff --git a/clients/client-chime/commands/CreateAppInstanceCommand.ts b/clients/client-chime/src/commands/CreateAppInstanceCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateAppInstanceCommand.ts rename to clients/client-chime/src/commands/CreateAppInstanceCommand.ts diff --git a/clients/client-chime/commands/CreateAppInstanceUserCommand.ts b/clients/client-chime/src/commands/CreateAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/CreateAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/CreateAttendeeCommand.ts b/clients/client-chime/src/commands/CreateAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateAttendeeCommand.ts rename to clients/client-chime/src/commands/CreateAttendeeCommand.ts diff --git a/clients/client-chime/commands/CreateBotCommand.ts b/clients/client-chime/src/commands/CreateBotCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateBotCommand.ts rename to clients/client-chime/src/commands/CreateBotCommand.ts diff --git a/clients/client-chime/commands/CreateChannelBanCommand.ts b/clients/client-chime/src/commands/CreateChannelBanCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateChannelBanCommand.ts rename to clients/client-chime/src/commands/CreateChannelBanCommand.ts diff --git a/clients/client-chime/commands/CreateChannelCommand.ts b/clients/client-chime/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateChannelCommand.ts rename to clients/client-chime/src/commands/CreateChannelCommand.ts diff --git a/clients/client-chime/commands/CreateChannelMembershipCommand.ts b/clients/client-chime/src/commands/CreateChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateChannelMembershipCommand.ts rename to clients/client-chime/src/commands/CreateChannelMembershipCommand.ts diff --git a/clients/client-chime/commands/CreateChannelModeratorCommand.ts b/clients/client-chime/src/commands/CreateChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateChannelModeratorCommand.ts rename to clients/client-chime/src/commands/CreateChannelModeratorCommand.ts diff --git a/clients/client-chime/commands/CreateMediaCapturePipelineCommand.ts b/clients/client-chime/src/commands/CreateMediaCapturePipelineCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateMediaCapturePipelineCommand.ts rename to clients/client-chime/src/commands/CreateMediaCapturePipelineCommand.ts diff --git a/clients/client-chime/commands/CreateMeetingCommand.ts b/clients/client-chime/src/commands/CreateMeetingCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateMeetingCommand.ts rename to clients/client-chime/src/commands/CreateMeetingCommand.ts diff --git a/clients/client-chime/commands/CreateMeetingDialOutCommand.ts b/clients/client-chime/src/commands/CreateMeetingDialOutCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateMeetingDialOutCommand.ts rename to clients/client-chime/src/commands/CreateMeetingDialOutCommand.ts diff --git a/clients/client-chime/commands/CreateMeetingWithAttendeesCommand.ts b/clients/client-chime/src/commands/CreateMeetingWithAttendeesCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateMeetingWithAttendeesCommand.ts rename to clients/client-chime/src/commands/CreateMeetingWithAttendeesCommand.ts diff --git a/clients/client-chime/commands/CreatePhoneNumberOrderCommand.ts b/clients/client-chime/src/commands/CreatePhoneNumberOrderCommand.ts similarity index 100% rename from clients/client-chime/commands/CreatePhoneNumberOrderCommand.ts rename to clients/client-chime/src/commands/CreatePhoneNumberOrderCommand.ts diff --git a/clients/client-chime/commands/CreateProxySessionCommand.ts b/clients/client-chime/src/commands/CreateProxySessionCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateProxySessionCommand.ts rename to clients/client-chime/src/commands/CreateProxySessionCommand.ts diff --git a/clients/client-chime/commands/CreateRoomCommand.ts b/clients/client-chime/src/commands/CreateRoomCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateRoomCommand.ts rename to clients/client-chime/src/commands/CreateRoomCommand.ts diff --git a/clients/client-chime/commands/CreateRoomMembershipCommand.ts b/clients/client-chime/src/commands/CreateRoomMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateRoomMembershipCommand.ts rename to clients/client-chime/src/commands/CreateRoomMembershipCommand.ts diff --git a/clients/client-chime/commands/CreateSipMediaApplicationCallCommand.ts b/clients/client-chime/src/commands/CreateSipMediaApplicationCallCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateSipMediaApplicationCallCommand.ts rename to clients/client-chime/src/commands/CreateSipMediaApplicationCallCommand.ts diff --git a/clients/client-chime/commands/CreateSipMediaApplicationCommand.ts b/clients/client-chime/src/commands/CreateSipMediaApplicationCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateSipMediaApplicationCommand.ts rename to clients/client-chime/src/commands/CreateSipMediaApplicationCommand.ts diff --git a/clients/client-chime/commands/CreateSipRuleCommand.ts b/clients/client-chime/src/commands/CreateSipRuleCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateSipRuleCommand.ts rename to clients/client-chime/src/commands/CreateSipRuleCommand.ts diff --git a/clients/client-chime/commands/CreateUserCommand.ts b/clients/client-chime/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateUserCommand.ts rename to clients/client-chime/src/commands/CreateUserCommand.ts diff --git a/clients/client-chime/commands/CreateVoiceConnectorCommand.ts b/clients/client-chime/src/commands/CreateVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/CreateVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/CreateVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/CreateVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/CreateVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/CreateVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/commands/DeleteAccountCommand.ts b/clients/client-chime/src/commands/DeleteAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAccountCommand.ts rename to clients/client-chime/src/commands/DeleteAccountCommand.ts diff --git a/clients/client-chime/commands/DeleteAppInstanceAdminCommand.ts b/clients/client-chime/src/commands/DeleteAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAppInstanceAdminCommand.ts rename to clients/client-chime/src/commands/DeleteAppInstanceAdminCommand.ts diff --git a/clients/client-chime/commands/DeleteAppInstanceCommand.ts b/clients/client-chime/src/commands/DeleteAppInstanceCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAppInstanceCommand.ts rename to clients/client-chime/src/commands/DeleteAppInstanceCommand.ts diff --git a/clients/client-chime/commands/DeleteAppInstanceStreamingConfigurationsCommand.ts b/clients/client-chime/src/commands/DeleteAppInstanceStreamingConfigurationsCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAppInstanceStreamingConfigurationsCommand.ts rename to clients/client-chime/src/commands/DeleteAppInstanceStreamingConfigurationsCommand.ts diff --git a/clients/client-chime/commands/DeleteAppInstanceUserCommand.ts b/clients/client-chime/src/commands/DeleteAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/DeleteAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/DeleteAttendeeCommand.ts b/clients/client-chime/src/commands/DeleteAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteAttendeeCommand.ts rename to clients/client-chime/src/commands/DeleteAttendeeCommand.ts diff --git a/clients/client-chime/commands/DeleteChannelBanCommand.ts b/clients/client-chime/src/commands/DeleteChannelBanCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteChannelBanCommand.ts rename to clients/client-chime/src/commands/DeleteChannelBanCommand.ts diff --git a/clients/client-chime/commands/DeleteChannelCommand.ts b/clients/client-chime/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteChannelCommand.ts rename to clients/client-chime/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-chime/commands/DeleteChannelMembershipCommand.ts b/clients/client-chime/src/commands/DeleteChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteChannelMembershipCommand.ts rename to clients/client-chime/src/commands/DeleteChannelMembershipCommand.ts diff --git a/clients/client-chime/commands/DeleteChannelMessageCommand.ts b/clients/client-chime/src/commands/DeleteChannelMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteChannelMessageCommand.ts rename to clients/client-chime/src/commands/DeleteChannelMessageCommand.ts diff --git a/clients/client-chime/commands/DeleteChannelModeratorCommand.ts b/clients/client-chime/src/commands/DeleteChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteChannelModeratorCommand.ts rename to clients/client-chime/src/commands/DeleteChannelModeratorCommand.ts diff --git a/clients/client-chime/commands/DeleteEventsConfigurationCommand.ts b/clients/client-chime/src/commands/DeleteEventsConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteEventsConfigurationCommand.ts rename to clients/client-chime/src/commands/DeleteEventsConfigurationCommand.ts diff --git a/clients/client-chime/commands/DeleteMediaCapturePipelineCommand.ts b/clients/client-chime/src/commands/DeleteMediaCapturePipelineCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteMediaCapturePipelineCommand.ts rename to clients/client-chime/src/commands/DeleteMediaCapturePipelineCommand.ts diff --git a/clients/client-chime/commands/DeleteMeetingCommand.ts b/clients/client-chime/src/commands/DeleteMeetingCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteMeetingCommand.ts rename to clients/client-chime/src/commands/DeleteMeetingCommand.ts diff --git a/clients/client-chime/commands/DeletePhoneNumberCommand.ts b/clients/client-chime/src/commands/DeletePhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/DeletePhoneNumberCommand.ts rename to clients/client-chime/src/commands/DeletePhoneNumberCommand.ts diff --git a/clients/client-chime/commands/DeleteProxySessionCommand.ts b/clients/client-chime/src/commands/DeleteProxySessionCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteProxySessionCommand.ts rename to clients/client-chime/src/commands/DeleteProxySessionCommand.ts diff --git a/clients/client-chime/commands/DeleteRoomCommand.ts b/clients/client-chime/src/commands/DeleteRoomCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteRoomCommand.ts rename to clients/client-chime/src/commands/DeleteRoomCommand.ts diff --git a/clients/client-chime/commands/DeleteRoomMembershipCommand.ts b/clients/client-chime/src/commands/DeleteRoomMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteRoomMembershipCommand.ts rename to clients/client-chime/src/commands/DeleteRoomMembershipCommand.ts diff --git a/clients/client-chime/commands/DeleteSipMediaApplicationCommand.ts b/clients/client-chime/src/commands/DeleteSipMediaApplicationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteSipMediaApplicationCommand.ts rename to clients/client-chime/src/commands/DeleteSipMediaApplicationCommand.ts diff --git a/clients/client-chime/commands/DeleteSipRuleCommand.ts b/clients/client-chime/src/commands/DeleteSipRuleCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteSipRuleCommand.ts rename to clients/client-chime/src/commands/DeleteSipRuleCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorEmergencyCallingConfigurationCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorEmergencyCallingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorEmergencyCallingConfigurationCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorEmergencyCallingConfigurationCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorOriginationCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorOriginationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorOriginationCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorOriginationCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorProxyCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorProxyCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorProxyCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorProxyCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorStreamingConfigurationCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorStreamingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorStreamingConfigurationCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorStreamingConfigurationCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorTerminationCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorTerminationCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorTerminationCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorTerminationCommand.ts diff --git a/clients/client-chime/commands/DeleteVoiceConnectorTerminationCredentialsCommand.ts b/clients/client-chime/src/commands/DeleteVoiceConnectorTerminationCredentialsCommand.ts similarity index 100% rename from clients/client-chime/commands/DeleteVoiceConnectorTerminationCredentialsCommand.ts rename to clients/client-chime/src/commands/DeleteVoiceConnectorTerminationCredentialsCommand.ts diff --git a/clients/client-chime/commands/DescribeAppInstanceAdminCommand.ts b/clients/client-chime/src/commands/DescribeAppInstanceAdminCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeAppInstanceAdminCommand.ts rename to clients/client-chime/src/commands/DescribeAppInstanceAdminCommand.ts diff --git a/clients/client-chime/commands/DescribeAppInstanceCommand.ts b/clients/client-chime/src/commands/DescribeAppInstanceCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeAppInstanceCommand.ts rename to clients/client-chime/src/commands/DescribeAppInstanceCommand.ts diff --git a/clients/client-chime/commands/DescribeAppInstanceUserCommand.ts b/clients/client-chime/src/commands/DescribeAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/DescribeAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelBanCommand.ts b/clients/client-chime/src/commands/DescribeChannelBanCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelBanCommand.ts rename to clients/client-chime/src/commands/DescribeChannelBanCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelCommand.ts b/clients/client-chime/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelCommand.ts rename to clients/client-chime/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelMembershipCommand.ts b/clients/client-chime/src/commands/DescribeChannelMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelMembershipCommand.ts rename to clients/client-chime/src/commands/DescribeChannelMembershipCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts b/clients/client-chime/src/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/DescribeChannelMembershipForAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts b/clients/client-chime/src/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/DescribeChannelModeratedByAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/DescribeChannelModeratorCommand.ts b/clients/client-chime/src/commands/DescribeChannelModeratorCommand.ts similarity index 100% rename from clients/client-chime/commands/DescribeChannelModeratorCommand.ts rename to clients/client-chime/src/commands/DescribeChannelModeratorCommand.ts diff --git a/clients/client-chime/commands/DisassociatePhoneNumberFromUserCommand.ts b/clients/client-chime/src/commands/DisassociatePhoneNumberFromUserCommand.ts similarity index 100% rename from clients/client-chime/commands/DisassociatePhoneNumberFromUserCommand.ts rename to clients/client-chime/src/commands/DisassociatePhoneNumberFromUserCommand.ts diff --git a/clients/client-chime/commands/DisassociatePhoneNumbersFromVoiceConnectorCommand.ts b/clients/client-chime/src/commands/DisassociatePhoneNumbersFromVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/DisassociatePhoneNumbersFromVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/DisassociatePhoneNumbersFromVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/DisassociatePhoneNumbersFromVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/DisassociatePhoneNumbersFromVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/DisassociatePhoneNumbersFromVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/DisassociatePhoneNumbersFromVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/commands/DisassociateSigninDelegateGroupsFromAccountCommand.ts b/clients/client-chime/src/commands/DisassociateSigninDelegateGroupsFromAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/DisassociateSigninDelegateGroupsFromAccountCommand.ts rename to clients/client-chime/src/commands/DisassociateSigninDelegateGroupsFromAccountCommand.ts diff --git a/clients/client-chime/commands/GetAccountCommand.ts b/clients/client-chime/src/commands/GetAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/GetAccountCommand.ts rename to clients/client-chime/src/commands/GetAccountCommand.ts diff --git a/clients/client-chime/commands/GetAccountSettingsCommand.ts b/clients/client-chime/src/commands/GetAccountSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetAccountSettingsCommand.ts rename to clients/client-chime/src/commands/GetAccountSettingsCommand.ts diff --git a/clients/client-chime/commands/GetAppInstanceRetentionSettingsCommand.ts b/clients/client-chime/src/commands/GetAppInstanceRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetAppInstanceRetentionSettingsCommand.ts rename to clients/client-chime/src/commands/GetAppInstanceRetentionSettingsCommand.ts diff --git a/clients/client-chime/commands/GetAppInstanceStreamingConfigurationsCommand.ts b/clients/client-chime/src/commands/GetAppInstanceStreamingConfigurationsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetAppInstanceStreamingConfigurationsCommand.ts rename to clients/client-chime/src/commands/GetAppInstanceStreamingConfigurationsCommand.ts diff --git a/clients/client-chime/commands/GetAttendeeCommand.ts b/clients/client-chime/src/commands/GetAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/GetAttendeeCommand.ts rename to clients/client-chime/src/commands/GetAttendeeCommand.ts diff --git a/clients/client-chime/commands/GetBotCommand.ts b/clients/client-chime/src/commands/GetBotCommand.ts similarity index 100% rename from clients/client-chime/commands/GetBotCommand.ts rename to clients/client-chime/src/commands/GetBotCommand.ts diff --git a/clients/client-chime/commands/GetChannelMessageCommand.ts b/clients/client-chime/src/commands/GetChannelMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/GetChannelMessageCommand.ts rename to clients/client-chime/src/commands/GetChannelMessageCommand.ts diff --git a/clients/client-chime/commands/GetEventsConfigurationCommand.ts b/clients/client-chime/src/commands/GetEventsConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetEventsConfigurationCommand.ts rename to clients/client-chime/src/commands/GetEventsConfigurationCommand.ts diff --git a/clients/client-chime/commands/GetGlobalSettingsCommand.ts b/clients/client-chime/src/commands/GetGlobalSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetGlobalSettingsCommand.ts rename to clients/client-chime/src/commands/GetGlobalSettingsCommand.ts diff --git a/clients/client-chime/commands/GetMediaCapturePipelineCommand.ts b/clients/client-chime/src/commands/GetMediaCapturePipelineCommand.ts similarity index 100% rename from clients/client-chime/commands/GetMediaCapturePipelineCommand.ts rename to clients/client-chime/src/commands/GetMediaCapturePipelineCommand.ts diff --git a/clients/client-chime/commands/GetMeetingCommand.ts b/clients/client-chime/src/commands/GetMeetingCommand.ts similarity index 100% rename from clients/client-chime/commands/GetMeetingCommand.ts rename to clients/client-chime/src/commands/GetMeetingCommand.ts diff --git a/clients/client-chime/commands/GetMessagingSessionEndpointCommand.ts b/clients/client-chime/src/commands/GetMessagingSessionEndpointCommand.ts similarity index 100% rename from clients/client-chime/commands/GetMessagingSessionEndpointCommand.ts rename to clients/client-chime/src/commands/GetMessagingSessionEndpointCommand.ts diff --git a/clients/client-chime/commands/GetPhoneNumberCommand.ts b/clients/client-chime/src/commands/GetPhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/GetPhoneNumberCommand.ts rename to clients/client-chime/src/commands/GetPhoneNumberCommand.ts diff --git a/clients/client-chime/commands/GetPhoneNumberOrderCommand.ts b/clients/client-chime/src/commands/GetPhoneNumberOrderCommand.ts similarity index 100% rename from clients/client-chime/commands/GetPhoneNumberOrderCommand.ts rename to clients/client-chime/src/commands/GetPhoneNumberOrderCommand.ts diff --git a/clients/client-chime/commands/GetPhoneNumberSettingsCommand.ts b/clients/client-chime/src/commands/GetPhoneNumberSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetPhoneNumberSettingsCommand.ts rename to clients/client-chime/src/commands/GetPhoneNumberSettingsCommand.ts diff --git a/clients/client-chime/commands/GetProxySessionCommand.ts b/clients/client-chime/src/commands/GetProxySessionCommand.ts similarity index 100% rename from clients/client-chime/commands/GetProxySessionCommand.ts rename to clients/client-chime/src/commands/GetProxySessionCommand.ts diff --git a/clients/client-chime/commands/GetRetentionSettingsCommand.ts b/clients/client-chime/src/commands/GetRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetRetentionSettingsCommand.ts rename to clients/client-chime/src/commands/GetRetentionSettingsCommand.ts diff --git a/clients/client-chime/commands/GetRoomCommand.ts b/clients/client-chime/src/commands/GetRoomCommand.ts similarity index 100% rename from clients/client-chime/commands/GetRoomCommand.ts rename to clients/client-chime/src/commands/GetRoomCommand.ts diff --git a/clients/client-chime/commands/GetSipMediaApplicationCommand.ts b/clients/client-chime/src/commands/GetSipMediaApplicationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetSipMediaApplicationCommand.ts rename to clients/client-chime/src/commands/GetSipMediaApplicationCommand.ts diff --git a/clients/client-chime/commands/GetSipMediaApplicationLoggingConfigurationCommand.ts b/clients/client-chime/src/commands/GetSipMediaApplicationLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetSipMediaApplicationLoggingConfigurationCommand.ts rename to clients/client-chime/src/commands/GetSipMediaApplicationLoggingConfigurationCommand.ts diff --git a/clients/client-chime/commands/GetSipRuleCommand.ts b/clients/client-chime/src/commands/GetSipRuleCommand.ts similarity index 100% rename from clients/client-chime/commands/GetSipRuleCommand.ts rename to clients/client-chime/src/commands/GetSipRuleCommand.ts diff --git a/clients/client-chime/commands/GetUserCommand.ts b/clients/client-chime/src/commands/GetUserCommand.ts similarity index 100% rename from clients/client-chime/commands/GetUserCommand.ts rename to clients/client-chime/src/commands/GetUserCommand.ts diff --git a/clients/client-chime/commands/GetUserSettingsCommand.ts b/clients/client-chime/src/commands/GetUserSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/GetUserSettingsCommand.ts rename to clients/client-chime/src/commands/GetUserSettingsCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorEmergencyCallingConfigurationCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorEmergencyCallingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorEmergencyCallingConfigurationCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorEmergencyCallingConfigurationCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorLoggingConfigurationCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorLoggingConfigurationCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorLoggingConfigurationCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorOriginationCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorOriginationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorOriginationCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorOriginationCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorProxyCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorProxyCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorProxyCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorProxyCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorStreamingConfigurationCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorStreamingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorStreamingConfigurationCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorStreamingConfigurationCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorTerminationCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorTerminationCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorTerminationCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorTerminationCommand.ts diff --git a/clients/client-chime/commands/GetVoiceConnectorTerminationHealthCommand.ts b/clients/client-chime/src/commands/GetVoiceConnectorTerminationHealthCommand.ts similarity index 100% rename from clients/client-chime/commands/GetVoiceConnectorTerminationHealthCommand.ts rename to clients/client-chime/src/commands/GetVoiceConnectorTerminationHealthCommand.ts diff --git a/clients/client-chime/commands/InviteUsersCommand.ts b/clients/client-chime/src/commands/InviteUsersCommand.ts similarity index 100% rename from clients/client-chime/commands/InviteUsersCommand.ts rename to clients/client-chime/src/commands/InviteUsersCommand.ts diff --git a/clients/client-chime/commands/ListAccountsCommand.ts b/clients/client-chime/src/commands/ListAccountsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAccountsCommand.ts rename to clients/client-chime/src/commands/ListAccountsCommand.ts diff --git a/clients/client-chime/commands/ListAppInstanceAdminsCommand.ts b/clients/client-chime/src/commands/ListAppInstanceAdminsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAppInstanceAdminsCommand.ts rename to clients/client-chime/src/commands/ListAppInstanceAdminsCommand.ts diff --git a/clients/client-chime/commands/ListAppInstanceUsersCommand.ts b/clients/client-chime/src/commands/ListAppInstanceUsersCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAppInstanceUsersCommand.ts rename to clients/client-chime/src/commands/ListAppInstanceUsersCommand.ts diff --git a/clients/client-chime/commands/ListAppInstancesCommand.ts b/clients/client-chime/src/commands/ListAppInstancesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAppInstancesCommand.ts rename to clients/client-chime/src/commands/ListAppInstancesCommand.ts diff --git a/clients/client-chime/commands/ListAttendeeTagsCommand.ts b/clients/client-chime/src/commands/ListAttendeeTagsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAttendeeTagsCommand.ts rename to clients/client-chime/src/commands/ListAttendeeTagsCommand.ts diff --git a/clients/client-chime/commands/ListAttendeesCommand.ts b/clients/client-chime/src/commands/ListAttendeesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListAttendeesCommand.ts rename to clients/client-chime/src/commands/ListAttendeesCommand.ts diff --git a/clients/client-chime/commands/ListBotsCommand.ts b/clients/client-chime/src/commands/ListBotsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListBotsCommand.ts rename to clients/client-chime/src/commands/ListBotsCommand.ts diff --git a/clients/client-chime/commands/ListChannelBansCommand.ts b/clients/client-chime/src/commands/ListChannelBansCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelBansCommand.ts rename to clients/client-chime/src/commands/ListChannelBansCommand.ts diff --git a/clients/client-chime/commands/ListChannelMembershipsCommand.ts b/clients/client-chime/src/commands/ListChannelMembershipsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelMembershipsCommand.ts rename to clients/client-chime/src/commands/ListChannelMembershipsCommand.ts diff --git a/clients/client-chime/commands/ListChannelMembershipsForAppInstanceUserCommand.ts b/clients/client-chime/src/commands/ListChannelMembershipsForAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelMembershipsForAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/ListChannelMembershipsForAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/ListChannelMessagesCommand.ts b/clients/client-chime/src/commands/ListChannelMessagesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelMessagesCommand.ts rename to clients/client-chime/src/commands/ListChannelMessagesCommand.ts diff --git a/clients/client-chime/commands/ListChannelModeratorsCommand.ts b/clients/client-chime/src/commands/ListChannelModeratorsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelModeratorsCommand.ts rename to clients/client-chime/src/commands/ListChannelModeratorsCommand.ts diff --git a/clients/client-chime/commands/ListChannelsCommand.ts b/clients/client-chime/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelsCommand.ts rename to clients/client-chime/src/commands/ListChannelsCommand.ts diff --git a/clients/client-chime/commands/ListChannelsModeratedByAppInstanceUserCommand.ts b/clients/client-chime/src/commands/ListChannelsModeratedByAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/ListChannelsModeratedByAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/ListChannelsModeratedByAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/ListMediaCapturePipelinesCommand.ts b/clients/client-chime/src/commands/ListMediaCapturePipelinesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListMediaCapturePipelinesCommand.ts rename to clients/client-chime/src/commands/ListMediaCapturePipelinesCommand.ts diff --git a/clients/client-chime/commands/ListMeetingTagsCommand.ts b/clients/client-chime/src/commands/ListMeetingTagsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListMeetingTagsCommand.ts rename to clients/client-chime/src/commands/ListMeetingTagsCommand.ts diff --git a/clients/client-chime/commands/ListMeetingsCommand.ts b/clients/client-chime/src/commands/ListMeetingsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListMeetingsCommand.ts rename to clients/client-chime/src/commands/ListMeetingsCommand.ts diff --git a/clients/client-chime/commands/ListPhoneNumberOrdersCommand.ts b/clients/client-chime/src/commands/ListPhoneNumberOrdersCommand.ts similarity index 100% rename from clients/client-chime/commands/ListPhoneNumberOrdersCommand.ts rename to clients/client-chime/src/commands/ListPhoneNumberOrdersCommand.ts diff --git a/clients/client-chime/commands/ListPhoneNumbersCommand.ts b/clients/client-chime/src/commands/ListPhoneNumbersCommand.ts similarity index 100% rename from clients/client-chime/commands/ListPhoneNumbersCommand.ts rename to clients/client-chime/src/commands/ListPhoneNumbersCommand.ts diff --git a/clients/client-chime/commands/ListProxySessionsCommand.ts b/clients/client-chime/src/commands/ListProxySessionsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListProxySessionsCommand.ts rename to clients/client-chime/src/commands/ListProxySessionsCommand.ts diff --git a/clients/client-chime/commands/ListRoomMembershipsCommand.ts b/clients/client-chime/src/commands/ListRoomMembershipsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListRoomMembershipsCommand.ts rename to clients/client-chime/src/commands/ListRoomMembershipsCommand.ts diff --git a/clients/client-chime/commands/ListRoomsCommand.ts b/clients/client-chime/src/commands/ListRoomsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListRoomsCommand.ts rename to clients/client-chime/src/commands/ListRoomsCommand.ts diff --git a/clients/client-chime/commands/ListSipMediaApplicationsCommand.ts b/clients/client-chime/src/commands/ListSipMediaApplicationsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListSipMediaApplicationsCommand.ts rename to clients/client-chime/src/commands/ListSipMediaApplicationsCommand.ts diff --git a/clients/client-chime/commands/ListSipRulesCommand.ts b/clients/client-chime/src/commands/ListSipRulesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListSipRulesCommand.ts rename to clients/client-chime/src/commands/ListSipRulesCommand.ts diff --git a/clients/client-chime/commands/ListSupportedPhoneNumberCountriesCommand.ts b/clients/client-chime/src/commands/ListSupportedPhoneNumberCountriesCommand.ts similarity index 100% rename from clients/client-chime/commands/ListSupportedPhoneNumberCountriesCommand.ts rename to clients/client-chime/src/commands/ListSupportedPhoneNumberCountriesCommand.ts diff --git a/clients/client-chime/commands/ListTagsForResourceCommand.ts b/clients/client-chime/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-chime/commands/ListTagsForResourceCommand.ts rename to clients/client-chime/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-chime/commands/ListUsersCommand.ts b/clients/client-chime/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-chime/commands/ListUsersCommand.ts rename to clients/client-chime/src/commands/ListUsersCommand.ts diff --git a/clients/client-chime/commands/ListVoiceConnectorGroupsCommand.ts b/clients/client-chime/src/commands/ListVoiceConnectorGroupsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListVoiceConnectorGroupsCommand.ts rename to clients/client-chime/src/commands/ListVoiceConnectorGroupsCommand.ts diff --git a/clients/client-chime/commands/ListVoiceConnectorTerminationCredentialsCommand.ts b/clients/client-chime/src/commands/ListVoiceConnectorTerminationCredentialsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListVoiceConnectorTerminationCredentialsCommand.ts rename to clients/client-chime/src/commands/ListVoiceConnectorTerminationCredentialsCommand.ts diff --git a/clients/client-chime/commands/ListVoiceConnectorsCommand.ts b/clients/client-chime/src/commands/ListVoiceConnectorsCommand.ts similarity index 100% rename from clients/client-chime/commands/ListVoiceConnectorsCommand.ts rename to clients/client-chime/src/commands/ListVoiceConnectorsCommand.ts diff --git a/clients/client-chime/commands/LogoutUserCommand.ts b/clients/client-chime/src/commands/LogoutUserCommand.ts similarity index 100% rename from clients/client-chime/commands/LogoutUserCommand.ts rename to clients/client-chime/src/commands/LogoutUserCommand.ts diff --git a/clients/client-chime/commands/PutAppInstanceRetentionSettingsCommand.ts b/clients/client-chime/src/commands/PutAppInstanceRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/PutAppInstanceRetentionSettingsCommand.ts rename to clients/client-chime/src/commands/PutAppInstanceRetentionSettingsCommand.ts diff --git a/clients/client-chime/commands/PutAppInstanceStreamingConfigurationsCommand.ts b/clients/client-chime/src/commands/PutAppInstanceStreamingConfigurationsCommand.ts similarity index 100% rename from clients/client-chime/commands/PutAppInstanceStreamingConfigurationsCommand.ts rename to clients/client-chime/src/commands/PutAppInstanceStreamingConfigurationsCommand.ts diff --git a/clients/client-chime/commands/PutEventsConfigurationCommand.ts b/clients/client-chime/src/commands/PutEventsConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutEventsConfigurationCommand.ts rename to clients/client-chime/src/commands/PutEventsConfigurationCommand.ts diff --git a/clients/client-chime/commands/PutRetentionSettingsCommand.ts b/clients/client-chime/src/commands/PutRetentionSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/PutRetentionSettingsCommand.ts rename to clients/client-chime/src/commands/PutRetentionSettingsCommand.ts diff --git a/clients/client-chime/commands/PutSipMediaApplicationLoggingConfigurationCommand.ts b/clients/client-chime/src/commands/PutSipMediaApplicationLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutSipMediaApplicationLoggingConfigurationCommand.ts rename to clients/client-chime/src/commands/PutSipMediaApplicationLoggingConfigurationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorEmergencyCallingConfigurationCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorEmergencyCallingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorEmergencyCallingConfigurationCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorEmergencyCallingConfigurationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorLoggingConfigurationCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorLoggingConfigurationCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorLoggingConfigurationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorOriginationCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorOriginationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorOriginationCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorOriginationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorProxyCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorProxyCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorProxyCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorProxyCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorStreamingConfigurationCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorStreamingConfigurationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorStreamingConfigurationCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorStreamingConfigurationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorTerminationCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorTerminationCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorTerminationCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorTerminationCommand.ts diff --git a/clients/client-chime/commands/PutVoiceConnectorTerminationCredentialsCommand.ts b/clients/client-chime/src/commands/PutVoiceConnectorTerminationCredentialsCommand.ts similarity index 100% rename from clients/client-chime/commands/PutVoiceConnectorTerminationCredentialsCommand.ts rename to clients/client-chime/src/commands/PutVoiceConnectorTerminationCredentialsCommand.ts diff --git a/clients/client-chime/commands/RedactChannelMessageCommand.ts b/clients/client-chime/src/commands/RedactChannelMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/RedactChannelMessageCommand.ts rename to clients/client-chime/src/commands/RedactChannelMessageCommand.ts diff --git a/clients/client-chime/commands/RedactConversationMessageCommand.ts b/clients/client-chime/src/commands/RedactConversationMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/RedactConversationMessageCommand.ts rename to clients/client-chime/src/commands/RedactConversationMessageCommand.ts diff --git a/clients/client-chime/commands/RedactRoomMessageCommand.ts b/clients/client-chime/src/commands/RedactRoomMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/RedactRoomMessageCommand.ts rename to clients/client-chime/src/commands/RedactRoomMessageCommand.ts diff --git a/clients/client-chime/commands/RegenerateSecurityTokenCommand.ts b/clients/client-chime/src/commands/RegenerateSecurityTokenCommand.ts similarity index 100% rename from clients/client-chime/commands/RegenerateSecurityTokenCommand.ts rename to clients/client-chime/src/commands/RegenerateSecurityTokenCommand.ts diff --git a/clients/client-chime/commands/ResetPersonalPINCommand.ts b/clients/client-chime/src/commands/ResetPersonalPINCommand.ts similarity index 100% rename from clients/client-chime/commands/ResetPersonalPINCommand.ts rename to clients/client-chime/src/commands/ResetPersonalPINCommand.ts diff --git a/clients/client-chime/commands/RestorePhoneNumberCommand.ts b/clients/client-chime/src/commands/RestorePhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/RestorePhoneNumberCommand.ts rename to clients/client-chime/src/commands/RestorePhoneNumberCommand.ts diff --git a/clients/client-chime/commands/SearchAvailablePhoneNumbersCommand.ts b/clients/client-chime/src/commands/SearchAvailablePhoneNumbersCommand.ts similarity index 100% rename from clients/client-chime/commands/SearchAvailablePhoneNumbersCommand.ts rename to clients/client-chime/src/commands/SearchAvailablePhoneNumbersCommand.ts diff --git a/clients/client-chime/commands/SendChannelMessageCommand.ts b/clients/client-chime/src/commands/SendChannelMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/SendChannelMessageCommand.ts rename to clients/client-chime/src/commands/SendChannelMessageCommand.ts diff --git a/clients/client-chime/commands/StartMeetingTranscriptionCommand.ts b/clients/client-chime/src/commands/StartMeetingTranscriptionCommand.ts similarity index 100% rename from clients/client-chime/commands/StartMeetingTranscriptionCommand.ts rename to clients/client-chime/src/commands/StartMeetingTranscriptionCommand.ts diff --git a/clients/client-chime/commands/StopMeetingTranscriptionCommand.ts b/clients/client-chime/src/commands/StopMeetingTranscriptionCommand.ts similarity index 100% rename from clients/client-chime/commands/StopMeetingTranscriptionCommand.ts rename to clients/client-chime/src/commands/StopMeetingTranscriptionCommand.ts diff --git a/clients/client-chime/commands/TagAttendeeCommand.ts b/clients/client-chime/src/commands/TagAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/TagAttendeeCommand.ts rename to clients/client-chime/src/commands/TagAttendeeCommand.ts diff --git a/clients/client-chime/commands/TagMeetingCommand.ts b/clients/client-chime/src/commands/TagMeetingCommand.ts similarity index 100% rename from clients/client-chime/commands/TagMeetingCommand.ts rename to clients/client-chime/src/commands/TagMeetingCommand.ts diff --git a/clients/client-chime/commands/TagResourceCommand.ts b/clients/client-chime/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-chime/commands/TagResourceCommand.ts rename to clients/client-chime/src/commands/TagResourceCommand.ts diff --git a/clients/client-chime/commands/UntagAttendeeCommand.ts b/clients/client-chime/src/commands/UntagAttendeeCommand.ts similarity index 100% rename from clients/client-chime/commands/UntagAttendeeCommand.ts rename to clients/client-chime/src/commands/UntagAttendeeCommand.ts diff --git a/clients/client-chime/commands/UntagMeetingCommand.ts b/clients/client-chime/src/commands/UntagMeetingCommand.ts similarity index 100% rename from clients/client-chime/commands/UntagMeetingCommand.ts rename to clients/client-chime/src/commands/UntagMeetingCommand.ts diff --git a/clients/client-chime/commands/UntagResourceCommand.ts b/clients/client-chime/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-chime/commands/UntagResourceCommand.ts rename to clients/client-chime/src/commands/UntagResourceCommand.ts diff --git a/clients/client-chime/commands/UpdateAccountCommand.ts b/clients/client-chime/src/commands/UpdateAccountCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateAccountCommand.ts rename to clients/client-chime/src/commands/UpdateAccountCommand.ts diff --git a/clients/client-chime/commands/UpdateAccountSettingsCommand.ts b/clients/client-chime/src/commands/UpdateAccountSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateAccountSettingsCommand.ts rename to clients/client-chime/src/commands/UpdateAccountSettingsCommand.ts diff --git a/clients/client-chime/commands/UpdateAppInstanceCommand.ts b/clients/client-chime/src/commands/UpdateAppInstanceCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateAppInstanceCommand.ts rename to clients/client-chime/src/commands/UpdateAppInstanceCommand.ts diff --git a/clients/client-chime/commands/UpdateAppInstanceUserCommand.ts b/clients/client-chime/src/commands/UpdateAppInstanceUserCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateAppInstanceUserCommand.ts rename to clients/client-chime/src/commands/UpdateAppInstanceUserCommand.ts diff --git a/clients/client-chime/commands/UpdateBotCommand.ts b/clients/client-chime/src/commands/UpdateBotCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateBotCommand.ts rename to clients/client-chime/src/commands/UpdateBotCommand.ts diff --git a/clients/client-chime/commands/UpdateChannelCommand.ts b/clients/client-chime/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateChannelCommand.ts rename to clients/client-chime/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-chime/commands/UpdateChannelMessageCommand.ts b/clients/client-chime/src/commands/UpdateChannelMessageCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateChannelMessageCommand.ts rename to clients/client-chime/src/commands/UpdateChannelMessageCommand.ts diff --git a/clients/client-chime/commands/UpdateChannelReadMarkerCommand.ts b/clients/client-chime/src/commands/UpdateChannelReadMarkerCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateChannelReadMarkerCommand.ts rename to clients/client-chime/src/commands/UpdateChannelReadMarkerCommand.ts diff --git a/clients/client-chime/commands/UpdateGlobalSettingsCommand.ts b/clients/client-chime/src/commands/UpdateGlobalSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateGlobalSettingsCommand.ts rename to clients/client-chime/src/commands/UpdateGlobalSettingsCommand.ts diff --git a/clients/client-chime/commands/UpdatePhoneNumberCommand.ts b/clients/client-chime/src/commands/UpdatePhoneNumberCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdatePhoneNumberCommand.ts rename to clients/client-chime/src/commands/UpdatePhoneNumberCommand.ts diff --git a/clients/client-chime/commands/UpdatePhoneNumberSettingsCommand.ts b/clients/client-chime/src/commands/UpdatePhoneNumberSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdatePhoneNumberSettingsCommand.ts rename to clients/client-chime/src/commands/UpdatePhoneNumberSettingsCommand.ts diff --git a/clients/client-chime/commands/UpdateProxySessionCommand.ts b/clients/client-chime/src/commands/UpdateProxySessionCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateProxySessionCommand.ts rename to clients/client-chime/src/commands/UpdateProxySessionCommand.ts diff --git a/clients/client-chime/commands/UpdateRoomCommand.ts b/clients/client-chime/src/commands/UpdateRoomCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateRoomCommand.ts rename to clients/client-chime/src/commands/UpdateRoomCommand.ts diff --git a/clients/client-chime/commands/UpdateRoomMembershipCommand.ts b/clients/client-chime/src/commands/UpdateRoomMembershipCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateRoomMembershipCommand.ts rename to clients/client-chime/src/commands/UpdateRoomMembershipCommand.ts diff --git a/clients/client-chime/commands/UpdateSipMediaApplicationCallCommand.ts b/clients/client-chime/src/commands/UpdateSipMediaApplicationCallCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateSipMediaApplicationCallCommand.ts rename to clients/client-chime/src/commands/UpdateSipMediaApplicationCallCommand.ts diff --git a/clients/client-chime/commands/UpdateSipMediaApplicationCommand.ts b/clients/client-chime/src/commands/UpdateSipMediaApplicationCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateSipMediaApplicationCommand.ts rename to clients/client-chime/src/commands/UpdateSipMediaApplicationCommand.ts diff --git a/clients/client-chime/commands/UpdateSipRuleCommand.ts b/clients/client-chime/src/commands/UpdateSipRuleCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateSipRuleCommand.ts rename to clients/client-chime/src/commands/UpdateSipRuleCommand.ts diff --git a/clients/client-chime/commands/UpdateUserCommand.ts b/clients/client-chime/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateUserCommand.ts rename to clients/client-chime/src/commands/UpdateUserCommand.ts diff --git a/clients/client-chime/commands/UpdateUserSettingsCommand.ts b/clients/client-chime/src/commands/UpdateUserSettingsCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateUserSettingsCommand.ts rename to clients/client-chime/src/commands/UpdateUserSettingsCommand.ts diff --git a/clients/client-chime/commands/UpdateVoiceConnectorCommand.ts b/clients/client-chime/src/commands/UpdateVoiceConnectorCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateVoiceConnectorCommand.ts rename to clients/client-chime/src/commands/UpdateVoiceConnectorCommand.ts diff --git a/clients/client-chime/commands/UpdateVoiceConnectorGroupCommand.ts b/clients/client-chime/src/commands/UpdateVoiceConnectorGroupCommand.ts similarity index 100% rename from clients/client-chime/commands/UpdateVoiceConnectorGroupCommand.ts rename to clients/client-chime/src/commands/UpdateVoiceConnectorGroupCommand.ts diff --git a/clients/client-chime/endpoints.ts b/clients/client-chime/src/endpoints.ts similarity index 100% rename from clients/client-chime/endpoints.ts rename to clients/client-chime/src/endpoints.ts diff --git a/clients/client-chime/index.ts b/clients/client-chime/src/index.ts similarity index 100% rename from clients/client-chime/index.ts rename to clients/client-chime/src/index.ts diff --git a/clients/client-chime/models/index.ts b/clients/client-chime/src/models/index.ts similarity index 100% rename from clients/client-chime/models/index.ts rename to clients/client-chime/src/models/index.ts diff --git a/clients/client-chime/models/models_0.ts b/clients/client-chime/src/models/models_0.ts similarity index 100% rename from clients/client-chime/models/models_0.ts rename to clients/client-chime/src/models/models_0.ts diff --git a/clients/client-chime/models/models_1.ts b/clients/client-chime/src/models/models_1.ts similarity index 100% rename from clients/client-chime/models/models_1.ts rename to clients/client-chime/src/models/models_1.ts diff --git a/clients/client-chime/pagination/Interfaces.ts b/clients/client-chime/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-chime/pagination/Interfaces.ts rename to clients/client-chime/src/pagination/Interfaces.ts diff --git a/clients/client-chime/pagination/ListAccountsPaginator.ts b/clients/client-chime/src/pagination/ListAccountsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListAccountsPaginator.ts rename to clients/client-chime/src/pagination/ListAccountsPaginator.ts diff --git a/clients/client-chime/pagination/ListAppInstanceAdminsPaginator.ts b/clients/client-chime/src/pagination/ListAppInstanceAdminsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListAppInstanceAdminsPaginator.ts rename to clients/client-chime/src/pagination/ListAppInstanceAdminsPaginator.ts diff --git a/clients/client-chime/pagination/ListAppInstanceUsersPaginator.ts b/clients/client-chime/src/pagination/ListAppInstanceUsersPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListAppInstanceUsersPaginator.ts rename to clients/client-chime/src/pagination/ListAppInstanceUsersPaginator.ts diff --git a/clients/client-chime/pagination/ListAppInstancesPaginator.ts b/clients/client-chime/src/pagination/ListAppInstancesPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListAppInstancesPaginator.ts rename to clients/client-chime/src/pagination/ListAppInstancesPaginator.ts diff --git a/clients/client-chime/pagination/ListAttendeesPaginator.ts b/clients/client-chime/src/pagination/ListAttendeesPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListAttendeesPaginator.ts rename to clients/client-chime/src/pagination/ListAttendeesPaginator.ts diff --git a/clients/client-chime/pagination/ListBotsPaginator.ts b/clients/client-chime/src/pagination/ListBotsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListBotsPaginator.ts rename to clients/client-chime/src/pagination/ListBotsPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelBansPaginator.ts b/clients/client-chime/src/pagination/ListChannelBansPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelBansPaginator.ts rename to clients/client-chime/src/pagination/ListChannelBansPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts b/clients/client-chime/src/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts rename to clients/client-chime/src/pagination/ListChannelMembershipsForAppInstanceUserPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelMembershipsPaginator.ts b/clients/client-chime/src/pagination/ListChannelMembershipsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelMembershipsPaginator.ts rename to clients/client-chime/src/pagination/ListChannelMembershipsPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelMessagesPaginator.ts b/clients/client-chime/src/pagination/ListChannelMessagesPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelMessagesPaginator.ts rename to clients/client-chime/src/pagination/ListChannelMessagesPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelModeratorsPaginator.ts b/clients/client-chime/src/pagination/ListChannelModeratorsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelModeratorsPaginator.ts rename to clients/client-chime/src/pagination/ListChannelModeratorsPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts b/clients/client-chime/src/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts rename to clients/client-chime/src/pagination/ListChannelsModeratedByAppInstanceUserPaginator.ts diff --git a/clients/client-chime/pagination/ListChannelsPaginator.ts b/clients/client-chime/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListChannelsPaginator.ts rename to clients/client-chime/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-chime/pagination/ListMediaCapturePipelinesPaginator.ts b/clients/client-chime/src/pagination/ListMediaCapturePipelinesPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListMediaCapturePipelinesPaginator.ts rename to clients/client-chime/src/pagination/ListMediaCapturePipelinesPaginator.ts diff --git a/clients/client-chime/pagination/ListMeetingsPaginator.ts b/clients/client-chime/src/pagination/ListMeetingsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListMeetingsPaginator.ts rename to clients/client-chime/src/pagination/ListMeetingsPaginator.ts diff --git a/clients/client-chime/pagination/ListPhoneNumberOrdersPaginator.ts b/clients/client-chime/src/pagination/ListPhoneNumberOrdersPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListPhoneNumberOrdersPaginator.ts rename to clients/client-chime/src/pagination/ListPhoneNumberOrdersPaginator.ts diff --git a/clients/client-chime/pagination/ListPhoneNumbersPaginator.ts b/clients/client-chime/src/pagination/ListPhoneNumbersPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListPhoneNumbersPaginator.ts rename to clients/client-chime/src/pagination/ListPhoneNumbersPaginator.ts diff --git a/clients/client-chime/pagination/ListProxySessionsPaginator.ts b/clients/client-chime/src/pagination/ListProxySessionsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListProxySessionsPaginator.ts rename to clients/client-chime/src/pagination/ListProxySessionsPaginator.ts diff --git a/clients/client-chime/pagination/ListRoomMembershipsPaginator.ts b/clients/client-chime/src/pagination/ListRoomMembershipsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListRoomMembershipsPaginator.ts rename to clients/client-chime/src/pagination/ListRoomMembershipsPaginator.ts diff --git a/clients/client-chime/pagination/ListRoomsPaginator.ts b/clients/client-chime/src/pagination/ListRoomsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListRoomsPaginator.ts rename to clients/client-chime/src/pagination/ListRoomsPaginator.ts diff --git a/clients/client-chime/pagination/ListSipMediaApplicationsPaginator.ts b/clients/client-chime/src/pagination/ListSipMediaApplicationsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListSipMediaApplicationsPaginator.ts rename to clients/client-chime/src/pagination/ListSipMediaApplicationsPaginator.ts diff --git a/clients/client-chime/pagination/ListSipRulesPaginator.ts b/clients/client-chime/src/pagination/ListSipRulesPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListSipRulesPaginator.ts rename to clients/client-chime/src/pagination/ListSipRulesPaginator.ts diff --git a/clients/client-chime/pagination/ListUsersPaginator.ts b/clients/client-chime/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListUsersPaginator.ts rename to clients/client-chime/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-chime/pagination/ListVoiceConnectorGroupsPaginator.ts b/clients/client-chime/src/pagination/ListVoiceConnectorGroupsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListVoiceConnectorGroupsPaginator.ts rename to clients/client-chime/src/pagination/ListVoiceConnectorGroupsPaginator.ts diff --git a/clients/client-chime/pagination/ListVoiceConnectorsPaginator.ts b/clients/client-chime/src/pagination/ListVoiceConnectorsPaginator.ts similarity index 100% rename from clients/client-chime/pagination/ListVoiceConnectorsPaginator.ts rename to clients/client-chime/src/pagination/ListVoiceConnectorsPaginator.ts diff --git a/clients/client-chime/pagination/SearchAvailablePhoneNumbersPaginator.ts b/clients/client-chime/src/pagination/SearchAvailablePhoneNumbersPaginator.ts similarity index 100% rename from clients/client-chime/pagination/SearchAvailablePhoneNumbersPaginator.ts rename to clients/client-chime/src/pagination/SearchAvailablePhoneNumbersPaginator.ts diff --git a/clients/client-chime/protocols/Aws_restJson1.ts b/clients/client-chime/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-chime/protocols/Aws_restJson1.ts rename to clients/client-chime/src/protocols/Aws_restJson1.ts diff --git a/clients/client-chime/src/runtimeConfig.browser.ts b/clients/client-chime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2f5314f8b03e --- /dev/null +++ b/clients/client-chime/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ChimeClientConfig } from "./ChimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime/runtimeConfig.native.ts b/clients/client-chime/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-chime/runtimeConfig.native.ts rename to clients/client-chime/src/runtimeConfig.native.ts diff --git a/clients/client-chime/runtimeConfig.shared.ts b/clients/client-chime/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-chime/runtimeConfig.shared.ts rename to clients/client-chime/src/runtimeConfig.shared.ts diff --git a/clients/client-chime/src/runtimeConfig.ts b/clients/client-chime/src/runtimeConfig.ts new file mode 100644 index 000000000000..bfaee525420b --- /dev/null +++ b/clients/client-chime/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ChimeClientConfig } from "./ChimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ChimeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-chime/tsconfig.es.json b/clients/client-chime/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-chime/tsconfig.es.json +++ b/clients/client-chime/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-chime/tsconfig.json b/clients/client-chime/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-chime/tsconfig.json +++ b/clients/client-chime/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-chime/tsconfig.types.json b/clients/client-chime/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-chime/tsconfig.types.json +++ b/clients/client-chime/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloud9/.gitignore b/clients/client-cloud9/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloud9/.gitignore +++ b/clients/client-cloud9/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloud9/package.json b/clients/client-cloud9/package.json index 68e831b9befe..559cae7de0f4 100644 --- a/clients/client-cloud9/package.json +++ b/clients/client-cloud9/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloud9", "repository": { "type": "git", diff --git a/clients/client-cloud9/runtimeConfig.browser.ts b/clients/client-cloud9/runtimeConfig.browser.ts deleted file mode 100644 index 3b640d4e0730..000000000000 --- a/clients/client-cloud9/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Cloud9ClientConfig } from "./Cloud9Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Cloud9ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloud9/runtimeConfig.ts b/clients/client-cloud9/runtimeConfig.ts deleted file mode 100644 index bbe7c21d4b44..000000000000 --- a/clients/client-cloud9/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Cloud9ClientConfig } from "./Cloud9Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Cloud9ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloud9/Cloud9.ts b/clients/client-cloud9/src/Cloud9.ts similarity index 100% rename from clients/client-cloud9/Cloud9.ts rename to clients/client-cloud9/src/Cloud9.ts diff --git a/clients/client-cloud9/Cloud9Client.ts b/clients/client-cloud9/src/Cloud9Client.ts similarity index 100% rename from clients/client-cloud9/Cloud9Client.ts rename to clients/client-cloud9/src/Cloud9Client.ts diff --git a/clients/client-cloud9/commands/CreateEnvironmentEC2Command.ts b/clients/client-cloud9/src/commands/CreateEnvironmentEC2Command.ts similarity index 100% rename from clients/client-cloud9/commands/CreateEnvironmentEC2Command.ts rename to clients/client-cloud9/src/commands/CreateEnvironmentEC2Command.ts diff --git a/clients/client-cloud9/commands/CreateEnvironmentMembershipCommand.ts b/clients/client-cloud9/src/commands/CreateEnvironmentMembershipCommand.ts similarity index 100% rename from clients/client-cloud9/commands/CreateEnvironmentMembershipCommand.ts rename to clients/client-cloud9/src/commands/CreateEnvironmentMembershipCommand.ts diff --git a/clients/client-cloud9/commands/DeleteEnvironmentCommand.ts b/clients/client-cloud9/src/commands/DeleteEnvironmentCommand.ts similarity index 100% rename from clients/client-cloud9/commands/DeleteEnvironmentCommand.ts rename to clients/client-cloud9/src/commands/DeleteEnvironmentCommand.ts diff --git a/clients/client-cloud9/commands/DeleteEnvironmentMembershipCommand.ts b/clients/client-cloud9/src/commands/DeleteEnvironmentMembershipCommand.ts similarity index 100% rename from clients/client-cloud9/commands/DeleteEnvironmentMembershipCommand.ts rename to clients/client-cloud9/src/commands/DeleteEnvironmentMembershipCommand.ts diff --git a/clients/client-cloud9/commands/DescribeEnvironmentMembershipsCommand.ts b/clients/client-cloud9/src/commands/DescribeEnvironmentMembershipsCommand.ts similarity index 100% rename from clients/client-cloud9/commands/DescribeEnvironmentMembershipsCommand.ts rename to clients/client-cloud9/src/commands/DescribeEnvironmentMembershipsCommand.ts diff --git a/clients/client-cloud9/commands/DescribeEnvironmentStatusCommand.ts b/clients/client-cloud9/src/commands/DescribeEnvironmentStatusCommand.ts similarity index 100% rename from clients/client-cloud9/commands/DescribeEnvironmentStatusCommand.ts rename to clients/client-cloud9/src/commands/DescribeEnvironmentStatusCommand.ts diff --git a/clients/client-cloud9/commands/DescribeEnvironmentsCommand.ts b/clients/client-cloud9/src/commands/DescribeEnvironmentsCommand.ts similarity index 100% rename from clients/client-cloud9/commands/DescribeEnvironmentsCommand.ts rename to clients/client-cloud9/src/commands/DescribeEnvironmentsCommand.ts diff --git a/clients/client-cloud9/commands/ListEnvironmentsCommand.ts b/clients/client-cloud9/src/commands/ListEnvironmentsCommand.ts similarity index 100% rename from clients/client-cloud9/commands/ListEnvironmentsCommand.ts rename to clients/client-cloud9/src/commands/ListEnvironmentsCommand.ts diff --git a/clients/client-cloud9/commands/ListTagsForResourceCommand.ts b/clients/client-cloud9/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cloud9/commands/ListTagsForResourceCommand.ts rename to clients/client-cloud9/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cloud9/commands/TagResourceCommand.ts b/clients/client-cloud9/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cloud9/commands/TagResourceCommand.ts rename to clients/client-cloud9/src/commands/TagResourceCommand.ts diff --git a/clients/client-cloud9/commands/UntagResourceCommand.ts b/clients/client-cloud9/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cloud9/commands/UntagResourceCommand.ts rename to clients/client-cloud9/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cloud9/commands/UpdateEnvironmentCommand.ts b/clients/client-cloud9/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-cloud9/commands/UpdateEnvironmentCommand.ts rename to clients/client-cloud9/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-cloud9/commands/UpdateEnvironmentMembershipCommand.ts b/clients/client-cloud9/src/commands/UpdateEnvironmentMembershipCommand.ts similarity index 100% rename from clients/client-cloud9/commands/UpdateEnvironmentMembershipCommand.ts rename to clients/client-cloud9/src/commands/UpdateEnvironmentMembershipCommand.ts diff --git a/clients/client-cloud9/endpoints.ts b/clients/client-cloud9/src/endpoints.ts similarity index 100% rename from clients/client-cloud9/endpoints.ts rename to clients/client-cloud9/src/endpoints.ts diff --git a/clients/client-cloud9/index.ts b/clients/client-cloud9/src/index.ts similarity index 100% rename from clients/client-cloud9/index.ts rename to clients/client-cloud9/src/index.ts diff --git a/clients/client-cloud9/models/index.ts b/clients/client-cloud9/src/models/index.ts similarity index 100% rename from clients/client-cloud9/models/index.ts rename to clients/client-cloud9/src/models/index.ts diff --git a/clients/client-cloud9/models/models_0.ts b/clients/client-cloud9/src/models/models_0.ts similarity index 100% rename from clients/client-cloud9/models/models_0.ts rename to clients/client-cloud9/src/models/models_0.ts diff --git a/clients/client-cloud9/pagination/DescribeEnvironmentMembershipsPaginator.ts b/clients/client-cloud9/src/pagination/DescribeEnvironmentMembershipsPaginator.ts similarity index 100% rename from clients/client-cloud9/pagination/DescribeEnvironmentMembershipsPaginator.ts rename to clients/client-cloud9/src/pagination/DescribeEnvironmentMembershipsPaginator.ts diff --git a/clients/client-cloud9/pagination/Interfaces.ts b/clients/client-cloud9/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloud9/pagination/Interfaces.ts rename to clients/client-cloud9/src/pagination/Interfaces.ts diff --git a/clients/client-cloud9/pagination/ListEnvironmentsPaginator.ts b/clients/client-cloud9/src/pagination/ListEnvironmentsPaginator.ts similarity index 100% rename from clients/client-cloud9/pagination/ListEnvironmentsPaginator.ts rename to clients/client-cloud9/src/pagination/ListEnvironmentsPaginator.ts diff --git a/clients/client-cloud9/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloud9/protocols/Aws_json1_1.ts rename to clients/client-cloud9/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloud9/src/runtimeConfig.browser.ts b/clients/client-cloud9/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..04704fa5975e --- /dev/null +++ b/clients/client-cloud9/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Cloud9ClientConfig } from "./Cloud9Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Cloud9ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloud9/runtimeConfig.native.ts b/clients/client-cloud9/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloud9/runtimeConfig.native.ts rename to clients/client-cloud9/src/runtimeConfig.native.ts diff --git a/clients/client-cloud9/runtimeConfig.shared.ts b/clients/client-cloud9/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloud9/runtimeConfig.shared.ts rename to clients/client-cloud9/src/runtimeConfig.shared.ts diff --git a/clients/client-cloud9/src/runtimeConfig.ts b/clients/client-cloud9/src/runtimeConfig.ts new file mode 100644 index 000000000000..22cacbcaa09d --- /dev/null +++ b/clients/client-cloud9/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Cloud9ClientConfig } from "./Cloud9Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Cloud9ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloud9/tsconfig.es.json b/clients/client-cloud9/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloud9/tsconfig.es.json +++ b/clients/client-cloud9/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloud9/tsconfig.json b/clients/client-cloud9/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloud9/tsconfig.json +++ b/clients/client-cloud9/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloud9/tsconfig.types.json b/clients/client-cloud9/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloud9/tsconfig.types.json +++ b/clients/client-cloud9/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-clouddirectory/.gitignore b/clients/client-clouddirectory/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-clouddirectory/.gitignore +++ b/clients/client-clouddirectory/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-clouddirectory/package.json b/clients/client-clouddirectory/package.json index 6864959092af..8e61a1294da0 100644 --- a/clients/client-clouddirectory/package.json +++ b/clients/client-clouddirectory/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-clouddirectory", "repository": { "type": "git", diff --git a/clients/client-clouddirectory/runtimeConfig.browser.ts b/clients/client-clouddirectory/runtimeConfig.browser.ts deleted file mode 100644 index 47120a80ca7c..000000000000 --- a/clients/client-clouddirectory/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudDirectoryClientConfig } from "./CloudDirectoryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-clouddirectory/runtimeConfig.ts b/clients/client-clouddirectory/runtimeConfig.ts deleted file mode 100644 index 542eebcc0602..000000000000 --- a/clients/client-clouddirectory/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudDirectoryClientConfig } from "./CloudDirectoryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-clouddirectory/CloudDirectory.ts b/clients/client-clouddirectory/src/CloudDirectory.ts similarity index 100% rename from clients/client-clouddirectory/CloudDirectory.ts rename to clients/client-clouddirectory/src/CloudDirectory.ts diff --git a/clients/client-clouddirectory/CloudDirectoryClient.ts b/clients/client-clouddirectory/src/CloudDirectoryClient.ts similarity index 100% rename from clients/client-clouddirectory/CloudDirectoryClient.ts rename to clients/client-clouddirectory/src/CloudDirectoryClient.ts diff --git a/clients/client-clouddirectory/commands/AddFacetToObjectCommand.ts b/clients/client-clouddirectory/src/commands/AddFacetToObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/AddFacetToObjectCommand.ts rename to clients/client-clouddirectory/src/commands/AddFacetToObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/ApplySchemaCommand.ts b/clients/client-clouddirectory/src/commands/ApplySchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ApplySchemaCommand.ts rename to clients/client-clouddirectory/src/commands/ApplySchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/AttachObjectCommand.ts b/clients/client-clouddirectory/src/commands/AttachObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/AttachObjectCommand.ts rename to clients/client-clouddirectory/src/commands/AttachObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/AttachPolicyCommand.ts b/clients/client-clouddirectory/src/commands/AttachPolicyCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/AttachPolicyCommand.ts rename to clients/client-clouddirectory/src/commands/AttachPolicyCommand.ts diff --git a/clients/client-clouddirectory/commands/AttachToIndexCommand.ts b/clients/client-clouddirectory/src/commands/AttachToIndexCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/AttachToIndexCommand.ts rename to clients/client-clouddirectory/src/commands/AttachToIndexCommand.ts diff --git a/clients/client-clouddirectory/commands/AttachTypedLinkCommand.ts b/clients/client-clouddirectory/src/commands/AttachTypedLinkCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/AttachTypedLinkCommand.ts rename to clients/client-clouddirectory/src/commands/AttachTypedLinkCommand.ts diff --git a/clients/client-clouddirectory/commands/BatchReadCommand.ts b/clients/client-clouddirectory/src/commands/BatchReadCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/BatchReadCommand.ts rename to clients/client-clouddirectory/src/commands/BatchReadCommand.ts diff --git a/clients/client-clouddirectory/commands/BatchWriteCommand.ts b/clients/client-clouddirectory/src/commands/BatchWriteCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/BatchWriteCommand.ts rename to clients/client-clouddirectory/src/commands/BatchWriteCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateDirectoryCommand.ts b/clients/client-clouddirectory/src/commands/CreateDirectoryCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateDirectoryCommand.ts rename to clients/client-clouddirectory/src/commands/CreateDirectoryCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateFacetCommand.ts b/clients/client-clouddirectory/src/commands/CreateFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateFacetCommand.ts rename to clients/client-clouddirectory/src/commands/CreateFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateIndexCommand.ts b/clients/client-clouddirectory/src/commands/CreateIndexCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateIndexCommand.ts rename to clients/client-clouddirectory/src/commands/CreateIndexCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateObjectCommand.ts b/clients/client-clouddirectory/src/commands/CreateObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateObjectCommand.ts rename to clients/client-clouddirectory/src/commands/CreateObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateSchemaCommand.ts b/clients/client-clouddirectory/src/commands/CreateSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/CreateSchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/CreateTypedLinkFacetCommand.ts b/clients/client-clouddirectory/src/commands/CreateTypedLinkFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/CreateTypedLinkFacetCommand.ts rename to clients/client-clouddirectory/src/commands/CreateTypedLinkFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/DeleteDirectoryCommand.ts b/clients/client-clouddirectory/src/commands/DeleteDirectoryCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DeleteDirectoryCommand.ts rename to clients/client-clouddirectory/src/commands/DeleteDirectoryCommand.ts diff --git a/clients/client-clouddirectory/commands/DeleteFacetCommand.ts b/clients/client-clouddirectory/src/commands/DeleteFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DeleteFacetCommand.ts rename to clients/client-clouddirectory/src/commands/DeleteFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/DeleteObjectCommand.ts b/clients/client-clouddirectory/src/commands/DeleteObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DeleteObjectCommand.ts rename to clients/client-clouddirectory/src/commands/DeleteObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/DeleteSchemaCommand.ts b/clients/client-clouddirectory/src/commands/DeleteSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DeleteSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/DeleteSchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/DeleteTypedLinkFacetCommand.ts b/clients/client-clouddirectory/src/commands/DeleteTypedLinkFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DeleteTypedLinkFacetCommand.ts rename to clients/client-clouddirectory/src/commands/DeleteTypedLinkFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/DetachFromIndexCommand.ts b/clients/client-clouddirectory/src/commands/DetachFromIndexCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DetachFromIndexCommand.ts rename to clients/client-clouddirectory/src/commands/DetachFromIndexCommand.ts diff --git a/clients/client-clouddirectory/commands/DetachObjectCommand.ts b/clients/client-clouddirectory/src/commands/DetachObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DetachObjectCommand.ts rename to clients/client-clouddirectory/src/commands/DetachObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/DetachPolicyCommand.ts b/clients/client-clouddirectory/src/commands/DetachPolicyCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DetachPolicyCommand.ts rename to clients/client-clouddirectory/src/commands/DetachPolicyCommand.ts diff --git a/clients/client-clouddirectory/commands/DetachTypedLinkCommand.ts b/clients/client-clouddirectory/src/commands/DetachTypedLinkCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DetachTypedLinkCommand.ts rename to clients/client-clouddirectory/src/commands/DetachTypedLinkCommand.ts diff --git a/clients/client-clouddirectory/commands/DisableDirectoryCommand.ts b/clients/client-clouddirectory/src/commands/DisableDirectoryCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/DisableDirectoryCommand.ts rename to clients/client-clouddirectory/src/commands/DisableDirectoryCommand.ts diff --git a/clients/client-clouddirectory/commands/EnableDirectoryCommand.ts b/clients/client-clouddirectory/src/commands/EnableDirectoryCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/EnableDirectoryCommand.ts rename to clients/client-clouddirectory/src/commands/EnableDirectoryCommand.ts diff --git a/clients/client-clouddirectory/commands/GetAppliedSchemaVersionCommand.ts b/clients/client-clouddirectory/src/commands/GetAppliedSchemaVersionCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetAppliedSchemaVersionCommand.ts rename to clients/client-clouddirectory/src/commands/GetAppliedSchemaVersionCommand.ts diff --git a/clients/client-clouddirectory/commands/GetDirectoryCommand.ts b/clients/client-clouddirectory/src/commands/GetDirectoryCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetDirectoryCommand.ts rename to clients/client-clouddirectory/src/commands/GetDirectoryCommand.ts diff --git a/clients/client-clouddirectory/commands/GetFacetCommand.ts b/clients/client-clouddirectory/src/commands/GetFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetFacetCommand.ts rename to clients/client-clouddirectory/src/commands/GetFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/GetLinkAttributesCommand.ts b/clients/client-clouddirectory/src/commands/GetLinkAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetLinkAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/GetLinkAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/GetObjectAttributesCommand.ts b/clients/client-clouddirectory/src/commands/GetObjectAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetObjectAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/GetObjectAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/GetObjectInformationCommand.ts b/clients/client-clouddirectory/src/commands/GetObjectInformationCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetObjectInformationCommand.ts rename to clients/client-clouddirectory/src/commands/GetObjectInformationCommand.ts diff --git a/clients/client-clouddirectory/commands/GetSchemaAsJsonCommand.ts b/clients/client-clouddirectory/src/commands/GetSchemaAsJsonCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetSchemaAsJsonCommand.ts rename to clients/client-clouddirectory/src/commands/GetSchemaAsJsonCommand.ts diff --git a/clients/client-clouddirectory/commands/GetTypedLinkFacetInformationCommand.ts b/clients/client-clouddirectory/src/commands/GetTypedLinkFacetInformationCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/GetTypedLinkFacetInformationCommand.ts rename to clients/client-clouddirectory/src/commands/GetTypedLinkFacetInformationCommand.ts diff --git a/clients/client-clouddirectory/commands/ListAppliedSchemaArnsCommand.ts b/clients/client-clouddirectory/src/commands/ListAppliedSchemaArnsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListAppliedSchemaArnsCommand.ts rename to clients/client-clouddirectory/src/commands/ListAppliedSchemaArnsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListAttachedIndicesCommand.ts b/clients/client-clouddirectory/src/commands/ListAttachedIndicesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListAttachedIndicesCommand.ts rename to clients/client-clouddirectory/src/commands/ListAttachedIndicesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListDevelopmentSchemaArnsCommand.ts b/clients/client-clouddirectory/src/commands/ListDevelopmentSchemaArnsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListDevelopmentSchemaArnsCommand.ts rename to clients/client-clouddirectory/src/commands/ListDevelopmentSchemaArnsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListDirectoriesCommand.ts b/clients/client-clouddirectory/src/commands/ListDirectoriesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListDirectoriesCommand.ts rename to clients/client-clouddirectory/src/commands/ListDirectoriesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListFacetAttributesCommand.ts b/clients/client-clouddirectory/src/commands/ListFacetAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListFacetAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/ListFacetAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListFacetNamesCommand.ts b/clients/client-clouddirectory/src/commands/ListFacetNamesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListFacetNamesCommand.ts rename to clients/client-clouddirectory/src/commands/ListFacetNamesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListIncomingTypedLinksCommand.ts b/clients/client-clouddirectory/src/commands/ListIncomingTypedLinksCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListIncomingTypedLinksCommand.ts rename to clients/client-clouddirectory/src/commands/ListIncomingTypedLinksCommand.ts diff --git a/clients/client-clouddirectory/commands/ListIndexCommand.ts b/clients/client-clouddirectory/src/commands/ListIndexCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListIndexCommand.ts rename to clients/client-clouddirectory/src/commands/ListIndexCommand.ts diff --git a/clients/client-clouddirectory/commands/ListManagedSchemaArnsCommand.ts b/clients/client-clouddirectory/src/commands/ListManagedSchemaArnsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListManagedSchemaArnsCommand.ts rename to clients/client-clouddirectory/src/commands/ListManagedSchemaArnsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListObjectAttributesCommand.ts b/clients/client-clouddirectory/src/commands/ListObjectAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListObjectAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/ListObjectAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListObjectChildrenCommand.ts b/clients/client-clouddirectory/src/commands/ListObjectChildrenCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListObjectChildrenCommand.ts rename to clients/client-clouddirectory/src/commands/ListObjectChildrenCommand.ts diff --git a/clients/client-clouddirectory/commands/ListObjectParentPathsCommand.ts b/clients/client-clouddirectory/src/commands/ListObjectParentPathsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListObjectParentPathsCommand.ts rename to clients/client-clouddirectory/src/commands/ListObjectParentPathsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListObjectParentsCommand.ts b/clients/client-clouddirectory/src/commands/ListObjectParentsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListObjectParentsCommand.ts rename to clients/client-clouddirectory/src/commands/ListObjectParentsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListObjectPoliciesCommand.ts b/clients/client-clouddirectory/src/commands/ListObjectPoliciesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListObjectPoliciesCommand.ts rename to clients/client-clouddirectory/src/commands/ListObjectPoliciesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListOutgoingTypedLinksCommand.ts b/clients/client-clouddirectory/src/commands/ListOutgoingTypedLinksCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListOutgoingTypedLinksCommand.ts rename to clients/client-clouddirectory/src/commands/ListOutgoingTypedLinksCommand.ts diff --git a/clients/client-clouddirectory/commands/ListPolicyAttachmentsCommand.ts b/clients/client-clouddirectory/src/commands/ListPolicyAttachmentsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListPolicyAttachmentsCommand.ts rename to clients/client-clouddirectory/src/commands/ListPolicyAttachmentsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListPublishedSchemaArnsCommand.ts b/clients/client-clouddirectory/src/commands/ListPublishedSchemaArnsCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListPublishedSchemaArnsCommand.ts rename to clients/client-clouddirectory/src/commands/ListPublishedSchemaArnsCommand.ts diff --git a/clients/client-clouddirectory/commands/ListTagsForResourceCommand.ts b/clients/client-clouddirectory/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListTagsForResourceCommand.ts rename to clients/client-clouddirectory/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-clouddirectory/commands/ListTypedLinkFacetAttributesCommand.ts b/clients/client-clouddirectory/src/commands/ListTypedLinkFacetAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListTypedLinkFacetAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/ListTypedLinkFacetAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/ListTypedLinkFacetNamesCommand.ts b/clients/client-clouddirectory/src/commands/ListTypedLinkFacetNamesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/ListTypedLinkFacetNamesCommand.ts rename to clients/client-clouddirectory/src/commands/ListTypedLinkFacetNamesCommand.ts diff --git a/clients/client-clouddirectory/commands/LookupPolicyCommand.ts b/clients/client-clouddirectory/src/commands/LookupPolicyCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/LookupPolicyCommand.ts rename to clients/client-clouddirectory/src/commands/LookupPolicyCommand.ts diff --git a/clients/client-clouddirectory/commands/PublishSchemaCommand.ts b/clients/client-clouddirectory/src/commands/PublishSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/PublishSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/PublishSchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/PutSchemaFromJsonCommand.ts b/clients/client-clouddirectory/src/commands/PutSchemaFromJsonCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/PutSchemaFromJsonCommand.ts rename to clients/client-clouddirectory/src/commands/PutSchemaFromJsonCommand.ts diff --git a/clients/client-clouddirectory/commands/RemoveFacetFromObjectCommand.ts b/clients/client-clouddirectory/src/commands/RemoveFacetFromObjectCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/RemoveFacetFromObjectCommand.ts rename to clients/client-clouddirectory/src/commands/RemoveFacetFromObjectCommand.ts diff --git a/clients/client-clouddirectory/commands/TagResourceCommand.ts b/clients/client-clouddirectory/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/TagResourceCommand.ts rename to clients/client-clouddirectory/src/commands/TagResourceCommand.ts diff --git a/clients/client-clouddirectory/commands/UntagResourceCommand.ts b/clients/client-clouddirectory/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UntagResourceCommand.ts rename to clients/client-clouddirectory/src/commands/UntagResourceCommand.ts diff --git a/clients/client-clouddirectory/commands/UpdateFacetCommand.ts b/clients/client-clouddirectory/src/commands/UpdateFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpdateFacetCommand.ts rename to clients/client-clouddirectory/src/commands/UpdateFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/UpdateLinkAttributesCommand.ts b/clients/client-clouddirectory/src/commands/UpdateLinkAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpdateLinkAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/UpdateLinkAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/UpdateObjectAttributesCommand.ts b/clients/client-clouddirectory/src/commands/UpdateObjectAttributesCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpdateObjectAttributesCommand.ts rename to clients/client-clouddirectory/src/commands/UpdateObjectAttributesCommand.ts diff --git a/clients/client-clouddirectory/commands/UpdateSchemaCommand.ts b/clients/client-clouddirectory/src/commands/UpdateSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpdateSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/UpdateSchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/UpdateTypedLinkFacetCommand.ts b/clients/client-clouddirectory/src/commands/UpdateTypedLinkFacetCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpdateTypedLinkFacetCommand.ts rename to clients/client-clouddirectory/src/commands/UpdateTypedLinkFacetCommand.ts diff --git a/clients/client-clouddirectory/commands/UpgradeAppliedSchemaCommand.ts b/clients/client-clouddirectory/src/commands/UpgradeAppliedSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpgradeAppliedSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/UpgradeAppliedSchemaCommand.ts diff --git a/clients/client-clouddirectory/commands/UpgradePublishedSchemaCommand.ts b/clients/client-clouddirectory/src/commands/UpgradePublishedSchemaCommand.ts similarity index 100% rename from clients/client-clouddirectory/commands/UpgradePublishedSchemaCommand.ts rename to clients/client-clouddirectory/src/commands/UpgradePublishedSchemaCommand.ts diff --git a/clients/client-clouddirectory/endpoints.ts b/clients/client-clouddirectory/src/endpoints.ts similarity index 100% rename from clients/client-clouddirectory/endpoints.ts rename to clients/client-clouddirectory/src/endpoints.ts diff --git a/clients/client-clouddirectory/index.ts b/clients/client-clouddirectory/src/index.ts similarity index 100% rename from clients/client-clouddirectory/index.ts rename to clients/client-clouddirectory/src/index.ts diff --git a/clients/client-clouddirectory/models/index.ts b/clients/client-clouddirectory/src/models/index.ts similarity index 100% rename from clients/client-clouddirectory/models/index.ts rename to clients/client-clouddirectory/src/models/index.ts diff --git a/clients/client-clouddirectory/models/models_0.ts b/clients/client-clouddirectory/src/models/models_0.ts similarity index 100% rename from clients/client-clouddirectory/models/models_0.ts rename to clients/client-clouddirectory/src/models/models_0.ts diff --git a/clients/client-clouddirectory/pagination/Interfaces.ts b/clients/client-clouddirectory/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-clouddirectory/pagination/Interfaces.ts rename to clients/client-clouddirectory/src/pagination/Interfaces.ts diff --git a/clients/client-clouddirectory/pagination/ListAppliedSchemaArnsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListAppliedSchemaArnsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListAppliedSchemaArnsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListAppliedSchemaArnsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListAttachedIndicesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListAttachedIndicesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListAttachedIndicesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListAttachedIndicesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListDevelopmentSchemaArnsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListDevelopmentSchemaArnsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListDevelopmentSchemaArnsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListDevelopmentSchemaArnsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListDirectoriesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListDirectoriesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListDirectoriesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListDirectoriesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListFacetAttributesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListFacetAttributesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListFacetAttributesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListFacetAttributesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListFacetNamesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListFacetNamesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListFacetNamesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListFacetNamesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListIndexPaginator.ts b/clients/client-clouddirectory/src/pagination/ListIndexPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListIndexPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListIndexPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListManagedSchemaArnsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListManagedSchemaArnsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListManagedSchemaArnsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListManagedSchemaArnsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListObjectAttributesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListObjectAttributesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListObjectAttributesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListObjectAttributesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListObjectChildrenPaginator.ts b/clients/client-clouddirectory/src/pagination/ListObjectChildrenPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListObjectChildrenPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListObjectChildrenPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListObjectParentPathsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListObjectParentPathsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListObjectParentPathsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListObjectParentPathsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListObjectParentsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListObjectParentsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListObjectParentsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListObjectParentsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListObjectPoliciesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListObjectPoliciesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListObjectPoliciesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListObjectPoliciesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListPolicyAttachmentsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListPolicyAttachmentsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListPolicyAttachmentsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListPolicyAttachmentsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListPublishedSchemaArnsPaginator.ts b/clients/client-clouddirectory/src/pagination/ListPublishedSchemaArnsPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListPublishedSchemaArnsPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListPublishedSchemaArnsPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListTagsForResourcePaginator.ts b/clients/client-clouddirectory/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListTagsForResourcePaginator.ts rename to clients/client-clouddirectory/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListTypedLinkFacetAttributesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListTypedLinkFacetAttributesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListTypedLinkFacetAttributesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListTypedLinkFacetAttributesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/ListTypedLinkFacetNamesPaginator.ts b/clients/client-clouddirectory/src/pagination/ListTypedLinkFacetNamesPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/ListTypedLinkFacetNamesPaginator.ts rename to clients/client-clouddirectory/src/pagination/ListTypedLinkFacetNamesPaginator.ts diff --git a/clients/client-clouddirectory/pagination/LookupPolicyPaginator.ts b/clients/client-clouddirectory/src/pagination/LookupPolicyPaginator.ts similarity index 100% rename from clients/client-clouddirectory/pagination/LookupPolicyPaginator.ts rename to clients/client-clouddirectory/src/pagination/LookupPolicyPaginator.ts diff --git a/clients/client-clouddirectory/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-clouddirectory/protocols/Aws_restJson1.ts rename to clients/client-clouddirectory/src/protocols/Aws_restJson1.ts diff --git a/clients/client-clouddirectory/src/runtimeConfig.browser.ts b/clients/client-clouddirectory/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..eb67482bd8f1 --- /dev/null +++ b/clients/client-clouddirectory/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudDirectoryClientConfig } from "./CloudDirectoryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-clouddirectory/runtimeConfig.native.ts b/clients/client-clouddirectory/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-clouddirectory/runtimeConfig.native.ts rename to clients/client-clouddirectory/src/runtimeConfig.native.ts diff --git a/clients/client-clouddirectory/runtimeConfig.shared.ts b/clients/client-clouddirectory/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-clouddirectory/runtimeConfig.shared.ts rename to clients/client-clouddirectory/src/runtimeConfig.shared.ts diff --git a/clients/client-clouddirectory/src/runtimeConfig.ts b/clients/client-clouddirectory/src/runtimeConfig.ts new file mode 100644 index 000000000000..e2e7dc5958ec --- /dev/null +++ b/clients/client-clouddirectory/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudDirectoryClientConfig } from "./CloudDirectoryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-clouddirectory/tsconfig.es.json b/clients/client-clouddirectory/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-clouddirectory/tsconfig.es.json +++ b/clients/client-clouddirectory/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-clouddirectory/tsconfig.json b/clients/client-clouddirectory/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-clouddirectory/tsconfig.json +++ b/clients/client-clouddirectory/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-clouddirectory/tsconfig.types.json b/clients/client-clouddirectory/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-clouddirectory/tsconfig.types.json +++ b/clients/client-clouddirectory/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudformation/.gitignore b/clients/client-cloudformation/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudformation/.gitignore +++ b/clients/client-cloudformation/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudformation/package.json b/clients/client-cloudformation/package.json index 3763dabed294..ea345388a94e 100644 --- a/clients/client-cloudformation/package.json +++ b/clients/client-cloudformation/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -77,8 +71,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -87,6 +81,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudformation", "repository": { "type": "git", diff --git a/clients/client-cloudformation/runtimeConfig.browser.ts b/clients/client-cloudformation/runtimeConfig.browser.ts deleted file mode 100644 index 364f418a3b45..000000000000 --- a/clients/client-cloudformation/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudFormationClientConfig } from "./CloudFormationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudFormationClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudformation/runtimeConfig.ts b/clients/client-cloudformation/runtimeConfig.ts deleted file mode 100644 index ea053b2b5f17..000000000000 --- a/clients/client-cloudformation/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudFormationClientConfig } from "./CloudFormationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudFormationClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudformation/CloudFormation.ts b/clients/client-cloudformation/src/CloudFormation.ts similarity index 100% rename from clients/client-cloudformation/CloudFormation.ts rename to clients/client-cloudformation/src/CloudFormation.ts diff --git a/clients/client-cloudformation/CloudFormationClient.ts b/clients/client-cloudformation/src/CloudFormationClient.ts similarity index 100% rename from clients/client-cloudformation/CloudFormationClient.ts rename to clients/client-cloudformation/src/CloudFormationClient.ts diff --git a/clients/client-cloudformation/commands/ActivateTypeCommand.ts b/clients/client-cloudformation/src/commands/ActivateTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ActivateTypeCommand.ts rename to clients/client-cloudformation/src/commands/ActivateTypeCommand.ts diff --git a/clients/client-cloudformation/commands/BatchDescribeTypeConfigurationsCommand.ts b/clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/BatchDescribeTypeConfigurationsCommand.ts rename to clients/client-cloudformation/src/commands/BatchDescribeTypeConfigurationsCommand.ts diff --git a/clients/client-cloudformation/commands/CancelUpdateStackCommand.ts b/clients/client-cloudformation/src/commands/CancelUpdateStackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/CancelUpdateStackCommand.ts rename to clients/client-cloudformation/src/commands/CancelUpdateStackCommand.ts diff --git a/clients/client-cloudformation/commands/ContinueUpdateRollbackCommand.ts b/clients/client-cloudformation/src/commands/ContinueUpdateRollbackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ContinueUpdateRollbackCommand.ts rename to clients/client-cloudformation/src/commands/ContinueUpdateRollbackCommand.ts diff --git a/clients/client-cloudformation/commands/CreateChangeSetCommand.ts b/clients/client-cloudformation/src/commands/CreateChangeSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/CreateChangeSetCommand.ts rename to clients/client-cloudformation/src/commands/CreateChangeSetCommand.ts diff --git a/clients/client-cloudformation/commands/CreateStackCommand.ts b/clients/client-cloudformation/src/commands/CreateStackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/CreateStackCommand.ts rename to clients/client-cloudformation/src/commands/CreateStackCommand.ts diff --git a/clients/client-cloudformation/commands/CreateStackInstancesCommand.ts b/clients/client-cloudformation/src/commands/CreateStackInstancesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/CreateStackInstancesCommand.ts rename to clients/client-cloudformation/src/commands/CreateStackInstancesCommand.ts diff --git a/clients/client-cloudformation/commands/CreateStackSetCommand.ts b/clients/client-cloudformation/src/commands/CreateStackSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/CreateStackSetCommand.ts rename to clients/client-cloudformation/src/commands/CreateStackSetCommand.ts diff --git a/clients/client-cloudformation/commands/DeactivateTypeCommand.ts b/clients/client-cloudformation/src/commands/DeactivateTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeactivateTypeCommand.ts rename to clients/client-cloudformation/src/commands/DeactivateTypeCommand.ts diff --git a/clients/client-cloudformation/commands/DeleteChangeSetCommand.ts b/clients/client-cloudformation/src/commands/DeleteChangeSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeleteChangeSetCommand.ts rename to clients/client-cloudformation/src/commands/DeleteChangeSetCommand.ts diff --git a/clients/client-cloudformation/commands/DeleteStackCommand.ts b/clients/client-cloudformation/src/commands/DeleteStackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeleteStackCommand.ts rename to clients/client-cloudformation/src/commands/DeleteStackCommand.ts diff --git a/clients/client-cloudformation/commands/DeleteStackInstancesCommand.ts b/clients/client-cloudformation/src/commands/DeleteStackInstancesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeleteStackInstancesCommand.ts rename to clients/client-cloudformation/src/commands/DeleteStackInstancesCommand.ts diff --git a/clients/client-cloudformation/commands/DeleteStackSetCommand.ts b/clients/client-cloudformation/src/commands/DeleteStackSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeleteStackSetCommand.ts rename to clients/client-cloudformation/src/commands/DeleteStackSetCommand.ts diff --git a/clients/client-cloudformation/commands/DeregisterTypeCommand.ts b/clients/client-cloudformation/src/commands/DeregisterTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DeregisterTypeCommand.ts rename to clients/client-cloudformation/src/commands/DeregisterTypeCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeAccountLimitsCommand.ts b/clients/client-cloudformation/src/commands/DescribeAccountLimitsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeAccountLimitsCommand.ts rename to clients/client-cloudformation/src/commands/DescribeAccountLimitsCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeChangeSetCommand.ts b/clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeChangeSetCommand.ts rename to clients/client-cloudformation/src/commands/DescribeChangeSetCommand.ts diff --git a/clients/client-cloudformation/commands/DescribePublisherCommand.ts b/clients/client-cloudformation/src/commands/DescribePublisherCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribePublisherCommand.ts rename to clients/client-cloudformation/src/commands/DescribePublisherCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackDriftDetectionStatusCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackDriftDetectionStatusCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackDriftDetectionStatusCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackDriftDetectionStatusCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackEventsCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackEventsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackEventsCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackEventsCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackInstanceCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackInstanceCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackInstanceCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackInstanceCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackResourceCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackResourceCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackResourceCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackResourceCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackResourceDriftsCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackResourceDriftsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackResourceDriftsCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackResourceDriftsCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackResourcesCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackResourcesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackResourcesCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackResourcesCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackSetCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackSetCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackSetCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStackSetOperationCommand.ts b/clients/client-cloudformation/src/commands/DescribeStackSetOperationCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStackSetOperationCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStackSetOperationCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeStacksCommand.ts b/clients/client-cloudformation/src/commands/DescribeStacksCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeStacksCommand.ts rename to clients/client-cloudformation/src/commands/DescribeStacksCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeTypeCommand.ts b/clients/client-cloudformation/src/commands/DescribeTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeTypeCommand.ts rename to clients/client-cloudformation/src/commands/DescribeTypeCommand.ts diff --git a/clients/client-cloudformation/commands/DescribeTypeRegistrationCommand.ts b/clients/client-cloudformation/src/commands/DescribeTypeRegistrationCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DescribeTypeRegistrationCommand.ts rename to clients/client-cloudformation/src/commands/DescribeTypeRegistrationCommand.ts diff --git a/clients/client-cloudformation/commands/DetectStackDriftCommand.ts b/clients/client-cloudformation/src/commands/DetectStackDriftCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DetectStackDriftCommand.ts rename to clients/client-cloudformation/src/commands/DetectStackDriftCommand.ts diff --git a/clients/client-cloudformation/commands/DetectStackResourceDriftCommand.ts b/clients/client-cloudformation/src/commands/DetectStackResourceDriftCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DetectStackResourceDriftCommand.ts rename to clients/client-cloudformation/src/commands/DetectStackResourceDriftCommand.ts diff --git a/clients/client-cloudformation/commands/DetectStackSetDriftCommand.ts b/clients/client-cloudformation/src/commands/DetectStackSetDriftCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/DetectStackSetDriftCommand.ts rename to clients/client-cloudformation/src/commands/DetectStackSetDriftCommand.ts diff --git a/clients/client-cloudformation/commands/EstimateTemplateCostCommand.ts b/clients/client-cloudformation/src/commands/EstimateTemplateCostCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/EstimateTemplateCostCommand.ts rename to clients/client-cloudformation/src/commands/EstimateTemplateCostCommand.ts diff --git a/clients/client-cloudformation/commands/ExecuteChangeSetCommand.ts b/clients/client-cloudformation/src/commands/ExecuteChangeSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ExecuteChangeSetCommand.ts rename to clients/client-cloudformation/src/commands/ExecuteChangeSetCommand.ts diff --git a/clients/client-cloudformation/commands/GetStackPolicyCommand.ts b/clients/client-cloudformation/src/commands/GetStackPolicyCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/GetStackPolicyCommand.ts rename to clients/client-cloudformation/src/commands/GetStackPolicyCommand.ts diff --git a/clients/client-cloudformation/commands/GetTemplateCommand.ts b/clients/client-cloudformation/src/commands/GetTemplateCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/GetTemplateCommand.ts rename to clients/client-cloudformation/src/commands/GetTemplateCommand.ts diff --git a/clients/client-cloudformation/commands/GetTemplateSummaryCommand.ts b/clients/client-cloudformation/src/commands/GetTemplateSummaryCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/GetTemplateSummaryCommand.ts rename to clients/client-cloudformation/src/commands/GetTemplateSummaryCommand.ts diff --git a/clients/client-cloudformation/commands/ImportStacksToStackSetCommand.ts b/clients/client-cloudformation/src/commands/ImportStacksToStackSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ImportStacksToStackSetCommand.ts rename to clients/client-cloudformation/src/commands/ImportStacksToStackSetCommand.ts diff --git a/clients/client-cloudformation/commands/ListChangeSetsCommand.ts b/clients/client-cloudformation/src/commands/ListChangeSetsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListChangeSetsCommand.ts rename to clients/client-cloudformation/src/commands/ListChangeSetsCommand.ts diff --git a/clients/client-cloudformation/commands/ListExportsCommand.ts b/clients/client-cloudformation/src/commands/ListExportsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListExportsCommand.ts rename to clients/client-cloudformation/src/commands/ListExportsCommand.ts diff --git a/clients/client-cloudformation/commands/ListImportsCommand.ts b/clients/client-cloudformation/src/commands/ListImportsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListImportsCommand.ts rename to clients/client-cloudformation/src/commands/ListImportsCommand.ts diff --git a/clients/client-cloudformation/commands/ListStackInstancesCommand.ts b/clients/client-cloudformation/src/commands/ListStackInstancesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStackInstancesCommand.ts rename to clients/client-cloudformation/src/commands/ListStackInstancesCommand.ts diff --git a/clients/client-cloudformation/commands/ListStackResourcesCommand.ts b/clients/client-cloudformation/src/commands/ListStackResourcesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStackResourcesCommand.ts rename to clients/client-cloudformation/src/commands/ListStackResourcesCommand.ts diff --git a/clients/client-cloudformation/commands/ListStackSetOperationResultsCommand.ts b/clients/client-cloudformation/src/commands/ListStackSetOperationResultsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStackSetOperationResultsCommand.ts rename to clients/client-cloudformation/src/commands/ListStackSetOperationResultsCommand.ts diff --git a/clients/client-cloudformation/commands/ListStackSetOperationsCommand.ts b/clients/client-cloudformation/src/commands/ListStackSetOperationsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStackSetOperationsCommand.ts rename to clients/client-cloudformation/src/commands/ListStackSetOperationsCommand.ts diff --git a/clients/client-cloudformation/commands/ListStackSetsCommand.ts b/clients/client-cloudformation/src/commands/ListStackSetsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStackSetsCommand.ts rename to clients/client-cloudformation/src/commands/ListStackSetsCommand.ts diff --git a/clients/client-cloudformation/commands/ListStacksCommand.ts b/clients/client-cloudformation/src/commands/ListStacksCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListStacksCommand.ts rename to clients/client-cloudformation/src/commands/ListStacksCommand.ts diff --git a/clients/client-cloudformation/commands/ListTypeRegistrationsCommand.ts b/clients/client-cloudformation/src/commands/ListTypeRegistrationsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListTypeRegistrationsCommand.ts rename to clients/client-cloudformation/src/commands/ListTypeRegistrationsCommand.ts diff --git a/clients/client-cloudformation/commands/ListTypeVersionsCommand.ts b/clients/client-cloudformation/src/commands/ListTypeVersionsCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListTypeVersionsCommand.ts rename to clients/client-cloudformation/src/commands/ListTypeVersionsCommand.ts diff --git a/clients/client-cloudformation/commands/ListTypesCommand.ts b/clients/client-cloudformation/src/commands/ListTypesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ListTypesCommand.ts rename to clients/client-cloudformation/src/commands/ListTypesCommand.ts diff --git a/clients/client-cloudformation/commands/PublishTypeCommand.ts b/clients/client-cloudformation/src/commands/PublishTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/PublishTypeCommand.ts rename to clients/client-cloudformation/src/commands/PublishTypeCommand.ts diff --git a/clients/client-cloudformation/commands/RecordHandlerProgressCommand.ts b/clients/client-cloudformation/src/commands/RecordHandlerProgressCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/RecordHandlerProgressCommand.ts rename to clients/client-cloudformation/src/commands/RecordHandlerProgressCommand.ts diff --git a/clients/client-cloudformation/commands/RegisterPublisherCommand.ts b/clients/client-cloudformation/src/commands/RegisterPublisherCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/RegisterPublisherCommand.ts rename to clients/client-cloudformation/src/commands/RegisterPublisherCommand.ts diff --git a/clients/client-cloudformation/commands/RegisterTypeCommand.ts b/clients/client-cloudformation/src/commands/RegisterTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/RegisterTypeCommand.ts rename to clients/client-cloudformation/src/commands/RegisterTypeCommand.ts diff --git a/clients/client-cloudformation/commands/RollbackStackCommand.ts b/clients/client-cloudformation/src/commands/RollbackStackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/RollbackStackCommand.ts rename to clients/client-cloudformation/src/commands/RollbackStackCommand.ts diff --git a/clients/client-cloudformation/commands/SetStackPolicyCommand.ts b/clients/client-cloudformation/src/commands/SetStackPolicyCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/SetStackPolicyCommand.ts rename to clients/client-cloudformation/src/commands/SetStackPolicyCommand.ts diff --git a/clients/client-cloudformation/commands/SetTypeConfigurationCommand.ts b/clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/SetTypeConfigurationCommand.ts rename to clients/client-cloudformation/src/commands/SetTypeConfigurationCommand.ts diff --git a/clients/client-cloudformation/commands/SetTypeDefaultVersionCommand.ts b/clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/SetTypeDefaultVersionCommand.ts rename to clients/client-cloudformation/src/commands/SetTypeDefaultVersionCommand.ts diff --git a/clients/client-cloudformation/commands/SignalResourceCommand.ts b/clients/client-cloudformation/src/commands/SignalResourceCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/SignalResourceCommand.ts rename to clients/client-cloudformation/src/commands/SignalResourceCommand.ts diff --git a/clients/client-cloudformation/commands/StopStackSetOperationCommand.ts b/clients/client-cloudformation/src/commands/StopStackSetOperationCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/StopStackSetOperationCommand.ts rename to clients/client-cloudformation/src/commands/StopStackSetOperationCommand.ts diff --git a/clients/client-cloudformation/commands/TestTypeCommand.ts b/clients/client-cloudformation/src/commands/TestTypeCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/TestTypeCommand.ts rename to clients/client-cloudformation/src/commands/TestTypeCommand.ts diff --git a/clients/client-cloudformation/commands/UpdateStackCommand.ts b/clients/client-cloudformation/src/commands/UpdateStackCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/UpdateStackCommand.ts rename to clients/client-cloudformation/src/commands/UpdateStackCommand.ts diff --git a/clients/client-cloudformation/commands/UpdateStackInstancesCommand.ts b/clients/client-cloudformation/src/commands/UpdateStackInstancesCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/UpdateStackInstancesCommand.ts rename to clients/client-cloudformation/src/commands/UpdateStackInstancesCommand.ts diff --git a/clients/client-cloudformation/commands/UpdateStackSetCommand.ts b/clients/client-cloudformation/src/commands/UpdateStackSetCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/UpdateStackSetCommand.ts rename to clients/client-cloudformation/src/commands/UpdateStackSetCommand.ts diff --git a/clients/client-cloudformation/commands/UpdateTerminationProtectionCommand.ts b/clients/client-cloudformation/src/commands/UpdateTerminationProtectionCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/UpdateTerminationProtectionCommand.ts rename to clients/client-cloudformation/src/commands/UpdateTerminationProtectionCommand.ts diff --git a/clients/client-cloudformation/commands/ValidateTemplateCommand.ts b/clients/client-cloudformation/src/commands/ValidateTemplateCommand.ts similarity index 100% rename from clients/client-cloudformation/commands/ValidateTemplateCommand.ts rename to clients/client-cloudformation/src/commands/ValidateTemplateCommand.ts diff --git a/clients/client-cloudformation/endpoints.ts b/clients/client-cloudformation/src/endpoints.ts similarity index 100% rename from clients/client-cloudformation/endpoints.ts rename to clients/client-cloudformation/src/endpoints.ts diff --git a/clients/client-cloudformation/index.ts b/clients/client-cloudformation/src/index.ts similarity index 100% rename from clients/client-cloudformation/index.ts rename to clients/client-cloudformation/src/index.ts diff --git a/clients/client-cloudformation/models/index.ts b/clients/client-cloudformation/src/models/index.ts similarity index 100% rename from clients/client-cloudformation/models/index.ts rename to clients/client-cloudformation/src/models/index.ts diff --git a/clients/client-cloudformation/models/models_0.ts b/clients/client-cloudformation/src/models/models_0.ts similarity index 100% rename from clients/client-cloudformation/models/models_0.ts rename to clients/client-cloudformation/src/models/models_0.ts diff --git a/clients/client-cloudformation/pagination/DescribeAccountLimitsPaginator.ts b/clients/client-cloudformation/src/pagination/DescribeAccountLimitsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/DescribeAccountLimitsPaginator.ts rename to clients/client-cloudformation/src/pagination/DescribeAccountLimitsPaginator.ts diff --git a/clients/client-cloudformation/pagination/DescribeStackEventsPaginator.ts b/clients/client-cloudformation/src/pagination/DescribeStackEventsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/DescribeStackEventsPaginator.ts rename to clients/client-cloudformation/src/pagination/DescribeStackEventsPaginator.ts diff --git a/clients/client-cloudformation/pagination/DescribeStackResourceDriftsPaginator.ts b/clients/client-cloudformation/src/pagination/DescribeStackResourceDriftsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/DescribeStackResourceDriftsPaginator.ts rename to clients/client-cloudformation/src/pagination/DescribeStackResourceDriftsPaginator.ts diff --git a/clients/client-cloudformation/pagination/DescribeStacksPaginator.ts b/clients/client-cloudformation/src/pagination/DescribeStacksPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/DescribeStacksPaginator.ts rename to clients/client-cloudformation/src/pagination/DescribeStacksPaginator.ts diff --git a/clients/client-cloudformation/pagination/Interfaces.ts b/clients/client-cloudformation/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudformation/pagination/Interfaces.ts rename to clients/client-cloudformation/src/pagination/Interfaces.ts diff --git a/clients/client-cloudformation/pagination/ListChangeSetsPaginator.ts b/clients/client-cloudformation/src/pagination/ListChangeSetsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListChangeSetsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListChangeSetsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListExportsPaginator.ts b/clients/client-cloudformation/src/pagination/ListExportsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListExportsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListExportsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListImportsPaginator.ts b/clients/client-cloudformation/src/pagination/ListImportsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListImportsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListImportsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStackInstancesPaginator.ts b/clients/client-cloudformation/src/pagination/ListStackInstancesPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStackInstancesPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStackInstancesPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStackResourcesPaginator.ts b/clients/client-cloudformation/src/pagination/ListStackResourcesPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStackResourcesPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStackResourcesPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStackSetOperationResultsPaginator.ts b/clients/client-cloudformation/src/pagination/ListStackSetOperationResultsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStackSetOperationResultsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStackSetOperationResultsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStackSetOperationsPaginator.ts b/clients/client-cloudformation/src/pagination/ListStackSetOperationsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStackSetOperationsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStackSetOperationsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStackSetsPaginator.ts b/clients/client-cloudformation/src/pagination/ListStackSetsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStackSetsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStackSetsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListStacksPaginator.ts b/clients/client-cloudformation/src/pagination/ListStacksPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListStacksPaginator.ts rename to clients/client-cloudformation/src/pagination/ListStacksPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListTypeRegistrationsPaginator.ts b/clients/client-cloudformation/src/pagination/ListTypeRegistrationsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListTypeRegistrationsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListTypeRegistrationsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListTypeVersionsPaginator.ts b/clients/client-cloudformation/src/pagination/ListTypeVersionsPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListTypeVersionsPaginator.ts rename to clients/client-cloudformation/src/pagination/ListTypeVersionsPaginator.ts diff --git a/clients/client-cloudformation/pagination/ListTypesPaginator.ts b/clients/client-cloudformation/src/pagination/ListTypesPaginator.ts similarity index 100% rename from clients/client-cloudformation/pagination/ListTypesPaginator.ts rename to clients/client-cloudformation/src/pagination/ListTypesPaginator.ts diff --git a/clients/client-cloudformation/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-cloudformation/protocols/Aws_query.ts rename to clients/client-cloudformation/src/protocols/Aws_query.ts diff --git a/clients/client-cloudformation/src/runtimeConfig.browser.ts b/clients/client-cloudformation/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..beee5a049a10 --- /dev/null +++ b/clients/client-cloudformation/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudFormationClientConfig } from "./CloudFormationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudFormationClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudformation/runtimeConfig.native.ts b/clients/client-cloudformation/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudformation/runtimeConfig.native.ts rename to clients/client-cloudformation/src/runtimeConfig.native.ts diff --git a/clients/client-cloudformation/runtimeConfig.shared.ts b/clients/client-cloudformation/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudformation/runtimeConfig.shared.ts rename to clients/client-cloudformation/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudformation/src/runtimeConfig.ts b/clients/client-cloudformation/src/runtimeConfig.ts new file mode 100644 index 000000000000..2534c96de718 --- /dev/null +++ b/clients/client-cloudformation/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudFormationClientConfig } from "./CloudFormationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudFormationClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudformation/waiters/waitForChangeSetCreateComplete.ts b/clients/client-cloudformation/src/waiters/waitForChangeSetCreateComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForChangeSetCreateComplete.ts rename to clients/client-cloudformation/src/waiters/waitForChangeSetCreateComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForStackCreateComplete.ts b/clients/client-cloudformation/src/waiters/waitForStackCreateComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackCreateComplete.ts rename to clients/client-cloudformation/src/waiters/waitForStackCreateComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForStackDeleteComplete.ts b/clients/client-cloudformation/src/waiters/waitForStackDeleteComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackDeleteComplete.ts rename to clients/client-cloudformation/src/waiters/waitForStackDeleteComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForStackExists.ts b/clients/client-cloudformation/src/waiters/waitForStackExists.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackExists.ts rename to clients/client-cloudformation/src/waiters/waitForStackExists.ts diff --git a/clients/client-cloudformation/waiters/waitForStackImportComplete.ts b/clients/client-cloudformation/src/waiters/waitForStackImportComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackImportComplete.ts rename to clients/client-cloudformation/src/waiters/waitForStackImportComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForStackRollbackComplete.ts b/clients/client-cloudformation/src/waiters/waitForStackRollbackComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackRollbackComplete.ts rename to clients/client-cloudformation/src/waiters/waitForStackRollbackComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForStackUpdateComplete.ts b/clients/client-cloudformation/src/waiters/waitForStackUpdateComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForStackUpdateComplete.ts rename to clients/client-cloudformation/src/waiters/waitForStackUpdateComplete.ts diff --git a/clients/client-cloudformation/waiters/waitForTypeRegistrationComplete.ts b/clients/client-cloudformation/src/waiters/waitForTypeRegistrationComplete.ts similarity index 100% rename from clients/client-cloudformation/waiters/waitForTypeRegistrationComplete.ts rename to clients/client-cloudformation/src/waiters/waitForTypeRegistrationComplete.ts diff --git a/clients/client-cloudformation/tsconfig.es.json b/clients/client-cloudformation/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudformation/tsconfig.es.json +++ b/clients/client-cloudformation/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudformation/tsconfig.json b/clients/client-cloudformation/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudformation/tsconfig.json +++ b/clients/client-cloudformation/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudformation/tsconfig.types.json b/clients/client-cloudformation/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudformation/tsconfig.types.json +++ b/clients/client-cloudformation/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudfront/.gitignore b/clients/client-cloudfront/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudfront/.gitignore +++ b/clients/client-cloudfront/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudfront/package.json b/clients/client-cloudfront/package.json index 56dad54e7651..c3c506d01194 100644 --- a/clients/client-cloudfront/package.json +++ b/clients/client-cloudfront/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudfront", "repository": { "type": "git", diff --git a/clients/client-cloudfront/runtimeConfig.browser.ts b/clients/client-cloudfront/runtimeConfig.browser.ts deleted file mode 100644 index 902dfd8d85b9..000000000000 --- a/clients/client-cloudfront/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudFrontClientConfig } from "./CloudFrontClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudFrontClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudfront/runtimeConfig.ts b/clients/client-cloudfront/runtimeConfig.ts deleted file mode 100644 index a3b196729d81..000000000000 --- a/clients/client-cloudfront/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudFrontClientConfig } from "./CloudFrontClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudFrontClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudfront/CloudFront.ts b/clients/client-cloudfront/src/CloudFront.ts similarity index 100% rename from clients/client-cloudfront/CloudFront.ts rename to clients/client-cloudfront/src/CloudFront.ts diff --git a/clients/client-cloudfront/CloudFrontClient.ts b/clients/client-cloudfront/src/CloudFrontClient.ts similarity index 100% rename from clients/client-cloudfront/CloudFrontClient.ts rename to clients/client-cloudfront/src/CloudFrontClient.ts diff --git a/clients/client-cloudfront/commands/AssociateAliasCommand.ts b/clients/client-cloudfront/src/commands/AssociateAliasCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/AssociateAliasCommand.ts rename to clients/client-cloudfront/src/commands/AssociateAliasCommand.ts diff --git a/clients/client-cloudfront/commands/CreateCachePolicyCommand.ts b/clients/client-cloudfront/src/commands/CreateCachePolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateCachePolicyCommand.ts rename to clients/client-cloudfront/src/commands/CreateCachePolicyCommand.ts diff --git a/clients/client-cloudfront/commands/CreateCloudFrontOriginAccessIdentityCommand.ts b/clients/client-cloudfront/src/commands/CreateCloudFrontOriginAccessIdentityCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateCloudFrontOriginAccessIdentityCommand.ts rename to clients/client-cloudfront/src/commands/CreateCloudFrontOriginAccessIdentityCommand.ts diff --git a/clients/client-cloudfront/commands/CreateDistributionCommand.ts b/clients/client-cloudfront/src/commands/CreateDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateDistributionCommand.ts rename to clients/client-cloudfront/src/commands/CreateDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/CreateDistributionWithTagsCommand.ts b/clients/client-cloudfront/src/commands/CreateDistributionWithTagsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateDistributionWithTagsCommand.ts rename to clients/client-cloudfront/src/commands/CreateDistributionWithTagsCommand.ts diff --git a/clients/client-cloudfront/commands/CreateFieldLevelEncryptionConfigCommand.ts b/clients/client-cloudfront/src/commands/CreateFieldLevelEncryptionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateFieldLevelEncryptionConfigCommand.ts rename to clients/client-cloudfront/src/commands/CreateFieldLevelEncryptionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/CreateFieldLevelEncryptionProfileCommand.ts b/clients/client-cloudfront/src/commands/CreateFieldLevelEncryptionProfileCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateFieldLevelEncryptionProfileCommand.ts rename to clients/client-cloudfront/src/commands/CreateFieldLevelEncryptionProfileCommand.ts diff --git a/clients/client-cloudfront/commands/CreateFunctionCommand.ts b/clients/client-cloudfront/src/commands/CreateFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateFunctionCommand.ts rename to clients/client-cloudfront/src/commands/CreateFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/CreateInvalidationCommand.ts b/clients/client-cloudfront/src/commands/CreateInvalidationCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateInvalidationCommand.ts rename to clients/client-cloudfront/src/commands/CreateInvalidationCommand.ts diff --git a/clients/client-cloudfront/commands/CreateKeyGroupCommand.ts b/clients/client-cloudfront/src/commands/CreateKeyGroupCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateKeyGroupCommand.ts rename to clients/client-cloudfront/src/commands/CreateKeyGroupCommand.ts diff --git a/clients/client-cloudfront/commands/CreateMonitoringSubscriptionCommand.ts b/clients/client-cloudfront/src/commands/CreateMonitoringSubscriptionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateMonitoringSubscriptionCommand.ts rename to clients/client-cloudfront/src/commands/CreateMonitoringSubscriptionCommand.ts diff --git a/clients/client-cloudfront/commands/CreateOriginRequestPolicyCommand.ts b/clients/client-cloudfront/src/commands/CreateOriginRequestPolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateOriginRequestPolicyCommand.ts rename to clients/client-cloudfront/src/commands/CreateOriginRequestPolicyCommand.ts diff --git a/clients/client-cloudfront/commands/CreatePublicKeyCommand.ts b/clients/client-cloudfront/src/commands/CreatePublicKeyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreatePublicKeyCommand.ts rename to clients/client-cloudfront/src/commands/CreatePublicKeyCommand.ts diff --git a/clients/client-cloudfront/commands/CreateRealtimeLogConfigCommand.ts b/clients/client-cloudfront/src/commands/CreateRealtimeLogConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateRealtimeLogConfigCommand.ts rename to clients/client-cloudfront/src/commands/CreateRealtimeLogConfigCommand.ts diff --git a/clients/client-cloudfront/commands/CreateStreamingDistributionCommand.ts b/clients/client-cloudfront/src/commands/CreateStreamingDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateStreamingDistributionCommand.ts rename to clients/client-cloudfront/src/commands/CreateStreamingDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/CreateStreamingDistributionWithTagsCommand.ts b/clients/client-cloudfront/src/commands/CreateStreamingDistributionWithTagsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/CreateStreamingDistributionWithTagsCommand.ts rename to clients/client-cloudfront/src/commands/CreateStreamingDistributionWithTagsCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteCachePolicyCommand.ts b/clients/client-cloudfront/src/commands/DeleteCachePolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteCachePolicyCommand.ts rename to clients/client-cloudfront/src/commands/DeleteCachePolicyCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteCloudFrontOriginAccessIdentityCommand.ts b/clients/client-cloudfront/src/commands/DeleteCloudFrontOriginAccessIdentityCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteCloudFrontOriginAccessIdentityCommand.ts rename to clients/client-cloudfront/src/commands/DeleteCloudFrontOriginAccessIdentityCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteDistributionCommand.ts b/clients/client-cloudfront/src/commands/DeleteDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteDistributionCommand.ts rename to clients/client-cloudfront/src/commands/DeleteDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteFieldLevelEncryptionConfigCommand.ts b/clients/client-cloudfront/src/commands/DeleteFieldLevelEncryptionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteFieldLevelEncryptionConfigCommand.ts rename to clients/client-cloudfront/src/commands/DeleteFieldLevelEncryptionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteFieldLevelEncryptionProfileCommand.ts b/clients/client-cloudfront/src/commands/DeleteFieldLevelEncryptionProfileCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteFieldLevelEncryptionProfileCommand.ts rename to clients/client-cloudfront/src/commands/DeleteFieldLevelEncryptionProfileCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteFunctionCommand.ts b/clients/client-cloudfront/src/commands/DeleteFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteFunctionCommand.ts rename to clients/client-cloudfront/src/commands/DeleteFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteKeyGroupCommand.ts b/clients/client-cloudfront/src/commands/DeleteKeyGroupCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteKeyGroupCommand.ts rename to clients/client-cloudfront/src/commands/DeleteKeyGroupCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteMonitoringSubscriptionCommand.ts b/clients/client-cloudfront/src/commands/DeleteMonitoringSubscriptionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteMonitoringSubscriptionCommand.ts rename to clients/client-cloudfront/src/commands/DeleteMonitoringSubscriptionCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteOriginRequestPolicyCommand.ts b/clients/client-cloudfront/src/commands/DeleteOriginRequestPolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteOriginRequestPolicyCommand.ts rename to clients/client-cloudfront/src/commands/DeleteOriginRequestPolicyCommand.ts diff --git a/clients/client-cloudfront/commands/DeletePublicKeyCommand.ts b/clients/client-cloudfront/src/commands/DeletePublicKeyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeletePublicKeyCommand.ts rename to clients/client-cloudfront/src/commands/DeletePublicKeyCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteRealtimeLogConfigCommand.ts b/clients/client-cloudfront/src/commands/DeleteRealtimeLogConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteRealtimeLogConfigCommand.ts rename to clients/client-cloudfront/src/commands/DeleteRealtimeLogConfigCommand.ts diff --git a/clients/client-cloudfront/commands/DeleteStreamingDistributionCommand.ts b/clients/client-cloudfront/src/commands/DeleteStreamingDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DeleteStreamingDistributionCommand.ts rename to clients/client-cloudfront/src/commands/DeleteStreamingDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/DescribeFunctionCommand.ts b/clients/client-cloudfront/src/commands/DescribeFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/DescribeFunctionCommand.ts rename to clients/client-cloudfront/src/commands/DescribeFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/GetCachePolicyCommand.ts b/clients/client-cloudfront/src/commands/GetCachePolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetCachePolicyCommand.ts rename to clients/client-cloudfront/src/commands/GetCachePolicyCommand.ts diff --git a/clients/client-cloudfront/commands/GetCachePolicyConfigCommand.ts b/clients/client-cloudfront/src/commands/GetCachePolicyConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetCachePolicyConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetCachePolicyConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetCloudFrontOriginAccessIdentityCommand.ts b/clients/client-cloudfront/src/commands/GetCloudFrontOriginAccessIdentityCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetCloudFrontOriginAccessIdentityCommand.ts rename to clients/client-cloudfront/src/commands/GetCloudFrontOriginAccessIdentityCommand.ts diff --git a/clients/client-cloudfront/commands/GetCloudFrontOriginAccessIdentityConfigCommand.ts b/clients/client-cloudfront/src/commands/GetCloudFrontOriginAccessIdentityConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetCloudFrontOriginAccessIdentityConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetCloudFrontOriginAccessIdentityConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetDistributionCommand.ts b/clients/client-cloudfront/src/commands/GetDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetDistributionCommand.ts rename to clients/client-cloudfront/src/commands/GetDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/GetDistributionConfigCommand.ts b/clients/client-cloudfront/src/commands/GetDistributionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetDistributionConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetDistributionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetFieldLevelEncryptionCommand.ts b/clients/client-cloudfront/src/commands/GetFieldLevelEncryptionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetFieldLevelEncryptionCommand.ts rename to clients/client-cloudfront/src/commands/GetFieldLevelEncryptionCommand.ts diff --git a/clients/client-cloudfront/commands/GetFieldLevelEncryptionConfigCommand.ts b/clients/client-cloudfront/src/commands/GetFieldLevelEncryptionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetFieldLevelEncryptionConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetFieldLevelEncryptionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetFieldLevelEncryptionProfileCommand.ts b/clients/client-cloudfront/src/commands/GetFieldLevelEncryptionProfileCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetFieldLevelEncryptionProfileCommand.ts rename to clients/client-cloudfront/src/commands/GetFieldLevelEncryptionProfileCommand.ts diff --git a/clients/client-cloudfront/commands/GetFieldLevelEncryptionProfileConfigCommand.ts b/clients/client-cloudfront/src/commands/GetFieldLevelEncryptionProfileConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetFieldLevelEncryptionProfileConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetFieldLevelEncryptionProfileConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetFunctionCommand.ts b/clients/client-cloudfront/src/commands/GetFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetFunctionCommand.ts rename to clients/client-cloudfront/src/commands/GetFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/GetInvalidationCommand.ts b/clients/client-cloudfront/src/commands/GetInvalidationCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetInvalidationCommand.ts rename to clients/client-cloudfront/src/commands/GetInvalidationCommand.ts diff --git a/clients/client-cloudfront/commands/GetKeyGroupCommand.ts b/clients/client-cloudfront/src/commands/GetKeyGroupCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetKeyGroupCommand.ts rename to clients/client-cloudfront/src/commands/GetKeyGroupCommand.ts diff --git a/clients/client-cloudfront/commands/GetKeyGroupConfigCommand.ts b/clients/client-cloudfront/src/commands/GetKeyGroupConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetKeyGroupConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetKeyGroupConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetMonitoringSubscriptionCommand.ts b/clients/client-cloudfront/src/commands/GetMonitoringSubscriptionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetMonitoringSubscriptionCommand.ts rename to clients/client-cloudfront/src/commands/GetMonitoringSubscriptionCommand.ts diff --git a/clients/client-cloudfront/commands/GetOriginRequestPolicyCommand.ts b/clients/client-cloudfront/src/commands/GetOriginRequestPolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetOriginRequestPolicyCommand.ts rename to clients/client-cloudfront/src/commands/GetOriginRequestPolicyCommand.ts diff --git a/clients/client-cloudfront/commands/GetOriginRequestPolicyConfigCommand.ts b/clients/client-cloudfront/src/commands/GetOriginRequestPolicyConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetOriginRequestPolicyConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetOriginRequestPolicyConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetPublicKeyCommand.ts b/clients/client-cloudfront/src/commands/GetPublicKeyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetPublicKeyCommand.ts rename to clients/client-cloudfront/src/commands/GetPublicKeyCommand.ts diff --git a/clients/client-cloudfront/commands/GetPublicKeyConfigCommand.ts b/clients/client-cloudfront/src/commands/GetPublicKeyConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetPublicKeyConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetPublicKeyConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetRealtimeLogConfigCommand.ts b/clients/client-cloudfront/src/commands/GetRealtimeLogConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetRealtimeLogConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetRealtimeLogConfigCommand.ts diff --git a/clients/client-cloudfront/commands/GetStreamingDistributionCommand.ts b/clients/client-cloudfront/src/commands/GetStreamingDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetStreamingDistributionCommand.ts rename to clients/client-cloudfront/src/commands/GetStreamingDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/GetStreamingDistributionConfigCommand.ts b/clients/client-cloudfront/src/commands/GetStreamingDistributionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/GetStreamingDistributionConfigCommand.ts rename to clients/client-cloudfront/src/commands/GetStreamingDistributionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/ListCachePoliciesCommand.ts b/clients/client-cloudfront/src/commands/ListCachePoliciesCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListCachePoliciesCommand.ts rename to clients/client-cloudfront/src/commands/ListCachePoliciesCommand.ts diff --git a/clients/client-cloudfront/commands/ListCloudFrontOriginAccessIdentitiesCommand.ts b/clients/client-cloudfront/src/commands/ListCloudFrontOriginAccessIdentitiesCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListCloudFrontOriginAccessIdentitiesCommand.ts rename to clients/client-cloudfront/src/commands/ListCloudFrontOriginAccessIdentitiesCommand.ts diff --git a/clients/client-cloudfront/commands/ListConflictingAliasesCommand.ts b/clients/client-cloudfront/src/commands/ListConflictingAliasesCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListConflictingAliasesCommand.ts rename to clients/client-cloudfront/src/commands/ListConflictingAliasesCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsByCachePolicyIdCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsByCachePolicyIdCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsByCachePolicyIdCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsByCachePolicyIdCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsByKeyGroupCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsByKeyGroupCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsByKeyGroupCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsByKeyGroupCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsByOriginRequestPolicyIdCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsByOriginRequestPolicyIdCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsByOriginRequestPolicyIdCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsByOriginRequestPolicyIdCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsByRealtimeLogConfigCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsByRealtimeLogConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsByRealtimeLogConfigCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsByRealtimeLogConfigCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsByWebACLIdCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsByWebACLIdCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsByWebACLIdCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsByWebACLIdCommand.ts diff --git a/clients/client-cloudfront/commands/ListDistributionsCommand.ts b/clients/client-cloudfront/src/commands/ListDistributionsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListDistributionsCommand.ts rename to clients/client-cloudfront/src/commands/ListDistributionsCommand.ts diff --git a/clients/client-cloudfront/commands/ListFieldLevelEncryptionConfigsCommand.ts b/clients/client-cloudfront/src/commands/ListFieldLevelEncryptionConfigsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListFieldLevelEncryptionConfigsCommand.ts rename to clients/client-cloudfront/src/commands/ListFieldLevelEncryptionConfigsCommand.ts diff --git a/clients/client-cloudfront/commands/ListFieldLevelEncryptionProfilesCommand.ts b/clients/client-cloudfront/src/commands/ListFieldLevelEncryptionProfilesCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListFieldLevelEncryptionProfilesCommand.ts rename to clients/client-cloudfront/src/commands/ListFieldLevelEncryptionProfilesCommand.ts diff --git a/clients/client-cloudfront/commands/ListFunctionsCommand.ts b/clients/client-cloudfront/src/commands/ListFunctionsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListFunctionsCommand.ts rename to clients/client-cloudfront/src/commands/ListFunctionsCommand.ts diff --git a/clients/client-cloudfront/commands/ListInvalidationsCommand.ts b/clients/client-cloudfront/src/commands/ListInvalidationsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListInvalidationsCommand.ts rename to clients/client-cloudfront/src/commands/ListInvalidationsCommand.ts diff --git a/clients/client-cloudfront/commands/ListKeyGroupsCommand.ts b/clients/client-cloudfront/src/commands/ListKeyGroupsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListKeyGroupsCommand.ts rename to clients/client-cloudfront/src/commands/ListKeyGroupsCommand.ts diff --git a/clients/client-cloudfront/commands/ListOriginRequestPoliciesCommand.ts b/clients/client-cloudfront/src/commands/ListOriginRequestPoliciesCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListOriginRequestPoliciesCommand.ts rename to clients/client-cloudfront/src/commands/ListOriginRequestPoliciesCommand.ts diff --git a/clients/client-cloudfront/commands/ListPublicKeysCommand.ts b/clients/client-cloudfront/src/commands/ListPublicKeysCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListPublicKeysCommand.ts rename to clients/client-cloudfront/src/commands/ListPublicKeysCommand.ts diff --git a/clients/client-cloudfront/commands/ListRealtimeLogConfigsCommand.ts b/clients/client-cloudfront/src/commands/ListRealtimeLogConfigsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListRealtimeLogConfigsCommand.ts rename to clients/client-cloudfront/src/commands/ListRealtimeLogConfigsCommand.ts diff --git a/clients/client-cloudfront/commands/ListStreamingDistributionsCommand.ts b/clients/client-cloudfront/src/commands/ListStreamingDistributionsCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListStreamingDistributionsCommand.ts rename to clients/client-cloudfront/src/commands/ListStreamingDistributionsCommand.ts diff --git a/clients/client-cloudfront/commands/ListTagsForResourceCommand.ts b/clients/client-cloudfront/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/ListTagsForResourceCommand.ts rename to clients/client-cloudfront/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cloudfront/commands/PublishFunctionCommand.ts b/clients/client-cloudfront/src/commands/PublishFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/PublishFunctionCommand.ts rename to clients/client-cloudfront/src/commands/PublishFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/TagResourceCommand.ts b/clients/client-cloudfront/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/TagResourceCommand.ts rename to clients/client-cloudfront/src/commands/TagResourceCommand.ts diff --git a/clients/client-cloudfront/commands/TestFunctionCommand.ts b/clients/client-cloudfront/src/commands/TestFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/TestFunctionCommand.ts rename to clients/client-cloudfront/src/commands/TestFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/UntagResourceCommand.ts b/clients/client-cloudfront/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UntagResourceCommand.ts rename to clients/client-cloudfront/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateCachePolicyCommand.ts b/clients/client-cloudfront/src/commands/UpdateCachePolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateCachePolicyCommand.ts rename to clients/client-cloudfront/src/commands/UpdateCachePolicyCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateCloudFrontOriginAccessIdentityCommand.ts b/clients/client-cloudfront/src/commands/UpdateCloudFrontOriginAccessIdentityCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateCloudFrontOriginAccessIdentityCommand.ts rename to clients/client-cloudfront/src/commands/UpdateCloudFrontOriginAccessIdentityCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateDistributionCommand.ts b/clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateDistributionCommand.ts rename to clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateFieldLevelEncryptionConfigCommand.ts b/clients/client-cloudfront/src/commands/UpdateFieldLevelEncryptionConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateFieldLevelEncryptionConfigCommand.ts rename to clients/client-cloudfront/src/commands/UpdateFieldLevelEncryptionConfigCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateFieldLevelEncryptionProfileCommand.ts b/clients/client-cloudfront/src/commands/UpdateFieldLevelEncryptionProfileCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateFieldLevelEncryptionProfileCommand.ts rename to clients/client-cloudfront/src/commands/UpdateFieldLevelEncryptionProfileCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateFunctionCommand.ts b/clients/client-cloudfront/src/commands/UpdateFunctionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateFunctionCommand.ts rename to clients/client-cloudfront/src/commands/UpdateFunctionCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateKeyGroupCommand.ts b/clients/client-cloudfront/src/commands/UpdateKeyGroupCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateKeyGroupCommand.ts rename to clients/client-cloudfront/src/commands/UpdateKeyGroupCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateOriginRequestPolicyCommand.ts b/clients/client-cloudfront/src/commands/UpdateOriginRequestPolicyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateOriginRequestPolicyCommand.ts rename to clients/client-cloudfront/src/commands/UpdateOriginRequestPolicyCommand.ts diff --git a/clients/client-cloudfront/commands/UpdatePublicKeyCommand.ts b/clients/client-cloudfront/src/commands/UpdatePublicKeyCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdatePublicKeyCommand.ts rename to clients/client-cloudfront/src/commands/UpdatePublicKeyCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateRealtimeLogConfigCommand.ts b/clients/client-cloudfront/src/commands/UpdateRealtimeLogConfigCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateRealtimeLogConfigCommand.ts rename to clients/client-cloudfront/src/commands/UpdateRealtimeLogConfigCommand.ts diff --git a/clients/client-cloudfront/commands/UpdateStreamingDistributionCommand.ts b/clients/client-cloudfront/src/commands/UpdateStreamingDistributionCommand.ts similarity index 100% rename from clients/client-cloudfront/commands/UpdateStreamingDistributionCommand.ts rename to clients/client-cloudfront/src/commands/UpdateStreamingDistributionCommand.ts diff --git a/clients/client-cloudfront/endpoints.ts b/clients/client-cloudfront/src/endpoints.ts similarity index 100% rename from clients/client-cloudfront/endpoints.ts rename to clients/client-cloudfront/src/endpoints.ts diff --git a/clients/client-cloudfront/index.ts b/clients/client-cloudfront/src/index.ts similarity index 100% rename from clients/client-cloudfront/index.ts rename to clients/client-cloudfront/src/index.ts diff --git a/clients/client-cloudfront/models/index.ts b/clients/client-cloudfront/src/models/index.ts similarity index 100% rename from clients/client-cloudfront/models/index.ts rename to clients/client-cloudfront/src/models/index.ts diff --git a/clients/client-cloudfront/models/models_0.ts b/clients/client-cloudfront/src/models/models_0.ts similarity index 100% rename from clients/client-cloudfront/models/models_0.ts rename to clients/client-cloudfront/src/models/models_0.ts diff --git a/clients/client-cloudfront/models/models_1.ts b/clients/client-cloudfront/src/models/models_1.ts similarity index 100% rename from clients/client-cloudfront/models/models_1.ts rename to clients/client-cloudfront/src/models/models_1.ts diff --git a/clients/client-cloudfront/pagination/Interfaces.ts b/clients/client-cloudfront/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudfront/pagination/Interfaces.ts rename to clients/client-cloudfront/src/pagination/Interfaces.ts diff --git a/clients/client-cloudfront/pagination/ListCloudFrontOriginAccessIdentitiesPaginator.ts b/clients/client-cloudfront/src/pagination/ListCloudFrontOriginAccessIdentitiesPaginator.ts similarity index 100% rename from clients/client-cloudfront/pagination/ListCloudFrontOriginAccessIdentitiesPaginator.ts rename to clients/client-cloudfront/src/pagination/ListCloudFrontOriginAccessIdentitiesPaginator.ts diff --git a/clients/client-cloudfront/pagination/ListDistributionsPaginator.ts b/clients/client-cloudfront/src/pagination/ListDistributionsPaginator.ts similarity index 100% rename from clients/client-cloudfront/pagination/ListDistributionsPaginator.ts rename to clients/client-cloudfront/src/pagination/ListDistributionsPaginator.ts diff --git a/clients/client-cloudfront/pagination/ListInvalidationsPaginator.ts b/clients/client-cloudfront/src/pagination/ListInvalidationsPaginator.ts similarity index 100% rename from clients/client-cloudfront/pagination/ListInvalidationsPaginator.ts rename to clients/client-cloudfront/src/pagination/ListInvalidationsPaginator.ts diff --git a/clients/client-cloudfront/pagination/ListStreamingDistributionsPaginator.ts b/clients/client-cloudfront/src/pagination/ListStreamingDistributionsPaginator.ts similarity index 100% rename from clients/client-cloudfront/pagination/ListStreamingDistributionsPaginator.ts rename to clients/client-cloudfront/src/pagination/ListStreamingDistributionsPaginator.ts diff --git a/clients/client-cloudfront/protocols/Aws_restXml.ts b/clients/client-cloudfront/src/protocols/Aws_restXml.ts similarity index 100% rename from clients/client-cloudfront/protocols/Aws_restXml.ts rename to clients/client-cloudfront/src/protocols/Aws_restXml.ts diff --git a/clients/client-cloudfront/src/runtimeConfig.browser.ts b/clients/client-cloudfront/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4b954a6e79d9 --- /dev/null +++ b/clients/client-cloudfront/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudFrontClientConfig } from "./CloudFrontClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudFrontClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudfront/runtimeConfig.native.ts b/clients/client-cloudfront/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudfront/runtimeConfig.native.ts rename to clients/client-cloudfront/src/runtimeConfig.native.ts diff --git a/clients/client-cloudfront/runtimeConfig.shared.ts b/clients/client-cloudfront/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudfront/runtimeConfig.shared.ts rename to clients/client-cloudfront/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudfront/src/runtimeConfig.ts b/clients/client-cloudfront/src/runtimeConfig.ts new file mode 100644 index 000000000000..ac0759f246c6 --- /dev/null +++ b/clients/client-cloudfront/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudFrontClientConfig } from "./CloudFrontClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudFrontClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudfront/waiters/waitForDistributionDeployed.ts b/clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts similarity index 100% rename from clients/client-cloudfront/waiters/waitForDistributionDeployed.ts rename to clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts diff --git a/clients/client-cloudfront/waiters/waitForInvalidationCompleted.ts b/clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts similarity index 100% rename from clients/client-cloudfront/waiters/waitForInvalidationCompleted.ts rename to clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts diff --git a/clients/client-cloudfront/waiters/waitForStreamingDistributionDeployed.ts b/clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts similarity index 100% rename from clients/client-cloudfront/waiters/waitForStreamingDistributionDeployed.ts rename to clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts diff --git a/clients/client-cloudfront/tsconfig.es.json b/clients/client-cloudfront/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudfront/tsconfig.es.json +++ b/clients/client-cloudfront/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudfront/tsconfig.json b/clients/client-cloudfront/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudfront/tsconfig.json +++ b/clients/client-cloudfront/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudfront/tsconfig.types.json b/clients/client-cloudfront/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudfront/tsconfig.types.json +++ b/clients/client-cloudfront/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudhsm-v2/.gitignore b/clients/client-cloudhsm-v2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudhsm-v2/.gitignore +++ b/clients/client-cloudhsm-v2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudhsm-v2/package.json b/clients/client-cloudhsm-v2/package.json index 8968601e18bd..ad3444bb9af2 100644 --- a/clients/client-cloudhsm-v2/package.json +++ b/clients/client-cloudhsm-v2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudhsm-v2", "repository": { "type": "git", diff --git a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts b/clients/client-cloudhsm-v2/runtimeConfig.browser.ts deleted file mode 100644 index 1cf511ab8607..000000000000 --- a/clients/client-cloudhsm-v2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudHSMV2ClientConfig } from "./CloudHSMV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudhsm-v2/runtimeConfig.ts b/clients/client-cloudhsm-v2/runtimeConfig.ts deleted file mode 100644 index f78c68f88918..000000000000 --- a/clients/client-cloudhsm-v2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudHSMV2ClientConfig } from "./CloudHSMV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudhsm-v2/CloudHSMV2.ts b/clients/client-cloudhsm-v2/src/CloudHSMV2.ts similarity index 100% rename from clients/client-cloudhsm-v2/CloudHSMV2.ts rename to clients/client-cloudhsm-v2/src/CloudHSMV2.ts diff --git a/clients/client-cloudhsm-v2/CloudHSMV2Client.ts b/clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts similarity index 100% rename from clients/client-cloudhsm-v2/CloudHSMV2Client.ts rename to clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts diff --git a/clients/client-cloudhsm-v2/commands/CopyBackupToRegionCommand.ts b/clients/client-cloudhsm-v2/src/commands/CopyBackupToRegionCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/CopyBackupToRegionCommand.ts rename to clients/client-cloudhsm-v2/src/commands/CopyBackupToRegionCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/CreateClusterCommand.ts b/clients/client-cloudhsm-v2/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/CreateClusterCommand.ts rename to clients/client-cloudhsm-v2/src/commands/CreateClusterCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/CreateHsmCommand.ts b/clients/client-cloudhsm-v2/src/commands/CreateHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/CreateHsmCommand.ts rename to clients/client-cloudhsm-v2/src/commands/CreateHsmCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/DeleteBackupCommand.ts b/clients/client-cloudhsm-v2/src/commands/DeleteBackupCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/DeleteBackupCommand.ts rename to clients/client-cloudhsm-v2/src/commands/DeleteBackupCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/DeleteClusterCommand.ts b/clients/client-cloudhsm-v2/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/DeleteClusterCommand.ts rename to clients/client-cloudhsm-v2/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/DeleteHsmCommand.ts b/clients/client-cloudhsm-v2/src/commands/DeleteHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/DeleteHsmCommand.ts rename to clients/client-cloudhsm-v2/src/commands/DeleteHsmCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/DescribeBackupsCommand.ts b/clients/client-cloudhsm-v2/src/commands/DescribeBackupsCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/DescribeBackupsCommand.ts rename to clients/client-cloudhsm-v2/src/commands/DescribeBackupsCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/DescribeClustersCommand.ts b/clients/client-cloudhsm-v2/src/commands/DescribeClustersCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/DescribeClustersCommand.ts rename to clients/client-cloudhsm-v2/src/commands/DescribeClustersCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/InitializeClusterCommand.ts b/clients/client-cloudhsm-v2/src/commands/InitializeClusterCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/InitializeClusterCommand.ts rename to clients/client-cloudhsm-v2/src/commands/InitializeClusterCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/ListTagsCommand.ts b/clients/client-cloudhsm-v2/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/ListTagsCommand.ts rename to clients/client-cloudhsm-v2/src/commands/ListTagsCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/ModifyBackupAttributesCommand.ts b/clients/client-cloudhsm-v2/src/commands/ModifyBackupAttributesCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/ModifyBackupAttributesCommand.ts rename to clients/client-cloudhsm-v2/src/commands/ModifyBackupAttributesCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/ModifyClusterCommand.ts b/clients/client-cloudhsm-v2/src/commands/ModifyClusterCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/ModifyClusterCommand.ts rename to clients/client-cloudhsm-v2/src/commands/ModifyClusterCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/RestoreBackupCommand.ts b/clients/client-cloudhsm-v2/src/commands/RestoreBackupCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/RestoreBackupCommand.ts rename to clients/client-cloudhsm-v2/src/commands/RestoreBackupCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/TagResourceCommand.ts b/clients/client-cloudhsm-v2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/TagResourceCommand.ts rename to clients/client-cloudhsm-v2/src/commands/TagResourceCommand.ts diff --git a/clients/client-cloudhsm-v2/commands/UntagResourceCommand.ts b/clients/client-cloudhsm-v2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cloudhsm-v2/commands/UntagResourceCommand.ts rename to clients/client-cloudhsm-v2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cloudhsm-v2/endpoints.ts b/clients/client-cloudhsm-v2/src/endpoints.ts similarity index 100% rename from clients/client-cloudhsm-v2/endpoints.ts rename to clients/client-cloudhsm-v2/src/endpoints.ts diff --git a/clients/client-cloudhsm-v2/index.ts b/clients/client-cloudhsm-v2/src/index.ts similarity index 100% rename from clients/client-cloudhsm-v2/index.ts rename to clients/client-cloudhsm-v2/src/index.ts diff --git a/clients/client-cloudhsm-v2/models/index.ts b/clients/client-cloudhsm-v2/src/models/index.ts similarity index 100% rename from clients/client-cloudhsm-v2/models/index.ts rename to clients/client-cloudhsm-v2/src/models/index.ts diff --git a/clients/client-cloudhsm-v2/models/models_0.ts b/clients/client-cloudhsm-v2/src/models/models_0.ts similarity index 100% rename from clients/client-cloudhsm-v2/models/models_0.ts rename to clients/client-cloudhsm-v2/src/models/models_0.ts diff --git a/clients/client-cloudhsm-v2/pagination/DescribeBackupsPaginator.ts b/clients/client-cloudhsm-v2/src/pagination/DescribeBackupsPaginator.ts similarity index 100% rename from clients/client-cloudhsm-v2/pagination/DescribeBackupsPaginator.ts rename to clients/client-cloudhsm-v2/src/pagination/DescribeBackupsPaginator.ts diff --git a/clients/client-cloudhsm-v2/pagination/DescribeClustersPaginator.ts b/clients/client-cloudhsm-v2/src/pagination/DescribeClustersPaginator.ts similarity index 100% rename from clients/client-cloudhsm-v2/pagination/DescribeClustersPaginator.ts rename to clients/client-cloudhsm-v2/src/pagination/DescribeClustersPaginator.ts diff --git a/clients/client-cloudhsm-v2/pagination/Interfaces.ts b/clients/client-cloudhsm-v2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudhsm-v2/pagination/Interfaces.ts rename to clients/client-cloudhsm-v2/src/pagination/Interfaces.ts diff --git a/clients/client-cloudhsm-v2/pagination/ListTagsPaginator.ts b/clients/client-cloudhsm-v2/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-cloudhsm-v2/pagination/ListTagsPaginator.ts rename to clients/client-cloudhsm-v2/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts rename to clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloudhsm-v2/src/runtimeConfig.browser.ts b/clients/client-cloudhsm-v2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..aab1629f12c2 --- /dev/null +++ b/clients/client-cloudhsm-v2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudHSMV2ClientConfig } from "./CloudHSMV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudhsm-v2/runtimeConfig.native.ts b/clients/client-cloudhsm-v2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudhsm-v2/runtimeConfig.native.ts rename to clients/client-cloudhsm-v2/src/runtimeConfig.native.ts diff --git a/clients/client-cloudhsm-v2/runtimeConfig.shared.ts b/clients/client-cloudhsm-v2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudhsm-v2/runtimeConfig.shared.ts rename to clients/client-cloudhsm-v2/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudhsm-v2/src/runtimeConfig.ts b/clients/client-cloudhsm-v2/src/runtimeConfig.ts new file mode 100644 index 000000000000..382dffc9bc4a --- /dev/null +++ b/clients/client-cloudhsm-v2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudHSMV2ClientConfig } from "./CloudHSMV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudhsm-v2/tsconfig.es.json b/clients/client-cloudhsm-v2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudhsm-v2/tsconfig.es.json +++ b/clients/client-cloudhsm-v2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudhsm-v2/tsconfig.json b/clients/client-cloudhsm-v2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudhsm-v2/tsconfig.json +++ b/clients/client-cloudhsm-v2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudhsm-v2/tsconfig.types.json b/clients/client-cloudhsm-v2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudhsm-v2/tsconfig.types.json +++ b/clients/client-cloudhsm-v2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudhsm/.gitignore b/clients/client-cloudhsm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudhsm/.gitignore +++ b/clients/client-cloudhsm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudhsm/package.json b/clients/client-cloudhsm/package.json index 001505e79ed8..38d5cb27864e 100644 --- a/clients/client-cloudhsm/package.json +++ b/clients/client-cloudhsm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudhsm", "repository": { "type": "git", diff --git a/clients/client-cloudhsm/runtimeConfig.browser.ts b/clients/client-cloudhsm/runtimeConfig.browser.ts deleted file mode 100644 index dc7812cd34f3..000000000000 --- a/clients/client-cloudhsm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudHSMClientConfig } from "./CloudHSMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudHSMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudhsm/runtimeConfig.ts b/clients/client-cloudhsm/runtimeConfig.ts deleted file mode 100644 index 4b14179c6c61..000000000000 --- a/clients/client-cloudhsm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudHSMClientConfig } from "./CloudHSMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudHSMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudhsm/CloudHSM.ts b/clients/client-cloudhsm/src/CloudHSM.ts similarity index 100% rename from clients/client-cloudhsm/CloudHSM.ts rename to clients/client-cloudhsm/src/CloudHSM.ts diff --git a/clients/client-cloudhsm/CloudHSMClient.ts b/clients/client-cloudhsm/src/CloudHSMClient.ts similarity index 100% rename from clients/client-cloudhsm/CloudHSMClient.ts rename to clients/client-cloudhsm/src/CloudHSMClient.ts diff --git a/clients/client-cloudhsm/commands/AddTagsToResourceCommand.ts b/clients/client-cloudhsm/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/AddTagsToResourceCommand.ts rename to clients/client-cloudhsm/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-cloudhsm/commands/CreateHapgCommand.ts b/clients/client-cloudhsm/src/commands/CreateHapgCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/CreateHapgCommand.ts rename to clients/client-cloudhsm/src/commands/CreateHapgCommand.ts diff --git a/clients/client-cloudhsm/commands/CreateHsmCommand.ts b/clients/client-cloudhsm/src/commands/CreateHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/CreateHsmCommand.ts rename to clients/client-cloudhsm/src/commands/CreateHsmCommand.ts diff --git a/clients/client-cloudhsm/commands/CreateLunaClientCommand.ts b/clients/client-cloudhsm/src/commands/CreateLunaClientCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/CreateLunaClientCommand.ts rename to clients/client-cloudhsm/src/commands/CreateLunaClientCommand.ts diff --git a/clients/client-cloudhsm/commands/DeleteHapgCommand.ts b/clients/client-cloudhsm/src/commands/DeleteHapgCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DeleteHapgCommand.ts rename to clients/client-cloudhsm/src/commands/DeleteHapgCommand.ts diff --git a/clients/client-cloudhsm/commands/DeleteHsmCommand.ts b/clients/client-cloudhsm/src/commands/DeleteHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DeleteHsmCommand.ts rename to clients/client-cloudhsm/src/commands/DeleteHsmCommand.ts diff --git a/clients/client-cloudhsm/commands/DeleteLunaClientCommand.ts b/clients/client-cloudhsm/src/commands/DeleteLunaClientCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DeleteLunaClientCommand.ts rename to clients/client-cloudhsm/src/commands/DeleteLunaClientCommand.ts diff --git a/clients/client-cloudhsm/commands/DescribeHapgCommand.ts b/clients/client-cloudhsm/src/commands/DescribeHapgCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DescribeHapgCommand.ts rename to clients/client-cloudhsm/src/commands/DescribeHapgCommand.ts diff --git a/clients/client-cloudhsm/commands/DescribeHsmCommand.ts b/clients/client-cloudhsm/src/commands/DescribeHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DescribeHsmCommand.ts rename to clients/client-cloudhsm/src/commands/DescribeHsmCommand.ts diff --git a/clients/client-cloudhsm/commands/DescribeLunaClientCommand.ts b/clients/client-cloudhsm/src/commands/DescribeLunaClientCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/DescribeLunaClientCommand.ts rename to clients/client-cloudhsm/src/commands/DescribeLunaClientCommand.ts diff --git a/clients/client-cloudhsm/commands/GetConfigCommand.ts b/clients/client-cloudhsm/src/commands/GetConfigCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/GetConfigCommand.ts rename to clients/client-cloudhsm/src/commands/GetConfigCommand.ts diff --git a/clients/client-cloudhsm/commands/ListAvailableZonesCommand.ts b/clients/client-cloudhsm/src/commands/ListAvailableZonesCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ListAvailableZonesCommand.ts rename to clients/client-cloudhsm/src/commands/ListAvailableZonesCommand.ts diff --git a/clients/client-cloudhsm/commands/ListHapgsCommand.ts b/clients/client-cloudhsm/src/commands/ListHapgsCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ListHapgsCommand.ts rename to clients/client-cloudhsm/src/commands/ListHapgsCommand.ts diff --git a/clients/client-cloudhsm/commands/ListHsmsCommand.ts b/clients/client-cloudhsm/src/commands/ListHsmsCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ListHsmsCommand.ts rename to clients/client-cloudhsm/src/commands/ListHsmsCommand.ts diff --git a/clients/client-cloudhsm/commands/ListLunaClientsCommand.ts b/clients/client-cloudhsm/src/commands/ListLunaClientsCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ListLunaClientsCommand.ts rename to clients/client-cloudhsm/src/commands/ListLunaClientsCommand.ts diff --git a/clients/client-cloudhsm/commands/ListTagsForResourceCommand.ts b/clients/client-cloudhsm/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ListTagsForResourceCommand.ts rename to clients/client-cloudhsm/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cloudhsm/commands/ModifyHapgCommand.ts b/clients/client-cloudhsm/src/commands/ModifyHapgCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ModifyHapgCommand.ts rename to clients/client-cloudhsm/src/commands/ModifyHapgCommand.ts diff --git a/clients/client-cloudhsm/commands/ModifyHsmCommand.ts b/clients/client-cloudhsm/src/commands/ModifyHsmCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ModifyHsmCommand.ts rename to clients/client-cloudhsm/src/commands/ModifyHsmCommand.ts diff --git a/clients/client-cloudhsm/commands/ModifyLunaClientCommand.ts b/clients/client-cloudhsm/src/commands/ModifyLunaClientCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/ModifyLunaClientCommand.ts rename to clients/client-cloudhsm/src/commands/ModifyLunaClientCommand.ts diff --git a/clients/client-cloudhsm/commands/RemoveTagsFromResourceCommand.ts b/clients/client-cloudhsm/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-cloudhsm/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-cloudhsm/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-cloudhsm/endpoints.ts b/clients/client-cloudhsm/src/endpoints.ts similarity index 100% rename from clients/client-cloudhsm/endpoints.ts rename to clients/client-cloudhsm/src/endpoints.ts diff --git a/clients/client-cloudhsm/index.ts b/clients/client-cloudhsm/src/index.ts similarity index 100% rename from clients/client-cloudhsm/index.ts rename to clients/client-cloudhsm/src/index.ts diff --git a/clients/client-cloudhsm/models/index.ts b/clients/client-cloudhsm/src/models/index.ts similarity index 100% rename from clients/client-cloudhsm/models/index.ts rename to clients/client-cloudhsm/src/models/index.ts diff --git a/clients/client-cloudhsm/models/models_0.ts b/clients/client-cloudhsm/src/models/models_0.ts similarity index 100% rename from clients/client-cloudhsm/models/models_0.ts rename to clients/client-cloudhsm/src/models/models_0.ts diff --git a/clients/client-cloudhsm/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloudhsm/protocols/Aws_json1_1.ts rename to clients/client-cloudhsm/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloudhsm/src/runtimeConfig.browser.ts b/clients/client-cloudhsm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9a7994d59bf3 --- /dev/null +++ b/clients/client-cloudhsm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudHSMClientConfig } from "./CloudHSMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudHSMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudhsm/runtimeConfig.native.ts b/clients/client-cloudhsm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudhsm/runtimeConfig.native.ts rename to clients/client-cloudhsm/src/runtimeConfig.native.ts diff --git a/clients/client-cloudhsm/runtimeConfig.shared.ts b/clients/client-cloudhsm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudhsm/runtimeConfig.shared.ts rename to clients/client-cloudhsm/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudhsm/src/runtimeConfig.ts b/clients/client-cloudhsm/src/runtimeConfig.ts new file mode 100644 index 000000000000..e7793e060e95 --- /dev/null +++ b/clients/client-cloudhsm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudHSMClientConfig } from "./CloudHSMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudHSMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudhsm/tsconfig.es.json b/clients/client-cloudhsm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudhsm/tsconfig.es.json +++ b/clients/client-cloudhsm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudhsm/tsconfig.json b/clients/client-cloudhsm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudhsm/tsconfig.json +++ b/clients/client-cloudhsm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudhsm/tsconfig.types.json b/clients/client-cloudhsm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudhsm/tsconfig.types.json +++ b/clients/client-cloudhsm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudsearch-domain/.gitignore b/clients/client-cloudsearch-domain/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudsearch-domain/.gitignore +++ b/clients/client-cloudsearch-domain/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudsearch-domain/package.json b/clients/client-cloudsearch-domain/package.json index cf9c96d98a7b..23239e510ccc 100644 --- a/clients/client-cloudsearch-domain/package.json +++ b/clients/client-cloudsearch-domain/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudsearch-domain", "repository": { "type": "git", diff --git a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts b/clients/client-cloudsearch-domain/runtimeConfig.browser.ts deleted file mode 100644 index d5ffb3d97c90..000000000000 --- a/clients/client-cloudsearch-domain/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudSearchDomainClientConfig } from "./CloudSearchDomainClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudsearch-domain/runtimeConfig.ts b/clients/client-cloudsearch-domain/runtimeConfig.ts deleted file mode 100644 index cd7499260105..000000000000 --- a/clients/client-cloudsearch-domain/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudSearchDomainClientConfig } from "./CloudSearchDomainClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudsearch-domain/CloudSearchDomain.ts b/clients/client-cloudsearch-domain/src/CloudSearchDomain.ts similarity index 100% rename from clients/client-cloudsearch-domain/CloudSearchDomain.ts rename to clients/client-cloudsearch-domain/src/CloudSearchDomain.ts diff --git a/clients/client-cloudsearch-domain/CloudSearchDomainClient.ts b/clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts similarity index 100% rename from clients/client-cloudsearch-domain/CloudSearchDomainClient.ts rename to clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts diff --git a/clients/client-cloudsearch-domain/commands/SearchCommand.ts b/clients/client-cloudsearch-domain/src/commands/SearchCommand.ts similarity index 100% rename from clients/client-cloudsearch-domain/commands/SearchCommand.ts rename to clients/client-cloudsearch-domain/src/commands/SearchCommand.ts diff --git a/clients/client-cloudsearch-domain/commands/SuggestCommand.ts b/clients/client-cloudsearch-domain/src/commands/SuggestCommand.ts similarity index 100% rename from clients/client-cloudsearch-domain/commands/SuggestCommand.ts rename to clients/client-cloudsearch-domain/src/commands/SuggestCommand.ts diff --git a/clients/client-cloudsearch-domain/commands/UploadDocumentsCommand.ts b/clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts similarity index 100% rename from clients/client-cloudsearch-domain/commands/UploadDocumentsCommand.ts rename to clients/client-cloudsearch-domain/src/commands/UploadDocumentsCommand.ts diff --git a/clients/client-cloudsearch-domain/endpoints.ts b/clients/client-cloudsearch-domain/src/endpoints.ts similarity index 100% rename from clients/client-cloudsearch-domain/endpoints.ts rename to clients/client-cloudsearch-domain/src/endpoints.ts diff --git a/clients/client-cloudsearch-domain/index.ts b/clients/client-cloudsearch-domain/src/index.ts similarity index 100% rename from clients/client-cloudsearch-domain/index.ts rename to clients/client-cloudsearch-domain/src/index.ts diff --git a/clients/client-cloudsearch-domain/models/index.ts b/clients/client-cloudsearch-domain/src/models/index.ts similarity index 100% rename from clients/client-cloudsearch-domain/models/index.ts rename to clients/client-cloudsearch-domain/src/models/index.ts diff --git a/clients/client-cloudsearch-domain/models/models_0.ts b/clients/client-cloudsearch-domain/src/models/models_0.ts similarity index 100% rename from clients/client-cloudsearch-domain/models/models_0.ts rename to clients/client-cloudsearch-domain/src/models/models_0.ts diff --git a/clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-cloudsearch-domain/protocols/Aws_restJson1.ts rename to clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts diff --git a/clients/client-cloudsearch-domain/src/runtimeConfig.browser.ts b/clients/client-cloudsearch-domain/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2542923aeeff --- /dev/null +++ b/clients/client-cloudsearch-domain/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudSearchDomainClientConfig } from "./CloudSearchDomainClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudsearch-domain/runtimeConfig.native.ts b/clients/client-cloudsearch-domain/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudsearch-domain/runtimeConfig.native.ts rename to clients/client-cloudsearch-domain/src/runtimeConfig.native.ts diff --git a/clients/client-cloudsearch-domain/runtimeConfig.shared.ts b/clients/client-cloudsearch-domain/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudsearch-domain/runtimeConfig.shared.ts rename to clients/client-cloudsearch-domain/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudsearch-domain/src/runtimeConfig.ts b/clients/client-cloudsearch-domain/src/runtimeConfig.ts new file mode 100644 index 000000000000..ddde379a8c10 --- /dev/null +++ b/clients/client-cloudsearch-domain/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudSearchDomainClientConfig } from "./CloudSearchDomainClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudsearch-domain/tsconfig.es.json b/clients/client-cloudsearch-domain/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudsearch-domain/tsconfig.es.json +++ b/clients/client-cloudsearch-domain/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudsearch-domain/tsconfig.json b/clients/client-cloudsearch-domain/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudsearch-domain/tsconfig.json +++ b/clients/client-cloudsearch-domain/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudsearch-domain/tsconfig.types.json b/clients/client-cloudsearch-domain/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudsearch-domain/tsconfig.types.json +++ b/clients/client-cloudsearch-domain/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudsearch/.gitignore b/clients/client-cloudsearch/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudsearch/.gitignore +++ b/clients/client-cloudsearch/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudsearch/package.json b/clients/client-cloudsearch/package.json index 4515bf9817b5..9e1ce1daa1b6 100644 --- a/clients/client-cloudsearch/package.json +++ b/clients/client-cloudsearch/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudsearch", "repository": { "type": "git", diff --git a/clients/client-cloudsearch/runtimeConfig.browser.ts b/clients/client-cloudsearch/runtimeConfig.browser.ts deleted file mode 100644 index 9e43091783ff..000000000000 --- a/clients/client-cloudsearch/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudSearchClientConfig } from "./CloudSearchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudSearchClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudsearch/runtimeConfig.ts b/clients/client-cloudsearch/runtimeConfig.ts deleted file mode 100644 index 370b7f5cb58f..000000000000 --- a/clients/client-cloudsearch/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudSearchClientConfig } from "./CloudSearchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudSearchClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudsearch/CloudSearch.ts b/clients/client-cloudsearch/src/CloudSearch.ts similarity index 100% rename from clients/client-cloudsearch/CloudSearch.ts rename to clients/client-cloudsearch/src/CloudSearch.ts diff --git a/clients/client-cloudsearch/CloudSearchClient.ts b/clients/client-cloudsearch/src/CloudSearchClient.ts similarity index 100% rename from clients/client-cloudsearch/CloudSearchClient.ts rename to clients/client-cloudsearch/src/CloudSearchClient.ts diff --git a/clients/client-cloudsearch/commands/BuildSuggestersCommand.ts b/clients/client-cloudsearch/src/commands/BuildSuggestersCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/BuildSuggestersCommand.ts rename to clients/client-cloudsearch/src/commands/BuildSuggestersCommand.ts diff --git a/clients/client-cloudsearch/commands/CreateDomainCommand.ts b/clients/client-cloudsearch/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/CreateDomainCommand.ts rename to clients/client-cloudsearch/src/commands/CreateDomainCommand.ts diff --git a/clients/client-cloudsearch/commands/DefineAnalysisSchemeCommand.ts b/clients/client-cloudsearch/src/commands/DefineAnalysisSchemeCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DefineAnalysisSchemeCommand.ts rename to clients/client-cloudsearch/src/commands/DefineAnalysisSchemeCommand.ts diff --git a/clients/client-cloudsearch/commands/DefineExpressionCommand.ts b/clients/client-cloudsearch/src/commands/DefineExpressionCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DefineExpressionCommand.ts rename to clients/client-cloudsearch/src/commands/DefineExpressionCommand.ts diff --git a/clients/client-cloudsearch/commands/DefineIndexFieldCommand.ts b/clients/client-cloudsearch/src/commands/DefineIndexFieldCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DefineIndexFieldCommand.ts rename to clients/client-cloudsearch/src/commands/DefineIndexFieldCommand.ts diff --git a/clients/client-cloudsearch/commands/DefineSuggesterCommand.ts b/clients/client-cloudsearch/src/commands/DefineSuggesterCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DefineSuggesterCommand.ts rename to clients/client-cloudsearch/src/commands/DefineSuggesterCommand.ts diff --git a/clients/client-cloudsearch/commands/DeleteAnalysisSchemeCommand.ts b/clients/client-cloudsearch/src/commands/DeleteAnalysisSchemeCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DeleteAnalysisSchemeCommand.ts rename to clients/client-cloudsearch/src/commands/DeleteAnalysisSchemeCommand.ts diff --git a/clients/client-cloudsearch/commands/DeleteDomainCommand.ts b/clients/client-cloudsearch/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DeleteDomainCommand.ts rename to clients/client-cloudsearch/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-cloudsearch/commands/DeleteExpressionCommand.ts b/clients/client-cloudsearch/src/commands/DeleteExpressionCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DeleteExpressionCommand.ts rename to clients/client-cloudsearch/src/commands/DeleteExpressionCommand.ts diff --git a/clients/client-cloudsearch/commands/DeleteIndexFieldCommand.ts b/clients/client-cloudsearch/src/commands/DeleteIndexFieldCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DeleteIndexFieldCommand.ts rename to clients/client-cloudsearch/src/commands/DeleteIndexFieldCommand.ts diff --git a/clients/client-cloudsearch/commands/DeleteSuggesterCommand.ts b/clients/client-cloudsearch/src/commands/DeleteSuggesterCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DeleteSuggesterCommand.ts rename to clients/client-cloudsearch/src/commands/DeleteSuggesterCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeAnalysisSchemesCommand.ts b/clients/client-cloudsearch/src/commands/DescribeAnalysisSchemesCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeAnalysisSchemesCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeAnalysisSchemesCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeAvailabilityOptionsCommand.ts b/clients/client-cloudsearch/src/commands/DescribeAvailabilityOptionsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeAvailabilityOptionsCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeAvailabilityOptionsCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeDomainEndpointOptionsCommand.ts b/clients/client-cloudsearch/src/commands/DescribeDomainEndpointOptionsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeDomainEndpointOptionsCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeDomainEndpointOptionsCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeDomainsCommand.ts b/clients/client-cloudsearch/src/commands/DescribeDomainsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeDomainsCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeDomainsCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeExpressionsCommand.ts b/clients/client-cloudsearch/src/commands/DescribeExpressionsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeExpressionsCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeExpressionsCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeIndexFieldsCommand.ts b/clients/client-cloudsearch/src/commands/DescribeIndexFieldsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeIndexFieldsCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeIndexFieldsCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeScalingParametersCommand.ts b/clients/client-cloudsearch/src/commands/DescribeScalingParametersCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeScalingParametersCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeScalingParametersCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeServiceAccessPoliciesCommand.ts b/clients/client-cloudsearch/src/commands/DescribeServiceAccessPoliciesCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeServiceAccessPoliciesCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeServiceAccessPoliciesCommand.ts diff --git a/clients/client-cloudsearch/commands/DescribeSuggestersCommand.ts b/clients/client-cloudsearch/src/commands/DescribeSuggestersCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/DescribeSuggestersCommand.ts rename to clients/client-cloudsearch/src/commands/DescribeSuggestersCommand.ts diff --git a/clients/client-cloudsearch/commands/IndexDocumentsCommand.ts b/clients/client-cloudsearch/src/commands/IndexDocumentsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/IndexDocumentsCommand.ts rename to clients/client-cloudsearch/src/commands/IndexDocumentsCommand.ts diff --git a/clients/client-cloudsearch/commands/ListDomainNamesCommand.ts b/clients/client-cloudsearch/src/commands/ListDomainNamesCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/ListDomainNamesCommand.ts rename to clients/client-cloudsearch/src/commands/ListDomainNamesCommand.ts diff --git a/clients/client-cloudsearch/commands/UpdateAvailabilityOptionsCommand.ts b/clients/client-cloudsearch/src/commands/UpdateAvailabilityOptionsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/UpdateAvailabilityOptionsCommand.ts rename to clients/client-cloudsearch/src/commands/UpdateAvailabilityOptionsCommand.ts diff --git a/clients/client-cloudsearch/commands/UpdateDomainEndpointOptionsCommand.ts b/clients/client-cloudsearch/src/commands/UpdateDomainEndpointOptionsCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/UpdateDomainEndpointOptionsCommand.ts rename to clients/client-cloudsearch/src/commands/UpdateDomainEndpointOptionsCommand.ts diff --git a/clients/client-cloudsearch/commands/UpdateScalingParametersCommand.ts b/clients/client-cloudsearch/src/commands/UpdateScalingParametersCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/UpdateScalingParametersCommand.ts rename to clients/client-cloudsearch/src/commands/UpdateScalingParametersCommand.ts diff --git a/clients/client-cloudsearch/commands/UpdateServiceAccessPoliciesCommand.ts b/clients/client-cloudsearch/src/commands/UpdateServiceAccessPoliciesCommand.ts similarity index 100% rename from clients/client-cloudsearch/commands/UpdateServiceAccessPoliciesCommand.ts rename to clients/client-cloudsearch/src/commands/UpdateServiceAccessPoliciesCommand.ts diff --git a/clients/client-cloudsearch/endpoints.ts b/clients/client-cloudsearch/src/endpoints.ts similarity index 100% rename from clients/client-cloudsearch/endpoints.ts rename to clients/client-cloudsearch/src/endpoints.ts diff --git a/clients/client-cloudsearch/index.ts b/clients/client-cloudsearch/src/index.ts similarity index 100% rename from clients/client-cloudsearch/index.ts rename to clients/client-cloudsearch/src/index.ts diff --git a/clients/client-cloudsearch/models/index.ts b/clients/client-cloudsearch/src/models/index.ts similarity index 100% rename from clients/client-cloudsearch/models/index.ts rename to clients/client-cloudsearch/src/models/index.ts diff --git a/clients/client-cloudsearch/models/models_0.ts b/clients/client-cloudsearch/src/models/models_0.ts similarity index 100% rename from clients/client-cloudsearch/models/models_0.ts rename to clients/client-cloudsearch/src/models/models_0.ts diff --git a/clients/client-cloudsearch/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-cloudsearch/protocols/Aws_query.ts rename to clients/client-cloudsearch/src/protocols/Aws_query.ts diff --git a/clients/client-cloudsearch/src/runtimeConfig.browser.ts b/clients/client-cloudsearch/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b9402184adf4 --- /dev/null +++ b/clients/client-cloudsearch/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudSearchClientConfig } from "./CloudSearchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudSearchClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudsearch/runtimeConfig.native.ts b/clients/client-cloudsearch/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudsearch/runtimeConfig.native.ts rename to clients/client-cloudsearch/src/runtimeConfig.native.ts diff --git a/clients/client-cloudsearch/runtimeConfig.shared.ts b/clients/client-cloudsearch/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudsearch/runtimeConfig.shared.ts rename to clients/client-cloudsearch/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudsearch/src/runtimeConfig.ts b/clients/client-cloudsearch/src/runtimeConfig.ts new file mode 100644 index 000000000000..de01866c4b7f --- /dev/null +++ b/clients/client-cloudsearch/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudSearchClientConfig } from "./CloudSearchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudSearchClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudsearch/tsconfig.es.json b/clients/client-cloudsearch/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudsearch/tsconfig.es.json +++ b/clients/client-cloudsearch/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudsearch/tsconfig.json b/clients/client-cloudsearch/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudsearch/tsconfig.json +++ b/clients/client-cloudsearch/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudsearch/tsconfig.types.json b/clients/client-cloudsearch/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudsearch/tsconfig.types.json +++ b/clients/client-cloudsearch/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudtrail/.gitignore b/clients/client-cloudtrail/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudtrail/.gitignore +++ b/clients/client-cloudtrail/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudtrail/package.json b/clients/client-cloudtrail/package.json index d68f9ce01a69..8eb0f2e40c8b 100644 --- a/clients/client-cloudtrail/package.json +++ b/clients/client-cloudtrail/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudtrail", "repository": { "type": "git", diff --git a/clients/client-cloudtrail/runtimeConfig.browser.ts b/clients/client-cloudtrail/runtimeConfig.browser.ts deleted file mode 100644 index f33de9fb52ce..000000000000 --- a/clients/client-cloudtrail/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudTrailClientConfig } from "./CloudTrailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudTrailClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudtrail/runtimeConfig.ts b/clients/client-cloudtrail/runtimeConfig.ts deleted file mode 100644 index a258ef5d0c2c..000000000000 --- a/clients/client-cloudtrail/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudTrailClientConfig } from "./CloudTrailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudTrailClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudtrail/CloudTrail.ts b/clients/client-cloudtrail/src/CloudTrail.ts similarity index 100% rename from clients/client-cloudtrail/CloudTrail.ts rename to clients/client-cloudtrail/src/CloudTrail.ts diff --git a/clients/client-cloudtrail/CloudTrailClient.ts b/clients/client-cloudtrail/src/CloudTrailClient.ts similarity index 100% rename from clients/client-cloudtrail/CloudTrailClient.ts rename to clients/client-cloudtrail/src/CloudTrailClient.ts diff --git a/clients/client-cloudtrail/commands/AddTagsCommand.ts b/clients/client-cloudtrail/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/AddTagsCommand.ts rename to clients/client-cloudtrail/src/commands/AddTagsCommand.ts diff --git a/clients/client-cloudtrail/commands/CreateTrailCommand.ts b/clients/client-cloudtrail/src/commands/CreateTrailCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/CreateTrailCommand.ts rename to clients/client-cloudtrail/src/commands/CreateTrailCommand.ts diff --git a/clients/client-cloudtrail/commands/DeleteTrailCommand.ts b/clients/client-cloudtrail/src/commands/DeleteTrailCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/DeleteTrailCommand.ts rename to clients/client-cloudtrail/src/commands/DeleteTrailCommand.ts diff --git a/clients/client-cloudtrail/commands/DescribeTrailsCommand.ts b/clients/client-cloudtrail/src/commands/DescribeTrailsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/DescribeTrailsCommand.ts rename to clients/client-cloudtrail/src/commands/DescribeTrailsCommand.ts diff --git a/clients/client-cloudtrail/commands/GetEventSelectorsCommand.ts b/clients/client-cloudtrail/src/commands/GetEventSelectorsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/GetEventSelectorsCommand.ts rename to clients/client-cloudtrail/src/commands/GetEventSelectorsCommand.ts diff --git a/clients/client-cloudtrail/commands/GetInsightSelectorsCommand.ts b/clients/client-cloudtrail/src/commands/GetInsightSelectorsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/GetInsightSelectorsCommand.ts rename to clients/client-cloudtrail/src/commands/GetInsightSelectorsCommand.ts diff --git a/clients/client-cloudtrail/commands/GetTrailCommand.ts b/clients/client-cloudtrail/src/commands/GetTrailCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/GetTrailCommand.ts rename to clients/client-cloudtrail/src/commands/GetTrailCommand.ts diff --git a/clients/client-cloudtrail/commands/GetTrailStatusCommand.ts b/clients/client-cloudtrail/src/commands/GetTrailStatusCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/GetTrailStatusCommand.ts rename to clients/client-cloudtrail/src/commands/GetTrailStatusCommand.ts diff --git a/clients/client-cloudtrail/commands/ListPublicKeysCommand.ts b/clients/client-cloudtrail/src/commands/ListPublicKeysCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/ListPublicKeysCommand.ts rename to clients/client-cloudtrail/src/commands/ListPublicKeysCommand.ts diff --git a/clients/client-cloudtrail/commands/ListTagsCommand.ts b/clients/client-cloudtrail/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/ListTagsCommand.ts rename to clients/client-cloudtrail/src/commands/ListTagsCommand.ts diff --git a/clients/client-cloudtrail/commands/ListTrailsCommand.ts b/clients/client-cloudtrail/src/commands/ListTrailsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/ListTrailsCommand.ts rename to clients/client-cloudtrail/src/commands/ListTrailsCommand.ts diff --git a/clients/client-cloudtrail/commands/LookupEventsCommand.ts b/clients/client-cloudtrail/src/commands/LookupEventsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/LookupEventsCommand.ts rename to clients/client-cloudtrail/src/commands/LookupEventsCommand.ts diff --git a/clients/client-cloudtrail/commands/PutEventSelectorsCommand.ts b/clients/client-cloudtrail/src/commands/PutEventSelectorsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/PutEventSelectorsCommand.ts rename to clients/client-cloudtrail/src/commands/PutEventSelectorsCommand.ts diff --git a/clients/client-cloudtrail/commands/PutInsightSelectorsCommand.ts b/clients/client-cloudtrail/src/commands/PutInsightSelectorsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/PutInsightSelectorsCommand.ts rename to clients/client-cloudtrail/src/commands/PutInsightSelectorsCommand.ts diff --git a/clients/client-cloudtrail/commands/RemoveTagsCommand.ts b/clients/client-cloudtrail/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/RemoveTagsCommand.ts rename to clients/client-cloudtrail/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-cloudtrail/commands/StartLoggingCommand.ts b/clients/client-cloudtrail/src/commands/StartLoggingCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/StartLoggingCommand.ts rename to clients/client-cloudtrail/src/commands/StartLoggingCommand.ts diff --git a/clients/client-cloudtrail/commands/StopLoggingCommand.ts b/clients/client-cloudtrail/src/commands/StopLoggingCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/StopLoggingCommand.ts rename to clients/client-cloudtrail/src/commands/StopLoggingCommand.ts diff --git a/clients/client-cloudtrail/commands/UpdateTrailCommand.ts b/clients/client-cloudtrail/src/commands/UpdateTrailCommand.ts similarity index 100% rename from clients/client-cloudtrail/commands/UpdateTrailCommand.ts rename to clients/client-cloudtrail/src/commands/UpdateTrailCommand.ts diff --git a/clients/client-cloudtrail/endpoints.ts b/clients/client-cloudtrail/src/endpoints.ts similarity index 100% rename from clients/client-cloudtrail/endpoints.ts rename to clients/client-cloudtrail/src/endpoints.ts diff --git a/clients/client-cloudtrail/index.ts b/clients/client-cloudtrail/src/index.ts similarity index 100% rename from clients/client-cloudtrail/index.ts rename to clients/client-cloudtrail/src/index.ts diff --git a/clients/client-cloudtrail/models/index.ts b/clients/client-cloudtrail/src/models/index.ts similarity index 100% rename from clients/client-cloudtrail/models/index.ts rename to clients/client-cloudtrail/src/models/index.ts diff --git a/clients/client-cloudtrail/models/models_0.ts b/clients/client-cloudtrail/src/models/models_0.ts similarity index 100% rename from clients/client-cloudtrail/models/models_0.ts rename to clients/client-cloudtrail/src/models/models_0.ts diff --git a/clients/client-cloudtrail/pagination/Interfaces.ts b/clients/client-cloudtrail/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudtrail/pagination/Interfaces.ts rename to clients/client-cloudtrail/src/pagination/Interfaces.ts diff --git a/clients/client-cloudtrail/pagination/ListPublicKeysPaginator.ts b/clients/client-cloudtrail/src/pagination/ListPublicKeysPaginator.ts similarity index 100% rename from clients/client-cloudtrail/pagination/ListPublicKeysPaginator.ts rename to clients/client-cloudtrail/src/pagination/ListPublicKeysPaginator.ts diff --git a/clients/client-cloudtrail/pagination/ListTagsPaginator.ts b/clients/client-cloudtrail/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-cloudtrail/pagination/ListTagsPaginator.ts rename to clients/client-cloudtrail/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-cloudtrail/pagination/ListTrailsPaginator.ts b/clients/client-cloudtrail/src/pagination/ListTrailsPaginator.ts similarity index 100% rename from clients/client-cloudtrail/pagination/ListTrailsPaginator.ts rename to clients/client-cloudtrail/src/pagination/ListTrailsPaginator.ts diff --git a/clients/client-cloudtrail/pagination/LookupEventsPaginator.ts b/clients/client-cloudtrail/src/pagination/LookupEventsPaginator.ts similarity index 100% rename from clients/client-cloudtrail/pagination/LookupEventsPaginator.ts rename to clients/client-cloudtrail/src/pagination/LookupEventsPaginator.ts diff --git a/clients/client-cloudtrail/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloudtrail/protocols/Aws_json1_1.ts rename to clients/client-cloudtrail/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloudtrail/src/runtimeConfig.browser.ts b/clients/client-cloudtrail/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..341234775d63 --- /dev/null +++ b/clients/client-cloudtrail/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudTrailClientConfig } from "./CloudTrailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudTrailClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudtrail/runtimeConfig.native.ts b/clients/client-cloudtrail/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudtrail/runtimeConfig.native.ts rename to clients/client-cloudtrail/src/runtimeConfig.native.ts diff --git a/clients/client-cloudtrail/runtimeConfig.shared.ts b/clients/client-cloudtrail/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudtrail/runtimeConfig.shared.ts rename to clients/client-cloudtrail/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudtrail/src/runtimeConfig.ts b/clients/client-cloudtrail/src/runtimeConfig.ts new file mode 100644 index 000000000000..23cb328bae7c --- /dev/null +++ b/clients/client-cloudtrail/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudTrailClientConfig } from "./CloudTrailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudTrailClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudtrail/tsconfig.es.json b/clients/client-cloudtrail/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudtrail/tsconfig.es.json +++ b/clients/client-cloudtrail/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudtrail/tsconfig.json b/clients/client-cloudtrail/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudtrail/tsconfig.json +++ b/clients/client-cloudtrail/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudtrail/tsconfig.types.json b/clients/client-cloudtrail/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudtrail/tsconfig.types.json +++ b/clients/client-cloudtrail/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudwatch-events/.gitignore b/clients/client-cloudwatch-events/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudwatch-events/.gitignore +++ b/clients/client-cloudwatch-events/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudwatch-events/package.json b/clients/client-cloudwatch-events/package.json index 6abc734e3eb1..edeee1847c92 100644 --- a/clients/client-cloudwatch-events/package.json +++ b/clients/client-cloudwatch-events/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch-events", "repository": { "type": "git", diff --git a/clients/client-cloudwatch-events/runtimeConfig.browser.ts b/clients/client-cloudwatch-events/runtimeConfig.browser.ts deleted file mode 100644 index 940909b13419..000000000000 --- a/clients/client-cloudwatch-events/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudWatchEventsClientConfig } from "./CloudWatchEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch-events/runtimeConfig.ts b/clients/client-cloudwatch-events/runtimeConfig.ts deleted file mode 100644 index 62a9e56db3c4..000000000000 --- a/clients/client-cloudwatch-events/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudWatchEventsClientConfig } from "./CloudWatchEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch-events/CloudWatchEvents.ts b/clients/client-cloudwatch-events/src/CloudWatchEvents.ts similarity index 100% rename from clients/client-cloudwatch-events/CloudWatchEvents.ts rename to clients/client-cloudwatch-events/src/CloudWatchEvents.ts diff --git a/clients/client-cloudwatch-events/CloudWatchEventsClient.ts b/clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts similarity index 100% rename from clients/client-cloudwatch-events/CloudWatchEventsClient.ts rename to clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts diff --git a/clients/client-cloudwatch-events/commands/ActivateEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/ActivateEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ActivateEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/ActivateEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CancelReplayCommand.ts b/clients/client-cloudwatch-events/src/commands/CancelReplayCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CancelReplayCommand.ts rename to clients/client-cloudwatch-events/src/commands/CancelReplayCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CreateApiDestinationCommand.ts b/clients/client-cloudwatch-events/src/commands/CreateApiDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CreateApiDestinationCommand.ts rename to clients/client-cloudwatch-events/src/commands/CreateApiDestinationCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CreateArchiveCommand.ts b/clients/client-cloudwatch-events/src/commands/CreateArchiveCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CreateArchiveCommand.ts rename to clients/client-cloudwatch-events/src/commands/CreateArchiveCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CreateConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CreateConnectionCommand.ts rename to clients/client-cloudwatch-events/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CreateEventBusCommand.ts b/clients/client-cloudwatch-events/src/commands/CreateEventBusCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CreateEventBusCommand.ts rename to clients/client-cloudwatch-events/src/commands/CreateEventBusCommand.ts diff --git a/clients/client-cloudwatch-events/commands/CreatePartnerEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/CreatePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/CreatePartnerEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/CreatePartnerEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeactivateEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/DeactivateEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeactivateEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeactivateEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeauthorizeConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/DeauthorizeConnectionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeauthorizeConnectionCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeauthorizeConnectionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeleteApiDestinationCommand.ts b/clients/client-cloudwatch-events/src/commands/DeleteApiDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeleteApiDestinationCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeleteApiDestinationCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeleteArchiveCommand.ts b/clients/client-cloudwatch-events/src/commands/DeleteArchiveCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeleteArchiveCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeleteArchiveCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeleteConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeleteConnectionCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeleteEventBusCommand.ts b/clients/client-cloudwatch-events/src/commands/DeleteEventBusCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeleteEventBusCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeleteEventBusCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeletePartnerEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/DeletePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeletePartnerEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeletePartnerEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DeleteRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DeleteRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeApiDestinationCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeApiDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeApiDestinationCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeApiDestinationCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeArchiveCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeArchiveCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeArchiveCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeArchiveCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeConnectionCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeConnectionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeEventBusCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeEventBusCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeEventBusCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeEventBusCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribePartnerEventSourceCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribePartnerEventSourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribePartnerEventSourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeReplayCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeReplayCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeReplayCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeReplayCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DescribeRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/DescribeRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DescribeRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/DescribeRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/DisableRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/DisableRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/DisableRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/DisableRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/EnableRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/EnableRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/EnableRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/EnableRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListApiDestinationsCommand.ts b/clients/client-cloudwatch-events/src/commands/ListApiDestinationsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListApiDestinationsCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListApiDestinationsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListArchivesCommand.ts b/clients/client-cloudwatch-events/src/commands/ListArchivesCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListArchivesCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListArchivesCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListConnectionsCommand.ts b/clients/client-cloudwatch-events/src/commands/ListConnectionsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListConnectionsCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListConnectionsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListEventBusesCommand.ts b/clients/client-cloudwatch-events/src/commands/ListEventBusesCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListEventBusesCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListEventBusesCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListEventSourcesCommand.ts b/clients/client-cloudwatch-events/src/commands/ListEventSourcesCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListEventSourcesCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListEventSourcesCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListPartnerEventSourceAccountsCommand.ts b/clients/client-cloudwatch-events/src/commands/ListPartnerEventSourceAccountsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListPartnerEventSourceAccountsCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListPartnerEventSourceAccountsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListPartnerEventSourcesCommand.ts b/clients/client-cloudwatch-events/src/commands/ListPartnerEventSourcesCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListPartnerEventSourcesCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListPartnerEventSourcesCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListReplaysCommand.ts b/clients/client-cloudwatch-events/src/commands/ListReplaysCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListReplaysCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListReplaysCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListRuleNamesByTargetCommand.ts b/clients/client-cloudwatch-events/src/commands/ListRuleNamesByTargetCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListRuleNamesByTargetCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListRuleNamesByTargetCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListRulesCommand.ts b/clients/client-cloudwatch-events/src/commands/ListRulesCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListRulesCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListRulesCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListTagsForResourceCommand.ts b/clients/client-cloudwatch-events/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListTagsForResourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/ListTargetsByRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/ListTargetsByRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/ListTargetsByRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/ListTargetsByRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/PutEventsCommand.ts b/clients/client-cloudwatch-events/src/commands/PutEventsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/PutEventsCommand.ts rename to clients/client-cloudwatch-events/src/commands/PutEventsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/PutPartnerEventsCommand.ts b/clients/client-cloudwatch-events/src/commands/PutPartnerEventsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/PutPartnerEventsCommand.ts rename to clients/client-cloudwatch-events/src/commands/PutPartnerEventsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/PutPermissionCommand.ts b/clients/client-cloudwatch-events/src/commands/PutPermissionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/PutPermissionCommand.ts rename to clients/client-cloudwatch-events/src/commands/PutPermissionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/PutRuleCommand.ts b/clients/client-cloudwatch-events/src/commands/PutRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/PutRuleCommand.ts rename to clients/client-cloudwatch-events/src/commands/PutRuleCommand.ts diff --git a/clients/client-cloudwatch-events/commands/PutTargetsCommand.ts b/clients/client-cloudwatch-events/src/commands/PutTargetsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/PutTargetsCommand.ts rename to clients/client-cloudwatch-events/src/commands/PutTargetsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/RemovePermissionCommand.ts b/clients/client-cloudwatch-events/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/RemovePermissionCommand.ts rename to clients/client-cloudwatch-events/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-cloudwatch-events/commands/RemoveTargetsCommand.ts b/clients/client-cloudwatch-events/src/commands/RemoveTargetsCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/RemoveTargetsCommand.ts rename to clients/client-cloudwatch-events/src/commands/RemoveTargetsCommand.ts diff --git a/clients/client-cloudwatch-events/commands/StartReplayCommand.ts b/clients/client-cloudwatch-events/src/commands/StartReplayCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/StartReplayCommand.ts rename to clients/client-cloudwatch-events/src/commands/StartReplayCommand.ts diff --git a/clients/client-cloudwatch-events/commands/TagResourceCommand.ts b/clients/client-cloudwatch-events/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/TagResourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/TagResourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/TestEventPatternCommand.ts b/clients/client-cloudwatch-events/src/commands/TestEventPatternCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/TestEventPatternCommand.ts rename to clients/client-cloudwatch-events/src/commands/TestEventPatternCommand.ts diff --git a/clients/client-cloudwatch-events/commands/UntagResourceCommand.ts b/clients/client-cloudwatch-events/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/UntagResourceCommand.ts rename to clients/client-cloudwatch-events/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cloudwatch-events/commands/UpdateApiDestinationCommand.ts b/clients/client-cloudwatch-events/src/commands/UpdateApiDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/UpdateApiDestinationCommand.ts rename to clients/client-cloudwatch-events/src/commands/UpdateApiDestinationCommand.ts diff --git a/clients/client-cloudwatch-events/commands/UpdateArchiveCommand.ts b/clients/client-cloudwatch-events/src/commands/UpdateArchiveCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/UpdateArchiveCommand.ts rename to clients/client-cloudwatch-events/src/commands/UpdateArchiveCommand.ts diff --git a/clients/client-cloudwatch-events/commands/UpdateConnectionCommand.ts b/clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts similarity index 100% rename from clients/client-cloudwatch-events/commands/UpdateConnectionCommand.ts rename to clients/client-cloudwatch-events/src/commands/UpdateConnectionCommand.ts diff --git a/clients/client-cloudwatch-events/endpoints.ts b/clients/client-cloudwatch-events/src/endpoints.ts similarity index 100% rename from clients/client-cloudwatch-events/endpoints.ts rename to clients/client-cloudwatch-events/src/endpoints.ts diff --git a/clients/client-cloudwatch-events/index.ts b/clients/client-cloudwatch-events/src/index.ts similarity index 100% rename from clients/client-cloudwatch-events/index.ts rename to clients/client-cloudwatch-events/src/index.ts diff --git a/clients/client-cloudwatch-events/models/index.ts b/clients/client-cloudwatch-events/src/models/index.ts similarity index 100% rename from clients/client-cloudwatch-events/models/index.ts rename to clients/client-cloudwatch-events/src/models/index.ts diff --git a/clients/client-cloudwatch-events/models/models_0.ts b/clients/client-cloudwatch-events/src/models/models_0.ts similarity index 100% rename from clients/client-cloudwatch-events/models/models_0.ts rename to clients/client-cloudwatch-events/src/models/models_0.ts diff --git a/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloudwatch-events/protocols/Aws_json1_1.ts rename to clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloudwatch-events/src/runtimeConfig.browser.ts b/clients/client-cloudwatch-events/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6c7dbf2f2712 --- /dev/null +++ b/clients/client-cloudwatch-events/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudWatchEventsClientConfig } from "./CloudWatchEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch-events/runtimeConfig.native.ts b/clients/client-cloudwatch-events/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudwatch-events/runtimeConfig.native.ts rename to clients/client-cloudwatch-events/src/runtimeConfig.native.ts diff --git a/clients/client-cloudwatch-events/runtimeConfig.shared.ts b/clients/client-cloudwatch-events/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudwatch-events/runtimeConfig.shared.ts rename to clients/client-cloudwatch-events/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudwatch-events/src/runtimeConfig.ts b/clients/client-cloudwatch-events/src/runtimeConfig.ts new file mode 100644 index 000000000000..f6ff79f477fe --- /dev/null +++ b/clients/client-cloudwatch-events/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudWatchEventsClientConfig } from "./CloudWatchEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch-events/tsconfig.es.json b/clients/client-cloudwatch-events/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudwatch-events/tsconfig.es.json +++ b/clients/client-cloudwatch-events/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudwatch-events/tsconfig.json b/clients/client-cloudwatch-events/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudwatch-events/tsconfig.json +++ b/clients/client-cloudwatch-events/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudwatch-events/tsconfig.types.json b/clients/client-cloudwatch-events/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudwatch-events/tsconfig.types.json +++ b/clients/client-cloudwatch-events/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudwatch-logs/.gitignore b/clients/client-cloudwatch-logs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudwatch-logs/.gitignore +++ b/clients/client-cloudwatch-logs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudwatch-logs/package.json b/clients/client-cloudwatch-logs/package.json index e9b50b67f12f..f5b18ed07124 100644 --- a/clients/client-cloudwatch-logs/package.json +++ b/clients/client-cloudwatch-logs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch-logs", "repository": { "type": "git", diff --git a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts b/clients/client-cloudwatch-logs/runtimeConfig.browser.ts deleted file mode 100644 index 6b8c49383f43..000000000000 --- a/clients/client-cloudwatch-logs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudWatchLogsClientConfig } from "./CloudWatchLogsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch-logs/runtimeConfig.ts b/clients/client-cloudwatch-logs/runtimeConfig.ts deleted file mode 100644 index 6b9c50f28ecf..000000000000 --- a/clients/client-cloudwatch-logs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudWatchLogsClientConfig } from "./CloudWatchLogsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch-logs/CloudWatchLogs.ts b/clients/client-cloudwatch-logs/src/CloudWatchLogs.ts similarity index 100% rename from clients/client-cloudwatch-logs/CloudWatchLogs.ts rename to clients/client-cloudwatch-logs/src/CloudWatchLogs.ts diff --git a/clients/client-cloudwatch-logs/CloudWatchLogsClient.ts b/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts similarity index 100% rename from clients/client-cloudwatch-logs/CloudWatchLogsClient.ts rename to clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts diff --git a/clients/client-cloudwatch-logs/commands/AssociateKmsKeyCommand.ts b/clients/client-cloudwatch-logs/src/commands/AssociateKmsKeyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/AssociateKmsKeyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/AssociateKmsKeyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/CancelExportTaskCommand.ts b/clients/client-cloudwatch-logs/src/commands/CancelExportTaskCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/CancelExportTaskCommand.ts rename to clients/client-cloudwatch-logs/src/commands/CancelExportTaskCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/CreateExportTaskCommand.ts b/clients/client-cloudwatch-logs/src/commands/CreateExportTaskCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/CreateExportTaskCommand.ts rename to clients/client-cloudwatch-logs/src/commands/CreateExportTaskCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/CreateLogGroupCommand.ts b/clients/client-cloudwatch-logs/src/commands/CreateLogGroupCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/CreateLogGroupCommand.ts rename to clients/client-cloudwatch-logs/src/commands/CreateLogGroupCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/CreateLogStreamCommand.ts b/clients/client-cloudwatch-logs/src/commands/CreateLogStreamCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/CreateLogStreamCommand.ts rename to clients/client-cloudwatch-logs/src/commands/CreateLogStreamCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteDestinationCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteDestinationCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteDestinationCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteLogGroupCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteLogGroupCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteLogGroupCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteLogGroupCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteLogStreamCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteLogStreamCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteLogStreamCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteLogStreamCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteMetricFilterCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteMetricFilterCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteMetricFilterCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteMetricFilterCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteQueryDefinitionCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteQueryDefinitionCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteQueryDefinitionCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteQueryDefinitionCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteResourcePolicyCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteResourcePolicyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteRetentionPolicyCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteRetentionPolicyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteRetentionPolicyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteRetentionPolicyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DeleteSubscriptionFilterCommand.ts b/clients/client-cloudwatch-logs/src/commands/DeleteSubscriptionFilterCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DeleteSubscriptionFilterCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DeleteSubscriptionFilterCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeDestinationsCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeDestinationsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeDestinationsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeDestinationsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeExportTasksCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeExportTasksCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeExportTasksCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeExportTasksCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeLogGroupsCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeLogGroupsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeLogGroupsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeLogGroupsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeLogStreamsCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeLogStreamsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeLogStreamsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeLogStreamsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeMetricFiltersCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeMetricFiltersCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeMetricFiltersCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeMetricFiltersCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeQueriesCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeQueriesCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeQueriesCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeQueriesCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeQueryDefinitionsCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeQueryDefinitionsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeQueryDefinitionsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeQueryDefinitionsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeResourcePoliciesCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeResourcePoliciesCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeResourcePoliciesCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeResourcePoliciesCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DescribeSubscriptionFiltersCommand.ts b/clients/client-cloudwatch-logs/src/commands/DescribeSubscriptionFiltersCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DescribeSubscriptionFiltersCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DescribeSubscriptionFiltersCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/DisassociateKmsKeyCommand.ts b/clients/client-cloudwatch-logs/src/commands/DisassociateKmsKeyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/DisassociateKmsKeyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/DisassociateKmsKeyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/FilterLogEventsCommand.ts b/clients/client-cloudwatch-logs/src/commands/FilterLogEventsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/FilterLogEventsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/FilterLogEventsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/GetLogEventsCommand.ts b/clients/client-cloudwatch-logs/src/commands/GetLogEventsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/GetLogEventsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/GetLogEventsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/GetLogGroupFieldsCommand.ts b/clients/client-cloudwatch-logs/src/commands/GetLogGroupFieldsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/GetLogGroupFieldsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/GetLogGroupFieldsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/GetLogRecordCommand.ts b/clients/client-cloudwatch-logs/src/commands/GetLogRecordCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/GetLogRecordCommand.ts rename to clients/client-cloudwatch-logs/src/commands/GetLogRecordCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/GetQueryResultsCommand.ts b/clients/client-cloudwatch-logs/src/commands/GetQueryResultsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/GetQueryResultsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/GetQueryResultsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/ListTagsLogGroupCommand.ts b/clients/client-cloudwatch-logs/src/commands/ListTagsLogGroupCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/ListTagsLogGroupCommand.ts rename to clients/client-cloudwatch-logs/src/commands/ListTagsLogGroupCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutDestinationCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutDestinationCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutDestinationCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutDestinationCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutDestinationPolicyCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutDestinationPolicyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutDestinationPolicyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutDestinationPolicyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutLogEventsCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutLogEventsCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutLogEventsCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutLogEventsCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutMetricFilterCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutMetricFilterCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutMetricFilterCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutMetricFilterCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutQueryDefinitionCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutQueryDefinitionCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutQueryDefinitionCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutQueryDefinitionCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutResourcePolicyCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutResourcePolicyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutRetentionPolicyCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutRetentionPolicyCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutRetentionPolicyCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutRetentionPolicyCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/PutSubscriptionFilterCommand.ts b/clients/client-cloudwatch-logs/src/commands/PutSubscriptionFilterCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/PutSubscriptionFilterCommand.ts rename to clients/client-cloudwatch-logs/src/commands/PutSubscriptionFilterCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/StartQueryCommand.ts b/clients/client-cloudwatch-logs/src/commands/StartQueryCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/StartQueryCommand.ts rename to clients/client-cloudwatch-logs/src/commands/StartQueryCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/StopQueryCommand.ts b/clients/client-cloudwatch-logs/src/commands/StopQueryCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/StopQueryCommand.ts rename to clients/client-cloudwatch-logs/src/commands/StopQueryCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/TagLogGroupCommand.ts b/clients/client-cloudwatch-logs/src/commands/TagLogGroupCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/TagLogGroupCommand.ts rename to clients/client-cloudwatch-logs/src/commands/TagLogGroupCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/TestMetricFilterCommand.ts b/clients/client-cloudwatch-logs/src/commands/TestMetricFilterCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/TestMetricFilterCommand.ts rename to clients/client-cloudwatch-logs/src/commands/TestMetricFilterCommand.ts diff --git a/clients/client-cloudwatch-logs/commands/UntagLogGroupCommand.ts b/clients/client-cloudwatch-logs/src/commands/UntagLogGroupCommand.ts similarity index 100% rename from clients/client-cloudwatch-logs/commands/UntagLogGroupCommand.ts rename to clients/client-cloudwatch-logs/src/commands/UntagLogGroupCommand.ts diff --git a/clients/client-cloudwatch-logs/endpoints.ts b/clients/client-cloudwatch-logs/src/endpoints.ts similarity index 100% rename from clients/client-cloudwatch-logs/endpoints.ts rename to clients/client-cloudwatch-logs/src/endpoints.ts diff --git a/clients/client-cloudwatch-logs/index.ts b/clients/client-cloudwatch-logs/src/index.ts similarity index 100% rename from clients/client-cloudwatch-logs/index.ts rename to clients/client-cloudwatch-logs/src/index.ts diff --git a/clients/client-cloudwatch-logs/models/index.ts b/clients/client-cloudwatch-logs/src/models/index.ts similarity index 100% rename from clients/client-cloudwatch-logs/models/index.ts rename to clients/client-cloudwatch-logs/src/models/index.ts diff --git a/clients/client-cloudwatch-logs/models/models_0.ts b/clients/client-cloudwatch-logs/src/models/models_0.ts similarity index 100% rename from clients/client-cloudwatch-logs/models/models_0.ts rename to clients/client-cloudwatch-logs/src/models/models_0.ts diff --git a/clients/client-cloudwatch-logs/pagination/DescribeDestinationsPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/DescribeDestinationsPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/DescribeDestinationsPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/DescribeDestinationsPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/DescribeLogGroupsPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/DescribeLogGroupsPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/DescribeLogGroupsPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/DescribeLogGroupsPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/DescribeLogStreamsPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/DescribeLogStreamsPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/DescribeLogStreamsPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/DescribeLogStreamsPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/DescribeMetricFiltersPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/DescribeMetricFiltersPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/DescribeMetricFiltersPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/DescribeMetricFiltersPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/DescribeSubscriptionFiltersPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/DescribeSubscriptionFiltersPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/DescribeSubscriptionFiltersPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/DescribeSubscriptionFiltersPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/FilterLogEventsPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/FilterLogEventsPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/FilterLogEventsPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/FilterLogEventsPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/GetLogEventsPaginator.ts b/clients/client-cloudwatch-logs/src/pagination/GetLogEventsPaginator.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/GetLogEventsPaginator.ts rename to clients/client-cloudwatch-logs/src/pagination/GetLogEventsPaginator.ts diff --git a/clients/client-cloudwatch-logs/pagination/Interfaces.ts b/clients/client-cloudwatch-logs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudwatch-logs/pagination/Interfaces.ts rename to clients/client-cloudwatch-logs/src/pagination/Interfaces.ts diff --git a/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts rename to clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cloudwatch-logs/src/runtimeConfig.browser.ts b/clients/client-cloudwatch-logs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5e13fbbacd2a --- /dev/null +++ b/clients/client-cloudwatch-logs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudWatchLogsClientConfig } from "./CloudWatchLogsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch-logs/runtimeConfig.native.ts b/clients/client-cloudwatch-logs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudwatch-logs/runtimeConfig.native.ts rename to clients/client-cloudwatch-logs/src/runtimeConfig.native.ts diff --git a/clients/client-cloudwatch-logs/runtimeConfig.shared.ts b/clients/client-cloudwatch-logs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudwatch-logs/runtimeConfig.shared.ts rename to clients/client-cloudwatch-logs/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudwatch-logs/src/runtimeConfig.ts b/clients/client-cloudwatch-logs/src/runtimeConfig.ts new file mode 100644 index 000000000000..e6274431d242 --- /dev/null +++ b/clients/client-cloudwatch-logs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudWatchLogsClientConfig } from "./CloudWatchLogsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch-logs/tsconfig.es.json b/clients/client-cloudwatch-logs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudwatch-logs/tsconfig.es.json +++ b/clients/client-cloudwatch-logs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudwatch-logs/tsconfig.json b/clients/client-cloudwatch-logs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudwatch-logs/tsconfig.json +++ b/clients/client-cloudwatch-logs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudwatch-logs/tsconfig.types.json b/clients/client-cloudwatch-logs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudwatch-logs/tsconfig.types.json +++ b/clients/client-cloudwatch-logs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cloudwatch/.gitignore b/clients/client-cloudwatch/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cloudwatch/.gitignore +++ b/clients/client-cloudwatch/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cloudwatch/package.json b/clients/client-cloudwatch/package.json index 9b07002f68b9..24378e812cf5 100644 --- a/clients/client-cloudwatch/package.json +++ b/clients/client-cloudwatch/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cloudwatch", "repository": { "type": "git", diff --git a/clients/client-cloudwatch/runtimeConfig.browser.ts b/clients/client-cloudwatch/runtimeConfig.browser.ts deleted file mode 100644 index 608ed4efec95..000000000000 --- a/clients/client-cloudwatch/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CloudWatchClientConfig } from "./CloudWatchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch/runtimeConfig.ts b/clients/client-cloudwatch/runtimeConfig.ts deleted file mode 100644 index 872c7d1e731e..000000000000 --- a/clients/client-cloudwatch/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CloudWatchClientConfig } from "./CloudWatchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CloudWatchClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cloudwatch/CloudWatch.ts b/clients/client-cloudwatch/src/CloudWatch.ts similarity index 100% rename from clients/client-cloudwatch/CloudWatch.ts rename to clients/client-cloudwatch/src/CloudWatch.ts diff --git a/clients/client-cloudwatch/CloudWatchClient.ts b/clients/client-cloudwatch/src/CloudWatchClient.ts similarity index 100% rename from clients/client-cloudwatch/CloudWatchClient.ts rename to clients/client-cloudwatch/src/CloudWatchClient.ts diff --git a/clients/client-cloudwatch/commands/DeleteAlarmsCommand.ts b/clients/client-cloudwatch/src/commands/DeleteAlarmsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DeleteAlarmsCommand.ts rename to clients/client-cloudwatch/src/commands/DeleteAlarmsCommand.ts diff --git a/clients/client-cloudwatch/commands/DeleteAnomalyDetectorCommand.ts b/clients/client-cloudwatch/src/commands/DeleteAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DeleteAnomalyDetectorCommand.ts rename to clients/client-cloudwatch/src/commands/DeleteAnomalyDetectorCommand.ts diff --git a/clients/client-cloudwatch/commands/DeleteDashboardsCommand.ts b/clients/client-cloudwatch/src/commands/DeleteDashboardsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DeleteDashboardsCommand.ts rename to clients/client-cloudwatch/src/commands/DeleteDashboardsCommand.ts diff --git a/clients/client-cloudwatch/commands/DeleteInsightRulesCommand.ts b/clients/client-cloudwatch/src/commands/DeleteInsightRulesCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DeleteInsightRulesCommand.ts rename to clients/client-cloudwatch/src/commands/DeleteInsightRulesCommand.ts diff --git a/clients/client-cloudwatch/commands/DeleteMetricStreamCommand.ts b/clients/client-cloudwatch/src/commands/DeleteMetricStreamCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DeleteMetricStreamCommand.ts rename to clients/client-cloudwatch/src/commands/DeleteMetricStreamCommand.ts diff --git a/clients/client-cloudwatch/commands/DescribeAlarmHistoryCommand.ts b/clients/client-cloudwatch/src/commands/DescribeAlarmHistoryCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DescribeAlarmHistoryCommand.ts rename to clients/client-cloudwatch/src/commands/DescribeAlarmHistoryCommand.ts diff --git a/clients/client-cloudwatch/commands/DescribeAlarmsCommand.ts b/clients/client-cloudwatch/src/commands/DescribeAlarmsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DescribeAlarmsCommand.ts rename to clients/client-cloudwatch/src/commands/DescribeAlarmsCommand.ts diff --git a/clients/client-cloudwatch/commands/DescribeAlarmsForMetricCommand.ts b/clients/client-cloudwatch/src/commands/DescribeAlarmsForMetricCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DescribeAlarmsForMetricCommand.ts rename to clients/client-cloudwatch/src/commands/DescribeAlarmsForMetricCommand.ts diff --git a/clients/client-cloudwatch/commands/DescribeAnomalyDetectorsCommand.ts b/clients/client-cloudwatch/src/commands/DescribeAnomalyDetectorsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DescribeAnomalyDetectorsCommand.ts rename to clients/client-cloudwatch/src/commands/DescribeAnomalyDetectorsCommand.ts diff --git a/clients/client-cloudwatch/commands/DescribeInsightRulesCommand.ts b/clients/client-cloudwatch/src/commands/DescribeInsightRulesCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DescribeInsightRulesCommand.ts rename to clients/client-cloudwatch/src/commands/DescribeInsightRulesCommand.ts diff --git a/clients/client-cloudwatch/commands/DisableAlarmActionsCommand.ts b/clients/client-cloudwatch/src/commands/DisableAlarmActionsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DisableAlarmActionsCommand.ts rename to clients/client-cloudwatch/src/commands/DisableAlarmActionsCommand.ts diff --git a/clients/client-cloudwatch/commands/DisableInsightRulesCommand.ts b/clients/client-cloudwatch/src/commands/DisableInsightRulesCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/DisableInsightRulesCommand.ts rename to clients/client-cloudwatch/src/commands/DisableInsightRulesCommand.ts diff --git a/clients/client-cloudwatch/commands/EnableAlarmActionsCommand.ts b/clients/client-cloudwatch/src/commands/EnableAlarmActionsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/EnableAlarmActionsCommand.ts rename to clients/client-cloudwatch/src/commands/EnableAlarmActionsCommand.ts diff --git a/clients/client-cloudwatch/commands/EnableInsightRulesCommand.ts b/clients/client-cloudwatch/src/commands/EnableInsightRulesCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/EnableInsightRulesCommand.ts rename to clients/client-cloudwatch/src/commands/EnableInsightRulesCommand.ts diff --git a/clients/client-cloudwatch/commands/GetDashboardCommand.ts b/clients/client-cloudwatch/src/commands/GetDashboardCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetDashboardCommand.ts rename to clients/client-cloudwatch/src/commands/GetDashboardCommand.ts diff --git a/clients/client-cloudwatch/commands/GetInsightRuleReportCommand.ts b/clients/client-cloudwatch/src/commands/GetInsightRuleReportCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetInsightRuleReportCommand.ts rename to clients/client-cloudwatch/src/commands/GetInsightRuleReportCommand.ts diff --git a/clients/client-cloudwatch/commands/GetMetricDataCommand.ts b/clients/client-cloudwatch/src/commands/GetMetricDataCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetMetricDataCommand.ts rename to clients/client-cloudwatch/src/commands/GetMetricDataCommand.ts diff --git a/clients/client-cloudwatch/commands/GetMetricStatisticsCommand.ts b/clients/client-cloudwatch/src/commands/GetMetricStatisticsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetMetricStatisticsCommand.ts rename to clients/client-cloudwatch/src/commands/GetMetricStatisticsCommand.ts diff --git a/clients/client-cloudwatch/commands/GetMetricStreamCommand.ts b/clients/client-cloudwatch/src/commands/GetMetricStreamCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetMetricStreamCommand.ts rename to clients/client-cloudwatch/src/commands/GetMetricStreamCommand.ts diff --git a/clients/client-cloudwatch/commands/GetMetricWidgetImageCommand.ts b/clients/client-cloudwatch/src/commands/GetMetricWidgetImageCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/GetMetricWidgetImageCommand.ts rename to clients/client-cloudwatch/src/commands/GetMetricWidgetImageCommand.ts diff --git a/clients/client-cloudwatch/commands/ListDashboardsCommand.ts b/clients/client-cloudwatch/src/commands/ListDashboardsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/ListDashboardsCommand.ts rename to clients/client-cloudwatch/src/commands/ListDashboardsCommand.ts diff --git a/clients/client-cloudwatch/commands/ListMetricStreamsCommand.ts b/clients/client-cloudwatch/src/commands/ListMetricStreamsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/ListMetricStreamsCommand.ts rename to clients/client-cloudwatch/src/commands/ListMetricStreamsCommand.ts diff --git a/clients/client-cloudwatch/commands/ListMetricsCommand.ts b/clients/client-cloudwatch/src/commands/ListMetricsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/ListMetricsCommand.ts rename to clients/client-cloudwatch/src/commands/ListMetricsCommand.ts diff --git a/clients/client-cloudwatch/commands/ListTagsForResourceCommand.ts b/clients/client-cloudwatch/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/ListTagsForResourceCommand.ts rename to clients/client-cloudwatch/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cloudwatch/commands/PutAnomalyDetectorCommand.ts b/clients/client-cloudwatch/src/commands/PutAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutAnomalyDetectorCommand.ts rename to clients/client-cloudwatch/src/commands/PutAnomalyDetectorCommand.ts diff --git a/clients/client-cloudwatch/commands/PutCompositeAlarmCommand.ts b/clients/client-cloudwatch/src/commands/PutCompositeAlarmCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutCompositeAlarmCommand.ts rename to clients/client-cloudwatch/src/commands/PutCompositeAlarmCommand.ts diff --git a/clients/client-cloudwatch/commands/PutDashboardCommand.ts b/clients/client-cloudwatch/src/commands/PutDashboardCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutDashboardCommand.ts rename to clients/client-cloudwatch/src/commands/PutDashboardCommand.ts diff --git a/clients/client-cloudwatch/commands/PutInsightRuleCommand.ts b/clients/client-cloudwatch/src/commands/PutInsightRuleCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutInsightRuleCommand.ts rename to clients/client-cloudwatch/src/commands/PutInsightRuleCommand.ts diff --git a/clients/client-cloudwatch/commands/PutMetricAlarmCommand.ts b/clients/client-cloudwatch/src/commands/PutMetricAlarmCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutMetricAlarmCommand.ts rename to clients/client-cloudwatch/src/commands/PutMetricAlarmCommand.ts diff --git a/clients/client-cloudwatch/commands/PutMetricDataCommand.ts b/clients/client-cloudwatch/src/commands/PutMetricDataCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutMetricDataCommand.ts rename to clients/client-cloudwatch/src/commands/PutMetricDataCommand.ts diff --git a/clients/client-cloudwatch/commands/PutMetricStreamCommand.ts b/clients/client-cloudwatch/src/commands/PutMetricStreamCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/PutMetricStreamCommand.ts rename to clients/client-cloudwatch/src/commands/PutMetricStreamCommand.ts diff --git a/clients/client-cloudwatch/commands/SetAlarmStateCommand.ts b/clients/client-cloudwatch/src/commands/SetAlarmStateCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/SetAlarmStateCommand.ts rename to clients/client-cloudwatch/src/commands/SetAlarmStateCommand.ts diff --git a/clients/client-cloudwatch/commands/StartMetricStreamsCommand.ts b/clients/client-cloudwatch/src/commands/StartMetricStreamsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/StartMetricStreamsCommand.ts rename to clients/client-cloudwatch/src/commands/StartMetricStreamsCommand.ts diff --git a/clients/client-cloudwatch/commands/StopMetricStreamsCommand.ts b/clients/client-cloudwatch/src/commands/StopMetricStreamsCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/StopMetricStreamsCommand.ts rename to clients/client-cloudwatch/src/commands/StopMetricStreamsCommand.ts diff --git a/clients/client-cloudwatch/commands/TagResourceCommand.ts b/clients/client-cloudwatch/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/TagResourceCommand.ts rename to clients/client-cloudwatch/src/commands/TagResourceCommand.ts diff --git a/clients/client-cloudwatch/commands/UntagResourceCommand.ts b/clients/client-cloudwatch/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cloudwatch/commands/UntagResourceCommand.ts rename to clients/client-cloudwatch/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cloudwatch/endpoints.ts b/clients/client-cloudwatch/src/endpoints.ts similarity index 100% rename from clients/client-cloudwatch/endpoints.ts rename to clients/client-cloudwatch/src/endpoints.ts diff --git a/clients/client-cloudwatch/index.ts b/clients/client-cloudwatch/src/index.ts similarity index 100% rename from clients/client-cloudwatch/index.ts rename to clients/client-cloudwatch/src/index.ts diff --git a/clients/client-cloudwatch/models/index.ts b/clients/client-cloudwatch/src/models/index.ts similarity index 100% rename from clients/client-cloudwatch/models/index.ts rename to clients/client-cloudwatch/src/models/index.ts diff --git a/clients/client-cloudwatch/models/models_0.ts b/clients/client-cloudwatch/src/models/models_0.ts similarity index 100% rename from clients/client-cloudwatch/models/models_0.ts rename to clients/client-cloudwatch/src/models/models_0.ts diff --git a/clients/client-cloudwatch/pagination/DescribeAlarmHistoryPaginator.ts b/clients/client-cloudwatch/src/pagination/DescribeAlarmHistoryPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/DescribeAlarmHistoryPaginator.ts rename to clients/client-cloudwatch/src/pagination/DescribeAlarmHistoryPaginator.ts diff --git a/clients/client-cloudwatch/pagination/DescribeAlarmsPaginator.ts b/clients/client-cloudwatch/src/pagination/DescribeAlarmsPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/DescribeAlarmsPaginator.ts rename to clients/client-cloudwatch/src/pagination/DescribeAlarmsPaginator.ts diff --git a/clients/client-cloudwatch/pagination/DescribeInsightRulesPaginator.ts b/clients/client-cloudwatch/src/pagination/DescribeInsightRulesPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/DescribeInsightRulesPaginator.ts rename to clients/client-cloudwatch/src/pagination/DescribeInsightRulesPaginator.ts diff --git a/clients/client-cloudwatch/pagination/GetMetricDataPaginator.ts b/clients/client-cloudwatch/src/pagination/GetMetricDataPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/GetMetricDataPaginator.ts rename to clients/client-cloudwatch/src/pagination/GetMetricDataPaginator.ts diff --git a/clients/client-cloudwatch/pagination/Interfaces.ts b/clients/client-cloudwatch/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cloudwatch/pagination/Interfaces.ts rename to clients/client-cloudwatch/src/pagination/Interfaces.ts diff --git a/clients/client-cloudwatch/pagination/ListDashboardsPaginator.ts b/clients/client-cloudwatch/src/pagination/ListDashboardsPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/ListDashboardsPaginator.ts rename to clients/client-cloudwatch/src/pagination/ListDashboardsPaginator.ts diff --git a/clients/client-cloudwatch/pagination/ListMetricStreamsPaginator.ts b/clients/client-cloudwatch/src/pagination/ListMetricStreamsPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/ListMetricStreamsPaginator.ts rename to clients/client-cloudwatch/src/pagination/ListMetricStreamsPaginator.ts diff --git a/clients/client-cloudwatch/pagination/ListMetricsPaginator.ts b/clients/client-cloudwatch/src/pagination/ListMetricsPaginator.ts similarity index 100% rename from clients/client-cloudwatch/pagination/ListMetricsPaginator.ts rename to clients/client-cloudwatch/src/pagination/ListMetricsPaginator.ts diff --git a/clients/client-cloudwatch/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-cloudwatch/protocols/Aws_query.ts rename to clients/client-cloudwatch/src/protocols/Aws_query.ts diff --git a/clients/client-cloudwatch/src/runtimeConfig.browser.ts b/clients/client-cloudwatch/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2bb24af43e69 --- /dev/null +++ b/clients/client-cloudwatch/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CloudWatchClientConfig } from "./CloudWatchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch/runtimeConfig.native.ts b/clients/client-cloudwatch/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cloudwatch/runtimeConfig.native.ts rename to clients/client-cloudwatch/src/runtimeConfig.native.ts diff --git a/clients/client-cloudwatch/runtimeConfig.shared.ts b/clients/client-cloudwatch/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cloudwatch/runtimeConfig.shared.ts rename to clients/client-cloudwatch/src/runtimeConfig.shared.ts diff --git a/clients/client-cloudwatch/src/runtimeConfig.ts b/clients/client-cloudwatch/src/runtimeConfig.ts new file mode 100644 index 000000000000..1d09cf8a86d3 --- /dev/null +++ b/clients/client-cloudwatch/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CloudWatchClientConfig } from "./CloudWatchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CloudWatchClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cloudwatch/waiters/waitForAlarmExists.ts b/clients/client-cloudwatch/src/waiters/waitForAlarmExists.ts similarity index 100% rename from clients/client-cloudwatch/waiters/waitForAlarmExists.ts rename to clients/client-cloudwatch/src/waiters/waitForAlarmExists.ts diff --git a/clients/client-cloudwatch/waiters/waitForCompositeAlarmExists.ts b/clients/client-cloudwatch/src/waiters/waitForCompositeAlarmExists.ts similarity index 100% rename from clients/client-cloudwatch/waiters/waitForCompositeAlarmExists.ts rename to clients/client-cloudwatch/src/waiters/waitForCompositeAlarmExists.ts diff --git a/clients/client-cloudwatch/tsconfig.es.json b/clients/client-cloudwatch/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cloudwatch/tsconfig.es.json +++ b/clients/client-cloudwatch/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cloudwatch/tsconfig.json b/clients/client-cloudwatch/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cloudwatch/tsconfig.json +++ b/clients/client-cloudwatch/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cloudwatch/tsconfig.types.json b/clients/client-cloudwatch/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cloudwatch/tsconfig.types.json +++ b/clients/client-cloudwatch/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codeartifact/.gitignore b/clients/client-codeartifact/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codeartifact/.gitignore +++ b/clients/client-codeartifact/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codeartifact/package.json b/clients/client-codeartifact/package.json index 08b6f3cac119..cc4998fb5001 100644 --- a/clients/client-codeartifact/package.json +++ b/clients/client-codeartifact/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codeartifact", "repository": { "type": "git", diff --git a/clients/client-codeartifact/runtimeConfig.browser.ts b/clients/client-codeartifact/runtimeConfig.browser.ts deleted file mode 100644 index a1a1a53dab33..000000000000 --- a/clients/client-codeartifact/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeartifactClientConfig } from "./CodeartifactClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeartifactClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeartifact/runtimeConfig.ts b/clients/client-codeartifact/runtimeConfig.ts deleted file mode 100644 index 26b25acfb434..000000000000 --- a/clients/client-codeartifact/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeartifactClientConfig } from "./CodeartifactClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeartifactClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeartifact/Codeartifact.ts b/clients/client-codeartifact/src/Codeartifact.ts similarity index 100% rename from clients/client-codeartifact/Codeartifact.ts rename to clients/client-codeartifact/src/Codeartifact.ts diff --git a/clients/client-codeartifact/CodeartifactClient.ts b/clients/client-codeartifact/src/CodeartifactClient.ts similarity index 100% rename from clients/client-codeartifact/CodeartifactClient.ts rename to clients/client-codeartifact/src/CodeartifactClient.ts diff --git a/clients/client-codeartifact/commands/AssociateExternalConnectionCommand.ts b/clients/client-codeartifact/src/commands/AssociateExternalConnectionCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/AssociateExternalConnectionCommand.ts rename to clients/client-codeartifact/src/commands/AssociateExternalConnectionCommand.ts diff --git a/clients/client-codeartifact/commands/CopyPackageVersionsCommand.ts b/clients/client-codeartifact/src/commands/CopyPackageVersionsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/CopyPackageVersionsCommand.ts rename to clients/client-codeartifact/src/commands/CopyPackageVersionsCommand.ts diff --git a/clients/client-codeartifact/commands/CreateDomainCommand.ts b/clients/client-codeartifact/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/CreateDomainCommand.ts rename to clients/client-codeartifact/src/commands/CreateDomainCommand.ts diff --git a/clients/client-codeartifact/commands/CreateRepositoryCommand.ts b/clients/client-codeartifact/src/commands/CreateRepositoryCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/CreateRepositoryCommand.ts rename to clients/client-codeartifact/src/commands/CreateRepositoryCommand.ts diff --git a/clients/client-codeartifact/commands/DeleteDomainCommand.ts b/clients/client-codeartifact/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DeleteDomainCommand.ts rename to clients/client-codeartifact/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-codeartifact/commands/DeleteDomainPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/DeleteDomainPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DeleteDomainPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/DeleteDomainPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/DeletePackageVersionsCommand.ts b/clients/client-codeartifact/src/commands/DeletePackageVersionsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DeletePackageVersionsCommand.ts rename to clients/client-codeartifact/src/commands/DeletePackageVersionsCommand.ts diff --git a/clients/client-codeartifact/commands/DeleteRepositoryCommand.ts b/clients/client-codeartifact/src/commands/DeleteRepositoryCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DeleteRepositoryCommand.ts rename to clients/client-codeartifact/src/commands/DeleteRepositoryCommand.ts diff --git a/clients/client-codeartifact/commands/DeleteRepositoryPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/DeleteRepositoryPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DeleteRepositoryPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/DeleteRepositoryPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/DescribeDomainCommand.ts b/clients/client-codeartifact/src/commands/DescribeDomainCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DescribeDomainCommand.ts rename to clients/client-codeartifact/src/commands/DescribeDomainCommand.ts diff --git a/clients/client-codeartifact/commands/DescribePackageVersionCommand.ts b/clients/client-codeartifact/src/commands/DescribePackageVersionCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DescribePackageVersionCommand.ts rename to clients/client-codeartifact/src/commands/DescribePackageVersionCommand.ts diff --git a/clients/client-codeartifact/commands/DescribeRepositoryCommand.ts b/clients/client-codeartifact/src/commands/DescribeRepositoryCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DescribeRepositoryCommand.ts rename to clients/client-codeartifact/src/commands/DescribeRepositoryCommand.ts diff --git a/clients/client-codeartifact/commands/DisassociateExternalConnectionCommand.ts b/clients/client-codeartifact/src/commands/DisassociateExternalConnectionCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DisassociateExternalConnectionCommand.ts rename to clients/client-codeartifact/src/commands/DisassociateExternalConnectionCommand.ts diff --git a/clients/client-codeartifact/commands/DisposePackageVersionsCommand.ts b/clients/client-codeartifact/src/commands/DisposePackageVersionsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/DisposePackageVersionsCommand.ts rename to clients/client-codeartifact/src/commands/DisposePackageVersionsCommand.ts diff --git a/clients/client-codeartifact/commands/GetAuthorizationTokenCommand.ts b/clients/client-codeartifact/src/commands/GetAuthorizationTokenCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetAuthorizationTokenCommand.ts rename to clients/client-codeartifact/src/commands/GetAuthorizationTokenCommand.ts diff --git a/clients/client-codeartifact/commands/GetDomainPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/GetDomainPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetDomainPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/GetDomainPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/GetPackageVersionAssetCommand.ts b/clients/client-codeartifact/src/commands/GetPackageVersionAssetCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetPackageVersionAssetCommand.ts rename to clients/client-codeartifact/src/commands/GetPackageVersionAssetCommand.ts diff --git a/clients/client-codeartifact/commands/GetPackageVersionReadmeCommand.ts b/clients/client-codeartifact/src/commands/GetPackageVersionReadmeCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetPackageVersionReadmeCommand.ts rename to clients/client-codeartifact/src/commands/GetPackageVersionReadmeCommand.ts diff --git a/clients/client-codeartifact/commands/GetRepositoryEndpointCommand.ts b/clients/client-codeartifact/src/commands/GetRepositoryEndpointCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetRepositoryEndpointCommand.ts rename to clients/client-codeartifact/src/commands/GetRepositoryEndpointCommand.ts diff --git a/clients/client-codeartifact/commands/GetRepositoryPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/GetRepositoryPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/GetRepositoryPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/GetRepositoryPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/ListDomainsCommand.ts b/clients/client-codeartifact/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListDomainsCommand.ts rename to clients/client-codeartifact/src/commands/ListDomainsCommand.ts diff --git a/clients/client-codeartifact/commands/ListPackageVersionAssetsCommand.ts b/clients/client-codeartifact/src/commands/ListPackageVersionAssetsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListPackageVersionAssetsCommand.ts rename to clients/client-codeartifact/src/commands/ListPackageVersionAssetsCommand.ts diff --git a/clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts b/clients/client-codeartifact/src/commands/ListPackageVersionDependenciesCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts rename to clients/client-codeartifact/src/commands/ListPackageVersionDependenciesCommand.ts diff --git a/clients/client-codeartifact/commands/ListPackageVersionsCommand.ts b/clients/client-codeartifact/src/commands/ListPackageVersionsCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListPackageVersionsCommand.ts rename to clients/client-codeartifact/src/commands/ListPackageVersionsCommand.ts diff --git a/clients/client-codeartifact/commands/ListPackagesCommand.ts b/clients/client-codeartifact/src/commands/ListPackagesCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListPackagesCommand.ts rename to clients/client-codeartifact/src/commands/ListPackagesCommand.ts diff --git a/clients/client-codeartifact/commands/ListRepositoriesCommand.ts b/clients/client-codeartifact/src/commands/ListRepositoriesCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListRepositoriesCommand.ts rename to clients/client-codeartifact/src/commands/ListRepositoriesCommand.ts diff --git a/clients/client-codeartifact/commands/ListRepositoriesInDomainCommand.ts b/clients/client-codeartifact/src/commands/ListRepositoriesInDomainCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListRepositoriesInDomainCommand.ts rename to clients/client-codeartifact/src/commands/ListRepositoriesInDomainCommand.ts diff --git a/clients/client-codeartifact/commands/ListTagsForResourceCommand.ts b/clients/client-codeartifact/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/ListTagsForResourceCommand.ts rename to clients/client-codeartifact/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codeartifact/commands/PutDomainPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/PutDomainPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/PutDomainPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/PutDomainPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/PutRepositoryPermissionsPolicyCommand.ts b/clients/client-codeartifact/src/commands/PutRepositoryPermissionsPolicyCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/PutRepositoryPermissionsPolicyCommand.ts rename to clients/client-codeartifact/src/commands/PutRepositoryPermissionsPolicyCommand.ts diff --git a/clients/client-codeartifact/commands/TagResourceCommand.ts b/clients/client-codeartifact/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/TagResourceCommand.ts rename to clients/client-codeartifact/src/commands/TagResourceCommand.ts diff --git a/clients/client-codeartifact/commands/UntagResourceCommand.ts b/clients/client-codeartifact/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/UntagResourceCommand.ts rename to clients/client-codeartifact/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codeartifact/commands/UpdatePackageVersionsStatusCommand.ts b/clients/client-codeartifact/src/commands/UpdatePackageVersionsStatusCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/UpdatePackageVersionsStatusCommand.ts rename to clients/client-codeartifact/src/commands/UpdatePackageVersionsStatusCommand.ts diff --git a/clients/client-codeartifact/commands/UpdateRepositoryCommand.ts b/clients/client-codeartifact/src/commands/UpdateRepositoryCommand.ts similarity index 100% rename from clients/client-codeartifact/commands/UpdateRepositoryCommand.ts rename to clients/client-codeartifact/src/commands/UpdateRepositoryCommand.ts diff --git a/clients/client-codeartifact/endpoints.ts b/clients/client-codeartifact/src/endpoints.ts similarity index 100% rename from clients/client-codeartifact/endpoints.ts rename to clients/client-codeartifact/src/endpoints.ts diff --git a/clients/client-codeartifact/index.ts b/clients/client-codeartifact/src/index.ts similarity index 100% rename from clients/client-codeartifact/index.ts rename to clients/client-codeartifact/src/index.ts diff --git a/clients/client-codeartifact/models/index.ts b/clients/client-codeartifact/src/models/index.ts similarity index 100% rename from clients/client-codeartifact/models/index.ts rename to clients/client-codeartifact/src/models/index.ts diff --git a/clients/client-codeartifact/models/models_0.ts b/clients/client-codeartifact/src/models/models_0.ts similarity index 100% rename from clients/client-codeartifact/models/models_0.ts rename to clients/client-codeartifact/src/models/models_0.ts diff --git a/clients/client-codeartifact/pagination/Interfaces.ts b/clients/client-codeartifact/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codeartifact/pagination/Interfaces.ts rename to clients/client-codeartifact/src/pagination/Interfaces.ts diff --git a/clients/client-codeartifact/pagination/ListDomainsPaginator.ts b/clients/client-codeartifact/src/pagination/ListDomainsPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListDomainsPaginator.ts rename to clients/client-codeartifact/src/pagination/ListDomainsPaginator.ts diff --git a/clients/client-codeartifact/pagination/ListPackageVersionAssetsPaginator.ts b/clients/client-codeartifact/src/pagination/ListPackageVersionAssetsPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListPackageVersionAssetsPaginator.ts rename to clients/client-codeartifact/src/pagination/ListPackageVersionAssetsPaginator.ts diff --git a/clients/client-codeartifact/pagination/ListPackageVersionsPaginator.ts b/clients/client-codeartifact/src/pagination/ListPackageVersionsPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListPackageVersionsPaginator.ts rename to clients/client-codeartifact/src/pagination/ListPackageVersionsPaginator.ts diff --git a/clients/client-codeartifact/pagination/ListPackagesPaginator.ts b/clients/client-codeartifact/src/pagination/ListPackagesPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListPackagesPaginator.ts rename to clients/client-codeartifact/src/pagination/ListPackagesPaginator.ts diff --git a/clients/client-codeartifact/pagination/ListRepositoriesInDomainPaginator.ts b/clients/client-codeartifact/src/pagination/ListRepositoriesInDomainPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListRepositoriesInDomainPaginator.ts rename to clients/client-codeartifact/src/pagination/ListRepositoriesInDomainPaginator.ts diff --git a/clients/client-codeartifact/pagination/ListRepositoriesPaginator.ts b/clients/client-codeartifact/src/pagination/ListRepositoriesPaginator.ts similarity index 100% rename from clients/client-codeartifact/pagination/ListRepositoriesPaginator.ts rename to clients/client-codeartifact/src/pagination/ListRepositoriesPaginator.ts diff --git a/clients/client-codeartifact/protocols/Aws_restJson1.ts b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-codeartifact/protocols/Aws_restJson1.ts rename to clients/client-codeartifact/src/protocols/Aws_restJson1.ts diff --git a/clients/client-codeartifact/src/runtimeConfig.browser.ts b/clients/client-codeartifact/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2d7e74341550 --- /dev/null +++ b/clients/client-codeartifact/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeartifactClientConfig } from "./CodeartifactClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeartifactClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeartifact/runtimeConfig.native.ts b/clients/client-codeartifact/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codeartifact/runtimeConfig.native.ts rename to clients/client-codeartifact/src/runtimeConfig.native.ts diff --git a/clients/client-codeartifact/runtimeConfig.shared.ts b/clients/client-codeartifact/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codeartifact/runtimeConfig.shared.ts rename to clients/client-codeartifact/src/runtimeConfig.shared.ts diff --git a/clients/client-codeartifact/src/runtimeConfig.ts b/clients/client-codeartifact/src/runtimeConfig.ts new file mode 100644 index 000000000000..dfc122d12902 --- /dev/null +++ b/clients/client-codeartifact/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeartifactClientConfig } from "./CodeartifactClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeartifactClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeartifact/tsconfig.es.json b/clients/client-codeartifact/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codeartifact/tsconfig.es.json +++ b/clients/client-codeartifact/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codeartifact/tsconfig.json b/clients/client-codeartifact/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codeartifact/tsconfig.json +++ b/clients/client-codeartifact/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codeartifact/tsconfig.types.json b/clients/client-codeartifact/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codeartifact/tsconfig.types.json +++ b/clients/client-codeartifact/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codebuild/.gitignore b/clients/client-codebuild/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codebuild/.gitignore +++ b/clients/client-codebuild/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codebuild/package.json b/clients/client-codebuild/package.json index e5455b0970cf..153ee8ed416a 100644 --- a/clients/client-codebuild/package.json +++ b/clients/client-codebuild/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codebuild", "repository": { "type": "git", diff --git a/clients/client-codebuild/runtimeConfig.browser.ts b/clients/client-codebuild/runtimeConfig.browser.ts deleted file mode 100644 index 2c613a5caece..000000000000 --- a/clients/client-codebuild/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeBuildClientConfig } from "./CodeBuildClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeBuildClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codebuild/runtimeConfig.ts b/clients/client-codebuild/runtimeConfig.ts deleted file mode 100644 index 18aa5344db59..000000000000 --- a/clients/client-codebuild/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeBuildClientConfig } from "./CodeBuildClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeBuildClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codebuild/CodeBuild.ts b/clients/client-codebuild/src/CodeBuild.ts similarity index 100% rename from clients/client-codebuild/CodeBuild.ts rename to clients/client-codebuild/src/CodeBuild.ts diff --git a/clients/client-codebuild/CodeBuildClient.ts b/clients/client-codebuild/src/CodeBuildClient.ts similarity index 100% rename from clients/client-codebuild/CodeBuildClient.ts rename to clients/client-codebuild/src/CodeBuildClient.ts diff --git a/clients/client-codebuild/commands/BatchDeleteBuildsCommand.ts b/clients/client-codebuild/src/commands/BatchDeleteBuildsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchDeleteBuildsCommand.ts rename to clients/client-codebuild/src/commands/BatchDeleteBuildsCommand.ts diff --git a/clients/client-codebuild/commands/BatchGetBuildBatchesCommand.ts b/clients/client-codebuild/src/commands/BatchGetBuildBatchesCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchGetBuildBatchesCommand.ts rename to clients/client-codebuild/src/commands/BatchGetBuildBatchesCommand.ts diff --git a/clients/client-codebuild/commands/BatchGetBuildsCommand.ts b/clients/client-codebuild/src/commands/BatchGetBuildsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchGetBuildsCommand.ts rename to clients/client-codebuild/src/commands/BatchGetBuildsCommand.ts diff --git a/clients/client-codebuild/commands/BatchGetProjectsCommand.ts b/clients/client-codebuild/src/commands/BatchGetProjectsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchGetProjectsCommand.ts rename to clients/client-codebuild/src/commands/BatchGetProjectsCommand.ts diff --git a/clients/client-codebuild/commands/BatchGetReportGroupsCommand.ts b/clients/client-codebuild/src/commands/BatchGetReportGroupsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchGetReportGroupsCommand.ts rename to clients/client-codebuild/src/commands/BatchGetReportGroupsCommand.ts diff --git a/clients/client-codebuild/commands/BatchGetReportsCommand.ts b/clients/client-codebuild/src/commands/BatchGetReportsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/BatchGetReportsCommand.ts rename to clients/client-codebuild/src/commands/BatchGetReportsCommand.ts diff --git a/clients/client-codebuild/commands/CreateProjectCommand.ts b/clients/client-codebuild/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-codebuild/commands/CreateProjectCommand.ts rename to clients/client-codebuild/src/commands/CreateProjectCommand.ts diff --git a/clients/client-codebuild/commands/CreateReportGroupCommand.ts b/clients/client-codebuild/src/commands/CreateReportGroupCommand.ts similarity index 100% rename from clients/client-codebuild/commands/CreateReportGroupCommand.ts rename to clients/client-codebuild/src/commands/CreateReportGroupCommand.ts diff --git a/clients/client-codebuild/commands/CreateWebhookCommand.ts b/clients/client-codebuild/src/commands/CreateWebhookCommand.ts similarity index 100% rename from clients/client-codebuild/commands/CreateWebhookCommand.ts rename to clients/client-codebuild/src/commands/CreateWebhookCommand.ts diff --git a/clients/client-codebuild/commands/DeleteBuildBatchCommand.ts b/clients/client-codebuild/src/commands/DeleteBuildBatchCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteBuildBatchCommand.ts rename to clients/client-codebuild/src/commands/DeleteBuildBatchCommand.ts diff --git a/clients/client-codebuild/commands/DeleteProjectCommand.ts b/clients/client-codebuild/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteProjectCommand.ts rename to clients/client-codebuild/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-codebuild/commands/DeleteReportCommand.ts b/clients/client-codebuild/src/commands/DeleteReportCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteReportCommand.ts rename to clients/client-codebuild/src/commands/DeleteReportCommand.ts diff --git a/clients/client-codebuild/commands/DeleteReportGroupCommand.ts b/clients/client-codebuild/src/commands/DeleteReportGroupCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteReportGroupCommand.ts rename to clients/client-codebuild/src/commands/DeleteReportGroupCommand.ts diff --git a/clients/client-codebuild/commands/DeleteResourcePolicyCommand.ts b/clients/client-codebuild/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteResourcePolicyCommand.ts rename to clients/client-codebuild/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-codebuild/commands/DeleteSourceCredentialsCommand.ts b/clients/client-codebuild/src/commands/DeleteSourceCredentialsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteSourceCredentialsCommand.ts rename to clients/client-codebuild/src/commands/DeleteSourceCredentialsCommand.ts diff --git a/clients/client-codebuild/commands/DeleteWebhookCommand.ts b/clients/client-codebuild/src/commands/DeleteWebhookCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DeleteWebhookCommand.ts rename to clients/client-codebuild/src/commands/DeleteWebhookCommand.ts diff --git a/clients/client-codebuild/commands/DescribeCodeCoveragesCommand.ts b/clients/client-codebuild/src/commands/DescribeCodeCoveragesCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DescribeCodeCoveragesCommand.ts rename to clients/client-codebuild/src/commands/DescribeCodeCoveragesCommand.ts diff --git a/clients/client-codebuild/commands/DescribeTestCasesCommand.ts b/clients/client-codebuild/src/commands/DescribeTestCasesCommand.ts similarity index 100% rename from clients/client-codebuild/commands/DescribeTestCasesCommand.ts rename to clients/client-codebuild/src/commands/DescribeTestCasesCommand.ts diff --git a/clients/client-codebuild/commands/GetReportGroupTrendCommand.ts b/clients/client-codebuild/src/commands/GetReportGroupTrendCommand.ts similarity index 100% rename from clients/client-codebuild/commands/GetReportGroupTrendCommand.ts rename to clients/client-codebuild/src/commands/GetReportGroupTrendCommand.ts diff --git a/clients/client-codebuild/commands/GetResourcePolicyCommand.ts b/clients/client-codebuild/src/commands/GetResourcePolicyCommand.ts similarity index 100% rename from clients/client-codebuild/commands/GetResourcePolicyCommand.ts rename to clients/client-codebuild/src/commands/GetResourcePolicyCommand.ts diff --git a/clients/client-codebuild/commands/ImportSourceCredentialsCommand.ts b/clients/client-codebuild/src/commands/ImportSourceCredentialsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ImportSourceCredentialsCommand.ts rename to clients/client-codebuild/src/commands/ImportSourceCredentialsCommand.ts diff --git a/clients/client-codebuild/commands/InvalidateProjectCacheCommand.ts b/clients/client-codebuild/src/commands/InvalidateProjectCacheCommand.ts similarity index 100% rename from clients/client-codebuild/commands/InvalidateProjectCacheCommand.ts rename to clients/client-codebuild/src/commands/InvalidateProjectCacheCommand.ts diff --git a/clients/client-codebuild/commands/ListBuildBatchesCommand.ts b/clients/client-codebuild/src/commands/ListBuildBatchesCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListBuildBatchesCommand.ts rename to clients/client-codebuild/src/commands/ListBuildBatchesCommand.ts diff --git a/clients/client-codebuild/commands/ListBuildBatchesForProjectCommand.ts b/clients/client-codebuild/src/commands/ListBuildBatchesForProjectCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListBuildBatchesForProjectCommand.ts rename to clients/client-codebuild/src/commands/ListBuildBatchesForProjectCommand.ts diff --git a/clients/client-codebuild/commands/ListBuildsCommand.ts b/clients/client-codebuild/src/commands/ListBuildsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListBuildsCommand.ts rename to clients/client-codebuild/src/commands/ListBuildsCommand.ts diff --git a/clients/client-codebuild/commands/ListBuildsForProjectCommand.ts b/clients/client-codebuild/src/commands/ListBuildsForProjectCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListBuildsForProjectCommand.ts rename to clients/client-codebuild/src/commands/ListBuildsForProjectCommand.ts diff --git a/clients/client-codebuild/commands/ListCuratedEnvironmentImagesCommand.ts b/clients/client-codebuild/src/commands/ListCuratedEnvironmentImagesCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListCuratedEnvironmentImagesCommand.ts rename to clients/client-codebuild/src/commands/ListCuratedEnvironmentImagesCommand.ts diff --git a/clients/client-codebuild/commands/ListProjectsCommand.ts b/clients/client-codebuild/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListProjectsCommand.ts rename to clients/client-codebuild/src/commands/ListProjectsCommand.ts diff --git a/clients/client-codebuild/commands/ListReportGroupsCommand.ts b/clients/client-codebuild/src/commands/ListReportGroupsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListReportGroupsCommand.ts rename to clients/client-codebuild/src/commands/ListReportGroupsCommand.ts diff --git a/clients/client-codebuild/commands/ListReportsCommand.ts b/clients/client-codebuild/src/commands/ListReportsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListReportsCommand.ts rename to clients/client-codebuild/src/commands/ListReportsCommand.ts diff --git a/clients/client-codebuild/commands/ListReportsForReportGroupCommand.ts b/clients/client-codebuild/src/commands/ListReportsForReportGroupCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListReportsForReportGroupCommand.ts rename to clients/client-codebuild/src/commands/ListReportsForReportGroupCommand.ts diff --git a/clients/client-codebuild/commands/ListSharedProjectsCommand.ts b/clients/client-codebuild/src/commands/ListSharedProjectsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListSharedProjectsCommand.ts rename to clients/client-codebuild/src/commands/ListSharedProjectsCommand.ts diff --git a/clients/client-codebuild/commands/ListSharedReportGroupsCommand.ts b/clients/client-codebuild/src/commands/ListSharedReportGroupsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListSharedReportGroupsCommand.ts rename to clients/client-codebuild/src/commands/ListSharedReportGroupsCommand.ts diff --git a/clients/client-codebuild/commands/ListSourceCredentialsCommand.ts b/clients/client-codebuild/src/commands/ListSourceCredentialsCommand.ts similarity index 100% rename from clients/client-codebuild/commands/ListSourceCredentialsCommand.ts rename to clients/client-codebuild/src/commands/ListSourceCredentialsCommand.ts diff --git a/clients/client-codebuild/commands/PutResourcePolicyCommand.ts b/clients/client-codebuild/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-codebuild/commands/PutResourcePolicyCommand.ts rename to clients/client-codebuild/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-codebuild/commands/RetryBuildBatchCommand.ts b/clients/client-codebuild/src/commands/RetryBuildBatchCommand.ts similarity index 100% rename from clients/client-codebuild/commands/RetryBuildBatchCommand.ts rename to clients/client-codebuild/src/commands/RetryBuildBatchCommand.ts diff --git a/clients/client-codebuild/commands/RetryBuildCommand.ts b/clients/client-codebuild/src/commands/RetryBuildCommand.ts similarity index 100% rename from clients/client-codebuild/commands/RetryBuildCommand.ts rename to clients/client-codebuild/src/commands/RetryBuildCommand.ts diff --git a/clients/client-codebuild/commands/StartBuildBatchCommand.ts b/clients/client-codebuild/src/commands/StartBuildBatchCommand.ts similarity index 100% rename from clients/client-codebuild/commands/StartBuildBatchCommand.ts rename to clients/client-codebuild/src/commands/StartBuildBatchCommand.ts diff --git a/clients/client-codebuild/commands/StartBuildCommand.ts b/clients/client-codebuild/src/commands/StartBuildCommand.ts similarity index 100% rename from clients/client-codebuild/commands/StartBuildCommand.ts rename to clients/client-codebuild/src/commands/StartBuildCommand.ts diff --git a/clients/client-codebuild/commands/StopBuildBatchCommand.ts b/clients/client-codebuild/src/commands/StopBuildBatchCommand.ts similarity index 100% rename from clients/client-codebuild/commands/StopBuildBatchCommand.ts rename to clients/client-codebuild/src/commands/StopBuildBatchCommand.ts diff --git a/clients/client-codebuild/commands/StopBuildCommand.ts b/clients/client-codebuild/src/commands/StopBuildCommand.ts similarity index 100% rename from clients/client-codebuild/commands/StopBuildCommand.ts rename to clients/client-codebuild/src/commands/StopBuildCommand.ts diff --git a/clients/client-codebuild/commands/UpdateProjectCommand.ts b/clients/client-codebuild/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-codebuild/commands/UpdateProjectCommand.ts rename to clients/client-codebuild/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-codebuild/commands/UpdateProjectVisibilityCommand.ts b/clients/client-codebuild/src/commands/UpdateProjectVisibilityCommand.ts similarity index 100% rename from clients/client-codebuild/commands/UpdateProjectVisibilityCommand.ts rename to clients/client-codebuild/src/commands/UpdateProjectVisibilityCommand.ts diff --git a/clients/client-codebuild/commands/UpdateReportGroupCommand.ts b/clients/client-codebuild/src/commands/UpdateReportGroupCommand.ts similarity index 100% rename from clients/client-codebuild/commands/UpdateReportGroupCommand.ts rename to clients/client-codebuild/src/commands/UpdateReportGroupCommand.ts diff --git a/clients/client-codebuild/commands/UpdateWebhookCommand.ts b/clients/client-codebuild/src/commands/UpdateWebhookCommand.ts similarity index 100% rename from clients/client-codebuild/commands/UpdateWebhookCommand.ts rename to clients/client-codebuild/src/commands/UpdateWebhookCommand.ts diff --git a/clients/client-codebuild/endpoints.ts b/clients/client-codebuild/src/endpoints.ts similarity index 100% rename from clients/client-codebuild/endpoints.ts rename to clients/client-codebuild/src/endpoints.ts diff --git a/clients/client-codebuild/index.ts b/clients/client-codebuild/src/index.ts similarity index 100% rename from clients/client-codebuild/index.ts rename to clients/client-codebuild/src/index.ts diff --git a/clients/client-codebuild/models/index.ts b/clients/client-codebuild/src/models/index.ts similarity index 100% rename from clients/client-codebuild/models/index.ts rename to clients/client-codebuild/src/models/index.ts diff --git a/clients/client-codebuild/models/models_0.ts b/clients/client-codebuild/src/models/models_0.ts similarity index 100% rename from clients/client-codebuild/models/models_0.ts rename to clients/client-codebuild/src/models/models_0.ts diff --git a/clients/client-codebuild/pagination/DescribeCodeCoveragesPaginator.ts b/clients/client-codebuild/src/pagination/DescribeCodeCoveragesPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/DescribeCodeCoveragesPaginator.ts rename to clients/client-codebuild/src/pagination/DescribeCodeCoveragesPaginator.ts diff --git a/clients/client-codebuild/pagination/DescribeTestCasesPaginator.ts b/clients/client-codebuild/src/pagination/DescribeTestCasesPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/DescribeTestCasesPaginator.ts rename to clients/client-codebuild/src/pagination/DescribeTestCasesPaginator.ts diff --git a/clients/client-codebuild/pagination/Interfaces.ts b/clients/client-codebuild/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codebuild/pagination/Interfaces.ts rename to clients/client-codebuild/src/pagination/Interfaces.ts diff --git a/clients/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts b/clients/client-codebuild/src/pagination/ListBuildBatchesForProjectPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListBuildBatchesForProjectPaginator.ts rename to clients/client-codebuild/src/pagination/ListBuildBatchesForProjectPaginator.ts diff --git a/clients/client-codebuild/pagination/ListBuildBatchesPaginator.ts b/clients/client-codebuild/src/pagination/ListBuildBatchesPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListBuildBatchesPaginator.ts rename to clients/client-codebuild/src/pagination/ListBuildBatchesPaginator.ts diff --git a/clients/client-codebuild/pagination/ListBuildsForProjectPaginator.ts b/clients/client-codebuild/src/pagination/ListBuildsForProjectPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListBuildsForProjectPaginator.ts rename to clients/client-codebuild/src/pagination/ListBuildsForProjectPaginator.ts diff --git a/clients/client-codebuild/pagination/ListBuildsPaginator.ts b/clients/client-codebuild/src/pagination/ListBuildsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListBuildsPaginator.ts rename to clients/client-codebuild/src/pagination/ListBuildsPaginator.ts diff --git a/clients/client-codebuild/pagination/ListProjectsPaginator.ts b/clients/client-codebuild/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListProjectsPaginator.ts rename to clients/client-codebuild/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-codebuild/pagination/ListReportGroupsPaginator.ts b/clients/client-codebuild/src/pagination/ListReportGroupsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListReportGroupsPaginator.ts rename to clients/client-codebuild/src/pagination/ListReportGroupsPaginator.ts diff --git a/clients/client-codebuild/pagination/ListReportsForReportGroupPaginator.ts b/clients/client-codebuild/src/pagination/ListReportsForReportGroupPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListReportsForReportGroupPaginator.ts rename to clients/client-codebuild/src/pagination/ListReportsForReportGroupPaginator.ts diff --git a/clients/client-codebuild/pagination/ListReportsPaginator.ts b/clients/client-codebuild/src/pagination/ListReportsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListReportsPaginator.ts rename to clients/client-codebuild/src/pagination/ListReportsPaginator.ts diff --git a/clients/client-codebuild/pagination/ListSharedProjectsPaginator.ts b/clients/client-codebuild/src/pagination/ListSharedProjectsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListSharedProjectsPaginator.ts rename to clients/client-codebuild/src/pagination/ListSharedProjectsPaginator.ts diff --git a/clients/client-codebuild/pagination/ListSharedReportGroupsPaginator.ts b/clients/client-codebuild/src/pagination/ListSharedReportGroupsPaginator.ts similarity index 100% rename from clients/client-codebuild/pagination/ListSharedReportGroupsPaginator.ts rename to clients/client-codebuild/src/pagination/ListSharedReportGroupsPaginator.ts diff --git a/clients/client-codebuild/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-codebuild/protocols/Aws_json1_1.ts rename to clients/client-codebuild/src/protocols/Aws_json1_1.ts diff --git a/clients/client-codebuild/src/runtimeConfig.browser.ts b/clients/client-codebuild/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..03999f562c89 --- /dev/null +++ b/clients/client-codebuild/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeBuildClientConfig } from "./CodeBuildClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeBuildClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codebuild/runtimeConfig.native.ts b/clients/client-codebuild/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codebuild/runtimeConfig.native.ts rename to clients/client-codebuild/src/runtimeConfig.native.ts diff --git a/clients/client-codebuild/runtimeConfig.shared.ts b/clients/client-codebuild/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codebuild/runtimeConfig.shared.ts rename to clients/client-codebuild/src/runtimeConfig.shared.ts diff --git a/clients/client-codebuild/src/runtimeConfig.ts b/clients/client-codebuild/src/runtimeConfig.ts new file mode 100644 index 000000000000..3bde23c66a87 --- /dev/null +++ b/clients/client-codebuild/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeBuildClientConfig } from "./CodeBuildClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeBuildClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codebuild/tsconfig.es.json b/clients/client-codebuild/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codebuild/tsconfig.es.json +++ b/clients/client-codebuild/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codebuild/tsconfig.json b/clients/client-codebuild/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codebuild/tsconfig.json +++ b/clients/client-codebuild/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codebuild/tsconfig.types.json b/clients/client-codebuild/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codebuild/tsconfig.types.json +++ b/clients/client-codebuild/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codecommit/.gitignore b/clients/client-codecommit/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codecommit/.gitignore +++ b/clients/client-codecommit/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codecommit/package.json b/clients/client-codecommit/package.json index 4e1d8b9298a9..9298335fca93 100644 --- a/clients/client-codecommit/package.json +++ b/clients/client-codecommit/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codecommit", "repository": { "type": "git", diff --git a/clients/client-codecommit/runtimeConfig.browser.ts b/clients/client-codecommit/runtimeConfig.browser.ts deleted file mode 100644 index 727103703cef..000000000000 --- a/clients/client-codecommit/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeCommitClientConfig } from "./CodeCommitClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeCommitClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codecommit/runtimeConfig.ts b/clients/client-codecommit/runtimeConfig.ts deleted file mode 100644 index 03db5ebe5427..000000000000 --- a/clients/client-codecommit/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeCommitClientConfig } from "./CodeCommitClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeCommitClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codecommit/CodeCommit.ts b/clients/client-codecommit/src/CodeCommit.ts similarity index 100% rename from clients/client-codecommit/CodeCommit.ts rename to clients/client-codecommit/src/CodeCommit.ts diff --git a/clients/client-codecommit/CodeCommitClient.ts b/clients/client-codecommit/src/CodeCommitClient.ts similarity index 100% rename from clients/client-codecommit/CodeCommitClient.ts rename to clients/client-codecommit/src/CodeCommitClient.ts diff --git a/clients/client-codecommit/commands/AssociateApprovalRuleTemplateWithRepositoryCommand.ts b/clients/client-codecommit/src/commands/AssociateApprovalRuleTemplateWithRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/AssociateApprovalRuleTemplateWithRepositoryCommand.ts rename to clients/client-codecommit/src/commands/AssociateApprovalRuleTemplateWithRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/BatchAssociateApprovalRuleTemplateWithRepositoriesCommand.ts b/clients/client-codecommit/src/commands/BatchAssociateApprovalRuleTemplateWithRepositoriesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/BatchAssociateApprovalRuleTemplateWithRepositoriesCommand.ts rename to clients/client-codecommit/src/commands/BatchAssociateApprovalRuleTemplateWithRepositoriesCommand.ts diff --git a/clients/client-codecommit/commands/BatchDescribeMergeConflictsCommand.ts b/clients/client-codecommit/src/commands/BatchDescribeMergeConflictsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/BatchDescribeMergeConflictsCommand.ts rename to clients/client-codecommit/src/commands/BatchDescribeMergeConflictsCommand.ts diff --git a/clients/client-codecommit/commands/BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand.ts b/clients/client-codecommit/src/commands/BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand.ts rename to clients/client-codecommit/src/commands/BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand.ts diff --git a/clients/client-codecommit/commands/BatchGetCommitsCommand.ts b/clients/client-codecommit/src/commands/BatchGetCommitsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/BatchGetCommitsCommand.ts rename to clients/client-codecommit/src/commands/BatchGetCommitsCommand.ts diff --git a/clients/client-codecommit/commands/BatchGetRepositoriesCommand.ts b/clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/BatchGetRepositoriesCommand.ts rename to clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts diff --git a/clients/client-codecommit/commands/CreateApprovalRuleTemplateCommand.ts b/clients/client-codecommit/src/commands/CreateApprovalRuleTemplateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreateApprovalRuleTemplateCommand.ts rename to clients/client-codecommit/src/commands/CreateApprovalRuleTemplateCommand.ts diff --git a/clients/client-codecommit/commands/CreateBranchCommand.ts b/clients/client-codecommit/src/commands/CreateBranchCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreateBranchCommand.ts rename to clients/client-codecommit/src/commands/CreateBranchCommand.ts diff --git a/clients/client-codecommit/commands/CreateCommitCommand.ts b/clients/client-codecommit/src/commands/CreateCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreateCommitCommand.ts rename to clients/client-codecommit/src/commands/CreateCommitCommand.ts diff --git a/clients/client-codecommit/commands/CreatePullRequestApprovalRuleCommand.ts b/clients/client-codecommit/src/commands/CreatePullRequestApprovalRuleCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreatePullRequestApprovalRuleCommand.ts rename to clients/client-codecommit/src/commands/CreatePullRequestApprovalRuleCommand.ts diff --git a/clients/client-codecommit/commands/CreatePullRequestCommand.ts b/clients/client-codecommit/src/commands/CreatePullRequestCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreatePullRequestCommand.ts rename to clients/client-codecommit/src/commands/CreatePullRequestCommand.ts diff --git a/clients/client-codecommit/commands/CreateRepositoryCommand.ts b/clients/client-codecommit/src/commands/CreateRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreateRepositoryCommand.ts rename to clients/client-codecommit/src/commands/CreateRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/CreateUnreferencedMergeCommitCommand.ts b/clients/client-codecommit/src/commands/CreateUnreferencedMergeCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/CreateUnreferencedMergeCommitCommand.ts rename to clients/client-codecommit/src/commands/CreateUnreferencedMergeCommitCommand.ts diff --git a/clients/client-codecommit/commands/DeleteApprovalRuleTemplateCommand.ts b/clients/client-codecommit/src/commands/DeleteApprovalRuleTemplateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeleteApprovalRuleTemplateCommand.ts rename to clients/client-codecommit/src/commands/DeleteApprovalRuleTemplateCommand.ts diff --git a/clients/client-codecommit/commands/DeleteBranchCommand.ts b/clients/client-codecommit/src/commands/DeleteBranchCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeleteBranchCommand.ts rename to clients/client-codecommit/src/commands/DeleteBranchCommand.ts diff --git a/clients/client-codecommit/commands/DeleteCommentContentCommand.ts b/clients/client-codecommit/src/commands/DeleteCommentContentCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeleteCommentContentCommand.ts rename to clients/client-codecommit/src/commands/DeleteCommentContentCommand.ts diff --git a/clients/client-codecommit/commands/DeleteFileCommand.ts b/clients/client-codecommit/src/commands/DeleteFileCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeleteFileCommand.ts rename to clients/client-codecommit/src/commands/DeleteFileCommand.ts diff --git a/clients/client-codecommit/commands/DeletePullRequestApprovalRuleCommand.ts b/clients/client-codecommit/src/commands/DeletePullRequestApprovalRuleCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeletePullRequestApprovalRuleCommand.ts rename to clients/client-codecommit/src/commands/DeletePullRequestApprovalRuleCommand.ts diff --git a/clients/client-codecommit/commands/DeleteRepositoryCommand.ts b/clients/client-codecommit/src/commands/DeleteRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DeleteRepositoryCommand.ts rename to clients/client-codecommit/src/commands/DeleteRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/DescribeMergeConflictsCommand.ts b/clients/client-codecommit/src/commands/DescribeMergeConflictsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DescribeMergeConflictsCommand.ts rename to clients/client-codecommit/src/commands/DescribeMergeConflictsCommand.ts diff --git a/clients/client-codecommit/commands/DescribePullRequestEventsCommand.ts b/clients/client-codecommit/src/commands/DescribePullRequestEventsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DescribePullRequestEventsCommand.ts rename to clients/client-codecommit/src/commands/DescribePullRequestEventsCommand.ts diff --git a/clients/client-codecommit/commands/DisassociateApprovalRuleTemplateFromRepositoryCommand.ts b/clients/client-codecommit/src/commands/DisassociateApprovalRuleTemplateFromRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/DisassociateApprovalRuleTemplateFromRepositoryCommand.ts rename to clients/client-codecommit/src/commands/DisassociateApprovalRuleTemplateFromRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/EvaluatePullRequestApprovalRulesCommand.ts b/clients/client-codecommit/src/commands/EvaluatePullRequestApprovalRulesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/EvaluatePullRequestApprovalRulesCommand.ts rename to clients/client-codecommit/src/commands/EvaluatePullRequestApprovalRulesCommand.ts diff --git a/clients/client-codecommit/commands/GetApprovalRuleTemplateCommand.ts b/clients/client-codecommit/src/commands/GetApprovalRuleTemplateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetApprovalRuleTemplateCommand.ts rename to clients/client-codecommit/src/commands/GetApprovalRuleTemplateCommand.ts diff --git a/clients/client-codecommit/commands/GetBlobCommand.ts b/clients/client-codecommit/src/commands/GetBlobCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetBlobCommand.ts rename to clients/client-codecommit/src/commands/GetBlobCommand.ts diff --git a/clients/client-codecommit/commands/GetBranchCommand.ts b/clients/client-codecommit/src/commands/GetBranchCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetBranchCommand.ts rename to clients/client-codecommit/src/commands/GetBranchCommand.ts diff --git a/clients/client-codecommit/commands/GetCommentCommand.ts b/clients/client-codecommit/src/commands/GetCommentCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetCommentCommand.ts rename to clients/client-codecommit/src/commands/GetCommentCommand.ts diff --git a/clients/client-codecommit/commands/GetCommentReactionsCommand.ts b/clients/client-codecommit/src/commands/GetCommentReactionsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetCommentReactionsCommand.ts rename to clients/client-codecommit/src/commands/GetCommentReactionsCommand.ts diff --git a/clients/client-codecommit/commands/GetCommentsForComparedCommitCommand.ts b/clients/client-codecommit/src/commands/GetCommentsForComparedCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetCommentsForComparedCommitCommand.ts rename to clients/client-codecommit/src/commands/GetCommentsForComparedCommitCommand.ts diff --git a/clients/client-codecommit/commands/GetCommentsForPullRequestCommand.ts b/clients/client-codecommit/src/commands/GetCommentsForPullRequestCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetCommentsForPullRequestCommand.ts rename to clients/client-codecommit/src/commands/GetCommentsForPullRequestCommand.ts diff --git a/clients/client-codecommit/commands/GetCommitCommand.ts b/clients/client-codecommit/src/commands/GetCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetCommitCommand.ts rename to clients/client-codecommit/src/commands/GetCommitCommand.ts diff --git a/clients/client-codecommit/commands/GetDifferencesCommand.ts b/clients/client-codecommit/src/commands/GetDifferencesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetDifferencesCommand.ts rename to clients/client-codecommit/src/commands/GetDifferencesCommand.ts diff --git a/clients/client-codecommit/commands/GetFileCommand.ts b/clients/client-codecommit/src/commands/GetFileCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetFileCommand.ts rename to clients/client-codecommit/src/commands/GetFileCommand.ts diff --git a/clients/client-codecommit/commands/GetFolderCommand.ts b/clients/client-codecommit/src/commands/GetFolderCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetFolderCommand.ts rename to clients/client-codecommit/src/commands/GetFolderCommand.ts diff --git a/clients/client-codecommit/commands/GetMergeCommitCommand.ts b/clients/client-codecommit/src/commands/GetMergeCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetMergeCommitCommand.ts rename to clients/client-codecommit/src/commands/GetMergeCommitCommand.ts diff --git a/clients/client-codecommit/commands/GetMergeConflictsCommand.ts b/clients/client-codecommit/src/commands/GetMergeConflictsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetMergeConflictsCommand.ts rename to clients/client-codecommit/src/commands/GetMergeConflictsCommand.ts diff --git a/clients/client-codecommit/commands/GetMergeOptionsCommand.ts b/clients/client-codecommit/src/commands/GetMergeOptionsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetMergeOptionsCommand.ts rename to clients/client-codecommit/src/commands/GetMergeOptionsCommand.ts diff --git a/clients/client-codecommit/commands/GetPullRequestApprovalStatesCommand.ts b/clients/client-codecommit/src/commands/GetPullRequestApprovalStatesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetPullRequestApprovalStatesCommand.ts rename to clients/client-codecommit/src/commands/GetPullRequestApprovalStatesCommand.ts diff --git a/clients/client-codecommit/commands/GetPullRequestCommand.ts b/clients/client-codecommit/src/commands/GetPullRequestCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetPullRequestCommand.ts rename to clients/client-codecommit/src/commands/GetPullRequestCommand.ts diff --git a/clients/client-codecommit/commands/GetPullRequestOverrideStateCommand.ts b/clients/client-codecommit/src/commands/GetPullRequestOverrideStateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetPullRequestOverrideStateCommand.ts rename to clients/client-codecommit/src/commands/GetPullRequestOverrideStateCommand.ts diff --git a/clients/client-codecommit/commands/GetRepositoryCommand.ts b/clients/client-codecommit/src/commands/GetRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetRepositoryCommand.ts rename to clients/client-codecommit/src/commands/GetRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/GetRepositoryTriggersCommand.ts b/clients/client-codecommit/src/commands/GetRepositoryTriggersCommand.ts similarity index 100% rename from clients/client-codecommit/commands/GetRepositoryTriggersCommand.ts rename to clients/client-codecommit/src/commands/GetRepositoryTriggersCommand.ts diff --git a/clients/client-codecommit/commands/ListApprovalRuleTemplatesCommand.ts b/clients/client-codecommit/src/commands/ListApprovalRuleTemplatesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListApprovalRuleTemplatesCommand.ts rename to clients/client-codecommit/src/commands/ListApprovalRuleTemplatesCommand.ts diff --git a/clients/client-codecommit/commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand.ts b/clients/client-codecommit/src/commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand.ts rename to clients/client-codecommit/src/commands/ListAssociatedApprovalRuleTemplatesForRepositoryCommand.ts diff --git a/clients/client-codecommit/commands/ListBranchesCommand.ts b/clients/client-codecommit/src/commands/ListBranchesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListBranchesCommand.ts rename to clients/client-codecommit/src/commands/ListBranchesCommand.ts diff --git a/clients/client-codecommit/commands/ListPullRequestsCommand.ts b/clients/client-codecommit/src/commands/ListPullRequestsCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListPullRequestsCommand.ts rename to clients/client-codecommit/src/commands/ListPullRequestsCommand.ts diff --git a/clients/client-codecommit/commands/ListRepositoriesCommand.ts b/clients/client-codecommit/src/commands/ListRepositoriesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListRepositoriesCommand.ts rename to clients/client-codecommit/src/commands/ListRepositoriesCommand.ts diff --git a/clients/client-codecommit/commands/ListRepositoriesForApprovalRuleTemplateCommand.ts b/clients/client-codecommit/src/commands/ListRepositoriesForApprovalRuleTemplateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListRepositoriesForApprovalRuleTemplateCommand.ts rename to clients/client-codecommit/src/commands/ListRepositoriesForApprovalRuleTemplateCommand.ts diff --git a/clients/client-codecommit/commands/ListTagsForResourceCommand.ts b/clients/client-codecommit/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codecommit/commands/ListTagsForResourceCommand.ts rename to clients/client-codecommit/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codecommit/commands/MergeBranchesByFastForwardCommand.ts b/clients/client-codecommit/src/commands/MergeBranchesByFastForwardCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergeBranchesByFastForwardCommand.ts rename to clients/client-codecommit/src/commands/MergeBranchesByFastForwardCommand.ts diff --git a/clients/client-codecommit/commands/MergeBranchesBySquashCommand.ts b/clients/client-codecommit/src/commands/MergeBranchesBySquashCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergeBranchesBySquashCommand.ts rename to clients/client-codecommit/src/commands/MergeBranchesBySquashCommand.ts diff --git a/clients/client-codecommit/commands/MergeBranchesByThreeWayCommand.ts b/clients/client-codecommit/src/commands/MergeBranchesByThreeWayCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergeBranchesByThreeWayCommand.ts rename to clients/client-codecommit/src/commands/MergeBranchesByThreeWayCommand.ts diff --git a/clients/client-codecommit/commands/MergePullRequestByFastForwardCommand.ts b/clients/client-codecommit/src/commands/MergePullRequestByFastForwardCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergePullRequestByFastForwardCommand.ts rename to clients/client-codecommit/src/commands/MergePullRequestByFastForwardCommand.ts diff --git a/clients/client-codecommit/commands/MergePullRequestBySquashCommand.ts b/clients/client-codecommit/src/commands/MergePullRequestBySquashCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergePullRequestBySquashCommand.ts rename to clients/client-codecommit/src/commands/MergePullRequestBySquashCommand.ts diff --git a/clients/client-codecommit/commands/MergePullRequestByThreeWayCommand.ts b/clients/client-codecommit/src/commands/MergePullRequestByThreeWayCommand.ts similarity index 100% rename from clients/client-codecommit/commands/MergePullRequestByThreeWayCommand.ts rename to clients/client-codecommit/src/commands/MergePullRequestByThreeWayCommand.ts diff --git a/clients/client-codecommit/commands/OverridePullRequestApprovalRulesCommand.ts b/clients/client-codecommit/src/commands/OverridePullRequestApprovalRulesCommand.ts similarity index 100% rename from clients/client-codecommit/commands/OverridePullRequestApprovalRulesCommand.ts rename to clients/client-codecommit/src/commands/OverridePullRequestApprovalRulesCommand.ts diff --git a/clients/client-codecommit/commands/PostCommentForComparedCommitCommand.ts b/clients/client-codecommit/src/commands/PostCommentForComparedCommitCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PostCommentForComparedCommitCommand.ts rename to clients/client-codecommit/src/commands/PostCommentForComparedCommitCommand.ts diff --git a/clients/client-codecommit/commands/PostCommentForPullRequestCommand.ts b/clients/client-codecommit/src/commands/PostCommentForPullRequestCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PostCommentForPullRequestCommand.ts rename to clients/client-codecommit/src/commands/PostCommentForPullRequestCommand.ts diff --git a/clients/client-codecommit/commands/PostCommentReplyCommand.ts b/clients/client-codecommit/src/commands/PostCommentReplyCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PostCommentReplyCommand.ts rename to clients/client-codecommit/src/commands/PostCommentReplyCommand.ts diff --git a/clients/client-codecommit/commands/PutCommentReactionCommand.ts b/clients/client-codecommit/src/commands/PutCommentReactionCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PutCommentReactionCommand.ts rename to clients/client-codecommit/src/commands/PutCommentReactionCommand.ts diff --git a/clients/client-codecommit/commands/PutFileCommand.ts b/clients/client-codecommit/src/commands/PutFileCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PutFileCommand.ts rename to clients/client-codecommit/src/commands/PutFileCommand.ts diff --git a/clients/client-codecommit/commands/PutRepositoryTriggersCommand.ts b/clients/client-codecommit/src/commands/PutRepositoryTriggersCommand.ts similarity index 100% rename from clients/client-codecommit/commands/PutRepositoryTriggersCommand.ts rename to clients/client-codecommit/src/commands/PutRepositoryTriggersCommand.ts diff --git a/clients/client-codecommit/commands/TagResourceCommand.ts b/clients/client-codecommit/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codecommit/commands/TagResourceCommand.ts rename to clients/client-codecommit/src/commands/TagResourceCommand.ts diff --git a/clients/client-codecommit/commands/TestRepositoryTriggersCommand.ts b/clients/client-codecommit/src/commands/TestRepositoryTriggersCommand.ts similarity index 100% rename from clients/client-codecommit/commands/TestRepositoryTriggersCommand.ts rename to clients/client-codecommit/src/commands/TestRepositoryTriggersCommand.ts diff --git a/clients/client-codecommit/commands/UntagResourceCommand.ts b/clients/client-codecommit/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UntagResourceCommand.ts rename to clients/client-codecommit/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codecommit/commands/UpdateApprovalRuleTemplateContentCommand.ts b/clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateContentCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateApprovalRuleTemplateContentCommand.ts rename to clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateContentCommand.ts diff --git a/clients/client-codecommit/commands/UpdateApprovalRuleTemplateDescriptionCommand.ts b/clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateDescriptionCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateApprovalRuleTemplateDescriptionCommand.ts rename to clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateDescriptionCommand.ts diff --git a/clients/client-codecommit/commands/UpdateApprovalRuleTemplateNameCommand.ts b/clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateNameCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateApprovalRuleTemplateNameCommand.ts rename to clients/client-codecommit/src/commands/UpdateApprovalRuleTemplateNameCommand.ts diff --git a/clients/client-codecommit/commands/UpdateCommentCommand.ts b/clients/client-codecommit/src/commands/UpdateCommentCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateCommentCommand.ts rename to clients/client-codecommit/src/commands/UpdateCommentCommand.ts diff --git a/clients/client-codecommit/commands/UpdateDefaultBranchCommand.ts b/clients/client-codecommit/src/commands/UpdateDefaultBranchCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateDefaultBranchCommand.ts rename to clients/client-codecommit/src/commands/UpdateDefaultBranchCommand.ts diff --git a/clients/client-codecommit/commands/UpdatePullRequestApprovalRuleContentCommand.ts b/clients/client-codecommit/src/commands/UpdatePullRequestApprovalRuleContentCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdatePullRequestApprovalRuleContentCommand.ts rename to clients/client-codecommit/src/commands/UpdatePullRequestApprovalRuleContentCommand.ts diff --git a/clients/client-codecommit/commands/UpdatePullRequestApprovalStateCommand.ts b/clients/client-codecommit/src/commands/UpdatePullRequestApprovalStateCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdatePullRequestApprovalStateCommand.ts rename to clients/client-codecommit/src/commands/UpdatePullRequestApprovalStateCommand.ts diff --git a/clients/client-codecommit/commands/UpdatePullRequestDescriptionCommand.ts b/clients/client-codecommit/src/commands/UpdatePullRequestDescriptionCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdatePullRequestDescriptionCommand.ts rename to clients/client-codecommit/src/commands/UpdatePullRequestDescriptionCommand.ts diff --git a/clients/client-codecommit/commands/UpdatePullRequestStatusCommand.ts b/clients/client-codecommit/src/commands/UpdatePullRequestStatusCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdatePullRequestStatusCommand.ts rename to clients/client-codecommit/src/commands/UpdatePullRequestStatusCommand.ts diff --git a/clients/client-codecommit/commands/UpdatePullRequestTitleCommand.ts b/clients/client-codecommit/src/commands/UpdatePullRequestTitleCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdatePullRequestTitleCommand.ts rename to clients/client-codecommit/src/commands/UpdatePullRequestTitleCommand.ts diff --git a/clients/client-codecommit/commands/UpdateRepositoryDescriptionCommand.ts b/clients/client-codecommit/src/commands/UpdateRepositoryDescriptionCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateRepositoryDescriptionCommand.ts rename to clients/client-codecommit/src/commands/UpdateRepositoryDescriptionCommand.ts diff --git a/clients/client-codecommit/commands/UpdateRepositoryNameCommand.ts b/clients/client-codecommit/src/commands/UpdateRepositoryNameCommand.ts similarity index 100% rename from clients/client-codecommit/commands/UpdateRepositoryNameCommand.ts rename to clients/client-codecommit/src/commands/UpdateRepositoryNameCommand.ts diff --git a/clients/client-codecommit/endpoints.ts b/clients/client-codecommit/src/endpoints.ts similarity index 100% rename from clients/client-codecommit/endpoints.ts rename to clients/client-codecommit/src/endpoints.ts diff --git a/clients/client-codecommit/index.ts b/clients/client-codecommit/src/index.ts similarity index 100% rename from clients/client-codecommit/index.ts rename to clients/client-codecommit/src/index.ts diff --git a/clients/client-codecommit/models/index.ts b/clients/client-codecommit/src/models/index.ts similarity index 100% rename from clients/client-codecommit/models/index.ts rename to clients/client-codecommit/src/models/index.ts diff --git a/clients/client-codecommit/models/models_0.ts b/clients/client-codecommit/src/models/models_0.ts similarity index 100% rename from clients/client-codecommit/models/models_0.ts rename to clients/client-codecommit/src/models/models_0.ts diff --git a/clients/client-codecommit/models/models_1.ts b/clients/client-codecommit/src/models/models_1.ts similarity index 100% rename from clients/client-codecommit/models/models_1.ts rename to clients/client-codecommit/src/models/models_1.ts diff --git a/clients/client-codecommit/pagination/DescribeMergeConflictsPaginator.ts b/clients/client-codecommit/src/pagination/DescribeMergeConflictsPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/DescribeMergeConflictsPaginator.ts rename to clients/client-codecommit/src/pagination/DescribeMergeConflictsPaginator.ts diff --git a/clients/client-codecommit/pagination/DescribePullRequestEventsPaginator.ts b/clients/client-codecommit/src/pagination/DescribePullRequestEventsPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/DescribePullRequestEventsPaginator.ts rename to clients/client-codecommit/src/pagination/DescribePullRequestEventsPaginator.ts diff --git a/clients/client-codecommit/pagination/GetCommentReactionsPaginator.ts b/clients/client-codecommit/src/pagination/GetCommentReactionsPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/GetCommentReactionsPaginator.ts rename to clients/client-codecommit/src/pagination/GetCommentReactionsPaginator.ts diff --git a/clients/client-codecommit/pagination/GetCommentsForComparedCommitPaginator.ts b/clients/client-codecommit/src/pagination/GetCommentsForComparedCommitPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/GetCommentsForComparedCommitPaginator.ts rename to clients/client-codecommit/src/pagination/GetCommentsForComparedCommitPaginator.ts diff --git a/clients/client-codecommit/pagination/GetCommentsForPullRequestPaginator.ts b/clients/client-codecommit/src/pagination/GetCommentsForPullRequestPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/GetCommentsForPullRequestPaginator.ts rename to clients/client-codecommit/src/pagination/GetCommentsForPullRequestPaginator.ts diff --git a/clients/client-codecommit/pagination/GetDifferencesPaginator.ts b/clients/client-codecommit/src/pagination/GetDifferencesPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/GetDifferencesPaginator.ts rename to clients/client-codecommit/src/pagination/GetDifferencesPaginator.ts diff --git a/clients/client-codecommit/pagination/GetMergeConflictsPaginator.ts b/clients/client-codecommit/src/pagination/GetMergeConflictsPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/GetMergeConflictsPaginator.ts rename to clients/client-codecommit/src/pagination/GetMergeConflictsPaginator.ts diff --git a/clients/client-codecommit/pagination/Interfaces.ts b/clients/client-codecommit/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codecommit/pagination/Interfaces.ts rename to clients/client-codecommit/src/pagination/Interfaces.ts diff --git a/clients/client-codecommit/pagination/ListApprovalRuleTemplatesPaginator.ts b/clients/client-codecommit/src/pagination/ListApprovalRuleTemplatesPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListApprovalRuleTemplatesPaginator.ts rename to clients/client-codecommit/src/pagination/ListApprovalRuleTemplatesPaginator.ts diff --git a/clients/client-codecommit/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts b/clients/client-codecommit/src/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts rename to clients/client-codecommit/src/pagination/ListAssociatedApprovalRuleTemplatesForRepositoryPaginator.ts diff --git a/clients/client-codecommit/pagination/ListBranchesPaginator.ts b/clients/client-codecommit/src/pagination/ListBranchesPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListBranchesPaginator.ts rename to clients/client-codecommit/src/pagination/ListBranchesPaginator.ts diff --git a/clients/client-codecommit/pagination/ListPullRequestsPaginator.ts b/clients/client-codecommit/src/pagination/ListPullRequestsPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListPullRequestsPaginator.ts rename to clients/client-codecommit/src/pagination/ListPullRequestsPaginator.ts diff --git a/clients/client-codecommit/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts b/clients/client-codecommit/src/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts rename to clients/client-codecommit/src/pagination/ListRepositoriesForApprovalRuleTemplatePaginator.ts diff --git a/clients/client-codecommit/pagination/ListRepositoriesPaginator.ts b/clients/client-codecommit/src/pagination/ListRepositoriesPaginator.ts similarity index 100% rename from clients/client-codecommit/pagination/ListRepositoriesPaginator.ts rename to clients/client-codecommit/src/pagination/ListRepositoriesPaginator.ts diff --git a/clients/client-codecommit/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-codecommit/protocols/Aws_json1_1.ts rename to clients/client-codecommit/src/protocols/Aws_json1_1.ts diff --git a/clients/client-codecommit/src/runtimeConfig.browser.ts b/clients/client-codecommit/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d672984fb56f --- /dev/null +++ b/clients/client-codecommit/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeCommitClientConfig } from "./CodeCommitClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeCommitClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codecommit/runtimeConfig.native.ts b/clients/client-codecommit/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codecommit/runtimeConfig.native.ts rename to clients/client-codecommit/src/runtimeConfig.native.ts diff --git a/clients/client-codecommit/runtimeConfig.shared.ts b/clients/client-codecommit/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codecommit/runtimeConfig.shared.ts rename to clients/client-codecommit/src/runtimeConfig.shared.ts diff --git a/clients/client-codecommit/src/runtimeConfig.ts b/clients/client-codecommit/src/runtimeConfig.ts new file mode 100644 index 000000000000..e8011ff17762 --- /dev/null +++ b/clients/client-codecommit/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeCommitClientConfig } from "./CodeCommitClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeCommitClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codecommit/tsconfig.es.json b/clients/client-codecommit/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codecommit/tsconfig.es.json +++ b/clients/client-codecommit/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codecommit/tsconfig.json b/clients/client-codecommit/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codecommit/tsconfig.json +++ b/clients/client-codecommit/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codecommit/tsconfig.types.json b/clients/client-codecommit/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codecommit/tsconfig.types.json +++ b/clients/client-codecommit/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codedeploy/.gitignore b/clients/client-codedeploy/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codedeploy/.gitignore +++ b/clients/client-codedeploy/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codedeploy/package.json b/clients/client-codedeploy/package.json index e51c5f46cb8d..46f5a2ed6f74 100644 --- a/clients/client-codedeploy/package.json +++ b/clients/client-codedeploy/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codedeploy", "repository": { "type": "git", diff --git a/clients/client-codedeploy/runtimeConfig.browser.ts b/clients/client-codedeploy/runtimeConfig.browser.ts deleted file mode 100644 index 658ded21a82e..000000000000 --- a/clients/client-codedeploy/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeDeployClientConfig } from "./CodeDeployClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeDeployClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codedeploy/runtimeConfig.ts b/clients/client-codedeploy/runtimeConfig.ts deleted file mode 100644 index f4486114877d..000000000000 --- a/clients/client-codedeploy/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeDeployClientConfig } from "./CodeDeployClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeDeployClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codedeploy/CodeDeploy.ts b/clients/client-codedeploy/src/CodeDeploy.ts similarity index 100% rename from clients/client-codedeploy/CodeDeploy.ts rename to clients/client-codedeploy/src/CodeDeploy.ts diff --git a/clients/client-codedeploy/CodeDeployClient.ts b/clients/client-codedeploy/src/CodeDeployClient.ts similarity index 100% rename from clients/client-codedeploy/CodeDeployClient.ts rename to clients/client-codedeploy/src/CodeDeployClient.ts diff --git a/clients/client-codedeploy/commands/AddTagsToOnPremisesInstancesCommand.ts b/clients/client-codedeploy/src/commands/AddTagsToOnPremisesInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/AddTagsToOnPremisesInstancesCommand.ts rename to clients/client-codedeploy/src/commands/AddTagsToOnPremisesInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetApplicationRevisionsCommand.ts b/clients/client-codedeploy/src/commands/BatchGetApplicationRevisionsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetApplicationRevisionsCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetApplicationRevisionsCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetApplicationsCommand.ts b/clients/client-codedeploy/src/commands/BatchGetApplicationsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetApplicationsCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetApplicationsCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetDeploymentGroupsCommand.ts b/clients/client-codedeploy/src/commands/BatchGetDeploymentGroupsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetDeploymentGroupsCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetDeploymentGroupsCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetDeploymentInstancesCommand.ts b/clients/client-codedeploy/src/commands/BatchGetDeploymentInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetDeploymentInstancesCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetDeploymentInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetDeploymentTargetsCommand.ts b/clients/client-codedeploy/src/commands/BatchGetDeploymentTargetsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetDeploymentTargetsCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetDeploymentTargetsCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetDeploymentsCommand.ts b/clients/client-codedeploy/src/commands/BatchGetDeploymentsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetDeploymentsCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetDeploymentsCommand.ts diff --git a/clients/client-codedeploy/commands/BatchGetOnPremisesInstancesCommand.ts b/clients/client-codedeploy/src/commands/BatchGetOnPremisesInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/BatchGetOnPremisesInstancesCommand.ts rename to clients/client-codedeploy/src/commands/BatchGetOnPremisesInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/ContinueDeploymentCommand.ts b/clients/client-codedeploy/src/commands/ContinueDeploymentCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ContinueDeploymentCommand.ts rename to clients/client-codedeploy/src/commands/ContinueDeploymentCommand.ts diff --git a/clients/client-codedeploy/commands/CreateApplicationCommand.ts b/clients/client-codedeploy/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/CreateApplicationCommand.ts rename to clients/client-codedeploy/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-codedeploy/commands/CreateDeploymentCommand.ts b/clients/client-codedeploy/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/CreateDeploymentCommand.ts rename to clients/client-codedeploy/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-codedeploy/commands/CreateDeploymentConfigCommand.ts b/clients/client-codedeploy/src/commands/CreateDeploymentConfigCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/CreateDeploymentConfigCommand.ts rename to clients/client-codedeploy/src/commands/CreateDeploymentConfigCommand.ts diff --git a/clients/client-codedeploy/commands/CreateDeploymentGroupCommand.ts b/clients/client-codedeploy/src/commands/CreateDeploymentGroupCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/CreateDeploymentGroupCommand.ts rename to clients/client-codedeploy/src/commands/CreateDeploymentGroupCommand.ts diff --git a/clients/client-codedeploy/commands/DeleteApplicationCommand.ts b/clients/client-codedeploy/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeleteApplicationCommand.ts rename to clients/client-codedeploy/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-codedeploy/commands/DeleteDeploymentConfigCommand.ts b/clients/client-codedeploy/src/commands/DeleteDeploymentConfigCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeleteDeploymentConfigCommand.ts rename to clients/client-codedeploy/src/commands/DeleteDeploymentConfigCommand.ts diff --git a/clients/client-codedeploy/commands/DeleteDeploymentGroupCommand.ts b/clients/client-codedeploy/src/commands/DeleteDeploymentGroupCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeleteDeploymentGroupCommand.ts rename to clients/client-codedeploy/src/commands/DeleteDeploymentGroupCommand.ts diff --git a/clients/client-codedeploy/commands/DeleteGitHubAccountTokenCommand.ts b/clients/client-codedeploy/src/commands/DeleteGitHubAccountTokenCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeleteGitHubAccountTokenCommand.ts rename to clients/client-codedeploy/src/commands/DeleteGitHubAccountTokenCommand.ts diff --git a/clients/client-codedeploy/commands/DeleteResourcesByExternalIdCommand.ts b/clients/client-codedeploy/src/commands/DeleteResourcesByExternalIdCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeleteResourcesByExternalIdCommand.ts rename to clients/client-codedeploy/src/commands/DeleteResourcesByExternalIdCommand.ts diff --git a/clients/client-codedeploy/commands/DeregisterOnPremisesInstanceCommand.ts b/clients/client-codedeploy/src/commands/DeregisterOnPremisesInstanceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/DeregisterOnPremisesInstanceCommand.ts rename to clients/client-codedeploy/src/commands/DeregisterOnPremisesInstanceCommand.ts diff --git a/clients/client-codedeploy/commands/GetApplicationCommand.ts b/clients/client-codedeploy/src/commands/GetApplicationCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetApplicationCommand.ts rename to clients/client-codedeploy/src/commands/GetApplicationCommand.ts diff --git a/clients/client-codedeploy/commands/GetApplicationRevisionCommand.ts b/clients/client-codedeploy/src/commands/GetApplicationRevisionCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetApplicationRevisionCommand.ts rename to clients/client-codedeploy/src/commands/GetApplicationRevisionCommand.ts diff --git a/clients/client-codedeploy/commands/GetDeploymentCommand.ts b/clients/client-codedeploy/src/commands/GetDeploymentCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetDeploymentCommand.ts rename to clients/client-codedeploy/src/commands/GetDeploymentCommand.ts diff --git a/clients/client-codedeploy/commands/GetDeploymentConfigCommand.ts b/clients/client-codedeploy/src/commands/GetDeploymentConfigCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetDeploymentConfigCommand.ts rename to clients/client-codedeploy/src/commands/GetDeploymentConfigCommand.ts diff --git a/clients/client-codedeploy/commands/GetDeploymentGroupCommand.ts b/clients/client-codedeploy/src/commands/GetDeploymentGroupCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetDeploymentGroupCommand.ts rename to clients/client-codedeploy/src/commands/GetDeploymentGroupCommand.ts diff --git a/clients/client-codedeploy/commands/GetDeploymentInstanceCommand.ts b/clients/client-codedeploy/src/commands/GetDeploymentInstanceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetDeploymentInstanceCommand.ts rename to clients/client-codedeploy/src/commands/GetDeploymentInstanceCommand.ts diff --git a/clients/client-codedeploy/commands/GetDeploymentTargetCommand.ts b/clients/client-codedeploy/src/commands/GetDeploymentTargetCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetDeploymentTargetCommand.ts rename to clients/client-codedeploy/src/commands/GetDeploymentTargetCommand.ts diff --git a/clients/client-codedeploy/commands/GetOnPremisesInstanceCommand.ts b/clients/client-codedeploy/src/commands/GetOnPremisesInstanceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/GetOnPremisesInstanceCommand.ts rename to clients/client-codedeploy/src/commands/GetOnPremisesInstanceCommand.ts diff --git a/clients/client-codedeploy/commands/ListApplicationRevisionsCommand.ts b/clients/client-codedeploy/src/commands/ListApplicationRevisionsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListApplicationRevisionsCommand.ts rename to clients/client-codedeploy/src/commands/ListApplicationRevisionsCommand.ts diff --git a/clients/client-codedeploy/commands/ListApplicationsCommand.ts b/clients/client-codedeploy/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListApplicationsCommand.ts rename to clients/client-codedeploy/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-codedeploy/commands/ListDeploymentConfigsCommand.ts b/clients/client-codedeploy/src/commands/ListDeploymentConfigsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListDeploymentConfigsCommand.ts rename to clients/client-codedeploy/src/commands/ListDeploymentConfigsCommand.ts diff --git a/clients/client-codedeploy/commands/ListDeploymentGroupsCommand.ts b/clients/client-codedeploy/src/commands/ListDeploymentGroupsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListDeploymentGroupsCommand.ts rename to clients/client-codedeploy/src/commands/ListDeploymentGroupsCommand.ts diff --git a/clients/client-codedeploy/commands/ListDeploymentInstancesCommand.ts b/clients/client-codedeploy/src/commands/ListDeploymentInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListDeploymentInstancesCommand.ts rename to clients/client-codedeploy/src/commands/ListDeploymentInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/ListDeploymentTargetsCommand.ts b/clients/client-codedeploy/src/commands/ListDeploymentTargetsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListDeploymentTargetsCommand.ts rename to clients/client-codedeploy/src/commands/ListDeploymentTargetsCommand.ts diff --git a/clients/client-codedeploy/commands/ListDeploymentsCommand.ts b/clients/client-codedeploy/src/commands/ListDeploymentsCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListDeploymentsCommand.ts rename to clients/client-codedeploy/src/commands/ListDeploymentsCommand.ts diff --git a/clients/client-codedeploy/commands/ListGitHubAccountTokenNamesCommand.ts b/clients/client-codedeploy/src/commands/ListGitHubAccountTokenNamesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListGitHubAccountTokenNamesCommand.ts rename to clients/client-codedeploy/src/commands/ListGitHubAccountTokenNamesCommand.ts diff --git a/clients/client-codedeploy/commands/ListOnPremisesInstancesCommand.ts b/clients/client-codedeploy/src/commands/ListOnPremisesInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListOnPremisesInstancesCommand.ts rename to clients/client-codedeploy/src/commands/ListOnPremisesInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/ListTagsForResourceCommand.ts b/clients/client-codedeploy/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/ListTagsForResourceCommand.ts rename to clients/client-codedeploy/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codedeploy/commands/PutLifecycleEventHookExecutionStatusCommand.ts b/clients/client-codedeploy/src/commands/PutLifecycleEventHookExecutionStatusCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/PutLifecycleEventHookExecutionStatusCommand.ts rename to clients/client-codedeploy/src/commands/PutLifecycleEventHookExecutionStatusCommand.ts diff --git a/clients/client-codedeploy/commands/RegisterApplicationRevisionCommand.ts b/clients/client-codedeploy/src/commands/RegisterApplicationRevisionCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/RegisterApplicationRevisionCommand.ts rename to clients/client-codedeploy/src/commands/RegisterApplicationRevisionCommand.ts diff --git a/clients/client-codedeploy/commands/RegisterOnPremisesInstanceCommand.ts b/clients/client-codedeploy/src/commands/RegisterOnPremisesInstanceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/RegisterOnPremisesInstanceCommand.ts rename to clients/client-codedeploy/src/commands/RegisterOnPremisesInstanceCommand.ts diff --git a/clients/client-codedeploy/commands/RemoveTagsFromOnPremisesInstancesCommand.ts b/clients/client-codedeploy/src/commands/RemoveTagsFromOnPremisesInstancesCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/RemoveTagsFromOnPremisesInstancesCommand.ts rename to clients/client-codedeploy/src/commands/RemoveTagsFromOnPremisesInstancesCommand.ts diff --git a/clients/client-codedeploy/commands/SkipWaitTimeForInstanceTerminationCommand.ts b/clients/client-codedeploy/src/commands/SkipWaitTimeForInstanceTerminationCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/SkipWaitTimeForInstanceTerminationCommand.ts rename to clients/client-codedeploy/src/commands/SkipWaitTimeForInstanceTerminationCommand.ts diff --git a/clients/client-codedeploy/commands/StopDeploymentCommand.ts b/clients/client-codedeploy/src/commands/StopDeploymentCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/StopDeploymentCommand.ts rename to clients/client-codedeploy/src/commands/StopDeploymentCommand.ts diff --git a/clients/client-codedeploy/commands/TagResourceCommand.ts b/clients/client-codedeploy/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/TagResourceCommand.ts rename to clients/client-codedeploy/src/commands/TagResourceCommand.ts diff --git a/clients/client-codedeploy/commands/UntagResourceCommand.ts b/clients/client-codedeploy/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/UntagResourceCommand.ts rename to clients/client-codedeploy/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codedeploy/commands/UpdateApplicationCommand.ts b/clients/client-codedeploy/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/UpdateApplicationCommand.ts rename to clients/client-codedeploy/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-codedeploy/commands/UpdateDeploymentGroupCommand.ts b/clients/client-codedeploy/src/commands/UpdateDeploymentGroupCommand.ts similarity index 100% rename from clients/client-codedeploy/commands/UpdateDeploymentGroupCommand.ts rename to clients/client-codedeploy/src/commands/UpdateDeploymentGroupCommand.ts diff --git a/clients/client-codedeploy/endpoints.ts b/clients/client-codedeploy/src/endpoints.ts similarity index 100% rename from clients/client-codedeploy/endpoints.ts rename to clients/client-codedeploy/src/endpoints.ts diff --git a/clients/client-codedeploy/index.ts b/clients/client-codedeploy/src/index.ts similarity index 100% rename from clients/client-codedeploy/index.ts rename to clients/client-codedeploy/src/index.ts diff --git a/clients/client-codedeploy/models/index.ts b/clients/client-codedeploy/src/models/index.ts similarity index 100% rename from clients/client-codedeploy/models/index.ts rename to clients/client-codedeploy/src/models/index.ts diff --git a/clients/client-codedeploy/models/models_0.ts b/clients/client-codedeploy/src/models/models_0.ts similarity index 100% rename from clients/client-codedeploy/models/models_0.ts rename to clients/client-codedeploy/src/models/models_0.ts diff --git a/clients/client-codedeploy/pagination/Interfaces.ts b/clients/client-codedeploy/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codedeploy/pagination/Interfaces.ts rename to clients/client-codedeploy/src/pagination/Interfaces.ts diff --git a/clients/client-codedeploy/pagination/ListApplicationRevisionsPaginator.ts b/clients/client-codedeploy/src/pagination/ListApplicationRevisionsPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListApplicationRevisionsPaginator.ts rename to clients/client-codedeploy/src/pagination/ListApplicationRevisionsPaginator.ts diff --git a/clients/client-codedeploy/pagination/ListApplicationsPaginator.ts b/clients/client-codedeploy/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListApplicationsPaginator.ts rename to clients/client-codedeploy/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-codedeploy/pagination/ListDeploymentConfigsPaginator.ts b/clients/client-codedeploy/src/pagination/ListDeploymentConfigsPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListDeploymentConfigsPaginator.ts rename to clients/client-codedeploy/src/pagination/ListDeploymentConfigsPaginator.ts diff --git a/clients/client-codedeploy/pagination/ListDeploymentGroupsPaginator.ts b/clients/client-codedeploy/src/pagination/ListDeploymentGroupsPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListDeploymentGroupsPaginator.ts rename to clients/client-codedeploy/src/pagination/ListDeploymentGroupsPaginator.ts diff --git a/clients/client-codedeploy/pagination/ListDeploymentInstancesPaginator.ts b/clients/client-codedeploy/src/pagination/ListDeploymentInstancesPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListDeploymentInstancesPaginator.ts rename to clients/client-codedeploy/src/pagination/ListDeploymentInstancesPaginator.ts diff --git a/clients/client-codedeploy/pagination/ListDeploymentsPaginator.ts b/clients/client-codedeploy/src/pagination/ListDeploymentsPaginator.ts similarity index 100% rename from clients/client-codedeploy/pagination/ListDeploymentsPaginator.ts rename to clients/client-codedeploy/src/pagination/ListDeploymentsPaginator.ts diff --git a/clients/client-codedeploy/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-codedeploy/protocols/Aws_json1_1.ts rename to clients/client-codedeploy/src/protocols/Aws_json1_1.ts diff --git a/clients/client-codedeploy/src/runtimeConfig.browser.ts b/clients/client-codedeploy/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a2e304de0d4e --- /dev/null +++ b/clients/client-codedeploy/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeDeployClientConfig } from "./CodeDeployClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeDeployClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codedeploy/runtimeConfig.native.ts b/clients/client-codedeploy/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codedeploy/runtimeConfig.native.ts rename to clients/client-codedeploy/src/runtimeConfig.native.ts diff --git a/clients/client-codedeploy/runtimeConfig.shared.ts b/clients/client-codedeploy/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codedeploy/runtimeConfig.shared.ts rename to clients/client-codedeploy/src/runtimeConfig.shared.ts diff --git a/clients/client-codedeploy/src/runtimeConfig.ts b/clients/client-codedeploy/src/runtimeConfig.ts new file mode 100644 index 000000000000..e666813f3088 --- /dev/null +++ b/clients/client-codedeploy/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeDeployClientConfig } from "./CodeDeployClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeDeployClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codedeploy/waiters/waitForDeploymentSuccessful.ts b/clients/client-codedeploy/src/waiters/waitForDeploymentSuccessful.ts similarity index 100% rename from clients/client-codedeploy/waiters/waitForDeploymentSuccessful.ts rename to clients/client-codedeploy/src/waiters/waitForDeploymentSuccessful.ts diff --git a/clients/client-codedeploy/tsconfig.es.json b/clients/client-codedeploy/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codedeploy/tsconfig.es.json +++ b/clients/client-codedeploy/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codedeploy/tsconfig.json b/clients/client-codedeploy/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codedeploy/tsconfig.json +++ b/clients/client-codedeploy/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codedeploy/tsconfig.types.json b/clients/client-codedeploy/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codedeploy/tsconfig.types.json +++ b/clients/client-codedeploy/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codeguru-reviewer/.gitignore b/clients/client-codeguru-reviewer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codeguru-reviewer/.gitignore +++ b/clients/client-codeguru-reviewer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codeguru-reviewer/package.json b/clients/client-codeguru-reviewer/package.json index 33f5d79e4808..f21ecb959ec5 100644 --- a/clients/client-codeguru-reviewer/package.json +++ b/clients/client-codeguru-reviewer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codeguru-reviewer", "repository": { "type": "git", diff --git a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts b/clients/client-codeguru-reviewer/runtimeConfig.browser.ts deleted file mode 100644 index 1cbcd481224e..000000000000 --- a/clients/client-codeguru-reviewer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeGuruReviewerClientConfig } from "./CodeGuruReviewerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeguru-reviewer/runtimeConfig.ts b/clients/client-codeguru-reviewer/runtimeConfig.ts deleted file mode 100644 index 726794cda008..000000000000 --- a/clients/client-codeguru-reviewer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeGuruReviewerClientConfig } from "./CodeGuruReviewerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeguru-reviewer/CodeGuruReviewer.ts b/clients/client-codeguru-reviewer/src/CodeGuruReviewer.ts similarity index 100% rename from clients/client-codeguru-reviewer/CodeGuruReviewer.ts rename to clients/client-codeguru-reviewer/src/CodeGuruReviewer.ts diff --git a/clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts b/clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts similarity index 100% rename from clients/client-codeguru-reviewer/CodeGuruReviewerClient.ts rename to clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts diff --git a/clients/client-codeguru-reviewer/commands/AssociateRepositoryCommand.ts b/clients/client-codeguru-reviewer/src/commands/AssociateRepositoryCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/AssociateRepositoryCommand.ts rename to clients/client-codeguru-reviewer/src/commands/AssociateRepositoryCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/CreateCodeReviewCommand.ts b/clients/client-codeguru-reviewer/src/commands/CreateCodeReviewCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/CreateCodeReviewCommand.ts rename to clients/client-codeguru-reviewer/src/commands/CreateCodeReviewCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/DescribeCodeReviewCommand.ts b/clients/client-codeguru-reviewer/src/commands/DescribeCodeReviewCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/DescribeCodeReviewCommand.ts rename to clients/client-codeguru-reviewer/src/commands/DescribeCodeReviewCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/DescribeRecommendationFeedbackCommand.ts b/clients/client-codeguru-reviewer/src/commands/DescribeRecommendationFeedbackCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/DescribeRecommendationFeedbackCommand.ts rename to clients/client-codeguru-reviewer/src/commands/DescribeRecommendationFeedbackCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/DescribeRepositoryAssociationCommand.ts b/clients/client-codeguru-reviewer/src/commands/DescribeRepositoryAssociationCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/DescribeRepositoryAssociationCommand.ts rename to clients/client-codeguru-reviewer/src/commands/DescribeRepositoryAssociationCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/DisassociateRepositoryCommand.ts b/clients/client-codeguru-reviewer/src/commands/DisassociateRepositoryCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/DisassociateRepositoryCommand.ts rename to clients/client-codeguru-reviewer/src/commands/DisassociateRepositoryCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/ListCodeReviewsCommand.ts b/clients/client-codeguru-reviewer/src/commands/ListCodeReviewsCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/ListCodeReviewsCommand.ts rename to clients/client-codeguru-reviewer/src/commands/ListCodeReviewsCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/ListRecommendationFeedbackCommand.ts b/clients/client-codeguru-reviewer/src/commands/ListRecommendationFeedbackCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/ListRecommendationFeedbackCommand.ts rename to clients/client-codeguru-reviewer/src/commands/ListRecommendationFeedbackCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/ListRecommendationsCommand.ts b/clients/client-codeguru-reviewer/src/commands/ListRecommendationsCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/ListRecommendationsCommand.ts rename to clients/client-codeguru-reviewer/src/commands/ListRecommendationsCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/ListRepositoryAssociationsCommand.ts b/clients/client-codeguru-reviewer/src/commands/ListRepositoryAssociationsCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/ListRepositoryAssociationsCommand.ts rename to clients/client-codeguru-reviewer/src/commands/ListRepositoryAssociationsCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/ListTagsForResourceCommand.ts b/clients/client-codeguru-reviewer/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/ListTagsForResourceCommand.ts rename to clients/client-codeguru-reviewer/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/PutRecommendationFeedbackCommand.ts b/clients/client-codeguru-reviewer/src/commands/PutRecommendationFeedbackCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/PutRecommendationFeedbackCommand.ts rename to clients/client-codeguru-reviewer/src/commands/PutRecommendationFeedbackCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/TagResourceCommand.ts b/clients/client-codeguru-reviewer/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/TagResourceCommand.ts rename to clients/client-codeguru-reviewer/src/commands/TagResourceCommand.ts diff --git a/clients/client-codeguru-reviewer/commands/UntagResourceCommand.ts b/clients/client-codeguru-reviewer/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codeguru-reviewer/commands/UntagResourceCommand.ts rename to clients/client-codeguru-reviewer/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codeguru-reviewer/endpoints.ts b/clients/client-codeguru-reviewer/src/endpoints.ts similarity index 100% rename from clients/client-codeguru-reviewer/endpoints.ts rename to clients/client-codeguru-reviewer/src/endpoints.ts diff --git a/clients/client-codeguru-reviewer/index.ts b/clients/client-codeguru-reviewer/src/index.ts similarity index 100% rename from clients/client-codeguru-reviewer/index.ts rename to clients/client-codeguru-reviewer/src/index.ts diff --git a/clients/client-codeguru-reviewer/models/index.ts b/clients/client-codeguru-reviewer/src/models/index.ts similarity index 100% rename from clients/client-codeguru-reviewer/models/index.ts rename to clients/client-codeguru-reviewer/src/models/index.ts diff --git a/clients/client-codeguru-reviewer/models/models_0.ts b/clients/client-codeguru-reviewer/src/models/models_0.ts similarity index 100% rename from clients/client-codeguru-reviewer/models/models_0.ts rename to clients/client-codeguru-reviewer/src/models/models_0.ts diff --git a/clients/client-codeguru-reviewer/pagination/Interfaces.ts b/clients/client-codeguru-reviewer/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codeguru-reviewer/pagination/Interfaces.ts rename to clients/client-codeguru-reviewer/src/pagination/Interfaces.ts diff --git a/clients/client-codeguru-reviewer/pagination/ListCodeReviewsPaginator.ts b/clients/client-codeguru-reviewer/src/pagination/ListCodeReviewsPaginator.ts similarity index 100% rename from clients/client-codeguru-reviewer/pagination/ListCodeReviewsPaginator.ts rename to clients/client-codeguru-reviewer/src/pagination/ListCodeReviewsPaginator.ts diff --git a/clients/client-codeguru-reviewer/pagination/ListRecommendationFeedbackPaginator.ts b/clients/client-codeguru-reviewer/src/pagination/ListRecommendationFeedbackPaginator.ts similarity index 100% rename from clients/client-codeguru-reviewer/pagination/ListRecommendationFeedbackPaginator.ts rename to clients/client-codeguru-reviewer/src/pagination/ListRecommendationFeedbackPaginator.ts diff --git a/clients/client-codeguru-reviewer/pagination/ListRecommendationsPaginator.ts b/clients/client-codeguru-reviewer/src/pagination/ListRecommendationsPaginator.ts similarity index 100% rename from clients/client-codeguru-reviewer/pagination/ListRecommendationsPaginator.ts rename to clients/client-codeguru-reviewer/src/pagination/ListRecommendationsPaginator.ts diff --git a/clients/client-codeguru-reviewer/pagination/ListRepositoryAssociationsPaginator.ts b/clients/client-codeguru-reviewer/src/pagination/ListRepositoryAssociationsPaginator.ts similarity index 100% rename from clients/client-codeguru-reviewer/pagination/ListRepositoryAssociationsPaginator.ts rename to clients/client-codeguru-reviewer/src/pagination/ListRepositoryAssociationsPaginator.ts diff --git a/clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-codeguru-reviewer/protocols/Aws_restJson1.ts rename to clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts diff --git a/clients/client-codeguru-reviewer/src/runtimeConfig.browser.ts b/clients/client-codeguru-reviewer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1ed140e99b57 --- /dev/null +++ b/clients/client-codeguru-reviewer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeGuruReviewerClientConfig } from "./CodeGuruReviewerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeguru-reviewer/runtimeConfig.native.ts b/clients/client-codeguru-reviewer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codeguru-reviewer/runtimeConfig.native.ts rename to clients/client-codeguru-reviewer/src/runtimeConfig.native.ts diff --git a/clients/client-codeguru-reviewer/runtimeConfig.shared.ts b/clients/client-codeguru-reviewer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codeguru-reviewer/runtimeConfig.shared.ts rename to clients/client-codeguru-reviewer/src/runtimeConfig.shared.ts diff --git a/clients/client-codeguru-reviewer/src/runtimeConfig.ts b/clients/client-codeguru-reviewer/src/runtimeConfig.ts new file mode 100644 index 000000000000..adce015c00fd --- /dev/null +++ b/clients/client-codeguru-reviewer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeGuruReviewerClientConfig } from "./CodeGuruReviewerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeguru-reviewer/waiters/waitForCodeReviewCompleted.ts b/clients/client-codeguru-reviewer/src/waiters/waitForCodeReviewCompleted.ts similarity index 100% rename from clients/client-codeguru-reviewer/waiters/waitForCodeReviewCompleted.ts rename to clients/client-codeguru-reviewer/src/waiters/waitForCodeReviewCompleted.ts diff --git a/clients/client-codeguru-reviewer/waiters/waitForRepositoryAssociationSucceeded.ts b/clients/client-codeguru-reviewer/src/waiters/waitForRepositoryAssociationSucceeded.ts similarity index 100% rename from clients/client-codeguru-reviewer/waiters/waitForRepositoryAssociationSucceeded.ts rename to clients/client-codeguru-reviewer/src/waiters/waitForRepositoryAssociationSucceeded.ts diff --git a/clients/client-codeguru-reviewer/tsconfig.es.json b/clients/client-codeguru-reviewer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codeguru-reviewer/tsconfig.es.json +++ b/clients/client-codeguru-reviewer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codeguru-reviewer/tsconfig.json b/clients/client-codeguru-reviewer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codeguru-reviewer/tsconfig.json +++ b/clients/client-codeguru-reviewer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codeguru-reviewer/tsconfig.types.json b/clients/client-codeguru-reviewer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codeguru-reviewer/tsconfig.types.json +++ b/clients/client-codeguru-reviewer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codeguruprofiler/.gitignore b/clients/client-codeguruprofiler/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codeguruprofiler/.gitignore +++ b/clients/client-codeguruprofiler/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codeguruprofiler/package.json b/clients/client-codeguruprofiler/package.json index 95b978cbac42..7b94345ab7da 100644 --- a/clients/client-codeguruprofiler/package.json +++ b/clients/client-codeguruprofiler/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codeguruprofiler", "repository": { "type": "git", diff --git a/clients/client-codeguruprofiler/runtimeConfig.browser.ts b/clients/client-codeguruprofiler/runtimeConfig.browser.ts deleted file mode 100644 index bc6a2792e8db..000000000000 --- a/clients/client-codeguruprofiler/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeGuruProfilerClientConfig } from "./CodeGuruProfilerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeguruprofiler/runtimeConfig.ts b/clients/client-codeguruprofiler/runtimeConfig.ts deleted file mode 100644 index ec7020b49a17..000000000000 --- a/clients/client-codeguruprofiler/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeGuruProfilerClientConfig } from "./CodeGuruProfilerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codeguruprofiler/CodeGuruProfiler.ts b/clients/client-codeguruprofiler/src/CodeGuruProfiler.ts similarity index 100% rename from clients/client-codeguruprofiler/CodeGuruProfiler.ts rename to clients/client-codeguruprofiler/src/CodeGuruProfiler.ts diff --git a/clients/client-codeguruprofiler/CodeGuruProfilerClient.ts b/clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts similarity index 100% rename from clients/client-codeguruprofiler/CodeGuruProfilerClient.ts rename to clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts diff --git a/clients/client-codeguruprofiler/commands/AddNotificationChannelsCommand.ts b/clients/client-codeguruprofiler/src/commands/AddNotificationChannelsCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/AddNotificationChannelsCommand.ts rename to clients/client-codeguruprofiler/src/commands/AddNotificationChannelsCommand.ts diff --git a/clients/client-codeguruprofiler/commands/BatchGetFrameMetricDataCommand.ts b/clients/client-codeguruprofiler/src/commands/BatchGetFrameMetricDataCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/BatchGetFrameMetricDataCommand.ts rename to clients/client-codeguruprofiler/src/commands/BatchGetFrameMetricDataCommand.ts diff --git a/clients/client-codeguruprofiler/commands/ConfigureAgentCommand.ts b/clients/client-codeguruprofiler/src/commands/ConfigureAgentCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/ConfigureAgentCommand.ts rename to clients/client-codeguruprofiler/src/commands/ConfigureAgentCommand.ts diff --git a/clients/client-codeguruprofiler/commands/CreateProfilingGroupCommand.ts b/clients/client-codeguruprofiler/src/commands/CreateProfilingGroupCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/CreateProfilingGroupCommand.ts rename to clients/client-codeguruprofiler/src/commands/CreateProfilingGroupCommand.ts diff --git a/clients/client-codeguruprofiler/commands/DeleteProfilingGroupCommand.ts b/clients/client-codeguruprofiler/src/commands/DeleteProfilingGroupCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/DeleteProfilingGroupCommand.ts rename to clients/client-codeguruprofiler/src/commands/DeleteProfilingGroupCommand.ts diff --git a/clients/client-codeguruprofiler/commands/DescribeProfilingGroupCommand.ts b/clients/client-codeguruprofiler/src/commands/DescribeProfilingGroupCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/DescribeProfilingGroupCommand.ts rename to clients/client-codeguruprofiler/src/commands/DescribeProfilingGroupCommand.ts diff --git a/clients/client-codeguruprofiler/commands/GetFindingsReportAccountSummaryCommand.ts b/clients/client-codeguruprofiler/src/commands/GetFindingsReportAccountSummaryCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/GetFindingsReportAccountSummaryCommand.ts rename to clients/client-codeguruprofiler/src/commands/GetFindingsReportAccountSummaryCommand.ts diff --git a/clients/client-codeguruprofiler/commands/GetNotificationConfigurationCommand.ts b/clients/client-codeguruprofiler/src/commands/GetNotificationConfigurationCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/GetNotificationConfigurationCommand.ts rename to clients/client-codeguruprofiler/src/commands/GetNotificationConfigurationCommand.ts diff --git a/clients/client-codeguruprofiler/commands/GetPolicyCommand.ts b/clients/client-codeguruprofiler/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/GetPolicyCommand.ts rename to clients/client-codeguruprofiler/src/commands/GetPolicyCommand.ts diff --git a/clients/client-codeguruprofiler/commands/GetProfileCommand.ts b/clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/GetProfileCommand.ts rename to clients/client-codeguruprofiler/src/commands/GetProfileCommand.ts diff --git a/clients/client-codeguruprofiler/commands/GetRecommendationsCommand.ts b/clients/client-codeguruprofiler/src/commands/GetRecommendationsCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/GetRecommendationsCommand.ts rename to clients/client-codeguruprofiler/src/commands/GetRecommendationsCommand.ts diff --git a/clients/client-codeguruprofiler/commands/ListFindingsReportsCommand.ts b/clients/client-codeguruprofiler/src/commands/ListFindingsReportsCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/ListFindingsReportsCommand.ts rename to clients/client-codeguruprofiler/src/commands/ListFindingsReportsCommand.ts diff --git a/clients/client-codeguruprofiler/commands/ListProfileTimesCommand.ts b/clients/client-codeguruprofiler/src/commands/ListProfileTimesCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/ListProfileTimesCommand.ts rename to clients/client-codeguruprofiler/src/commands/ListProfileTimesCommand.ts diff --git a/clients/client-codeguruprofiler/commands/ListProfilingGroupsCommand.ts b/clients/client-codeguruprofiler/src/commands/ListProfilingGroupsCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/ListProfilingGroupsCommand.ts rename to clients/client-codeguruprofiler/src/commands/ListProfilingGroupsCommand.ts diff --git a/clients/client-codeguruprofiler/commands/ListTagsForResourceCommand.ts b/clients/client-codeguruprofiler/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/ListTagsForResourceCommand.ts rename to clients/client-codeguruprofiler/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codeguruprofiler/commands/PostAgentProfileCommand.ts b/clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/PostAgentProfileCommand.ts rename to clients/client-codeguruprofiler/src/commands/PostAgentProfileCommand.ts diff --git a/clients/client-codeguruprofiler/commands/PutPermissionCommand.ts b/clients/client-codeguruprofiler/src/commands/PutPermissionCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/PutPermissionCommand.ts rename to clients/client-codeguruprofiler/src/commands/PutPermissionCommand.ts diff --git a/clients/client-codeguruprofiler/commands/RemoveNotificationChannelCommand.ts b/clients/client-codeguruprofiler/src/commands/RemoveNotificationChannelCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/RemoveNotificationChannelCommand.ts rename to clients/client-codeguruprofiler/src/commands/RemoveNotificationChannelCommand.ts diff --git a/clients/client-codeguruprofiler/commands/RemovePermissionCommand.ts b/clients/client-codeguruprofiler/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/RemovePermissionCommand.ts rename to clients/client-codeguruprofiler/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-codeguruprofiler/commands/SubmitFeedbackCommand.ts b/clients/client-codeguruprofiler/src/commands/SubmitFeedbackCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/SubmitFeedbackCommand.ts rename to clients/client-codeguruprofiler/src/commands/SubmitFeedbackCommand.ts diff --git a/clients/client-codeguruprofiler/commands/TagResourceCommand.ts b/clients/client-codeguruprofiler/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/TagResourceCommand.ts rename to clients/client-codeguruprofiler/src/commands/TagResourceCommand.ts diff --git a/clients/client-codeguruprofiler/commands/UntagResourceCommand.ts b/clients/client-codeguruprofiler/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/UntagResourceCommand.ts rename to clients/client-codeguruprofiler/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codeguruprofiler/commands/UpdateProfilingGroupCommand.ts b/clients/client-codeguruprofiler/src/commands/UpdateProfilingGroupCommand.ts similarity index 100% rename from clients/client-codeguruprofiler/commands/UpdateProfilingGroupCommand.ts rename to clients/client-codeguruprofiler/src/commands/UpdateProfilingGroupCommand.ts diff --git a/clients/client-codeguruprofiler/endpoints.ts b/clients/client-codeguruprofiler/src/endpoints.ts similarity index 100% rename from clients/client-codeguruprofiler/endpoints.ts rename to clients/client-codeguruprofiler/src/endpoints.ts diff --git a/clients/client-codeguruprofiler/index.ts b/clients/client-codeguruprofiler/src/index.ts similarity index 100% rename from clients/client-codeguruprofiler/index.ts rename to clients/client-codeguruprofiler/src/index.ts diff --git a/clients/client-codeguruprofiler/models/index.ts b/clients/client-codeguruprofiler/src/models/index.ts similarity index 100% rename from clients/client-codeguruprofiler/models/index.ts rename to clients/client-codeguruprofiler/src/models/index.ts diff --git a/clients/client-codeguruprofiler/models/models_0.ts b/clients/client-codeguruprofiler/src/models/models_0.ts similarity index 100% rename from clients/client-codeguruprofiler/models/models_0.ts rename to clients/client-codeguruprofiler/src/models/models_0.ts diff --git a/clients/client-codeguruprofiler/pagination/GetFindingsReportAccountSummaryPaginator.ts b/clients/client-codeguruprofiler/src/pagination/GetFindingsReportAccountSummaryPaginator.ts similarity index 100% rename from clients/client-codeguruprofiler/pagination/GetFindingsReportAccountSummaryPaginator.ts rename to clients/client-codeguruprofiler/src/pagination/GetFindingsReportAccountSummaryPaginator.ts diff --git a/clients/client-codeguruprofiler/pagination/Interfaces.ts b/clients/client-codeguruprofiler/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codeguruprofiler/pagination/Interfaces.ts rename to clients/client-codeguruprofiler/src/pagination/Interfaces.ts diff --git a/clients/client-codeguruprofiler/pagination/ListFindingsReportsPaginator.ts b/clients/client-codeguruprofiler/src/pagination/ListFindingsReportsPaginator.ts similarity index 100% rename from clients/client-codeguruprofiler/pagination/ListFindingsReportsPaginator.ts rename to clients/client-codeguruprofiler/src/pagination/ListFindingsReportsPaginator.ts diff --git a/clients/client-codeguruprofiler/pagination/ListProfileTimesPaginator.ts b/clients/client-codeguruprofiler/src/pagination/ListProfileTimesPaginator.ts similarity index 100% rename from clients/client-codeguruprofiler/pagination/ListProfileTimesPaginator.ts rename to clients/client-codeguruprofiler/src/pagination/ListProfileTimesPaginator.ts diff --git a/clients/client-codeguruprofiler/pagination/ListProfilingGroupsPaginator.ts b/clients/client-codeguruprofiler/src/pagination/ListProfilingGroupsPaginator.ts similarity index 100% rename from clients/client-codeguruprofiler/pagination/ListProfilingGroupsPaginator.ts rename to clients/client-codeguruprofiler/src/pagination/ListProfilingGroupsPaginator.ts diff --git a/clients/client-codeguruprofiler/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-codeguruprofiler/protocols/Aws_restJson1.ts rename to clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts diff --git a/clients/client-codeguruprofiler/src/runtimeConfig.browser.ts b/clients/client-codeguruprofiler/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2dc33e85e228 --- /dev/null +++ b/clients/client-codeguruprofiler/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeGuruProfilerClientConfig } from "./CodeGuruProfilerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeguruprofiler/runtimeConfig.native.ts b/clients/client-codeguruprofiler/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codeguruprofiler/runtimeConfig.native.ts rename to clients/client-codeguruprofiler/src/runtimeConfig.native.ts diff --git a/clients/client-codeguruprofiler/runtimeConfig.shared.ts b/clients/client-codeguruprofiler/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codeguruprofiler/runtimeConfig.shared.ts rename to clients/client-codeguruprofiler/src/runtimeConfig.shared.ts diff --git a/clients/client-codeguruprofiler/src/runtimeConfig.ts b/clients/client-codeguruprofiler/src/runtimeConfig.ts new file mode 100644 index 000000000000..06e9d687854d --- /dev/null +++ b/clients/client-codeguruprofiler/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeGuruProfilerClientConfig } from "./CodeGuruProfilerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codeguruprofiler/tsconfig.es.json b/clients/client-codeguruprofiler/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codeguruprofiler/tsconfig.es.json +++ b/clients/client-codeguruprofiler/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codeguruprofiler/tsconfig.json b/clients/client-codeguruprofiler/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codeguruprofiler/tsconfig.json +++ b/clients/client-codeguruprofiler/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codeguruprofiler/tsconfig.types.json b/clients/client-codeguruprofiler/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codeguruprofiler/tsconfig.types.json +++ b/clients/client-codeguruprofiler/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codepipeline/.gitignore b/clients/client-codepipeline/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codepipeline/.gitignore +++ b/clients/client-codepipeline/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codepipeline/package.json b/clients/client-codepipeline/package.json index 6ba3f67be880..adcb59425827 100644 --- a/clients/client-codepipeline/package.json +++ b/clients/client-codepipeline/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codepipeline", "repository": { "type": "git", diff --git a/clients/client-codepipeline/runtimeConfig.browser.ts b/clients/client-codepipeline/runtimeConfig.browser.ts deleted file mode 100644 index 60932422e13e..000000000000 --- a/clients/client-codepipeline/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodePipelineClientConfig } from "./CodePipelineClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodePipelineClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codepipeline/runtimeConfig.ts b/clients/client-codepipeline/runtimeConfig.ts deleted file mode 100644 index 99d3104f0a4f..000000000000 --- a/clients/client-codepipeline/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodePipelineClientConfig } from "./CodePipelineClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodePipelineClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codepipeline/CodePipeline.ts b/clients/client-codepipeline/src/CodePipeline.ts similarity index 100% rename from clients/client-codepipeline/CodePipeline.ts rename to clients/client-codepipeline/src/CodePipeline.ts diff --git a/clients/client-codepipeline/CodePipelineClient.ts b/clients/client-codepipeline/src/CodePipelineClient.ts similarity index 100% rename from clients/client-codepipeline/CodePipelineClient.ts rename to clients/client-codepipeline/src/CodePipelineClient.ts diff --git a/clients/client-codepipeline/commands/AcknowledgeJobCommand.ts b/clients/client-codepipeline/src/commands/AcknowledgeJobCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/AcknowledgeJobCommand.ts rename to clients/client-codepipeline/src/commands/AcknowledgeJobCommand.ts diff --git a/clients/client-codepipeline/commands/AcknowledgeThirdPartyJobCommand.ts b/clients/client-codepipeline/src/commands/AcknowledgeThirdPartyJobCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/AcknowledgeThirdPartyJobCommand.ts rename to clients/client-codepipeline/src/commands/AcknowledgeThirdPartyJobCommand.ts diff --git a/clients/client-codepipeline/commands/CreateCustomActionTypeCommand.ts b/clients/client-codepipeline/src/commands/CreateCustomActionTypeCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/CreateCustomActionTypeCommand.ts rename to clients/client-codepipeline/src/commands/CreateCustomActionTypeCommand.ts diff --git a/clients/client-codepipeline/commands/CreatePipelineCommand.ts b/clients/client-codepipeline/src/commands/CreatePipelineCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/CreatePipelineCommand.ts rename to clients/client-codepipeline/src/commands/CreatePipelineCommand.ts diff --git a/clients/client-codepipeline/commands/DeleteCustomActionTypeCommand.ts b/clients/client-codepipeline/src/commands/DeleteCustomActionTypeCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/DeleteCustomActionTypeCommand.ts rename to clients/client-codepipeline/src/commands/DeleteCustomActionTypeCommand.ts diff --git a/clients/client-codepipeline/commands/DeletePipelineCommand.ts b/clients/client-codepipeline/src/commands/DeletePipelineCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/DeletePipelineCommand.ts rename to clients/client-codepipeline/src/commands/DeletePipelineCommand.ts diff --git a/clients/client-codepipeline/commands/DeleteWebhookCommand.ts b/clients/client-codepipeline/src/commands/DeleteWebhookCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/DeleteWebhookCommand.ts rename to clients/client-codepipeline/src/commands/DeleteWebhookCommand.ts diff --git a/clients/client-codepipeline/commands/DeregisterWebhookWithThirdPartyCommand.ts b/clients/client-codepipeline/src/commands/DeregisterWebhookWithThirdPartyCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/DeregisterWebhookWithThirdPartyCommand.ts rename to clients/client-codepipeline/src/commands/DeregisterWebhookWithThirdPartyCommand.ts diff --git a/clients/client-codepipeline/commands/DisableStageTransitionCommand.ts b/clients/client-codepipeline/src/commands/DisableStageTransitionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/DisableStageTransitionCommand.ts rename to clients/client-codepipeline/src/commands/DisableStageTransitionCommand.ts diff --git a/clients/client-codepipeline/commands/EnableStageTransitionCommand.ts b/clients/client-codepipeline/src/commands/EnableStageTransitionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/EnableStageTransitionCommand.ts rename to clients/client-codepipeline/src/commands/EnableStageTransitionCommand.ts diff --git a/clients/client-codepipeline/commands/GetActionTypeCommand.ts b/clients/client-codepipeline/src/commands/GetActionTypeCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetActionTypeCommand.ts rename to clients/client-codepipeline/src/commands/GetActionTypeCommand.ts diff --git a/clients/client-codepipeline/commands/GetJobDetailsCommand.ts b/clients/client-codepipeline/src/commands/GetJobDetailsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetJobDetailsCommand.ts rename to clients/client-codepipeline/src/commands/GetJobDetailsCommand.ts diff --git a/clients/client-codepipeline/commands/GetPipelineCommand.ts b/clients/client-codepipeline/src/commands/GetPipelineCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetPipelineCommand.ts rename to clients/client-codepipeline/src/commands/GetPipelineCommand.ts diff --git a/clients/client-codepipeline/commands/GetPipelineExecutionCommand.ts b/clients/client-codepipeline/src/commands/GetPipelineExecutionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetPipelineExecutionCommand.ts rename to clients/client-codepipeline/src/commands/GetPipelineExecutionCommand.ts diff --git a/clients/client-codepipeline/commands/GetPipelineStateCommand.ts b/clients/client-codepipeline/src/commands/GetPipelineStateCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetPipelineStateCommand.ts rename to clients/client-codepipeline/src/commands/GetPipelineStateCommand.ts diff --git a/clients/client-codepipeline/commands/GetThirdPartyJobDetailsCommand.ts b/clients/client-codepipeline/src/commands/GetThirdPartyJobDetailsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/GetThirdPartyJobDetailsCommand.ts rename to clients/client-codepipeline/src/commands/GetThirdPartyJobDetailsCommand.ts diff --git a/clients/client-codepipeline/commands/ListActionExecutionsCommand.ts b/clients/client-codepipeline/src/commands/ListActionExecutionsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListActionExecutionsCommand.ts rename to clients/client-codepipeline/src/commands/ListActionExecutionsCommand.ts diff --git a/clients/client-codepipeline/commands/ListActionTypesCommand.ts b/clients/client-codepipeline/src/commands/ListActionTypesCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListActionTypesCommand.ts rename to clients/client-codepipeline/src/commands/ListActionTypesCommand.ts diff --git a/clients/client-codepipeline/commands/ListPipelineExecutionsCommand.ts b/clients/client-codepipeline/src/commands/ListPipelineExecutionsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListPipelineExecutionsCommand.ts rename to clients/client-codepipeline/src/commands/ListPipelineExecutionsCommand.ts diff --git a/clients/client-codepipeline/commands/ListPipelinesCommand.ts b/clients/client-codepipeline/src/commands/ListPipelinesCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListPipelinesCommand.ts rename to clients/client-codepipeline/src/commands/ListPipelinesCommand.ts diff --git a/clients/client-codepipeline/commands/ListTagsForResourceCommand.ts b/clients/client-codepipeline/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListTagsForResourceCommand.ts rename to clients/client-codepipeline/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codepipeline/commands/ListWebhooksCommand.ts b/clients/client-codepipeline/src/commands/ListWebhooksCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/ListWebhooksCommand.ts rename to clients/client-codepipeline/src/commands/ListWebhooksCommand.ts diff --git a/clients/client-codepipeline/commands/PollForJobsCommand.ts b/clients/client-codepipeline/src/commands/PollForJobsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PollForJobsCommand.ts rename to clients/client-codepipeline/src/commands/PollForJobsCommand.ts diff --git a/clients/client-codepipeline/commands/PollForThirdPartyJobsCommand.ts b/clients/client-codepipeline/src/commands/PollForThirdPartyJobsCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PollForThirdPartyJobsCommand.ts rename to clients/client-codepipeline/src/commands/PollForThirdPartyJobsCommand.ts diff --git a/clients/client-codepipeline/commands/PutActionRevisionCommand.ts b/clients/client-codepipeline/src/commands/PutActionRevisionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutActionRevisionCommand.ts rename to clients/client-codepipeline/src/commands/PutActionRevisionCommand.ts diff --git a/clients/client-codepipeline/commands/PutApprovalResultCommand.ts b/clients/client-codepipeline/src/commands/PutApprovalResultCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutApprovalResultCommand.ts rename to clients/client-codepipeline/src/commands/PutApprovalResultCommand.ts diff --git a/clients/client-codepipeline/commands/PutJobFailureResultCommand.ts b/clients/client-codepipeline/src/commands/PutJobFailureResultCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutJobFailureResultCommand.ts rename to clients/client-codepipeline/src/commands/PutJobFailureResultCommand.ts diff --git a/clients/client-codepipeline/commands/PutJobSuccessResultCommand.ts b/clients/client-codepipeline/src/commands/PutJobSuccessResultCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutJobSuccessResultCommand.ts rename to clients/client-codepipeline/src/commands/PutJobSuccessResultCommand.ts diff --git a/clients/client-codepipeline/commands/PutThirdPartyJobFailureResultCommand.ts b/clients/client-codepipeline/src/commands/PutThirdPartyJobFailureResultCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutThirdPartyJobFailureResultCommand.ts rename to clients/client-codepipeline/src/commands/PutThirdPartyJobFailureResultCommand.ts diff --git a/clients/client-codepipeline/commands/PutThirdPartyJobSuccessResultCommand.ts b/clients/client-codepipeline/src/commands/PutThirdPartyJobSuccessResultCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutThirdPartyJobSuccessResultCommand.ts rename to clients/client-codepipeline/src/commands/PutThirdPartyJobSuccessResultCommand.ts diff --git a/clients/client-codepipeline/commands/PutWebhookCommand.ts b/clients/client-codepipeline/src/commands/PutWebhookCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/PutWebhookCommand.ts rename to clients/client-codepipeline/src/commands/PutWebhookCommand.ts diff --git a/clients/client-codepipeline/commands/RegisterWebhookWithThirdPartyCommand.ts b/clients/client-codepipeline/src/commands/RegisterWebhookWithThirdPartyCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/RegisterWebhookWithThirdPartyCommand.ts rename to clients/client-codepipeline/src/commands/RegisterWebhookWithThirdPartyCommand.ts diff --git a/clients/client-codepipeline/commands/RetryStageExecutionCommand.ts b/clients/client-codepipeline/src/commands/RetryStageExecutionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/RetryStageExecutionCommand.ts rename to clients/client-codepipeline/src/commands/RetryStageExecutionCommand.ts diff --git a/clients/client-codepipeline/commands/StartPipelineExecutionCommand.ts b/clients/client-codepipeline/src/commands/StartPipelineExecutionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/StartPipelineExecutionCommand.ts rename to clients/client-codepipeline/src/commands/StartPipelineExecutionCommand.ts diff --git a/clients/client-codepipeline/commands/StopPipelineExecutionCommand.ts b/clients/client-codepipeline/src/commands/StopPipelineExecutionCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/StopPipelineExecutionCommand.ts rename to clients/client-codepipeline/src/commands/StopPipelineExecutionCommand.ts diff --git a/clients/client-codepipeline/commands/TagResourceCommand.ts b/clients/client-codepipeline/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/TagResourceCommand.ts rename to clients/client-codepipeline/src/commands/TagResourceCommand.ts diff --git a/clients/client-codepipeline/commands/UntagResourceCommand.ts b/clients/client-codepipeline/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/UntagResourceCommand.ts rename to clients/client-codepipeline/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codepipeline/commands/UpdateActionTypeCommand.ts b/clients/client-codepipeline/src/commands/UpdateActionTypeCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/UpdateActionTypeCommand.ts rename to clients/client-codepipeline/src/commands/UpdateActionTypeCommand.ts diff --git a/clients/client-codepipeline/commands/UpdatePipelineCommand.ts b/clients/client-codepipeline/src/commands/UpdatePipelineCommand.ts similarity index 100% rename from clients/client-codepipeline/commands/UpdatePipelineCommand.ts rename to clients/client-codepipeline/src/commands/UpdatePipelineCommand.ts diff --git a/clients/client-codepipeline/endpoints.ts b/clients/client-codepipeline/src/endpoints.ts similarity index 100% rename from clients/client-codepipeline/endpoints.ts rename to clients/client-codepipeline/src/endpoints.ts diff --git a/clients/client-codepipeline/index.ts b/clients/client-codepipeline/src/index.ts similarity index 100% rename from clients/client-codepipeline/index.ts rename to clients/client-codepipeline/src/index.ts diff --git a/clients/client-codepipeline/models/index.ts b/clients/client-codepipeline/src/models/index.ts similarity index 100% rename from clients/client-codepipeline/models/index.ts rename to clients/client-codepipeline/src/models/index.ts diff --git a/clients/client-codepipeline/models/models_0.ts b/clients/client-codepipeline/src/models/models_0.ts similarity index 100% rename from clients/client-codepipeline/models/models_0.ts rename to clients/client-codepipeline/src/models/models_0.ts diff --git a/clients/client-codepipeline/pagination/Interfaces.ts b/clients/client-codepipeline/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codepipeline/pagination/Interfaces.ts rename to clients/client-codepipeline/src/pagination/Interfaces.ts diff --git a/clients/client-codepipeline/pagination/ListActionExecutionsPaginator.ts b/clients/client-codepipeline/src/pagination/ListActionExecutionsPaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListActionExecutionsPaginator.ts rename to clients/client-codepipeline/src/pagination/ListActionExecutionsPaginator.ts diff --git a/clients/client-codepipeline/pagination/ListActionTypesPaginator.ts b/clients/client-codepipeline/src/pagination/ListActionTypesPaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListActionTypesPaginator.ts rename to clients/client-codepipeline/src/pagination/ListActionTypesPaginator.ts diff --git a/clients/client-codepipeline/pagination/ListPipelineExecutionsPaginator.ts b/clients/client-codepipeline/src/pagination/ListPipelineExecutionsPaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListPipelineExecutionsPaginator.ts rename to clients/client-codepipeline/src/pagination/ListPipelineExecutionsPaginator.ts diff --git a/clients/client-codepipeline/pagination/ListPipelinesPaginator.ts b/clients/client-codepipeline/src/pagination/ListPipelinesPaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListPipelinesPaginator.ts rename to clients/client-codepipeline/src/pagination/ListPipelinesPaginator.ts diff --git a/clients/client-codepipeline/pagination/ListTagsForResourcePaginator.ts b/clients/client-codepipeline/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListTagsForResourcePaginator.ts rename to clients/client-codepipeline/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-codepipeline/pagination/ListWebhooksPaginator.ts b/clients/client-codepipeline/src/pagination/ListWebhooksPaginator.ts similarity index 100% rename from clients/client-codepipeline/pagination/ListWebhooksPaginator.ts rename to clients/client-codepipeline/src/pagination/ListWebhooksPaginator.ts diff --git a/clients/client-codepipeline/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-codepipeline/protocols/Aws_json1_1.ts rename to clients/client-codepipeline/src/protocols/Aws_json1_1.ts diff --git a/clients/client-codepipeline/src/runtimeConfig.browser.ts b/clients/client-codepipeline/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e471e3fecccb --- /dev/null +++ b/clients/client-codepipeline/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodePipelineClientConfig } from "./CodePipelineClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodePipelineClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codepipeline/runtimeConfig.native.ts b/clients/client-codepipeline/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codepipeline/runtimeConfig.native.ts rename to clients/client-codepipeline/src/runtimeConfig.native.ts diff --git a/clients/client-codepipeline/runtimeConfig.shared.ts b/clients/client-codepipeline/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codepipeline/runtimeConfig.shared.ts rename to clients/client-codepipeline/src/runtimeConfig.shared.ts diff --git a/clients/client-codepipeline/src/runtimeConfig.ts b/clients/client-codepipeline/src/runtimeConfig.ts new file mode 100644 index 000000000000..514706dfd05a --- /dev/null +++ b/clients/client-codepipeline/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodePipelineClientConfig } from "./CodePipelineClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodePipelineClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codepipeline/tsconfig.es.json b/clients/client-codepipeline/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codepipeline/tsconfig.es.json +++ b/clients/client-codepipeline/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codepipeline/tsconfig.json b/clients/client-codepipeline/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codepipeline/tsconfig.json +++ b/clients/client-codepipeline/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codepipeline/tsconfig.types.json b/clients/client-codepipeline/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codepipeline/tsconfig.types.json +++ b/clients/client-codepipeline/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codestar-connections/.gitignore b/clients/client-codestar-connections/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codestar-connections/.gitignore +++ b/clients/client-codestar-connections/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codestar-connections/package.json b/clients/client-codestar-connections/package.json index c94de30c5165..011d53d79be3 100644 --- a/clients/client-codestar-connections/package.json +++ b/clients/client-codestar-connections/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codestar-connections", "repository": { "type": "git", diff --git a/clients/client-codestar-connections/runtimeConfig.browser.ts b/clients/client-codestar-connections/runtimeConfig.browser.ts deleted file mode 100644 index 4ece15b790eb..000000000000 --- a/clients/client-codestar-connections/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeStarConnectionsClientConfig } from "./CodeStarConnectionsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar-connections/runtimeConfig.ts b/clients/client-codestar-connections/runtimeConfig.ts deleted file mode 100644 index 4306bb0eee74..000000000000 --- a/clients/client-codestar-connections/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeStarConnectionsClientConfig } from "./CodeStarConnectionsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar-connections/CodeStarConnections.ts b/clients/client-codestar-connections/src/CodeStarConnections.ts similarity index 100% rename from clients/client-codestar-connections/CodeStarConnections.ts rename to clients/client-codestar-connections/src/CodeStarConnections.ts diff --git a/clients/client-codestar-connections/CodeStarConnectionsClient.ts b/clients/client-codestar-connections/src/CodeStarConnectionsClient.ts similarity index 100% rename from clients/client-codestar-connections/CodeStarConnectionsClient.ts rename to clients/client-codestar-connections/src/CodeStarConnectionsClient.ts diff --git a/clients/client-codestar-connections/commands/CreateConnectionCommand.ts b/clients/client-codestar-connections/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/CreateConnectionCommand.ts rename to clients/client-codestar-connections/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-codestar-connections/commands/CreateHostCommand.ts b/clients/client-codestar-connections/src/commands/CreateHostCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/CreateHostCommand.ts rename to clients/client-codestar-connections/src/commands/CreateHostCommand.ts diff --git a/clients/client-codestar-connections/commands/DeleteConnectionCommand.ts b/clients/client-codestar-connections/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/DeleteConnectionCommand.ts rename to clients/client-codestar-connections/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-codestar-connections/commands/DeleteHostCommand.ts b/clients/client-codestar-connections/src/commands/DeleteHostCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/DeleteHostCommand.ts rename to clients/client-codestar-connections/src/commands/DeleteHostCommand.ts diff --git a/clients/client-codestar-connections/commands/GetConnectionCommand.ts b/clients/client-codestar-connections/src/commands/GetConnectionCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/GetConnectionCommand.ts rename to clients/client-codestar-connections/src/commands/GetConnectionCommand.ts diff --git a/clients/client-codestar-connections/commands/GetHostCommand.ts b/clients/client-codestar-connections/src/commands/GetHostCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/GetHostCommand.ts rename to clients/client-codestar-connections/src/commands/GetHostCommand.ts diff --git a/clients/client-codestar-connections/commands/ListConnectionsCommand.ts b/clients/client-codestar-connections/src/commands/ListConnectionsCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/ListConnectionsCommand.ts rename to clients/client-codestar-connections/src/commands/ListConnectionsCommand.ts diff --git a/clients/client-codestar-connections/commands/ListHostsCommand.ts b/clients/client-codestar-connections/src/commands/ListHostsCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/ListHostsCommand.ts rename to clients/client-codestar-connections/src/commands/ListHostsCommand.ts diff --git a/clients/client-codestar-connections/commands/ListTagsForResourceCommand.ts b/clients/client-codestar-connections/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/ListTagsForResourceCommand.ts rename to clients/client-codestar-connections/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codestar-connections/commands/TagResourceCommand.ts b/clients/client-codestar-connections/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/TagResourceCommand.ts rename to clients/client-codestar-connections/src/commands/TagResourceCommand.ts diff --git a/clients/client-codestar-connections/commands/UntagResourceCommand.ts b/clients/client-codestar-connections/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/UntagResourceCommand.ts rename to clients/client-codestar-connections/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codestar-connections/commands/UpdateHostCommand.ts b/clients/client-codestar-connections/src/commands/UpdateHostCommand.ts similarity index 100% rename from clients/client-codestar-connections/commands/UpdateHostCommand.ts rename to clients/client-codestar-connections/src/commands/UpdateHostCommand.ts diff --git a/clients/client-codestar-connections/endpoints.ts b/clients/client-codestar-connections/src/endpoints.ts similarity index 100% rename from clients/client-codestar-connections/endpoints.ts rename to clients/client-codestar-connections/src/endpoints.ts diff --git a/clients/client-codestar-connections/index.ts b/clients/client-codestar-connections/src/index.ts similarity index 100% rename from clients/client-codestar-connections/index.ts rename to clients/client-codestar-connections/src/index.ts diff --git a/clients/client-codestar-connections/models/index.ts b/clients/client-codestar-connections/src/models/index.ts similarity index 100% rename from clients/client-codestar-connections/models/index.ts rename to clients/client-codestar-connections/src/models/index.ts diff --git a/clients/client-codestar-connections/models/models_0.ts b/clients/client-codestar-connections/src/models/models_0.ts similarity index 100% rename from clients/client-codestar-connections/models/models_0.ts rename to clients/client-codestar-connections/src/models/models_0.ts diff --git a/clients/client-codestar-connections/pagination/Interfaces.ts b/clients/client-codestar-connections/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codestar-connections/pagination/Interfaces.ts rename to clients/client-codestar-connections/src/pagination/Interfaces.ts diff --git a/clients/client-codestar-connections/pagination/ListConnectionsPaginator.ts b/clients/client-codestar-connections/src/pagination/ListConnectionsPaginator.ts similarity index 100% rename from clients/client-codestar-connections/pagination/ListConnectionsPaginator.ts rename to clients/client-codestar-connections/src/pagination/ListConnectionsPaginator.ts diff --git a/clients/client-codestar-connections/pagination/ListHostsPaginator.ts b/clients/client-codestar-connections/src/pagination/ListHostsPaginator.ts similarity index 100% rename from clients/client-codestar-connections/pagination/ListHostsPaginator.ts rename to clients/client-codestar-connections/src/pagination/ListHostsPaginator.ts diff --git a/clients/client-codestar-connections/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-codestar-connections/protocols/Aws_json1_0.ts rename to clients/client-codestar-connections/src/protocols/Aws_json1_0.ts diff --git a/clients/client-codestar-connections/src/runtimeConfig.browser.ts b/clients/client-codestar-connections/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..98221a21877b --- /dev/null +++ b/clients/client-codestar-connections/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeStarConnectionsClientConfig } from "./CodeStarConnectionsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar-connections/runtimeConfig.native.ts b/clients/client-codestar-connections/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codestar-connections/runtimeConfig.native.ts rename to clients/client-codestar-connections/src/runtimeConfig.native.ts diff --git a/clients/client-codestar-connections/runtimeConfig.shared.ts b/clients/client-codestar-connections/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codestar-connections/runtimeConfig.shared.ts rename to clients/client-codestar-connections/src/runtimeConfig.shared.ts diff --git a/clients/client-codestar-connections/src/runtimeConfig.ts b/clients/client-codestar-connections/src/runtimeConfig.ts new file mode 100644 index 000000000000..8d0e45560d5b --- /dev/null +++ b/clients/client-codestar-connections/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeStarConnectionsClientConfig } from "./CodeStarConnectionsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar-connections/tsconfig.es.json b/clients/client-codestar-connections/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codestar-connections/tsconfig.es.json +++ b/clients/client-codestar-connections/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codestar-connections/tsconfig.json b/clients/client-codestar-connections/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codestar-connections/tsconfig.json +++ b/clients/client-codestar-connections/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codestar-connections/tsconfig.types.json b/clients/client-codestar-connections/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codestar-connections/tsconfig.types.json +++ b/clients/client-codestar-connections/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codestar-notifications/.gitignore b/clients/client-codestar-notifications/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codestar-notifications/.gitignore +++ b/clients/client-codestar-notifications/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codestar-notifications/package.json b/clients/client-codestar-notifications/package.json index fbd5df4f44b4..bbf04ea9e0b7 100644 --- a/clients/client-codestar-notifications/package.json +++ b/clients/client-codestar-notifications/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codestar-notifications", "repository": { "type": "git", diff --git a/clients/client-codestar-notifications/runtimeConfig.browser.ts b/clients/client-codestar-notifications/runtimeConfig.browser.ts deleted file mode 100644 index 213b4413f9ad..000000000000 --- a/clients/client-codestar-notifications/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodestarNotificationsClientConfig } from "./CodestarNotificationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar-notifications/runtimeConfig.ts b/clients/client-codestar-notifications/runtimeConfig.ts deleted file mode 100644 index 87564d605456..000000000000 --- a/clients/client-codestar-notifications/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodestarNotificationsClientConfig } from "./CodestarNotificationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar-notifications/CodestarNotifications.ts b/clients/client-codestar-notifications/src/CodestarNotifications.ts similarity index 100% rename from clients/client-codestar-notifications/CodestarNotifications.ts rename to clients/client-codestar-notifications/src/CodestarNotifications.ts diff --git a/clients/client-codestar-notifications/CodestarNotificationsClient.ts b/clients/client-codestar-notifications/src/CodestarNotificationsClient.ts similarity index 100% rename from clients/client-codestar-notifications/CodestarNotificationsClient.ts rename to clients/client-codestar-notifications/src/CodestarNotificationsClient.ts diff --git a/clients/client-codestar-notifications/commands/CreateNotificationRuleCommand.ts b/clients/client-codestar-notifications/src/commands/CreateNotificationRuleCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/CreateNotificationRuleCommand.ts rename to clients/client-codestar-notifications/src/commands/CreateNotificationRuleCommand.ts diff --git a/clients/client-codestar-notifications/commands/DeleteNotificationRuleCommand.ts b/clients/client-codestar-notifications/src/commands/DeleteNotificationRuleCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/DeleteNotificationRuleCommand.ts rename to clients/client-codestar-notifications/src/commands/DeleteNotificationRuleCommand.ts diff --git a/clients/client-codestar-notifications/commands/DeleteTargetCommand.ts b/clients/client-codestar-notifications/src/commands/DeleteTargetCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/DeleteTargetCommand.ts rename to clients/client-codestar-notifications/src/commands/DeleteTargetCommand.ts diff --git a/clients/client-codestar-notifications/commands/DescribeNotificationRuleCommand.ts b/clients/client-codestar-notifications/src/commands/DescribeNotificationRuleCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/DescribeNotificationRuleCommand.ts rename to clients/client-codestar-notifications/src/commands/DescribeNotificationRuleCommand.ts diff --git a/clients/client-codestar-notifications/commands/ListEventTypesCommand.ts b/clients/client-codestar-notifications/src/commands/ListEventTypesCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/ListEventTypesCommand.ts rename to clients/client-codestar-notifications/src/commands/ListEventTypesCommand.ts diff --git a/clients/client-codestar-notifications/commands/ListNotificationRulesCommand.ts b/clients/client-codestar-notifications/src/commands/ListNotificationRulesCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/ListNotificationRulesCommand.ts rename to clients/client-codestar-notifications/src/commands/ListNotificationRulesCommand.ts diff --git a/clients/client-codestar-notifications/commands/ListTagsForResourceCommand.ts b/clients/client-codestar-notifications/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/ListTagsForResourceCommand.ts rename to clients/client-codestar-notifications/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-codestar-notifications/commands/ListTargetsCommand.ts b/clients/client-codestar-notifications/src/commands/ListTargetsCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/ListTargetsCommand.ts rename to clients/client-codestar-notifications/src/commands/ListTargetsCommand.ts diff --git a/clients/client-codestar-notifications/commands/SubscribeCommand.ts b/clients/client-codestar-notifications/src/commands/SubscribeCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/SubscribeCommand.ts rename to clients/client-codestar-notifications/src/commands/SubscribeCommand.ts diff --git a/clients/client-codestar-notifications/commands/TagResourceCommand.ts b/clients/client-codestar-notifications/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/TagResourceCommand.ts rename to clients/client-codestar-notifications/src/commands/TagResourceCommand.ts diff --git a/clients/client-codestar-notifications/commands/UnsubscribeCommand.ts b/clients/client-codestar-notifications/src/commands/UnsubscribeCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/UnsubscribeCommand.ts rename to clients/client-codestar-notifications/src/commands/UnsubscribeCommand.ts diff --git a/clients/client-codestar-notifications/commands/UntagResourceCommand.ts b/clients/client-codestar-notifications/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/UntagResourceCommand.ts rename to clients/client-codestar-notifications/src/commands/UntagResourceCommand.ts diff --git a/clients/client-codestar-notifications/commands/UpdateNotificationRuleCommand.ts b/clients/client-codestar-notifications/src/commands/UpdateNotificationRuleCommand.ts similarity index 100% rename from clients/client-codestar-notifications/commands/UpdateNotificationRuleCommand.ts rename to clients/client-codestar-notifications/src/commands/UpdateNotificationRuleCommand.ts diff --git a/clients/client-codestar-notifications/endpoints.ts b/clients/client-codestar-notifications/src/endpoints.ts similarity index 100% rename from clients/client-codestar-notifications/endpoints.ts rename to clients/client-codestar-notifications/src/endpoints.ts diff --git a/clients/client-codestar-notifications/index.ts b/clients/client-codestar-notifications/src/index.ts similarity index 100% rename from clients/client-codestar-notifications/index.ts rename to clients/client-codestar-notifications/src/index.ts diff --git a/clients/client-codestar-notifications/models/index.ts b/clients/client-codestar-notifications/src/models/index.ts similarity index 100% rename from clients/client-codestar-notifications/models/index.ts rename to clients/client-codestar-notifications/src/models/index.ts diff --git a/clients/client-codestar-notifications/models/models_0.ts b/clients/client-codestar-notifications/src/models/models_0.ts similarity index 100% rename from clients/client-codestar-notifications/models/models_0.ts rename to clients/client-codestar-notifications/src/models/models_0.ts diff --git a/clients/client-codestar-notifications/pagination/Interfaces.ts b/clients/client-codestar-notifications/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-codestar-notifications/pagination/Interfaces.ts rename to clients/client-codestar-notifications/src/pagination/Interfaces.ts diff --git a/clients/client-codestar-notifications/pagination/ListEventTypesPaginator.ts b/clients/client-codestar-notifications/src/pagination/ListEventTypesPaginator.ts similarity index 100% rename from clients/client-codestar-notifications/pagination/ListEventTypesPaginator.ts rename to clients/client-codestar-notifications/src/pagination/ListEventTypesPaginator.ts diff --git a/clients/client-codestar-notifications/pagination/ListNotificationRulesPaginator.ts b/clients/client-codestar-notifications/src/pagination/ListNotificationRulesPaginator.ts similarity index 100% rename from clients/client-codestar-notifications/pagination/ListNotificationRulesPaginator.ts rename to clients/client-codestar-notifications/src/pagination/ListNotificationRulesPaginator.ts diff --git a/clients/client-codestar-notifications/pagination/ListTargetsPaginator.ts b/clients/client-codestar-notifications/src/pagination/ListTargetsPaginator.ts similarity index 100% rename from clients/client-codestar-notifications/pagination/ListTargetsPaginator.ts rename to clients/client-codestar-notifications/src/pagination/ListTargetsPaginator.ts diff --git a/clients/client-codestar-notifications/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-codestar-notifications/protocols/Aws_restJson1.ts rename to clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts diff --git a/clients/client-codestar-notifications/src/runtimeConfig.browser.ts b/clients/client-codestar-notifications/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fbfd6290a6e2 --- /dev/null +++ b/clients/client-codestar-notifications/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodestarNotificationsClientConfig } from "./CodestarNotificationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar-notifications/runtimeConfig.native.ts b/clients/client-codestar-notifications/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codestar-notifications/runtimeConfig.native.ts rename to clients/client-codestar-notifications/src/runtimeConfig.native.ts diff --git a/clients/client-codestar-notifications/runtimeConfig.shared.ts b/clients/client-codestar-notifications/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codestar-notifications/runtimeConfig.shared.ts rename to clients/client-codestar-notifications/src/runtimeConfig.shared.ts diff --git a/clients/client-codestar-notifications/src/runtimeConfig.ts b/clients/client-codestar-notifications/src/runtimeConfig.ts new file mode 100644 index 000000000000..18ffe0bd2355 --- /dev/null +++ b/clients/client-codestar-notifications/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodestarNotificationsClientConfig } from "./CodestarNotificationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar-notifications/tsconfig.es.json b/clients/client-codestar-notifications/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codestar-notifications/tsconfig.es.json +++ b/clients/client-codestar-notifications/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codestar-notifications/tsconfig.json b/clients/client-codestar-notifications/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codestar-notifications/tsconfig.json +++ b/clients/client-codestar-notifications/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codestar-notifications/tsconfig.types.json b/clients/client-codestar-notifications/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codestar-notifications/tsconfig.types.json +++ b/clients/client-codestar-notifications/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-codestar/.gitignore b/clients/client-codestar/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-codestar/.gitignore +++ b/clients/client-codestar/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-codestar/package.json b/clients/client-codestar/package.json index 18f4f6da735b..d8c394b2b4cb 100644 --- a/clients/client-codestar/package.json +++ b/clients/client-codestar/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-codestar", "repository": { "type": "git", diff --git a/clients/client-codestar/runtimeConfig.browser.ts b/clients/client-codestar/runtimeConfig.browser.ts deleted file mode 100644 index 4144d943563a..000000000000 --- a/clients/client-codestar/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CodeStarClientConfig } from "./CodeStarClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeStarClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar/runtimeConfig.ts b/clients/client-codestar/runtimeConfig.ts deleted file mode 100644 index 6b1882ad80a7..000000000000 --- a/clients/client-codestar/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CodeStarClientConfig } from "./CodeStarClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CodeStarClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-codestar/CodeStar.ts b/clients/client-codestar/src/CodeStar.ts similarity index 100% rename from clients/client-codestar/CodeStar.ts rename to clients/client-codestar/src/CodeStar.ts diff --git a/clients/client-codestar/CodeStarClient.ts b/clients/client-codestar/src/CodeStarClient.ts similarity index 100% rename from clients/client-codestar/CodeStarClient.ts rename to clients/client-codestar/src/CodeStarClient.ts diff --git a/clients/client-codestar/commands/AssociateTeamMemberCommand.ts b/clients/client-codestar/src/commands/AssociateTeamMemberCommand.ts similarity index 100% rename from clients/client-codestar/commands/AssociateTeamMemberCommand.ts rename to clients/client-codestar/src/commands/AssociateTeamMemberCommand.ts diff --git a/clients/client-codestar/commands/CreateProjectCommand.ts b/clients/client-codestar/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/CreateProjectCommand.ts rename to clients/client-codestar/src/commands/CreateProjectCommand.ts diff --git a/clients/client-codestar/commands/CreateUserProfileCommand.ts b/clients/client-codestar/src/commands/CreateUserProfileCommand.ts similarity index 100% rename from clients/client-codestar/commands/CreateUserProfileCommand.ts rename to clients/client-codestar/src/commands/CreateUserProfileCommand.ts diff --git a/clients/client-codestar/commands/DeleteProjectCommand.ts b/clients/client-codestar/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/DeleteProjectCommand.ts rename to clients/client-codestar/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-codestar/commands/DeleteUserProfileCommand.ts b/clients/client-codestar/src/commands/DeleteUserProfileCommand.ts similarity index 100% rename from clients/client-codestar/commands/DeleteUserProfileCommand.ts rename to clients/client-codestar/src/commands/DeleteUserProfileCommand.ts diff --git a/clients/client-codestar/commands/DescribeProjectCommand.ts b/clients/client-codestar/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/DescribeProjectCommand.ts rename to clients/client-codestar/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-codestar/commands/DescribeUserProfileCommand.ts b/clients/client-codestar/src/commands/DescribeUserProfileCommand.ts similarity index 100% rename from clients/client-codestar/commands/DescribeUserProfileCommand.ts rename to clients/client-codestar/src/commands/DescribeUserProfileCommand.ts diff --git a/clients/client-codestar/commands/DisassociateTeamMemberCommand.ts b/clients/client-codestar/src/commands/DisassociateTeamMemberCommand.ts similarity index 100% rename from clients/client-codestar/commands/DisassociateTeamMemberCommand.ts rename to clients/client-codestar/src/commands/DisassociateTeamMemberCommand.ts diff --git a/clients/client-codestar/commands/ListProjectsCommand.ts b/clients/client-codestar/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-codestar/commands/ListProjectsCommand.ts rename to clients/client-codestar/src/commands/ListProjectsCommand.ts diff --git a/clients/client-codestar/commands/ListResourcesCommand.ts b/clients/client-codestar/src/commands/ListResourcesCommand.ts similarity index 100% rename from clients/client-codestar/commands/ListResourcesCommand.ts rename to clients/client-codestar/src/commands/ListResourcesCommand.ts diff --git a/clients/client-codestar/commands/ListTagsForProjectCommand.ts b/clients/client-codestar/src/commands/ListTagsForProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/ListTagsForProjectCommand.ts rename to clients/client-codestar/src/commands/ListTagsForProjectCommand.ts diff --git a/clients/client-codestar/commands/ListTeamMembersCommand.ts b/clients/client-codestar/src/commands/ListTeamMembersCommand.ts similarity index 100% rename from clients/client-codestar/commands/ListTeamMembersCommand.ts rename to clients/client-codestar/src/commands/ListTeamMembersCommand.ts diff --git a/clients/client-codestar/commands/ListUserProfilesCommand.ts b/clients/client-codestar/src/commands/ListUserProfilesCommand.ts similarity index 100% rename from clients/client-codestar/commands/ListUserProfilesCommand.ts rename to clients/client-codestar/src/commands/ListUserProfilesCommand.ts diff --git a/clients/client-codestar/commands/TagProjectCommand.ts b/clients/client-codestar/src/commands/TagProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/TagProjectCommand.ts rename to clients/client-codestar/src/commands/TagProjectCommand.ts diff --git a/clients/client-codestar/commands/UntagProjectCommand.ts b/clients/client-codestar/src/commands/UntagProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/UntagProjectCommand.ts rename to clients/client-codestar/src/commands/UntagProjectCommand.ts diff --git a/clients/client-codestar/commands/UpdateProjectCommand.ts b/clients/client-codestar/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-codestar/commands/UpdateProjectCommand.ts rename to clients/client-codestar/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-codestar/commands/UpdateTeamMemberCommand.ts b/clients/client-codestar/src/commands/UpdateTeamMemberCommand.ts similarity index 100% rename from clients/client-codestar/commands/UpdateTeamMemberCommand.ts rename to clients/client-codestar/src/commands/UpdateTeamMemberCommand.ts diff --git a/clients/client-codestar/commands/UpdateUserProfileCommand.ts b/clients/client-codestar/src/commands/UpdateUserProfileCommand.ts similarity index 100% rename from clients/client-codestar/commands/UpdateUserProfileCommand.ts rename to clients/client-codestar/src/commands/UpdateUserProfileCommand.ts diff --git a/clients/client-codestar/endpoints.ts b/clients/client-codestar/src/endpoints.ts similarity index 100% rename from clients/client-codestar/endpoints.ts rename to clients/client-codestar/src/endpoints.ts diff --git a/clients/client-codestar/index.ts b/clients/client-codestar/src/index.ts similarity index 100% rename from clients/client-codestar/index.ts rename to clients/client-codestar/src/index.ts diff --git a/clients/client-codestar/models/index.ts b/clients/client-codestar/src/models/index.ts similarity index 100% rename from clients/client-codestar/models/index.ts rename to clients/client-codestar/src/models/index.ts diff --git a/clients/client-codestar/models/models_0.ts b/clients/client-codestar/src/models/models_0.ts similarity index 100% rename from clients/client-codestar/models/models_0.ts rename to clients/client-codestar/src/models/models_0.ts diff --git a/clients/client-codestar/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-codestar/protocols/Aws_json1_1.ts rename to clients/client-codestar/src/protocols/Aws_json1_1.ts diff --git a/clients/client-codestar/src/runtimeConfig.browser.ts b/clients/client-codestar/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9aaf65079cf1 --- /dev/null +++ b/clients/client-codestar/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CodeStarClientConfig } from "./CodeStarClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeStarClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar/runtimeConfig.native.ts b/clients/client-codestar/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-codestar/runtimeConfig.native.ts rename to clients/client-codestar/src/runtimeConfig.native.ts diff --git a/clients/client-codestar/runtimeConfig.shared.ts b/clients/client-codestar/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-codestar/runtimeConfig.shared.ts rename to clients/client-codestar/src/runtimeConfig.shared.ts diff --git a/clients/client-codestar/src/runtimeConfig.ts b/clients/client-codestar/src/runtimeConfig.ts new file mode 100644 index 000000000000..fa8828ba5eb0 --- /dev/null +++ b/clients/client-codestar/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CodeStarClientConfig } from "./CodeStarClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CodeStarClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-codestar/tsconfig.es.json b/clients/client-codestar/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-codestar/tsconfig.es.json +++ b/clients/client-codestar/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-codestar/tsconfig.json b/clients/client-codestar/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-codestar/tsconfig.json +++ b/clients/client-codestar/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-codestar/tsconfig.types.json b/clients/client-codestar/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-codestar/tsconfig.types.json +++ b/clients/client-codestar/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cognito-identity-provider/.gitignore b/clients/client-cognito-identity-provider/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cognito-identity-provider/.gitignore +++ b/clients/client-cognito-identity-provider/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cognito-identity-provider/package.json b/clients/client-cognito-identity-provider/package.json index 5b8ead722b07..a11df7d2749f 100644 --- a/clients/client-cognito-identity-provider/package.json +++ b/clients/client-cognito-identity-provider/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity-provider", "repository": { "type": "git", diff --git a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts b/clients/client-cognito-identity-provider/runtimeConfig.browser.ts deleted file mode 100644 index 87bc1aadc529..000000000000 --- a/clients/client-cognito-identity-provider/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CognitoIdentityProviderClientConfig } from "./CognitoIdentityProviderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-identity-provider/runtimeConfig.ts b/clients/client-cognito-identity-provider/runtimeConfig.ts deleted file mode 100644 index 215236939151..000000000000 --- a/clients/client-cognito-identity-provider/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CognitoIdentityProviderClientConfig } from "./CognitoIdentityProviderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-identity-provider/CognitoIdentityProvider.ts b/clients/client-cognito-identity-provider/src/CognitoIdentityProvider.ts similarity index 100% rename from clients/client-cognito-identity-provider/CognitoIdentityProvider.ts rename to clients/client-cognito-identity-provider/src/CognitoIdentityProvider.ts diff --git a/clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts b/clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts similarity index 100% rename from clients/client-cognito-identity-provider/CognitoIdentityProviderClient.ts rename to clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts diff --git a/clients/client-cognito-identity-provider/commands/AddCustomAttributesCommand.ts b/clients/client-cognito-identity-provider/src/commands/AddCustomAttributesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AddCustomAttributesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AddCustomAttributesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminAddUserToGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminAddUserToGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminAddUserToGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminAddUserToGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminConfirmSignUpCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminConfirmSignUpCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminConfirmSignUpCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminConfirmSignUpCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminCreateUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminCreateUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminCreateUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminCreateUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminDeleteUserAttributesCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminDeleteUserAttributesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminDeleteUserAttributesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminDeleteUserAttributesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminDeleteUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminDeleteUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminDeleteUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminDeleteUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminDisableProviderForUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminDisableProviderForUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminDisableProviderForUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminDisableProviderForUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminDisableUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminDisableUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminDisableUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminDisableUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminEnableUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminEnableUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminEnableUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminEnableUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminForgetDeviceCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminForgetDeviceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminForgetDeviceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminForgetDeviceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminGetDeviceCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminGetDeviceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminGetDeviceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminGetDeviceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminGetUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminGetUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminGetUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminGetUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminInitiateAuthCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminInitiateAuthCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminInitiateAuthCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminInitiateAuthCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminLinkProviderForUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminLinkProviderForUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminLinkProviderForUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminLinkProviderForUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminListDevicesCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminListDevicesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminListDevicesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminListDevicesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminListGroupsForUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminListGroupsForUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminListGroupsForUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminListGroupsForUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminListUserAuthEventsCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminListUserAuthEventsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminListUserAuthEventsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminListUserAuthEventsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminRemoveUserFromGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminRemoveUserFromGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminRemoveUserFromGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminRemoveUserFromGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminResetUserPasswordCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminResetUserPasswordCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminResetUserPasswordCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminResetUserPasswordCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminRespondToAuthChallengeCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminRespondToAuthChallengeCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminRespondToAuthChallengeCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminRespondToAuthChallengeCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminSetUserMFAPreferenceCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminSetUserMFAPreferenceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminSetUserMFAPreferenceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminSetUserMFAPreferenceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminSetUserPasswordCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminSetUserPasswordCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminSetUserPasswordCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminSetUserPasswordCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminSetUserSettingsCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminSetUserSettingsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminSetUserSettingsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminSetUserSettingsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminUpdateAuthEventFeedbackCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminUpdateAuthEventFeedbackCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminUpdateAuthEventFeedbackCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminUpdateAuthEventFeedbackCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminUpdateDeviceStatusCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminUpdateDeviceStatusCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminUpdateDeviceStatusCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminUpdateDeviceStatusCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminUpdateUserAttributesCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminUpdateUserAttributesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminUpdateUserAttributesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminUpdateUserAttributesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AdminUserGlobalSignOutCommand.ts b/clients/client-cognito-identity-provider/src/commands/AdminUserGlobalSignOutCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AdminUserGlobalSignOutCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AdminUserGlobalSignOutCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/AssociateSoftwareTokenCommand.ts b/clients/client-cognito-identity-provider/src/commands/AssociateSoftwareTokenCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/AssociateSoftwareTokenCommand.ts rename to clients/client-cognito-identity-provider/src/commands/AssociateSoftwareTokenCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ChangePasswordCommand.ts b/clients/client-cognito-identity-provider/src/commands/ChangePasswordCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ChangePasswordCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ChangePasswordCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ConfirmDeviceCommand.ts b/clients/client-cognito-identity-provider/src/commands/ConfirmDeviceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ConfirmDeviceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ConfirmDeviceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ConfirmForgotPasswordCommand.ts b/clients/client-cognito-identity-provider/src/commands/ConfirmForgotPasswordCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ConfirmForgotPasswordCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ConfirmForgotPasswordCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ConfirmSignUpCommand.ts b/clients/client-cognito-identity-provider/src/commands/ConfirmSignUpCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ConfirmSignUpCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ConfirmSignUpCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateIdentityProviderCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateIdentityProviderCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateIdentityProviderCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateIdentityProviderCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateResourceServerCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateResourceServerCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateResourceServerCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateResourceServerCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateUserImportJobCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateUserImportJobCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateUserImportJobCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateUserImportJobCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateUserPoolClientCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateUserPoolClientCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateUserPoolClientCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateUserPoolClientCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateUserPoolCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateUserPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateUserPoolCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateUserPoolCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/CreateUserPoolDomainCommand.ts b/clients/client-cognito-identity-provider/src/commands/CreateUserPoolDomainCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/CreateUserPoolDomainCommand.ts rename to clients/client-cognito-identity-provider/src/commands/CreateUserPoolDomainCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteIdentityProviderCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteIdentityProviderCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteIdentityProviderCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteIdentityProviderCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteResourceServerCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteResourceServerCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteResourceServerCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteResourceServerCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteUserAttributesCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteUserAttributesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteUserAttributesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteUserAttributesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteUserPoolClientCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteUserPoolClientCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteUserPoolClientCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteUserPoolClientCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteUserPoolCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteUserPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteUserPoolCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteUserPoolCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DeleteUserPoolDomainCommand.ts b/clients/client-cognito-identity-provider/src/commands/DeleteUserPoolDomainCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DeleteUserPoolDomainCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DeleteUserPoolDomainCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeIdentityProviderCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeIdentityProviderCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeIdentityProviderCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeIdentityProviderCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeResourceServerCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeResourceServerCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeResourceServerCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeResourceServerCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeRiskConfigurationCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeRiskConfigurationCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeRiskConfigurationCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeRiskConfigurationCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeUserImportJobCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeUserImportJobCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeUserImportJobCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeUserImportJobCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeUserPoolClientCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeUserPoolClientCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeUserPoolClientCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeUserPoolClientCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeUserPoolCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeUserPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeUserPoolCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeUserPoolCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/DescribeUserPoolDomainCommand.ts b/clients/client-cognito-identity-provider/src/commands/DescribeUserPoolDomainCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/DescribeUserPoolDomainCommand.ts rename to clients/client-cognito-identity-provider/src/commands/DescribeUserPoolDomainCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ForgetDeviceCommand.ts b/clients/client-cognito-identity-provider/src/commands/ForgetDeviceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ForgetDeviceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ForgetDeviceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ForgotPasswordCommand.ts b/clients/client-cognito-identity-provider/src/commands/ForgotPasswordCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ForgotPasswordCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ForgotPasswordCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetCSVHeaderCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetCSVHeaderCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetCSVHeaderCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetCSVHeaderCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetDeviceCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetDeviceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetDeviceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetDeviceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetIdentityProviderByIdentifierCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetIdentityProviderByIdentifierCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetIdentityProviderByIdentifierCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetIdentityProviderByIdentifierCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetSigningCertificateCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetSigningCertificateCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetSigningCertificateCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetSigningCertificateCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetUICustomizationCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetUICustomizationCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetUICustomizationCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetUICustomizationCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetUserAttributeVerificationCodeCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetUserAttributeVerificationCodeCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetUserAttributeVerificationCodeCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetUserAttributeVerificationCodeCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetUserCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetUserCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetUserCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetUserCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GetUserPoolMfaConfigCommand.ts b/clients/client-cognito-identity-provider/src/commands/GetUserPoolMfaConfigCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GetUserPoolMfaConfigCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GetUserPoolMfaConfigCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/GlobalSignOutCommand.ts b/clients/client-cognito-identity-provider/src/commands/GlobalSignOutCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/GlobalSignOutCommand.ts rename to clients/client-cognito-identity-provider/src/commands/GlobalSignOutCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/InitiateAuthCommand.ts b/clients/client-cognito-identity-provider/src/commands/InitiateAuthCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/InitiateAuthCommand.ts rename to clients/client-cognito-identity-provider/src/commands/InitiateAuthCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListDevicesCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListDevicesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListDevicesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListGroupsCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListGroupsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListGroupsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListIdentityProvidersCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListIdentityProvidersCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListIdentityProvidersCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListIdentityProvidersCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListResourceServersCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListResourceServersCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListResourceServersCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListResourceServersCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListTagsForResourceCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListTagsForResourceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListUserImportJobsCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListUserImportJobsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListUserImportJobsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListUserImportJobsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListUserPoolClientsCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListUserPoolClientsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListUserPoolClientsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListUserPoolClientsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListUserPoolsCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListUserPoolsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListUserPoolsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListUserPoolsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListUsersCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListUsersCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListUsersCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ListUsersInGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/ListUsersInGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ListUsersInGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ListUsersInGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/ResendConfirmationCodeCommand.ts b/clients/client-cognito-identity-provider/src/commands/ResendConfirmationCodeCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/ResendConfirmationCodeCommand.ts rename to clients/client-cognito-identity-provider/src/commands/ResendConfirmationCodeCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/RespondToAuthChallengeCommand.ts b/clients/client-cognito-identity-provider/src/commands/RespondToAuthChallengeCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/RespondToAuthChallengeCommand.ts rename to clients/client-cognito-identity-provider/src/commands/RespondToAuthChallengeCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/RevokeTokenCommand.ts b/clients/client-cognito-identity-provider/src/commands/RevokeTokenCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/RevokeTokenCommand.ts rename to clients/client-cognito-identity-provider/src/commands/RevokeTokenCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SetRiskConfigurationCommand.ts b/clients/client-cognito-identity-provider/src/commands/SetRiskConfigurationCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SetRiskConfigurationCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SetRiskConfigurationCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SetUICustomizationCommand.ts b/clients/client-cognito-identity-provider/src/commands/SetUICustomizationCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SetUICustomizationCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SetUICustomizationCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SetUserMFAPreferenceCommand.ts b/clients/client-cognito-identity-provider/src/commands/SetUserMFAPreferenceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SetUserMFAPreferenceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SetUserMFAPreferenceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SetUserPoolMfaConfigCommand.ts b/clients/client-cognito-identity-provider/src/commands/SetUserPoolMfaConfigCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SetUserPoolMfaConfigCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SetUserPoolMfaConfigCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SetUserSettingsCommand.ts b/clients/client-cognito-identity-provider/src/commands/SetUserSettingsCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SetUserSettingsCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SetUserSettingsCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/SignUpCommand.ts b/clients/client-cognito-identity-provider/src/commands/SignUpCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/SignUpCommand.ts rename to clients/client-cognito-identity-provider/src/commands/SignUpCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/StartUserImportJobCommand.ts b/clients/client-cognito-identity-provider/src/commands/StartUserImportJobCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/StartUserImportJobCommand.ts rename to clients/client-cognito-identity-provider/src/commands/StartUserImportJobCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/StopUserImportJobCommand.ts b/clients/client-cognito-identity-provider/src/commands/StopUserImportJobCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/StopUserImportJobCommand.ts rename to clients/client-cognito-identity-provider/src/commands/StopUserImportJobCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/TagResourceCommand.ts b/clients/client-cognito-identity-provider/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/TagResourceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/TagResourceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UntagResourceCommand.ts b/clients/client-cognito-identity-provider/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UntagResourceCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateAuthEventFeedbackCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateAuthEventFeedbackCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateAuthEventFeedbackCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateAuthEventFeedbackCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateDeviceStatusCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateDeviceStatusCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateDeviceStatusCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateDeviceStatusCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateGroupCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateGroupCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateIdentityProviderCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateIdentityProviderCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateIdentityProviderCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateIdentityProviderCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateResourceServerCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateResourceServerCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateResourceServerCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateResourceServerCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateUserAttributesCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateUserAttributesCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateUserAttributesCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateUserAttributesCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateUserPoolClientCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateUserPoolClientCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateUserPoolClientCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateUserPoolClientCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateUserPoolCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateUserPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateUserPoolCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateUserPoolCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/UpdateUserPoolDomainCommand.ts b/clients/client-cognito-identity-provider/src/commands/UpdateUserPoolDomainCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/UpdateUserPoolDomainCommand.ts rename to clients/client-cognito-identity-provider/src/commands/UpdateUserPoolDomainCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/VerifySoftwareTokenCommand.ts b/clients/client-cognito-identity-provider/src/commands/VerifySoftwareTokenCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/VerifySoftwareTokenCommand.ts rename to clients/client-cognito-identity-provider/src/commands/VerifySoftwareTokenCommand.ts diff --git a/clients/client-cognito-identity-provider/commands/VerifyUserAttributeCommand.ts b/clients/client-cognito-identity-provider/src/commands/VerifyUserAttributeCommand.ts similarity index 100% rename from clients/client-cognito-identity-provider/commands/VerifyUserAttributeCommand.ts rename to clients/client-cognito-identity-provider/src/commands/VerifyUserAttributeCommand.ts diff --git a/clients/client-cognito-identity-provider/endpoints.ts b/clients/client-cognito-identity-provider/src/endpoints.ts similarity index 100% rename from clients/client-cognito-identity-provider/endpoints.ts rename to clients/client-cognito-identity-provider/src/endpoints.ts diff --git a/clients/client-cognito-identity-provider/index.ts b/clients/client-cognito-identity-provider/src/index.ts similarity index 100% rename from clients/client-cognito-identity-provider/index.ts rename to clients/client-cognito-identity-provider/src/index.ts diff --git a/clients/client-cognito-identity-provider/models/index.ts b/clients/client-cognito-identity-provider/src/models/index.ts similarity index 100% rename from clients/client-cognito-identity-provider/models/index.ts rename to clients/client-cognito-identity-provider/src/models/index.ts diff --git a/clients/client-cognito-identity-provider/models/models_0.ts b/clients/client-cognito-identity-provider/src/models/models_0.ts similarity index 100% rename from clients/client-cognito-identity-provider/models/models_0.ts rename to clients/client-cognito-identity-provider/src/models/models_0.ts diff --git a/clients/client-cognito-identity-provider/models/models_1.ts b/clients/client-cognito-identity-provider/src/models/models_1.ts similarity index 100% rename from clients/client-cognito-identity-provider/models/models_1.ts rename to clients/client-cognito-identity-provider/src/models/models_1.ts diff --git a/clients/client-cognito-identity-provider/pagination/AdminListGroupsForUserPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/AdminListGroupsForUserPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/AdminListGroupsForUserPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/AdminListGroupsForUserPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/AdminListUserAuthEventsPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/AdminListUserAuthEventsPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/AdminListUserAuthEventsPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/AdminListUserAuthEventsPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/Interfaces.ts b/clients/client-cognito-identity-provider/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/Interfaces.ts rename to clients/client-cognito-identity-provider/src/pagination/Interfaces.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListGroupsPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListGroupsPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListGroupsPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListGroupsPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListIdentityProvidersPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListIdentityProvidersPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListIdentityProvidersPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListIdentityProvidersPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListResourceServersPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListResourceServersPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListResourceServersPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListResourceServersPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListUserPoolClientsPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListUserPoolClientsPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListUserPoolClientsPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListUserPoolClientsPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListUserPoolsPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListUserPoolsPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListUserPoolsPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListUserPoolsPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListUsersInGroupPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListUsersInGroupPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListUsersInGroupPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListUsersInGroupPaginator.ts diff --git a/clients/client-cognito-identity-provider/pagination/ListUsersPaginator.ts b/clients/client-cognito-identity-provider/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-cognito-identity-provider/pagination/ListUsersPaginator.ts rename to clients/client-cognito-identity-provider/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts rename to clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cognito-identity-provider/src/runtimeConfig.browser.ts b/clients/client-cognito-identity-provider/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..668a9ad1587f --- /dev/null +++ b/clients/client-cognito-identity-provider/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CognitoIdentityProviderClientConfig } from "./CognitoIdentityProviderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-identity-provider/runtimeConfig.native.ts b/clients/client-cognito-identity-provider/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cognito-identity-provider/runtimeConfig.native.ts rename to clients/client-cognito-identity-provider/src/runtimeConfig.native.ts diff --git a/clients/client-cognito-identity-provider/runtimeConfig.shared.ts b/clients/client-cognito-identity-provider/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cognito-identity-provider/runtimeConfig.shared.ts rename to clients/client-cognito-identity-provider/src/runtimeConfig.shared.ts diff --git a/clients/client-cognito-identity-provider/src/runtimeConfig.ts b/clients/client-cognito-identity-provider/src/runtimeConfig.ts new file mode 100644 index 000000000000..ea323a5550b3 --- /dev/null +++ b/clients/client-cognito-identity-provider/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CognitoIdentityProviderClientConfig } from "./CognitoIdentityProviderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-identity-provider/tsconfig.es.json b/clients/client-cognito-identity-provider/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cognito-identity-provider/tsconfig.es.json +++ b/clients/client-cognito-identity-provider/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cognito-identity-provider/tsconfig.json b/clients/client-cognito-identity-provider/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cognito-identity-provider/tsconfig.json +++ b/clients/client-cognito-identity-provider/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cognito-identity-provider/tsconfig.types.json b/clients/client-cognito-identity-provider/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cognito-identity-provider/tsconfig.types.json +++ b/clients/client-cognito-identity-provider/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cognito-identity/.gitignore b/clients/client-cognito-identity/.gitignore index 09915454c880..bbc99354973f 100644 --- a/clients/client-cognito-identity/.gitignore +++ b/clients/client-cognito-identity/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cognito-identity/karma.conf.js b/clients/client-cognito-identity/karma.conf.js index 4592c6e7a9a2..6698ee33a1e9 100644 --- a/clients/client-cognito-identity/karma.conf.js +++ b/clients/client-cognito-identity/karma.conf.js @@ -1,10 +1,12 @@ +const webpack = require("webpack"); + module.exports = function (config) { config.set({ basePath: "", frameworks: ["mocha", "chai"], - files: ["e2e/**/*.ispec.ts"], + files: ["test/e2e/**/*.ispec.ts"], preprocessors: { - "e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], + "test/e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], }, webpackMiddleware: { stats: "minimal", @@ -33,6 +35,7 @@ module.exports = function (config) { }, ], }, + plugins: [new webpack.NormalModuleReplacementPlugin(/\.\/runtimeConfig$/, "./runtimeConfig.browser")], devtool: "inline-source-map", }, envPreprocessor: ["AWS_SMOKE_TEST_REGION", "AWS_SMOKE_TEST_IDENTITY_POOL_ID"], diff --git a/clients/client-cognito-identity/package.json b/clients/client-cognito-identity/package.json index c1258ff1e83d..22430e32d8f7 100644 --- a/clients/client-cognito-identity/package.json +++ b/clients/client-cognito-identity/package.json @@ -11,20 +11,13 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", - "test": "yarn test:unit", - "test:e2e": "mocha **/cjs/**/*.ispec.js && karma start karma.conf.js", - "test:unit": "mocha **/cjs/**/*.spec.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", + "test": "exit 0", + "test:e2e": "ts-mocha test/**/*.ispec.ts && karma start karma.conf.js" }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -77,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -87,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity", "repository": { "type": "git", diff --git a/clients/client-cognito-identity/runtimeConfig.browser.ts b/clients/client-cognito-identity/runtimeConfig.browser.ts deleted file mode 100644 index 35d078421ff4..000000000000 --- a/clients/client-cognito-identity/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-identity/runtimeConfig.ts b/clients/client-cognito-identity/runtimeConfig.ts deleted file mode 100644 index d425b2fc8db4..000000000000 --- a/clients/client-cognito-identity/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-identity/CognitoIdentity.ts b/clients/client-cognito-identity/src/CognitoIdentity.ts similarity index 100% rename from clients/client-cognito-identity/CognitoIdentity.ts rename to clients/client-cognito-identity/src/CognitoIdentity.ts diff --git a/clients/client-cognito-identity/CognitoIdentityClient.ts b/clients/client-cognito-identity/src/CognitoIdentityClient.ts similarity index 100% rename from clients/client-cognito-identity/CognitoIdentityClient.ts rename to clients/client-cognito-identity/src/CognitoIdentityClient.ts diff --git a/clients/client-cognito-identity/commands/CreateIdentityPoolCommand.ts b/clients/client-cognito-identity/src/commands/CreateIdentityPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/CreateIdentityPoolCommand.ts rename to clients/client-cognito-identity/src/commands/CreateIdentityPoolCommand.ts diff --git a/clients/client-cognito-identity/commands/DeleteIdentitiesCommand.ts b/clients/client-cognito-identity/src/commands/DeleteIdentitiesCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/DeleteIdentitiesCommand.ts rename to clients/client-cognito-identity/src/commands/DeleteIdentitiesCommand.ts diff --git a/clients/client-cognito-identity/commands/DeleteIdentityPoolCommand.ts b/clients/client-cognito-identity/src/commands/DeleteIdentityPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/DeleteIdentityPoolCommand.ts rename to clients/client-cognito-identity/src/commands/DeleteIdentityPoolCommand.ts diff --git a/clients/client-cognito-identity/commands/DescribeIdentityCommand.ts b/clients/client-cognito-identity/src/commands/DescribeIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/DescribeIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/DescribeIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/DescribeIdentityPoolCommand.ts b/clients/client-cognito-identity/src/commands/DescribeIdentityPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/DescribeIdentityPoolCommand.ts rename to clients/client-cognito-identity/src/commands/DescribeIdentityPoolCommand.ts diff --git a/clients/client-cognito-identity/commands/GetCredentialsForIdentityCommand.ts b/clients/client-cognito-identity/src/commands/GetCredentialsForIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetCredentialsForIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/GetCredentialsForIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/GetIdCommand.ts b/clients/client-cognito-identity/src/commands/GetIdCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetIdCommand.ts rename to clients/client-cognito-identity/src/commands/GetIdCommand.ts diff --git a/clients/client-cognito-identity/commands/GetIdentityPoolRolesCommand.ts b/clients/client-cognito-identity/src/commands/GetIdentityPoolRolesCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetIdentityPoolRolesCommand.ts rename to clients/client-cognito-identity/src/commands/GetIdentityPoolRolesCommand.ts diff --git a/clients/client-cognito-identity/commands/GetOpenIdTokenCommand.ts b/clients/client-cognito-identity/src/commands/GetOpenIdTokenCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetOpenIdTokenCommand.ts rename to clients/client-cognito-identity/src/commands/GetOpenIdTokenCommand.ts diff --git a/clients/client-cognito-identity/commands/GetOpenIdTokenForDeveloperIdentityCommand.ts b/clients/client-cognito-identity/src/commands/GetOpenIdTokenForDeveloperIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetOpenIdTokenForDeveloperIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/GetOpenIdTokenForDeveloperIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/GetPrincipalTagAttributeMapCommand.ts b/clients/client-cognito-identity/src/commands/GetPrincipalTagAttributeMapCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/GetPrincipalTagAttributeMapCommand.ts rename to clients/client-cognito-identity/src/commands/GetPrincipalTagAttributeMapCommand.ts diff --git a/clients/client-cognito-identity/commands/ListIdentitiesCommand.ts b/clients/client-cognito-identity/src/commands/ListIdentitiesCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/ListIdentitiesCommand.ts rename to clients/client-cognito-identity/src/commands/ListIdentitiesCommand.ts diff --git a/clients/client-cognito-identity/commands/ListIdentityPoolsCommand.ts b/clients/client-cognito-identity/src/commands/ListIdentityPoolsCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/ListIdentityPoolsCommand.ts rename to clients/client-cognito-identity/src/commands/ListIdentityPoolsCommand.ts diff --git a/clients/client-cognito-identity/commands/ListTagsForResourceCommand.ts b/clients/client-cognito-identity/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/ListTagsForResourceCommand.ts rename to clients/client-cognito-identity/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-cognito-identity/commands/LookupDeveloperIdentityCommand.ts b/clients/client-cognito-identity/src/commands/LookupDeveloperIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/LookupDeveloperIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/LookupDeveloperIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/MergeDeveloperIdentitiesCommand.ts b/clients/client-cognito-identity/src/commands/MergeDeveloperIdentitiesCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/MergeDeveloperIdentitiesCommand.ts rename to clients/client-cognito-identity/src/commands/MergeDeveloperIdentitiesCommand.ts diff --git a/clients/client-cognito-identity/commands/SetIdentityPoolRolesCommand.ts b/clients/client-cognito-identity/src/commands/SetIdentityPoolRolesCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/SetIdentityPoolRolesCommand.ts rename to clients/client-cognito-identity/src/commands/SetIdentityPoolRolesCommand.ts diff --git a/clients/client-cognito-identity/commands/SetPrincipalTagAttributeMapCommand.ts b/clients/client-cognito-identity/src/commands/SetPrincipalTagAttributeMapCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/SetPrincipalTagAttributeMapCommand.ts rename to clients/client-cognito-identity/src/commands/SetPrincipalTagAttributeMapCommand.ts diff --git a/clients/client-cognito-identity/commands/TagResourceCommand.ts b/clients/client-cognito-identity/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/TagResourceCommand.ts rename to clients/client-cognito-identity/src/commands/TagResourceCommand.ts diff --git a/clients/client-cognito-identity/commands/UnlinkDeveloperIdentityCommand.ts b/clients/client-cognito-identity/src/commands/UnlinkDeveloperIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/UnlinkDeveloperIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/UnlinkDeveloperIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/UnlinkIdentityCommand.ts b/clients/client-cognito-identity/src/commands/UnlinkIdentityCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/UnlinkIdentityCommand.ts rename to clients/client-cognito-identity/src/commands/UnlinkIdentityCommand.ts diff --git a/clients/client-cognito-identity/commands/UntagResourceCommand.ts b/clients/client-cognito-identity/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/UntagResourceCommand.ts rename to clients/client-cognito-identity/src/commands/UntagResourceCommand.ts diff --git a/clients/client-cognito-identity/commands/UpdateIdentityPoolCommand.ts b/clients/client-cognito-identity/src/commands/UpdateIdentityPoolCommand.ts similarity index 100% rename from clients/client-cognito-identity/commands/UpdateIdentityPoolCommand.ts rename to clients/client-cognito-identity/src/commands/UpdateIdentityPoolCommand.ts diff --git a/clients/client-cognito-identity/endpoints.ts b/clients/client-cognito-identity/src/endpoints.ts similarity index 100% rename from clients/client-cognito-identity/endpoints.ts rename to clients/client-cognito-identity/src/endpoints.ts diff --git a/clients/client-cognito-identity/index.ts b/clients/client-cognito-identity/src/index.ts similarity index 100% rename from clients/client-cognito-identity/index.ts rename to clients/client-cognito-identity/src/index.ts diff --git a/clients/client-cognito-identity/models/index.ts b/clients/client-cognito-identity/src/models/index.ts similarity index 100% rename from clients/client-cognito-identity/models/index.ts rename to clients/client-cognito-identity/src/models/index.ts diff --git a/clients/client-cognito-identity/models/models_0.ts b/clients/client-cognito-identity/src/models/models_0.ts similarity index 100% rename from clients/client-cognito-identity/models/models_0.ts rename to clients/client-cognito-identity/src/models/models_0.ts diff --git a/clients/client-cognito-identity/pagination/Interfaces.ts b/clients/client-cognito-identity/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cognito-identity/pagination/Interfaces.ts rename to clients/client-cognito-identity/src/pagination/Interfaces.ts diff --git a/clients/client-cognito-identity/pagination/ListIdentityPoolsPaginator.ts b/clients/client-cognito-identity/src/pagination/ListIdentityPoolsPaginator.ts similarity index 100% rename from clients/client-cognito-identity/pagination/ListIdentityPoolsPaginator.ts rename to clients/client-cognito-identity/src/pagination/ListIdentityPoolsPaginator.ts diff --git a/clients/client-cognito-identity/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cognito-identity/protocols/Aws_json1_1.ts rename to clients/client-cognito-identity/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cognito-identity/src/runtimeConfig.browser.ts b/clients/client-cognito-identity/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..48c751862ff2 --- /dev/null +++ b/clients/client-cognito-identity/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-identity/runtimeConfig.native.ts b/clients/client-cognito-identity/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cognito-identity/runtimeConfig.native.ts rename to clients/client-cognito-identity/src/runtimeConfig.native.ts diff --git a/clients/client-cognito-identity/runtimeConfig.shared.ts b/clients/client-cognito-identity/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cognito-identity/runtimeConfig.shared.ts rename to clients/client-cognito-identity/src/runtimeConfig.shared.ts diff --git a/clients/client-cognito-identity/src/runtimeConfig.ts b/clients/client-cognito-identity/src/runtimeConfig.ts new file mode 100644 index 000000000000..a5fe187e7350 --- /dev/null +++ b/clients/client-cognito-identity/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CognitoIdentityClientConfig } from "./CognitoIdentityClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-identity/e2e/CognitoIdentity.ispec.ts b/clients/client-cognito-identity/test/e2e/CognitoIdentity.ispec.ts similarity index 100% rename from clients/client-cognito-identity/e2e/CognitoIdentity.ispec.ts rename to clients/client-cognito-identity/test/e2e/CognitoIdentity.ispec.ts diff --git a/clients/client-cognito-identity/e2e/README.md b/clients/client-cognito-identity/test/e2e/README.md similarity index 100% rename from clients/client-cognito-identity/e2e/README.md rename to clients/client-cognito-identity/test/e2e/README.md diff --git a/clients/client-cognito-identity/tsconfig.es.json b/clients/client-cognito-identity/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cognito-identity/tsconfig.es.json +++ b/clients/client-cognito-identity/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cognito-identity/tsconfig.json b/clients/client-cognito-identity/tsconfig.json index 846d726e4644..cbb7e0dec925 100644 --- a/clients/client-cognito-identity/tsconfig.json +++ b/clients/client-cognito-identity/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true, "types": ["mocha", "node"] }, @@ -28,5 +29,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cognito-identity/tsconfig.types.json b/clients/client-cognito-identity/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cognito-identity/tsconfig.types.json +++ b/clients/client-cognito-identity/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cognito-sync/.gitignore b/clients/client-cognito-sync/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cognito-sync/.gitignore +++ b/clients/client-cognito-sync/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cognito-sync/package.json b/clients/client-cognito-sync/package.json index 9f55493ba2ec..dabfafde9a18 100644 --- a/clients/client-cognito-sync/package.json +++ b/clients/client-cognito-sync/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-sync", "repository": { "type": "git", diff --git a/clients/client-cognito-sync/runtimeConfig.browser.ts b/clients/client-cognito-sync/runtimeConfig.browser.ts deleted file mode 100644 index 666e8dd1fbea..000000000000 --- a/clients/client-cognito-sync/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CognitoSyncClientConfig } from "./CognitoSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-sync/runtimeConfig.ts b/clients/client-cognito-sync/runtimeConfig.ts deleted file mode 100644 index d3eda10b2518..000000000000 --- a/clients/client-cognito-sync/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CognitoSyncClientConfig } from "./CognitoSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cognito-sync/CognitoSync.ts b/clients/client-cognito-sync/src/CognitoSync.ts similarity index 100% rename from clients/client-cognito-sync/CognitoSync.ts rename to clients/client-cognito-sync/src/CognitoSync.ts diff --git a/clients/client-cognito-sync/CognitoSyncClient.ts b/clients/client-cognito-sync/src/CognitoSyncClient.ts similarity index 100% rename from clients/client-cognito-sync/CognitoSyncClient.ts rename to clients/client-cognito-sync/src/CognitoSyncClient.ts diff --git a/clients/client-cognito-sync/commands/BulkPublishCommand.ts b/clients/client-cognito-sync/src/commands/BulkPublishCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/BulkPublishCommand.ts rename to clients/client-cognito-sync/src/commands/BulkPublishCommand.ts diff --git a/clients/client-cognito-sync/commands/DeleteDatasetCommand.ts b/clients/client-cognito-sync/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/DeleteDatasetCommand.ts rename to clients/client-cognito-sync/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-cognito-sync/commands/DescribeDatasetCommand.ts b/clients/client-cognito-sync/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/DescribeDatasetCommand.ts rename to clients/client-cognito-sync/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-cognito-sync/commands/DescribeIdentityPoolUsageCommand.ts b/clients/client-cognito-sync/src/commands/DescribeIdentityPoolUsageCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/DescribeIdentityPoolUsageCommand.ts rename to clients/client-cognito-sync/src/commands/DescribeIdentityPoolUsageCommand.ts diff --git a/clients/client-cognito-sync/commands/DescribeIdentityUsageCommand.ts b/clients/client-cognito-sync/src/commands/DescribeIdentityUsageCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/DescribeIdentityUsageCommand.ts rename to clients/client-cognito-sync/src/commands/DescribeIdentityUsageCommand.ts diff --git a/clients/client-cognito-sync/commands/GetBulkPublishDetailsCommand.ts b/clients/client-cognito-sync/src/commands/GetBulkPublishDetailsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/GetBulkPublishDetailsCommand.ts rename to clients/client-cognito-sync/src/commands/GetBulkPublishDetailsCommand.ts diff --git a/clients/client-cognito-sync/commands/GetCognitoEventsCommand.ts b/clients/client-cognito-sync/src/commands/GetCognitoEventsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/GetCognitoEventsCommand.ts rename to clients/client-cognito-sync/src/commands/GetCognitoEventsCommand.ts diff --git a/clients/client-cognito-sync/commands/GetIdentityPoolConfigurationCommand.ts b/clients/client-cognito-sync/src/commands/GetIdentityPoolConfigurationCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/GetIdentityPoolConfigurationCommand.ts rename to clients/client-cognito-sync/src/commands/GetIdentityPoolConfigurationCommand.ts diff --git a/clients/client-cognito-sync/commands/ListDatasetsCommand.ts b/clients/client-cognito-sync/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/ListDatasetsCommand.ts rename to clients/client-cognito-sync/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-cognito-sync/commands/ListIdentityPoolUsageCommand.ts b/clients/client-cognito-sync/src/commands/ListIdentityPoolUsageCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/ListIdentityPoolUsageCommand.ts rename to clients/client-cognito-sync/src/commands/ListIdentityPoolUsageCommand.ts diff --git a/clients/client-cognito-sync/commands/ListRecordsCommand.ts b/clients/client-cognito-sync/src/commands/ListRecordsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/ListRecordsCommand.ts rename to clients/client-cognito-sync/src/commands/ListRecordsCommand.ts diff --git a/clients/client-cognito-sync/commands/RegisterDeviceCommand.ts b/clients/client-cognito-sync/src/commands/RegisterDeviceCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/RegisterDeviceCommand.ts rename to clients/client-cognito-sync/src/commands/RegisterDeviceCommand.ts diff --git a/clients/client-cognito-sync/commands/SetCognitoEventsCommand.ts b/clients/client-cognito-sync/src/commands/SetCognitoEventsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/SetCognitoEventsCommand.ts rename to clients/client-cognito-sync/src/commands/SetCognitoEventsCommand.ts diff --git a/clients/client-cognito-sync/commands/SetIdentityPoolConfigurationCommand.ts b/clients/client-cognito-sync/src/commands/SetIdentityPoolConfigurationCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/SetIdentityPoolConfigurationCommand.ts rename to clients/client-cognito-sync/src/commands/SetIdentityPoolConfigurationCommand.ts diff --git a/clients/client-cognito-sync/commands/SubscribeToDatasetCommand.ts b/clients/client-cognito-sync/src/commands/SubscribeToDatasetCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/SubscribeToDatasetCommand.ts rename to clients/client-cognito-sync/src/commands/SubscribeToDatasetCommand.ts diff --git a/clients/client-cognito-sync/commands/UnsubscribeFromDatasetCommand.ts b/clients/client-cognito-sync/src/commands/UnsubscribeFromDatasetCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/UnsubscribeFromDatasetCommand.ts rename to clients/client-cognito-sync/src/commands/UnsubscribeFromDatasetCommand.ts diff --git a/clients/client-cognito-sync/commands/UpdateRecordsCommand.ts b/clients/client-cognito-sync/src/commands/UpdateRecordsCommand.ts similarity index 100% rename from clients/client-cognito-sync/commands/UpdateRecordsCommand.ts rename to clients/client-cognito-sync/src/commands/UpdateRecordsCommand.ts diff --git a/clients/client-cognito-sync/endpoints.ts b/clients/client-cognito-sync/src/endpoints.ts similarity index 100% rename from clients/client-cognito-sync/endpoints.ts rename to clients/client-cognito-sync/src/endpoints.ts diff --git a/clients/client-cognito-sync/index.ts b/clients/client-cognito-sync/src/index.ts similarity index 100% rename from clients/client-cognito-sync/index.ts rename to clients/client-cognito-sync/src/index.ts diff --git a/clients/client-cognito-sync/models/index.ts b/clients/client-cognito-sync/src/models/index.ts similarity index 100% rename from clients/client-cognito-sync/models/index.ts rename to clients/client-cognito-sync/src/models/index.ts diff --git a/clients/client-cognito-sync/models/models_0.ts b/clients/client-cognito-sync/src/models/models_0.ts similarity index 100% rename from clients/client-cognito-sync/models/models_0.ts rename to clients/client-cognito-sync/src/models/models_0.ts diff --git a/clients/client-cognito-sync/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-cognito-sync/protocols/Aws_restJson1.ts rename to clients/client-cognito-sync/src/protocols/Aws_restJson1.ts diff --git a/clients/client-cognito-sync/src/runtimeConfig.browser.ts b/clients/client-cognito-sync/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a955b71f8944 --- /dev/null +++ b/clients/client-cognito-sync/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CognitoSyncClientConfig } from "./CognitoSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-sync/runtimeConfig.native.ts b/clients/client-cognito-sync/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cognito-sync/runtimeConfig.native.ts rename to clients/client-cognito-sync/src/runtimeConfig.native.ts diff --git a/clients/client-cognito-sync/runtimeConfig.shared.ts b/clients/client-cognito-sync/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cognito-sync/runtimeConfig.shared.ts rename to clients/client-cognito-sync/src/runtimeConfig.shared.ts diff --git a/clients/client-cognito-sync/src/runtimeConfig.ts b/clients/client-cognito-sync/src/runtimeConfig.ts new file mode 100644 index 000000000000..e60876a4b471 --- /dev/null +++ b/clients/client-cognito-sync/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CognitoSyncClientConfig } from "./CognitoSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cognito-sync/tsconfig.es.json b/clients/client-cognito-sync/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cognito-sync/tsconfig.es.json +++ b/clients/client-cognito-sync/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cognito-sync/tsconfig.json b/clients/client-cognito-sync/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cognito-sync/tsconfig.json +++ b/clients/client-cognito-sync/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cognito-sync/tsconfig.types.json b/clients/client-cognito-sync/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cognito-sync/tsconfig.types.json +++ b/clients/client-cognito-sync/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-comprehend/.gitignore b/clients/client-comprehend/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-comprehend/.gitignore +++ b/clients/client-comprehend/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-comprehend/package.json b/clients/client-comprehend/package.json index 08c00e3ad9da..7249b0f92b20 100644 --- a/clients/client-comprehend/package.json +++ b/clients/client-comprehend/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-comprehend", "repository": { "type": "git", diff --git a/clients/client-comprehend/runtimeConfig.browser.ts b/clients/client-comprehend/runtimeConfig.browser.ts deleted file mode 100644 index 29ef410e1bec..000000000000 --- a/clients/client-comprehend/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ComprehendClientConfig } from "./ComprehendClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComprehendClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-comprehend/runtimeConfig.ts b/clients/client-comprehend/runtimeConfig.ts deleted file mode 100644 index 0d615437015c..000000000000 --- a/clients/client-comprehend/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ComprehendClientConfig } from "./ComprehendClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComprehendClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-comprehend/Comprehend.ts b/clients/client-comprehend/src/Comprehend.ts similarity index 100% rename from clients/client-comprehend/Comprehend.ts rename to clients/client-comprehend/src/Comprehend.ts diff --git a/clients/client-comprehend/ComprehendClient.ts b/clients/client-comprehend/src/ComprehendClient.ts similarity index 100% rename from clients/client-comprehend/ComprehendClient.ts rename to clients/client-comprehend/src/ComprehendClient.ts diff --git a/clients/client-comprehend/commands/BatchDetectDominantLanguageCommand.ts b/clients/client-comprehend/src/commands/BatchDetectDominantLanguageCommand.ts similarity index 100% rename from clients/client-comprehend/commands/BatchDetectDominantLanguageCommand.ts rename to clients/client-comprehend/src/commands/BatchDetectDominantLanguageCommand.ts diff --git a/clients/client-comprehend/commands/BatchDetectEntitiesCommand.ts b/clients/client-comprehend/src/commands/BatchDetectEntitiesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/BatchDetectEntitiesCommand.ts rename to clients/client-comprehend/src/commands/BatchDetectEntitiesCommand.ts diff --git a/clients/client-comprehend/commands/BatchDetectKeyPhrasesCommand.ts b/clients/client-comprehend/src/commands/BatchDetectKeyPhrasesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/BatchDetectKeyPhrasesCommand.ts rename to clients/client-comprehend/src/commands/BatchDetectKeyPhrasesCommand.ts diff --git a/clients/client-comprehend/commands/BatchDetectSentimentCommand.ts b/clients/client-comprehend/src/commands/BatchDetectSentimentCommand.ts similarity index 100% rename from clients/client-comprehend/commands/BatchDetectSentimentCommand.ts rename to clients/client-comprehend/src/commands/BatchDetectSentimentCommand.ts diff --git a/clients/client-comprehend/commands/BatchDetectSyntaxCommand.ts b/clients/client-comprehend/src/commands/BatchDetectSyntaxCommand.ts similarity index 100% rename from clients/client-comprehend/commands/BatchDetectSyntaxCommand.ts rename to clients/client-comprehend/src/commands/BatchDetectSyntaxCommand.ts diff --git a/clients/client-comprehend/commands/ClassifyDocumentCommand.ts b/clients/client-comprehend/src/commands/ClassifyDocumentCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ClassifyDocumentCommand.ts rename to clients/client-comprehend/src/commands/ClassifyDocumentCommand.ts diff --git a/clients/client-comprehend/commands/ContainsPiiEntitiesCommand.ts b/clients/client-comprehend/src/commands/ContainsPiiEntitiesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ContainsPiiEntitiesCommand.ts rename to clients/client-comprehend/src/commands/ContainsPiiEntitiesCommand.ts diff --git a/clients/client-comprehend/commands/CreateDocumentClassifierCommand.ts b/clients/client-comprehend/src/commands/CreateDocumentClassifierCommand.ts similarity index 100% rename from clients/client-comprehend/commands/CreateDocumentClassifierCommand.ts rename to clients/client-comprehend/src/commands/CreateDocumentClassifierCommand.ts diff --git a/clients/client-comprehend/commands/CreateEndpointCommand.ts b/clients/client-comprehend/src/commands/CreateEndpointCommand.ts similarity index 100% rename from clients/client-comprehend/commands/CreateEndpointCommand.ts rename to clients/client-comprehend/src/commands/CreateEndpointCommand.ts diff --git a/clients/client-comprehend/commands/CreateEntityRecognizerCommand.ts b/clients/client-comprehend/src/commands/CreateEntityRecognizerCommand.ts similarity index 100% rename from clients/client-comprehend/commands/CreateEntityRecognizerCommand.ts rename to clients/client-comprehend/src/commands/CreateEntityRecognizerCommand.ts diff --git a/clients/client-comprehend/commands/DeleteDocumentClassifierCommand.ts b/clients/client-comprehend/src/commands/DeleteDocumentClassifierCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DeleteDocumentClassifierCommand.ts rename to clients/client-comprehend/src/commands/DeleteDocumentClassifierCommand.ts diff --git a/clients/client-comprehend/commands/DeleteEndpointCommand.ts b/clients/client-comprehend/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DeleteEndpointCommand.ts rename to clients/client-comprehend/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-comprehend/commands/DeleteEntityRecognizerCommand.ts b/clients/client-comprehend/src/commands/DeleteEntityRecognizerCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DeleteEntityRecognizerCommand.ts rename to clients/client-comprehend/src/commands/DeleteEntityRecognizerCommand.ts diff --git a/clients/client-comprehend/commands/DescribeDocumentClassificationJobCommand.ts b/clients/client-comprehend/src/commands/DescribeDocumentClassificationJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeDocumentClassificationJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeDocumentClassificationJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeDocumentClassifierCommand.ts b/clients/client-comprehend/src/commands/DescribeDocumentClassifierCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeDocumentClassifierCommand.ts rename to clients/client-comprehend/src/commands/DescribeDocumentClassifierCommand.ts diff --git a/clients/client-comprehend/commands/DescribeDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeDominantLanguageDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeDominantLanguageDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeDominantLanguageDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeEndpointCommand.ts b/clients/client-comprehend/src/commands/DescribeEndpointCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeEndpointCommand.ts rename to clients/client-comprehend/src/commands/DescribeEndpointCommand.ts diff --git a/clients/client-comprehend/commands/DescribeEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeEntityRecognizerCommand.ts b/clients/client-comprehend/src/commands/DescribeEntityRecognizerCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeEntityRecognizerCommand.ts rename to clients/client-comprehend/src/commands/DescribeEntityRecognizerCommand.ts diff --git a/clients/client-comprehend/commands/DescribeEventsDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeEventsDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeEventsDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeEventsDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeKeyPhrasesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeKeyPhrasesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeKeyPhrasesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribePiiEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribePiiEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribePiiEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribePiiEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeSentimentDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeSentimentDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeSentimentDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeSentimentDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DescribeTopicsDetectionJobCommand.ts b/clients/client-comprehend/src/commands/DescribeTopicsDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DescribeTopicsDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/DescribeTopicsDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/DetectDominantLanguageCommand.ts b/clients/client-comprehend/src/commands/DetectDominantLanguageCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectDominantLanguageCommand.ts rename to clients/client-comprehend/src/commands/DetectDominantLanguageCommand.ts diff --git a/clients/client-comprehend/commands/DetectEntitiesCommand.ts b/clients/client-comprehend/src/commands/DetectEntitiesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectEntitiesCommand.ts rename to clients/client-comprehend/src/commands/DetectEntitiesCommand.ts diff --git a/clients/client-comprehend/commands/DetectKeyPhrasesCommand.ts b/clients/client-comprehend/src/commands/DetectKeyPhrasesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectKeyPhrasesCommand.ts rename to clients/client-comprehend/src/commands/DetectKeyPhrasesCommand.ts diff --git a/clients/client-comprehend/commands/DetectPiiEntitiesCommand.ts b/clients/client-comprehend/src/commands/DetectPiiEntitiesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectPiiEntitiesCommand.ts rename to clients/client-comprehend/src/commands/DetectPiiEntitiesCommand.ts diff --git a/clients/client-comprehend/commands/DetectSentimentCommand.ts b/clients/client-comprehend/src/commands/DetectSentimentCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectSentimentCommand.ts rename to clients/client-comprehend/src/commands/DetectSentimentCommand.ts diff --git a/clients/client-comprehend/commands/DetectSyntaxCommand.ts b/clients/client-comprehend/src/commands/DetectSyntaxCommand.ts similarity index 100% rename from clients/client-comprehend/commands/DetectSyntaxCommand.ts rename to clients/client-comprehend/src/commands/DetectSyntaxCommand.ts diff --git a/clients/client-comprehend/commands/ListDocumentClassificationJobsCommand.ts b/clients/client-comprehend/src/commands/ListDocumentClassificationJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListDocumentClassificationJobsCommand.ts rename to clients/client-comprehend/src/commands/ListDocumentClassificationJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListDocumentClassifierSummariesCommand.ts b/clients/client-comprehend/src/commands/ListDocumentClassifierSummariesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListDocumentClassifierSummariesCommand.ts rename to clients/client-comprehend/src/commands/ListDocumentClassifierSummariesCommand.ts diff --git a/clients/client-comprehend/commands/ListDocumentClassifiersCommand.ts b/clients/client-comprehend/src/commands/ListDocumentClassifiersCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListDocumentClassifiersCommand.ts rename to clients/client-comprehend/src/commands/ListDocumentClassifiersCommand.ts diff --git a/clients/client-comprehend/commands/ListDominantLanguageDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListDominantLanguageDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListDominantLanguageDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListDominantLanguageDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListEndpointsCommand.ts b/clients/client-comprehend/src/commands/ListEndpointsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListEndpointsCommand.ts rename to clients/client-comprehend/src/commands/ListEndpointsCommand.ts diff --git a/clients/client-comprehend/commands/ListEntitiesDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListEntitiesDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListEntitiesDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListEntitiesDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListEntityRecognizerSummariesCommand.ts b/clients/client-comprehend/src/commands/ListEntityRecognizerSummariesCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListEntityRecognizerSummariesCommand.ts rename to clients/client-comprehend/src/commands/ListEntityRecognizerSummariesCommand.ts diff --git a/clients/client-comprehend/commands/ListEntityRecognizersCommand.ts b/clients/client-comprehend/src/commands/ListEntityRecognizersCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListEntityRecognizersCommand.ts rename to clients/client-comprehend/src/commands/ListEntityRecognizersCommand.ts diff --git a/clients/client-comprehend/commands/ListEventsDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListEventsDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListEventsDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListEventsDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListKeyPhrasesDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListKeyPhrasesDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListKeyPhrasesDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListKeyPhrasesDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListPiiEntitiesDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListPiiEntitiesDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListPiiEntitiesDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListPiiEntitiesDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListSentimentDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListSentimentDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListSentimentDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListSentimentDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/ListTagsForResourceCommand.ts b/clients/client-comprehend/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListTagsForResourceCommand.ts rename to clients/client-comprehend/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-comprehend/commands/ListTopicsDetectionJobsCommand.ts b/clients/client-comprehend/src/commands/ListTopicsDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehend/commands/ListTopicsDetectionJobsCommand.ts rename to clients/client-comprehend/src/commands/ListTopicsDetectionJobsCommand.ts diff --git a/clients/client-comprehend/commands/StartDocumentClassificationJobCommand.ts b/clients/client-comprehend/src/commands/StartDocumentClassificationJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartDocumentClassificationJobCommand.ts rename to clients/client-comprehend/src/commands/StartDocumentClassificationJobCommand.ts diff --git a/clients/client-comprehend/commands/StartDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartDominantLanguageDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartDominantLanguageDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartDominantLanguageDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartEventsDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartEventsDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartEventsDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartEventsDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartKeyPhrasesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartKeyPhrasesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartKeyPhrasesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartPiiEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartPiiEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartPiiEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartPiiEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartSentimentDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartSentimentDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartSentimentDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartSentimentDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StartTopicsDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StartTopicsDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StartTopicsDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StartTopicsDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopDominantLanguageDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopDominantLanguageDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopDominantLanguageDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopEventsDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopEventsDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopEventsDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopEventsDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopKeyPhrasesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopKeyPhrasesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopKeyPhrasesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopPiiEntitiesDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopPiiEntitiesDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopPiiEntitiesDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopPiiEntitiesDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopSentimentDetectionJobCommand.ts b/clients/client-comprehend/src/commands/StopSentimentDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopSentimentDetectionJobCommand.ts rename to clients/client-comprehend/src/commands/StopSentimentDetectionJobCommand.ts diff --git a/clients/client-comprehend/commands/StopTrainingDocumentClassifierCommand.ts b/clients/client-comprehend/src/commands/StopTrainingDocumentClassifierCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopTrainingDocumentClassifierCommand.ts rename to clients/client-comprehend/src/commands/StopTrainingDocumentClassifierCommand.ts diff --git a/clients/client-comprehend/commands/StopTrainingEntityRecognizerCommand.ts b/clients/client-comprehend/src/commands/StopTrainingEntityRecognizerCommand.ts similarity index 100% rename from clients/client-comprehend/commands/StopTrainingEntityRecognizerCommand.ts rename to clients/client-comprehend/src/commands/StopTrainingEntityRecognizerCommand.ts diff --git a/clients/client-comprehend/commands/TagResourceCommand.ts b/clients/client-comprehend/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-comprehend/commands/TagResourceCommand.ts rename to clients/client-comprehend/src/commands/TagResourceCommand.ts diff --git a/clients/client-comprehend/commands/UntagResourceCommand.ts b/clients/client-comprehend/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-comprehend/commands/UntagResourceCommand.ts rename to clients/client-comprehend/src/commands/UntagResourceCommand.ts diff --git a/clients/client-comprehend/commands/UpdateEndpointCommand.ts b/clients/client-comprehend/src/commands/UpdateEndpointCommand.ts similarity index 100% rename from clients/client-comprehend/commands/UpdateEndpointCommand.ts rename to clients/client-comprehend/src/commands/UpdateEndpointCommand.ts diff --git a/clients/client-comprehend/endpoints.ts b/clients/client-comprehend/src/endpoints.ts similarity index 100% rename from clients/client-comprehend/endpoints.ts rename to clients/client-comprehend/src/endpoints.ts diff --git a/clients/client-comprehend/index.ts b/clients/client-comprehend/src/index.ts similarity index 100% rename from clients/client-comprehend/index.ts rename to clients/client-comprehend/src/index.ts diff --git a/clients/client-comprehend/models/index.ts b/clients/client-comprehend/src/models/index.ts similarity index 100% rename from clients/client-comprehend/models/index.ts rename to clients/client-comprehend/src/models/index.ts diff --git a/clients/client-comprehend/models/models_0.ts b/clients/client-comprehend/src/models/models_0.ts similarity index 100% rename from clients/client-comprehend/models/models_0.ts rename to clients/client-comprehend/src/models/models_0.ts diff --git a/clients/client-comprehend/pagination/Interfaces.ts b/clients/client-comprehend/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-comprehend/pagination/Interfaces.ts rename to clients/client-comprehend/src/pagination/Interfaces.ts diff --git a/clients/client-comprehend/pagination/ListDocumentClassificationJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListDocumentClassificationJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListDocumentClassificationJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListDocumentClassificationJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListDocumentClassifierSummariesPaginator.ts b/clients/client-comprehend/src/pagination/ListDocumentClassifierSummariesPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListDocumentClassifierSummariesPaginator.ts rename to clients/client-comprehend/src/pagination/ListDocumentClassifierSummariesPaginator.ts diff --git a/clients/client-comprehend/pagination/ListDocumentClassifiersPaginator.ts b/clients/client-comprehend/src/pagination/ListDocumentClassifiersPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListDocumentClassifiersPaginator.ts rename to clients/client-comprehend/src/pagination/ListDocumentClassifiersPaginator.ts diff --git a/clients/client-comprehend/pagination/ListDominantLanguageDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListDominantLanguageDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListDominantLanguageDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListDominantLanguageDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListEntitiesDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListEntitiesDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListEntitiesDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListEntitiesDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListEntityRecognizerSummariesPaginator.ts b/clients/client-comprehend/src/pagination/ListEntityRecognizerSummariesPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListEntityRecognizerSummariesPaginator.ts rename to clients/client-comprehend/src/pagination/ListEntityRecognizerSummariesPaginator.ts diff --git a/clients/client-comprehend/pagination/ListEntityRecognizersPaginator.ts b/clients/client-comprehend/src/pagination/ListEntityRecognizersPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListEntityRecognizersPaginator.ts rename to clients/client-comprehend/src/pagination/ListEntityRecognizersPaginator.ts diff --git a/clients/client-comprehend/pagination/ListEventsDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListEventsDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListEventsDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListEventsDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListKeyPhrasesDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListKeyPhrasesDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListKeyPhrasesDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListKeyPhrasesDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListSentimentDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListSentimentDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListSentimentDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListSentimentDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/pagination/ListTopicsDetectionJobsPaginator.ts b/clients/client-comprehend/src/pagination/ListTopicsDetectionJobsPaginator.ts similarity index 100% rename from clients/client-comprehend/pagination/ListTopicsDetectionJobsPaginator.ts rename to clients/client-comprehend/src/pagination/ListTopicsDetectionJobsPaginator.ts diff --git a/clients/client-comprehend/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-comprehend/protocols/Aws_json1_1.ts rename to clients/client-comprehend/src/protocols/Aws_json1_1.ts diff --git a/clients/client-comprehend/src/runtimeConfig.browser.ts b/clients/client-comprehend/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7334a805aa91 --- /dev/null +++ b/clients/client-comprehend/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ComprehendClientConfig } from "./ComprehendClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComprehendClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-comprehend/runtimeConfig.native.ts b/clients/client-comprehend/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-comprehend/runtimeConfig.native.ts rename to clients/client-comprehend/src/runtimeConfig.native.ts diff --git a/clients/client-comprehend/runtimeConfig.shared.ts b/clients/client-comprehend/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-comprehend/runtimeConfig.shared.ts rename to clients/client-comprehend/src/runtimeConfig.shared.ts diff --git a/clients/client-comprehend/src/runtimeConfig.ts b/clients/client-comprehend/src/runtimeConfig.ts new file mode 100644 index 000000000000..65e27a1bf00d --- /dev/null +++ b/clients/client-comprehend/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ComprehendClientConfig } from "./ComprehendClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComprehendClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-comprehend/tsconfig.es.json b/clients/client-comprehend/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-comprehend/tsconfig.es.json +++ b/clients/client-comprehend/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-comprehend/tsconfig.json b/clients/client-comprehend/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-comprehend/tsconfig.json +++ b/clients/client-comprehend/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-comprehend/tsconfig.types.json b/clients/client-comprehend/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-comprehend/tsconfig.types.json +++ b/clients/client-comprehend/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-comprehendmedical/.gitignore b/clients/client-comprehendmedical/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-comprehendmedical/.gitignore +++ b/clients/client-comprehendmedical/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-comprehendmedical/package.json b/clients/client-comprehendmedical/package.json index 637dfcc14789..971f973482e0 100644 --- a/clients/client-comprehendmedical/package.json +++ b/clients/client-comprehendmedical/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-comprehendmedical", "repository": { "type": "git", diff --git a/clients/client-comprehendmedical/runtimeConfig.browser.ts b/clients/client-comprehendmedical/runtimeConfig.browser.ts deleted file mode 100644 index cb56513a61a7..000000000000 --- a/clients/client-comprehendmedical/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ComprehendMedicalClientConfig } from "./ComprehendMedicalClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-comprehendmedical/runtimeConfig.ts b/clients/client-comprehendmedical/runtimeConfig.ts deleted file mode 100644 index b2543c224da9..000000000000 --- a/clients/client-comprehendmedical/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ComprehendMedicalClientConfig } from "./ComprehendMedicalClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-comprehendmedical/ComprehendMedical.ts b/clients/client-comprehendmedical/src/ComprehendMedical.ts similarity index 100% rename from clients/client-comprehendmedical/ComprehendMedical.ts rename to clients/client-comprehendmedical/src/ComprehendMedical.ts diff --git a/clients/client-comprehendmedical/ComprehendMedicalClient.ts b/clients/client-comprehendmedical/src/ComprehendMedicalClient.ts similarity index 100% rename from clients/client-comprehendmedical/ComprehendMedicalClient.ts rename to clients/client-comprehendmedical/src/ComprehendMedicalClient.ts diff --git a/clients/client-comprehendmedical/commands/DescribeEntitiesDetectionV2JobCommand.ts b/clients/client-comprehendmedical/src/commands/DescribeEntitiesDetectionV2JobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DescribeEntitiesDetectionV2JobCommand.ts rename to clients/client-comprehendmedical/src/commands/DescribeEntitiesDetectionV2JobCommand.ts diff --git a/clients/client-comprehendmedical/commands/DescribeICD10CMInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/DescribeICD10CMInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DescribeICD10CMInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/DescribeICD10CMInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/DescribePHIDetectionJobCommand.ts b/clients/client-comprehendmedical/src/commands/DescribePHIDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DescribePHIDetectionJobCommand.ts rename to clients/client-comprehendmedical/src/commands/DescribePHIDetectionJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/DescribeRxNormInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/DescribeRxNormInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DescribeRxNormInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/DescribeRxNormInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/DetectEntitiesCommand.ts b/clients/client-comprehendmedical/src/commands/DetectEntitiesCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DetectEntitiesCommand.ts rename to clients/client-comprehendmedical/src/commands/DetectEntitiesCommand.ts diff --git a/clients/client-comprehendmedical/commands/DetectEntitiesV2Command.ts b/clients/client-comprehendmedical/src/commands/DetectEntitiesV2Command.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DetectEntitiesV2Command.ts rename to clients/client-comprehendmedical/src/commands/DetectEntitiesV2Command.ts diff --git a/clients/client-comprehendmedical/commands/DetectPHICommand.ts b/clients/client-comprehendmedical/src/commands/DetectPHICommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/DetectPHICommand.ts rename to clients/client-comprehendmedical/src/commands/DetectPHICommand.ts diff --git a/clients/client-comprehendmedical/commands/InferICD10CMCommand.ts b/clients/client-comprehendmedical/src/commands/InferICD10CMCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/InferICD10CMCommand.ts rename to clients/client-comprehendmedical/src/commands/InferICD10CMCommand.ts diff --git a/clients/client-comprehendmedical/commands/InferRxNormCommand.ts b/clients/client-comprehendmedical/src/commands/InferRxNormCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/InferRxNormCommand.ts rename to clients/client-comprehendmedical/src/commands/InferRxNormCommand.ts diff --git a/clients/client-comprehendmedical/commands/ListEntitiesDetectionV2JobsCommand.ts b/clients/client-comprehendmedical/src/commands/ListEntitiesDetectionV2JobsCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/ListEntitiesDetectionV2JobsCommand.ts rename to clients/client-comprehendmedical/src/commands/ListEntitiesDetectionV2JobsCommand.ts diff --git a/clients/client-comprehendmedical/commands/ListICD10CMInferenceJobsCommand.ts b/clients/client-comprehendmedical/src/commands/ListICD10CMInferenceJobsCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/ListICD10CMInferenceJobsCommand.ts rename to clients/client-comprehendmedical/src/commands/ListICD10CMInferenceJobsCommand.ts diff --git a/clients/client-comprehendmedical/commands/ListPHIDetectionJobsCommand.ts b/clients/client-comprehendmedical/src/commands/ListPHIDetectionJobsCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/ListPHIDetectionJobsCommand.ts rename to clients/client-comprehendmedical/src/commands/ListPHIDetectionJobsCommand.ts diff --git a/clients/client-comprehendmedical/commands/ListRxNormInferenceJobsCommand.ts b/clients/client-comprehendmedical/src/commands/ListRxNormInferenceJobsCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/ListRxNormInferenceJobsCommand.ts rename to clients/client-comprehendmedical/src/commands/ListRxNormInferenceJobsCommand.ts diff --git a/clients/client-comprehendmedical/commands/StartEntitiesDetectionV2JobCommand.ts b/clients/client-comprehendmedical/src/commands/StartEntitiesDetectionV2JobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StartEntitiesDetectionV2JobCommand.ts rename to clients/client-comprehendmedical/src/commands/StartEntitiesDetectionV2JobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StartICD10CMInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/StartICD10CMInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StartICD10CMInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StartICD10CMInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StartPHIDetectionJobCommand.ts b/clients/client-comprehendmedical/src/commands/StartPHIDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StartPHIDetectionJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StartPHIDetectionJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StartRxNormInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/StartRxNormInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StartRxNormInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StartRxNormInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StopEntitiesDetectionV2JobCommand.ts b/clients/client-comprehendmedical/src/commands/StopEntitiesDetectionV2JobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StopEntitiesDetectionV2JobCommand.ts rename to clients/client-comprehendmedical/src/commands/StopEntitiesDetectionV2JobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StopICD10CMInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/StopICD10CMInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StopICD10CMInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StopICD10CMInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StopPHIDetectionJobCommand.ts b/clients/client-comprehendmedical/src/commands/StopPHIDetectionJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StopPHIDetectionJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StopPHIDetectionJobCommand.ts diff --git a/clients/client-comprehendmedical/commands/StopRxNormInferenceJobCommand.ts b/clients/client-comprehendmedical/src/commands/StopRxNormInferenceJobCommand.ts similarity index 100% rename from clients/client-comprehendmedical/commands/StopRxNormInferenceJobCommand.ts rename to clients/client-comprehendmedical/src/commands/StopRxNormInferenceJobCommand.ts diff --git a/clients/client-comprehendmedical/endpoints.ts b/clients/client-comprehendmedical/src/endpoints.ts similarity index 100% rename from clients/client-comprehendmedical/endpoints.ts rename to clients/client-comprehendmedical/src/endpoints.ts diff --git a/clients/client-comprehendmedical/index.ts b/clients/client-comprehendmedical/src/index.ts similarity index 100% rename from clients/client-comprehendmedical/index.ts rename to clients/client-comprehendmedical/src/index.ts diff --git a/clients/client-comprehendmedical/models/index.ts b/clients/client-comprehendmedical/src/models/index.ts similarity index 100% rename from clients/client-comprehendmedical/models/index.ts rename to clients/client-comprehendmedical/src/models/index.ts diff --git a/clients/client-comprehendmedical/models/models_0.ts b/clients/client-comprehendmedical/src/models/models_0.ts similarity index 100% rename from clients/client-comprehendmedical/models/models_0.ts rename to clients/client-comprehendmedical/src/models/models_0.ts diff --git a/clients/client-comprehendmedical/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-comprehendmedical/protocols/Aws_json1_1.ts rename to clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts diff --git a/clients/client-comprehendmedical/src/runtimeConfig.browser.ts b/clients/client-comprehendmedical/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..848217831275 --- /dev/null +++ b/clients/client-comprehendmedical/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ComprehendMedicalClientConfig } from "./ComprehendMedicalClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-comprehendmedical/runtimeConfig.native.ts b/clients/client-comprehendmedical/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-comprehendmedical/runtimeConfig.native.ts rename to clients/client-comprehendmedical/src/runtimeConfig.native.ts diff --git a/clients/client-comprehendmedical/runtimeConfig.shared.ts b/clients/client-comprehendmedical/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-comprehendmedical/runtimeConfig.shared.ts rename to clients/client-comprehendmedical/src/runtimeConfig.shared.ts diff --git a/clients/client-comprehendmedical/src/runtimeConfig.ts b/clients/client-comprehendmedical/src/runtimeConfig.ts new file mode 100644 index 000000000000..0c1b5776967a --- /dev/null +++ b/clients/client-comprehendmedical/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ComprehendMedicalClientConfig } from "./ComprehendMedicalClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-comprehendmedical/tsconfig.es.json b/clients/client-comprehendmedical/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-comprehendmedical/tsconfig.es.json +++ b/clients/client-comprehendmedical/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-comprehendmedical/tsconfig.json b/clients/client-comprehendmedical/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-comprehendmedical/tsconfig.json +++ b/clients/client-comprehendmedical/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-comprehendmedical/tsconfig.types.json b/clients/client-comprehendmedical/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-comprehendmedical/tsconfig.types.json +++ b/clients/client-comprehendmedical/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-compute-optimizer/.gitignore b/clients/client-compute-optimizer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-compute-optimizer/.gitignore +++ b/clients/client-compute-optimizer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-compute-optimizer/package.json b/clients/client-compute-optimizer/package.json index 09c63081cb7e..43e416c97303 100644 --- a/clients/client-compute-optimizer/package.json +++ b/clients/client-compute-optimizer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-compute-optimizer", "repository": { "type": "git", diff --git a/clients/client-compute-optimizer/runtimeConfig.browser.ts b/clients/client-compute-optimizer/runtimeConfig.browser.ts deleted file mode 100644 index 60278413dafa..000000000000 --- a/clients/client-compute-optimizer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ComputeOptimizerClientConfig } from "./ComputeOptimizerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-compute-optimizer/runtimeConfig.ts b/clients/client-compute-optimizer/runtimeConfig.ts deleted file mode 100644 index 0a659396f96e..000000000000 --- a/clients/client-compute-optimizer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ComputeOptimizerClientConfig } from "./ComputeOptimizerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-compute-optimizer/ComputeOptimizer.ts b/clients/client-compute-optimizer/src/ComputeOptimizer.ts similarity index 100% rename from clients/client-compute-optimizer/ComputeOptimizer.ts rename to clients/client-compute-optimizer/src/ComputeOptimizer.ts diff --git a/clients/client-compute-optimizer/ComputeOptimizerClient.ts b/clients/client-compute-optimizer/src/ComputeOptimizerClient.ts similarity index 100% rename from clients/client-compute-optimizer/ComputeOptimizerClient.ts rename to clients/client-compute-optimizer/src/ComputeOptimizerClient.ts diff --git a/clients/client-compute-optimizer/commands/DescribeRecommendationExportJobsCommand.ts b/clients/client-compute-optimizer/src/commands/DescribeRecommendationExportJobsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/DescribeRecommendationExportJobsCommand.ts rename to clients/client-compute-optimizer/src/commands/DescribeRecommendationExportJobsCommand.ts diff --git a/clients/client-compute-optimizer/commands/ExportAutoScalingGroupRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/ExportAutoScalingGroupRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/ExportAutoScalingGroupRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/ExportAutoScalingGroupRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/ExportEBSVolumeRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/ExportEBSVolumeRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/ExportEBSVolumeRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/ExportEBSVolumeRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/ExportEC2InstanceRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/ExportEC2InstanceRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/ExportEC2InstanceRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/ExportEC2InstanceRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/ExportLambdaFunctionRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/ExportLambdaFunctionRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/ExportLambdaFunctionRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/ExportLambdaFunctionRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetAutoScalingGroupRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/GetAutoScalingGroupRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetAutoScalingGroupRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/GetAutoScalingGroupRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetEBSVolumeRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/GetEBSVolumeRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetEBSVolumeRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/GetEBSVolumeRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetEC2InstanceRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/GetEC2InstanceRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetEC2InstanceRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/GetEC2InstanceRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetEC2RecommendationProjectedMetricsCommand.ts b/clients/client-compute-optimizer/src/commands/GetEC2RecommendationProjectedMetricsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetEC2RecommendationProjectedMetricsCommand.ts rename to clients/client-compute-optimizer/src/commands/GetEC2RecommendationProjectedMetricsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetEnrollmentStatusCommand.ts b/clients/client-compute-optimizer/src/commands/GetEnrollmentStatusCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetEnrollmentStatusCommand.ts rename to clients/client-compute-optimizer/src/commands/GetEnrollmentStatusCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetEnrollmentStatusesForOrganizationCommand.ts b/clients/client-compute-optimizer/src/commands/GetEnrollmentStatusesForOrganizationCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetEnrollmentStatusesForOrganizationCommand.ts rename to clients/client-compute-optimizer/src/commands/GetEnrollmentStatusesForOrganizationCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetLambdaFunctionRecommendationsCommand.ts b/clients/client-compute-optimizer/src/commands/GetLambdaFunctionRecommendationsCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetLambdaFunctionRecommendationsCommand.ts rename to clients/client-compute-optimizer/src/commands/GetLambdaFunctionRecommendationsCommand.ts diff --git a/clients/client-compute-optimizer/commands/GetRecommendationSummariesCommand.ts b/clients/client-compute-optimizer/src/commands/GetRecommendationSummariesCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/GetRecommendationSummariesCommand.ts rename to clients/client-compute-optimizer/src/commands/GetRecommendationSummariesCommand.ts diff --git a/clients/client-compute-optimizer/commands/UpdateEnrollmentStatusCommand.ts b/clients/client-compute-optimizer/src/commands/UpdateEnrollmentStatusCommand.ts similarity index 100% rename from clients/client-compute-optimizer/commands/UpdateEnrollmentStatusCommand.ts rename to clients/client-compute-optimizer/src/commands/UpdateEnrollmentStatusCommand.ts diff --git a/clients/client-compute-optimizer/endpoints.ts b/clients/client-compute-optimizer/src/endpoints.ts similarity index 100% rename from clients/client-compute-optimizer/endpoints.ts rename to clients/client-compute-optimizer/src/endpoints.ts diff --git a/clients/client-compute-optimizer/index.ts b/clients/client-compute-optimizer/src/index.ts similarity index 100% rename from clients/client-compute-optimizer/index.ts rename to clients/client-compute-optimizer/src/index.ts diff --git a/clients/client-compute-optimizer/models/index.ts b/clients/client-compute-optimizer/src/models/index.ts similarity index 100% rename from clients/client-compute-optimizer/models/index.ts rename to clients/client-compute-optimizer/src/models/index.ts diff --git a/clients/client-compute-optimizer/models/models_0.ts b/clients/client-compute-optimizer/src/models/models_0.ts similarity index 100% rename from clients/client-compute-optimizer/models/models_0.ts rename to clients/client-compute-optimizer/src/models/models_0.ts diff --git a/clients/client-compute-optimizer/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-compute-optimizer/protocols/Aws_json1_0.ts rename to clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts diff --git a/clients/client-compute-optimizer/src/runtimeConfig.browser.ts b/clients/client-compute-optimizer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c364cea91052 --- /dev/null +++ b/clients/client-compute-optimizer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ComputeOptimizerClientConfig } from "./ComputeOptimizerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-compute-optimizer/runtimeConfig.native.ts b/clients/client-compute-optimizer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-compute-optimizer/runtimeConfig.native.ts rename to clients/client-compute-optimizer/src/runtimeConfig.native.ts diff --git a/clients/client-compute-optimizer/runtimeConfig.shared.ts b/clients/client-compute-optimizer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-compute-optimizer/runtimeConfig.shared.ts rename to clients/client-compute-optimizer/src/runtimeConfig.shared.ts diff --git a/clients/client-compute-optimizer/src/runtimeConfig.ts b/clients/client-compute-optimizer/src/runtimeConfig.ts new file mode 100644 index 000000000000..a5cbf191cc94 --- /dev/null +++ b/clients/client-compute-optimizer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ComputeOptimizerClientConfig } from "./ComputeOptimizerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-compute-optimizer/tsconfig.es.json b/clients/client-compute-optimizer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-compute-optimizer/tsconfig.es.json +++ b/clients/client-compute-optimizer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-compute-optimizer/tsconfig.json b/clients/client-compute-optimizer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-compute-optimizer/tsconfig.json +++ b/clients/client-compute-optimizer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-compute-optimizer/tsconfig.types.json b/clients/client-compute-optimizer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-compute-optimizer/tsconfig.types.json +++ b/clients/client-compute-optimizer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-config-service/.gitignore b/clients/client-config-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-config-service/.gitignore +++ b/clients/client-config-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-config-service/package.json b/clients/client-config-service/package.json index c43cd8a255e6..72b893869f1d 100644 --- a/clients/client-config-service/package.json +++ b/clients/client-config-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-config-service", "repository": { "type": "git", diff --git a/clients/client-config-service/runtimeConfig.browser.ts b/clients/client-config-service/runtimeConfig.browser.ts deleted file mode 100644 index 3aeb7824a759..000000000000 --- a/clients/client-config-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ConfigServiceClientConfig } from "./ConfigServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-config-service/runtimeConfig.ts b/clients/client-config-service/runtimeConfig.ts deleted file mode 100644 index c7418d2bbbfc..000000000000 --- a/clients/client-config-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ConfigServiceClientConfig } from "./ConfigServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-config-service/ConfigService.ts b/clients/client-config-service/src/ConfigService.ts similarity index 100% rename from clients/client-config-service/ConfigService.ts rename to clients/client-config-service/src/ConfigService.ts diff --git a/clients/client-config-service/ConfigServiceClient.ts b/clients/client-config-service/src/ConfigServiceClient.ts similarity index 100% rename from clients/client-config-service/ConfigServiceClient.ts rename to clients/client-config-service/src/ConfigServiceClient.ts diff --git a/clients/client-config-service/commands/BatchGetAggregateResourceConfigCommand.ts b/clients/client-config-service/src/commands/BatchGetAggregateResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/BatchGetAggregateResourceConfigCommand.ts rename to clients/client-config-service/src/commands/BatchGetAggregateResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/BatchGetResourceConfigCommand.ts b/clients/client-config-service/src/commands/BatchGetResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/BatchGetResourceConfigCommand.ts rename to clients/client-config-service/src/commands/BatchGetResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/DeleteAggregationAuthorizationCommand.ts b/clients/client-config-service/src/commands/DeleteAggregationAuthorizationCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteAggregationAuthorizationCommand.ts rename to clients/client-config-service/src/commands/DeleteAggregationAuthorizationCommand.ts diff --git a/clients/client-config-service/commands/DeleteConfigRuleCommand.ts b/clients/client-config-service/src/commands/DeleteConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteConfigRuleCommand.ts rename to clients/client-config-service/src/commands/DeleteConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/DeleteConfigurationAggregatorCommand.ts b/clients/client-config-service/src/commands/DeleteConfigurationAggregatorCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteConfigurationAggregatorCommand.ts rename to clients/client-config-service/src/commands/DeleteConfigurationAggregatorCommand.ts diff --git a/clients/client-config-service/commands/DeleteConfigurationRecorderCommand.ts b/clients/client-config-service/src/commands/DeleteConfigurationRecorderCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteConfigurationRecorderCommand.ts rename to clients/client-config-service/src/commands/DeleteConfigurationRecorderCommand.ts diff --git a/clients/client-config-service/commands/DeleteConformancePackCommand.ts b/clients/client-config-service/src/commands/DeleteConformancePackCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteConformancePackCommand.ts rename to clients/client-config-service/src/commands/DeleteConformancePackCommand.ts diff --git a/clients/client-config-service/commands/DeleteDeliveryChannelCommand.ts b/clients/client-config-service/src/commands/DeleteDeliveryChannelCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteDeliveryChannelCommand.ts rename to clients/client-config-service/src/commands/DeleteDeliveryChannelCommand.ts diff --git a/clients/client-config-service/commands/DeleteEvaluationResultsCommand.ts b/clients/client-config-service/src/commands/DeleteEvaluationResultsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteEvaluationResultsCommand.ts rename to clients/client-config-service/src/commands/DeleteEvaluationResultsCommand.ts diff --git a/clients/client-config-service/commands/DeleteOrganizationConfigRuleCommand.ts b/clients/client-config-service/src/commands/DeleteOrganizationConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteOrganizationConfigRuleCommand.ts rename to clients/client-config-service/src/commands/DeleteOrganizationConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/DeleteOrganizationConformancePackCommand.ts b/clients/client-config-service/src/commands/DeleteOrganizationConformancePackCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteOrganizationConformancePackCommand.ts rename to clients/client-config-service/src/commands/DeleteOrganizationConformancePackCommand.ts diff --git a/clients/client-config-service/commands/DeletePendingAggregationRequestCommand.ts b/clients/client-config-service/src/commands/DeletePendingAggregationRequestCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeletePendingAggregationRequestCommand.ts rename to clients/client-config-service/src/commands/DeletePendingAggregationRequestCommand.ts diff --git a/clients/client-config-service/commands/DeleteRemediationConfigurationCommand.ts b/clients/client-config-service/src/commands/DeleteRemediationConfigurationCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteRemediationConfigurationCommand.ts rename to clients/client-config-service/src/commands/DeleteRemediationConfigurationCommand.ts diff --git a/clients/client-config-service/commands/DeleteRemediationExceptionsCommand.ts b/clients/client-config-service/src/commands/DeleteRemediationExceptionsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteRemediationExceptionsCommand.ts rename to clients/client-config-service/src/commands/DeleteRemediationExceptionsCommand.ts diff --git a/clients/client-config-service/commands/DeleteResourceConfigCommand.ts b/clients/client-config-service/src/commands/DeleteResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteResourceConfigCommand.ts rename to clients/client-config-service/src/commands/DeleteResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/DeleteRetentionConfigurationCommand.ts b/clients/client-config-service/src/commands/DeleteRetentionConfigurationCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteRetentionConfigurationCommand.ts rename to clients/client-config-service/src/commands/DeleteRetentionConfigurationCommand.ts diff --git a/clients/client-config-service/commands/DeleteStoredQueryCommand.ts b/clients/client-config-service/src/commands/DeleteStoredQueryCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeleteStoredQueryCommand.ts rename to clients/client-config-service/src/commands/DeleteStoredQueryCommand.ts diff --git a/clients/client-config-service/commands/DeliverConfigSnapshotCommand.ts b/clients/client-config-service/src/commands/DeliverConfigSnapshotCommand.ts similarity index 100% rename from clients/client-config-service/commands/DeliverConfigSnapshotCommand.ts rename to clients/client-config-service/src/commands/DeliverConfigSnapshotCommand.ts diff --git a/clients/client-config-service/commands/DescribeAggregateComplianceByConfigRulesCommand.ts b/clients/client-config-service/src/commands/DescribeAggregateComplianceByConfigRulesCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeAggregateComplianceByConfigRulesCommand.ts rename to clients/client-config-service/src/commands/DescribeAggregateComplianceByConfigRulesCommand.ts diff --git a/clients/client-config-service/commands/DescribeAggregateComplianceByConformancePacksCommand.ts b/clients/client-config-service/src/commands/DescribeAggregateComplianceByConformancePacksCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeAggregateComplianceByConformancePacksCommand.ts rename to clients/client-config-service/src/commands/DescribeAggregateComplianceByConformancePacksCommand.ts diff --git a/clients/client-config-service/commands/DescribeAggregationAuthorizationsCommand.ts b/clients/client-config-service/src/commands/DescribeAggregationAuthorizationsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeAggregationAuthorizationsCommand.ts rename to clients/client-config-service/src/commands/DescribeAggregationAuthorizationsCommand.ts diff --git a/clients/client-config-service/commands/DescribeComplianceByConfigRuleCommand.ts b/clients/client-config-service/src/commands/DescribeComplianceByConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeComplianceByConfigRuleCommand.ts rename to clients/client-config-service/src/commands/DescribeComplianceByConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/DescribeComplianceByResourceCommand.ts b/clients/client-config-service/src/commands/DescribeComplianceByResourceCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeComplianceByResourceCommand.ts rename to clients/client-config-service/src/commands/DescribeComplianceByResourceCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigRuleEvaluationStatusCommand.ts b/clients/client-config-service/src/commands/DescribeConfigRuleEvaluationStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigRuleEvaluationStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigRuleEvaluationStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigRulesCommand.ts b/clients/client-config-service/src/commands/DescribeConfigRulesCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigRulesCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigRulesCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigurationAggregatorSourcesStatusCommand.ts b/clients/client-config-service/src/commands/DescribeConfigurationAggregatorSourcesStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigurationAggregatorSourcesStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigurationAggregatorSourcesStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigurationAggregatorsCommand.ts b/clients/client-config-service/src/commands/DescribeConfigurationAggregatorsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigurationAggregatorsCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigurationAggregatorsCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigurationRecorderStatusCommand.ts b/clients/client-config-service/src/commands/DescribeConfigurationRecorderStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigurationRecorderStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigurationRecorderStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeConfigurationRecordersCommand.ts b/clients/client-config-service/src/commands/DescribeConfigurationRecordersCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConfigurationRecordersCommand.ts rename to clients/client-config-service/src/commands/DescribeConfigurationRecordersCommand.ts diff --git a/clients/client-config-service/commands/DescribeConformancePackComplianceCommand.ts b/clients/client-config-service/src/commands/DescribeConformancePackComplianceCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConformancePackComplianceCommand.ts rename to clients/client-config-service/src/commands/DescribeConformancePackComplianceCommand.ts diff --git a/clients/client-config-service/commands/DescribeConformancePackStatusCommand.ts b/clients/client-config-service/src/commands/DescribeConformancePackStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConformancePackStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeConformancePackStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeConformancePacksCommand.ts b/clients/client-config-service/src/commands/DescribeConformancePacksCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeConformancePacksCommand.ts rename to clients/client-config-service/src/commands/DescribeConformancePacksCommand.ts diff --git a/clients/client-config-service/commands/DescribeDeliveryChannelStatusCommand.ts b/clients/client-config-service/src/commands/DescribeDeliveryChannelStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeDeliveryChannelStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeDeliveryChannelStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeDeliveryChannelsCommand.ts b/clients/client-config-service/src/commands/DescribeDeliveryChannelsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeDeliveryChannelsCommand.ts rename to clients/client-config-service/src/commands/DescribeDeliveryChannelsCommand.ts diff --git a/clients/client-config-service/commands/DescribeOrganizationConfigRuleStatusesCommand.ts b/clients/client-config-service/src/commands/DescribeOrganizationConfigRuleStatusesCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeOrganizationConfigRuleStatusesCommand.ts rename to clients/client-config-service/src/commands/DescribeOrganizationConfigRuleStatusesCommand.ts diff --git a/clients/client-config-service/commands/DescribeOrganizationConfigRulesCommand.ts b/clients/client-config-service/src/commands/DescribeOrganizationConfigRulesCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeOrganizationConfigRulesCommand.ts rename to clients/client-config-service/src/commands/DescribeOrganizationConfigRulesCommand.ts diff --git a/clients/client-config-service/commands/DescribeOrganizationConformancePackStatusesCommand.ts b/clients/client-config-service/src/commands/DescribeOrganizationConformancePackStatusesCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeOrganizationConformancePackStatusesCommand.ts rename to clients/client-config-service/src/commands/DescribeOrganizationConformancePackStatusesCommand.ts diff --git a/clients/client-config-service/commands/DescribeOrganizationConformancePacksCommand.ts b/clients/client-config-service/src/commands/DescribeOrganizationConformancePacksCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeOrganizationConformancePacksCommand.ts rename to clients/client-config-service/src/commands/DescribeOrganizationConformancePacksCommand.ts diff --git a/clients/client-config-service/commands/DescribePendingAggregationRequestsCommand.ts b/clients/client-config-service/src/commands/DescribePendingAggregationRequestsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribePendingAggregationRequestsCommand.ts rename to clients/client-config-service/src/commands/DescribePendingAggregationRequestsCommand.ts diff --git a/clients/client-config-service/commands/DescribeRemediationConfigurationsCommand.ts b/clients/client-config-service/src/commands/DescribeRemediationConfigurationsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeRemediationConfigurationsCommand.ts rename to clients/client-config-service/src/commands/DescribeRemediationConfigurationsCommand.ts diff --git a/clients/client-config-service/commands/DescribeRemediationExceptionsCommand.ts b/clients/client-config-service/src/commands/DescribeRemediationExceptionsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeRemediationExceptionsCommand.ts rename to clients/client-config-service/src/commands/DescribeRemediationExceptionsCommand.ts diff --git a/clients/client-config-service/commands/DescribeRemediationExecutionStatusCommand.ts b/clients/client-config-service/src/commands/DescribeRemediationExecutionStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeRemediationExecutionStatusCommand.ts rename to clients/client-config-service/src/commands/DescribeRemediationExecutionStatusCommand.ts diff --git a/clients/client-config-service/commands/DescribeRetentionConfigurationsCommand.ts b/clients/client-config-service/src/commands/DescribeRetentionConfigurationsCommand.ts similarity index 100% rename from clients/client-config-service/commands/DescribeRetentionConfigurationsCommand.ts rename to clients/client-config-service/src/commands/DescribeRetentionConfigurationsCommand.ts diff --git a/clients/client-config-service/commands/GetAggregateComplianceDetailsByConfigRuleCommand.ts b/clients/client-config-service/src/commands/GetAggregateComplianceDetailsByConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetAggregateComplianceDetailsByConfigRuleCommand.ts rename to clients/client-config-service/src/commands/GetAggregateComplianceDetailsByConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/GetAggregateConfigRuleComplianceSummaryCommand.ts b/clients/client-config-service/src/commands/GetAggregateConfigRuleComplianceSummaryCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetAggregateConfigRuleComplianceSummaryCommand.ts rename to clients/client-config-service/src/commands/GetAggregateConfigRuleComplianceSummaryCommand.ts diff --git a/clients/client-config-service/commands/GetAggregateConformancePackComplianceSummaryCommand.ts b/clients/client-config-service/src/commands/GetAggregateConformancePackComplianceSummaryCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetAggregateConformancePackComplianceSummaryCommand.ts rename to clients/client-config-service/src/commands/GetAggregateConformancePackComplianceSummaryCommand.ts diff --git a/clients/client-config-service/commands/GetAggregateDiscoveredResourceCountsCommand.ts b/clients/client-config-service/src/commands/GetAggregateDiscoveredResourceCountsCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetAggregateDiscoveredResourceCountsCommand.ts rename to clients/client-config-service/src/commands/GetAggregateDiscoveredResourceCountsCommand.ts diff --git a/clients/client-config-service/commands/GetAggregateResourceConfigCommand.ts b/clients/client-config-service/src/commands/GetAggregateResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetAggregateResourceConfigCommand.ts rename to clients/client-config-service/src/commands/GetAggregateResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/GetComplianceDetailsByConfigRuleCommand.ts b/clients/client-config-service/src/commands/GetComplianceDetailsByConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetComplianceDetailsByConfigRuleCommand.ts rename to clients/client-config-service/src/commands/GetComplianceDetailsByConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/GetComplianceDetailsByResourceCommand.ts b/clients/client-config-service/src/commands/GetComplianceDetailsByResourceCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetComplianceDetailsByResourceCommand.ts rename to clients/client-config-service/src/commands/GetComplianceDetailsByResourceCommand.ts diff --git a/clients/client-config-service/commands/GetComplianceSummaryByConfigRuleCommand.ts b/clients/client-config-service/src/commands/GetComplianceSummaryByConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetComplianceSummaryByConfigRuleCommand.ts rename to clients/client-config-service/src/commands/GetComplianceSummaryByConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/GetComplianceSummaryByResourceTypeCommand.ts b/clients/client-config-service/src/commands/GetComplianceSummaryByResourceTypeCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetComplianceSummaryByResourceTypeCommand.ts rename to clients/client-config-service/src/commands/GetComplianceSummaryByResourceTypeCommand.ts diff --git a/clients/client-config-service/commands/GetConformancePackComplianceDetailsCommand.ts b/clients/client-config-service/src/commands/GetConformancePackComplianceDetailsCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetConformancePackComplianceDetailsCommand.ts rename to clients/client-config-service/src/commands/GetConformancePackComplianceDetailsCommand.ts diff --git a/clients/client-config-service/commands/GetConformancePackComplianceSummaryCommand.ts b/clients/client-config-service/src/commands/GetConformancePackComplianceSummaryCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetConformancePackComplianceSummaryCommand.ts rename to clients/client-config-service/src/commands/GetConformancePackComplianceSummaryCommand.ts diff --git a/clients/client-config-service/commands/GetDiscoveredResourceCountsCommand.ts b/clients/client-config-service/src/commands/GetDiscoveredResourceCountsCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetDiscoveredResourceCountsCommand.ts rename to clients/client-config-service/src/commands/GetDiscoveredResourceCountsCommand.ts diff --git a/clients/client-config-service/commands/GetOrganizationConfigRuleDetailedStatusCommand.ts b/clients/client-config-service/src/commands/GetOrganizationConfigRuleDetailedStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetOrganizationConfigRuleDetailedStatusCommand.ts rename to clients/client-config-service/src/commands/GetOrganizationConfigRuleDetailedStatusCommand.ts diff --git a/clients/client-config-service/commands/GetOrganizationConformancePackDetailedStatusCommand.ts b/clients/client-config-service/src/commands/GetOrganizationConformancePackDetailedStatusCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetOrganizationConformancePackDetailedStatusCommand.ts rename to clients/client-config-service/src/commands/GetOrganizationConformancePackDetailedStatusCommand.ts diff --git a/clients/client-config-service/commands/GetResourceConfigHistoryCommand.ts b/clients/client-config-service/src/commands/GetResourceConfigHistoryCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetResourceConfigHistoryCommand.ts rename to clients/client-config-service/src/commands/GetResourceConfigHistoryCommand.ts diff --git a/clients/client-config-service/commands/GetStoredQueryCommand.ts b/clients/client-config-service/src/commands/GetStoredQueryCommand.ts similarity index 100% rename from clients/client-config-service/commands/GetStoredQueryCommand.ts rename to clients/client-config-service/src/commands/GetStoredQueryCommand.ts diff --git a/clients/client-config-service/commands/ListAggregateDiscoveredResourcesCommand.ts b/clients/client-config-service/src/commands/ListAggregateDiscoveredResourcesCommand.ts similarity index 100% rename from clients/client-config-service/commands/ListAggregateDiscoveredResourcesCommand.ts rename to clients/client-config-service/src/commands/ListAggregateDiscoveredResourcesCommand.ts diff --git a/clients/client-config-service/commands/ListDiscoveredResourcesCommand.ts b/clients/client-config-service/src/commands/ListDiscoveredResourcesCommand.ts similarity index 100% rename from clients/client-config-service/commands/ListDiscoveredResourcesCommand.ts rename to clients/client-config-service/src/commands/ListDiscoveredResourcesCommand.ts diff --git a/clients/client-config-service/commands/ListStoredQueriesCommand.ts b/clients/client-config-service/src/commands/ListStoredQueriesCommand.ts similarity index 100% rename from clients/client-config-service/commands/ListStoredQueriesCommand.ts rename to clients/client-config-service/src/commands/ListStoredQueriesCommand.ts diff --git a/clients/client-config-service/commands/ListTagsForResourceCommand.ts b/clients/client-config-service/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-config-service/commands/ListTagsForResourceCommand.ts rename to clients/client-config-service/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-config-service/commands/PutAggregationAuthorizationCommand.ts b/clients/client-config-service/src/commands/PutAggregationAuthorizationCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutAggregationAuthorizationCommand.ts rename to clients/client-config-service/src/commands/PutAggregationAuthorizationCommand.ts diff --git a/clients/client-config-service/commands/PutConfigRuleCommand.ts b/clients/client-config-service/src/commands/PutConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutConfigRuleCommand.ts rename to clients/client-config-service/src/commands/PutConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/PutConfigurationAggregatorCommand.ts b/clients/client-config-service/src/commands/PutConfigurationAggregatorCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutConfigurationAggregatorCommand.ts rename to clients/client-config-service/src/commands/PutConfigurationAggregatorCommand.ts diff --git a/clients/client-config-service/commands/PutConfigurationRecorderCommand.ts b/clients/client-config-service/src/commands/PutConfigurationRecorderCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutConfigurationRecorderCommand.ts rename to clients/client-config-service/src/commands/PutConfigurationRecorderCommand.ts diff --git a/clients/client-config-service/commands/PutConformancePackCommand.ts b/clients/client-config-service/src/commands/PutConformancePackCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutConformancePackCommand.ts rename to clients/client-config-service/src/commands/PutConformancePackCommand.ts diff --git a/clients/client-config-service/commands/PutDeliveryChannelCommand.ts b/clients/client-config-service/src/commands/PutDeliveryChannelCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutDeliveryChannelCommand.ts rename to clients/client-config-service/src/commands/PutDeliveryChannelCommand.ts diff --git a/clients/client-config-service/commands/PutEvaluationsCommand.ts b/clients/client-config-service/src/commands/PutEvaluationsCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutEvaluationsCommand.ts rename to clients/client-config-service/src/commands/PutEvaluationsCommand.ts diff --git a/clients/client-config-service/commands/PutExternalEvaluationCommand.ts b/clients/client-config-service/src/commands/PutExternalEvaluationCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutExternalEvaluationCommand.ts rename to clients/client-config-service/src/commands/PutExternalEvaluationCommand.ts diff --git a/clients/client-config-service/commands/PutOrganizationConfigRuleCommand.ts b/clients/client-config-service/src/commands/PutOrganizationConfigRuleCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutOrganizationConfigRuleCommand.ts rename to clients/client-config-service/src/commands/PutOrganizationConfigRuleCommand.ts diff --git a/clients/client-config-service/commands/PutOrganizationConformancePackCommand.ts b/clients/client-config-service/src/commands/PutOrganizationConformancePackCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutOrganizationConformancePackCommand.ts rename to clients/client-config-service/src/commands/PutOrganizationConformancePackCommand.ts diff --git a/clients/client-config-service/commands/PutRemediationConfigurationsCommand.ts b/clients/client-config-service/src/commands/PutRemediationConfigurationsCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutRemediationConfigurationsCommand.ts rename to clients/client-config-service/src/commands/PutRemediationConfigurationsCommand.ts diff --git a/clients/client-config-service/commands/PutRemediationExceptionsCommand.ts b/clients/client-config-service/src/commands/PutRemediationExceptionsCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutRemediationExceptionsCommand.ts rename to clients/client-config-service/src/commands/PutRemediationExceptionsCommand.ts diff --git a/clients/client-config-service/commands/PutResourceConfigCommand.ts b/clients/client-config-service/src/commands/PutResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutResourceConfigCommand.ts rename to clients/client-config-service/src/commands/PutResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/PutRetentionConfigurationCommand.ts b/clients/client-config-service/src/commands/PutRetentionConfigurationCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutRetentionConfigurationCommand.ts rename to clients/client-config-service/src/commands/PutRetentionConfigurationCommand.ts diff --git a/clients/client-config-service/commands/PutStoredQueryCommand.ts b/clients/client-config-service/src/commands/PutStoredQueryCommand.ts similarity index 100% rename from clients/client-config-service/commands/PutStoredQueryCommand.ts rename to clients/client-config-service/src/commands/PutStoredQueryCommand.ts diff --git a/clients/client-config-service/commands/SelectAggregateResourceConfigCommand.ts b/clients/client-config-service/src/commands/SelectAggregateResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/SelectAggregateResourceConfigCommand.ts rename to clients/client-config-service/src/commands/SelectAggregateResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/SelectResourceConfigCommand.ts b/clients/client-config-service/src/commands/SelectResourceConfigCommand.ts similarity index 100% rename from clients/client-config-service/commands/SelectResourceConfigCommand.ts rename to clients/client-config-service/src/commands/SelectResourceConfigCommand.ts diff --git a/clients/client-config-service/commands/StartConfigRulesEvaluationCommand.ts b/clients/client-config-service/src/commands/StartConfigRulesEvaluationCommand.ts similarity index 100% rename from clients/client-config-service/commands/StartConfigRulesEvaluationCommand.ts rename to clients/client-config-service/src/commands/StartConfigRulesEvaluationCommand.ts diff --git a/clients/client-config-service/commands/StartConfigurationRecorderCommand.ts b/clients/client-config-service/src/commands/StartConfigurationRecorderCommand.ts similarity index 100% rename from clients/client-config-service/commands/StartConfigurationRecorderCommand.ts rename to clients/client-config-service/src/commands/StartConfigurationRecorderCommand.ts diff --git a/clients/client-config-service/commands/StartRemediationExecutionCommand.ts b/clients/client-config-service/src/commands/StartRemediationExecutionCommand.ts similarity index 100% rename from clients/client-config-service/commands/StartRemediationExecutionCommand.ts rename to clients/client-config-service/src/commands/StartRemediationExecutionCommand.ts diff --git a/clients/client-config-service/commands/StopConfigurationRecorderCommand.ts b/clients/client-config-service/src/commands/StopConfigurationRecorderCommand.ts similarity index 100% rename from clients/client-config-service/commands/StopConfigurationRecorderCommand.ts rename to clients/client-config-service/src/commands/StopConfigurationRecorderCommand.ts diff --git a/clients/client-config-service/commands/TagResourceCommand.ts b/clients/client-config-service/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-config-service/commands/TagResourceCommand.ts rename to clients/client-config-service/src/commands/TagResourceCommand.ts diff --git a/clients/client-config-service/commands/UntagResourceCommand.ts b/clients/client-config-service/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-config-service/commands/UntagResourceCommand.ts rename to clients/client-config-service/src/commands/UntagResourceCommand.ts diff --git a/clients/client-config-service/endpoints.ts b/clients/client-config-service/src/endpoints.ts similarity index 100% rename from clients/client-config-service/endpoints.ts rename to clients/client-config-service/src/endpoints.ts diff --git a/clients/client-config-service/index.ts b/clients/client-config-service/src/index.ts similarity index 100% rename from clients/client-config-service/index.ts rename to clients/client-config-service/src/index.ts diff --git a/clients/client-config-service/models/index.ts b/clients/client-config-service/src/models/index.ts similarity index 100% rename from clients/client-config-service/models/index.ts rename to clients/client-config-service/src/models/index.ts diff --git a/clients/client-config-service/models/models_0.ts b/clients/client-config-service/src/models/models_0.ts similarity index 100% rename from clients/client-config-service/models/models_0.ts rename to clients/client-config-service/src/models/models_0.ts diff --git a/clients/client-config-service/models/models_1.ts b/clients/client-config-service/src/models/models_1.ts similarity index 100% rename from clients/client-config-service/models/models_1.ts rename to clients/client-config-service/src/models/models_1.ts diff --git a/clients/client-config-service/pagination/DescribeAggregateComplianceByConfigRulesPaginator.ts b/clients/client-config-service/src/pagination/DescribeAggregateComplianceByConfigRulesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeAggregateComplianceByConfigRulesPaginator.ts rename to clients/client-config-service/src/pagination/DescribeAggregateComplianceByConfigRulesPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeAggregateComplianceByConformancePacksPaginator.ts b/clients/client-config-service/src/pagination/DescribeAggregateComplianceByConformancePacksPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeAggregateComplianceByConformancePacksPaginator.ts rename to clients/client-config-service/src/pagination/DescribeAggregateComplianceByConformancePacksPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeAggregationAuthorizationsPaginator.ts b/clients/client-config-service/src/pagination/DescribeAggregationAuthorizationsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeAggregationAuthorizationsPaginator.ts rename to clients/client-config-service/src/pagination/DescribeAggregationAuthorizationsPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeComplianceByConfigRulePaginator.ts b/clients/client-config-service/src/pagination/DescribeComplianceByConfigRulePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeComplianceByConfigRulePaginator.ts rename to clients/client-config-service/src/pagination/DescribeComplianceByConfigRulePaginator.ts diff --git a/clients/client-config-service/pagination/DescribeComplianceByResourcePaginator.ts b/clients/client-config-service/src/pagination/DescribeComplianceByResourcePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeComplianceByResourcePaginator.ts rename to clients/client-config-service/src/pagination/DescribeComplianceByResourcePaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConfigRuleEvaluationStatusPaginator.ts b/clients/client-config-service/src/pagination/DescribeConfigRuleEvaluationStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConfigRuleEvaluationStatusPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConfigRuleEvaluationStatusPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConfigRulesPaginator.ts b/clients/client-config-service/src/pagination/DescribeConfigRulesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConfigRulesPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConfigRulesPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConfigurationAggregatorSourcesStatusPaginator.ts b/clients/client-config-service/src/pagination/DescribeConfigurationAggregatorSourcesStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConfigurationAggregatorSourcesStatusPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConfigurationAggregatorSourcesStatusPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConfigurationAggregatorsPaginator.ts b/clients/client-config-service/src/pagination/DescribeConfigurationAggregatorsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConfigurationAggregatorsPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConfigurationAggregatorsPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConformancePackCompliancePaginator.ts b/clients/client-config-service/src/pagination/DescribeConformancePackCompliancePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConformancePackCompliancePaginator.ts rename to clients/client-config-service/src/pagination/DescribeConformancePackCompliancePaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConformancePackStatusPaginator.ts b/clients/client-config-service/src/pagination/DescribeConformancePackStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConformancePackStatusPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConformancePackStatusPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeConformancePacksPaginator.ts b/clients/client-config-service/src/pagination/DescribeConformancePacksPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeConformancePacksPaginator.ts rename to clients/client-config-service/src/pagination/DescribeConformancePacksPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeOrganizationConfigRuleStatusesPaginator.ts b/clients/client-config-service/src/pagination/DescribeOrganizationConfigRuleStatusesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeOrganizationConfigRuleStatusesPaginator.ts rename to clients/client-config-service/src/pagination/DescribeOrganizationConfigRuleStatusesPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeOrganizationConfigRulesPaginator.ts b/clients/client-config-service/src/pagination/DescribeOrganizationConfigRulesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeOrganizationConfigRulesPaginator.ts rename to clients/client-config-service/src/pagination/DescribeOrganizationConfigRulesPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeOrganizationConformancePackStatusesPaginator.ts b/clients/client-config-service/src/pagination/DescribeOrganizationConformancePackStatusesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeOrganizationConformancePackStatusesPaginator.ts rename to clients/client-config-service/src/pagination/DescribeOrganizationConformancePackStatusesPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeOrganizationConformancePacksPaginator.ts b/clients/client-config-service/src/pagination/DescribeOrganizationConformancePacksPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeOrganizationConformancePacksPaginator.ts rename to clients/client-config-service/src/pagination/DescribeOrganizationConformancePacksPaginator.ts diff --git a/clients/client-config-service/pagination/DescribePendingAggregationRequestsPaginator.ts b/clients/client-config-service/src/pagination/DescribePendingAggregationRequestsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribePendingAggregationRequestsPaginator.ts rename to clients/client-config-service/src/pagination/DescribePendingAggregationRequestsPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeRemediationExceptionsPaginator.ts b/clients/client-config-service/src/pagination/DescribeRemediationExceptionsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeRemediationExceptionsPaginator.ts rename to clients/client-config-service/src/pagination/DescribeRemediationExceptionsPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeRemediationExecutionStatusPaginator.ts b/clients/client-config-service/src/pagination/DescribeRemediationExecutionStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeRemediationExecutionStatusPaginator.ts rename to clients/client-config-service/src/pagination/DescribeRemediationExecutionStatusPaginator.ts diff --git a/clients/client-config-service/pagination/DescribeRetentionConfigurationsPaginator.ts b/clients/client-config-service/src/pagination/DescribeRetentionConfigurationsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/DescribeRetentionConfigurationsPaginator.ts rename to clients/client-config-service/src/pagination/DescribeRetentionConfigurationsPaginator.ts diff --git a/clients/client-config-service/pagination/GetAggregateComplianceDetailsByConfigRulePaginator.ts b/clients/client-config-service/src/pagination/GetAggregateComplianceDetailsByConfigRulePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetAggregateComplianceDetailsByConfigRulePaginator.ts rename to clients/client-config-service/src/pagination/GetAggregateComplianceDetailsByConfigRulePaginator.ts diff --git a/clients/client-config-service/pagination/GetAggregateConfigRuleComplianceSummaryPaginator.ts b/clients/client-config-service/src/pagination/GetAggregateConfigRuleComplianceSummaryPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetAggregateConfigRuleComplianceSummaryPaginator.ts rename to clients/client-config-service/src/pagination/GetAggregateConfigRuleComplianceSummaryPaginator.ts diff --git a/clients/client-config-service/pagination/GetAggregateConformancePackComplianceSummaryPaginator.ts b/clients/client-config-service/src/pagination/GetAggregateConformancePackComplianceSummaryPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetAggregateConformancePackComplianceSummaryPaginator.ts rename to clients/client-config-service/src/pagination/GetAggregateConformancePackComplianceSummaryPaginator.ts diff --git a/clients/client-config-service/pagination/GetAggregateDiscoveredResourceCountsPaginator.ts b/clients/client-config-service/src/pagination/GetAggregateDiscoveredResourceCountsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetAggregateDiscoveredResourceCountsPaginator.ts rename to clients/client-config-service/src/pagination/GetAggregateDiscoveredResourceCountsPaginator.ts diff --git a/clients/client-config-service/pagination/GetComplianceDetailsByConfigRulePaginator.ts b/clients/client-config-service/src/pagination/GetComplianceDetailsByConfigRulePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetComplianceDetailsByConfigRulePaginator.ts rename to clients/client-config-service/src/pagination/GetComplianceDetailsByConfigRulePaginator.ts diff --git a/clients/client-config-service/pagination/GetComplianceDetailsByResourcePaginator.ts b/clients/client-config-service/src/pagination/GetComplianceDetailsByResourcePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetComplianceDetailsByResourcePaginator.ts rename to clients/client-config-service/src/pagination/GetComplianceDetailsByResourcePaginator.ts diff --git a/clients/client-config-service/pagination/GetConformancePackComplianceDetailsPaginator.ts b/clients/client-config-service/src/pagination/GetConformancePackComplianceDetailsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetConformancePackComplianceDetailsPaginator.ts rename to clients/client-config-service/src/pagination/GetConformancePackComplianceDetailsPaginator.ts diff --git a/clients/client-config-service/pagination/GetConformancePackComplianceSummaryPaginator.ts b/clients/client-config-service/src/pagination/GetConformancePackComplianceSummaryPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetConformancePackComplianceSummaryPaginator.ts rename to clients/client-config-service/src/pagination/GetConformancePackComplianceSummaryPaginator.ts diff --git a/clients/client-config-service/pagination/GetDiscoveredResourceCountsPaginator.ts b/clients/client-config-service/src/pagination/GetDiscoveredResourceCountsPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetDiscoveredResourceCountsPaginator.ts rename to clients/client-config-service/src/pagination/GetDiscoveredResourceCountsPaginator.ts diff --git a/clients/client-config-service/pagination/GetOrganizationConfigRuleDetailedStatusPaginator.ts b/clients/client-config-service/src/pagination/GetOrganizationConfigRuleDetailedStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetOrganizationConfigRuleDetailedStatusPaginator.ts rename to clients/client-config-service/src/pagination/GetOrganizationConfigRuleDetailedStatusPaginator.ts diff --git a/clients/client-config-service/pagination/GetOrganizationConformancePackDetailedStatusPaginator.ts b/clients/client-config-service/src/pagination/GetOrganizationConformancePackDetailedStatusPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetOrganizationConformancePackDetailedStatusPaginator.ts rename to clients/client-config-service/src/pagination/GetOrganizationConformancePackDetailedStatusPaginator.ts diff --git a/clients/client-config-service/pagination/GetResourceConfigHistoryPaginator.ts b/clients/client-config-service/src/pagination/GetResourceConfigHistoryPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/GetResourceConfigHistoryPaginator.ts rename to clients/client-config-service/src/pagination/GetResourceConfigHistoryPaginator.ts diff --git a/clients/client-config-service/pagination/Interfaces.ts b/clients/client-config-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-config-service/pagination/Interfaces.ts rename to clients/client-config-service/src/pagination/Interfaces.ts diff --git a/clients/client-config-service/pagination/ListAggregateDiscoveredResourcesPaginator.ts b/clients/client-config-service/src/pagination/ListAggregateDiscoveredResourcesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/ListAggregateDiscoveredResourcesPaginator.ts rename to clients/client-config-service/src/pagination/ListAggregateDiscoveredResourcesPaginator.ts diff --git a/clients/client-config-service/pagination/ListDiscoveredResourcesPaginator.ts b/clients/client-config-service/src/pagination/ListDiscoveredResourcesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/ListDiscoveredResourcesPaginator.ts rename to clients/client-config-service/src/pagination/ListDiscoveredResourcesPaginator.ts diff --git a/clients/client-config-service/pagination/ListStoredQueriesPaginator.ts b/clients/client-config-service/src/pagination/ListStoredQueriesPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/ListStoredQueriesPaginator.ts rename to clients/client-config-service/src/pagination/ListStoredQueriesPaginator.ts diff --git a/clients/client-config-service/pagination/ListTagsForResourcePaginator.ts b/clients/client-config-service/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-config-service/pagination/ListTagsForResourcePaginator.ts rename to clients/client-config-service/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-config-service/pagination/SelectAggregateResourceConfigPaginator.ts b/clients/client-config-service/src/pagination/SelectAggregateResourceConfigPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/SelectAggregateResourceConfigPaginator.ts rename to clients/client-config-service/src/pagination/SelectAggregateResourceConfigPaginator.ts diff --git a/clients/client-config-service/pagination/SelectResourceConfigPaginator.ts b/clients/client-config-service/src/pagination/SelectResourceConfigPaginator.ts similarity index 100% rename from clients/client-config-service/pagination/SelectResourceConfigPaginator.ts rename to clients/client-config-service/src/pagination/SelectResourceConfigPaginator.ts diff --git a/clients/client-config-service/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-config-service/protocols/Aws_json1_1.ts rename to clients/client-config-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-config-service/src/runtimeConfig.browser.ts b/clients/client-config-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2dc584a14dc1 --- /dev/null +++ b/clients/client-config-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ConfigServiceClientConfig } from "./ConfigServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-config-service/runtimeConfig.native.ts b/clients/client-config-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-config-service/runtimeConfig.native.ts rename to clients/client-config-service/src/runtimeConfig.native.ts diff --git a/clients/client-config-service/runtimeConfig.shared.ts b/clients/client-config-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-config-service/runtimeConfig.shared.ts rename to clients/client-config-service/src/runtimeConfig.shared.ts diff --git a/clients/client-config-service/src/runtimeConfig.ts b/clients/client-config-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..cf464dbd0767 --- /dev/null +++ b/clients/client-config-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ConfigServiceClientConfig } from "./ConfigServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-config-service/tsconfig.es.json b/clients/client-config-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-config-service/tsconfig.es.json +++ b/clients/client-config-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-config-service/tsconfig.json b/clients/client-config-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-config-service/tsconfig.json +++ b/clients/client-config-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-config-service/tsconfig.types.json b/clients/client-config-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-config-service/tsconfig.types.json +++ b/clients/client-config-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-connect-contact-lens/.gitignore b/clients/client-connect-contact-lens/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-connect-contact-lens/.gitignore +++ b/clients/client-connect-contact-lens/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-connect-contact-lens/package.json b/clients/client-connect-contact-lens/package.json index 43c2bd88ed78..3a6a5f4993d3 100644 --- a/clients/client-connect-contact-lens/package.json +++ b/clients/client-connect-contact-lens/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-connect-contact-lens", "repository": { "type": "git", diff --git a/clients/client-connect-contact-lens/runtimeConfig.browser.ts b/clients/client-connect-contact-lens/runtimeConfig.browser.ts deleted file mode 100644 index bbeb8f696fcb..000000000000 --- a/clients/client-connect-contact-lens/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ConnectContactLensClientConfig } from "./ConnectContactLensClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connect-contact-lens/runtimeConfig.ts b/clients/client-connect-contact-lens/runtimeConfig.ts deleted file mode 100644 index d462469b9847..000000000000 --- a/clients/client-connect-contact-lens/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ConnectContactLensClientConfig } from "./ConnectContactLensClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connect-contact-lens/ConnectContactLens.ts b/clients/client-connect-contact-lens/src/ConnectContactLens.ts similarity index 100% rename from clients/client-connect-contact-lens/ConnectContactLens.ts rename to clients/client-connect-contact-lens/src/ConnectContactLens.ts diff --git a/clients/client-connect-contact-lens/ConnectContactLensClient.ts b/clients/client-connect-contact-lens/src/ConnectContactLensClient.ts similarity index 100% rename from clients/client-connect-contact-lens/ConnectContactLensClient.ts rename to clients/client-connect-contact-lens/src/ConnectContactLensClient.ts diff --git a/clients/client-connect-contact-lens/commands/ListRealtimeContactAnalysisSegmentsCommand.ts b/clients/client-connect-contact-lens/src/commands/ListRealtimeContactAnalysisSegmentsCommand.ts similarity index 100% rename from clients/client-connect-contact-lens/commands/ListRealtimeContactAnalysisSegmentsCommand.ts rename to clients/client-connect-contact-lens/src/commands/ListRealtimeContactAnalysisSegmentsCommand.ts diff --git a/clients/client-connect-contact-lens/endpoints.ts b/clients/client-connect-contact-lens/src/endpoints.ts similarity index 100% rename from clients/client-connect-contact-lens/endpoints.ts rename to clients/client-connect-contact-lens/src/endpoints.ts diff --git a/clients/client-connect-contact-lens/index.ts b/clients/client-connect-contact-lens/src/index.ts similarity index 100% rename from clients/client-connect-contact-lens/index.ts rename to clients/client-connect-contact-lens/src/index.ts diff --git a/clients/client-connect-contact-lens/models/index.ts b/clients/client-connect-contact-lens/src/models/index.ts similarity index 100% rename from clients/client-connect-contact-lens/models/index.ts rename to clients/client-connect-contact-lens/src/models/index.ts diff --git a/clients/client-connect-contact-lens/models/models_0.ts b/clients/client-connect-contact-lens/src/models/models_0.ts similarity index 100% rename from clients/client-connect-contact-lens/models/models_0.ts rename to clients/client-connect-contact-lens/src/models/models_0.ts diff --git a/clients/client-connect-contact-lens/pagination/Interfaces.ts b/clients/client-connect-contact-lens/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-connect-contact-lens/pagination/Interfaces.ts rename to clients/client-connect-contact-lens/src/pagination/Interfaces.ts diff --git a/clients/client-connect-contact-lens/pagination/ListRealtimeContactAnalysisSegmentsPaginator.ts b/clients/client-connect-contact-lens/src/pagination/ListRealtimeContactAnalysisSegmentsPaginator.ts similarity index 100% rename from clients/client-connect-contact-lens/pagination/ListRealtimeContactAnalysisSegmentsPaginator.ts rename to clients/client-connect-contact-lens/src/pagination/ListRealtimeContactAnalysisSegmentsPaginator.ts diff --git a/clients/client-connect-contact-lens/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-connect-contact-lens/protocols/Aws_restJson1.ts rename to clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts diff --git a/clients/client-connect-contact-lens/src/runtimeConfig.browser.ts b/clients/client-connect-contact-lens/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..10fc13e33356 --- /dev/null +++ b/clients/client-connect-contact-lens/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ConnectContactLensClientConfig } from "./ConnectContactLensClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connect-contact-lens/runtimeConfig.native.ts b/clients/client-connect-contact-lens/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-connect-contact-lens/runtimeConfig.native.ts rename to clients/client-connect-contact-lens/src/runtimeConfig.native.ts diff --git a/clients/client-connect-contact-lens/runtimeConfig.shared.ts b/clients/client-connect-contact-lens/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-connect-contact-lens/runtimeConfig.shared.ts rename to clients/client-connect-contact-lens/src/runtimeConfig.shared.ts diff --git a/clients/client-connect-contact-lens/src/runtimeConfig.ts b/clients/client-connect-contact-lens/src/runtimeConfig.ts new file mode 100644 index 000000000000..5ed472d69aba --- /dev/null +++ b/clients/client-connect-contact-lens/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ConnectContactLensClientConfig } from "./ConnectContactLensClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connect-contact-lens/tsconfig.es.json b/clients/client-connect-contact-lens/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-connect-contact-lens/tsconfig.es.json +++ b/clients/client-connect-contact-lens/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-connect-contact-lens/tsconfig.json b/clients/client-connect-contact-lens/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-connect-contact-lens/tsconfig.json +++ b/clients/client-connect-contact-lens/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-connect-contact-lens/tsconfig.types.json b/clients/client-connect-contact-lens/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-connect-contact-lens/tsconfig.types.json +++ b/clients/client-connect-contact-lens/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-connect/.gitignore b/clients/client-connect/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-connect/.gitignore +++ b/clients/client-connect/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-connect/package.json b/clients/client-connect/package.json index ce2b537c1039..90fa4c932a74 100644 --- a/clients/client-connect/package.json +++ b/clients/client-connect/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-connect", "repository": { "type": "git", diff --git a/clients/client-connect/runtimeConfig.browser.ts b/clients/client-connect/runtimeConfig.browser.ts deleted file mode 100644 index a4f659c288ab..000000000000 --- a/clients/client-connect/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ConnectClientConfig } from "./ConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connect/runtimeConfig.ts b/clients/client-connect/runtimeConfig.ts deleted file mode 100644 index 129cd0172883..000000000000 --- a/clients/client-connect/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ConnectClientConfig } from "./ConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connect/Connect.ts b/clients/client-connect/src/Connect.ts similarity index 100% rename from clients/client-connect/Connect.ts rename to clients/client-connect/src/Connect.ts diff --git a/clients/client-connect/ConnectClient.ts b/clients/client-connect/src/ConnectClient.ts similarity index 100% rename from clients/client-connect/ConnectClient.ts rename to clients/client-connect/src/ConnectClient.ts diff --git a/clients/client-connect/commands/AssociateApprovedOriginCommand.ts b/clients/client-connect/src/commands/AssociateApprovedOriginCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateApprovedOriginCommand.ts rename to clients/client-connect/src/commands/AssociateApprovedOriginCommand.ts diff --git a/clients/client-connect/commands/AssociateBotCommand.ts b/clients/client-connect/src/commands/AssociateBotCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateBotCommand.ts rename to clients/client-connect/src/commands/AssociateBotCommand.ts diff --git a/clients/client-connect/commands/AssociateInstanceStorageConfigCommand.ts b/clients/client-connect/src/commands/AssociateInstanceStorageConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateInstanceStorageConfigCommand.ts rename to clients/client-connect/src/commands/AssociateInstanceStorageConfigCommand.ts diff --git a/clients/client-connect/commands/AssociateLambdaFunctionCommand.ts b/clients/client-connect/src/commands/AssociateLambdaFunctionCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateLambdaFunctionCommand.ts rename to clients/client-connect/src/commands/AssociateLambdaFunctionCommand.ts diff --git a/clients/client-connect/commands/AssociateLexBotCommand.ts b/clients/client-connect/src/commands/AssociateLexBotCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateLexBotCommand.ts rename to clients/client-connect/src/commands/AssociateLexBotCommand.ts diff --git a/clients/client-connect/commands/AssociateQueueQuickConnectsCommand.ts b/clients/client-connect/src/commands/AssociateQueueQuickConnectsCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateQueueQuickConnectsCommand.ts rename to clients/client-connect/src/commands/AssociateQueueQuickConnectsCommand.ts diff --git a/clients/client-connect/commands/AssociateRoutingProfileQueuesCommand.ts b/clients/client-connect/src/commands/AssociateRoutingProfileQueuesCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateRoutingProfileQueuesCommand.ts rename to clients/client-connect/src/commands/AssociateRoutingProfileQueuesCommand.ts diff --git a/clients/client-connect/commands/AssociateSecurityKeyCommand.ts b/clients/client-connect/src/commands/AssociateSecurityKeyCommand.ts similarity index 100% rename from clients/client-connect/commands/AssociateSecurityKeyCommand.ts rename to clients/client-connect/src/commands/AssociateSecurityKeyCommand.ts diff --git a/clients/client-connect/commands/CreateAgentStatusCommand.ts b/clients/client-connect/src/commands/CreateAgentStatusCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateAgentStatusCommand.ts rename to clients/client-connect/src/commands/CreateAgentStatusCommand.ts diff --git a/clients/client-connect/commands/CreateContactFlowCommand.ts b/clients/client-connect/src/commands/CreateContactFlowCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateContactFlowCommand.ts rename to clients/client-connect/src/commands/CreateContactFlowCommand.ts diff --git a/clients/client-connect/commands/CreateHoursOfOperationCommand.ts b/clients/client-connect/src/commands/CreateHoursOfOperationCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateHoursOfOperationCommand.ts rename to clients/client-connect/src/commands/CreateHoursOfOperationCommand.ts diff --git a/clients/client-connect/commands/CreateInstanceCommand.ts b/clients/client-connect/src/commands/CreateInstanceCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateInstanceCommand.ts rename to clients/client-connect/src/commands/CreateInstanceCommand.ts diff --git a/clients/client-connect/commands/CreateIntegrationAssociationCommand.ts b/clients/client-connect/src/commands/CreateIntegrationAssociationCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateIntegrationAssociationCommand.ts rename to clients/client-connect/src/commands/CreateIntegrationAssociationCommand.ts diff --git a/clients/client-connect/commands/CreateQueueCommand.ts b/clients/client-connect/src/commands/CreateQueueCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateQueueCommand.ts rename to clients/client-connect/src/commands/CreateQueueCommand.ts diff --git a/clients/client-connect/commands/CreateQuickConnectCommand.ts b/clients/client-connect/src/commands/CreateQuickConnectCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateQuickConnectCommand.ts rename to clients/client-connect/src/commands/CreateQuickConnectCommand.ts diff --git a/clients/client-connect/commands/CreateRoutingProfileCommand.ts b/clients/client-connect/src/commands/CreateRoutingProfileCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateRoutingProfileCommand.ts rename to clients/client-connect/src/commands/CreateRoutingProfileCommand.ts diff --git a/clients/client-connect/commands/CreateUseCaseCommand.ts b/clients/client-connect/src/commands/CreateUseCaseCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateUseCaseCommand.ts rename to clients/client-connect/src/commands/CreateUseCaseCommand.ts diff --git a/clients/client-connect/commands/CreateUserCommand.ts b/clients/client-connect/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateUserCommand.ts rename to clients/client-connect/src/commands/CreateUserCommand.ts diff --git a/clients/client-connect/commands/CreateUserHierarchyGroupCommand.ts b/clients/client-connect/src/commands/CreateUserHierarchyGroupCommand.ts similarity index 100% rename from clients/client-connect/commands/CreateUserHierarchyGroupCommand.ts rename to clients/client-connect/src/commands/CreateUserHierarchyGroupCommand.ts diff --git a/clients/client-connect/commands/DeleteHoursOfOperationCommand.ts b/clients/client-connect/src/commands/DeleteHoursOfOperationCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteHoursOfOperationCommand.ts rename to clients/client-connect/src/commands/DeleteHoursOfOperationCommand.ts diff --git a/clients/client-connect/commands/DeleteInstanceCommand.ts b/clients/client-connect/src/commands/DeleteInstanceCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteInstanceCommand.ts rename to clients/client-connect/src/commands/DeleteInstanceCommand.ts diff --git a/clients/client-connect/commands/DeleteIntegrationAssociationCommand.ts b/clients/client-connect/src/commands/DeleteIntegrationAssociationCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteIntegrationAssociationCommand.ts rename to clients/client-connect/src/commands/DeleteIntegrationAssociationCommand.ts diff --git a/clients/client-connect/commands/DeleteQuickConnectCommand.ts b/clients/client-connect/src/commands/DeleteQuickConnectCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteQuickConnectCommand.ts rename to clients/client-connect/src/commands/DeleteQuickConnectCommand.ts diff --git a/clients/client-connect/commands/DeleteUseCaseCommand.ts b/clients/client-connect/src/commands/DeleteUseCaseCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteUseCaseCommand.ts rename to clients/client-connect/src/commands/DeleteUseCaseCommand.ts diff --git a/clients/client-connect/commands/DeleteUserCommand.ts b/clients/client-connect/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteUserCommand.ts rename to clients/client-connect/src/commands/DeleteUserCommand.ts diff --git a/clients/client-connect/commands/DeleteUserHierarchyGroupCommand.ts b/clients/client-connect/src/commands/DeleteUserHierarchyGroupCommand.ts similarity index 100% rename from clients/client-connect/commands/DeleteUserHierarchyGroupCommand.ts rename to clients/client-connect/src/commands/DeleteUserHierarchyGroupCommand.ts diff --git a/clients/client-connect/commands/DescribeAgentStatusCommand.ts b/clients/client-connect/src/commands/DescribeAgentStatusCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeAgentStatusCommand.ts rename to clients/client-connect/src/commands/DescribeAgentStatusCommand.ts diff --git a/clients/client-connect/commands/DescribeContactFlowCommand.ts b/clients/client-connect/src/commands/DescribeContactFlowCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeContactFlowCommand.ts rename to clients/client-connect/src/commands/DescribeContactFlowCommand.ts diff --git a/clients/client-connect/commands/DescribeHoursOfOperationCommand.ts b/clients/client-connect/src/commands/DescribeHoursOfOperationCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeHoursOfOperationCommand.ts rename to clients/client-connect/src/commands/DescribeHoursOfOperationCommand.ts diff --git a/clients/client-connect/commands/DescribeInstanceAttributeCommand.ts b/clients/client-connect/src/commands/DescribeInstanceAttributeCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeInstanceAttributeCommand.ts rename to clients/client-connect/src/commands/DescribeInstanceAttributeCommand.ts diff --git a/clients/client-connect/commands/DescribeInstanceCommand.ts b/clients/client-connect/src/commands/DescribeInstanceCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeInstanceCommand.ts rename to clients/client-connect/src/commands/DescribeInstanceCommand.ts diff --git a/clients/client-connect/commands/DescribeInstanceStorageConfigCommand.ts b/clients/client-connect/src/commands/DescribeInstanceStorageConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeInstanceStorageConfigCommand.ts rename to clients/client-connect/src/commands/DescribeInstanceStorageConfigCommand.ts diff --git a/clients/client-connect/commands/DescribeQueueCommand.ts b/clients/client-connect/src/commands/DescribeQueueCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeQueueCommand.ts rename to clients/client-connect/src/commands/DescribeQueueCommand.ts diff --git a/clients/client-connect/commands/DescribeQuickConnectCommand.ts b/clients/client-connect/src/commands/DescribeQuickConnectCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeQuickConnectCommand.ts rename to clients/client-connect/src/commands/DescribeQuickConnectCommand.ts diff --git a/clients/client-connect/commands/DescribeRoutingProfileCommand.ts b/clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeRoutingProfileCommand.ts rename to clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts diff --git a/clients/client-connect/commands/DescribeUserCommand.ts b/clients/client-connect/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeUserCommand.ts rename to clients/client-connect/src/commands/DescribeUserCommand.ts diff --git a/clients/client-connect/commands/DescribeUserHierarchyGroupCommand.ts b/clients/client-connect/src/commands/DescribeUserHierarchyGroupCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeUserHierarchyGroupCommand.ts rename to clients/client-connect/src/commands/DescribeUserHierarchyGroupCommand.ts diff --git a/clients/client-connect/commands/DescribeUserHierarchyStructureCommand.ts b/clients/client-connect/src/commands/DescribeUserHierarchyStructureCommand.ts similarity index 100% rename from clients/client-connect/commands/DescribeUserHierarchyStructureCommand.ts rename to clients/client-connect/src/commands/DescribeUserHierarchyStructureCommand.ts diff --git a/clients/client-connect/commands/DisassociateApprovedOriginCommand.ts b/clients/client-connect/src/commands/DisassociateApprovedOriginCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateApprovedOriginCommand.ts rename to clients/client-connect/src/commands/DisassociateApprovedOriginCommand.ts diff --git a/clients/client-connect/commands/DisassociateBotCommand.ts b/clients/client-connect/src/commands/DisassociateBotCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateBotCommand.ts rename to clients/client-connect/src/commands/DisassociateBotCommand.ts diff --git a/clients/client-connect/commands/DisassociateInstanceStorageConfigCommand.ts b/clients/client-connect/src/commands/DisassociateInstanceStorageConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateInstanceStorageConfigCommand.ts rename to clients/client-connect/src/commands/DisassociateInstanceStorageConfigCommand.ts diff --git a/clients/client-connect/commands/DisassociateLambdaFunctionCommand.ts b/clients/client-connect/src/commands/DisassociateLambdaFunctionCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateLambdaFunctionCommand.ts rename to clients/client-connect/src/commands/DisassociateLambdaFunctionCommand.ts diff --git a/clients/client-connect/commands/DisassociateLexBotCommand.ts b/clients/client-connect/src/commands/DisassociateLexBotCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateLexBotCommand.ts rename to clients/client-connect/src/commands/DisassociateLexBotCommand.ts diff --git a/clients/client-connect/commands/DisassociateQueueQuickConnectsCommand.ts b/clients/client-connect/src/commands/DisassociateQueueQuickConnectsCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateQueueQuickConnectsCommand.ts rename to clients/client-connect/src/commands/DisassociateQueueQuickConnectsCommand.ts diff --git a/clients/client-connect/commands/DisassociateRoutingProfileQueuesCommand.ts b/clients/client-connect/src/commands/DisassociateRoutingProfileQueuesCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateRoutingProfileQueuesCommand.ts rename to clients/client-connect/src/commands/DisassociateRoutingProfileQueuesCommand.ts diff --git a/clients/client-connect/commands/DisassociateSecurityKeyCommand.ts b/clients/client-connect/src/commands/DisassociateSecurityKeyCommand.ts similarity index 100% rename from clients/client-connect/commands/DisassociateSecurityKeyCommand.ts rename to clients/client-connect/src/commands/DisassociateSecurityKeyCommand.ts diff --git a/clients/client-connect/commands/GetContactAttributesCommand.ts b/clients/client-connect/src/commands/GetContactAttributesCommand.ts similarity index 100% rename from clients/client-connect/commands/GetContactAttributesCommand.ts rename to clients/client-connect/src/commands/GetContactAttributesCommand.ts diff --git a/clients/client-connect/commands/GetCurrentMetricDataCommand.ts b/clients/client-connect/src/commands/GetCurrentMetricDataCommand.ts similarity index 100% rename from clients/client-connect/commands/GetCurrentMetricDataCommand.ts rename to clients/client-connect/src/commands/GetCurrentMetricDataCommand.ts diff --git a/clients/client-connect/commands/GetFederationTokenCommand.ts b/clients/client-connect/src/commands/GetFederationTokenCommand.ts similarity index 100% rename from clients/client-connect/commands/GetFederationTokenCommand.ts rename to clients/client-connect/src/commands/GetFederationTokenCommand.ts diff --git a/clients/client-connect/commands/GetMetricDataCommand.ts b/clients/client-connect/src/commands/GetMetricDataCommand.ts similarity index 100% rename from clients/client-connect/commands/GetMetricDataCommand.ts rename to clients/client-connect/src/commands/GetMetricDataCommand.ts diff --git a/clients/client-connect/commands/ListAgentStatusesCommand.ts b/clients/client-connect/src/commands/ListAgentStatusesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListAgentStatusesCommand.ts rename to clients/client-connect/src/commands/ListAgentStatusesCommand.ts diff --git a/clients/client-connect/commands/ListApprovedOriginsCommand.ts b/clients/client-connect/src/commands/ListApprovedOriginsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListApprovedOriginsCommand.ts rename to clients/client-connect/src/commands/ListApprovedOriginsCommand.ts diff --git a/clients/client-connect/commands/ListBotsCommand.ts b/clients/client-connect/src/commands/ListBotsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListBotsCommand.ts rename to clients/client-connect/src/commands/ListBotsCommand.ts diff --git a/clients/client-connect/commands/ListContactFlowsCommand.ts b/clients/client-connect/src/commands/ListContactFlowsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListContactFlowsCommand.ts rename to clients/client-connect/src/commands/ListContactFlowsCommand.ts diff --git a/clients/client-connect/commands/ListHoursOfOperationsCommand.ts b/clients/client-connect/src/commands/ListHoursOfOperationsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListHoursOfOperationsCommand.ts rename to clients/client-connect/src/commands/ListHoursOfOperationsCommand.ts diff --git a/clients/client-connect/commands/ListInstanceAttributesCommand.ts b/clients/client-connect/src/commands/ListInstanceAttributesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListInstanceAttributesCommand.ts rename to clients/client-connect/src/commands/ListInstanceAttributesCommand.ts diff --git a/clients/client-connect/commands/ListInstanceStorageConfigsCommand.ts b/clients/client-connect/src/commands/ListInstanceStorageConfigsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListInstanceStorageConfigsCommand.ts rename to clients/client-connect/src/commands/ListInstanceStorageConfigsCommand.ts diff --git a/clients/client-connect/commands/ListInstancesCommand.ts b/clients/client-connect/src/commands/ListInstancesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListInstancesCommand.ts rename to clients/client-connect/src/commands/ListInstancesCommand.ts diff --git a/clients/client-connect/commands/ListIntegrationAssociationsCommand.ts b/clients/client-connect/src/commands/ListIntegrationAssociationsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListIntegrationAssociationsCommand.ts rename to clients/client-connect/src/commands/ListIntegrationAssociationsCommand.ts diff --git a/clients/client-connect/commands/ListLambdaFunctionsCommand.ts b/clients/client-connect/src/commands/ListLambdaFunctionsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListLambdaFunctionsCommand.ts rename to clients/client-connect/src/commands/ListLambdaFunctionsCommand.ts diff --git a/clients/client-connect/commands/ListLexBotsCommand.ts b/clients/client-connect/src/commands/ListLexBotsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListLexBotsCommand.ts rename to clients/client-connect/src/commands/ListLexBotsCommand.ts diff --git a/clients/client-connect/commands/ListPhoneNumbersCommand.ts b/clients/client-connect/src/commands/ListPhoneNumbersCommand.ts similarity index 100% rename from clients/client-connect/commands/ListPhoneNumbersCommand.ts rename to clients/client-connect/src/commands/ListPhoneNumbersCommand.ts diff --git a/clients/client-connect/commands/ListPromptsCommand.ts b/clients/client-connect/src/commands/ListPromptsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListPromptsCommand.ts rename to clients/client-connect/src/commands/ListPromptsCommand.ts diff --git a/clients/client-connect/commands/ListQueueQuickConnectsCommand.ts b/clients/client-connect/src/commands/ListQueueQuickConnectsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListQueueQuickConnectsCommand.ts rename to clients/client-connect/src/commands/ListQueueQuickConnectsCommand.ts diff --git a/clients/client-connect/commands/ListQueuesCommand.ts b/clients/client-connect/src/commands/ListQueuesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListQueuesCommand.ts rename to clients/client-connect/src/commands/ListQueuesCommand.ts diff --git a/clients/client-connect/commands/ListQuickConnectsCommand.ts b/clients/client-connect/src/commands/ListQuickConnectsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListQuickConnectsCommand.ts rename to clients/client-connect/src/commands/ListQuickConnectsCommand.ts diff --git a/clients/client-connect/commands/ListRoutingProfileQueuesCommand.ts b/clients/client-connect/src/commands/ListRoutingProfileQueuesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListRoutingProfileQueuesCommand.ts rename to clients/client-connect/src/commands/ListRoutingProfileQueuesCommand.ts diff --git a/clients/client-connect/commands/ListRoutingProfilesCommand.ts b/clients/client-connect/src/commands/ListRoutingProfilesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListRoutingProfilesCommand.ts rename to clients/client-connect/src/commands/ListRoutingProfilesCommand.ts diff --git a/clients/client-connect/commands/ListSecurityKeysCommand.ts b/clients/client-connect/src/commands/ListSecurityKeysCommand.ts similarity index 100% rename from clients/client-connect/commands/ListSecurityKeysCommand.ts rename to clients/client-connect/src/commands/ListSecurityKeysCommand.ts diff --git a/clients/client-connect/commands/ListSecurityProfilesCommand.ts b/clients/client-connect/src/commands/ListSecurityProfilesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListSecurityProfilesCommand.ts rename to clients/client-connect/src/commands/ListSecurityProfilesCommand.ts diff --git a/clients/client-connect/commands/ListTagsForResourceCommand.ts b/clients/client-connect/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-connect/commands/ListTagsForResourceCommand.ts rename to clients/client-connect/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-connect/commands/ListUseCasesCommand.ts b/clients/client-connect/src/commands/ListUseCasesCommand.ts similarity index 100% rename from clients/client-connect/commands/ListUseCasesCommand.ts rename to clients/client-connect/src/commands/ListUseCasesCommand.ts diff --git a/clients/client-connect/commands/ListUserHierarchyGroupsCommand.ts b/clients/client-connect/src/commands/ListUserHierarchyGroupsCommand.ts similarity index 100% rename from clients/client-connect/commands/ListUserHierarchyGroupsCommand.ts rename to clients/client-connect/src/commands/ListUserHierarchyGroupsCommand.ts diff --git a/clients/client-connect/commands/ListUsersCommand.ts b/clients/client-connect/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-connect/commands/ListUsersCommand.ts rename to clients/client-connect/src/commands/ListUsersCommand.ts diff --git a/clients/client-connect/commands/ResumeContactRecordingCommand.ts b/clients/client-connect/src/commands/ResumeContactRecordingCommand.ts similarity index 100% rename from clients/client-connect/commands/ResumeContactRecordingCommand.ts rename to clients/client-connect/src/commands/ResumeContactRecordingCommand.ts diff --git a/clients/client-connect/commands/StartChatContactCommand.ts b/clients/client-connect/src/commands/StartChatContactCommand.ts similarity index 100% rename from clients/client-connect/commands/StartChatContactCommand.ts rename to clients/client-connect/src/commands/StartChatContactCommand.ts diff --git a/clients/client-connect/commands/StartContactRecordingCommand.ts b/clients/client-connect/src/commands/StartContactRecordingCommand.ts similarity index 100% rename from clients/client-connect/commands/StartContactRecordingCommand.ts rename to clients/client-connect/src/commands/StartContactRecordingCommand.ts diff --git a/clients/client-connect/commands/StartOutboundVoiceContactCommand.ts b/clients/client-connect/src/commands/StartOutboundVoiceContactCommand.ts similarity index 100% rename from clients/client-connect/commands/StartOutboundVoiceContactCommand.ts rename to clients/client-connect/src/commands/StartOutboundVoiceContactCommand.ts diff --git a/clients/client-connect/commands/StartTaskContactCommand.ts b/clients/client-connect/src/commands/StartTaskContactCommand.ts similarity index 100% rename from clients/client-connect/commands/StartTaskContactCommand.ts rename to clients/client-connect/src/commands/StartTaskContactCommand.ts diff --git a/clients/client-connect/commands/StopContactCommand.ts b/clients/client-connect/src/commands/StopContactCommand.ts similarity index 100% rename from clients/client-connect/commands/StopContactCommand.ts rename to clients/client-connect/src/commands/StopContactCommand.ts diff --git a/clients/client-connect/commands/StopContactRecordingCommand.ts b/clients/client-connect/src/commands/StopContactRecordingCommand.ts similarity index 100% rename from clients/client-connect/commands/StopContactRecordingCommand.ts rename to clients/client-connect/src/commands/StopContactRecordingCommand.ts diff --git a/clients/client-connect/commands/SuspendContactRecordingCommand.ts b/clients/client-connect/src/commands/SuspendContactRecordingCommand.ts similarity index 100% rename from clients/client-connect/commands/SuspendContactRecordingCommand.ts rename to clients/client-connect/src/commands/SuspendContactRecordingCommand.ts diff --git a/clients/client-connect/commands/TagResourceCommand.ts b/clients/client-connect/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-connect/commands/TagResourceCommand.ts rename to clients/client-connect/src/commands/TagResourceCommand.ts diff --git a/clients/client-connect/commands/UntagResourceCommand.ts b/clients/client-connect/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-connect/commands/UntagResourceCommand.ts rename to clients/client-connect/src/commands/UntagResourceCommand.ts diff --git a/clients/client-connect/commands/UpdateAgentStatusCommand.ts b/clients/client-connect/src/commands/UpdateAgentStatusCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateAgentStatusCommand.ts rename to clients/client-connect/src/commands/UpdateAgentStatusCommand.ts diff --git a/clients/client-connect/commands/UpdateContactAttributesCommand.ts b/clients/client-connect/src/commands/UpdateContactAttributesCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateContactAttributesCommand.ts rename to clients/client-connect/src/commands/UpdateContactAttributesCommand.ts diff --git a/clients/client-connect/commands/UpdateContactFlowContentCommand.ts b/clients/client-connect/src/commands/UpdateContactFlowContentCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateContactFlowContentCommand.ts rename to clients/client-connect/src/commands/UpdateContactFlowContentCommand.ts diff --git a/clients/client-connect/commands/UpdateContactFlowNameCommand.ts b/clients/client-connect/src/commands/UpdateContactFlowNameCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateContactFlowNameCommand.ts rename to clients/client-connect/src/commands/UpdateContactFlowNameCommand.ts diff --git a/clients/client-connect/commands/UpdateHoursOfOperationCommand.ts b/clients/client-connect/src/commands/UpdateHoursOfOperationCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateHoursOfOperationCommand.ts rename to clients/client-connect/src/commands/UpdateHoursOfOperationCommand.ts diff --git a/clients/client-connect/commands/UpdateInstanceAttributeCommand.ts b/clients/client-connect/src/commands/UpdateInstanceAttributeCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateInstanceAttributeCommand.ts rename to clients/client-connect/src/commands/UpdateInstanceAttributeCommand.ts diff --git a/clients/client-connect/commands/UpdateInstanceStorageConfigCommand.ts b/clients/client-connect/src/commands/UpdateInstanceStorageConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateInstanceStorageConfigCommand.ts rename to clients/client-connect/src/commands/UpdateInstanceStorageConfigCommand.ts diff --git a/clients/client-connect/commands/UpdateQueueHoursOfOperationCommand.ts b/clients/client-connect/src/commands/UpdateQueueHoursOfOperationCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQueueHoursOfOperationCommand.ts rename to clients/client-connect/src/commands/UpdateQueueHoursOfOperationCommand.ts diff --git a/clients/client-connect/commands/UpdateQueueMaxContactsCommand.ts b/clients/client-connect/src/commands/UpdateQueueMaxContactsCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQueueMaxContactsCommand.ts rename to clients/client-connect/src/commands/UpdateQueueMaxContactsCommand.ts diff --git a/clients/client-connect/commands/UpdateQueueNameCommand.ts b/clients/client-connect/src/commands/UpdateQueueNameCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQueueNameCommand.ts rename to clients/client-connect/src/commands/UpdateQueueNameCommand.ts diff --git a/clients/client-connect/commands/UpdateQueueOutboundCallerConfigCommand.ts b/clients/client-connect/src/commands/UpdateQueueOutboundCallerConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQueueOutboundCallerConfigCommand.ts rename to clients/client-connect/src/commands/UpdateQueueOutboundCallerConfigCommand.ts diff --git a/clients/client-connect/commands/UpdateQueueStatusCommand.ts b/clients/client-connect/src/commands/UpdateQueueStatusCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQueueStatusCommand.ts rename to clients/client-connect/src/commands/UpdateQueueStatusCommand.ts diff --git a/clients/client-connect/commands/UpdateQuickConnectConfigCommand.ts b/clients/client-connect/src/commands/UpdateQuickConnectConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQuickConnectConfigCommand.ts rename to clients/client-connect/src/commands/UpdateQuickConnectConfigCommand.ts diff --git a/clients/client-connect/commands/UpdateQuickConnectNameCommand.ts b/clients/client-connect/src/commands/UpdateQuickConnectNameCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateQuickConnectNameCommand.ts rename to clients/client-connect/src/commands/UpdateQuickConnectNameCommand.ts diff --git a/clients/client-connect/commands/UpdateRoutingProfileConcurrencyCommand.ts b/clients/client-connect/src/commands/UpdateRoutingProfileConcurrencyCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateRoutingProfileConcurrencyCommand.ts rename to clients/client-connect/src/commands/UpdateRoutingProfileConcurrencyCommand.ts diff --git a/clients/client-connect/commands/UpdateRoutingProfileDefaultOutboundQueueCommand.ts b/clients/client-connect/src/commands/UpdateRoutingProfileDefaultOutboundQueueCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateRoutingProfileDefaultOutboundQueueCommand.ts rename to clients/client-connect/src/commands/UpdateRoutingProfileDefaultOutboundQueueCommand.ts diff --git a/clients/client-connect/commands/UpdateRoutingProfileNameCommand.ts b/clients/client-connect/src/commands/UpdateRoutingProfileNameCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateRoutingProfileNameCommand.ts rename to clients/client-connect/src/commands/UpdateRoutingProfileNameCommand.ts diff --git a/clients/client-connect/commands/UpdateRoutingProfileQueuesCommand.ts b/clients/client-connect/src/commands/UpdateRoutingProfileQueuesCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateRoutingProfileQueuesCommand.ts rename to clients/client-connect/src/commands/UpdateRoutingProfileQueuesCommand.ts diff --git a/clients/client-connect/commands/UpdateUserHierarchyCommand.ts b/clients/client-connect/src/commands/UpdateUserHierarchyCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserHierarchyCommand.ts rename to clients/client-connect/src/commands/UpdateUserHierarchyCommand.ts diff --git a/clients/client-connect/commands/UpdateUserHierarchyGroupNameCommand.ts b/clients/client-connect/src/commands/UpdateUserHierarchyGroupNameCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserHierarchyGroupNameCommand.ts rename to clients/client-connect/src/commands/UpdateUserHierarchyGroupNameCommand.ts diff --git a/clients/client-connect/commands/UpdateUserHierarchyStructureCommand.ts b/clients/client-connect/src/commands/UpdateUserHierarchyStructureCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserHierarchyStructureCommand.ts rename to clients/client-connect/src/commands/UpdateUserHierarchyStructureCommand.ts diff --git a/clients/client-connect/commands/UpdateUserIdentityInfoCommand.ts b/clients/client-connect/src/commands/UpdateUserIdentityInfoCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserIdentityInfoCommand.ts rename to clients/client-connect/src/commands/UpdateUserIdentityInfoCommand.ts diff --git a/clients/client-connect/commands/UpdateUserPhoneConfigCommand.ts b/clients/client-connect/src/commands/UpdateUserPhoneConfigCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserPhoneConfigCommand.ts rename to clients/client-connect/src/commands/UpdateUserPhoneConfigCommand.ts diff --git a/clients/client-connect/commands/UpdateUserRoutingProfileCommand.ts b/clients/client-connect/src/commands/UpdateUserRoutingProfileCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserRoutingProfileCommand.ts rename to clients/client-connect/src/commands/UpdateUserRoutingProfileCommand.ts diff --git a/clients/client-connect/commands/UpdateUserSecurityProfilesCommand.ts b/clients/client-connect/src/commands/UpdateUserSecurityProfilesCommand.ts similarity index 100% rename from clients/client-connect/commands/UpdateUserSecurityProfilesCommand.ts rename to clients/client-connect/src/commands/UpdateUserSecurityProfilesCommand.ts diff --git a/clients/client-connect/endpoints.ts b/clients/client-connect/src/endpoints.ts similarity index 100% rename from clients/client-connect/endpoints.ts rename to clients/client-connect/src/endpoints.ts diff --git a/clients/client-connect/index.ts b/clients/client-connect/src/index.ts similarity index 100% rename from clients/client-connect/index.ts rename to clients/client-connect/src/index.ts diff --git a/clients/client-connect/models/index.ts b/clients/client-connect/src/models/index.ts similarity index 100% rename from clients/client-connect/models/index.ts rename to clients/client-connect/src/models/index.ts diff --git a/clients/client-connect/models/models_0.ts b/clients/client-connect/src/models/models_0.ts similarity index 100% rename from clients/client-connect/models/models_0.ts rename to clients/client-connect/src/models/models_0.ts diff --git a/clients/client-connect/pagination/GetCurrentMetricDataPaginator.ts b/clients/client-connect/src/pagination/GetCurrentMetricDataPaginator.ts similarity index 100% rename from clients/client-connect/pagination/GetCurrentMetricDataPaginator.ts rename to clients/client-connect/src/pagination/GetCurrentMetricDataPaginator.ts diff --git a/clients/client-connect/pagination/GetMetricDataPaginator.ts b/clients/client-connect/src/pagination/GetMetricDataPaginator.ts similarity index 100% rename from clients/client-connect/pagination/GetMetricDataPaginator.ts rename to clients/client-connect/src/pagination/GetMetricDataPaginator.ts diff --git a/clients/client-connect/pagination/Interfaces.ts b/clients/client-connect/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-connect/pagination/Interfaces.ts rename to clients/client-connect/src/pagination/Interfaces.ts diff --git a/clients/client-connect/pagination/ListAgentStatusesPaginator.ts b/clients/client-connect/src/pagination/ListAgentStatusesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListAgentStatusesPaginator.ts rename to clients/client-connect/src/pagination/ListAgentStatusesPaginator.ts diff --git a/clients/client-connect/pagination/ListApprovedOriginsPaginator.ts b/clients/client-connect/src/pagination/ListApprovedOriginsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListApprovedOriginsPaginator.ts rename to clients/client-connect/src/pagination/ListApprovedOriginsPaginator.ts diff --git a/clients/client-connect/pagination/ListBotsPaginator.ts b/clients/client-connect/src/pagination/ListBotsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListBotsPaginator.ts rename to clients/client-connect/src/pagination/ListBotsPaginator.ts diff --git a/clients/client-connect/pagination/ListContactFlowsPaginator.ts b/clients/client-connect/src/pagination/ListContactFlowsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListContactFlowsPaginator.ts rename to clients/client-connect/src/pagination/ListContactFlowsPaginator.ts diff --git a/clients/client-connect/pagination/ListHoursOfOperationsPaginator.ts b/clients/client-connect/src/pagination/ListHoursOfOperationsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListHoursOfOperationsPaginator.ts rename to clients/client-connect/src/pagination/ListHoursOfOperationsPaginator.ts diff --git a/clients/client-connect/pagination/ListInstanceAttributesPaginator.ts b/clients/client-connect/src/pagination/ListInstanceAttributesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListInstanceAttributesPaginator.ts rename to clients/client-connect/src/pagination/ListInstanceAttributesPaginator.ts diff --git a/clients/client-connect/pagination/ListInstanceStorageConfigsPaginator.ts b/clients/client-connect/src/pagination/ListInstanceStorageConfigsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListInstanceStorageConfigsPaginator.ts rename to clients/client-connect/src/pagination/ListInstanceStorageConfigsPaginator.ts diff --git a/clients/client-connect/pagination/ListInstancesPaginator.ts b/clients/client-connect/src/pagination/ListInstancesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListInstancesPaginator.ts rename to clients/client-connect/src/pagination/ListInstancesPaginator.ts diff --git a/clients/client-connect/pagination/ListIntegrationAssociationsPaginator.ts b/clients/client-connect/src/pagination/ListIntegrationAssociationsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListIntegrationAssociationsPaginator.ts rename to clients/client-connect/src/pagination/ListIntegrationAssociationsPaginator.ts diff --git a/clients/client-connect/pagination/ListLambdaFunctionsPaginator.ts b/clients/client-connect/src/pagination/ListLambdaFunctionsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListLambdaFunctionsPaginator.ts rename to clients/client-connect/src/pagination/ListLambdaFunctionsPaginator.ts diff --git a/clients/client-connect/pagination/ListLexBotsPaginator.ts b/clients/client-connect/src/pagination/ListLexBotsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListLexBotsPaginator.ts rename to clients/client-connect/src/pagination/ListLexBotsPaginator.ts diff --git a/clients/client-connect/pagination/ListPhoneNumbersPaginator.ts b/clients/client-connect/src/pagination/ListPhoneNumbersPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListPhoneNumbersPaginator.ts rename to clients/client-connect/src/pagination/ListPhoneNumbersPaginator.ts diff --git a/clients/client-connect/pagination/ListPromptsPaginator.ts b/clients/client-connect/src/pagination/ListPromptsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListPromptsPaginator.ts rename to clients/client-connect/src/pagination/ListPromptsPaginator.ts diff --git a/clients/client-connect/pagination/ListQueueQuickConnectsPaginator.ts b/clients/client-connect/src/pagination/ListQueueQuickConnectsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListQueueQuickConnectsPaginator.ts rename to clients/client-connect/src/pagination/ListQueueQuickConnectsPaginator.ts diff --git a/clients/client-connect/pagination/ListQueuesPaginator.ts b/clients/client-connect/src/pagination/ListQueuesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListQueuesPaginator.ts rename to clients/client-connect/src/pagination/ListQueuesPaginator.ts diff --git a/clients/client-connect/pagination/ListQuickConnectsPaginator.ts b/clients/client-connect/src/pagination/ListQuickConnectsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListQuickConnectsPaginator.ts rename to clients/client-connect/src/pagination/ListQuickConnectsPaginator.ts diff --git a/clients/client-connect/pagination/ListRoutingProfileQueuesPaginator.ts b/clients/client-connect/src/pagination/ListRoutingProfileQueuesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListRoutingProfileQueuesPaginator.ts rename to clients/client-connect/src/pagination/ListRoutingProfileQueuesPaginator.ts diff --git a/clients/client-connect/pagination/ListRoutingProfilesPaginator.ts b/clients/client-connect/src/pagination/ListRoutingProfilesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListRoutingProfilesPaginator.ts rename to clients/client-connect/src/pagination/ListRoutingProfilesPaginator.ts diff --git a/clients/client-connect/pagination/ListSecurityKeysPaginator.ts b/clients/client-connect/src/pagination/ListSecurityKeysPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListSecurityKeysPaginator.ts rename to clients/client-connect/src/pagination/ListSecurityKeysPaginator.ts diff --git a/clients/client-connect/pagination/ListSecurityProfilesPaginator.ts b/clients/client-connect/src/pagination/ListSecurityProfilesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListSecurityProfilesPaginator.ts rename to clients/client-connect/src/pagination/ListSecurityProfilesPaginator.ts diff --git a/clients/client-connect/pagination/ListUseCasesPaginator.ts b/clients/client-connect/src/pagination/ListUseCasesPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListUseCasesPaginator.ts rename to clients/client-connect/src/pagination/ListUseCasesPaginator.ts diff --git a/clients/client-connect/pagination/ListUserHierarchyGroupsPaginator.ts b/clients/client-connect/src/pagination/ListUserHierarchyGroupsPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListUserHierarchyGroupsPaginator.ts rename to clients/client-connect/src/pagination/ListUserHierarchyGroupsPaginator.ts diff --git a/clients/client-connect/pagination/ListUsersPaginator.ts b/clients/client-connect/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-connect/pagination/ListUsersPaginator.ts rename to clients/client-connect/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-connect/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-connect/protocols/Aws_restJson1.ts rename to clients/client-connect/src/protocols/Aws_restJson1.ts diff --git a/clients/client-connect/src/runtimeConfig.browser.ts b/clients/client-connect/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..75be2c462381 --- /dev/null +++ b/clients/client-connect/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ConnectClientConfig } from "./ConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connect/runtimeConfig.native.ts b/clients/client-connect/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-connect/runtimeConfig.native.ts rename to clients/client-connect/src/runtimeConfig.native.ts diff --git a/clients/client-connect/runtimeConfig.shared.ts b/clients/client-connect/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-connect/runtimeConfig.shared.ts rename to clients/client-connect/src/runtimeConfig.shared.ts diff --git a/clients/client-connect/src/runtimeConfig.ts b/clients/client-connect/src/runtimeConfig.ts new file mode 100644 index 000000000000..ca17f336423b --- /dev/null +++ b/clients/client-connect/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ConnectClientConfig } from "./ConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connect/tsconfig.es.json b/clients/client-connect/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-connect/tsconfig.es.json +++ b/clients/client-connect/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-connect/tsconfig.json b/clients/client-connect/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-connect/tsconfig.json +++ b/clients/client-connect/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-connect/tsconfig.types.json b/clients/client-connect/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-connect/tsconfig.types.json +++ b/clients/client-connect/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-connectparticipant/.gitignore b/clients/client-connectparticipant/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-connectparticipant/.gitignore +++ b/clients/client-connectparticipant/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-connectparticipant/package.json b/clients/client-connectparticipant/package.json index bd0685a7f5fd..b1bc037c4454 100644 --- a/clients/client-connectparticipant/package.json +++ b/clients/client-connectparticipant/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-connectparticipant", "repository": { "type": "git", diff --git a/clients/client-connectparticipant/runtimeConfig.browser.ts b/clients/client-connectparticipant/runtimeConfig.browser.ts deleted file mode 100644 index 129675c1a8c4..000000000000 --- a/clients/client-connectparticipant/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ConnectParticipantClientConfig } from "./ConnectParticipantClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connectparticipant/runtimeConfig.ts b/clients/client-connectparticipant/runtimeConfig.ts deleted file mode 100644 index bc3310f34131..000000000000 --- a/clients/client-connectparticipant/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ConnectParticipantClientConfig } from "./ConnectParticipantClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-connectparticipant/ConnectParticipant.ts b/clients/client-connectparticipant/src/ConnectParticipant.ts similarity index 100% rename from clients/client-connectparticipant/ConnectParticipant.ts rename to clients/client-connectparticipant/src/ConnectParticipant.ts diff --git a/clients/client-connectparticipant/ConnectParticipantClient.ts b/clients/client-connectparticipant/src/ConnectParticipantClient.ts similarity index 100% rename from clients/client-connectparticipant/ConnectParticipantClient.ts rename to clients/client-connectparticipant/src/ConnectParticipantClient.ts diff --git a/clients/client-connectparticipant/commands/CompleteAttachmentUploadCommand.ts b/clients/client-connectparticipant/src/commands/CompleteAttachmentUploadCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/CompleteAttachmentUploadCommand.ts rename to clients/client-connectparticipant/src/commands/CompleteAttachmentUploadCommand.ts diff --git a/clients/client-connectparticipant/commands/CreateParticipantConnectionCommand.ts b/clients/client-connectparticipant/src/commands/CreateParticipantConnectionCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/CreateParticipantConnectionCommand.ts rename to clients/client-connectparticipant/src/commands/CreateParticipantConnectionCommand.ts diff --git a/clients/client-connectparticipant/commands/DisconnectParticipantCommand.ts b/clients/client-connectparticipant/src/commands/DisconnectParticipantCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/DisconnectParticipantCommand.ts rename to clients/client-connectparticipant/src/commands/DisconnectParticipantCommand.ts diff --git a/clients/client-connectparticipant/commands/GetAttachmentCommand.ts b/clients/client-connectparticipant/src/commands/GetAttachmentCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/GetAttachmentCommand.ts rename to clients/client-connectparticipant/src/commands/GetAttachmentCommand.ts diff --git a/clients/client-connectparticipant/commands/GetTranscriptCommand.ts b/clients/client-connectparticipant/src/commands/GetTranscriptCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/GetTranscriptCommand.ts rename to clients/client-connectparticipant/src/commands/GetTranscriptCommand.ts diff --git a/clients/client-connectparticipant/commands/SendEventCommand.ts b/clients/client-connectparticipant/src/commands/SendEventCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/SendEventCommand.ts rename to clients/client-connectparticipant/src/commands/SendEventCommand.ts diff --git a/clients/client-connectparticipant/commands/SendMessageCommand.ts b/clients/client-connectparticipant/src/commands/SendMessageCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/SendMessageCommand.ts rename to clients/client-connectparticipant/src/commands/SendMessageCommand.ts diff --git a/clients/client-connectparticipant/commands/StartAttachmentUploadCommand.ts b/clients/client-connectparticipant/src/commands/StartAttachmentUploadCommand.ts similarity index 100% rename from clients/client-connectparticipant/commands/StartAttachmentUploadCommand.ts rename to clients/client-connectparticipant/src/commands/StartAttachmentUploadCommand.ts diff --git a/clients/client-connectparticipant/endpoints.ts b/clients/client-connectparticipant/src/endpoints.ts similarity index 100% rename from clients/client-connectparticipant/endpoints.ts rename to clients/client-connectparticipant/src/endpoints.ts diff --git a/clients/client-connectparticipant/index.ts b/clients/client-connectparticipant/src/index.ts similarity index 100% rename from clients/client-connectparticipant/index.ts rename to clients/client-connectparticipant/src/index.ts diff --git a/clients/client-connectparticipant/models/index.ts b/clients/client-connectparticipant/src/models/index.ts similarity index 100% rename from clients/client-connectparticipant/models/index.ts rename to clients/client-connectparticipant/src/models/index.ts diff --git a/clients/client-connectparticipant/models/models_0.ts b/clients/client-connectparticipant/src/models/models_0.ts similarity index 100% rename from clients/client-connectparticipant/models/models_0.ts rename to clients/client-connectparticipant/src/models/models_0.ts diff --git a/clients/client-connectparticipant/pagination/GetTranscriptPaginator.ts b/clients/client-connectparticipant/src/pagination/GetTranscriptPaginator.ts similarity index 100% rename from clients/client-connectparticipant/pagination/GetTranscriptPaginator.ts rename to clients/client-connectparticipant/src/pagination/GetTranscriptPaginator.ts diff --git a/clients/client-connectparticipant/pagination/Interfaces.ts b/clients/client-connectparticipant/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-connectparticipant/pagination/Interfaces.ts rename to clients/client-connectparticipant/src/pagination/Interfaces.ts diff --git a/clients/client-connectparticipant/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-connectparticipant/protocols/Aws_restJson1.ts rename to clients/client-connectparticipant/src/protocols/Aws_restJson1.ts diff --git a/clients/client-connectparticipant/src/runtimeConfig.browser.ts b/clients/client-connectparticipant/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a5140d69bd50 --- /dev/null +++ b/clients/client-connectparticipant/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ConnectParticipantClientConfig } from "./ConnectParticipantClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connectparticipant/runtimeConfig.native.ts b/clients/client-connectparticipant/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-connectparticipant/runtimeConfig.native.ts rename to clients/client-connectparticipant/src/runtimeConfig.native.ts diff --git a/clients/client-connectparticipant/runtimeConfig.shared.ts b/clients/client-connectparticipant/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-connectparticipant/runtimeConfig.shared.ts rename to clients/client-connectparticipant/src/runtimeConfig.shared.ts diff --git a/clients/client-connectparticipant/src/runtimeConfig.ts b/clients/client-connectparticipant/src/runtimeConfig.ts new file mode 100644 index 000000000000..6ae82c4d1a5b --- /dev/null +++ b/clients/client-connectparticipant/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ConnectParticipantClientConfig } from "./ConnectParticipantClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-connectparticipant/tsconfig.es.json b/clients/client-connectparticipant/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-connectparticipant/tsconfig.es.json +++ b/clients/client-connectparticipant/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-connectparticipant/tsconfig.json b/clients/client-connectparticipant/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-connectparticipant/tsconfig.json +++ b/clients/client-connectparticipant/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-connectparticipant/tsconfig.types.json b/clients/client-connectparticipant/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-connectparticipant/tsconfig.types.json +++ b/clients/client-connectparticipant/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cost-and-usage-report-service/.gitignore b/clients/client-cost-and-usage-report-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cost-and-usage-report-service/.gitignore +++ b/clients/client-cost-and-usage-report-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cost-and-usage-report-service/package.json b/clients/client-cost-and-usage-report-service/package.json index 6b015465a270..90517bf0fe11 100644 --- a/clients/client-cost-and-usage-report-service/package.json +++ b/clients/client-cost-and-usage-report-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cost-and-usage-report-service", "repository": { "type": "git", diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts deleted file mode 100644 index 1bc2fae61833..000000000000 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CostAndUsageReportServiceClientConfig } from "./CostAndUsageReportServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/runtimeConfig.ts deleted file mode 100644 index 8298481d9e4a..000000000000 --- a/clients/client-cost-and-usage-report-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CostAndUsageReportServiceClientConfig } from "./CostAndUsageReportServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cost-and-usage-report-service/CostAndUsageReportService.ts b/clients/client-cost-and-usage-report-service/src/CostAndUsageReportService.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/CostAndUsageReportService.ts rename to clients/client-cost-and-usage-report-service/src/CostAndUsageReportService.ts diff --git a/clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts b/clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/CostAndUsageReportServiceClient.ts rename to clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts diff --git a/clients/client-cost-and-usage-report-service/commands/DeleteReportDefinitionCommand.ts b/clients/client-cost-and-usage-report-service/src/commands/DeleteReportDefinitionCommand.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/commands/DeleteReportDefinitionCommand.ts rename to clients/client-cost-and-usage-report-service/src/commands/DeleteReportDefinitionCommand.ts diff --git a/clients/client-cost-and-usage-report-service/commands/DescribeReportDefinitionsCommand.ts b/clients/client-cost-and-usage-report-service/src/commands/DescribeReportDefinitionsCommand.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/commands/DescribeReportDefinitionsCommand.ts rename to clients/client-cost-and-usage-report-service/src/commands/DescribeReportDefinitionsCommand.ts diff --git a/clients/client-cost-and-usage-report-service/commands/ModifyReportDefinitionCommand.ts b/clients/client-cost-and-usage-report-service/src/commands/ModifyReportDefinitionCommand.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/commands/ModifyReportDefinitionCommand.ts rename to clients/client-cost-and-usage-report-service/src/commands/ModifyReportDefinitionCommand.ts diff --git a/clients/client-cost-and-usage-report-service/commands/PutReportDefinitionCommand.ts b/clients/client-cost-and-usage-report-service/src/commands/PutReportDefinitionCommand.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/commands/PutReportDefinitionCommand.ts rename to clients/client-cost-and-usage-report-service/src/commands/PutReportDefinitionCommand.ts diff --git a/clients/client-cost-and-usage-report-service/endpoints.ts b/clients/client-cost-and-usage-report-service/src/endpoints.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/endpoints.ts rename to clients/client-cost-and-usage-report-service/src/endpoints.ts diff --git a/clients/client-cost-and-usage-report-service/index.ts b/clients/client-cost-and-usage-report-service/src/index.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/index.ts rename to clients/client-cost-and-usage-report-service/src/index.ts diff --git a/clients/client-cost-and-usage-report-service/models/index.ts b/clients/client-cost-and-usage-report-service/src/models/index.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/models/index.ts rename to clients/client-cost-and-usage-report-service/src/models/index.ts diff --git a/clients/client-cost-and-usage-report-service/models/models_0.ts b/clients/client-cost-and-usage-report-service/src/models/models_0.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/models/models_0.ts rename to clients/client-cost-and-usage-report-service/src/models/models_0.ts diff --git a/clients/client-cost-and-usage-report-service/pagination/DescribeReportDefinitionsPaginator.ts b/clients/client-cost-and-usage-report-service/src/pagination/DescribeReportDefinitionsPaginator.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/pagination/DescribeReportDefinitionsPaginator.ts rename to clients/client-cost-and-usage-report-service/src/pagination/DescribeReportDefinitionsPaginator.ts diff --git a/clients/client-cost-and-usage-report-service/pagination/Interfaces.ts b/clients/client-cost-and-usage-report-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/pagination/Interfaces.ts rename to clients/client-cost-and-usage-report-service/src/pagination/Interfaces.ts diff --git a/clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/protocols/Aws_json1_1.ts rename to clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cost-and-usage-report-service/src/runtimeConfig.browser.ts b/clients/client-cost-and-usage-report-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..05ed2c4bc374 --- /dev/null +++ b/clients/client-cost-and-usage-report-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CostAndUsageReportServiceClientConfig } from "./CostAndUsageReportServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.native.ts b/clients/client-cost-and-usage-report-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/runtimeConfig.native.ts rename to clients/client-cost-and-usage-report-service/src/runtimeConfig.native.ts diff --git a/clients/client-cost-and-usage-report-service/runtimeConfig.shared.ts b/clients/client-cost-and-usage-report-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cost-and-usage-report-service/runtimeConfig.shared.ts rename to clients/client-cost-and-usage-report-service/src/runtimeConfig.shared.ts diff --git a/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..f5733df14108 --- /dev/null +++ b/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CostAndUsageReportServiceClientConfig } from "./CostAndUsageReportServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cost-and-usage-report-service/tsconfig.es.json b/clients/client-cost-and-usage-report-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cost-and-usage-report-service/tsconfig.es.json +++ b/clients/client-cost-and-usage-report-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cost-and-usage-report-service/tsconfig.json b/clients/client-cost-and-usage-report-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cost-and-usage-report-service/tsconfig.json +++ b/clients/client-cost-and-usage-report-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cost-and-usage-report-service/tsconfig.types.json b/clients/client-cost-and-usage-report-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cost-and-usage-report-service/tsconfig.types.json +++ b/clients/client-cost-and-usage-report-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-cost-explorer/.gitignore b/clients/client-cost-explorer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-cost-explorer/.gitignore +++ b/clients/client-cost-explorer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-cost-explorer/package.json b/clients/client-cost-explorer/package.json index 9dcdfb299d89..ed4174d6f02c 100644 --- a/clients/client-cost-explorer/package.json +++ b/clients/client-cost-explorer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cost-explorer", "repository": { "type": "git", diff --git a/clients/client-cost-explorer/runtimeConfig.browser.ts b/clients/client-cost-explorer/runtimeConfig.browser.ts deleted file mode 100644 index 52ff59bee371..000000000000 --- a/clients/client-cost-explorer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CostExplorerClientConfig } from "./CostExplorerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CostExplorerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cost-explorer/runtimeConfig.ts b/clients/client-cost-explorer/runtimeConfig.ts deleted file mode 100644 index 1b5bba3a9940..000000000000 --- a/clients/client-cost-explorer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CostExplorerClientConfig } from "./CostExplorerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CostExplorerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-cost-explorer/CostExplorer.ts b/clients/client-cost-explorer/src/CostExplorer.ts similarity index 100% rename from clients/client-cost-explorer/CostExplorer.ts rename to clients/client-cost-explorer/src/CostExplorer.ts diff --git a/clients/client-cost-explorer/CostExplorerClient.ts b/clients/client-cost-explorer/src/CostExplorerClient.ts similarity index 100% rename from clients/client-cost-explorer/CostExplorerClient.ts rename to clients/client-cost-explorer/src/CostExplorerClient.ts diff --git a/clients/client-cost-explorer/commands/CreateAnomalyMonitorCommand.ts b/clients/client-cost-explorer/src/commands/CreateAnomalyMonitorCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/CreateAnomalyMonitorCommand.ts rename to clients/client-cost-explorer/src/commands/CreateAnomalyMonitorCommand.ts diff --git a/clients/client-cost-explorer/commands/CreateAnomalySubscriptionCommand.ts b/clients/client-cost-explorer/src/commands/CreateAnomalySubscriptionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/CreateAnomalySubscriptionCommand.ts rename to clients/client-cost-explorer/src/commands/CreateAnomalySubscriptionCommand.ts diff --git a/clients/client-cost-explorer/commands/CreateCostCategoryDefinitionCommand.ts b/clients/client-cost-explorer/src/commands/CreateCostCategoryDefinitionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/CreateCostCategoryDefinitionCommand.ts rename to clients/client-cost-explorer/src/commands/CreateCostCategoryDefinitionCommand.ts diff --git a/clients/client-cost-explorer/commands/DeleteAnomalyMonitorCommand.ts b/clients/client-cost-explorer/src/commands/DeleteAnomalyMonitorCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/DeleteAnomalyMonitorCommand.ts rename to clients/client-cost-explorer/src/commands/DeleteAnomalyMonitorCommand.ts diff --git a/clients/client-cost-explorer/commands/DeleteAnomalySubscriptionCommand.ts b/clients/client-cost-explorer/src/commands/DeleteAnomalySubscriptionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/DeleteAnomalySubscriptionCommand.ts rename to clients/client-cost-explorer/src/commands/DeleteAnomalySubscriptionCommand.ts diff --git a/clients/client-cost-explorer/commands/DeleteCostCategoryDefinitionCommand.ts b/clients/client-cost-explorer/src/commands/DeleteCostCategoryDefinitionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/DeleteCostCategoryDefinitionCommand.ts rename to clients/client-cost-explorer/src/commands/DeleteCostCategoryDefinitionCommand.ts diff --git a/clients/client-cost-explorer/commands/DescribeCostCategoryDefinitionCommand.ts b/clients/client-cost-explorer/src/commands/DescribeCostCategoryDefinitionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/DescribeCostCategoryDefinitionCommand.ts rename to clients/client-cost-explorer/src/commands/DescribeCostCategoryDefinitionCommand.ts diff --git a/clients/client-cost-explorer/commands/GetAnomaliesCommand.ts b/clients/client-cost-explorer/src/commands/GetAnomaliesCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetAnomaliesCommand.ts rename to clients/client-cost-explorer/src/commands/GetAnomaliesCommand.ts diff --git a/clients/client-cost-explorer/commands/GetAnomalyMonitorsCommand.ts b/clients/client-cost-explorer/src/commands/GetAnomalyMonitorsCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetAnomalyMonitorsCommand.ts rename to clients/client-cost-explorer/src/commands/GetAnomalyMonitorsCommand.ts diff --git a/clients/client-cost-explorer/commands/GetAnomalySubscriptionsCommand.ts b/clients/client-cost-explorer/src/commands/GetAnomalySubscriptionsCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetAnomalySubscriptionsCommand.ts rename to clients/client-cost-explorer/src/commands/GetAnomalySubscriptionsCommand.ts diff --git a/clients/client-cost-explorer/commands/GetCostAndUsageCommand.ts b/clients/client-cost-explorer/src/commands/GetCostAndUsageCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetCostAndUsageCommand.ts rename to clients/client-cost-explorer/src/commands/GetCostAndUsageCommand.ts diff --git a/clients/client-cost-explorer/commands/GetCostAndUsageWithResourcesCommand.ts b/clients/client-cost-explorer/src/commands/GetCostAndUsageWithResourcesCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetCostAndUsageWithResourcesCommand.ts rename to clients/client-cost-explorer/src/commands/GetCostAndUsageWithResourcesCommand.ts diff --git a/clients/client-cost-explorer/commands/GetCostCategoriesCommand.ts b/clients/client-cost-explorer/src/commands/GetCostCategoriesCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetCostCategoriesCommand.ts rename to clients/client-cost-explorer/src/commands/GetCostCategoriesCommand.ts diff --git a/clients/client-cost-explorer/commands/GetCostForecastCommand.ts b/clients/client-cost-explorer/src/commands/GetCostForecastCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetCostForecastCommand.ts rename to clients/client-cost-explorer/src/commands/GetCostForecastCommand.ts diff --git a/clients/client-cost-explorer/commands/GetDimensionValuesCommand.ts b/clients/client-cost-explorer/src/commands/GetDimensionValuesCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetDimensionValuesCommand.ts rename to clients/client-cost-explorer/src/commands/GetDimensionValuesCommand.ts diff --git a/clients/client-cost-explorer/commands/GetReservationCoverageCommand.ts b/clients/client-cost-explorer/src/commands/GetReservationCoverageCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetReservationCoverageCommand.ts rename to clients/client-cost-explorer/src/commands/GetReservationCoverageCommand.ts diff --git a/clients/client-cost-explorer/commands/GetReservationPurchaseRecommendationCommand.ts b/clients/client-cost-explorer/src/commands/GetReservationPurchaseRecommendationCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetReservationPurchaseRecommendationCommand.ts rename to clients/client-cost-explorer/src/commands/GetReservationPurchaseRecommendationCommand.ts diff --git a/clients/client-cost-explorer/commands/GetReservationUtilizationCommand.ts b/clients/client-cost-explorer/src/commands/GetReservationUtilizationCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetReservationUtilizationCommand.ts rename to clients/client-cost-explorer/src/commands/GetReservationUtilizationCommand.ts diff --git a/clients/client-cost-explorer/commands/GetRightsizingRecommendationCommand.ts b/clients/client-cost-explorer/src/commands/GetRightsizingRecommendationCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetRightsizingRecommendationCommand.ts rename to clients/client-cost-explorer/src/commands/GetRightsizingRecommendationCommand.ts diff --git a/clients/client-cost-explorer/commands/GetSavingsPlansCoverageCommand.ts b/clients/client-cost-explorer/src/commands/GetSavingsPlansCoverageCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetSavingsPlansCoverageCommand.ts rename to clients/client-cost-explorer/src/commands/GetSavingsPlansCoverageCommand.ts diff --git a/clients/client-cost-explorer/commands/GetSavingsPlansPurchaseRecommendationCommand.ts b/clients/client-cost-explorer/src/commands/GetSavingsPlansPurchaseRecommendationCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetSavingsPlansPurchaseRecommendationCommand.ts rename to clients/client-cost-explorer/src/commands/GetSavingsPlansPurchaseRecommendationCommand.ts diff --git a/clients/client-cost-explorer/commands/GetSavingsPlansUtilizationCommand.ts b/clients/client-cost-explorer/src/commands/GetSavingsPlansUtilizationCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetSavingsPlansUtilizationCommand.ts rename to clients/client-cost-explorer/src/commands/GetSavingsPlansUtilizationCommand.ts diff --git a/clients/client-cost-explorer/commands/GetSavingsPlansUtilizationDetailsCommand.ts b/clients/client-cost-explorer/src/commands/GetSavingsPlansUtilizationDetailsCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetSavingsPlansUtilizationDetailsCommand.ts rename to clients/client-cost-explorer/src/commands/GetSavingsPlansUtilizationDetailsCommand.ts diff --git a/clients/client-cost-explorer/commands/GetTagsCommand.ts b/clients/client-cost-explorer/src/commands/GetTagsCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetTagsCommand.ts rename to clients/client-cost-explorer/src/commands/GetTagsCommand.ts diff --git a/clients/client-cost-explorer/commands/GetUsageForecastCommand.ts b/clients/client-cost-explorer/src/commands/GetUsageForecastCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/GetUsageForecastCommand.ts rename to clients/client-cost-explorer/src/commands/GetUsageForecastCommand.ts diff --git a/clients/client-cost-explorer/commands/ListCostCategoryDefinitionsCommand.ts b/clients/client-cost-explorer/src/commands/ListCostCategoryDefinitionsCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/ListCostCategoryDefinitionsCommand.ts rename to clients/client-cost-explorer/src/commands/ListCostCategoryDefinitionsCommand.ts diff --git a/clients/client-cost-explorer/commands/ProvideAnomalyFeedbackCommand.ts b/clients/client-cost-explorer/src/commands/ProvideAnomalyFeedbackCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/ProvideAnomalyFeedbackCommand.ts rename to clients/client-cost-explorer/src/commands/ProvideAnomalyFeedbackCommand.ts diff --git a/clients/client-cost-explorer/commands/UpdateAnomalyMonitorCommand.ts b/clients/client-cost-explorer/src/commands/UpdateAnomalyMonitorCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/UpdateAnomalyMonitorCommand.ts rename to clients/client-cost-explorer/src/commands/UpdateAnomalyMonitorCommand.ts diff --git a/clients/client-cost-explorer/commands/UpdateAnomalySubscriptionCommand.ts b/clients/client-cost-explorer/src/commands/UpdateAnomalySubscriptionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/UpdateAnomalySubscriptionCommand.ts rename to clients/client-cost-explorer/src/commands/UpdateAnomalySubscriptionCommand.ts diff --git a/clients/client-cost-explorer/commands/UpdateCostCategoryDefinitionCommand.ts b/clients/client-cost-explorer/src/commands/UpdateCostCategoryDefinitionCommand.ts similarity index 100% rename from clients/client-cost-explorer/commands/UpdateCostCategoryDefinitionCommand.ts rename to clients/client-cost-explorer/src/commands/UpdateCostCategoryDefinitionCommand.ts diff --git a/clients/client-cost-explorer/endpoints.ts b/clients/client-cost-explorer/src/endpoints.ts similarity index 100% rename from clients/client-cost-explorer/endpoints.ts rename to clients/client-cost-explorer/src/endpoints.ts diff --git a/clients/client-cost-explorer/index.ts b/clients/client-cost-explorer/src/index.ts similarity index 100% rename from clients/client-cost-explorer/index.ts rename to clients/client-cost-explorer/src/index.ts diff --git a/clients/client-cost-explorer/models/index.ts b/clients/client-cost-explorer/src/models/index.ts similarity index 100% rename from clients/client-cost-explorer/models/index.ts rename to clients/client-cost-explorer/src/models/index.ts diff --git a/clients/client-cost-explorer/models/models_0.ts b/clients/client-cost-explorer/src/models/models_0.ts similarity index 100% rename from clients/client-cost-explorer/models/models_0.ts rename to clients/client-cost-explorer/src/models/models_0.ts diff --git a/clients/client-cost-explorer/pagination/GetSavingsPlansCoveragePaginator.ts b/clients/client-cost-explorer/src/pagination/GetSavingsPlansCoveragePaginator.ts similarity index 100% rename from clients/client-cost-explorer/pagination/GetSavingsPlansCoveragePaginator.ts rename to clients/client-cost-explorer/src/pagination/GetSavingsPlansCoveragePaginator.ts diff --git a/clients/client-cost-explorer/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts b/clients/client-cost-explorer/src/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts similarity index 100% rename from clients/client-cost-explorer/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts rename to clients/client-cost-explorer/src/pagination/GetSavingsPlansUtilizationDetailsPaginator.ts diff --git a/clients/client-cost-explorer/pagination/Interfaces.ts b/clients/client-cost-explorer/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-cost-explorer/pagination/Interfaces.ts rename to clients/client-cost-explorer/src/pagination/Interfaces.ts diff --git a/clients/client-cost-explorer/pagination/ListCostCategoryDefinitionsPaginator.ts b/clients/client-cost-explorer/src/pagination/ListCostCategoryDefinitionsPaginator.ts similarity index 100% rename from clients/client-cost-explorer/pagination/ListCostCategoryDefinitionsPaginator.ts rename to clients/client-cost-explorer/src/pagination/ListCostCategoryDefinitionsPaginator.ts diff --git a/clients/client-cost-explorer/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-cost-explorer/protocols/Aws_json1_1.ts rename to clients/client-cost-explorer/src/protocols/Aws_json1_1.ts diff --git a/clients/client-cost-explorer/src/runtimeConfig.browser.ts b/clients/client-cost-explorer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..691f31fb7b2e --- /dev/null +++ b/clients/client-cost-explorer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CostExplorerClientConfig } from "./CostExplorerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CostExplorerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cost-explorer/runtimeConfig.native.ts b/clients/client-cost-explorer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-cost-explorer/runtimeConfig.native.ts rename to clients/client-cost-explorer/src/runtimeConfig.native.ts diff --git a/clients/client-cost-explorer/runtimeConfig.shared.ts b/clients/client-cost-explorer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-cost-explorer/runtimeConfig.shared.ts rename to clients/client-cost-explorer/src/runtimeConfig.shared.ts diff --git a/clients/client-cost-explorer/src/runtimeConfig.ts b/clients/client-cost-explorer/src/runtimeConfig.ts new file mode 100644 index 000000000000..d2069bdf1595 --- /dev/null +++ b/clients/client-cost-explorer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CostExplorerClientConfig } from "./CostExplorerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CostExplorerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-cost-explorer/tsconfig.es.json b/clients/client-cost-explorer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-cost-explorer/tsconfig.es.json +++ b/clients/client-cost-explorer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-cost-explorer/tsconfig.json b/clients/client-cost-explorer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-cost-explorer/tsconfig.json +++ b/clients/client-cost-explorer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-cost-explorer/tsconfig.types.json b/clients/client-cost-explorer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-cost-explorer/tsconfig.types.json +++ b/clients/client-cost-explorer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-customer-profiles/.gitignore b/clients/client-customer-profiles/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-customer-profiles/.gitignore +++ b/clients/client-customer-profiles/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-customer-profiles/package.json b/clients/client-customer-profiles/package.json index 8861c6c65195..4401328b0346 100644 --- a/clients/client-customer-profiles/package.json +++ b/clients/client-customer-profiles/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-customer-profiles", "repository": { "type": "git", diff --git a/clients/client-customer-profiles/runtimeConfig.browser.ts b/clients/client-customer-profiles/runtimeConfig.browser.ts deleted file mode 100644 index 98c1f5a62a51..000000000000 --- a/clients/client-customer-profiles/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { CustomerProfilesClientConfig } from "./CustomerProfilesClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-customer-profiles/runtimeConfig.ts b/clients/client-customer-profiles/runtimeConfig.ts deleted file mode 100644 index 36650a80cab3..000000000000 --- a/clients/client-customer-profiles/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { CustomerProfilesClientConfig } from "./CustomerProfilesClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-customer-profiles/CustomerProfiles.ts b/clients/client-customer-profiles/src/CustomerProfiles.ts similarity index 100% rename from clients/client-customer-profiles/CustomerProfiles.ts rename to clients/client-customer-profiles/src/CustomerProfiles.ts diff --git a/clients/client-customer-profiles/CustomerProfilesClient.ts b/clients/client-customer-profiles/src/CustomerProfilesClient.ts similarity index 100% rename from clients/client-customer-profiles/CustomerProfilesClient.ts rename to clients/client-customer-profiles/src/CustomerProfilesClient.ts diff --git a/clients/client-customer-profiles/commands/AddProfileKeyCommand.ts b/clients/client-customer-profiles/src/commands/AddProfileKeyCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/AddProfileKeyCommand.ts rename to clients/client-customer-profiles/src/commands/AddProfileKeyCommand.ts diff --git a/clients/client-customer-profiles/commands/CreateDomainCommand.ts b/clients/client-customer-profiles/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/CreateDomainCommand.ts rename to clients/client-customer-profiles/src/commands/CreateDomainCommand.ts diff --git a/clients/client-customer-profiles/commands/CreateProfileCommand.ts b/clients/client-customer-profiles/src/commands/CreateProfileCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/CreateProfileCommand.ts rename to clients/client-customer-profiles/src/commands/CreateProfileCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteDomainCommand.ts b/clients/client-customer-profiles/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteDomainCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteIntegrationCommand.ts b/clients/client-customer-profiles/src/commands/DeleteIntegrationCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteIntegrationCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteIntegrationCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteProfileCommand.ts b/clients/client-customer-profiles/src/commands/DeleteProfileCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteProfileCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteProfileCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteProfileKeyCommand.ts b/clients/client-customer-profiles/src/commands/DeleteProfileKeyCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteProfileKeyCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteProfileKeyCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteProfileObjectCommand.ts b/clients/client-customer-profiles/src/commands/DeleteProfileObjectCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteProfileObjectCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteProfileObjectCommand.ts diff --git a/clients/client-customer-profiles/commands/DeleteProfileObjectTypeCommand.ts b/clients/client-customer-profiles/src/commands/DeleteProfileObjectTypeCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/DeleteProfileObjectTypeCommand.ts rename to clients/client-customer-profiles/src/commands/DeleteProfileObjectTypeCommand.ts diff --git a/clients/client-customer-profiles/commands/GetDomainCommand.ts b/clients/client-customer-profiles/src/commands/GetDomainCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/GetDomainCommand.ts rename to clients/client-customer-profiles/src/commands/GetDomainCommand.ts diff --git a/clients/client-customer-profiles/commands/GetIntegrationCommand.ts b/clients/client-customer-profiles/src/commands/GetIntegrationCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/GetIntegrationCommand.ts rename to clients/client-customer-profiles/src/commands/GetIntegrationCommand.ts diff --git a/clients/client-customer-profiles/commands/GetMatchesCommand.ts b/clients/client-customer-profiles/src/commands/GetMatchesCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/GetMatchesCommand.ts rename to clients/client-customer-profiles/src/commands/GetMatchesCommand.ts diff --git a/clients/client-customer-profiles/commands/GetProfileObjectTypeCommand.ts b/clients/client-customer-profiles/src/commands/GetProfileObjectTypeCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/GetProfileObjectTypeCommand.ts rename to clients/client-customer-profiles/src/commands/GetProfileObjectTypeCommand.ts diff --git a/clients/client-customer-profiles/commands/GetProfileObjectTypeTemplateCommand.ts b/clients/client-customer-profiles/src/commands/GetProfileObjectTypeTemplateCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/GetProfileObjectTypeTemplateCommand.ts rename to clients/client-customer-profiles/src/commands/GetProfileObjectTypeTemplateCommand.ts diff --git a/clients/client-customer-profiles/commands/ListAccountIntegrationsCommand.ts b/clients/client-customer-profiles/src/commands/ListAccountIntegrationsCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListAccountIntegrationsCommand.ts rename to clients/client-customer-profiles/src/commands/ListAccountIntegrationsCommand.ts diff --git a/clients/client-customer-profiles/commands/ListDomainsCommand.ts b/clients/client-customer-profiles/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListDomainsCommand.ts rename to clients/client-customer-profiles/src/commands/ListDomainsCommand.ts diff --git a/clients/client-customer-profiles/commands/ListIntegrationsCommand.ts b/clients/client-customer-profiles/src/commands/ListIntegrationsCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListIntegrationsCommand.ts rename to clients/client-customer-profiles/src/commands/ListIntegrationsCommand.ts diff --git a/clients/client-customer-profiles/commands/ListProfileObjectTypeTemplatesCommand.ts b/clients/client-customer-profiles/src/commands/ListProfileObjectTypeTemplatesCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListProfileObjectTypeTemplatesCommand.ts rename to clients/client-customer-profiles/src/commands/ListProfileObjectTypeTemplatesCommand.ts diff --git a/clients/client-customer-profiles/commands/ListProfileObjectTypesCommand.ts b/clients/client-customer-profiles/src/commands/ListProfileObjectTypesCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListProfileObjectTypesCommand.ts rename to clients/client-customer-profiles/src/commands/ListProfileObjectTypesCommand.ts diff --git a/clients/client-customer-profiles/commands/ListProfileObjectsCommand.ts b/clients/client-customer-profiles/src/commands/ListProfileObjectsCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListProfileObjectsCommand.ts rename to clients/client-customer-profiles/src/commands/ListProfileObjectsCommand.ts diff --git a/clients/client-customer-profiles/commands/ListTagsForResourceCommand.ts b/clients/client-customer-profiles/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/ListTagsForResourceCommand.ts rename to clients/client-customer-profiles/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-customer-profiles/commands/MergeProfilesCommand.ts b/clients/client-customer-profiles/src/commands/MergeProfilesCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/MergeProfilesCommand.ts rename to clients/client-customer-profiles/src/commands/MergeProfilesCommand.ts diff --git a/clients/client-customer-profiles/commands/PutIntegrationCommand.ts b/clients/client-customer-profiles/src/commands/PutIntegrationCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/PutIntegrationCommand.ts rename to clients/client-customer-profiles/src/commands/PutIntegrationCommand.ts diff --git a/clients/client-customer-profiles/commands/PutProfileObjectCommand.ts b/clients/client-customer-profiles/src/commands/PutProfileObjectCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/PutProfileObjectCommand.ts rename to clients/client-customer-profiles/src/commands/PutProfileObjectCommand.ts diff --git a/clients/client-customer-profiles/commands/PutProfileObjectTypeCommand.ts b/clients/client-customer-profiles/src/commands/PutProfileObjectTypeCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/PutProfileObjectTypeCommand.ts rename to clients/client-customer-profiles/src/commands/PutProfileObjectTypeCommand.ts diff --git a/clients/client-customer-profiles/commands/SearchProfilesCommand.ts b/clients/client-customer-profiles/src/commands/SearchProfilesCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/SearchProfilesCommand.ts rename to clients/client-customer-profiles/src/commands/SearchProfilesCommand.ts diff --git a/clients/client-customer-profiles/commands/TagResourceCommand.ts b/clients/client-customer-profiles/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/TagResourceCommand.ts rename to clients/client-customer-profiles/src/commands/TagResourceCommand.ts diff --git a/clients/client-customer-profiles/commands/UntagResourceCommand.ts b/clients/client-customer-profiles/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/UntagResourceCommand.ts rename to clients/client-customer-profiles/src/commands/UntagResourceCommand.ts diff --git a/clients/client-customer-profiles/commands/UpdateDomainCommand.ts b/clients/client-customer-profiles/src/commands/UpdateDomainCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/UpdateDomainCommand.ts rename to clients/client-customer-profiles/src/commands/UpdateDomainCommand.ts diff --git a/clients/client-customer-profiles/commands/UpdateProfileCommand.ts b/clients/client-customer-profiles/src/commands/UpdateProfileCommand.ts similarity index 100% rename from clients/client-customer-profiles/commands/UpdateProfileCommand.ts rename to clients/client-customer-profiles/src/commands/UpdateProfileCommand.ts diff --git a/clients/client-customer-profiles/endpoints.ts b/clients/client-customer-profiles/src/endpoints.ts similarity index 100% rename from clients/client-customer-profiles/endpoints.ts rename to clients/client-customer-profiles/src/endpoints.ts diff --git a/clients/client-customer-profiles/index.ts b/clients/client-customer-profiles/src/index.ts similarity index 100% rename from clients/client-customer-profiles/index.ts rename to clients/client-customer-profiles/src/index.ts diff --git a/clients/client-customer-profiles/models/index.ts b/clients/client-customer-profiles/src/models/index.ts similarity index 100% rename from clients/client-customer-profiles/models/index.ts rename to clients/client-customer-profiles/src/models/index.ts diff --git a/clients/client-customer-profiles/models/models_0.ts b/clients/client-customer-profiles/src/models/models_0.ts similarity index 100% rename from clients/client-customer-profiles/models/models_0.ts rename to clients/client-customer-profiles/src/models/models_0.ts diff --git a/clients/client-customer-profiles/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-customer-profiles/protocols/Aws_restJson1.ts rename to clients/client-customer-profiles/src/protocols/Aws_restJson1.ts diff --git a/clients/client-customer-profiles/src/runtimeConfig.browser.ts b/clients/client-customer-profiles/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..8f3a517c4908 --- /dev/null +++ b/clients/client-customer-profiles/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { CustomerProfilesClientConfig } from "./CustomerProfilesClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-customer-profiles/runtimeConfig.native.ts b/clients/client-customer-profiles/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-customer-profiles/runtimeConfig.native.ts rename to clients/client-customer-profiles/src/runtimeConfig.native.ts diff --git a/clients/client-customer-profiles/runtimeConfig.shared.ts b/clients/client-customer-profiles/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-customer-profiles/runtimeConfig.shared.ts rename to clients/client-customer-profiles/src/runtimeConfig.shared.ts diff --git a/clients/client-customer-profiles/src/runtimeConfig.ts b/clients/client-customer-profiles/src/runtimeConfig.ts new file mode 100644 index 000000000000..9fbab743f275 --- /dev/null +++ b/clients/client-customer-profiles/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { CustomerProfilesClientConfig } from "./CustomerProfilesClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-customer-profiles/tsconfig.es.json b/clients/client-customer-profiles/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-customer-profiles/tsconfig.es.json +++ b/clients/client-customer-profiles/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-customer-profiles/tsconfig.json b/clients/client-customer-profiles/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-customer-profiles/tsconfig.json +++ b/clients/client-customer-profiles/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-customer-profiles/tsconfig.types.json b/clients/client-customer-profiles/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-customer-profiles/tsconfig.types.json +++ b/clients/client-customer-profiles/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-data-pipeline/.gitignore b/clients/client-data-pipeline/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-data-pipeline/.gitignore +++ b/clients/client-data-pipeline/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-data-pipeline/package.json b/clients/client-data-pipeline/package.json index 2757121a87c3..b2129bdac730 100644 --- a/clients/client-data-pipeline/package.json +++ b/clients/client-data-pipeline/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-data-pipeline", "repository": { "type": "git", diff --git a/clients/client-data-pipeline/runtimeConfig.browser.ts b/clients/client-data-pipeline/runtimeConfig.browser.ts deleted file mode 100644 index 15b57833c8b0..000000000000 --- a/clients/client-data-pipeline/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DataPipelineClientConfig } from "./DataPipelineClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataPipelineClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-data-pipeline/runtimeConfig.ts b/clients/client-data-pipeline/runtimeConfig.ts deleted file mode 100644 index 7e7ad11f2f14..000000000000 --- a/clients/client-data-pipeline/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DataPipelineClientConfig } from "./DataPipelineClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataPipelineClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-data-pipeline/DataPipeline.ts b/clients/client-data-pipeline/src/DataPipeline.ts similarity index 100% rename from clients/client-data-pipeline/DataPipeline.ts rename to clients/client-data-pipeline/src/DataPipeline.ts diff --git a/clients/client-data-pipeline/DataPipelineClient.ts b/clients/client-data-pipeline/src/DataPipelineClient.ts similarity index 100% rename from clients/client-data-pipeline/DataPipelineClient.ts rename to clients/client-data-pipeline/src/DataPipelineClient.ts diff --git a/clients/client-data-pipeline/commands/ActivatePipelineCommand.ts b/clients/client-data-pipeline/src/commands/ActivatePipelineCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/ActivatePipelineCommand.ts rename to clients/client-data-pipeline/src/commands/ActivatePipelineCommand.ts diff --git a/clients/client-data-pipeline/commands/AddTagsCommand.ts b/clients/client-data-pipeline/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/AddTagsCommand.ts rename to clients/client-data-pipeline/src/commands/AddTagsCommand.ts diff --git a/clients/client-data-pipeline/commands/CreatePipelineCommand.ts b/clients/client-data-pipeline/src/commands/CreatePipelineCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/CreatePipelineCommand.ts rename to clients/client-data-pipeline/src/commands/CreatePipelineCommand.ts diff --git a/clients/client-data-pipeline/commands/DeactivatePipelineCommand.ts b/clients/client-data-pipeline/src/commands/DeactivatePipelineCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/DeactivatePipelineCommand.ts rename to clients/client-data-pipeline/src/commands/DeactivatePipelineCommand.ts diff --git a/clients/client-data-pipeline/commands/DeletePipelineCommand.ts b/clients/client-data-pipeline/src/commands/DeletePipelineCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/DeletePipelineCommand.ts rename to clients/client-data-pipeline/src/commands/DeletePipelineCommand.ts diff --git a/clients/client-data-pipeline/commands/DescribeObjectsCommand.ts b/clients/client-data-pipeline/src/commands/DescribeObjectsCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/DescribeObjectsCommand.ts rename to clients/client-data-pipeline/src/commands/DescribeObjectsCommand.ts diff --git a/clients/client-data-pipeline/commands/DescribePipelinesCommand.ts b/clients/client-data-pipeline/src/commands/DescribePipelinesCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/DescribePipelinesCommand.ts rename to clients/client-data-pipeline/src/commands/DescribePipelinesCommand.ts diff --git a/clients/client-data-pipeline/commands/EvaluateExpressionCommand.ts b/clients/client-data-pipeline/src/commands/EvaluateExpressionCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/EvaluateExpressionCommand.ts rename to clients/client-data-pipeline/src/commands/EvaluateExpressionCommand.ts diff --git a/clients/client-data-pipeline/commands/GetPipelineDefinitionCommand.ts b/clients/client-data-pipeline/src/commands/GetPipelineDefinitionCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/GetPipelineDefinitionCommand.ts rename to clients/client-data-pipeline/src/commands/GetPipelineDefinitionCommand.ts diff --git a/clients/client-data-pipeline/commands/ListPipelinesCommand.ts b/clients/client-data-pipeline/src/commands/ListPipelinesCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/ListPipelinesCommand.ts rename to clients/client-data-pipeline/src/commands/ListPipelinesCommand.ts diff --git a/clients/client-data-pipeline/commands/PollForTaskCommand.ts b/clients/client-data-pipeline/src/commands/PollForTaskCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/PollForTaskCommand.ts rename to clients/client-data-pipeline/src/commands/PollForTaskCommand.ts diff --git a/clients/client-data-pipeline/commands/PutPipelineDefinitionCommand.ts b/clients/client-data-pipeline/src/commands/PutPipelineDefinitionCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/PutPipelineDefinitionCommand.ts rename to clients/client-data-pipeline/src/commands/PutPipelineDefinitionCommand.ts diff --git a/clients/client-data-pipeline/commands/QueryObjectsCommand.ts b/clients/client-data-pipeline/src/commands/QueryObjectsCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/QueryObjectsCommand.ts rename to clients/client-data-pipeline/src/commands/QueryObjectsCommand.ts diff --git a/clients/client-data-pipeline/commands/RemoveTagsCommand.ts b/clients/client-data-pipeline/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/RemoveTagsCommand.ts rename to clients/client-data-pipeline/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-data-pipeline/commands/ReportTaskProgressCommand.ts b/clients/client-data-pipeline/src/commands/ReportTaskProgressCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/ReportTaskProgressCommand.ts rename to clients/client-data-pipeline/src/commands/ReportTaskProgressCommand.ts diff --git a/clients/client-data-pipeline/commands/ReportTaskRunnerHeartbeatCommand.ts b/clients/client-data-pipeline/src/commands/ReportTaskRunnerHeartbeatCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/ReportTaskRunnerHeartbeatCommand.ts rename to clients/client-data-pipeline/src/commands/ReportTaskRunnerHeartbeatCommand.ts diff --git a/clients/client-data-pipeline/commands/SetStatusCommand.ts b/clients/client-data-pipeline/src/commands/SetStatusCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/SetStatusCommand.ts rename to clients/client-data-pipeline/src/commands/SetStatusCommand.ts diff --git a/clients/client-data-pipeline/commands/SetTaskStatusCommand.ts b/clients/client-data-pipeline/src/commands/SetTaskStatusCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/SetTaskStatusCommand.ts rename to clients/client-data-pipeline/src/commands/SetTaskStatusCommand.ts diff --git a/clients/client-data-pipeline/commands/ValidatePipelineDefinitionCommand.ts b/clients/client-data-pipeline/src/commands/ValidatePipelineDefinitionCommand.ts similarity index 100% rename from clients/client-data-pipeline/commands/ValidatePipelineDefinitionCommand.ts rename to clients/client-data-pipeline/src/commands/ValidatePipelineDefinitionCommand.ts diff --git a/clients/client-data-pipeline/endpoints.ts b/clients/client-data-pipeline/src/endpoints.ts similarity index 100% rename from clients/client-data-pipeline/endpoints.ts rename to clients/client-data-pipeline/src/endpoints.ts diff --git a/clients/client-data-pipeline/index.ts b/clients/client-data-pipeline/src/index.ts similarity index 100% rename from clients/client-data-pipeline/index.ts rename to clients/client-data-pipeline/src/index.ts diff --git a/clients/client-data-pipeline/models/index.ts b/clients/client-data-pipeline/src/models/index.ts similarity index 100% rename from clients/client-data-pipeline/models/index.ts rename to clients/client-data-pipeline/src/models/index.ts diff --git a/clients/client-data-pipeline/models/models_0.ts b/clients/client-data-pipeline/src/models/models_0.ts similarity index 100% rename from clients/client-data-pipeline/models/models_0.ts rename to clients/client-data-pipeline/src/models/models_0.ts diff --git a/clients/client-data-pipeline/pagination/DescribeObjectsPaginator.ts b/clients/client-data-pipeline/src/pagination/DescribeObjectsPaginator.ts similarity index 100% rename from clients/client-data-pipeline/pagination/DescribeObjectsPaginator.ts rename to clients/client-data-pipeline/src/pagination/DescribeObjectsPaginator.ts diff --git a/clients/client-data-pipeline/pagination/Interfaces.ts b/clients/client-data-pipeline/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-data-pipeline/pagination/Interfaces.ts rename to clients/client-data-pipeline/src/pagination/Interfaces.ts diff --git a/clients/client-data-pipeline/pagination/ListPipelinesPaginator.ts b/clients/client-data-pipeline/src/pagination/ListPipelinesPaginator.ts similarity index 100% rename from clients/client-data-pipeline/pagination/ListPipelinesPaginator.ts rename to clients/client-data-pipeline/src/pagination/ListPipelinesPaginator.ts diff --git a/clients/client-data-pipeline/pagination/QueryObjectsPaginator.ts b/clients/client-data-pipeline/src/pagination/QueryObjectsPaginator.ts similarity index 100% rename from clients/client-data-pipeline/pagination/QueryObjectsPaginator.ts rename to clients/client-data-pipeline/src/pagination/QueryObjectsPaginator.ts diff --git a/clients/client-data-pipeline/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-data-pipeline/protocols/Aws_json1_1.ts rename to clients/client-data-pipeline/src/protocols/Aws_json1_1.ts diff --git a/clients/client-data-pipeline/src/runtimeConfig.browser.ts b/clients/client-data-pipeline/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9a7aef985f9d --- /dev/null +++ b/clients/client-data-pipeline/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DataPipelineClientConfig } from "./DataPipelineClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataPipelineClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-data-pipeline/runtimeConfig.native.ts b/clients/client-data-pipeline/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-data-pipeline/runtimeConfig.native.ts rename to clients/client-data-pipeline/src/runtimeConfig.native.ts diff --git a/clients/client-data-pipeline/runtimeConfig.shared.ts b/clients/client-data-pipeline/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-data-pipeline/runtimeConfig.shared.ts rename to clients/client-data-pipeline/src/runtimeConfig.shared.ts diff --git a/clients/client-data-pipeline/src/runtimeConfig.ts b/clients/client-data-pipeline/src/runtimeConfig.ts new file mode 100644 index 000000000000..a17753110864 --- /dev/null +++ b/clients/client-data-pipeline/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DataPipelineClientConfig } from "./DataPipelineClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataPipelineClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-data-pipeline/tsconfig.es.json b/clients/client-data-pipeline/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-data-pipeline/tsconfig.es.json +++ b/clients/client-data-pipeline/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-data-pipeline/tsconfig.json b/clients/client-data-pipeline/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-data-pipeline/tsconfig.json +++ b/clients/client-data-pipeline/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-data-pipeline/tsconfig.types.json b/clients/client-data-pipeline/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-data-pipeline/tsconfig.types.json +++ b/clients/client-data-pipeline/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-database-migration-service/.gitignore b/clients/client-database-migration-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-database-migration-service/.gitignore +++ b/clients/client-database-migration-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-database-migration-service/package.json b/clients/client-database-migration-service/package.json index 043e7b934bdc..c11945ea61ae 100644 --- a/clients/client-database-migration-service/package.json +++ b/clients/client-database-migration-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-database-migration-service", "repository": { "type": "git", diff --git a/clients/client-database-migration-service/runtimeConfig.browser.ts b/clients/client-database-migration-service/runtimeConfig.browser.ts deleted file mode 100644 index 22ac2e6d5d6e..000000000000 --- a/clients/client-database-migration-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DatabaseMigrationServiceClientConfig } from "./DatabaseMigrationServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-database-migration-service/runtimeConfig.ts b/clients/client-database-migration-service/runtimeConfig.ts deleted file mode 100644 index 8c2f839f7197..000000000000 --- a/clients/client-database-migration-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DatabaseMigrationServiceClientConfig } from "./DatabaseMigrationServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-database-migration-service/DatabaseMigrationService.ts b/clients/client-database-migration-service/src/DatabaseMigrationService.ts similarity index 100% rename from clients/client-database-migration-service/DatabaseMigrationService.ts rename to clients/client-database-migration-service/src/DatabaseMigrationService.ts diff --git a/clients/client-database-migration-service/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts similarity index 100% rename from clients/client-database-migration-service/DatabaseMigrationServiceClient.ts rename to clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts diff --git a/clients/client-database-migration-service/commands/AddTagsToResourceCommand.ts b/clients/client-database-migration-service/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/AddTagsToResourceCommand.ts rename to clients/client-database-migration-service/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-database-migration-service/commands/ApplyPendingMaintenanceActionCommand.ts b/clients/client-database-migration-service/src/commands/ApplyPendingMaintenanceActionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ApplyPendingMaintenanceActionCommand.ts rename to clients/client-database-migration-service/src/commands/ApplyPendingMaintenanceActionCommand.ts diff --git a/clients/client-database-migration-service/commands/CancelReplicationTaskAssessmentRunCommand.ts b/clients/client-database-migration-service/src/commands/CancelReplicationTaskAssessmentRunCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CancelReplicationTaskAssessmentRunCommand.ts rename to clients/client-database-migration-service/src/commands/CancelReplicationTaskAssessmentRunCommand.ts diff --git a/clients/client-database-migration-service/commands/CreateEndpointCommand.ts b/clients/client-database-migration-service/src/commands/CreateEndpointCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CreateEndpointCommand.ts rename to clients/client-database-migration-service/src/commands/CreateEndpointCommand.ts diff --git a/clients/client-database-migration-service/commands/CreateEventSubscriptionCommand.ts b/clients/client-database-migration-service/src/commands/CreateEventSubscriptionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CreateEventSubscriptionCommand.ts rename to clients/client-database-migration-service/src/commands/CreateEventSubscriptionCommand.ts diff --git a/clients/client-database-migration-service/commands/CreateReplicationInstanceCommand.ts b/clients/client-database-migration-service/src/commands/CreateReplicationInstanceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CreateReplicationInstanceCommand.ts rename to clients/client-database-migration-service/src/commands/CreateReplicationInstanceCommand.ts diff --git a/clients/client-database-migration-service/commands/CreateReplicationSubnetGroupCommand.ts b/clients/client-database-migration-service/src/commands/CreateReplicationSubnetGroupCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CreateReplicationSubnetGroupCommand.ts rename to clients/client-database-migration-service/src/commands/CreateReplicationSubnetGroupCommand.ts diff --git a/clients/client-database-migration-service/commands/CreateReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/CreateReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/CreateReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/CreateReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteCertificateCommand.ts b/clients/client-database-migration-service/src/commands/DeleteCertificateCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteCertificateCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteCertificateCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteConnectionCommand.ts b/clients/client-database-migration-service/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteConnectionCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteEndpointCommand.ts b/clients/client-database-migration-service/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteEndpointCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteEventSubscriptionCommand.ts b/clients/client-database-migration-service/src/commands/DeleteEventSubscriptionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteEventSubscriptionCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteEventSubscriptionCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteReplicationInstanceCommand.ts b/clients/client-database-migration-service/src/commands/DeleteReplicationInstanceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteReplicationInstanceCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteReplicationInstanceCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteReplicationSubnetGroupCommand.ts b/clients/client-database-migration-service/src/commands/DeleteReplicationSubnetGroupCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteReplicationSubnetGroupCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteReplicationSubnetGroupCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteReplicationTaskAssessmentRunCommand.ts b/clients/client-database-migration-service/src/commands/DeleteReplicationTaskAssessmentRunCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteReplicationTaskAssessmentRunCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteReplicationTaskAssessmentRunCommand.ts diff --git a/clients/client-database-migration-service/commands/DeleteReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/DeleteReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DeleteReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/DeleteReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeAccountAttributesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeAccountAttributesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeApplicableIndividualAssessmentsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeApplicableIndividualAssessmentsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeApplicableIndividualAssessmentsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeApplicableIndividualAssessmentsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeCertificatesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeCertificatesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeCertificatesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeCertificatesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeConnectionsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeConnectionsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeConnectionsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeConnectionsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEndpointSettingsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEndpointSettingsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEndpointSettingsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEndpointSettingsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEndpointTypesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEndpointTypesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEndpointTypesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEndpointTypesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEndpointsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEndpointsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEndpointsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEndpointsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEventCategoriesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEventCategoriesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEventCategoriesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEventCategoriesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEventSubscriptionsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEventSubscriptionsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEventSubscriptionsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeEventsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeEventsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeOrderableReplicationInstancesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeOrderableReplicationInstancesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeOrderableReplicationInstancesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeOrderableReplicationInstancesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribePendingMaintenanceActionsCommand.ts b/clients/client-database-migration-service/src/commands/DescribePendingMaintenanceActionsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribePendingMaintenanceActionsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribePendingMaintenanceActionsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeRefreshSchemasStatusCommand.ts b/clients/client-database-migration-service/src/commands/DescribeRefreshSchemasStatusCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeRefreshSchemasStatusCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeRefreshSchemasStatusCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationInstanceTaskLogsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationInstanceTaskLogsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationInstanceTaskLogsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationInstanceTaskLogsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationInstancesCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationInstancesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationInstancesCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationInstancesCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationSubnetGroupsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationSubnetGroupsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationSubnetGroupsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationSubnetGroupsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationTaskAssessmentResultsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationTaskAssessmentResultsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationTaskAssessmentResultsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationTaskAssessmentResultsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationTaskAssessmentRunsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationTaskAssessmentRunsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationTaskAssessmentRunsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationTaskAssessmentRunsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationTaskIndividualAssessmentsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationTaskIndividualAssessmentsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationTaskIndividualAssessmentsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationTaskIndividualAssessmentsCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeReplicationTasksCommand.ts b/clients/client-database-migration-service/src/commands/DescribeReplicationTasksCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeReplicationTasksCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeReplicationTasksCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeSchemasCommand.ts b/clients/client-database-migration-service/src/commands/DescribeSchemasCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeSchemasCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeSchemasCommand.ts diff --git a/clients/client-database-migration-service/commands/DescribeTableStatisticsCommand.ts b/clients/client-database-migration-service/src/commands/DescribeTableStatisticsCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/DescribeTableStatisticsCommand.ts rename to clients/client-database-migration-service/src/commands/DescribeTableStatisticsCommand.ts diff --git a/clients/client-database-migration-service/commands/ImportCertificateCommand.ts b/clients/client-database-migration-service/src/commands/ImportCertificateCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ImportCertificateCommand.ts rename to clients/client-database-migration-service/src/commands/ImportCertificateCommand.ts diff --git a/clients/client-database-migration-service/commands/ListTagsForResourceCommand.ts b/clients/client-database-migration-service/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ListTagsForResourceCommand.ts rename to clients/client-database-migration-service/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-database-migration-service/commands/ModifyEndpointCommand.ts b/clients/client-database-migration-service/src/commands/ModifyEndpointCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ModifyEndpointCommand.ts rename to clients/client-database-migration-service/src/commands/ModifyEndpointCommand.ts diff --git a/clients/client-database-migration-service/commands/ModifyEventSubscriptionCommand.ts b/clients/client-database-migration-service/src/commands/ModifyEventSubscriptionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ModifyEventSubscriptionCommand.ts rename to clients/client-database-migration-service/src/commands/ModifyEventSubscriptionCommand.ts diff --git a/clients/client-database-migration-service/commands/ModifyReplicationInstanceCommand.ts b/clients/client-database-migration-service/src/commands/ModifyReplicationInstanceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ModifyReplicationInstanceCommand.ts rename to clients/client-database-migration-service/src/commands/ModifyReplicationInstanceCommand.ts diff --git a/clients/client-database-migration-service/commands/ModifyReplicationSubnetGroupCommand.ts b/clients/client-database-migration-service/src/commands/ModifyReplicationSubnetGroupCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ModifyReplicationSubnetGroupCommand.ts rename to clients/client-database-migration-service/src/commands/ModifyReplicationSubnetGroupCommand.ts diff --git a/clients/client-database-migration-service/commands/ModifyReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/ModifyReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ModifyReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/ModifyReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/MoveReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/MoveReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/MoveReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/MoveReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/RebootReplicationInstanceCommand.ts b/clients/client-database-migration-service/src/commands/RebootReplicationInstanceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/RebootReplicationInstanceCommand.ts rename to clients/client-database-migration-service/src/commands/RebootReplicationInstanceCommand.ts diff --git a/clients/client-database-migration-service/commands/RefreshSchemasCommand.ts b/clients/client-database-migration-service/src/commands/RefreshSchemasCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/RefreshSchemasCommand.ts rename to clients/client-database-migration-service/src/commands/RefreshSchemasCommand.ts diff --git a/clients/client-database-migration-service/commands/ReloadTablesCommand.ts b/clients/client-database-migration-service/src/commands/ReloadTablesCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/ReloadTablesCommand.ts rename to clients/client-database-migration-service/src/commands/ReloadTablesCommand.ts diff --git a/clients/client-database-migration-service/commands/RemoveTagsFromResourceCommand.ts b/clients/client-database-migration-service/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-database-migration-service/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-database-migration-service/commands/StartReplicationTaskAssessmentCommand.ts b/clients/client-database-migration-service/src/commands/StartReplicationTaskAssessmentCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/StartReplicationTaskAssessmentCommand.ts rename to clients/client-database-migration-service/src/commands/StartReplicationTaskAssessmentCommand.ts diff --git a/clients/client-database-migration-service/commands/StartReplicationTaskAssessmentRunCommand.ts b/clients/client-database-migration-service/src/commands/StartReplicationTaskAssessmentRunCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/StartReplicationTaskAssessmentRunCommand.ts rename to clients/client-database-migration-service/src/commands/StartReplicationTaskAssessmentRunCommand.ts diff --git a/clients/client-database-migration-service/commands/StartReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/StartReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/StartReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/StartReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/StopReplicationTaskCommand.ts b/clients/client-database-migration-service/src/commands/StopReplicationTaskCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/StopReplicationTaskCommand.ts rename to clients/client-database-migration-service/src/commands/StopReplicationTaskCommand.ts diff --git a/clients/client-database-migration-service/commands/TestConnectionCommand.ts b/clients/client-database-migration-service/src/commands/TestConnectionCommand.ts similarity index 100% rename from clients/client-database-migration-service/commands/TestConnectionCommand.ts rename to clients/client-database-migration-service/src/commands/TestConnectionCommand.ts diff --git a/clients/client-database-migration-service/endpoints.ts b/clients/client-database-migration-service/src/endpoints.ts similarity index 100% rename from clients/client-database-migration-service/endpoints.ts rename to clients/client-database-migration-service/src/endpoints.ts diff --git a/clients/client-database-migration-service/index.ts b/clients/client-database-migration-service/src/index.ts similarity index 100% rename from clients/client-database-migration-service/index.ts rename to clients/client-database-migration-service/src/index.ts diff --git a/clients/client-database-migration-service/models/index.ts b/clients/client-database-migration-service/src/models/index.ts similarity index 100% rename from clients/client-database-migration-service/models/index.ts rename to clients/client-database-migration-service/src/models/index.ts diff --git a/clients/client-database-migration-service/models/models_0.ts b/clients/client-database-migration-service/src/models/models_0.ts similarity index 100% rename from clients/client-database-migration-service/models/models_0.ts rename to clients/client-database-migration-service/src/models/models_0.ts diff --git a/clients/client-database-migration-service/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeApplicableIndividualAssessmentsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeCertificatesPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeCertificatesPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeCertificatesPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeCertificatesPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeConnectionsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeConnectionsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeConnectionsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeConnectionsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeEndpointSettingsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEndpointSettingsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeEndpointSettingsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeEndpointSettingsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeEndpointTypesPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEndpointTypesPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeEndpointTypesPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeEndpointTypesPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeEndpointsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEndpointsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeEndpointsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeEndpointsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeEventSubscriptionsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeEventSubscriptionsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeEventsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeEventsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeOrderableReplicationInstancesPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeOrderableReplicationInstancesPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeOrderableReplicationInstancesPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeOrderableReplicationInstancesPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribePendingMaintenanceActionsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribePendingMaintenanceActionsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribePendingMaintenanceActionsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationInstanceTaskLogsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationInstancesPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationInstancesPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationInstancesPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationInstancesPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationSubnetGroupsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationSubnetGroupsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationSubnetGroupsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationTaskAssessmentResultsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationTaskAssessmentRunsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationTaskIndividualAssessmentsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeReplicationTasksPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeReplicationTasksPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeReplicationTasksPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeReplicationTasksPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeSchemasPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeSchemasPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeSchemasPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeSchemasPaginator.ts diff --git a/clients/client-database-migration-service/pagination/DescribeTableStatisticsPaginator.ts b/clients/client-database-migration-service/src/pagination/DescribeTableStatisticsPaginator.ts similarity index 100% rename from clients/client-database-migration-service/pagination/DescribeTableStatisticsPaginator.ts rename to clients/client-database-migration-service/src/pagination/DescribeTableStatisticsPaginator.ts diff --git a/clients/client-database-migration-service/pagination/Interfaces.ts b/clients/client-database-migration-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-database-migration-service/pagination/Interfaces.ts rename to clients/client-database-migration-service/src/pagination/Interfaces.ts diff --git a/clients/client-database-migration-service/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-database-migration-service/protocols/Aws_json1_1.ts rename to clients/client-database-migration-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-database-migration-service/src/runtimeConfig.browser.ts b/clients/client-database-migration-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4fe309fc3bfc --- /dev/null +++ b/clients/client-database-migration-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DatabaseMigrationServiceClientConfig } from "./DatabaseMigrationServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-database-migration-service/runtimeConfig.native.ts b/clients/client-database-migration-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-database-migration-service/runtimeConfig.native.ts rename to clients/client-database-migration-service/src/runtimeConfig.native.ts diff --git a/clients/client-database-migration-service/runtimeConfig.shared.ts b/clients/client-database-migration-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-database-migration-service/runtimeConfig.shared.ts rename to clients/client-database-migration-service/src/runtimeConfig.shared.ts diff --git a/clients/client-database-migration-service/src/runtimeConfig.ts b/clients/client-database-migration-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..d4b35a71de9b --- /dev/null +++ b/clients/client-database-migration-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DatabaseMigrationServiceClientConfig } from "./DatabaseMigrationServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-database-migration-service/waiters/waitForEndpointDeleted.ts b/clients/client-database-migration-service/src/waiters/waitForEndpointDeleted.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForEndpointDeleted.ts rename to clients/client-database-migration-service/src/waiters/waitForEndpointDeleted.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationInstanceAvailable.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationInstanceAvailable.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationInstanceAvailable.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationInstanceAvailable.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationInstanceDeleted.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationInstanceDeleted.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationInstanceDeleted.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationInstanceDeleted.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationTaskDeleted.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationTaskDeleted.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationTaskDeleted.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationTaskDeleted.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationTaskReady.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationTaskReady.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationTaskReady.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationTaskReady.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationTaskRunning.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationTaskRunning.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationTaskRunning.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationTaskRunning.ts diff --git a/clients/client-database-migration-service/waiters/waitForReplicationTaskStopped.ts b/clients/client-database-migration-service/src/waiters/waitForReplicationTaskStopped.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForReplicationTaskStopped.ts rename to clients/client-database-migration-service/src/waiters/waitForReplicationTaskStopped.ts diff --git a/clients/client-database-migration-service/waiters/waitForTestConnectionSucceeds.ts b/clients/client-database-migration-service/src/waiters/waitForTestConnectionSucceeds.ts similarity index 100% rename from clients/client-database-migration-service/waiters/waitForTestConnectionSucceeds.ts rename to clients/client-database-migration-service/src/waiters/waitForTestConnectionSucceeds.ts diff --git a/clients/client-database-migration-service/tsconfig.es.json b/clients/client-database-migration-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-database-migration-service/tsconfig.es.json +++ b/clients/client-database-migration-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-database-migration-service/tsconfig.json b/clients/client-database-migration-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-database-migration-service/tsconfig.json +++ b/clients/client-database-migration-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-database-migration-service/tsconfig.types.json b/clients/client-database-migration-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-database-migration-service/tsconfig.types.json +++ b/clients/client-database-migration-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-databrew/.gitignore b/clients/client-databrew/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-databrew/.gitignore +++ b/clients/client-databrew/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-databrew/package.json b/clients/client-databrew/package.json index 0d2121d8c1ef..8698745b21c1 100644 --- a/clients/client-databrew/package.json +++ b/clients/client-databrew/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-databrew", "repository": { "type": "git", diff --git a/clients/client-databrew/runtimeConfig.browser.ts b/clients/client-databrew/runtimeConfig.browser.ts deleted file mode 100644 index 2dbba28dbd7c..000000000000 --- a/clients/client-databrew/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DataBrewClientConfig } from "./DataBrewClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataBrewClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-databrew/runtimeConfig.ts b/clients/client-databrew/runtimeConfig.ts deleted file mode 100644 index d3ea85a79d5b..000000000000 --- a/clients/client-databrew/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DataBrewClientConfig } from "./DataBrewClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataBrewClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-databrew/DataBrew.ts b/clients/client-databrew/src/DataBrew.ts similarity index 100% rename from clients/client-databrew/DataBrew.ts rename to clients/client-databrew/src/DataBrew.ts diff --git a/clients/client-databrew/DataBrewClient.ts b/clients/client-databrew/src/DataBrewClient.ts similarity index 100% rename from clients/client-databrew/DataBrewClient.ts rename to clients/client-databrew/src/DataBrewClient.ts diff --git a/clients/client-databrew/commands/BatchDeleteRecipeVersionCommand.ts b/clients/client-databrew/src/commands/BatchDeleteRecipeVersionCommand.ts similarity index 100% rename from clients/client-databrew/commands/BatchDeleteRecipeVersionCommand.ts rename to clients/client-databrew/src/commands/BatchDeleteRecipeVersionCommand.ts diff --git a/clients/client-databrew/commands/CreateDatasetCommand.ts b/clients/client-databrew/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateDatasetCommand.ts rename to clients/client-databrew/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-databrew/commands/CreateProfileJobCommand.ts b/clients/client-databrew/src/commands/CreateProfileJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateProfileJobCommand.ts rename to clients/client-databrew/src/commands/CreateProfileJobCommand.ts diff --git a/clients/client-databrew/commands/CreateProjectCommand.ts b/clients/client-databrew/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateProjectCommand.ts rename to clients/client-databrew/src/commands/CreateProjectCommand.ts diff --git a/clients/client-databrew/commands/CreateRecipeCommand.ts b/clients/client-databrew/src/commands/CreateRecipeCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateRecipeCommand.ts rename to clients/client-databrew/src/commands/CreateRecipeCommand.ts diff --git a/clients/client-databrew/commands/CreateRecipeJobCommand.ts b/clients/client-databrew/src/commands/CreateRecipeJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateRecipeJobCommand.ts rename to clients/client-databrew/src/commands/CreateRecipeJobCommand.ts diff --git a/clients/client-databrew/commands/CreateScheduleCommand.ts b/clients/client-databrew/src/commands/CreateScheduleCommand.ts similarity index 100% rename from clients/client-databrew/commands/CreateScheduleCommand.ts rename to clients/client-databrew/src/commands/CreateScheduleCommand.ts diff --git a/clients/client-databrew/commands/DeleteDatasetCommand.ts b/clients/client-databrew/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-databrew/commands/DeleteDatasetCommand.ts rename to clients/client-databrew/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-databrew/commands/DeleteJobCommand.ts b/clients/client-databrew/src/commands/DeleteJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/DeleteJobCommand.ts rename to clients/client-databrew/src/commands/DeleteJobCommand.ts diff --git a/clients/client-databrew/commands/DeleteProjectCommand.ts b/clients/client-databrew/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-databrew/commands/DeleteProjectCommand.ts rename to clients/client-databrew/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-databrew/commands/DeleteRecipeVersionCommand.ts b/clients/client-databrew/src/commands/DeleteRecipeVersionCommand.ts similarity index 100% rename from clients/client-databrew/commands/DeleteRecipeVersionCommand.ts rename to clients/client-databrew/src/commands/DeleteRecipeVersionCommand.ts diff --git a/clients/client-databrew/commands/DeleteScheduleCommand.ts b/clients/client-databrew/src/commands/DeleteScheduleCommand.ts similarity index 100% rename from clients/client-databrew/commands/DeleteScheduleCommand.ts rename to clients/client-databrew/src/commands/DeleteScheduleCommand.ts diff --git a/clients/client-databrew/commands/DescribeDatasetCommand.ts b/clients/client-databrew/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeDatasetCommand.ts rename to clients/client-databrew/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-databrew/commands/DescribeJobCommand.ts b/clients/client-databrew/src/commands/DescribeJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeJobCommand.ts rename to clients/client-databrew/src/commands/DescribeJobCommand.ts diff --git a/clients/client-databrew/commands/DescribeJobRunCommand.ts b/clients/client-databrew/src/commands/DescribeJobRunCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeJobRunCommand.ts rename to clients/client-databrew/src/commands/DescribeJobRunCommand.ts diff --git a/clients/client-databrew/commands/DescribeProjectCommand.ts b/clients/client-databrew/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeProjectCommand.ts rename to clients/client-databrew/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-databrew/commands/DescribeRecipeCommand.ts b/clients/client-databrew/src/commands/DescribeRecipeCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeRecipeCommand.ts rename to clients/client-databrew/src/commands/DescribeRecipeCommand.ts diff --git a/clients/client-databrew/commands/DescribeScheduleCommand.ts b/clients/client-databrew/src/commands/DescribeScheduleCommand.ts similarity index 100% rename from clients/client-databrew/commands/DescribeScheduleCommand.ts rename to clients/client-databrew/src/commands/DescribeScheduleCommand.ts diff --git a/clients/client-databrew/commands/ListDatasetsCommand.ts b/clients/client-databrew/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListDatasetsCommand.ts rename to clients/client-databrew/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-databrew/commands/ListJobRunsCommand.ts b/clients/client-databrew/src/commands/ListJobRunsCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListJobRunsCommand.ts rename to clients/client-databrew/src/commands/ListJobRunsCommand.ts diff --git a/clients/client-databrew/commands/ListJobsCommand.ts b/clients/client-databrew/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListJobsCommand.ts rename to clients/client-databrew/src/commands/ListJobsCommand.ts diff --git a/clients/client-databrew/commands/ListProjectsCommand.ts b/clients/client-databrew/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListProjectsCommand.ts rename to clients/client-databrew/src/commands/ListProjectsCommand.ts diff --git a/clients/client-databrew/commands/ListRecipeVersionsCommand.ts b/clients/client-databrew/src/commands/ListRecipeVersionsCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListRecipeVersionsCommand.ts rename to clients/client-databrew/src/commands/ListRecipeVersionsCommand.ts diff --git a/clients/client-databrew/commands/ListRecipesCommand.ts b/clients/client-databrew/src/commands/ListRecipesCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListRecipesCommand.ts rename to clients/client-databrew/src/commands/ListRecipesCommand.ts diff --git a/clients/client-databrew/commands/ListSchedulesCommand.ts b/clients/client-databrew/src/commands/ListSchedulesCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListSchedulesCommand.ts rename to clients/client-databrew/src/commands/ListSchedulesCommand.ts diff --git a/clients/client-databrew/commands/ListTagsForResourceCommand.ts b/clients/client-databrew/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-databrew/commands/ListTagsForResourceCommand.ts rename to clients/client-databrew/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-databrew/commands/PublishRecipeCommand.ts b/clients/client-databrew/src/commands/PublishRecipeCommand.ts similarity index 100% rename from clients/client-databrew/commands/PublishRecipeCommand.ts rename to clients/client-databrew/src/commands/PublishRecipeCommand.ts diff --git a/clients/client-databrew/commands/SendProjectSessionActionCommand.ts b/clients/client-databrew/src/commands/SendProjectSessionActionCommand.ts similarity index 100% rename from clients/client-databrew/commands/SendProjectSessionActionCommand.ts rename to clients/client-databrew/src/commands/SendProjectSessionActionCommand.ts diff --git a/clients/client-databrew/commands/StartJobRunCommand.ts b/clients/client-databrew/src/commands/StartJobRunCommand.ts similarity index 100% rename from clients/client-databrew/commands/StartJobRunCommand.ts rename to clients/client-databrew/src/commands/StartJobRunCommand.ts diff --git a/clients/client-databrew/commands/StartProjectSessionCommand.ts b/clients/client-databrew/src/commands/StartProjectSessionCommand.ts similarity index 100% rename from clients/client-databrew/commands/StartProjectSessionCommand.ts rename to clients/client-databrew/src/commands/StartProjectSessionCommand.ts diff --git a/clients/client-databrew/commands/StopJobRunCommand.ts b/clients/client-databrew/src/commands/StopJobRunCommand.ts similarity index 100% rename from clients/client-databrew/commands/StopJobRunCommand.ts rename to clients/client-databrew/src/commands/StopJobRunCommand.ts diff --git a/clients/client-databrew/commands/TagResourceCommand.ts b/clients/client-databrew/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-databrew/commands/TagResourceCommand.ts rename to clients/client-databrew/src/commands/TagResourceCommand.ts diff --git a/clients/client-databrew/commands/UntagResourceCommand.ts b/clients/client-databrew/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-databrew/commands/UntagResourceCommand.ts rename to clients/client-databrew/src/commands/UntagResourceCommand.ts diff --git a/clients/client-databrew/commands/UpdateDatasetCommand.ts b/clients/client-databrew/src/commands/UpdateDatasetCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateDatasetCommand.ts rename to clients/client-databrew/src/commands/UpdateDatasetCommand.ts diff --git a/clients/client-databrew/commands/UpdateProfileJobCommand.ts b/clients/client-databrew/src/commands/UpdateProfileJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateProfileJobCommand.ts rename to clients/client-databrew/src/commands/UpdateProfileJobCommand.ts diff --git a/clients/client-databrew/commands/UpdateProjectCommand.ts b/clients/client-databrew/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateProjectCommand.ts rename to clients/client-databrew/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-databrew/commands/UpdateRecipeCommand.ts b/clients/client-databrew/src/commands/UpdateRecipeCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateRecipeCommand.ts rename to clients/client-databrew/src/commands/UpdateRecipeCommand.ts diff --git a/clients/client-databrew/commands/UpdateRecipeJobCommand.ts b/clients/client-databrew/src/commands/UpdateRecipeJobCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateRecipeJobCommand.ts rename to clients/client-databrew/src/commands/UpdateRecipeJobCommand.ts diff --git a/clients/client-databrew/commands/UpdateScheduleCommand.ts b/clients/client-databrew/src/commands/UpdateScheduleCommand.ts similarity index 100% rename from clients/client-databrew/commands/UpdateScheduleCommand.ts rename to clients/client-databrew/src/commands/UpdateScheduleCommand.ts diff --git a/clients/client-databrew/endpoints.ts b/clients/client-databrew/src/endpoints.ts similarity index 100% rename from clients/client-databrew/endpoints.ts rename to clients/client-databrew/src/endpoints.ts diff --git a/clients/client-databrew/index.ts b/clients/client-databrew/src/index.ts similarity index 100% rename from clients/client-databrew/index.ts rename to clients/client-databrew/src/index.ts diff --git a/clients/client-databrew/models/index.ts b/clients/client-databrew/src/models/index.ts similarity index 100% rename from clients/client-databrew/models/index.ts rename to clients/client-databrew/src/models/index.ts diff --git a/clients/client-databrew/models/models_0.ts b/clients/client-databrew/src/models/models_0.ts similarity index 100% rename from clients/client-databrew/models/models_0.ts rename to clients/client-databrew/src/models/models_0.ts diff --git a/clients/client-databrew/pagination/Interfaces.ts b/clients/client-databrew/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-databrew/pagination/Interfaces.ts rename to clients/client-databrew/src/pagination/Interfaces.ts diff --git a/clients/client-databrew/pagination/ListDatasetsPaginator.ts b/clients/client-databrew/src/pagination/ListDatasetsPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListDatasetsPaginator.ts rename to clients/client-databrew/src/pagination/ListDatasetsPaginator.ts diff --git a/clients/client-databrew/pagination/ListJobRunsPaginator.ts b/clients/client-databrew/src/pagination/ListJobRunsPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListJobRunsPaginator.ts rename to clients/client-databrew/src/pagination/ListJobRunsPaginator.ts diff --git a/clients/client-databrew/pagination/ListJobsPaginator.ts b/clients/client-databrew/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListJobsPaginator.ts rename to clients/client-databrew/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-databrew/pagination/ListProjectsPaginator.ts b/clients/client-databrew/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListProjectsPaginator.ts rename to clients/client-databrew/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-databrew/pagination/ListRecipeVersionsPaginator.ts b/clients/client-databrew/src/pagination/ListRecipeVersionsPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListRecipeVersionsPaginator.ts rename to clients/client-databrew/src/pagination/ListRecipeVersionsPaginator.ts diff --git a/clients/client-databrew/pagination/ListRecipesPaginator.ts b/clients/client-databrew/src/pagination/ListRecipesPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListRecipesPaginator.ts rename to clients/client-databrew/src/pagination/ListRecipesPaginator.ts diff --git a/clients/client-databrew/pagination/ListSchedulesPaginator.ts b/clients/client-databrew/src/pagination/ListSchedulesPaginator.ts similarity index 100% rename from clients/client-databrew/pagination/ListSchedulesPaginator.ts rename to clients/client-databrew/src/pagination/ListSchedulesPaginator.ts diff --git a/clients/client-databrew/protocols/Aws_restJson1.ts b/clients/client-databrew/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-databrew/protocols/Aws_restJson1.ts rename to clients/client-databrew/src/protocols/Aws_restJson1.ts diff --git a/clients/client-databrew/src/runtimeConfig.browser.ts b/clients/client-databrew/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7af4027c1bd4 --- /dev/null +++ b/clients/client-databrew/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DataBrewClientConfig } from "./DataBrewClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataBrewClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-databrew/runtimeConfig.native.ts b/clients/client-databrew/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-databrew/runtimeConfig.native.ts rename to clients/client-databrew/src/runtimeConfig.native.ts diff --git a/clients/client-databrew/runtimeConfig.shared.ts b/clients/client-databrew/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-databrew/runtimeConfig.shared.ts rename to clients/client-databrew/src/runtimeConfig.shared.ts diff --git a/clients/client-databrew/src/runtimeConfig.ts b/clients/client-databrew/src/runtimeConfig.ts new file mode 100644 index 000000000000..30d96a27c3b7 --- /dev/null +++ b/clients/client-databrew/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DataBrewClientConfig } from "./DataBrewClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataBrewClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-databrew/tsconfig.es.json b/clients/client-databrew/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-databrew/tsconfig.es.json +++ b/clients/client-databrew/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-databrew/tsconfig.json b/clients/client-databrew/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-databrew/tsconfig.json +++ b/clients/client-databrew/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-databrew/tsconfig.types.json b/clients/client-databrew/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-databrew/tsconfig.types.json +++ b/clients/client-databrew/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-dataexchange/.gitignore b/clients/client-dataexchange/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-dataexchange/.gitignore +++ b/clients/client-dataexchange/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-dataexchange/package.json b/clients/client-dataexchange/package.json index bb6a84766641..3f6d41aedb0a 100644 --- a/clients/client-dataexchange/package.json +++ b/clients/client-dataexchange/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dataexchange", "repository": { "type": "git", diff --git a/clients/client-dataexchange/runtimeConfig.browser.ts b/clients/client-dataexchange/runtimeConfig.browser.ts deleted file mode 100644 index 637bb815d639..000000000000 --- a/clients/client-dataexchange/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DataExchangeClientConfig } from "./DataExchangeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataExchangeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dataexchange/runtimeConfig.ts b/clients/client-dataexchange/runtimeConfig.ts deleted file mode 100644 index 371a556c157e..000000000000 --- a/clients/client-dataexchange/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DataExchangeClientConfig } from "./DataExchangeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataExchangeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dataexchange/DataExchange.ts b/clients/client-dataexchange/src/DataExchange.ts similarity index 100% rename from clients/client-dataexchange/DataExchange.ts rename to clients/client-dataexchange/src/DataExchange.ts diff --git a/clients/client-dataexchange/DataExchangeClient.ts b/clients/client-dataexchange/src/DataExchangeClient.ts similarity index 100% rename from clients/client-dataexchange/DataExchangeClient.ts rename to clients/client-dataexchange/src/DataExchangeClient.ts diff --git a/clients/client-dataexchange/commands/CancelJobCommand.ts b/clients/client-dataexchange/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/CancelJobCommand.ts rename to clients/client-dataexchange/src/commands/CancelJobCommand.ts diff --git a/clients/client-dataexchange/commands/CreateDataSetCommand.ts b/clients/client-dataexchange/src/commands/CreateDataSetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/CreateDataSetCommand.ts rename to clients/client-dataexchange/src/commands/CreateDataSetCommand.ts diff --git a/clients/client-dataexchange/commands/CreateJobCommand.ts b/clients/client-dataexchange/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/CreateJobCommand.ts rename to clients/client-dataexchange/src/commands/CreateJobCommand.ts diff --git a/clients/client-dataexchange/commands/CreateRevisionCommand.ts b/clients/client-dataexchange/src/commands/CreateRevisionCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/CreateRevisionCommand.ts rename to clients/client-dataexchange/src/commands/CreateRevisionCommand.ts diff --git a/clients/client-dataexchange/commands/DeleteAssetCommand.ts b/clients/client-dataexchange/src/commands/DeleteAssetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/DeleteAssetCommand.ts rename to clients/client-dataexchange/src/commands/DeleteAssetCommand.ts diff --git a/clients/client-dataexchange/commands/DeleteDataSetCommand.ts b/clients/client-dataexchange/src/commands/DeleteDataSetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/DeleteDataSetCommand.ts rename to clients/client-dataexchange/src/commands/DeleteDataSetCommand.ts diff --git a/clients/client-dataexchange/commands/DeleteRevisionCommand.ts b/clients/client-dataexchange/src/commands/DeleteRevisionCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/DeleteRevisionCommand.ts rename to clients/client-dataexchange/src/commands/DeleteRevisionCommand.ts diff --git a/clients/client-dataexchange/commands/GetAssetCommand.ts b/clients/client-dataexchange/src/commands/GetAssetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/GetAssetCommand.ts rename to clients/client-dataexchange/src/commands/GetAssetCommand.ts diff --git a/clients/client-dataexchange/commands/GetDataSetCommand.ts b/clients/client-dataexchange/src/commands/GetDataSetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/GetDataSetCommand.ts rename to clients/client-dataexchange/src/commands/GetDataSetCommand.ts diff --git a/clients/client-dataexchange/commands/GetJobCommand.ts b/clients/client-dataexchange/src/commands/GetJobCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/GetJobCommand.ts rename to clients/client-dataexchange/src/commands/GetJobCommand.ts diff --git a/clients/client-dataexchange/commands/GetRevisionCommand.ts b/clients/client-dataexchange/src/commands/GetRevisionCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/GetRevisionCommand.ts rename to clients/client-dataexchange/src/commands/GetRevisionCommand.ts diff --git a/clients/client-dataexchange/commands/ListDataSetRevisionsCommand.ts b/clients/client-dataexchange/src/commands/ListDataSetRevisionsCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/ListDataSetRevisionsCommand.ts rename to clients/client-dataexchange/src/commands/ListDataSetRevisionsCommand.ts diff --git a/clients/client-dataexchange/commands/ListDataSetsCommand.ts b/clients/client-dataexchange/src/commands/ListDataSetsCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/ListDataSetsCommand.ts rename to clients/client-dataexchange/src/commands/ListDataSetsCommand.ts diff --git a/clients/client-dataexchange/commands/ListJobsCommand.ts b/clients/client-dataexchange/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/ListJobsCommand.ts rename to clients/client-dataexchange/src/commands/ListJobsCommand.ts diff --git a/clients/client-dataexchange/commands/ListRevisionAssetsCommand.ts b/clients/client-dataexchange/src/commands/ListRevisionAssetsCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/ListRevisionAssetsCommand.ts rename to clients/client-dataexchange/src/commands/ListRevisionAssetsCommand.ts diff --git a/clients/client-dataexchange/commands/ListTagsForResourceCommand.ts b/clients/client-dataexchange/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/ListTagsForResourceCommand.ts rename to clients/client-dataexchange/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-dataexchange/commands/StartJobCommand.ts b/clients/client-dataexchange/src/commands/StartJobCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/StartJobCommand.ts rename to clients/client-dataexchange/src/commands/StartJobCommand.ts diff --git a/clients/client-dataexchange/commands/TagResourceCommand.ts b/clients/client-dataexchange/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/TagResourceCommand.ts rename to clients/client-dataexchange/src/commands/TagResourceCommand.ts diff --git a/clients/client-dataexchange/commands/UntagResourceCommand.ts b/clients/client-dataexchange/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/UntagResourceCommand.ts rename to clients/client-dataexchange/src/commands/UntagResourceCommand.ts diff --git a/clients/client-dataexchange/commands/UpdateAssetCommand.ts b/clients/client-dataexchange/src/commands/UpdateAssetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/UpdateAssetCommand.ts rename to clients/client-dataexchange/src/commands/UpdateAssetCommand.ts diff --git a/clients/client-dataexchange/commands/UpdateDataSetCommand.ts b/clients/client-dataexchange/src/commands/UpdateDataSetCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/UpdateDataSetCommand.ts rename to clients/client-dataexchange/src/commands/UpdateDataSetCommand.ts diff --git a/clients/client-dataexchange/commands/UpdateRevisionCommand.ts b/clients/client-dataexchange/src/commands/UpdateRevisionCommand.ts similarity index 100% rename from clients/client-dataexchange/commands/UpdateRevisionCommand.ts rename to clients/client-dataexchange/src/commands/UpdateRevisionCommand.ts diff --git a/clients/client-dataexchange/endpoints.ts b/clients/client-dataexchange/src/endpoints.ts similarity index 100% rename from clients/client-dataexchange/endpoints.ts rename to clients/client-dataexchange/src/endpoints.ts diff --git a/clients/client-dataexchange/index.ts b/clients/client-dataexchange/src/index.ts similarity index 100% rename from clients/client-dataexchange/index.ts rename to clients/client-dataexchange/src/index.ts diff --git a/clients/client-dataexchange/models/index.ts b/clients/client-dataexchange/src/models/index.ts similarity index 100% rename from clients/client-dataexchange/models/index.ts rename to clients/client-dataexchange/src/models/index.ts diff --git a/clients/client-dataexchange/models/models_0.ts b/clients/client-dataexchange/src/models/models_0.ts similarity index 100% rename from clients/client-dataexchange/models/models_0.ts rename to clients/client-dataexchange/src/models/models_0.ts diff --git a/clients/client-dataexchange/pagination/Interfaces.ts b/clients/client-dataexchange/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-dataexchange/pagination/Interfaces.ts rename to clients/client-dataexchange/src/pagination/Interfaces.ts diff --git a/clients/client-dataexchange/pagination/ListDataSetRevisionsPaginator.ts b/clients/client-dataexchange/src/pagination/ListDataSetRevisionsPaginator.ts similarity index 100% rename from clients/client-dataexchange/pagination/ListDataSetRevisionsPaginator.ts rename to clients/client-dataexchange/src/pagination/ListDataSetRevisionsPaginator.ts diff --git a/clients/client-dataexchange/pagination/ListDataSetsPaginator.ts b/clients/client-dataexchange/src/pagination/ListDataSetsPaginator.ts similarity index 100% rename from clients/client-dataexchange/pagination/ListDataSetsPaginator.ts rename to clients/client-dataexchange/src/pagination/ListDataSetsPaginator.ts diff --git a/clients/client-dataexchange/pagination/ListJobsPaginator.ts b/clients/client-dataexchange/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-dataexchange/pagination/ListJobsPaginator.ts rename to clients/client-dataexchange/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-dataexchange/pagination/ListRevisionAssetsPaginator.ts b/clients/client-dataexchange/src/pagination/ListRevisionAssetsPaginator.ts similarity index 100% rename from clients/client-dataexchange/pagination/ListRevisionAssetsPaginator.ts rename to clients/client-dataexchange/src/pagination/ListRevisionAssetsPaginator.ts diff --git a/clients/client-dataexchange/protocols/Aws_restJson1.ts b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-dataexchange/protocols/Aws_restJson1.ts rename to clients/client-dataexchange/src/protocols/Aws_restJson1.ts diff --git a/clients/client-dataexchange/src/runtimeConfig.browser.ts b/clients/client-dataexchange/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4fde10672818 --- /dev/null +++ b/clients/client-dataexchange/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DataExchangeClientConfig } from "./DataExchangeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataExchangeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dataexchange/runtimeConfig.native.ts b/clients/client-dataexchange/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-dataexchange/runtimeConfig.native.ts rename to clients/client-dataexchange/src/runtimeConfig.native.ts diff --git a/clients/client-dataexchange/runtimeConfig.shared.ts b/clients/client-dataexchange/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-dataexchange/runtimeConfig.shared.ts rename to clients/client-dataexchange/src/runtimeConfig.shared.ts diff --git a/clients/client-dataexchange/src/runtimeConfig.ts b/clients/client-dataexchange/src/runtimeConfig.ts new file mode 100644 index 000000000000..597207f5d114 --- /dev/null +++ b/clients/client-dataexchange/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DataExchangeClientConfig } from "./DataExchangeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataExchangeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dataexchange/tsconfig.es.json b/clients/client-dataexchange/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-dataexchange/tsconfig.es.json +++ b/clients/client-dataexchange/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-dataexchange/tsconfig.json b/clients/client-dataexchange/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-dataexchange/tsconfig.json +++ b/clients/client-dataexchange/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-dataexchange/tsconfig.types.json b/clients/client-dataexchange/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-dataexchange/tsconfig.types.json +++ b/clients/client-dataexchange/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-datasync/.gitignore b/clients/client-datasync/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-datasync/.gitignore +++ b/clients/client-datasync/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-datasync/package.json b/clients/client-datasync/package.json index be5621e77b9b..a69f4dbcf079 100644 --- a/clients/client-datasync/package.json +++ b/clients/client-datasync/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-datasync", "repository": { "type": "git", diff --git a/clients/client-datasync/runtimeConfig.browser.ts b/clients/client-datasync/runtimeConfig.browser.ts deleted file mode 100644 index c99524d3891e..000000000000 --- a/clients/client-datasync/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DataSyncClientConfig } from "./DataSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataSyncClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-datasync/runtimeConfig.ts b/clients/client-datasync/runtimeConfig.ts deleted file mode 100644 index 8942e69982a5..000000000000 --- a/clients/client-datasync/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DataSyncClientConfig } from "./DataSyncClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DataSyncClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-datasync/DataSync.ts b/clients/client-datasync/src/DataSync.ts similarity index 100% rename from clients/client-datasync/DataSync.ts rename to clients/client-datasync/src/DataSync.ts diff --git a/clients/client-datasync/DataSyncClient.ts b/clients/client-datasync/src/DataSyncClient.ts similarity index 100% rename from clients/client-datasync/DataSyncClient.ts rename to clients/client-datasync/src/DataSyncClient.ts diff --git a/clients/client-datasync/commands/CancelTaskExecutionCommand.ts b/clients/client-datasync/src/commands/CancelTaskExecutionCommand.ts similarity index 100% rename from clients/client-datasync/commands/CancelTaskExecutionCommand.ts rename to clients/client-datasync/src/commands/CancelTaskExecutionCommand.ts diff --git a/clients/client-datasync/commands/CreateAgentCommand.ts b/clients/client-datasync/src/commands/CreateAgentCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateAgentCommand.ts rename to clients/client-datasync/src/commands/CreateAgentCommand.ts diff --git a/clients/client-datasync/commands/CreateLocationEfsCommand.ts b/clients/client-datasync/src/commands/CreateLocationEfsCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationEfsCommand.ts rename to clients/client-datasync/src/commands/CreateLocationEfsCommand.ts diff --git a/clients/client-datasync/commands/CreateLocationFsxWindowsCommand.ts b/clients/client-datasync/src/commands/CreateLocationFsxWindowsCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationFsxWindowsCommand.ts rename to clients/client-datasync/src/commands/CreateLocationFsxWindowsCommand.ts diff --git a/clients/client-datasync/commands/CreateLocationNfsCommand.ts b/clients/client-datasync/src/commands/CreateLocationNfsCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationNfsCommand.ts rename to clients/client-datasync/src/commands/CreateLocationNfsCommand.ts diff --git a/clients/client-datasync/commands/CreateLocationObjectStorageCommand.ts b/clients/client-datasync/src/commands/CreateLocationObjectStorageCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationObjectStorageCommand.ts rename to clients/client-datasync/src/commands/CreateLocationObjectStorageCommand.ts diff --git a/clients/client-datasync/commands/CreateLocationS3Command.ts b/clients/client-datasync/src/commands/CreateLocationS3Command.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationS3Command.ts rename to clients/client-datasync/src/commands/CreateLocationS3Command.ts diff --git a/clients/client-datasync/commands/CreateLocationSmbCommand.ts b/clients/client-datasync/src/commands/CreateLocationSmbCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateLocationSmbCommand.ts rename to clients/client-datasync/src/commands/CreateLocationSmbCommand.ts diff --git a/clients/client-datasync/commands/CreateTaskCommand.ts b/clients/client-datasync/src/commands/CreateTaskCommand.ts similarity index 100% rename from clients/client-datasync/commands/CreateTaskCommand.ts rename to clients/client-datasync/src/commands/CreateTaskCommand.ts diff --git a/clients/client-datasync/commands/DeleteAgentCommand.ts b/clients/client-datasync/src/commands/DeleteAgentCommand.ts similarity index 100% rename from clients/client-datasync/commands/DeleteAgentCommand.ts rename to clients/client-datasync/src/commands/DeleteAgentCommand.ts diff --git a/clients/client-datasync/commands/DeleteLocationCommand.ts b/clients/client-datasync/src/commands/DeleteLocationCommand.ts similarity index 100% rename from clients/client-datasync/commands/DeleteLocationCommand.ts rename to clients/client-datasync/src/commands/DeleteLocationCommand.ts diff --git a/clients/client-datasync/commands/DeleteTaskCommand.ts b/clients/client-datasync/src/commands/DeleteTaskCommand.ts similarity index 100% rename from clients/client-datasync/commands/DeleteTaskCommand.ts rename to clients/client-datasync/src/commands/DeleteTaskCommand.ts diff --git a/clients/client-datasync/commands/DescribeAgentCommand.ts b/clients/client-datasync/src/commands/DescribeAgentCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeAgentCommand.ts rename to clients/client-datasync/src/commands/DescribeAgentCommand.ts diff --git a/clients/client-datasync/commands/DescribeLocationEfsCommand.ts b/clients/client-datasync/src/commands/DescribeLocationEfsCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationEfsCommand.ts rename to clients/client-datasync/src/commands/DescribeLocationEfsCommand.ts diff --git a/clients/client-datasync/commands/DescribeLocationFsxWindowsCommand.ts b/clients/client-datasync/src/commands/DescribeLocationFsxWindowsCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationFsxWindowsCommand.ts rename to clients/client-datasync/src/commands/DescribeLocationFsxWindowsCommand.ts diff --git a/clients/client-datasync/commands/DescribeLocationNfsCommand.ts b/clients/client-datasync/src/commands/DescribeLocationNfsCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationNfsCommand.ts rename to clients/client-datasync/src/commands/DescribeLocationNfsCommand.ts diff --git a/clients/client-datasync/commands/DescribeLocationObjectStorageCommand.ts b/clients/client-datasync/src/commands/DescribeLocationObjectStorageCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationObjectStorageCommand.ts rename to clients/client-datasync/src/commands/DescribeLocationObjectStorageCommand.ts diff --git a/clients/client-datasync/commands/DescribeLocationS3Command.ts b/clients/client-datasync/src/commands/DescribeLocationS3Command.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationS3Command.ts rename to clients/client-datasync/src/commands/DescribeLocationS3Command.ts diff --git a/clients/client-datasync/commands/DescribeLocationSmbCommand.ts b/clients/client-datasync/src/commands/DescribeLocationSmbCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeLocationSmbCommand.ts rename to clients/client-datasync/src/commands/DescribeLocationSmbCommand.ts diff --git a/clients/client-datasync/commands/DescribeTaskCommand.ts b/clients/client-datasync/src/commands/DescribeTaskCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeTaskCommand.ts rename to clients/client-datasync/src/commands/DescribeTaskCommand.ts diff --git a/clients/client-datasync/commands/DescribeTaskExecutionCommand.ts b/clients/client-datasync/src/commands/DescribeTaskExecutionCommand.ts similarity index 100% rename from clients/client-datasync/commands/DescribeTaskExecutionCommand.ts rename to clients/client-datasync/src/commands/DescribeTaskExecutionCommand.ts diff --git a/clients/client-datasync/commands/ListAgentsCommand.ts b/clients/client-datasync/src/commands/ListAgentsCommand.ts similarity index 100% rename from clients/client-datasync/commands/ListAgentsCommand.ts rename to clients/client-datasync/src/commands/ListAgentsCommand.ts diff --git a/clients/client-datasync/commands/ListLocationsCommand.ts b/clients/client-datasync/src/commands/ListLocationsCommand.ts similarity index 100% rename from clients/client-datasync/commands/ListLocationsCommand.ts rename to clients/client-datasync/src/commands/ListLocationsCommand.ts diff --git a/clients/client-datasync/commands/ListTagsForResourceCommand.ts b/clients/client-datasync/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-datasync/commands/ListTagsForResourceCommand.ts rename to clients/client-datasync/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-datasync/commands/ListTaskExecutionsCommand.ts b/clients/client-datasync/src/commands/ListTaskExecutionsCommand.ts similarity index 100% rename from clients/client-datasync/commands/ListTaskExecutionsCommand.ts rename to clients/client-datasync/src/commands/ListTaskExecutionsCommand.ts diff --git a/clients/client-datasync/commands/ListTasksCommand.ts b/clients/client-datasync/src/commands/ListTasksCommand.ts similarity index 100% rename from clients/client-datasync/commands/ListTasksCommand.ts rename to clients/client-datasync/src/commands/ListTasksCommand.ts diff --git a/clients/client-datasync/commands/StartTaskExecutionCommand.ts b/clients/client-datasync/src/commands/StartTaskExecutionCommand.ts similarity index 100% rename from clients/client-datasync/commands/StartTaskExecutionCommand.ts rename to clients/client-datasync/src/commands/StartTaskExecutionCommand.ts diff --git a/clients/client-datasync/commands/TagResourceCommand.ts b/clients/client-datasync/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-datasync/commands/TagResourceCommand.ts rename to clients/client-datasync/src/commands/TagResourceCommand.ts diff --git a/clients/client-datasync/commands/UntagResourceCommand.ts b/clients/client-datasync/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-datasync/commands/UntagResourceCommand.ts rename to clients/client-datasync/src/commands/UntagResourceCommand.ts diff --git a/clients/client-datasync/commands/UpdateAgentCommand.ts b/clients/client-datasync/src/commands/UpdateAgentCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateAgentCommand.ts rename to clients/client-datasync/src/commands/UpdateAgentCommand.ts diff --git a/clients/client-datasync/commands/UpdateLocationNfsCommand.ts b/clients/client-datasync/src/commands/UpdateLocationNfsCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateLocationNfsCommand.ts rename to clients/client-datasync/src/commands/UpdateLocationNfsCommand.ts diff --git a/clients/client-datasync/commands/UpdateLocationObjectStorageCommand.ts b/clients/client-datasync/src/commands/UpdateLocationObjectStorageCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateLocationObjectStorageCommand.ts rename to clients/client-datasync/src/commands/UpdateLocationObjectStorageCommand.ts diff --git a/clients/client-datasync/commands/UpdateLocationSmbCommand.ts b/clients/client-datasync/src/commands/UpdateLocationSmbCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateLocationSmbCommand.ts rename to clients/client-datasync/src/commands/UpdateLocationSmbCommand.ts diff --git a/clients/client-datasync/commands/UpdateTaskCommand.ts b/clients/client-datasync/src/commands/UpdateTaskCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateTaskCommand.ts rename to clients/client-datasync/src/commands/UpdateTaskCommand.ts diff --git a/clients/client-datasync/commands/UpdateTaskExecutionCommand.ts b/clients/client-datasync/src/commands/UpdateTaskExecutionCommand.ts similarity index 100% rename from clients/client-datasync/commands/UpdateTaskExecutionCommand.ts rename to clients/client-datasync/src/commands/UpdateTaskExecutionCommand.ts diff --git a/clients/client-datasync/endpoints.ts b/clients/client-datasync/src/endpoints.ts similarity index 100% rename from clients/client-datasync/endpoints.ts rename to clients/client-datasync/src/endpoints.ts diff --git a/clients/client-datasync/index.ts b/clients/client-datasync/src/index.ts similarity index 100% rename from clients/client-datasync/index.ts rename to clients/client-datasync/src/index.ts diff --git a/clients/client-datasync/models/index.ts b/clients/client-datasync/src/models/index.ts similarity index 100% rename from clients/client-datasync/models/index.ts rename to clients/client-datasync/src/models/index.ts diff --git a/clients/client-datasync/models/models_0.ts b/clients/client-datasync/src/models/models_0.ts similarity index 100% rename from clients/client-datasync/models/models_0.ts rename to clients/client-datasync/src/models/models_0.ts diff --git a/clients/client-datasync/pagination/Interfaces.ts b/clients/client-datasync/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-datasync/pagination/Interfaces.ts rename to clients/client-datasync/src/pagination/Interfaces.ts diff --git a/clients/client-datasync/pagination/ListAgentsPaginator.ts b/clients/client-datasync/src/pagination/ListAgentsPaginator.ts similarity index 100% rename from clients/client-datasync/pagination/ListAgentsPaginator.ts rename to clients/client-datasync/src/pagination/ListAgentsPaginator.ts diff --git a/clients/client-datasync/pagination/ListLocationsPaginator.ts b/clients/client-datasync/src/pagination/ListLocationsPaginator.ts similarity index 100% rename from clients/client-datasync/pagination/ListLocationsPaginator.ts rename to clients/client-datasync/src/pagination/ListLocationsPaginator.ts diff --git a/clients/client-datasync/pagination/ListTagsForResourcePaginator.ts b/clients/client-datasync/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-datasync/pagination/ListTagsForResourcePaginator.ts rename to clients/client-datasync/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-datasync/pagination/ListTaskExecutionsPaginator.ts b/clients/client-datasync/src/pagination/ListTaskExecutionsPaginator.ts similarity index 100% rename from clients/client-datasync/pagination/ListTaskExecutionsPaginator.ts rename to clients/client-datasync/src/pagination/ListTaskExecutionsPaginator.ts diff --git a/clients/client-datasync/pagination/ListTasksPaginator.ts b/clients/client-datasync/src/pagination/ListTasksPaginator.ts similarity index 100% rename from clients/client-datasync/pagination/ListTasksPaginator.ts rename to clients/client-datasync/src/pagination/ListTasksPaginator.ts diff --git a/clients/client-datasync/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-datasync/protocols/Aws_json1_1.ts rename to clients/client-datasync/src/protocols/Aws_json1_1.ts diff --git a/clients/client-datasync/src/runtimeConfig.browser.ts b/clients/client-datasync/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5b2f640f8c6a --- /dev/null +++ b/clients/client-datasync/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DataSyncClientConfig } from "./DataSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataSyncClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-datasync/runtimeConfig.native.ts b/clients/client-datasync/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-datasync/runtimeConfig.native.ts rename to clients/client-datasync/src/runtimeConfig.native.ts diff --git a/clients/client-datasync/runtimeConfig.shared.ts b/clients/client-datasync/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-datasync/runtimeConfig.shared.ts rename to clients/client-datasync/src/runtimeConfig.shared.ts diff --git a/clients/client-datasync/src/runtimeConfig.ts b/clients/client-datasync/src/runtimeConfig.ts new file mode 100644 index 000000000000..0dba2dd92ed1 --- /dev/null +++ b/clients/client-datasync/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DataSyncClientConfig } from "./DataSyncClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DataSyncClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-datasync/tsconfig.es.json b/clients/client-datasync/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-datasync/tsconfig.es.json +++ b/clients/client-datasync/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-datasync/tsconfig.json b/clients/client-datasync/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-datasync/tsconfig.json +++ b/clients/client-datasync/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-datasync/tsconfig.types.json b/clients/client-datasync/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-datasync/tsconfig.types.json +++ b/clients/client-datasync/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-dax/.gitignore b/clients/client-dax/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-dax/.gitignore +++ b/clients/client-dax/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-dax/package.json b/clients/client-dax/package.json index 2158a292ad7c..b69ee3bd3182 100644 --- a/clients/client-dax/package.json +++ b/clients/client-dax/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dax", "repository": { "type": "git", diff --git a/clients/client-dax/runtimeConfig.browser.ts b/clients/client-dax/runtimeConfig.browser.ts deleted file mode 100644 index 39f3ee252279..000000000000 --- a/clients/client-dax/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DAXClientConfig } from "./DAXClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DAXClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dax/runtimeConfig.ts b/clients/client-dax/runtimeConfig.ts deleted file mode 100644 index 849c9db9b630..000000000000 --- a/clients/client-dax/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DAXClientConfig } from "./DAXClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DAXClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dax/DAX.ts b/clients/client-dax/src/DAX.ts similarity index 100% rename from clients/client-dax/DAX.ts rename to clients/client-dax/src/DAX.ts diff --git a/clients/client-dax/DAXClient.ts b/clients/client-dax/src/DAXClient.ts similarity index 100% rename from clients/client-dax/DAXClient.ts rename to clients/client-dax/src/DAXClient.ts diff --git a/clients/client-dax/commands/CreateClusterCommand.ts b/clients/client-dax/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-dax/commands/CreateClusterCommand.ts rename to clients/client-dax/src/commands/CreateClusterCommand.ts diff --git a/clients/client-dax/commands/CreateParameterGroupCommand.ts b/clients/client-dax/src/commands/CreateParameterGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/CreateParameterGroupCommand.ts rename to clients/client-dax/src/commands/CreateParameterGroupCommand.ts diff --git a/clients/client-dax/commands/CreateSubnetGroupCommand.ts b/clients/client-dax/src/commands/CreateSubnetGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/CreateSubnetGroupCommand.ts rename to clients/client-dax/src/commands/CreateSubnetGroupCommand.ts diff --git a/clients/client-dax/commands/DecreaseReplicationFactorCommand.ts b/clients/client-dax/src/commands/DecreaseReplicationFactorCommand.ts similarity index 100% rename from clients/client-dax/commands/DecreaseReplicationFactorCommand.ts rename to clients/client-dax/src/commands/DecreaseReplicationFactorCommand.ts diff --git a/clients/client-dax/commands/DeleteClusterCommand.ts b/clients/client-dax/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-dax/commands/DeleteClusterCommand.ts rename to clients/client-dax/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-dax/commands/DeleteParameterGroupCommand.ts b/clients/client-dax/src/commands/DeleteParameterGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/DeleteParameterGroupCommand.ts rename to clients/client-dax/src/commands/DeleteParameterGroupCommand.ts diff --git a/clients/client-dax/commands/DeleteSubnetGroupCommand.ts b/clients/client-dax/src/commands/DeleteSubnetGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/DeleteSubnetGroupCommand.ts rename to clients/client-dax/src/commands/DeleteSubnetGroupCommand.ts diff --git a/clients/client-dax/commands/DescribeClustersCommand.ts b/clients/client-dax/src/commands/DescribeClustersCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeClustersCommand.ts rename to clients/client-dax/src/commands/DescribeClustersCommand.ts diff --git a/clients/client-dax/commands/DescribeDefaultParametersCommand.ts b/clients/client-dax/src/commands/DescribeDefaultParametersCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeDefaultParametersCommand.ts rename to clients/client-dax/src/commands/DescribeDefaultParametersCommand.ts diff --git a/clients/client-dax/commands/DescribeEventsCommand.ts b/clients/client-dax/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeEventsCommand.ts rename to clients/client-dax/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-dax/commands/DescribeParameterGroupsCommand.ts b/clients/client-dax/src/commands/DescribeParameterGroupsCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeParameterGroupsCommand.ts rename to clients/client-dax/src/commands/DescribeParameterGroupsCommand.ts diff --git a/clients/client-dax/commands/DescribeParametersCommand.ts b/clients/client-dax/src/commands/DescribeParametersCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeParametersCommand.ts rename to clients/client-dax/src/commands/DescribeParametersCommand.ts diff --git a/clients/client-dax/commands/DescribeSubnetGroupsCommand.ts b/clients/client-dax/src/commands/DescribeSubnetGroupsCommand.ts similarity index 100% rename from clients/client-dax/commands/DescribeSubnetGroupsCommand.ts rename to clients/client-dax/src/commands/DescribeSubnetGroupsCommand.ts diff --git a/clients/client-dax/commands/IncreaseReplicationFactorCommand.ts b/clients/client-dax/src/commands/IncreaseReplicationFactorCommand.ts similarity index 100% rename from clients/client-dax/commands/IncreaseReplicationFactorCommand.ts rename to clients/client-dax/src/commands/IncreaseReplicationFactorCommand.ts diff --git a/clients/client-dax/commands/ListTagsCommand.ts b/clients/client-dax/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-dax/commands/ListTagsCommand.ts rename to clients/client-dax/src/commands/ListTagsCommand.ts diff --git a/clients/client-dax/commands/RebootNodeCommand.ts b/clients/client-dax/src/commands/RebootNodeCommand.ts similarity index 100% rename from clients/client-dax/commands/RebootNodeCommand.ts rename to clients/client-dax/src/commands/RebootNodeCommand.ts diff --git a/clients/client-dax/commands/TagResourceCommand.ts b/clients/client-dax/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-dax/commands/TagResourceCommand.ts rename to clients/client-dax/src/commands/TagResourceCommand.ts diff --git a/clients/client-dax/commands/UntagResourceCommand.ts b/clients/client-dax/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-dax/commands/UntagResourceCommand.ts rename to clients/client-dax/src/commands/UntagResourceCommand.ts diff --git a/clients/client-dax/commands/UpdateClusterCommand.ts b/clients/client-dax/src/commands/UpdateClusterCommand.ts similarity index 100% rename from clients/client-dax/commands/UpdateClusterCommand.ts rename to clients/client-dax/src/commands/UpdateClusterCommand.ts diff --git a/clients/client-dax/commands/UpdateParameterGroupCommand.ts b/clients/client-dax/src/commands/UpdateParameterGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/UpdateParameterGroupCommand.ts rename to clients/client-dax/src/commands/UpdateParameterGroupCommand.ts diff --git a/clients/client-dax/commands/UpdateSubnetGroupCommand.ts b/clients/client-dax/src/commands/UpdateSubnetGroupCommand.ts similarity index 100% rename from clients/client-dax/commands/UpdateSubnetGroupCommand.ts rename to clients/client-dax/src/commands/UpdateSubnetGroupCommand.ts diff --git a/clients/client-dax/endpoints.ts b/clients/client-dax/src/endpoints.ts similarity index 100% rename from clients/client-dax/endpoints.ts rename to clients/client-dax/src/endpoints.ts diff --git a/clients/client-dax/index.ts b/clients/client-dax/src/index.ts similarity index 100% rename from clients/client-dax/index.ts rename to clients/client-dax/src/index.ts diff --git a/clients/client-dax/models/index.ts b/clients/client-dax/src/models/index.ts similarity index 100% rename from clients/client-dax/models/index.ts rename to clients/client-dax/src/models/index.ts diff --git a/clients/client-dax/models/models_0.ts b/clients/client-dax/src/models/models_0.ts similarity index 100% rename from clients/client-dax/models/models_0.ts rename to clients/client-dax/src/models/models_0.ts diff --git a/clients/client-dax/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-dax/protocols/Aws_json1_1.ts rename to clients/client-dax/src/protocols/Aws_json1_1.ts diff --git a/clients/client-dax/src/runtimeConfig.browser.ts b/clients/client-dax/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fd9a121f96f3 --- /dev/null +++ b/clients/client-dax/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DAXClientConfig } from "./DAXClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DAXClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dax/runtimeConfig.native.ts b/clients/client-dax/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-dax/runtimeConfig.native.ts rename to clients/client-dax/src/runtimeConfig.native.ts diff --git a/clients/client-dax/runtimeConfig.shared.ts b/clients/client-dax/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-dax/runtimeConfig.shared.ts rename to clients/client-dax/src/runtimeConfig.shared.ts diff --git a/clients/client-dax/src/runtimeConfig.ts b/clients/client-dax/src/runtimeConfig.ts new file mode 100644 index 000000000000..4b4286806872 --- /dev/null +++ b/clients/client-dax/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DAXClientConfig } from "./DAXClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DAXClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dax/tsconfig.es.json b/clients/client-dax/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-dax/tsconfig.es.json +++ b/clients/client-dax/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-dax/tsconfig.json b/clients/client-dax/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-dax/tsconfig.json +++ b/clients/client-dax/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-dax/tsconfig.types.json b/clients/client-dax/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-dax/tsconfig.types.json +++ b/clients/client-dax/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-detective/.gitignore b/clients/client-detective/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-detective/.gitignore +++ b/clients/client-detective/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-detective/package.json b/clients/client-detective/package.json index ecba7757d347..daf4da0985a2 100644 --- a/clients/client-detective/package.json +++ b/clients/client-detective/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-detective", "repository": { "type": "git", diff --git a/clients/client-detective/runtimeConfig.browser.ts b/clients/client-detective/runtimeConfig.browser.ts deleted file mode 100644 index 2020b471d9ac..000000000000 --- a/clients/client-detective/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DetectiveClientConfig } from "./DetectiveClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DetectiveClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-detective/runtimeConfig.ts b/clients/client-detective/runtimeConfig.ts deleted file mode 100644 index cf55ef25b302..000000000000 --- a/clients/client-detective/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DetectiveClientConfig } from "./DetectiveClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DetectiveClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-detective/Detective.ts b/clients/client-detective/src/Detective.ts similarity index 100% rename from clients/client-detective/Detective.ts rename to clients/client-detective/src/Detective.ts diff --git a/clients/client-detective/DetectiveClient.ts b/clients/client-detective/src/DetectiveClient.ts similarity index 100% rename from clients/client-detective/DetectiveClient.ts rename to clients/client-detective/src/DetectiveClient.ts diff --git a/clients/client-detective/commands/AcceptInvitationCommand.ts b/clients/client-detective/src/commands/AcceptInvitationCommand.ts similarity index 100% rename from clients/client-detective/commands/AcceptInvitationCommand.ts rename to clients/client-detective/src/commands/AcceptInvitationCommand.ts diff --git a/clients/client-detective/commands/CreateGraphCommand.ts b/clients/client-detective/src/commands/CreateGraphCommand.ts similarity index 100% rename from clients/client-detective/commands/CreateGraphCommand.ts rename to clients/client-detective/src/commands/CreateGraphCommand.ts diff --git a/clients/client-detective/commands/CreateMembersCommand.ts b/clients/client-detective/src/commands/CreateMembersCommand.ts similarity index 100% rename from clients/client-detective/commands/CreateMembersCommand.ts rename to clients/client-detective/src/commands/CreateMembersCommand.ts diff --git a/clients/client-detective/commands/DeleteGraphCommand.ts b/clients/client-detective/src/commands/DeleteGraphCommand.ts similarity index 100% rename from clients/client-detective/commands/DeleteGraphCommand.ts rename to clients/client-detective/src/commands/DeleteGraphCommand.ts diff --git a/clients/client-detective/commands/DeleteMembersCommand.ts b/clients/client-detective/src/commands/DeleteMembersCommand.ts similarity index 100% rename from clients/client-detective/commands/DeleteMembersCommand.ts rename to clients/client-detective/src/commands/DeleteMembersCommand.ts diff --git a/clients/client-detective/commands/DisassociateMembershipCommand.ts b/clients/client-detective/src/commands/DisassociateMembershipCommand.ts similarity index 100% rename from clients/client-detective/commands/DisassociateMembershipCommand.ts rename to clients/client-detective/src/commands/DisassociateMembershipCommand.ts diff --git a/clients/client-detective/commands/GetMembersCommand.ts b/clients/client-detective/src/commands/GetMembersCommand.ts similarity index 100% rename from clients/client-detective/commands/GetMembersCommand.ts rename to clients/client-detective/src/commands/GetMembersCommand.ts diff --git a/clients/client-detective/commands/ListGraphsCommand.ts b/clients/client-detective/src/commands/ListGraphsCommand.ts similarity index 100% rename from clients/client-detective/commands/ListGraphsCommand.ts rename to clients/client-detective/src/commands/ListGraphsCommand.ts diff --git a/clients/client-detective/commands/ListInvitationsCommand.ts b/clients/client-detective/src/commands/ListInvitationsCommand.ts similarity index 100% rename from clients/client-detective/commands/ListInvitationsCommand.ts rename to clients/client-detective/src/commands/ListInvitationsCommand.ts diff --git a/clients/client-detective/commands/ListMembersCommand.ts b/clients/client-detective/src/commands/ListMembersCommand.ts similarity index 100% rename from clients/client-detective/commands/ListMembersCommand.ts rename to clients/client-detective/src/commands/ListMembersCommand.ts diff --git a/clients/client-detective/commands/ListTagsForResourceCommand.ts b/clients/client-detective/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-detective/commands/ListTagsForResourceCommand.ts rename to clients/client-detective/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-detective/commands/RejectInvitationCommand.ts b/clients/client-detective/src/commands/RejectInvitationCommand.ts similarity index 100% rename from clients/client-detective/commands/RejectInvitationCommand.ts rename to clients/client-detective/src/commands/RejectInvitationCommand.ts diff --git a/clients/client-detective/commands/StartMonitoringMemberCommand.ts b/clients/client-detective/src/commands/StartMonitoringMemberCommand.ts similarity index 100% rename from clients/client-detective/commands/StartMonitoringMemberCommand.ts rename to clients/client-detective/src/commands/StartMonitoringMemberCommand.ts diff --git a/clients/client-detective/commands/TagResourceCommand.ts b/clients/client-detective/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-detective/commands/TagResourceCommand.ts rename to clients/client-detective/src/commands/TagResourceCommand.ts diff --git a/clients/client-detective/commands/UntagResourceCommand.ts b/clients/client-detective/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-detective/commands/UntagResourceCommand.ts rename to clients/client-detective/src/commands/UntagResourceCommand.ts diff --git a/clients/client-detective/endpoints.ts b/clients/client-detective/src/endpoints.ts similarity index 100% rename from clients/client-detective/endpoints.ts rename to clients/client-detective/src/endpoints.ts diff --git a/clients/client-detective/index.ts b/clients/client-detective/src/index.ts similarity index 100% rename from clients/client-detective/index.ts rename to clients/client-detective/src/index.ts diff --git a/clients/client-detective/models/index.ts b/clients/client-detective/src/models/index.ts similarity index 100% rename from clients/client-detective/models/index.ts rename to clients/client-detective/src/models/index.ts diff --git a/clients/client-detective/models/models_0.ts b/clients/client-detective/src/models/models_0.ts similarity index 100% rename from clients/client-detective/models/models_0.ts rename to clients/client-detective/src/models/models_0.ts diff --git a/clients/client-detective/pagination/Interfaces.ts b/clients/client-detective/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-detective/pagination/Interfaces.ts rename to clients/client-detective/src/pagination/Interfaces.ts diff --git a/clients/client-detective/pagination/ListGraphsPaginator.ts b/clients/client-detective/src/pagination/ListGraphsPaginator.ts similarity index 100% rename from clients/client-detective/pagination/ListGraphsPaginator.ts rename to clients/client-detective/src/pagination/ListGraphsPaginator.ts diff --git a/clients/client-detective/pagination/ListInvitationsPaginator.ts b/clients/client-detective/src/pagination/ListInvitationsPaginator.ts similarity index 100% rename from clients/client-detective/pagination/ListInvitationsPaginator.ts rename to clients/client-detective/src/pagination/ListInvitationsPaginator.ts diff --git a/clients/client-detective/pagination/ListMembersPaginator.ts b/clients/client-detective/src/pagination/ListMembersPaginator.ts similarity index 100% rename from clients/client-detective/pagination/ListMembersPaginator.ts rename to clients/client-detective/src/pagination/ListMembersPaginator.ts diff --git a/clients/client-detective/protocols/Aws_restJson1.ts b/clients/client-detective/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-detective/protocols/Aws_restJson1.ts rename to clients/client-detective/src/protocols/Aws_restJson1.ts diff --git a/clients/client-detective/src/runtimeConfig.browser.ts b/clients/client-detective/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a61daf465f53 --- /dev/null +++ b/clients/client-detective/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DetectiveClientConfig } from "./DetectiveClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DetectiveClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-detective/runtimeConfig.native.ts b/clients/client-detective/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-detective/runtimeConfig.native.ts rename to clients/client-detective/src/runtimeConfig.native.ts diff --git a/clients/client-detective/runtimeConfig.shared.ts b/clients/client-detective/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-detective/runtimeConfig.shared.ts rename to clients/client-detective/src/runtimeConfig.shared.ts diff --git a/clients/client-detective/src/runtimeConfig.ts b/clients/client-detective/src/runtimeConfig.ts new file mode 100644 index 000000000000..9dcf0c6877ab --- /dev/null +++ b/clients/client-detective/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DetectiveClientConfig } from "./DetectiveClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DetectiveClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-detective/tsconfig.es.json b/clients/client-detective/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-detective/tsconfig.es.json +++ b/clients/client-detective/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-detective/tsconfig.json b/clients/client-detective/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-detective/tsconfig.json +++ b/clients/client-detective/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-detective/tsconfig.types.json b/clients/client-detective/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-detective/tsconfig.types.json +++ b/clients/client-detective/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-device-farm/.gitignore b/clients/client-device-farm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-device-farm/.gitignore +++ b/clients/client-device-farm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-device-farm/package.json b/clients/client-device-farm/package.json index 743bc7a56f7e..6f4c9bec44a0 100644 --- a/clients/client-device-farm/package.json +++ b/clients/client-device-farm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-device-farm", "repository": { "type": "git", diff --git a/clients/client-device-farm/runtimeConfig.browser.ts b/clients/client-device-farm/runtimeConfig.browser.ts deleted file mode 100644 index d120edb0709f..000000000000 --- a/clients/client-device-farm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DeviceFarmClientConfig } from "./DeviceFarmClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-device-farm/runtimeConfig.ts b/clients/client-device-farm/runtimeConfig.ts deleted file mode 100644 index 15a3f2fb828a..000000000000 --- a/clients/client-device-farm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DeviceFarmClientConfig } from "./DeviceFarmClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-device-farm/DeviceFarm.ts b/clients/client-device-farm/src/DeviceFarm.ts similarity index 100% rename from clients/client-device-farm/DeviceFarm.ts rename to clients/client-device-farm/src/DeviceFarm.ts diff --git a/clients/client-device-farm/DeviceFarmClient.ts b/clients/client-device-farm/src/DeviceFarmClient.ts similarity index 100% rename from clients/client-device-farm/DeviceFarmClient.ts rename to clients/client-device-farm/src/DeviceFarmClient.ts diff --git a/clients/client-device-farm/commands/CreateDevicePoolCommand.ts b/clients/client-device-farm/src/commands/CreateDevicePoolCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateDevicePoolCommand.ts rename to clients/client-device-farm/src/commands/CreateDevicePoolCommand.ts diff --git a/clients/client-device-farm/commands/CreateInstanceProfileCommand.ts b/clients/client-device-farm/src/commands/CreateInstanceProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateInstanceProfileCommand.ts rename to clients/client-device-farm/src/commands/CreateInstanceProfileCommand.ts diff --git a/clients/client-device-farm/commands/CreateNetworkProfileCommand.ts b/clients/client-device-farm/src/commands/CreateNetworkProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateNetworkProfileCommand.ts rename to clients/client-device-farm/src/commands/CreateNetworkProfileCommand.ts diff --git a/clients/client-device-farm/commands/CreateProjectCommand.ts b/clients/client-device-farm/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateProjectCommand.ts rename to clients/client-device-farm/src/commands/CreateProjectCommand.ts diff --git a/clients/client-device-farm/commands/CreateRemoteAccessSessionCommand.ts b/clients/client-device-farm/src/commands/CreateRemoteAccessSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateRemoteAccessSessionCommand.ts rename to clients/client-device-farm/src/commands/CreateRemoteAccessSessionCommand.ts diff --git a/clients/client-device-farm/commands/CreateTestGridProjectCommand.ts b/clients/client-device-farm/src/commands/CreateTestGridProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateTestGridProjectCommand.ts rename to clients/client-device-farm/src/commands/CreateTestGridProjectCommand.ts diff --git a/clients/client-device-farm/commands/CreateTestGridUrlCommand.ts b/clients/client-device-farm/src/commands/CreateTestGridUrlCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateTestGridUrlCommand.ts rename to clients/client-device-farm/src/commands/CreateTestGridUrlCommand.ts diff --git a/clients/client-device-farm/commands/CreateUploadCommand.ts b/clients/client-device-farm/src/commands/CreateUploadCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateUploadCommand.ts rename to clients/client-device-farm/src/commands/CreateUploadCommand.ts diff --git a/clients/client-device-farm/commands/CreateVPCEConfigurationCommand.ts b/clients/client-device-farm/src/commands/CreateVPCEConfigurationCommand.ts similarity index 100% rename from clients/client-device-farm/commands/CreateVPCEConfigurationCommand.ts rename to clients/client-device-farm/src/commands/CreateVPCEConfigurationCommand.ts diff --git a/clients/client-device-farm/commands/DeleteDevicePoolCommand.ts b/clients/client-device-farm/src/commands/DeleteDevicePoolCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteDevicePoolCommand.ts rename to clients/client-device-farm/src/commands/DeleteDevicePoolCommand.ts diff --git a/clients/client-device-farm/commands/DeleteInstanceProfileCommand.ts b/clients/client-device-farm/src/commands/DeleteInstanceProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteInstanceProfileCommand.ts rename to clients/client-device-farm/src/commands/DeleteInstanceProfileCommand.ts diff --git a/clients/client-device-farm/commands/DeleteNetworkProfileCommand.ts b/clients/client-device-farm/src/commands/DeleteNetworkProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteNetworkProfileCommand.ts rename to clients/client-device-farm/src/commands/DeleteNetworkProfileCommand.ts diff --git a/clients/client-device-farm/commands/DeleteProjectCommand.ts b/clients/client-device-farm/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteProjectCommand.ts rename to clients/client-device-farm/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-device-farm/commands/DeleteRemoteAccessSessionCommand.ts b/clients/client-device-farm/src/commands/DeleteRemoteAccessSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteRemoteAccessSessionCommand.ts rename to clients/client-device-farm/src/commands/DeleteRemoteAccessSessionCommand.ts diff --git a/clients/client-device-farm/commands/DeleteRunCommand.ts b/clients/client-device-farm/src/commands/DeleteRunCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteRunCommand.ts rename to clients/client-device-farm/src/commands/DeleteRunCommand.ts diff --git a/clients/client-device-farm/commands/DeleteTestGridProjectCommand.ts b/clients/client-device-farm/src/commands/DeleteTestGridProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteTestGridProjectCommand.ts rename to clients/client-device-farm/src/commands/DeleteTestGridProjectCommand.ts diff --git a/clients/client-device-farm/commands/DeleteUploadCommand.ts b/clients/client-device-farm/src/commands/DeleteUploadCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteUploadCommand.ts rename to clients/client-device-farm/src/commands/DeleteUploadCommand.ts diff --git a/clients/client-device-farm/commands/DeleteVPCEConfigurationCommand.ts b/clients/client-device-farm/src/commands/DeleteVPCEConfigurationCommand.ts similarity index 100% rename from clients/client-device-farm/commands/DeleteVPCEConfigurationCommand.ts rename to clients/client-device-farm/src/commands/DeleteVPCEConfigurationCommand.ts diff --git a/clients/client-device-farm/commands/GetAccountSettingsCommand.ts b/clients/client-device-farm/src/commands/GetAccountSettingsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetAccountSettingsCommand.ts rename to clients/client-device-farm/src/commands/GetAccountSettingsCommand.ts diff --git a/clients/client-device-farm/commands/GetDeviceCommand.ts b/clients/client-device-farm/src/commands/GetDeviceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetDeviceCommand.ts rename to clients/client-device-farm/src/commands/GetDeviceCommand.ts diff --git a/clients/client-device-farm/commands/GetDeviceInstanceCommand.ts b/clients/client-device-farm/src/commands/GetDeviceInstanceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetDeviceInstanceCommand.ts rename to clients/client-device-farm/src/commands/GetDeviceInstanceCommand.ts diff --git a/clients/client-device-farm/commands/GetDevicePoolCommand.ts b/clients/client-device-farm/src/commands/GetDevicePoolCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetDevicePoolCommand.ts rename to clients/client-device-farm/src/commands/GetDevicePoolCommand.ts diff --git a/clients/client-device-farm/commands/GetDevicePoolCompatibilityCommand.ts b/clients/client-device-farm/src/commands/GetDevicePoolCompatibilityCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetDevicePoolCompatibilityCommand.ts rename to clients/client-device-farm/src/commands/GetDevicePoolCompatibilityCommand.ts diff --git a/clients/client-device-farm/commands/GetInstanceProfileCommand.ts b/clients/client-device-farm/src/commands/GetInstanceProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetInstanceProfileCommand.ts rename to clients/client-device-farm/src/commands/GetInstanceProfileCommand.ts diff --git a/clients/client-device-farm/commands/GetJobCommand.ts b/clients/client-device-farm/src/commands/GetJobCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetJobCommand.ts rename to clients/client-device-farm/src/commands/GetJobCommand.ts diff --git a/clients/client-device-farm/commands/GetNetworkProfileCommand.ts b/clients/client-device-farm/src/commands/GetNetworkProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetNetworkProfileCommand.ts rename to clients/client-device-farm/src/commands/GetNetworkProfileCommand.ts diff --git a/clients/client-device-farm/commands/GetOfferingStatusCommand.ts b/clients/client-device-farm/src/commands/GetOfferingStatusCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetOfferingStatusCommand.ts rename to clients/client-device-farm/src/commands/GetOfferingStatusCommand.ts diff --git a/clients/client-device-farm/commands/GetProjectCommand.ts b/clients/client-device-farm/src/commands/GetProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetProjectCommand.ts rename to clients/client-device-farm/src/commands/GetProjectCommand.ts diff --git a/clients/client-device-farm/commands/GetRemoteAccessSessionCommand.ts b/clients/client-device-farm/src/commands/GetRemoteAccessSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetRemoteAccessSessionCommand.ts rename to clients/client-device-farm/src/commands/GetRemoteAccessSessionCommand.ts diff --git a/clients/client-device-farm/commands/GetRunCommand.ts b/clients/client-device-farm/src/commands/GetRunCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetRunCommand.ts rename to clients/client-device-farm/src/commands/GetRunCommand.ts diff --git a/clients/client-device-farm/commands/GetSuiteCommand.ts b/clients/client-device-farm/src/commands/GetSuiteCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetSuiteCommand.ts rename to clients/client-device-farm/src/commands/GetSuiteCommand.ts diff --git a/clients/client-device-farm/commands/GetTestCommand.ts b/clients/client-device-farm/src/commands/GetTestCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetTestCommand.ts rename to clients/client-device-farm/src/commands/GetTestCommand.ts diff --git a/clients/client-device-farm/commands/GetTestGridProjectCommand.ts b/clients/client-device-farm/src/commands/GetTestGridProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetTestGridProjectCommand.ts rename to clients/client-device-farm/src/commands/GetTestGridProjectCommand.ts diff --git a/clients/client-device-farm/commands/GetTestGridSessionCommand.ts b/clients/client-device-farm/src/commands/GetTestGridSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetTestGridSessionCommand.ts rename to clients/client-device-farm/src/commands/GetTestGridSessionCommand.ts diff --git a/clients/client-device-farm/commands/GetUploadCommand.ts b/clients/client-device-farm/src/commands/GetUploadCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetUploadCommand.ts rename to clients/client-device-farm/src/commands/GetUploadCommand.ts diff --git a/clients/client-device-farm/commands/GetVPCEConfigurationCommand.ts b/clients/client-device-farm/src/commands/GetVPCEConfigurationCommand.ts similarity index 100% rename from clients/client-device-farm/commands/GetVPCEConfigurationCommand.ts rename to clients/client-device-farm/src/commands/GetVPCEConfigurationCommand.ts diff --git a/clients/client-device-farm/commands/InstallToRemoteAccessSessionCommand.ts b/clients/client-device-farm/src/commands/InstallToRemoteAccessSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/InstallToRemoteAccessSessionCommand.ts rename to clients/client-device-farm/src/commands/InstallToRemoteAccessSessionCommand.ts diff --git a/clients/client-device-farm/commands/ListArtifactsCommand.ts b/clients/client-device-farm/src/commands/ListArtifactsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListArtifactsCommand.ts rename to clients/client-device-farm/src/commands/ListArtifactsCommand.ts diff --git a/clients/client-device-farm/commands/ListDeviceInstancesCommand.ts b/clients/client-device-farm/src/commands/ListDeviceInstancesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListDeviceInstancesCommand.ts rename to clients/client-device-farm/src/commands/ListDeviceInstancesCommand.ts diff --git a/clients/client-device-farm/commands/ListDevicePoolsCommand.ts b/clients/client-device-farm/src/commands/ListDevicePoolsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListDevicePoolsCommand.ts rename to clients/client-device-farm/src/commands/ListDevicePoolsCommand.ts diff --git a/clients/client-device-farm/commands/ListDevicesCommand.ts b/clients/client-device-farm/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListDevicesCommand.ts rename to clients/client-device-farm/src/commands/ListDevicesCommand.ts diff --git a/clients/client-device-farm/commands/ListInstanceProfilesCommand.ts b/clients/client-device-farm/src/commands/ListInstanceProfilesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListInstanceProfilesCommand.ts rename to clients/client-device-farm/src/commands/ListInstanceProfilesCommand.ts diff --git a/clients/client-device-farm/commands/ListJobsCommand.ts b/clients/client-device-farm/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListJobsCommand.ts rename to clients/client-device-farm/src/commands/ListJobsCommand.ts diff --git a/clients/client-device-farm/commands/ListNetworkProfilesCommand.ts b/clients/client-device-farm/src/commands/ListNetworkProfilesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListNetworkProfilesCommand.ts rename to clients/client-device-farm/src/commands/ListNetworkProfilesCommand.ts diff --git a/clients/client-device-farm/commands/ListOfferingPromotionsCommand.ts b/clients/client-device-farm/src/commands/ListOfferingPromotionsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListOfferingPromotionsCommand.ts rename to clients/client-device-farm/src/commands/ListOfferingPromotionsCommand.ts diff --git a/clients/client-device-farm/commands/ListOfferingTransactionsCommand.ts b/clients/client-device-farm/src/commands/ListOfferingTransactionsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListOfferingTransactionsCommand.ts rename to clients/client-device-farm/src/commands/ListOfferingTransactionsCommand.ts diff --git a/clients/client-device-farm/commands/ListOfferingsCommand.ts b/clients/client-device-farm/src/commands/ListOfferingsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListOfferingsCommand.ts rename to clients/client-device-farm/src/commands/ListOfferingsCommand.ts diff --git a/clients/client-device-farm/commands/ListProjectsCommand.ts b/clients/client-device-farm/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListProjectsCommand.ts rename to clients/client-device-farm/src/commands/ListProjectsCommand.ts diff --git a/clients/client-device-farm/commands/ListRemoteAccessSessionsCommand.ts b/clients/client-device-farm/src/commands/ListRemoteAccessSessionsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListRemoteAccessSessionsCommand.ts rename to clients/client-device-farm/src/commands/ListRemoteAccessSessionsCommand.ts diff --git a/clients/client-device-farm/commands/ListRunsCommand.ts b/clients/client-device-farm/src/commands/ListRunsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListRunsCommand.ts rename to clients/client-device-farm/src/commands/ListRunsCommand.ts diff --git a/clients/client-device-farm/commands/ListSamplesCommand.ts b/clients/client-device-farm/src/commands/ListSamplesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListSamplesCommand.ts rename to clients/client-device-farm/src/commands/ListSamplesCommand.ts diff --git a/clients/client-device-farm/commands/ListSuitesCommand.ts b/clients/client-device-farm/src/commands/ListSuitesCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListSuitesCommand.ts rename to clients/client-device-farm/src/commands/ListSuitesCommand.ts diff --git a/clients/client-device-farm/commands/ListTagsForResourceCommand.ts b/clients/client-device-farm/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTagsForResourceCommand.ts rename to clients/client-device-farm/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-device-farm/commands/ListTestGridProjectsCommand.ts b/clients/client-device-farm/src/commands/ListTestGridProjectsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTestGridProjectsCommand.ts rename to clients/client-device-farm/src/commands/ListTestGridProjectsCommand.ts diff --git a/clients/client-device-farm/commands/ListTestGridSessionActionsCommand.ts b/clients/client-device-farm/src/commands/ListTestGridSessionActionsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTestGridSessionActionsCommand.ts rename to clients/client-device-farm/src/commands/ListTestGridSessionActionsCommand.ts diff --git a/clients/client-device-farm/commands/ListTestGridSessionArtifactsCommand.ts b/clients/client-device-farm/src/commands/ListTestGridSessionArtifactsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTestGridSessionArtifactsCommand.ts rename to clients/client-device-farm/src/commands/ListTestGridSessionArtifactsCommand.ts diff --git a/clients/client-device-farm/commands/ListTestGridSessionsCommand.ts b/clients/client-device-farm/src/commands/ListTestGridSessionsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTestGridSessionsCommand.ts rename to clients/client-device-farm/src/commands/ListTestGridSessionsCommand.ts diff --git a/clients/client-device-farm/commands/ListTestsCommand.ts b/clients/client-device-farm/src/commands/ListTestsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListTestsCommand.ts rename to clients/client-device-farm/src/commands/ListTestsCommand.ts diff --git a/clients/client-device-farm/commands/ListUniqueProblemsCommand.ts b/clients/client-device-farm/src/commands/ListUniqueProblemsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListUniqueProblemsCommand.ts rename to clients/client-device-farm/src/commands/ListUniqueProblemsCommand.ts diff --git a/clients/client-device-farm/commands/ListUploadsCommand.ts b/clients/client-device-farm/src/commands/ListUploadsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListUploadsCommand.ts rename to clients/client-device-farm/src/commands/ListUploadsCommand.ts diff --git a/clients/client-device-farm/commands/ListVPCEConfigurationsCommand.ts b/clients/client-device-farm/src/commands/ListVPCEConfigurationsCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ListVPCEConfigurationsCommand.ts rename to clients/client-device-farm/src/commands/ListVPCEConfigurationsCommand.ts diff --git a/clients/client-device-farm/commands/PurchaseOfferingCommand.ts b/clients/client-device-farm/src/commands/PurchaseOfferingCommand.ts similarity index 100% rename from clients/client-device-farm/commands/PurchaseOfferingCommand.ts rename to clients/client-device-farm/src/commands/PurchaseOfferingCommand.ts diff --git a/clients/client-device-farm/commands/RenewOfferingCommand.ts b/clients/client-device-farm/src/commands/RenewOfferingCommand.ts similarity index 100% rename from clients/client-device-farm/commands/RenewOfferingCommand.ts rename to clients/client-device-farm/src/commands/RenewOfferingCommand.ts diff --git a/clients/client-device-farm/commands/ScheduleRunCommand.ts b/clients/client-device-farm/src/commands/ScheduleRunCommand.ts similarity index 100% rename from clients/client-device-farm/commands/ScheduleRunCommand.ts rename to clients/client-device-farm/src/commands/ScheduleRunCommand.ts diff --git a/clients/client-device-farm/commands/StopJobCommand.ts b/clients/client-device-farm/src/commands/StopJobCommand.ts similarity index 100% rename from clients/client-device-farm/commands/StopJobCommand.ts rename to clients/client-device-farm/src/commands/StopJobCommand.ts diff --git a/clients/client-device-farm/commands/StopRemoteAccessSessionCommand.ts b/clients/client-device-farm/src/commands/StopRemoteAccessSessionCommand.ts similarity index 100% rename from clients/client-device-farm/commands/StopRemoteAccessSessionCommand.ts rename to clients/client-device-farm/src/commands/StopRemoteAccessSessionCommand.ts diff --git a/clients/client-device-farm/commands/StopRunCommand.ts b/clients/client-device-farm/src/commands/StopRunCommand.ts similarity index 100% rename from clients/client-device-farm/commands/StopRunCommand.ts rename to clients/client-device-farm/src/commands/StopRunCommand.ts diff --git a/clients/client-device-farm/commands/TagResourceCommand.ts b/clients/client-device-farm/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/TagResourceCommand.ts rename to clients/client-device-farm/src/commands/TagResourceCommand.ts diff --git a/clients/client-device-farm/commands/UntagResourceCommand.ts b/clients/client-device-farm/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UntagResourceCommand.ts rename to clients/client-device-farm/src/commands/UntagResourceCommand.ts diff --git a/clients/client-device-farm/commands/UpdateDeviceInstanceCommand.ts b/clients/client-device-farm/src/commands/UpdateDeviceInstanceCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateDeviceInstanceCommand.ts rename to clients/client-device-farm/src/commands/UpdateDeviceInstanceCommand.ts diff --git a/clients/client-device-farm/commands/UpdateDevicePoolCommand.ts b/clients/client-device-farm/src/commands/UpdateDevicePoolCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateDevicePoolCommand.ts rename to clients/client-device-farm/src/commands/UpdateDevicePoolCommand.ts diff --git a/clients/client-device-farm/commands/UpdateInstanceProfileCommand.ts b/clients/client-device-farm/src/commands/UpdateInstanceProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateInstanceProfileCommand.ts rename to clients/client-device-farm/src/commands/UpdateInstanceProfileCommand.ts diff --git a/clients/client-device-farm/commands/UpdateNetworkProfileCommand.ts b/clients/client-device-farm/src/commands/UpdateNetworkProfileCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateNetworkProfileCommand.ts rename to clients/client-device-farm/src/commands/UpdateNetworkProfileCommand.ts diff --git a/clients/client-device-farm/commands/UpdateProjectCommand.ts b/clients/client-device-farm/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateProjectCommand.ts rename to clients/client-device-farm/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-device-farm/commands/UpdateTestGridProjectCommand.ts b/clients/client-device-farm/src/commands/UpdateTestGridProjectCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateTestGridProjectCommand.ts rename to clients/client-device-farm/src/commands/UpdateTestGridProjectCommand.ts diff --git a/clients/client-device-farm/commands/UpdateUploadCommand.ts b/clients/client-device-farm/src/commands/UpdateUploadCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateUploadCommand.ts rename to clients/client-device-farm/src/commands/UpdateUploadCommand.ts diff --git a/clients/client-device-farm/commands/UpdateVPCEConfigurationCommand.ts b/clients/client-device-farm/src/commands/UpdateVPCEConfigurationCommand.ts similarity index 100% rename from clients/client-device-farm/commands/UpdateVPCEConfigurationCommand.ts rename to clients/client-device-farm/src/commands/UpdateVPCEConfigurationCommand.ts diff --git a/clients/client-device-farm/endpoints.ts b/clients/client-device-farm/src/endpoints.ts similarity index 100% rename from clients/client-device-farm/endpoints.ts rename to clients/client-device-farm/src/endpoints.ts diff --git a/clients/client-device-farm/index.ts b/clients/client-device-farm/src/index.ts similarity index 100% rename from clients/client-device-farm/index.ts rename to clients/client-device-farm/src/index.ts diff --git a/clients/client-device-farm/models/index.ts b/clients/client-device-farm/src/models/index.ts similarity index 100% rename from clients/client-device-farm/models/index.ts rename to clients/client-device-farm/src/models/index.ts diff --git a/clients/client-device-farm/models/models_0.ts b/clients/client-device-farm/src/models/models_0.ts similarity index 100% rename from clients/client-device-farm/models/models_0.ts rename to clients/client-device-farm/src/models/models_0.ts diff --git a/clients/client-device-farm/pagination/GetOfferingStatusPaginator.ts b/clients/client-device-farm/src/pagination/GetOfferingStatusPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/GetOfferingStatusPaginator.ts rename to clients/client-device-farm/src/pagination/GetOfferingStatusPaginator.ts diff --git a/clients/client-device-farm/pagination/Interfaces.ts b/clients/client-device-farm/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-device-farm/pagination/Interfaces.ts rename to clients/client-device-farm/src/pagination/Interfaces.ts diff --git a/clients/client-device-farm/pagination/ListArtifactsPaginator.ts b/clients/client-device-farm/src/pagination/ListArtifactsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListArtifactsPaginator.ts rename to clients/client-device-farm/src/pagination/ListArtifactsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListDevicePoolsPaginator.ts b/clients/client-device-farm/src/pagination/ListDevicePoolsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListDevicePoolsPaginator.ts rename to clients/client-device-farm/src/pagination/ListDevicePoolsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListDevicesPaginator.ts b/clients/client-device-farm/src/pagination/ListDevicesPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListDevicesPaginator.ts rename to clients/client-device-farm/src/pagination/ListDevicesPaginator.ts diff --git a/clients/client-device-farm/pagination/ListJobsPaginator.ts b/clients/client-device-farm/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListJobsPaginator.ts rename to clients/client-device-farm/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListOfferingTransactionsPaginator.ts b/clients/client-device-farm/src/pagination/ListOfferingTransactionsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListOfferingTransactionsPaginator.ts rename to clients/client-device-farm/src/pagination/ListOfferingTransactionsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListOfferingsPaginator.ts b/clients/client-device-farm/src/pagination/ListOfferingsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListOfferingsPaginator.ts rename to clients/client-device-farm/src/pagination/ListOfferingsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListProjectsPaginator.ts b/clients/client-device-farm/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListProjectsPaginator.ts rename to clients/client-device-farm/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListRunsPaginator.ts b/clients/client-device-farm/src/pagination/ListRunsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListRunsPaginator.ts rename to clients/client-device-farm/src/pagination/ListRunsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListSamplesPaginator.ts b/clients/client-device-farm/src/pagination/ListSamplesPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListSamplesPaginator.ts rename to clients/client-device-farm/src/pagination/ListSamplesPaginator.ts diff --git a/clients/client-device-farm/pagination/ListSuitesPaginator.ts b/clients/client-device-farm/src/pagination/ListSuitesPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListSuitesPaginator.ts rename to clients/client-device-farm/src/pagination/ListSuitesPaginator.ts diff --git a/clients/client-device-farm/pagination/ListTestGridProjectsPaginator.ts b/clients/client-device-farm/src/pagination/ListTestGridProjectsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListTestGridProjectsPaginator.ts rename to clients/client-device-farm/src/pagination/ListTestGridProjectsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListTestGridSessionActionsPaginator.ts b/clients/client-device-farm/src/pagination/ListTestGridSessionActionsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListTestGridSessionActionsPaginator.ts rename to clients/client-device-farm/src/pagination/ListTestGridSessionActionsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListTestGridSessionArtifactsPaginator.ts b/clients/client-device-farm/src/pagination/ListTestGridSessionArtifactsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListTestGridSessionArtifactsPaginator.ts rename to clients/client-device-farm/src/pagination/ListTestGridSessionArtifactsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListTestGridSessionsPaginator.ts b/clients/client-device-farm/src/pagination/ListTestGridSessionsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListTestGridSessionsPaginator.ts rename to clients/client-device-farm/src/pagination/ListTestGridSessionsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListTestsPaginator.ts b/clients/client-device-farm/src/pagination/ListTestsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListTestsPaginator.ts rename to clients/client-device-farm/src/pagination/ListTestsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListUniqueProblemsPaginator.ts b/clients/client-device-farm/src/pagination/ListUniqueProblemsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListUniqueProblemsPaginator.ts rename to clients/client-device-farm/src/pagination/ListUniqueProblemsPaginator.ts diff --git a/clients/client-device-farm/pagination/ListUploadsPaginator.ts b/clients/client-device-farm/src/pagination/ListUploadsPaginator.ts similarity index 100% rename from clients/client-device-farm/pagination/ListUploadsPaginator.ts rename to clients/client-device-farm/src/pagination/ListUploadsPaginator.ts diff --git a/clients/client-device-farm/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-device-farm/protocols/Aws_json1_1.ts rename to clients/client-device-farm/src/protocols/Aws_json1_1.ts diff --git a/clients/client-device-farm/src/runtimeConfig.browser.ts b/clients/client-device-farm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a3bbdee1c673 --- /dev/null +++ b/clients/client-device-farm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DeviceFarmClientConfig } from "./DeviceFarmClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-device-farm/runtimeConfig.native.ts b/clients/client-device-farm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-device-farm/runtimeConfig.native.ts rename to clients/client-device-farm/src/runtimeConfig.native.ts diff --git a/clients/client-device-farm/runtimeConfig.shared.ts b/clients/client-device-farm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-device-farm/runtimeConfig.shared.ts rename to clients/client-device-farm/src/runtimeConfig.shared.ts diff --git a/clients/client-device-farm/src/runtimeConfig.ts b/clients/client-device-farm/src/runtimeConfig.ts new file mode 100644 index 000000000000..f684983fecd9 --- /dev/null +++ b/clients/client-device-farm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DeviceFarmClientConfig } from "./DeviceFarmClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-device-farm/tsconfig.es.json b/clients/client-device-farm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-device-farm/tsconfig.es.json +++ b/clients/client-device-farm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-device-farm/tsconfig.json b/clients/client-device-farm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-device-farm/tsconfig.json +++ b/clients/client-device-farm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-device-farm/tsconfig.types.json b/clients/client-device-farm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-device-farm/tsconfig.types.json +++ b/clients/client-device-farm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-devops-guru/.gitignore b/clients/client-devops-guru/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-devops-guru/.gitignore +++ b/clients/client-devops-guru/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-devops-guru/package.json b/clients/client-devops-guru/package.json index 2601f4d7075f..cc7c2446e4c4 100644 --- a/clients/client-devops-guru/package.json +++ b/clients/client-devops-guru/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-devops-guru", "repository": { "type": "git", diff --git a/clients/client-devops-guru/runtimeConfig.browser.ts b/clients/client-devops-guru/runtimeConfig.browser.ts deleted file mode 100644 index 5a4f1b8fdfca..000000000000 --- a/clients/client-devops-guru/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DevOpsGuruClientConfig } from "./DevOpsGuruClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-devops-guru/runtimeConfig.ts b/clients/client-devops-guru/runtimeConfig.ts deleted file mode 100644 index 3e92675f678e..000000000000 --- a/clients/client-devops-guru/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DevOpsGuruClientConfig } from "./DevOpsGuruClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-devops-guru/DevOpsGuru.ts b/clients/client-devops-guru/src/DevOpsGuru.ts similarity index 100% rename from clients/client-devops-guru/DevOpsGuru.ts rename to clients/client-devops-guru/src/DevOpsGuru.ts diff --git a/clients/client-devops-guru/DevOpsGuruClient.ts b/clients/client-devops-guru/src/DevOpsGuruClient.ts similarity index 100% rename from clients/client-devops-guru/DevOpsGuruClient.ts rename to clients/client-devops-guru/src/DevOpsGuruClient.ts diff --git a/clients/client-devops-guru/commands/AddNotificationChannelCommand.ts b/clients/client-devops-guru/src/commands/AddNotificationChannelCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/AddNotificationChannelCommand.ts rename to clients/client-devops-guru/src/commands/AddNotificationChannelCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeAccountHealthCommand.ts b/clients/client-devops-guru/src/commands/DescribeAccountHealthCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeAccountHealthCommand.ts rename to clients/client-devops-guru/src/commands/DescribeAccountHealthCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeAccountOverviewCommand.ts b/clients/client-devops-guru/src/commands/DescribeAccountOverviewCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeAccountOverviewCommand.ts rename to clients/client-devops-guru/src/commands/DescribeAccountOverviewCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeAnomalyCommand.ts b/clients/client-devops-guru/src/commands/DescribeAnomalyCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeAnomalyCommand.ts rename to clients/client-devops-guru/src/commands/DescribeAnomalyCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeFeedbackCommand.ts b/clients/client-devops-guru/src/commands/DescribeFeedbackCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeFeedbackCommand.ts rename to clients/client-devops-guru/src/commands/DescribeFeedbackCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeInsightCommand.ts b/clients/client-devops-guru/src/commands/DescribeInsightCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeInsightCommand.ts rename to clients/client-devops-guru/src/commands/DescribeInsightCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeResourceCollectionHealthCommand.ts b/clients/client-devops-guru/src/commands/DescribeResourceCollectionHealthCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeResourceCollectionHealthCommand.ts rename to clients/client-devops-guru/src/commands/DescribeResourceCollectionHealthCommand.ts diff --git a/clients/client-devops-guru/commands/DescribeServiceIntegrationCommand.ts b/clients/client-devops-guru/src/commands/DescribeServiceIntegrationCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/DescribeServiceIntegrationCommand.ts rename to clients/client-devops-guru/src/commands/DescribeServiceIntegrationCommand.ts diff --git a/clients/client-devops-guru/commands/GetCostEstimationCommand.ts b/clients/client-devops-guru/src/commands/GetCostEstimationCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/GetCostEstimationCommand.ts rename to clients/client-devops-guru/src/commands/GetCostEstimationCommand.ts diff --git a/clients/client-devops-guru/commands/GetResourceCollectionCommand.ts b/clients/client-devops-guru/src/commands/GetResourceCollectionCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/GetResourceCollectionCommand.ts rename to clients/client-devops-guru/src/commands/GetResourceCollectionCommand.ts diff --git a/clients/client-devops-guru/commands/ListAnomaliesForInsightCommand.ts b/clients/client-devops-guru/src/commands/ListAnomaliesForInsightCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/ListAnomaliesForInsightCommand.ts rename to clients/client-devops-guru/src/commands/ListAnomaliesForInsightCommand.ts diff --git a/clients/client-devops-guru/commands/ListEventsCommand.ts b/clients/client-devops-guru/src/commands/ListEventsCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/ListEventsCommand.ts rename to clients/client-devops-guru/src/commands/ListEventsCommand.ts diff --git a/clients/client-devops-guru/commands/ListInsightsCommand.ts b/clients/client-devops-guru/src/commands/ListInsightsCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/ListInsightsCommand.ts rename to clients/client-devops-guru/src/commands/ListInsightsCommand.ts diff --git a/clients/client-devops-guru/commands/ListNotificationChannelsCommand.ts b/clients/client-devops-guru/src/commands/ListNotificationChannelsCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/ListNotificationChannelsCommand.ts rename to clients/client-devops-guru/src/commands/ListNotificationChannelsCommand.ts diff --git a/clients/client-devops-guru/commands/ListRecommendationsCommand.ts b/clients/client-devops-guru/src/commands/ListRecommendationsCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/ListRecommendationsCommand.ts rename to clients/client-devops-guru/src/commands/ListRecommendationsCommand.ts diff --git a/clients/client-devops-guru/commands/PutFeedbackCommand.ts b/clients/client-devops-guru/src/commands/PutFeedbackCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/PutFeedbackCommand.ts rename to clients/client-devops-guru/src/commands/PutFeedbackCommand.ts diff --git a/clients/client-devops-guru/commands/RemoveNotificationChannelCommand.ts b/clients/client-devops-guru/src/commands/RemoveNotificationChannelCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/RemoveNotificationChannelCommand.ts rename to clients/client-devops-guru/src/commands/RemoveNotificationChannelCommand.ts diff --git a/clients/client-devops-guru/commands/SearchInsightsCommand.ts b/clients/client-devops-guru/src/commands/SearchInsightsCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/SearchInsightsCommand.ts rename to clients/client-devops-guru/src/commands/SearchInsightsCommand.ts diff --git a/clients/client-devops-guru/commands/StartCostEstimationCommand.ts b/clients/client-devops-guru/src/commands/StartCostEstimationCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/StartCostEstimationCommand.ts rename to clients/client-devops-guru/src/commands/StartCostEstimationCommand.ts diff --git a/clients/client-devops-guru/commands/UpdateResourceCollectionCommand.ts b/clients/client-devops-guru/src/commands/UpdateResourceCollectionCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/UpdateResourceCollectionCommand.ts rename to clients/client-devops-guru/src/commands/UpdateResourceCollectionCommand.ts diff --git a/clients/client-devops-guru/commands/UpdateServiceIntegrationCommand.ts b/clients/client-devops-guru/src/commands/UpdateServiceIntegrationCommand.ts similarity index 100% rename from clients/client-devops-guru/commands/UpdateServiceIntegrationCommand.ts rename to clients/client-devops-guru/src/commands/UpdateServiceIntegrationCommand.ts diff --git a/clients/client-devops-guru/endpoints.ts b/clients/client-devops-guru/src/endpoints.ts similarity index 100% rename from clients/client-devops-guru/endpoints.ts rename to clients/client-devops-guru/src/endpoints.ts diff --git a/clients/client-devops-guru/index.ts b/clients/client-devops-guru/src/index.ts similarity index 100% rename from clients/client-devops-guru/index.ts rename to clients/client-devops-guru/src/index.ts diff --git a/clients/client-devops-guru/models/index.ts b/clients/client-devops-guru/src/models/index.ts similarity index 100% rename from clients/client-devops-guru/models/index.ts rename to clients/client-devops-guru/src/models/index.ts diff --git a/clients/client-devops-guru/models/models_0.ts b/clients/client-devops-guru/src/models/models_0.ts similarity index 100% rename from clients/client-devops-guru/models/models_0.ts rename to clients/client-devops-guru/src/models/models_0.ts diff --git a/clients/client-devops-guru/pagination/DescribeResourceCollectionHealthPaginator.ts b/clients/client-devops-guru/src/pagination/DescribeResourceCollectionHealthPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/DescribeResourceCollectionHealthPaginator.ts rename to clients/client-devops-guru/src/pagination/DescribeResourceCollectionHealthPaginator.ts diff --git a/clients/client-devops-guru/pagination/GetCostEstimationPaginator.ts b/clients/client-devops-guru/src/pagination/GetCostEstimationPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/GetCostEstimationPaginator.ts rename to clients/client-devops-guru/src/pagination/GetCostEstimationPaginator.ts diff --git a/clients/client-devops-guru/pagination/GetResourceCollectionPaginator.ts b/clients/client-devops-guru/src/pagination/GetResourceCollectionPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/GetResourceCollectionPaginator.ts rename to clients/client-devops-guru/src/pagination/GetResourceCollectionPaginator.ts diff --git a/clients/client-devops-guru/pagination/Interfaces.ts b/clients/client-devops-guru/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-devops-guru/pagination/Interfaces.ts rename to clients/client-devops-guru/src/pagination/Interfaces.ts diff --git a/clients/client-devops-guru/pagination/ListAnomaliesForInsightPaginator.ts b/clients/client-devops-guru/src/pagination/ListAnomaliesForInsightPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/ListAnomaliesForInsightPaginator.ts rename to clients/client-devops-guru/src/pagination/ListAnomaliesForInsightPaginator.ts diff --git a/clients/client-devops-guru/pagination/ListEventsPaginator.ts b/clients/client-devops-guru/src/pagination/ListEventsPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/ListEventsPaginator.ts rename to clients/client-devops-guru/src/pagination/ListEventsPaginator.ts diff --git a/clients/client-devops-guru/pagination/ListInsightsPaginator.ts b/clients/client-devops-guru/src/pagination/ListInsightsPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/ListInsightsPaginator.ts rename to clients/client-devops-guru/src/pagination/ListInsightsPaginator.ts diff --git a/clients/client-devops-guru/pagination/ListNotificationChannelsPaginator.ts b/clients/client-devops-guru/src/pagination/ListNotificationChannelsPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/ListNotificationChannelsPaginator.ts rename to clients/client-devops-guru/src/pagination/ListNotificationChannelsPaginator.ts diff --git a/clients/client-devops-guru/pagination/ListRecommendationsPaginator.ts b/clients/client-devops-guru/src/pagination/ListRecommendationsPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/ListRecommendationsPaginator.ts rename to clients/client-devops-guru/src/pagination/ListRecommendationsPaginator.ts diff --git a/clients/client-devops-guru/pagination/SearchInsightsPaginator.ts b/clients/client-devops-guru/src/pagination/SearchInsightsPaginator.ts similarity index 100% rename from clients/client-devops-guru/pagination/SearchInsightsPaginator.ts rename to clients/client-devops-guru/src/pagination/SearchInsightsPaginator.ts diff --git a/clients/client-devops-guru/protocols/Aws_restJson1.ts b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-devops-guru/protocols/Aws_restJson1.ts rename to clients/client-devops-guru/src/protocols/Aws_restJson1.ts diff --git a/clients/client-devops-guru/src/runtimeConfig.browser.ts b/clients/client-devops-guru/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0fd7dccdf67b --- /dev/null +++ b/clients/client-devops-guru/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DevOpsGuruClientConfig } from "./DevOpsGuruClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-devops-guru/runtimeConfig.native.ts b/clients/client-devops-guru/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-devops-guru/runtimeConfig.native.ts rename to clients/client-devops-guru/src/runtimeConfig.native.ts diff --git a/clients/client-devops-guru/runtimeConfig.shared.ts b/clients/client-devops-guru/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-devops-guru/runtimeConfig.shared.ts rename to clients/client-devops-guru/src/runtimeConfig.shared.ts diff --git a/clients/client-devops-guru/src/runtimeConfig.ts b/clients/client-devops-guru/src/runtimeConfig.ts new file mode 100644 index 000000000000..17c28e6902d1 --- /dev/null +++ b/clients/client-devops-guru/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DevOpsGuruClientConfig } from "./DevOpsGuruClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-devops-guru/tsconfig.es.json b/clients/client-devops-guru/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-devops-guru/tsconfig.es.json +++ b/clients/client-devops-guru/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-devops-guru/tsconfig.json b/clients/client-devops-guru/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-devops-guru/tsconfig.json +++ b/clients/client-devops-guru/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-devops-guru/tsconfig.types.json b/clients/client-devops-guru/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-devops-guru/tsconfig.types.json +++ b/clients/client-devops-guru/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-direct-connect/.gitignore b/clients/client-direct-connect/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-direct-connect/.gitignore +++ b/clients/client-direct-connect/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-direct-connect/package.json b/clients/client-direct-connect/package.json index 77cc6e209548..1e93d04dc0a6 100644 --- a/clients/client-direct-connect/package.json +++ b/clients/client-direct-connect/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-direct-connect", "repository": { "type": "git", diff --git a/clients/client-direct-connect/runtimeConfig.browser.ts b/clients/client-direct-connect/runtimeConfig.browser.ts deleted file mode 100644 index ac135811ed69..000000000000 --- a/clients/client-direct-connect/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DirectConnectClientConfig } from "./DirectConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DirectConnectClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-direct-connect/runtimeConfig.ts b/clients/client-direct-connect/runtimeConfig.ts deleted file mode 100644 index ba35f9f04212..000000000000 --- a/clients/client-direct-connect/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DirectConnectClientConfig } from "./DirectConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DirectConnectClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-direct-connect/DirectConnect.ts b/clients/client-direct-connect/src/DirectConnect.ts similarity index 100% rename from clients/client-direct-connect/DirectConnect.ts rename to clients/client-direct-connect/src/DirectConnect.ts diff --git a/clients/client-direct-connect/DirectConnectClient.ts b/clients/client-direct-connect/src/DirectConnectClient.ts similarity index 100% rename from clients/client-direct-connect/DirectConnectClient.ts rename to clients/client-direct-connect/src/DirectConnectClient.ts diff --git a/clients/client-direct-connect/commands/AcceptDirectConnectGatewayAssociationProposalCommand.ts b/clients/client-direct-connect/src/commands/AcceptDirectConnectGatewayAssociationProposalCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AcceptDirectConnectGatewayAssociationProposalCommand.ts rename to clients/client-direct-connect/src/commands/AcceptDirectConnectGatewayAssociationProposalCommand.ts diff --git a/clients/client-direct-connect/commands/AllocateConnectionOnInterconnectCommand.ts b/clients/client-direct-connect/src/commands/AllocateConnectionOnInterconnectCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AllocateConnectionOnInterconnectCommand.ts rename to clients/client-direct-connect/src/commands/AllocateConnectionOnInterconnectCommand.ts diff --git a/clients/client-direct-connect/commands/AllocateHostedConnectionCommand.ts b/clients/client-direct-connect/src/commands/AllocateHostedConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AllocateHostedConnectionCommand.ts rename to clients/client-direct-connect/src/commands/AllocateHostedConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/AllocatePrivateVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/AllocatePrivateVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AllocatePrivateVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/AllocatePrivateVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/AllocatePublicVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/AllocatePublicVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AllocatePublicVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/AllocatePublicVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/AllocateTransitVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/AllocateTransitVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AllocateTransitVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/AllocateTransitVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/AssociateConnectionWithLagCommand.ts b/clients/client-direct-connect/src/commands/AssociateConnectionWithLagCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AssociateConnectionWithLagCommand.ts rename to clients/client-direct-connect/src/commands/AssociateConnectionWithLagCommand.ts diff --git a/clients/client-direct-connect/commands/AssociateHostedConnectionCommand.ts b/clients/client-direct-connect/src/commands/AssociateHostedConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AssociateHostedConnectionCommand.ts rename to clients/client-direct-connect/src/commands/AssociateHostedConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/AssociateMacSecKeyCommand.ts b/clients/client-direct-connect/src/commands/AssociateMacSecKeyCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AssociateMacSecKeyCommand.ts rename to clients/client-direct-connect/src/commands/AssociateMacSecKeyCommand.ts diff --git a/clients/client-direct-connect/commands/AssociateVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/AssociateVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/AssociateVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/AssociateVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/ConfirmConnectionCommand.ts b/clients/client-direct-connect/src/commands/ConfirmConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/ConfirmConnectionCommand.ts rename to clients/client-direct-connect/src/commands/ConfirmConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/ConfirmPrivateVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/ConfirmPrivateVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/ConfirmPrivateVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/ConfirmPrivateVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/ConfirmPublicVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/ConfirmPublicVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/ConfirmPublicVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/ConfirmPublicVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/ConfirmTransitVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/ConfirmTransitVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/ConfirmTransitVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/ConfirmTransitVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/CreateBGPPeerCommand.ts b/clients/client-direct-connect/src/commands/CreateBGPPeerCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateBGPPeerCommand.ts rename to clients/client-direct-connect/src/commands/CreateBGPPeerCommand.ts diff --git a/clients/client-direct-connect/commands/CreateConnectionCommand.ts b/clients/client-direct-connect/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateConnectionCommand.ts rename to clients/client-direct-connect/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/CreateDirectConnectGatewayAssociationCommand.ts b/clients/client-direct-connect/src/commands/CreateDirectConnectGatewayAssociationCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateDirectConnectGatewayAssociationCommand.ts rename to clients/client-direct-connect/src/commands/CreateDirectConnectGatewayAssociationCommand.ts diff --git a/clients/client-direct-connect/commands/CreateDirectConnectGatewayAssociationProposalCommand.ts b/clients/client-direct-connect/src/commands/CreateDirectConnectGatewayAssociationProposalCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateDirectConnectGatewayAssociationProposalCommand.ts rename to clients/client-direct-connect/src/commands/CreateDirectConnectGatewayAssociationProposalCommand.ts diff --git a/clients/client-direct-connect/commands/CreateDirectConnectGatewayCommand.ts b/clients/client-direct-connect/src/commands/CreateDirectConnectGatewayCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateDirectConnectGatewayCommand.ts rename to clients/client-direct-connect/src/commands/CreateDirectConnectGatewayCommand.ts diff --git a/clients/client-direct-connect/commands/CreateInterconnectCommand.ts b/clients/client-direct-connect/src/commands/CreateInterconnectCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateInterconnectCommand.ts rename to clients/client-direct-connect/src/commands/CreateInterconnectCommand.ts diff --git a/clients/client-direct-connect/commands/CreateLagCommand.ts b/clients/client-direct-connect/src/commands/CreateLagCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateLagCommand.ts rename to clients/client-direct-connect/src/commands/CreateLagCommand.ts diff --git a/clients/client-direct-connect/commands/CreatePrivateVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/CreatePrivateVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreatePrivateVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/CreatePrivateVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/CreatePublicVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/CreatePublicVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreatePublicVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/CreatePublicVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/CreateTransitVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/CreateTransitVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/CreateTransitVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/CreateTransitVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteBGPPeerCommand.ts b/clients/client-direct-connect/src/commands/DeleteBGPPeerCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteBGPPeerCommand.ts rename to clients/client-direct-connect/src/commands/DeleteBGPPeerCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteConnectionCommand.ts b/clients/client-direct-connect/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteConnectionCommand.ts rename to clients/client-direct-connect/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteDirectConnectGatewayAssociationCommand.ts b/clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayAssociationCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteDirectConnectGatewayAssociationCommand.ts rename to clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayAssociationCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteDirectConnectGatewayAssociationProposalCommand.ts b/clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayAssociationProposalCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteDirectConnectGatewayAssociationProposalCommand.ts rename to clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayAssociationProposalCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteDirectConnectGatewayCommand.ts b/clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteDirectConnectGatewayCommand.ts rename to clients/client-direct-connect/src/commands/DeleteDirectConnectGatewayCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteInterconnectCommand.ts b/clients/client-direct-connect/src/commands/DeleteInterconnectCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteInterconnectCommand.ts rename to clients/client-direct-connect/src/commands/DeleteInterconnectCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteLagCommand.ts b/clients/client-direct-connect/src/commands/DeleteLagCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteLagCommand.ts rename to clients/client-direct-connect/src/commands/DeleteLagCommand.ts diff --git a/clients/client-direct-connect/commands/DeleteVirtualInterfaceCommand.ts b/clients/client-direct-connect/src/commands/DeleteVirtualInterfaceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DeleteVirtualInterfaceCommand.ts rename to clients/client-direct-connect/src/commands/DeleteVirtualInterfaceCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeConnectionLoaCommand.ts b/clients/client-direct-connect/src/commands/DescribeConnectionLoaCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeConnectionLoaCommand.ts rename to clients/client-direct-connect/src/commands/DescribeConnectionLoaCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeConnectionsCommand.ts b/clients/client-direct-connect/src/commands/DescribeConnectionsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeConnectionsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeConnectionsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeConnectionsOnInterconnectCommand.ts b/clients/client-direct-connect/src/commands/DescribeConnectionsOnInterconnectCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeConnectionsOnInterconnectCommand.ts rename to clients/client-direct-connect/src/commands/DescribeConnectionsOnInterconnectCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeDirectConnectGatewayAssociationProposalsCommand.ts b/clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAssociationProposalsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeDirectConnectGatewayAssociationProposalsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAssociationProposalsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeDirectConnectGatewayAssociationsCommand.ts b/clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAssociationsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeDirectConnectGatewayAssociationsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAssociationsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeDirectConnectGatewayAttachmentsCommand.ts b/clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAttachmentsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeDirectConnectGatewayAttachmentsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeDirectConnectGatewayAttachmentsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeDirectConnectGatewaysCommand.ts b/clients/client-direct-connect/src/commands/DescribeDirectConnectGatewaysCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeDirectConnectGatewaysCommand.ts rename to clients/client-direct-connect/src/commands/DescribeDirectConnectGatewaysCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeHostedConnectionsCommand.ts b/clients/client-direct-connect/src/commands/DescribeHostedConnectionsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeHostedConnectionsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeHostedConnectionsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeInterconnectLoaCommand.ts b/clients/client-direct-connect/src/commands/DescribeInterconnectLoaCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeInterconnectLoaCommand.ts rename to clients/client-direct-connect/src/commands/DescribeInterconnectLoaCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeInterconnectsCommand.ts b/clients/client-direct-connect/src/commands/DescribeInterconnectsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeInterconnectsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeInterconnectsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeLagsCommand.ts b/clients/client-direct-connect/src/commands/DescribeLagsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeLagsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeLagsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeLoaCommand.ts b/clients/client-direct-connect/src/commands/DescribeLoaCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeLoaCommand.ts rename to clients/client-direct-connect/src/commands/DescribeLoaCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeLocationsCommand.ts b/clients/client-direct-connect/src/commands/DescribeLocationsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeLocationsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeLocationsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeTagsCommand.ts b/clients/client-direct-connect/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeTagsCommand.ts rename to clients/client-direct-connect/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeVirtualGatewaysCommand.ts b/clients/client-direct-connect/src/commands/DescribeVirtualGatewaysCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeVirtualGatewaysCommand.ts rename to clients/client-direct-connect/src/commands/DescribeVirtualGatewaysCommand.ts diff --git a/clients/client-direct-connect/commands/DescribeVirtualInterfacesCommand.ts b/clients/client-direct-connect/src/commands/DescribeVirtualInterfacesCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DescribeVirtualInterfacesCommand.ts rename to clients/client-direct-connect/src/commands/DescribeVirtualInterfacesCommand.ts diff --git a/clients/client-direct-connect/commands/DisassociateConnectionFromLagCommand.ts b/clients/client-direct-connect/src/commands/DisassociateConnectionFromLagCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DisassociateConnectionFromLagCommand.ts rename to clients/client-direct-connect/src/commands/DisassociateConnectionFromLagCommand.ts diff --git a/clients/client-direct-connect/commands/DisassociateMacSecKeyCommand.ts b/clients/client-direct-connect/src/commands/DisassociateMacSecKeyCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/DisassociateMacSecKeyCommand.ts rename to clients/client-direct-connect/src/commands/DisassociateMacSecKeyCommand.ts diff --git a/clients/client-direct-connect/commands/ListVirtualInterfaceTestHistoryCommand.ts b/clients/client-direct-connect/src/commands/ListVirtualInterfaceTestHistoryCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/ListVirtualInterfaceTestHistoryCommand.ts rename to clients/client-direct-connect/src/commands/ListVirtualInterfaceTestHistoryCommand.ts diff --git a/clients/client-direct-connect/commands/StartBgpFailoverTestCommand.ts b/clients/client-direct-connect/src/commands/StartBgpFailoverTestCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/StartBgpFailoverTestCommand.ts rename to clients/client-direct-connect/src/commands/StartBgpFailoverTestCommand.ts diff --git a/clients/client-direct-connect/commands/StopBgpFailoverTestCommand.ts b/clients/client-direct-connect/src/commands/StopBgpFailoverTestCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/StopBgpFailoverTestCommand.ts rename to clients/client-direct-connect/src/commands/StopBgpFailoverTestCommand.ts diff --git a/clients/client-direct-connect/commands/TagResourceCommand.ts b/clients/client-direct-connect/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/TagResourceCommand.ts rename to clients/client-direct-connect/src/commands/TagResourceCommand.ts diff --git a/clients/client-direct-connect/commands/UntagResourceCommand.ts b/clients/client-direct-connect/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/UntagResourceCommand.ts rename to clients/client-direct-connect/src/commands/UntagResourceCommand.ts diff --git a/clients/client-direct-connect/commands/UpdateConnectionCommand.ts b/clients/client-direct-connect/src/commands/UpdateConnectionCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/UpdateConnectionCommand.ts rename to clients/client-direct-connect/src/commands/UpdateConnectionCommand.ts diff --git a/clients/client-direct-connect/commands/UpdateDirectConnectGatewayAssociationCommand.ts b/clients/client-direct-connect/src/commands/UpdateDirectConnectGatewayAssociationCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/UpdateDirectConnectGatewayAssociationCommand.ts rename to clients/client-direct-connect/src/commands/UpdateDirectConnectGatewayAssociationCommand.ts diff --git a/clients/client-direct-connect/commands/UpdateLagCommand.ts b/clients/client-direct-connect/src/commands/UpdateLagCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/UpdateLagCommand.ts rename to clients/client-direct-connect/src/commands/UpdateLagCommand.ts diff --git a/clients/client-direct-connect/commands/UpdateVirtualInterfaceAttributesCommand.ts b/clients/client-direct-connect/src/commands/UpdateVirtualInterfaceAttributesCommand.ts similarity index 100% rename from clients/client-direct-connect/commands/UpdateVirtualInterfaceAttributesCommand.ts rename to clients/client-direct-connect/src/commands/UpdateVirtualInterfaceAttributesCommand.ts diff --git a/clients/client-direct-connect/endpoints.ts b/clients/client-direct-connect/src/endpoints.ts similarity index 100% rename from clients/client-direct-connect/endpoints.ts rename to clients/client-direct-connect/src/endpoints.ts diff --git a/clients/client-direct-connect/index.ts b/clients/client-direct-connect/src/index.ts similarity index 100% rename from clients/client-direct-connect/index.ts rename to clients/client-direct-connect/src/index.ts diff --git a/clients/client-direct-connect/models/index.ts b/clients/client-direct-connect/src/models/index.ts similarity index 100% rename from clients/client-direct-connect/models/index.ts rename to clients/client-direct-connect/src/models/index.ts diff --git a/clients/client-direct-connect/models/models_0.ts b/clients/client-direct-connect/src/models/models_0.ts similarity index 100% rename from clients/client-direct-connect/models/models_0.ts rename to clients/client-direct-connect/src/models/models_0.ts diff --git a/clients/client-direct-connect/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-direct-connect/protocols/Aws_json1_1.ts rename to clients/client-direct-connect/src/protocols/Aws_json1_1.ts diff --git a/clients/client-direct-connect/src/runtimeConfig.browser.ts b/clients/client-direct-connect/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..dd20401feec7 --- /dev/null +++ b/clients/client-direct-connect/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DirectConnectClientConfig } from "./DirectConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DirectConnectClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-direct-connect/runtimeConfig.native.ts b/clients/client-direct-connect/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-direct-connect/runtimeConfig.native.ts rename to clients/client-direct-connect/src/runtimeConfig.native.ts diff --git a/clients/client-direct-connect/runtimeConfig.shared.ts b/clients/client-direct-connect/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-direct-connect/runtimeConfig.shared.ts rename to clients/client-direct-connect/src/runtimeConfig.shared.ts diff --git a/clients/client-direct-connect/src/runtimeConfig.ts b/clients/client-direct-connect/src/runtimeConfig.ts new file mode 100644 index 000000000000..359e69a6a63d --- /dev/null +++ b/clients/client-direct-connect/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DirectConnectClientConfig } from "./DirectConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DirectConnectClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-direct-connect/tsconfig.es.json b/clients/client-direct-connect/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-direct-connect/tsconfig.es.json +++ b/clients/client-direct-connect/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-direct-connect/tsconfig.json b/clients/client-direct-connect/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-direct-connect/tsconfig.json +++ b/clients/client-direct-connect/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-direct-connect/tsconfig.types.json b/clients/client-direct-connect/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-direct-connect/tsconfig.types.json +++ b/clients/client-direct-connect/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-directory-service/.gitignore b/clients/client-directory-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-directory-service/.gitignore +++ b/clients/client-directory-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-directory-service/package.json b/clients/client-directory-service/package.json index 2e82d1a842c3..0f7ef4bd5893 100644 --- a/clients/client-directory-service/package.json +++ b/clients/client-directory-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-directory-service", "repository": { "type": "git", diff --git a/clients/client-directory-service/runtimeConfig.browser.ts b/clients/client-directory-service/runtimeConfig.browser.ts deleted file mode 100644 index 606a66531ef7..000000000000 --- a/clients/client-directory-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DirectoryServiceClientConfig } from "./DirectoryServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-directory-service/runtimeConfig.ts b/clients/client-directory-service/runtimeConfig.ts deleted file mode 100644 index a8d6d01096a6..000000000000 --- a/clients/client-directory-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DirectoryServiceClientConfig } from "./DirectoryServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-directory-service/DirectoryService.ts b/clients/client-directory-service/src/DirectoryService.ts similarity index 100% rename from clients/client-directory-service/DirectoryService.ts rename to clients/client-directory-service/src/DirectoryService.ts diff --git a/clients/client-directory-service/DirectoryServiceClient.ts b/clients/client-directory-service/src/DirectoryServiceClient.ts similarity index 100% rename from clients/client-directory-service/DirectoryServiceClient.ts rename to clients/client-directory-service/src/DirectoryServiceClient.ts diff --git a/clients/client-directory-service/commands/AcceptSharedDirectoryCommand.ts b/clients/client-directory-service/src/commands/AcceptSharedDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/AcceptSharedDirectoryCommand.ts rename to clients/client-directory-service/src/commands/AcceptSharedDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/AddIpRoutesCommand.ts b/clients/client-directory-service/src/commands/AddIpRoutesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/AddIpRoutesCommand.ts rename to clients/client-directory-service/src/commands/AddIpRoutesCommand.ts diff --git a/clients/client-directory-service/commands/AddRegionCommand.ts b/clients/client-directory-service/src/commands/AddRegionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/AddRegionCommand.ts rename to clients/client-directory-service/src/commands/AddRegionCommand.ts diff --git a/clients/client-directory-service/commands/AddTagsToResourceCommand.ts b/clients/client-directory-service/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-directory-service/commands/AddTagsToResourceCommand.ts rename to clients/client-directory-service/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-directory-service/commands/CancelSchemaExtensionCommand.ts b/clients/client-directory-service/src/commands/CancelSchemaExtensionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CancelSchemaExtensionCommand.ts rename to clients/client-directory-service/src/commands/CancelSchemaExtensionCommand.ts diff --git a/clients/client-directory-service/commands/ConnectDirectoryCommand.ts b/clients/client-directory-service/src/commands/ConnectDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ConnectDirectoryCommand.ts rename to clients/client-directory-service/src/commands/ConnectDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/CreateAliasCommand.ts b/clients/client-directory-service/src/commands/CreateAliasCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateAliasCommand.ts rename to clients/client-directory-service/src/commands/CreateAliasCommand.ts diff --git a/clients/client-directory-service/commands/CreateComputerCommand.ts b/clients/client-directory-service/src/commands/CreateComputerCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateComputerCommand.ts rename to clients/client-directory-service/src/commands/CreateComputerCommand.ts diff --git a/clients/client-directory-service/commands/CreateConditionalForwarderCommand.ts b/clients/client-directory-service/src/commands/CreateConditionalForwarderCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateConditionalForwarderCommand.ts rename to clients/client-directory-service/src/commands/CreateConditionalForwarderCommand.ts diff --git a/clients/client-directory-service/commands/CreateDirectoryCommand.ts b/clients/client-directory-service/src/commands/CreateDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateDirectoryCommand.ts rename to clients/client-directory-service/src/commands/CreateDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/CreateLogSubscriptionCommand.ts b/clients/client-directory-service/src/commands/CreateLogSubscriptionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateLogSubscriptionCommand.ts rename to clients/client-directory-service/src/commands/CreateLogSubscriptionCommand.ts diff --git a/clients/client-directory-service/commands/CreateMicrosoftADCommand.ts b/clients/client-directory-service/src/commands/CreateMicrosoftADCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateMicrosoftADCommand.ts rename to clients/client-directory-service/src/commands/CreateMicrosoftADCommand.ts diff --git a/clients/client-directory-service/commands/CreateSnapshotCommand.ts b/clients/client-directory-service/src/commands/CreateSnapshotCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateSnapshotCommand.ts rename to clients/client-directory-service/src/commands/CreateSnapshotCommand.ts diff --git a/clients/client-directory-service/commands/CreateTrustCommand.ts b/clients/client-directory-service/src/commands/CreateTrustCommand.ts similarity index 100% rename from clients/client-directory-service/commands/CreateTrustCommand.ts rename to clients/client-directory-service/src/commands/CreateTrustCommand.ts diff --git a/clients/client-directory-service/commands/DeleteConditionalForwarderCommand.ts b/clients/client-directory-service/src/commands/DeleteConditionalForwarderCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeleteConditionalForwarderCommand.ts rename to clients/client-directory-service/src/commands/DeleteConditionalForwarderCommand.ts diff --git a/clients/client-directory-service/commands/DeleteDirectoryCommand.ts b/clients/client-directory-service/src/commands/DeleteDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeleteDirectoryCommand.ts rename to clients/client-directory-service/src/commands/DeleteDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/DeleteLogSubscriptionCommand.ts b/clients/client-directory-service/src/commands/DeleteLogSubscriptionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeleteLogSubscriptionCommand.ts rename to clients/client-directory-service/src/commands/DeleteLogSubscriptionCommand.ts diff --git a/clients/client-directory-service/commands/DeleteSnapshotCommand.ts b/clients/client-directory-service/src/commands/DeleteSnapshotCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeleteSnapshotCommand.ts rename to clients/client-directory-service/src/commands/DeleteSnapshotCommand.ts diff --git a/clients/client-directory-service/commands/DeleteTrustCommand.ts b/clients/client-directory-service/src/commands/DeleteTrustCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeleteTrustCommand.ts rename to clients/client-directory-service/src/commands/DeleteTrustCommand.ts diff --git a/clients/client-directory-service/commands/DeregisterCertificateCommand.ts b/clients/client-directory-service/src/commands/DeregisterCertificateCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeregisterCertificateCommand.ts rename to clients/client-directory-service/src/commands/DeregisterCertificateCommand.ts diff --git a/clients/client-directory-service/commands/DeregisterEventTopicCommand.ts b/clients/client-directory-service/src/commands/DeregisterEventTopicCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DeregisterEventTopicCommand.ts rename to clients/client-directory-service/src/commands/DeregisterEventTopicCommand.ts diff --git a/clients/client-directory-service/commands/DescribeCertificateCommand.ts b/clients/client-directory-service/src/commands/DescribeCertificateCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeCertificateCommand.ts rename to clients/client-directory-service/src/commands/DescribeCertificateCommand.ts diff --git a/clients/client-directory-service/commands/DescribeClientAuthenticationSettingsCommand.ts b/clients/client-directory-service/src/commands/DescribeClientAuthenticationSettingsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeClientAuthenticationSettingsCommand.ts rename to clients/client-directory-service/src/commands/DescribeClientAuthenticationSettingsCommand.ts diff --git a/clients/client-directory-service/commands/DescribeConditionalForwardersCommand.ts b/clients/client-directory-service/src/commands/DescribeConditionalForwardersCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeConditionalForwardersCommand.ts rename to clients/client-directory-service/src/commands/DescribeConditionalForwardersCommand.ts diff --git a/clients/client-directory-service/commands/DescribeDirectoriesCommand.ts b/clients/client-directory-service/src/commands/DescribeDirectoriesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeDirectoriesCommand.ts rename to clients/client-directory-service/src/commands/DescribeDirectoriesCommand.ts diff --git a/clients/client-directory-service/commands/DescribeDomainControllersCommand.ts b/clients/client-directory-service/src/commands/DescribeDomainControllersCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeDomainControllersCommand.ts rename to clients/client-directory-service/src/commands/DescribeDomainControllersCommand.ts diff --git a/clients/client-directory-service/commands/DescribeEventTopicsCommand.ts b/clients/client-directory-service/src/commands/DescribeEventTopicsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeEventTopicsCommand.ts rename to clients/client-directory-service/src/commands/DescribeEventTopicsCommand.ts diff --git a/clients/client-directory-service/commands/DescribeLDAPSSettingsCommand.ts b/clients/client-directory-service/src/commands/DescribeLDAPSSettingsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeLDAPSSettingsCommand.ts rename to clients/client-directory-service/src/commands/DescribeLDAPSSettingsCommand.ts diff --git a/clients/client-directory-service/commands/DescribeRegionsCommand.ts b/clients/client-directory-service/src/commands/DescribeRegionsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeRegionsCommand.ts rename to clients/client-directory-service/src/commands/DescribeRegionsCommand.ts diff --git a/clients/client-directory-service/commands/DescribeSharedDirectoriesCommand.ts b/clients/client-directory-service/src/commands/DescribeSharedDirectoriesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeSharedDirectoriesCommand.ts rename to clients/client-directory-service/src/commands/DescribeSharedDirectoriesCommand.ts diff --git a/clients/client-directory-service/commands/DescribeSnapshotsCommand.ts b/clients/client-directory-service/src/commands/DescribeSnapshotsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeSnapshotsCommand.ts rename to clients/client-directory-service/src/commands/DescribeSnapshotsCommand.ts diff --git a/clients/client-directory-service/commands/DescribeTrustsCommand.ts b/clients/client-directory-service/src/commands/DescribeTrustsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DescribeTrustsCommand.ts rename to clients/client-directory-service/src/commands/DescribeTrustsCommand.ts diff --git a/clients/client-directory-service/commands/DisableClientAuthenticationCommand.ts b/clients/client-directory-service/src/commands/DisableClientAuthenticationCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DisableClientAuthenticationCommand.ts rename to clients/client-directory-service/src/commands/DisableClientAuthenticationCommand.ts diff --git a/clients/client-directory-service/commands/DisableLDAPSCommand.ts b/clients/client-directory-service/src/commands/DisableLDAPSCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DisableLDAPSCommand.ts rename to clients/client-directory-service/src/commands/DisableLDAPSCommand.ts diff --git a/clients/client-directory-service/commands/DisableRadiusCommand.ts b/clients/client-directory-service/src/commands/DisableRadiusCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DisableRadiusCommand.ts rename to clients/client-directory-service/src/commands/DisableRadiusCommand.ts diff --git a/clients/client-directory-service/commands/DisableSsoCommand.ts b/clients/client-directory-service/src/commands/DisableSsoCommand.ts similarity index 100% rename from clients/client-directory-service/commands/DisableSsoCommand.ts rename to clients/client-directory-service/src/commands/DisableSsoCommand.ts diff --git a/clients/client-directory-service/commands/EnableClientAuthenticationCommand.ts b/clients/client-directory-service/src/commands/EnableClientAuthenticationCommand.ts similarity index 100% rename from clients/client-directory-service/commands/EnableClientAuthenticationCommand.ts rename to clients/client-directory-service/src/commands/EnableClientAuthenticationCommand.ts diff --git a/clients/client-directory-service/commands/EnableLDAPSCommand.ts b/clients/client-directory-service/src/commands/EnableLDAPSCommand.ts similarity index 100% rename from clients/client-directory-service/commands/EnableLDAPSCommand.ts rename to clients/client-directory-service/src/commands/EnableLDAPSCommand.ts diff --git a/clients/client-directory-service/commands/EnableRadiusCommand.ts b/clients/client-directory-service/src/commands/EnableRadiusCommand.ts similarity index 100% rename from clients/client-directory-service/commands/EnableRadiusCommand.ts rename to clients/client-directory-service/src/commands/EnableRadiusCommand.ts diff --git a/clients/client-directory-service/commands/EnableSsoCommand.ts b/clients/client-directory-service/src/commands/EnableSsoCommand.ts similarity index 100% rename from clients/client-directory-service/commands/EnableSsoCommand.ts rename to clients/client-directory-service/src/commands/EnableSsoCommand.ts diff --git a/clients/client-directory-service/commands/GetDirectoryLimitsCommand.ts b/clients/client-directory-service/src/commands/GetDirectoryLimitsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/GetDirectoryLimitsCommand.ts rename to clients/client-directory-service/src/commands/GetDirectoryLimitsCommand.ts diff --git a/clients/client-directory-service/commands/GetSnapshotLimitsCommand.ts b/clients/client-directory-service/src/commands/GetSnapshotLimitsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/GetSnapshotLimitsCommand.ts rename to clients/client-directory-service/src/commands/GetSnapshotLimitsCommand.ts diff --git a/clients/client-directory-service/commands/ListCertificatesCommand.ts b/clients/client-directory-service/src/commands/ListCertificatesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ListCertificatesCommand.ts rename to clients/client-directory-service/src/commands/ListCertificatesCommand.ts diff --git a/clients/client-directory-service/commands/ListIpRoutesCommand.ts b/clients/client-directory-service/src/commands/ListIpRoutesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ListIpRoutesCommand.ts rename to clients/client-directory-service/src/commands/ListIpRoutesCommand.ts diff --git a/clients/client-directory-service/commands/ListLogSubscriptionsCommand.ts b/clients/client-directory-service/src/commands/ListLogSubscriptionsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ListLogSubscriptionsCommand.ts rename to clients/client-directory-service/src/commands/ListLogSubscriptionsCommand.ts diff --git a/clients/client-directory-service/commands/ListSchemaExtensionsCommand.ts b/clients/client-directory-service/src/commands/ListSchemaExtensionsCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ListSchemaExtensionsCommand.ts rename to clients/client-directory-service/src/commands/ListSchemaExtensionsCommand.ts diff --git a/clients/client-directory-service/commands/ListTagsForResourceCommand.ts b/clients/client-directory-service/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ListTagsForResourceCommand.ts rename to clients/client-directory-service/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-directory-service/commands/RegisterCertificateCommand.ts b/clients/client-directory-service/src/commands/RegisterCertificateCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RegisterCertificateCommand.ts rename to clients/client-directory-service/src/commands/RegisterCertificateCommand.ts diff --git a/clients/client-directory-service/commands/RegisterEventTopicCommand.ts b/clients/client-directory-service/src/commands/RegisterEventTopicCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RegisterEventTopicCommand.ts rename to clients/client-directory-service/src/commands/RegisterEventTopicCommand.ts diff --git a/clients/client-directory-service/commands/RejectSharedDirectoryCommand.ts b/clients/client-directory-service/src/commands/RejectSharedDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RejectSharedDirectoryCommand.ts rename to clients/client-directory-service/src/commands/RejectSharedDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/RemoveIpRoutesCommand.ts b/clients/client-directory-service/src/commands/RemoveIpRoutesCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RemoveIpRoutesCommand.ts rename to clients/client-directory-service/src/commands/RemoveIpRoutesCommand.ts diff --git a/clients/client-directory-service/commands/RemoveRegionCommand.ts b/clients/client-directory-service/src/commands/RemoveRegionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RemoveRegionCommand.ts rename to clients/client-directory-service/src/commands/RemoveRegionCommand.ts diff --git a/clients/client-directory-service/commands/RemoveTagsFromResourceCommand.ts b/clients/client-directory-service/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-directory-service/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-directory-service/commands/ResetUserPasswordCommand.ts b/clients/client-directory-service/src/commands/ResetUserPasswordCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ResetUserPasswordCommand.ts rename to clients/client-directory-service/src/commands/ResetUserPasswordCommand.ts diff --git a/clients/client-directory-service/commands/RestoreFromSnapshotCommand.ts b/clients/client-directory-service/src/commands/RestoreFromSnapshotCommand.ts similarity index 100% rename from clients/client-directory-service/commands/RestoreFromSnapshotCommand.ts rename to clients/client-directory-service/src/commands/RestoreFromSnapshotCommand.ts diff --git a/clients/client-directory-service/commands/ShareDirectoryCommand.ts b/clients/client-directory-service/src/commands/ShareDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/ShareDirectoryCommand.ts rename to clients/client-directory-service/src/commands/ShareDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/StartSchemaExtensionCommand.ts b/clients/client-directory-service/src/commands/StartSchemaExtensionCommand.ts similarity index 100% rename from clients/client-directory-service/commands/StartSchemaExtensionCommand.ts rename to clients/client-directory-service/src/commands/StartSchemaExtensionCommand.ts diff --git a/clients/client-directory-service/commands/UnshareDirectoryCommand.ts b/clients/client-directory-service/src/commands/UnshareDirectoryCommand.ts similarity index 100% rename from clients/client-directory-service/commands/UnshareDirectoryCommand.ts rename to clients/client-directory-service/src/commands/UnshareDirectoryCommand.ts diff --git a/clients/client-directory-service/commands/UpdateConditionalForwarderCommand.ts b/clients/client-directory-service/src/commands/UpdateConditionalForwarderCommand.ts similarity index 100% rename from clients/client-directory-service/commands/UpdateConditionalForwarderCommand.ts rename to clients/client-directory-service/src/commands/UpdateConditionalForwarderCommand.ts diff --git a/clients/client-directory-service/commands/UpdateNumberOfDomainControllersCommand.ts b/clients/client-directory-service/src/commands/UpdateNumberOfDomainControllersCommand.ts similarity index 100% rename from clients/client-directory-service/commands/UpdateNumberOfDomainControllersCommand.ts rename to clients/client-directory-service/src/commands/UpdateNumberOfDomainControllersCommand.ts diff --git a/clients/client-directory-service/commands/UpdateRadiusCommand.ts b/clients/client-directory-service/src/commands/UpdateRadiusCommand.ts similarity index 100% rename from clients/client-directory-service/commands/UpdateRadiusCommand.ts rename to clients/client-directory-service/src/commands/UpdateRadiusCommand.ts diff --git a/clients/client-directory-service/commands/UpdateTrustCommand.ts b/clients/client-directory-service/src/commands/UpdateTrustCommand.ts similarity index 100% rename from clients/client-directory-service/commands/UpdateTrustCommand.ts rename to clients/client-directory-service/src/commands/UpdateTrustCommand.ts diff --git a/clients/client-directory-service/commands/VerifyTrustCommand.ts b/clients/client-directory-service/src/commands/VerifyTrustCommand.ts similarity index 100% rename from clients/client-directory-service/commands/VerifyTrustCommand.ts rename to clients/client-directory-service/src/commands/VerifyTrustCommand.ts diff --git a/clients/client-directory-service/endpoints.ts b/clients/client-directory-service/src/endpoints.ts similarity index 100% rename from clients/client-directory-service/endpoints.ts rename to clients/client-directory-service/src/endpoints.ts diff --git a/clients/client-directory-service/index.ts b/clients/client-directory-service/src/index.ts similarity index 100% rename from clients/client-directory-service/index.ts rename to clients/client-directory-service/src/index.ts diff --git a/clients/client-directory-service/models/index.ts b/clients/client-directory-service/src/models/index.ts similarity index 100% rename from clients/client-directory-service/models/index.ts rename to clients/client-directory-service/src/models/index.ts diff --git a/clients/client-directory-service/models/models_0.ts b/clients/client-directory-service/src/models/models_0.ts similarity index 100% rename from clients/client-directory-service/models/models_0.ts rename to clients/client-directory-service/src/models/models_0.ts diff --git a/clients/client-directory-service/pagination/DescribeDomainControllersPaginator.ts b/clients/client-directory-service/src/pagination/DescribeDomainControllersPaginator.ts similarity index 100% rename from clients/client-directory-service/pagination/DescribeDomainControllersPaginator.ts rename to clients/client-directory-service/src/pagination/DescribeDomainControllersPaginator.ts diff --git a/clients/client-directory-service/pagination/Interfaces.ts b/clients/client-directory-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-directory-service/pagination/Interfaces.ts rename to clients/client-directory-service/src/pagination/Interfaces.ts diff --git a/clients/client-directory-service/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-directory-service/protocols/Aws_json1_1.ts rename to clients/client-directory-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-directory-service/src/runtimeConfig.browser.ts b/clients/client-directory-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..61c2bd578616 --- /dev/null +++ b/clients/client-directory-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DirectoryServiceClientConfig } from "./DirectoryServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-directory-service/runtimeConfig.native.ts b/clients/client-directory-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-directory-service/runtimeConfig.native.ts rename to clients/client-directory-service/src/runtimeConfig.native.ts diff --git a/clients/client-directory-service/runtimeConfig.shared.ts b/clients/client-directory-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-directory-service/runtimeConfig.shared.ts rename to clients/client-directory-service/src/runtimeConfig.shared.ts diff --git a/clients/client-directory-service/src/runtimeConfig.ts b/clients/client-directory-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..49a206cac8c3 --- /dev/null +++ b/clients/client-directory-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DirectoryServiceClientConfig } from "./DirectoryServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-directory-service/tsconfig.es.json b/clients/client-directory-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-directory-service/tsconfig.es.json +++ b/clients/client-directory-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-directory-service/tsconfig.json b/clients/client-directory-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-directory-service/tsconfig.json +++ b/clients/client-directory-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-directory-service/tsconfig.types.json b/clients/client-directory-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-directory-service/tsconfig.types.json +++ b/clients/client-directory-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-dlm/.gitignore b/clients/client-dlm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-dlm/.gitignore +++ b/clients/client-dlm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-dlm/package.json b/clients/client-dlm/package.json index 2e8c7bcea323..6bb5774eb4a0 100644 --- a/clients/client-dlm/package.json +++ b/clients/client-dlm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dlm", "repository": { "type": "git", diff --git a/clients/client-dlm/runtimeConfig.browser.ts b/clients/client-dlm/runtimeConfig.browser.ts deleted file mode 100644 index 57bdbe87e6c0..000000000000 --- a/clients/client-dlm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DLMClientConfig } from "./DLMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DLMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dlm/runtimeConfig.ts b/clients/client-dlm/runtimeConfig.ts deleted file mode 100644 index 9fd6c65c15e2..000000000000 --- a/clients/client-dlm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DLMClientConfig } from "./DLMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DLMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dlm/DLM.ts b/clients/client-dlm/src/DLM.ts similarity index 100% rename from clients/client-dlm/DLM.ts rename to clients/client-dlm/src/DLM.ts diff --git a/clients/client-dlm/DLMClient.ts b/clients/client-dlm/src/DLMClient.ts similarity index 100% rename from clients/client-dlm/DLMClient.ts rename to clients/client-dlm/src/DLMClient.ts diff --git a/clients/client-dlm/commands/CreateLifecyclePolicyCommand.ts b/clients/client-dlm/src/commands/CreateLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-dlm/commands/CreateLifecyclePolicyCommand.ts rename to clients/client-dlm/src/commands/CreateLifecyclePolicyCommand.ts diff --git a/clients/client-dlm/commands/DeleteLifecyclePolicyCommand.ts b/clients/client-dlm/src/commands/DeleteLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-dlm/commands/DeleteLifecyclePolicyCommand.ts rename to clients/client-dlm/src/commands/DeleteLifecyclePolicyCommand.ts diff --git a/clients/client-dlm/commands/GetLifecyclePoliciesCommand.ts b/clients/client-dlm/src/commands/GetLifecyclePoliciesCommand.ts similarity index 100% rename from clients/client-dlm/commands/GetLifecyclePoliciesCommand.ts rename to clients/client-dlm/src/commands/GetLifecyclePoliciesCommand.ts diff --git a/clients/client-dlm/commands/GetLifecyclePolicyCommand.ts b/clients/client-dlm/src/commands/GetLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-dlm/commands/GetLifecyclePolicyCommand.ts rename to clients/client-dlm/src/commands/GetLifecyclePolicyCommand.ts diff --git a/clients/client-dlm/commands/ListTagsForResourceCommand.ts b/clients/client-dlm/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-dlm/commands/ListTagsForResourceCommand.ts rename to clients/client-dlm/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-dlm/commands/TagResourceCommand.ts b/clients/client-dlm/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-dlm/commands/TagResourceCommand.ts rename to clients/client-dlm/src/commands/TagResourceCommand.ts diff --git a/clients/client-dlm/commands/UntagResourceCommand.ts b/clients/client-dlm/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-dlm/commands/UntagResourceCommand.ts rename to clients/client-dlm/src/commands/UntagResourceCommand.ts diff --git a/clients/client-dlm/commands/UpdateLifecyclePolicyCommand.ts b/clients/client-dlm/src/commands/UpdateLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-dlm/commands/UpdateLifecyclePolicyCommand.ts rename to clients/client-dlm/src/commands/UpdateLifecyclePolicyCommand.ts diff --git a/clients/client-dlm/endpoints.ts b/clients/client-dlm/src/endpoints.ts similarity index 100% rename from clients/client-dlm/endpoints.ts rename to clients/client-dlm/src/endpoints.ts diff --git a/clients/client-dlm/index.ts b/clients/client-dlm/src/index.ts similarity index 100% rename from clients/client-dlm/index.ts rename to clients/client-dlm/src/index.ts diff --git a/clients/client-dlm/models/index.ts b/clients/client-dlm/src/models/index.ts similarity index 100% rename from clients/client-dlm/models/index.ts rename to clients/client-dlm/src/models/index.ts diff --git a/clients/client-dlm/models/models_0.ts b/clients/client-dlm/src/models/models_0.ts similarity index 100% rename from clients/client-dlm/models/models_0.ts rename to clients/client-dlm/src/models/models_0.ts diff --git a/clients/client-dlm/protocols/Aws_restJson1.ts b/clients/client-dlm/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-dlm/protocols/Aws_restJson1.ts rename to clients/client-dlm/src/protocols/Aws_restJson1.ts diff --git a/clients/client-dlm/src/runtimeConfig.browser.ts b/clients/client-dlm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5de8b3e56fe8 --- /dev/null +++ b/clients/client-dlm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DLMClientConfig } from "./DLMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DLMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dlm/runtimeConfig.native.ts b/clients/client-dlm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-dlm/runtimeConfig.native.ts rename to clients/client-dlm/src/runtimeConfig.native.ts diff --git a/clients/client-dlm/runtimeConfig.shared.ts b/clients/client-dlm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-dlm/runtimeConfig.shared.ts rename to clients/client-dlm/src/runtimeConfig.shared.ts diff --git a/clients/client-dlm/src/runtimeConfig.ts b/clients/client-dlm/src/runtimeConfig.ts new file mode 100644 index 000000000000..8b115502e76d --- /dev/null +++ b/clients/client-dlm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DLMClientConfig } from "./DLMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DLMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dlm/tsconfig.es.json b/clients/client-dlm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-dlm/tsconfig.es.json +++ b/clients/client-dlm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-dlm/tsconfig.json b/clients/client-dlm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-dlm/tsconfig.json +++ b/clients/client-dlm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-dlm/tsconfig.types.json b/clients/client-dlm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-dlm/tsconfig.types.json +++ b/clients/client-dlm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-docdb/.gitignore b/clients/client-docdb/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-docdb/.gitignore +++ b/clients/client-docdb/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-docdb/package.json b/clients/client-docdb/package.json index f0779b064b9b..fe5e9587cbb2 100644 --- a/clients/client-docdb/package.json +++ b/clients/client-docdb/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-docdb", "repository": { "type": "git", diff --git a/clients/client-docdb/runtimeConfig.browser.ts b/clients/client-docdb/runtimeConfig.browser.ts deleted file mode 100644 index 91cf2dcb887f..000000000000 --- a/clients/client-docdb/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DocDBClientConfig } from "./DocDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DocDBClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-docdb/runtimeConfig.ts b/clients/client-docdb/runtimeConfig.ts deleted file mode 100644 index eba35ea24ffb..000000000000 --- a/clients/client-docdb/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DocDBClientConfig } from "./DocDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DocDBClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-docdb/DocDB.ts b/clients/client-docdb/src/DocDB.ts similarity index 100% rename from clients/client-docdb/DocDB.ts rename to clients/client-docdb/src/DocDB.ts diff --git a/clients/client-docdb/DocDBClient.ts b/clients/client-docdb/src/DocDBClient.ts similarity index 100% rename from clients/client-docdb/DocDBClient.ts rename to clients/client-docdb/src/DocDBClient.ts diff --git a/clients/client-docdb/commands/AddSourceIdentifierToSubscriptionCommand.ts b/clients/client-docdb/src/commands/AddSourceIdentifierToSubscriptionCommand.ts similarity index 100% rename from clients/client-docdb/commands/AddSourceIdentifierToSubscriptionCommand.ts rename to clients/client-docdb/src/commands/AddSourceIdentifierToSubscriptionCommand.ts diff --git a/clients/client-docdb/commands/AddTagsToResourceCommand.ts b/clients/client-docdb/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-docdb/commands/AddTagsToResourceCommand.ts rename to clients/client-docdb/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-docdb/commands/ApplyPendingMaintenanceActionCommand.ts b/clients/client-docdb/src/commands/ApplyPendingMaintenanceActionCommand.ts similarity index 100% rename from clients/client-docdb/commands/ApplyPendingMaintenanceActionCommand.ts rename to clients/client-docdb/src/commands/ApplyPendingMaintenanceActionCommand.ts diff --git a/clients/client-docdb/commands/CopyDBClusterParameterGroupCommand.ts b/clients/client-docdb/src/commands/CopyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/CopyDBClusterParameterGroupCommand.ts rename to clients/client-docdb/src/commands/CopyDBClusterParameterGroupCommand.ts diff --git a/clients/client-docdb/commands/CopyDBClusterSnapshotCommand.ts b/clients/client-docdb/src/commands/CopyDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-docdb/commands/CopyDBClusterSnapshotCommand.ts rename to clients/client-docdb/src/commands/CopyDBClusterSnapshotCommand.ts diff --git a/clients/client-docdb/commands/CreateDBClusterCommand.ts b/clients/client-docdb/src/commands/CreateDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateDBClusterCommand.ts rename to clients/client-docdb/src/commands/CreateDBClusterCommand.ts diff --git a/clients/client-docdb/commands/CreateDBClusterParameterGroupCommand.ts b/clients/client-docdb/src/commands/CreateDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateDBClusterParameterGroupCommand.ts rename to clients/client-docdb/src/commands/CreateDBClusterParameterGroupCommand.ts diff --git a/clients/client-docdb/commands/CreateDBClusterSnapshotCommand.ts b/clients/client-docdb/src/commands/CreateDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateDBClusterSnapshotCommand.ts rename to clients/client-docdb/src/commands/CreateDBClusterSnapshotCommand.ts diff --git a/clients/client-docdb/commands/CreateDBInstanceCommand.ts b/clients/client-docdb/src/commands/CreateDBInstanceCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateDBInstanceCommand.ts rename to clients/client-docdb/src/commands/CreateDBInstanceCommand.ts diff --git a/clients/client-docdb/commands/CreateDBSubnetGroupCommand.ts b/clients/client-docdb/src/commands/CreateDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateDBSubnetGroupCommand.ts rename to clients/client-docdb/src/commands/CreateDBSubnetGroupCommand.ts diff --git a/clients/client-docdb/commands/CreateEventSubscriptionCommand.ts b/clients/client-docdb/src/commands/CreateEventSubscriptionCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateEventSubscriptionCommand.ts rename to clients/client-docdb/src/commands/CreateEventSubscriptionCommand.ts diff --git a/clients/client-docdb/commands/CreateGlobalClusterCommand.ts b/clients/client-docdb/src/commands/CreateGlobalClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/CreateGlobalClusterCommand.ts rename to clients/client-docdb/src/commands/CreateGlobalClusterCommand.ts diff --git a/clients/client-docdb/commands/DeleteDBClusterCommand.ts b/clients/client-docdb/src/commands/DeleteDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteDBClusterCommand.ts rename to clients/client-docdb/src/commands/DeleteDBClusterCommand.ts diff --git a/clients/client-docdb/commands/DeleteDBClusterParameterGroupCommand.ts b/clients/client-docdb/src/commands/DeleteDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteDBClusterParameterGroupCommand.ts rename to clients/client-docdb/src/commands/DeleteDBClusterParameterGroupCommand.ts diff --git a/clients/client-docdb/commands/DeleteDBClusterSnapshotCommand.ts b/clients/client-docdb/src/commands/DeleteDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteDBClusterSnapshotCommand.ts rename to clients/client-docdb/src/commands/DeleteDBClusterSnapshotCommand.ts diff --git a/clients/client-docdb/commands/DeleteDBInstanceCommand.ts b/clients/client-docdb/src/commands/DeleteDBInstanceCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteDBInstanceCommand.ts rename to clients/client-docdb/src/commands/DeleteDBInstanceCommand.ts diff --git a/clients/client-docdb/commands/DeleteDBSubnetGroupCommand.ts b/clients/client-docdb/src/commands/DeleteDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteDBSubnetGroupCommand.ts rename to clients/client-docdb/src/commands/DeleteDBSubnetGroupCommand.ts diff --git a/clients/client-docdb/commands/DeleteEventSubscriptionCommand.ts b/clients/client-docdb/src/commands/DeleteEventSubscriptionCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteEventSubscriptionCommand.ts rename to clients/client-docdb/src/commands/DeleteEventSubscriptionCommand.ts diff --git a/clients/client-docdb/commands/DeleteGlobalClusterCommand.ts b/clients/client-docdb/src/commands/DeleteGlobalClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/DeleteGlobalClusterCommand.ts rename to clients/client-docdb/src/commands/DeleteGlobalClusterCommand.ts diff --git a/clients/client-docdb/commands/DescribeCertificatesCommand.ts b/clients/client-docdb/src/commands/DescribeCertificatesCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeCertificatesCommand.ts rename to clients/client-docdb/src/commands/DescribeCertificatesCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBClusterParameterGroupsCommand.ts b/clients/client-docdb/src/commands/DescribeDBClusterParameterGroupsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBClusterParameterGroupsCommand.ts rename to clients/client-docdb/src/commands/DescribeDBClusterParameterGroupsCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBClusterParametersCommand.ts b/clients/client-docdb/src/commands/DescribeDBClusterParametersCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBClusterParametersCommand.ts rename to clients/client-docdb/src/commands/DescribeDBClusterParametersCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBClusterSnapshotAttributesCommand.ts b/clients/client-docdb/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBClusterSnapshotAttributesCommand.ts rename to clients/client-docdb/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBClusterSnapshotsCommand.ts b/clients/client-docdb/src/commands/DescribeDBClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBClusterSnapshotsCommand.ts rename to clients/client-docdb/src/commands/DescribeDBClusterSnapshotsCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBClustersCommand.ts b/clients/client-docdb/src/commands/DescribeDBClustersCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBClustersCommand.ts rename to clients/client-docdb/src/commands/DescribeDBClustersCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBEngineVersionsCommand.ts b/clients/client-docdb/src/commands/DescribeDBEngineVersionsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBEngineVersionsCommand.ts rename to clients/client-docdb/src/commands/DescribeDBEngineVersionsCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBInstancesCommand.ts b/clients/client-docdb/src/commands/DescribeDBInstancesCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBInstancesCommand.ts rename to clients/client-docdb/src/commands/DescribeDBInstancesCommand.ts diff --git a/clients/client-docdb/commands/DescribeDBSubnetGroupsCommand.ts b/clients/client-docdb/src/commands/DescribeDBSubnetGroupsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeDBSubnetGroupsCommand.ts rename to clients/client-docdb/src/commands/DescribeDBSubnetGroupsCommand.ts diff --git a/clients/client-docdb/commands/DescribeEngineDefaultClusterParametersCommand.ts b/clients/client-docdb/src/commands/DescribeEngineDefaultClusterParametersCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeEngineDefaultClusterParametersCommand.ts rename to clients/client-docdb/src/commands/DescribeEngineDefaultClusterParametersCommand.ts diff --git a/clients/client-docdb/commands/DescribeEventCategoriesCommand.ts b/clients/client-docdb/src/commands/DescribeEventCategoriesCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeEventCategoriesCommand.ts rename to clients/client-docdb/src/commands/DescribeEventCategoriesCommand.ts diff --git a/clients/client-docdb/commands/DescribeEventSubscriptionsCommand.ts b/clients/client-docdb/src/commands/DescribeEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeEventSubscriptionsCommand.ts rename to clients/client-docdb/src/commands/DescribeEventSubscriptionsCommand.ts diff --git a/clients/client-docdb/commands/DescribeEventsCommand.ts b/clients/client-docdb/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeEventsCommand.ts rename to clients/client-docdb/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-docdb/commands/DescribeGlobalClustersCommand.ts b/clients/client-docdb/src/commands/DescribeGlobalClustersCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeGlobalClustersCommand.ts rename to clients/client-docdb/src/commands/DescribeGlobalClustersCommand.ts diff --git a/clients/client-docdb/commands/DescribeOrderableDBInstanceOptionsCommand.ts b/clients/client-docdb/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribeOrderableDBInstanceOptionsCommand.ts rename to clients/client-docdb/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts diff --git a/clients/client-docdb/commands/DescribePendingMaintenanceActionsCommand.ts b/clients/client-docdb/src/commands/DescribePendingMaintenanceActionsCommand.ts similarity index 100% rename from clients/client-docdb/commands/DescribePendingMaintenanceActionsCommand.ts rename to clients/client-docdb/src/commands/DescribePendingMaintenanceActionsCommand.ts diff --git a/clients/client-docdb/commands/FailoverDBClusterCommand.ts b/clients/client-docdb/src/commands/FailoverDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/FailoverDBClusterCommand.ts rename to clients/client-docdb/src/commands/FailoverDBClusterCommand.ts diff --git a/clients/client-docdb/commands/ListTagsForResourceCommand.ts b/clients/client-docdb/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-docdb/commands/ListTagsForResourceCommand.ts rename to clients/client-docdb/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-docdb/commands/ModifyDBClusterCommand.ts b/clients/client-docdb/src/commands/ModifyDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyDBClusterCommand.ts rename to clients/client-docdb/src/commands/ModifyDBClusterCommand.ts diff --git a/clients/client-docdb/commands/ModifyDBClusterParameterGroupCommand.ts b/clients/client-docdb/src/commands/ModifyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyDBClusterParameterGroupCommand.ts rename to clients/client-docdb/src/commands/ModifyDBClusterParameterGroupCommand.ts diff --git a/clients/client-docdb/commands/ModifyDBClusterSnapshotAttributeCommand.ts b/clients/client-docdb/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyDBClusterSnapshotAttributeCommand.ts rename to clients/client-docdb/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts diff --git a/clients/client-docdb/commands/ModifyDBInstanceCommand.ts b/clients/client-docdb/src/commands/ModifyDBInstanceCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyDBInstanceCommand.ts rename to clients/client-docdb/src/commands/ModifyDBInstanceCommand.ts diff --git a/clients/client-docdb/commands/ModifyDBSubnetGroupCommand.ts b/clients/client-docdb/src/commands/ModifyDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyDBSubnetGroupCommand.ts rename to clients/client-docdb/src/commands/ModifyDBSubnetGroupCommand.ts diff --git a/clients/client-docdb/commands/ModifyEventSubscriptionCommand.ts b/clients/client-docdb/src/commands/ModifyEventSubscriptionCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyEventSubscriptionCommand.ts rename to clients/client-docdb/src/commands/ModifyEventSubscriptionCommand.ts diff --git a/clients/client-docdb/commands/ModifyGlobalClusterCommand.ts b/clients/client-docdb/src/commands/ModifyGlobalClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/ModifyGlobalClusterCommand.ts rename to clients/client-docdb/src/commands/ModifyGlobalClusterCommand.ts diff --git a/clients/client-docdb/commands/RebootDBInstanceCommand.ts b/clients/client-docdb/src/commands/RebootDBInstanceCommand.ts similarity index 100% rename from clients/client-docdb/commands/RebootDBInstanceCommand.ts rename to clients/client-docdb/src/commands/RebootDBInstanceCommand.ts diff --git a/clients/client-docdb/commands/RemoveFromGlobalClusterCommand.ts b/clients/client-docdb/src/commands/RemoveFromGlobalClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/RemoveFromGlobalClusterCommand.ts rename to clients/client-docdb/src/commands/RemoveFromGlobalClusterCommand.ts diff --git a/clients/client-docdb/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts b/clients/client-docdb/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts similarity index 100% rename from clients/client-docdb/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts rename to clients/client-docdb/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts diff --git a/clients/client-docdb/commands/RemoveTagsFromResourceCommand.ts b/clients/client-docdb/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-docdb/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-docdb/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-docdb/commands/ResetDBClusterParameterGroupCommand.ts b/clients/client-docdb/src/commands/ResetDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-docdb/commands/ResetDBClusterParameterGroupCommand.ts rename to clients/client-docdb/src/commands/ResetDBClusterParameterGroupCommand.ts diff --git a/clients/client-docdb/commands/RestoreDBClusterFromSnapshotCommand.ts b/clients/client-docdb/src/commands/RestoreDBClusterFromSnapshotCommand.ts similarity index 100% rename from clients/client-docdb/commands/RestoreDBClusterFromSnapshotCommand.ts rename to clients/client-docdb/src/commands/RestoreDBClusterFromSnapshotCommand.ts diff --git a/clients/client-docdb/commands/RestoreDBClusterToPointInTimeCommand.ts b/clients/client-docdb/src/commands/RestoreDBClusterToPointInTimeCommand.ts similarity index 100% rename from clients/client-docdb/commands/RestoreDBClusterToPointInTimeCommand.ts rename to clients/client-docdb/src/commands/RestoreDBClusterToPointInTimeCommand.ts diff --git a/clients/client-docdb/commands/StartDBClusterCommand.ts b/clients/client-docdb/src/commands/StartDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/StartDBClusterCommand.ts rename to clients/client-docdb/src/commands/StartDBClusterCommand.ts diff --git a/clients/client-docdb/commands/StopDBClusterCommand.ts b/clients/client-docdb/src/commands/StopDBClusterCommand.ts similarity index 100% rename from clients/client-docdb/commands/StopDBClusterCommand.ts rename to clients/client-docdb/src/commands/StopDBClusterCommand.ts diff --git a/clients/client-docdb/endpoints.ts b/clients/client-docdb/src/endpoints.ts similarity index 100% rename from clients/client-docdb/endpoints.ts rename to clients/client-docdb/src/endpoints.ts diff --git a/clients/client-docdb/index.ts b/clients/client-docdb/src/index.ts similarity index 100% rename from clients/client-docdb/index.ts rename to clients/client-docdb/src/index.ts diff --git a/clients/client-docdb/models/index.ts b/clients/client-docdb/src/models/index.ts similarity index 100% rename from clients/client-docdb/models/index.ts rename to clients/client-docdb/src/models/index.ts diff --git a/clients/client-docdb/models/models_0.ts b/clients/client-docdb/src/models/models_0.ts similarity index 100% rename from clients/client-docdb/models/models_0.ts rename to clients/client-docdb/src/models/models_0.ts diff --git a/clients/client-docdb/pagination/DescribeCertificatesPaginator.ts b/clients/client-docdb/src/pagination/DescribeCertificatesPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeCertificatesPaginator.ts rename to clients/client-docdb/src/pagination/DescribeCertificatesPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBClusterParameterGroupsPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBClusterParameterGroupsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBClusterParametersPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBClusterParametersPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBClusterParametersPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBClusterParametersPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBClusterSnapshotsPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBClusterSnapshotsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBClusterSnapshotsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBClusterSnapshotsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBClustersPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBClustersPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBClustersPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBClustersPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBEngineVersionsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBEngineVersionsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBEngineVersionsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBInstancesPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBInstancesPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBInstancesPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBInstancesPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-docdb/src/pagination/DescribeDBSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeDBSubnetGroupsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeDBSubnetGroupsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-docdb/src/pagination/DescribeEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeEventSubscriptionsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeEventSubscriptionsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeEventsPaginator.ts b/clients/client-docdb/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeEventsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeGlobalClustersPaginator.ts b/clients/client-docdb/src/pagination/DescribeGlobalClustersPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeGlobalClustersPaginator.ts rename to clients/client-docdb/src/pagination/DescribeGlobalClustersPaginator.ts diff --git a/clients/client-docdb/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-docdb/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts rename to clients/client-docdb/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts diff --git a/clients/client-docdb/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-docdb/src/pagination/DescribePendingMaintenanceActionsPaginator.ts similarity index 100% rename from clients/client-docdb/pagination/DescribePendingMaintenanceActionsPaginator.ts rename to clients/client-docdb/src/pagination/DescribePendingMaintenanceActionsPaginator.ts diff --git a/clients/client-docdb/pagination/Interfaces.ts b/clients/client-docdb/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-docdb/pagination/Interfaces.ts rename to clients/client-docdb/src/pagination/Interfaces.ts diff --git a/clients/client-docdb/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-docdb/protocols/Aws_query.ts rename to clients/client-docdb/src/protocols/Aws_query.ts diff --git a/clients/client-docdb/src/runtimeConfig.browser.ts b/clients/client-docdb/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3352dd792e32 --- /dev/null +++ b/clients/client-docdb/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DocDBClientConfig } from "./DocDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DocDBClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-docdb/runtimeConfig.native.ts b/clients/client-docdb/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-docdb/runtimeConfig.native.ts rename to clients/client-docdb/src/runtimeConfig.native.ts diff --git a/clients/client-docdb/runtimeConfig.shared.ts b/clients/client-docdb/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-docdb/runtimeConfig.shared.ts rename to clients/client-docdb/src/runtimeConfig.shared.ts diff --git a/clients/client-docdb/src/runtimeConfig.ts b/clients/client-docdb/src/runtimeConfig.ts new file mode 100644 index 000000000000..977577181377 --- /dev/null +++ b/clients/client-docdb/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DocDBClientConfig } from "./DocDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DocDBClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-docdb/waiters/waitForDBInstanceAvailable.ts b/clients/client-docdb/src/waiters/waitForDBInstanceAvailable.ts similarity index 100% rename from clients/client-docdb/waiters/waitForDBInstanceAvailable.ts rename to clients/client-docdb/src/waiters/waitForDBInstanceAvailable.ts diff --git a/clients/client-docdb/tsconfig.es.json b/clients/client-docdb/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-docdb/tsconfig.es.json +++ b/clients/client-docdb/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-docdb/tsconfig.json b/clients/client-docdb/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-docdb/tsconfig.json +++ b/clients/client-docdb/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-docdb/tsconfig.types.json b/clients/client-docdb/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-docdb/tsconfig.types.json +++ b/clients/client-docdb/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-dynamodb-streams/.gitignore b/clients/client-dynamodb-streams/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-dynamodb-streams/.gitignore +++ b/clients/client-dynamodb-streams/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-dynamodb-streams/package.json b/clients/client-dynamodb-streams/package.json index 48d53036b50e..4be4fc6854ce 100644 --- a/clients/client-dynamodb-streams/package.json +++ b/clients/client-dynamodb-streams/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dynamodb-streams", "repository": { "type": "git", diff --git a/clients/client-dynamodb-streams/runtimeConfig.browser.ts b/clients/client-dynamodb-streams/runtimeConfig.browser.ts deleted file mode 100644 index 653d0315d0b7..000000000000 --- a/clients/client-dynamodb-streams/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DynamoDBStreamsClientConfig } from "./DynamoDBStreamsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dynamodb-streams/runtimeConfig.ts b/clients/client-dynamodb-streams/runtimeConfig.ts deleted file mode 100644 index eeef9ae47abf..000000000000 --- a/clients/client-dynamodb-streams/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DynamoDBStreamsClientConfig } from "./DynamoDBStreamsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dynamodb-streams/DynamoDBStreams.ts b/clients/client-dynamodb-streams/src/DynamoDBStreams.ts similarity index 100% rename from clients/client-dynamodb-streams/DynamoDBStreams.ts rename to clients/client-dynamodb-streams/src/DynamoDBStreams.ts diff --git a/clients/client-dynamodb-streams/DynamoDBStreamsClient.ts b/clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts similarity index 100% rename from clients/client-dynamodb-streams/DynamoDBStreamsClient.ts rename to clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts diff --git a/clients/client-dynamodb-streams/commands/DescribeStreamCommand.ts b/clients/client-dynamodb-streams/src/commands/DescribeStreamCommand.ts similarity index 100% rename from clients/client-dynamodb-streams/commands/DescribeStreamCommand.ts rename to clients/client-dynamodb-streams/src/commands/DescribeStreamCommand.ts diff --git a/clients/client-dynamodb-streams/commands/GetRecordsCommand.ts b/clients/client-dynamodb-streams/src/commands/GetRecordsCommand.ts similarity index 100% rename from clients/client-dynamodb-streams/commands/GetRecordsCommand.ts rename to clients/client-dynamodb-streams/src/commands/GetRecordsCommand.ts diff --git a/clients/client-dynamodb-streams/commands/GetShardIteratorCommand.ts b/clients/client-dynamodb-streams/src/commands/GetShardIteratorCommand.ts similarity index 100% rename from clients/client-dynamodb-streams/commands/GetShardIteratorCommand.ts rename to clients/client-dynamodb-streams/src/commands/GetShardIteratorCommand.ts diff --git a/clients/client-dynamodb-streams/commands/ListStreamsCommand.ts b/clients/client-dynamodb-streams/src/commands/ListStreamsCommand.ts similarity index 100% rename from clients/client-dynamodb-streams/commands/ListStreamsCommand.ts rename to clients/client-dynamodb-streams/src/commands/ListStreamsCommand.ts diff --git a/clients/client-dynamodb-streams/endpoints.ts b/clients/client-dynamodb-streams/src/endpoints.ts similarity index 100% rename from clients/client-dynamodb-streams/endpoints.ts rename to clients/client-dynamodb-streams/src/endpoints.ts diff --git a/clients/client-dynamodb-streams/index.ts b/clients/client-dynamodb-streams/src/index.ts similarity index 100% rename from clients/client-dynamodb-streams/index.ts rename to clients/client-dynamodb-streams/src/index.ts diff --git a/clients/client-dynamodb-streams/models/index.ts b/clients/client-dynamodb-streams/src/models/index.ts similarity index 100% rename from clients/client-dynamodb-streams/models/index.ts rename to clients/client-dynamodb-streams/src/models/index.ts diff --git a/clients/client-dynamodb-streams/models/models_0.ts b/clients/client-dynamodb-streams/src/models/models_0.ts similarity index 100% rename from clients/client-dynamodb-streams/models/models_0.ts rename to clients/client-dynamodb-streams/src/models/models_0.ts diff --git a/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-dynamodb-streams/protocols/Aws_json1_0.ts rename to clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts diff --git a/clients/client-dynamodb-streams/src/runtimeConfig.browser.ts b/clients/client-dynamodb-streams/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d43da9f5f509 --- /dev/null +++ b/clients/client-dynamodb-streams/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DynamoDBStreamsClientConfig } from "./DynamoDBStreamsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dynamodb-streams/runtimeConfig.native.ts b/clients/client-dynamodb-streams/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-dynamodb-streams/runtimeConfig.native.ts rename to clients/client-dynamodb-streams/src/runtimeConfig.native.ts diff --git a/clients/client-dynamodb-streams/runtimeConfig.shared.ts b/clients/client-dynamodb-streams/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-dynamodb-streams/runtimeConfig.shared.ts rename to clients/client-dynamodb-streams/src/runtimeConfig.shared.ts diff --git a/clients/client-dynamodb-streams/src/runtimeConfig.ts b/clients/client-dynamodb-streams/src/runtimeConfig.ts new file mode 100644 index 000000000000..254f5acf216d --- /dev/null +++ b/clients/client-dynamodb-streams/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DynamoDBStreamsClientConfig } from "./DynamoDBStreamsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dynamodb-streams/tsconfig.es.json b/clients/client-dynamodb-streams/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-dynamodb-streams/tsconfig.es.json +++ b/clients/client-dynamodb-streams/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-dynamodb-streams/tsconfig.json b/clients/client-dynamodb-streams/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-dynamodb-streams/tsconfig.json +++ b/clients/client-dynamodb-streams/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-dynamodb-streams/tsconfig.types.json b/clients/client-dynamodb-streams/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-dynamodb-streams/tsconfig.types.json +++ b/clients/client-dynamodb-streams/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-dynamodb/.gitignore b/clients/client-dynamodb/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-dynamodb/.gitignore +++ b/clients/client-dynamodb/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-dynamodb/package.json b/clients/client-dynamodb/package.json index 22f0dc79faef..aa966006ee67 100644 --- a/clients/client-dynamodb/package.json +++ b/clients/client-dynamodb/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-dynamodb", "repository": { "type": "git", diff --git a/clients/client-dynamodb/runtimeConfig.browser.ts b/clients/client-dynamodb/runtimeConfig.browser.ts deleted file mode 100644 index 089070737946..000000000000 --- a/clients/client-dynamodb/runtimeConfig.browser.ts +++ /dev/null @@ -1,41 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { DynamoDBClientConfig } from "./DynamoDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DynamoDBClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dynamodb/runtimeConfig.ts b/clients/client-dynamodb/runtimeConfig.ts deleted file mode 100644 index 10c5da5fc077..000000000000 --- a/clients/client-dynamodb/runtimeConfig.ts +++ /dev/null @@ -1,48 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { DynamoDBClientConfig } from "./DynamoDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: DynamoDBClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-dynamodb/DynamoDB.ts b/clients/client-dynamodb/src/DynamoDB.ts similarity index 100% rename from clients/client-dynamodb/DynamoDB.ts rename to clients/client-dynamodb/src/DynamoDB.ts diff --git a/clients/client-dynamodb/DynamoDBClient.ts b/clients/client-dynamodb/src/DynamoDBClient.ts similarity index 100% rename from clients/client-dynamodb/DynamoDBClient.ts rename to clients/client-dynamodb/src/DynamoDBClient.ts diff --git a/clients/client-dynamodb/commands/BatchExecuteStatementCommand.ts b/clients/client-dynamodb/src/commands/BatchExecuteStatementCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/BatchExecuteStatementCommand.ts rename to clients/client-dynamodb/src/commands/BatchExecuteStatementCommand.ts diff --git a/clients/client-dynamodb/commands/BatchGetItemCommand.ts b/clients/client-dynamodb/src/commands/BatchGetItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/BatchGetItemCommand.ts rename to clients/client-dynamodb/src/commands/BatchGetItemCommand.ts diff --git a/clients/client-dynamodb/commands/BatchWriteItemCommand.ts b/clients/client-dynamodb/src/commands/BatchWriteItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/BatchWriteItemCommand.ts rename to clients/client-dynamodb/src/commands/BatchWriteItemCommand.ts diff --git a/clients/client-dynamodb/commands/CreateBackupCommand.ts b/clients/client-dynamodb/src/commands/CreateBackupCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/CreateBackupCommand.ts rename to clients/client-dynamodb/src/commands/CreateBackupCommand.ts diff --git a/clients/client-dynamodb/commands/CreateGlobalTableCommand.ts b/clients/client-dynamodb/src/commands/CreateGlobalTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/CreateGlobalTableCommand.ts rename to clients/client-dynamodb/src/commands/CreateGlobalTableCommand.ts diff --git a/clients/client-dynamodb/commands/CreateTableCommand.ts b/clients/client-dynamodb/src/commands/CreateTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/CreateTableCommand.ts rename to clients/client-dynamodb/src/commands/CreateTableCommand.ts diff --git a/clients/client-dynamodb/commands/DeleteBackupCommand.ts b/clients/client-dynamodb/src/commands/DeleteBackupCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DeleteBackupCommand.ts rename to clients/client-dynamodb/src/commands/DeleteBackupCommand.ts diff --git a/clients/client-dynamodb/commands/DeleteItemCommand.ts b/clients/client-dynamodb/src/commands/DeleteItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DeleteItemCommand.ts rename to clients/client-dynamodb/src/commands/DeleteItemCommand.ts diff --git a/clients/client-dynamodb/commands/DeleteTableCommand.ts b/clients/client-dynamodb/src/commands/DeleteTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DeleteTableCommand.ts rename to clients/client-dynamodb/src/commands/DeleteTableCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeBackupCommand.ts b/clients/client-dynamodb/src/commands/DescribeBackupCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeBackupCommand.ts rename to clients/client-dynamodb/src/commands/DescribeBackupCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeContinuousBackupsCommand.ts b/clients/client-dynamodb/src/commands/DescribeContinuousBackupsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeContinuousBackupsCommand.ts rename to clients/client-dynamodb/src/commands/DescribeContinuousBackupsCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeContributorInsightsCommand.ts b/clients/client-dynamodb/src/commands/DescribeContributorInsightsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeContributorInsightsCommand.ts rename to clients/client-dynamodb/src/commands/DescribeContributorInsightsCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeEndpointsCommand.ts b/clients/client-dynamodb/src/commands/DescribeEndpointsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeEndpointsCommand.ts rename to clients/client-dynamodb/src/commands/DescribeEndpointsCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeExportCommand.ts b/clients/client-dynamodb/src/commands/DescribeExportCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeExportCommand.ts rename to clients/client-dynamodb/src/commands/DescribeExportCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeGlobalTableCommand.ts b/clients/client-dynamodb/src/commands/DescribeGlobalTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeGlobalTableCommand.ts rename to clients/client-dynamodb/src/commands/DescribeGlobalTableCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeGlobalTableSettingsCommand.ts b/clients/client-dynamodb/src/commands/DescribeGlobalTableSettingsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeGlobalTableSettingsCommand.ts rename to clients/client-dynamodb/src/commands/DescribeGlobalTableSettingsCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeKinesisStreamingDestinationCommand.ts b/clients/client-dynamodb/src/commands/DescribeKinesisStreamingDestinationCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeKinesisStreamingDestinationCommand.ts rename to clients/client-dynamodb/src/commands/DescribeKinesisStreamingDestinationCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeLimitsCommand.ts b/clients/client-dynamodb/src/commands/DescribeLimitsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeLimitsCommand.ts rename to clients/client-dynamodb/src/commands/DescribeLimitsCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeTableCommand.ts b/clients/client-dynamodb/src/commands/DescribeTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeTableCommand.ts rename to clients/client-dynamodb/src/commands/DescribeTableCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeTableReplicaAutoScalingCommand.ts b/clients/client-dynamodb/src/commands/DescribeTableReplicaAutoScalingCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeTableReplicaAutoScalingCommand.ts rename to clients/client-dynamodb/src/commands/DescribeTableReplicaAutoScalingCommand.ts diff --git a/clients/client-dynamodb/commands/DescribeTimeToLiveCommand.ts b/clients/client-dynamodb/src/commands/DescribeTimeToLiveCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DescribeTimeToLiveCommand.ts rename to clients/client-dynamodb/src/commands/DescribeTimeToLiveCommand.ts diff --git a/clients/client-dynamodb/commands/DisableKinesisStreamingDestinationCommand.ts b/clients/client-dynamodb/src/commands/DisableKinesisStreamingDestinationCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/DisableKinesisStreamingDestinationCommand.ts rename to clients/client-dynamodb/src/commands/DisableKinesisStreamingDestinationCommand.ts diff --git a/clients/client-dynamodb/commands/EnableKinesisStreamingDestinationCommand.ts b/clients/client-dynamodb/src/commands/EnableKinesisStreamingDestinationCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/EnableKinesisStreamingDestinationCommand.ts rename to clients/client-dynamodb/src/commands/EnableKinesisStreamingDestinationCommand.ts diff --git a/clients/client-dynamodb/commands/ExecuteStatementCommand.ts b/clients/client-dynamodb/src/commands/ExecuteStatementCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ExecuteStatementCommand.ts rename to clients/client-dynamodb/src/commands/ExecuteStatementCommand.ts diff --git a/clients/client-dynamodb/commands/ExecuteTransactionCommand.ts b/clients/client-dynamodb/src/commands/ExecuteTransactionCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ExecuteTransactionCommand.ts rename to clients/client-dynamodb/src/commands/ExecuteTransactionCommand.ts diff --git a/clients/client-dynamodb/commands/ExportTableToPointInTimeCommand.ts b/clients/client-dynamodb/src/commands/ExportTableToPointInTimeCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ExportTableToPointInTimeCommand.ts rename to clients/client-dynamodb/src/commands/ExportTableToPointInTimeCommand.ts diff --git a/clients/client-dynamodb/commands/GetItemCommand.ts b/clients/client-dynamodb/src/commands/GetItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/GetItemCommand.ts rename to clients/client-dynamodb/src/commands/GetItemCommand.ts diff --git a/clients/client-dynamodb/commands/ListBackupsCommand.ts b/clients/client-dynamodb/src/commands/ListBackupsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListBackupsCommand.ts rename to clients/client-dynamodb/src/commands/ListBackupsCommand.ts diff --git a/clients/client-dynamodb/commands/ListContributorInsightsCommand.ts b/clients/client-dynamodb/src/commands/ListContributorInsightsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListContributorInsightsCommand.ts rename to clients/client-dynamodb/src/commands/ListContributorInsightsCommand.ts diff --git a/clients/client-dynamodb/commands/ListExportsCommand.ts b/clients/client-dynamodb/src/commands/ListExportsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListExportsCommand.ts rename to clients/client-dynamodb/src/commands/ListExportsCommand.ts diff --git a/clients/client-dynamodb/commands/ListGlobalTablesCommand.ts b/clients/client-dynamodb/src/commands/ListGlobalTablesCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListGlobalTablesCommand.ts rename to clients/client-dynamodb/src/commands/ListGlobalTablesCommand.ts diff --git a/clients/client-dynamodb/commands/ListTablesCommand.ts b/clients/client-dynamodb/src/commands/ListTablesCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListTablesCommand.ts rename to clients/client-dynamodb/src/commands/ListTablesCommand.ts diff --git a/clients/client-dynamodb/commands/ListTagsOfResourceCommand.ts b/clients/client-dynamodb/src/commands/ListTagsOfResourceCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ListTagsOfResourceCommand.ts rename to clients/client-dynamodb/src/commands/ListTagsOfResourceCommand.ts diff --git a/clients/client-dynamodb/commands/PutItemCommand.ts b/clients/client-dynamodb/src/commands/PutItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/PutItemCommand.ts rename to clients/client-dynamodb/src/commands/PutItemCommand.ts diff --git a/clients/client-dynamodb/commands/QueryCommand.ts b/clients/client-dynamodb/src/commands/QueryCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/QueryCommand.ts rename to clients/client-dynamodb/src/commands/QueryCommand.ts diff --git a/clients/client-dynamodb/commands/RestoreTableFromBackupCommand.ts b/clients/client-dynamodb/src/commands/RestoreTableFromBackupCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/RestoreTableFromBackupCommand.ts rename to clients/client-dynamodb/src/commands/RestoreTableFromBackupCommand.ts diff --git a/clients/client-dynamodb/commands/RestoreTableToPointInTimeCommand.ts b/clients/client-dynamodb/src/commands/RestoreTableToPointInTimeCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/RestoreTableToPointInTimeCommand.ts rename to clients/client-dynamodb/src/commands/RestoreTableToPointInTimeCommand.ts diff --git a/clients/client-dynamodb/commands/ScanCommand.ts b/clients/client-dynamodb/src/commands/ScanCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/ScanCommand.ts rename to clients/client-dynamodb/src/commands/ScanCommand.ts diff --git a/clients/client-dynamodb/commands/TagResourceCommand.ts b/clients/client-dynamodb/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/TagResourceCommand.ts rename to clients/client-dynamodb/src/commands/TagResourceCommand.ts diff --git a/clients/client-dynamodb/commands/TransactGetItemsCommand.ts b/clients/client-dynamodb/src/commands/TransactGetItemsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/TransactGetItemsCommand.ts rename to clients/client-dynamodb/src/commands/TransactGetItemsCommand.ts diff --git a/clients/client-dynamodb/commands/TransactWriteItemsCommand.ts b/clients/client-dynamodb/src/commands/TransactWriteItemsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/TransactWriteItemsCommand.ts rename to clients/client-dynamodb/src/commands/TransactWriteItemsCommand.ts diff --git a/clients/client-dynamodb/commands/UntagResourceCommand.ts b/clients/client-dynamodb/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UntagResourceCommand.ts rename to clients/client-dynamodb/src/commands/UntagResourceCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateContinuousBackupsCommand.ts b/clients/client-dynamodb/src/commands/UpdateContinuousBackupsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateContinuousBackupsCommand.ts rename to clients/client-dynamodb/src/commands/UpdateContinuousBackupsCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateContributorInsightsCommand.ts b/clients/client-dynamodb/src/commands/UpdateContributorInsightsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateContributorInsightsCommand.ts rename to clients/client-dynamodb/src/commands/UpdateContributorInsightsCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateGlobalTableCommand.ts b/clients/client-dynamodb/src/commands/UpdateGlobalTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateGlobalTableCommand.ts rename to clients/client-dynamodb/src/commands/UpdateGlobalTableCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateGlobalTableSettingsCommand.ts b/clients/client-dynamodb/src/commands/UpdateGlobalTableSettingsCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateGlobalTableSettingsCommand.ts rename to clients/client-dynamodb/src/commands/UpdateGlobalTableSettingsCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateItemCommand.ts b/clients/client-dynamodb/src/commands/UpdateItemCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateItemCommand.ts rename to clients/client-dynamodb/src/commands/UpdateItemCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateTableCommand.ts b/clients/client-dynamodb/src/commands/UpdateTableCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateTableCommand.ts rename to clients/client-dynamodb/src/commands/UpdateTableCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateTableReplicaAutoScalingCommand.ts b/clients/client-dynamodb/src/commands/UpdateTableReplicaAutoScalingCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateTableReplicaAutoScalingCommand.ts rename to clients/client-dynamodb/src/commands/UpdateTableReplicaAutoScalingCommand.ts diff --git a/clients/client-dynamodb/commands/UpdateTimeToLiveCommand.ts b/clients/client-dynamodb/src/commands/UpdateTimeToLiveCommand.ts similarity index 100% rename from clients/client-dynamodb/commands/UpdateTimeToLiveCommand.ts rename to clients/client-dynamodb/src/commands/UpdateTimeToLiveCommand.ts diff --git a/clients/client-dynamodb/endpoints.ts b/clients/client-dynamodb/src/endpoints.ts similarity index 100% rename from clients/client-dynamodb/endpoints.ts rename to clients/client-dynamodb/src/endpoints.ts diff --git a/clients/client-dynamodb/index.ts b/clients/client-dynamodb/src/index.ts similarity index 100% rename from clients/client-dynamodb/index.ts rename to clients/client-dynamodb/src/index.ts diff --git a/clients/client-dynamodb/models/index.ts b/clients/client-dynamodb/src/models/index.ts similarity index 100% rename from clients/client-dynamodb/models/index.ts rename to clients/client-dynamodb/src/models/index.ts diff --git a/clients/client-dynamodb/models/models_0.ts b/clients/client-dynamodb/src/models/models_0.ts similarity index 100% rename from clients/client-dynamodb/models/models_0.ts rename to clients/client-dynamodb/src/models/models_0.ts diff --git a/clients/client-dynamodb/pagination/Interfaces.ts b/clients/client-dynamodb/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-dynamodb/pagination/Interfaces.ts rename to clients/client-dynamodb/src/pagination/Interfaces.ts diff --git a/clients/client-dynamodb/pagination/ListContributorInsightsPaginator.ts b/clients/client-dynamodb/src/pagination/ListContributorInsightsPaginator.ts similarity index 100% rename from clients/client-dynamodb/pagination/ListContributorInsightsPaginator.ts rename to clients/client-dynamodb/src/pagination/ListContributorInsightsPaginator.ts diff --git a/clients/client-dynamodb/pagination/ListExportsPaginator.ts b/clients/client-dynamodb/src/pagination/ListExportsPaginator.ts similarity index 100% rename from clients/client-dynamodb/pagination/ListExportsPaginator.ts rename to clients/client-dynamodb/src/pagination/ListExportsPaginator.ts diff --git a/clients/client-dynamodb/pagination/ListTablesPaginator.ts b/clients/client-dynamodb/src/pagination/ListTablesPaginator.ts similarity index 100% rename from clients/client-dynamodb/pagination/ListTablesPaginator.ts rename to clients/client-dynamodb/src/pagination/ListTablesPaginator.ts diff --git a/clients/client-dynamodb/pagination/QueryPaginator.ts b/clients/client-dynamodb/src/pagination/QueryPaginator.ts similarity index 100% rename from clients/client-dynamodb/pagination/QueryPaginator.ts rename to clients/client-dynamodb/src/pagination/QueryPaginator.ts diff --git a/clients/client-dynamodb/pagination/ScanPaginator.ts b/clients/client-dynamodb/src/pagination/ScanPaginator.ts similarity index 100% rename from clients/client-dynamodb/pagination/ScanPaginator.ts rename to clients/client-dynamodb/src/pagination/ScanPaginator.ts diff --git a/clients/client-dynamodb/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-dynamodb/protocols/Aws_json1_0.ts rename to clients/client-dynamodb/src/protocols/Aws_json1_0.ts diff --git a/clients/client-dynamodb/src/runtimeConfig.browser.ts b/clients/client-dynamodb/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..42b58f20e407 --- /dev/null +++ b/clients/client-dynamodb/src/runtimeConfig.browser.ts @@ -0,0 +1,42 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { DynamoDBClientConfig } from "./DynamoDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DynamoDBClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dynamodb/runtimeConfig.native.ts b/clients/client-dynamodb/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-dynamodb/runtimeConfig.native.ts rename to clients/client-dynamodb/src/runtimeConfig.native.ts diff --git a/clients/client-dynamodb/runtimeConfig.shared.ts b/clients/client-dynamodb/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-dynamodb/runtimeConfig.shared.ts rename to clients/client-dynamodb/src/runtimeConfig.shared.ts diff --git a/clients/client-dynamodb/src/runtimeConfig.ts b/clients/client-dynamodb/src/runtimeConfig.ts new file mode 100644 index 000000000000..3c6ffa482a7e --- /dev/null +++ b/clients/client-dynamodb/src/runtimeConfig.ts @@ -0,0 +1,49 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { DynamoDBClientConfig } from "./DynamoDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: DynamoDBClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-dynamodb/waiters/waitForTableExists.ts b/clients/client-dynamodb/src/waiters/waitForTableExists.ts similarity index 100% rename from clients/client-dynamodb/waiters/waitForTableExists.ts rename to clients/client-dynamodb/src/waiters/waitForTableExists.ts diff --git a/clients/client-dynamodb/waiters/waitForTableNotExists.ts b/clients/client-dynamodb/src/waiters/waitForTableNotExists.ts similarity index 100% rename from clients/client-dynamodb/waiters/waitForTableNotExists.ts rename to clients/client-dynamodb/src/waiters/waitForTableNotExists.ts diff --git a/clients/client-dynamodb/tsconfig.es.json b/clients/client-dynamodb/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-dynamodb/tsconfig.es.json +++ b/clients/client-dynamodb/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-dynamodb/tsconfig.json b/clients/client-dynamodb/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-dynamodb/tsconfig.json +++ b/clients/client-dynamodb/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-dynamodb/tsconfig.types.json b/clients/client-dynamodb/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-dynamodb/tsconfig.types.json +++ b/clients/client-dynamodb/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ebs/.gitignore b/clients/client-ebs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ebs/.gitignore +++ b/clients/client-ebs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ebs/package.json b/clients/client-ebs/package.json index 615dbef4bbea..bcd818e277ae 100644 --- a/clients/client-ebs/package.json +++ b/clients/client-ebs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ebs", "repository": { "type": "git", diff --git a/clients/client-ebs/runtimeConfig.browser.ts b/clients/client-ebs/runtimeConfig.browser.ts deleted file mode 100644 index bb23cd516b87..000000000000 --- a/clients/client-ebs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EBSClientConfig } from "./EBSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EBSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ebs/runtimeConfig.ts b/clients/client-ebs/runtimeConfig.ts deleted file mode 100644 index bf69b6bacd7f..000000000000 --- a/clients/client-ebs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EBSClientConfig } from "./EBSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EBSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ebs/EBS.ts b/clients/client-ebs/src/EBS.ts similarity index 100% rename from clients/client-ebs/EBS.ts rename to clients/client-ebs/src/EBS.ts diff --git a/clients/client-ebs/EBSClient.ts b/clients/client-ebs/src/EBSClient.ts similarity index 100% rename from clients/client-ebs/EBSClient.ts rename to clients/client-ebs/src/EBSClient.ts diff --git a/clients/client-ebs/commands/CompleteSnapshotCommand.ts b/clients/client-ebs/src/commands/CompleteSnapshotCommand.ts similarity index 100% rename from clients/client-ebs/commands/CompleteSnapshotCommand.ts rename to clients/client-ebs/src/commands/CompleteSnapshotCommand.ts diff --git a/clients/client-ebs/commands/GetSnapshotBlockCommand.ts b/clients/client-ebs/src/commands/GetSnapshotBlockCommand.ts similarity index 100% rename from clients/client-ebs/commands/GetSnapshotBlockCommand.ts rename to clients/client-ebs/src/commands/GetSnapshotBlockCommand.ts diff --git a/clients/client-ebs/commands/ListChangedBlocksCommand.ts b/clients/client-ebs/src/commands/ListChangedBlocksCommand.ts similarity index 100% rename from clients/client-ebs/commands/ListChangedBlocksCommand.ts rename to clients/client-ebs/src/commands/ListChangedBlocksCommand.ts diff --git a/clients/client-ebs/commands/ListSnapshotBlocksCommand.ts b/clients/client-ebs/src/commands/ListSnapshotBlocksCommand.ts similarity index 100% rename from clients/client-ebs/commands/ListSnapshotBlocksCommand.ts rename to clients/client-ebs/src/commands/ListSnapshotBlocksCommand.ts diff --git a/clients/client-ebs/commands/PutSnapshotBlockCommand.ts b/clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts similarity index 100% rename from clients/client-ebs/commands/PutSnapshotBlockCommand.ts rename to clients/client-ebs/src/commands/PutSnapshotBlockCommand.ts diff --git a/clients/client-ebs/commands/StartSnapshotCommand.ts b/clients/client-ebs/src/commands/StartSnapshotCommand.ts similarity index 100% rename from clients/client-ebs/commands/StartSnapshotCommand.ts rename to clients/client-ebs/src/commands/StartSnapshotCommand.ts diff --git a/clients/client-ebs/endpoints.ts b/clients/client-ebs/src/endpoints.ts similarity index 100% rename from clients/client-ebs/endpoints.ts rename to clients/client-ebs/src/endpoints.ts diff --git a/clients/client-ebs/index.ts b/clients/client-ebs/src/index.ts similarity index 100% rename from clients/client-ebs/index.ts rename to clients/client-ebs/src/index.ts diff --git a/clients/client-ebs/models/index.ts b/clients/client-ebs/src/models/index.ts similarity index 100% rename from clients/client-ebs/models/index.ts rename to clients/client-ebs/src/models/index.ts diff --git a/clients/client-ebs/models/models_0.ts b/clients/client-ebs/src/models/models_0.ts similarity index 100% rename from clients/client-ebs/models/models_0.ts rename to clients/client-ebs/src/models/models_0.ts diff --git a/clients/client-ebs/pagination/Interfaces.ts b/clients/client-ebs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ebs/pagination/Interfaces.ts rename to clients/client-ebs/src/pagination/Interfaces.ts diff --git a/clients/client-ebs/pagination/ListChangedBlocksPaginator.ts b/clients/client-ebs/src/pagination/ListChangedBlocksPaginator.ts similarity index 100% rename from clients/client-ebs/pagination/ListChangedBlocksPaginator.ts rename to clients/client-ebs/src/pagination/ListChangedBlocksPaginator.ts diff --git a/clients/client-ebs/pagination/ListSnapshotBlocksPaginator.ts b/clients/client-ebs/src/pagination/ListSnapshotBlocksPaginator.ts similarity index 100% rename from clients/client-ebs/pagination/ListSnapshotBlocksPaginator.ts rename to clients/client-ebs/src/pagination/ListSnapshotBlocksPaginator.ts diff --git a/clients/client-ebs/protocols/Aws_restJson1.ts b/clients/client-ebs/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-ebs/protocols/Aws_restJson1.ts rename to clients/client-ebs/src/protocols/Aws_restJson1.ts diff --git a/clients/client-ebs/src/runtimeConfig.browser.ts b/clients/client-ebs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e445d89dbcb0 --- /dev/null +++ b/clients/client-ebs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EBSClientConfig } from "./EBSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EBSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ebs/runtimeConfig.native.ts b/clients/client-ebs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ebs/runtimeConfig.native.ts rename to clients/client-ebs/src/runtimeConfig.native.ts diff --git a/clients/client-ebs/runtimeConfig.shared.ts b/clients/client-ebs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ebs/runtimeConfig.shared.ts rename to clients/client-ebs/src/runtimeConfig.shared.ts diff --git a/clients/client-ebs/src/runtimeConfig.ts b/clients/client-ebs/src/runtimeConfig.ts new file mode 100644 index 000000000000..cbab21e9fc89 --- /dev/null +++ b/clients/client-ebs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EBSClientConfig } from "./EBSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EBSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ebs/tsconfig.es.json b/clients/client-ebs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ebs/tsconfig.es.json +++ b/clients/client-ebs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ebs/tsconfig.json b/clients/client-ebs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ebs/tsconfig.json +++ b/clients/client-ebs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ebs/tsconfig.types.json b/clients/client-ebs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ebs/tsconfig.types.json +++ b/clients/client-ebs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ec2-instance-connect/.gitignore b/clients/client-ec2-instance-connect/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ec2-instance-connect/.gitignore +++ b/clients/client-ec2-instance-connect/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ec2-instance-connect/package.json b/clients/client-ec2-instance-connect/package.json index e401d3ff2790..c53614c3ac3a 100644 --- a/clients/client-ec2-instance-connect/package.json +++ b/clients/client-ec2-instance-connect/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ec2-instance-connect", "repository": { "type": "git", diff --git a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts b/clients/client-ec2-instance-connect/runtimeConfig.browser.ts deleted file mode 100644 index 028141b1803d..000000000000 --- a/clients/client-ec2-instance-connect/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EC2InstanceConnectClientConfig } from "./EC2InstanceConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ec2-instance-connect/runtimeConfig.ts b/clients/client-ec2-instance-connect/runtimeConfig.ts deleted file mode 100644 index 05ccb4e7a113..000000000000 --- a/clients/client-ec2-instance-connect/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EC2InstanceConnectClientConfig } from "./EC2InstanceConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ec2-instance-connect/EC2InstanceConnect.ts b/clients/client-ec2-instance-connect/src/EC2InstanceConnect.ts similarity index 100% rename from clients/client-ec2-instance-connect/EC2InstanceConnect.ts rename to clients/client-ec2-instance-connect/src/EC2InstanceConnect.ts diff --git a/clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts b/clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts similarity index 100% rename from clients/client-ec2-instance-connect/EC2InstanceConnectClient.ts rename to clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts diff --git a/clients/client-ec2-instance-connect/commands/SendSSHPublicKeyCommand.ts b/clients/client-ec2-instance-connect/src/commands/SendSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-ec2-instance-connect/commands/SendSSHPublicKeyCommand.ts rename to clients/client-ec2-instance-connect/src/commands/SendSSHPublicKeyCommand.ts diff --git a/clients/client-ec2-instance-connect/commands/SendSerialConsoleSSHPublicKeyCommand.ts b/clients/client-ec2-instance-connect/src/commands/SendSerialConsoleSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-ec2-instance-connect/commands/SendSerialConsoleSSHPublicKeyCommand.ts rename to clients/client-ec2-instance-connect/src/commands/SendSerialConsoleSSHPublicKeyCommand.ts diff --git a/clients/client-ec2-instance-connect/endpoints.ts b/clients/client-ec2-instance-connect/src/endpoints.ts similarity index 100% rename from clients/client-ec2-instance-connect/endpoints.ts rename to clients/client-ec2-instance-connect/src/endpoints.ts diff --git a/clients/client-ec2-instance-connect/index.ts b/clients/client-ec2-instance-connect/src/index.ts similarity index 100% rename from clients/client-ec2-instance-connect/index.ts rename to clients/client-ec2-instance-connect/src/index.ts diff --git a/clients/client-ec2-instance-connect/models/index.ts b/clients/client-ec2-instance-connect/src/models/index.ts similarity index 100% rename from clients/client-ec2-instance-connect/models/index.ts rename to clients/client-ec2-instance-connect/src/models/index.ts diff --git a/clients/client-ec2-instance-connect/models/models_0.ts b/clients/client-ec2-instance-connect/src/models/models_0.ts similarity index 100% rename from clients/client-ec2-instance-connect/models/models_0.ts rename to clients/client-ec2-instance-connect/src/models/models_0.ts diff --git a/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts rename to clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ec2-instance-connect/src/runtimeConfig.browser.ts b/clients/client-ec2-instance-connect/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..627873e9c71f --- /dev/null +++ b/clients/client-ec2-instance-connect/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EC2InstanceConnectClientConfig } from "./EC2InstanceConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ec2-instance-connect/runtimeConfig.native.ts b/clients/client-ec2-instance-connect/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ec2-instance-connect/runtimeConfig.native.ts rename to clients/client-ec2-instance-connect/src/runtimeConfig.native.ts diff --git a/clients/client-ec2-instance-connect/runtimeConfig.shared.ts b/clients/client-ec2-instance-connect/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ec2-instance-connect/runtimeConfig.shared.ts rename to clients/client-ec2-instance-connect/src/runtimeConfig.shared.ts diff --git a/clients/client-ec2-instance-connect/src/runtimeConfig.ts b/clients/client-ec2-instance-connect/src/runtimeConfig.ts new file mode 100644 index 000000000000..329e0c3138f4 --- /dev/null +++ b/clients/client-ec2-instance-connect/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EC2InstanceConnectClientConfig } from "./EC2InstanceConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ec2-instance-connect/tsconfig.es.json b/clients/client-ec2-instance-connect/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ec2-instance-connect/tsconfig.es.json +++ b/clients/client-ec2-instance-connect/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ec2-instance-connect/tsconfig.json b/clients/client-ec2-instance-connect/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ec2-instance-connect/tsconfig.json +++ b/clients/client-ec2-instance-connect/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ec2-instance-connect/tsconfig.types.json b/clients/client-ec2-instance-connect/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ec2-instance-connect/tsconfig.types.json +++ b/clients/client-ec2-instance-connect/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ec2/.gitignore b/clients/client-ec2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ec2/.gitignore +++ b/clients/client-ec2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ec2/package.json b/clients/client-ec2/package.json index 735dcdf2d8f8..264c8d247ab9 100644 --- a/clients/client-ec2/package.json +++ b/clients/client-ec2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -78,8 +72,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -88,6 +82,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ec2", "repository": { "type": "git", diff --git a/clients/client-ec2/runtimeConfig.browser.ts b/clients/client-ec2/runtimeConfig.browser.ts deleted file mode 100644 index 18c913ccd4d9..000000000000 --- a/clients/client-ec2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EC2ClientConfig } from "./EC2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ec2/runtimeConfig.ts b/clients/client-ec2/runtimeConfig.ts deleted file mode 100644 index 104985f610fe..000000000000 --- a/clients/client-ec2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EC2ClientConfig } from "./EC2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ec2/EC2.ts b/clients/client-ec2/src/EC2.ts similarity index 100% rename from clients/client-ec2/EC2.ts rename to clients/client-ec2/src/EC2.ts diff --git a/clients/client-ec2/EC2Client.ts b/clients/client-ec2/src/EC2Client.ts similarity index 100% rename from clients/client-ec2/EC2Client.ts rename to clients/client-ec2/src/EC2Client.ts diff --git a/clients/client-ec2/commands/AcceptReservedInstancesExchangeQuoteCommand.ts b/clients/client-ec2/src/commands/AcceptReservedInstancesExchangeQuoteCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptReservedInstancesExchangeQuoteCommand.ts rename to clients/client-ec2/src/commands/AcceptReservedInstancesExchangeQuoteCommand.ts diff --git a/clients/client-ec2/commands/AcceptTransitGatewayMulticastDomainAssociationsCommand.ts b/clients/client-ec2/src/commands/AcceptTransitGatewayMulticastDomainAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptTransitGatewayMulticastDomainAssociationsCommand.ts rename to clients/client-ec2/src/commands/AcceptTransitGatewayMulticastDomainAssociationsCommand.ts diff --git a/clients/client-ec2/commands/AcceptTransitGatewayPeeringAttachmentCommand.ts b/clients/client-ec2/src/commands/AcceptTransitGatewayPeeringAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptTransitGatewayPeeringAttachmentCommand.ts rename to clients/client-ec2/src/commands/AcceptTransitGatewayPeeringAttachmentCommand.ts diff --git a/clients/client-ec2/commands/AcceptTransitGatewayVpcAttachmentCommand.ts b/clients/client-ec2/src/commands/AcceptTransitGatewayVpcAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptTransitGatewayVpcAttachmentCommand.ts rename to clients/client-ec2/src/commands/AcceptTransitGatewayVpcAttachmentCommand.ts diff --git a/clients/client-ec2/commands/AcceptVpcEndpointConnectionsCommand.ts b/clients/client-ec2/src/commands/AcceptVpcEndpointConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptVpcEndpointConnectionsCommand.ts rename to clients/client-ec2/src/commands/AcceptVpcEndpointConnectionsCommand.ts diff --git a/clients/client-ec2/commands/AcceptVpcPeeringConnectionCommand.ts b/clients/client-ec2/src/commands/AcceptVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/AcceptVpcPeeringConnectionCommand.ts rename to clients/client-ec2/src/commands/AcceptVpcPeeringConnectionCommand.ts diff --git a/clients/client-ec2/commands/AdvertiseByoipCidrCommand.ts b/clients/client-ec2/src/commands/AdvertiseByoipCidrCommand.ts similarity index 100% rename from clients/client-ec2/commands/AdvertiseByoipCidrCommand.ts rename to clients/client-ec2/src/commands/AdvertiseByoipCidrCommand.ts diff --git a/clients/client-ec2/commands/AllocateAddressCommand.ts b/clients/client-ec2/src/commands/AllocateAddressCommand.ts similarity index 100% rename from clients/client-ec2/commands/AllocateAddressCommand.ts rename to clients/client-ec2/src/commands/AllocateAddressCommand.ts diff --git a/clients/client-ec2/commands/AllocateHostsCommand.ts b/clients/client-ec2/src/commands/AllocateHostsCommand.ts similarity index 100% rename from clients/client-ec2/commands/AllocateHostsCommand.ts rename to clients/client-ec2/src/commands/AllocateHostsCommand.ts diff --git a/clients/client-ec2/commands/ApplySecurityGroupsToClientVpnTargetNetworkCommand.ts b/clients/client-ec2/src/commands/ApplySecurityGroupsToClientVpnTargetNetworkCommand.ts similarity index 100% rename from clients/client-ec2/commands/ApplySecurityGroupsToClientVpnTargetNetworkCommand.ts rename to clients/client-ec2/src/commands/ApplySecurityGroupsToClientVpnTargetNetworkCommand.ts diff --git a/clients/client-ec2/commands/AssignIpv6AddressesCommand.ts b/clients/client-ec2/src/commands/AssignIpv6AddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssignIpv6AddressesCommand.ts rename to clients/client-ec2/src/commands/AssignIpv6AddressesCommand.ts diff --git a/clients/client-ec2/commands/AssignPrivateIpAddressesCommand.ts b/clients/client-ec2/src/commands/AssignPrivateIpAddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssignPrivateIpAddressesCommand.ts rename to clients/client-ec2/src/commands/AssignPrivateIpAddressesCommand.ts diff --git a/clients/client-ec2/commands/AssociateAddressCommand.ts b/clients/client-ec2/src/commands/AssociateAddressCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateAddressCommand.ts rename to clients/client-ec2/src/commands/AssociateAddressCommand.ts diff --git a/clients/client-ec2/commands/AssociateClientVpnTargetNetworkCommand.ts b/clients/client-ec2/src/commands/AssociateClientVpnTargetNetworkCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateClientVpnTargetNetworkCommand.ts rename to clients/client-ec2/src/commands/AssociateClientVpnTargetNetworkCommand.ts diff --git a/clients/client-ec2/commands/AssociateDhcpOptionsCommand.ts b/clients/client-ec2/src/commands/AssociateDhcpOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateDhcpOptionsCommand.ts rename to clients/client-ec2/src/commands/AssociateDhcpOptionsCommand.ts diff --git a/clients/client-ec2/commands/AssociateEnclaveCertificateIamRoleCommand.ts b/clients/client-ec2/src/commands/AssociateEnclaveCertificateIamRoleCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateEnclaveCertificateIamRoleCommand.ts rename to clients/client-ec2/src/commands/AssociateEnclaveCertificateIamRoleCommand.ts diff --git a/clients/client-ec2/commands/AssociateIamInstanceProfileCommand.ts b/clients/client-ec2/src/commands/AssociateIamInstanceProfileCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateIamInstanceProfileCommand.ts rename to clients/client-ec2/src/commands/AssociateIamInstanceProfileCommand.ts diff --git a/clients/client-ec2/commands/AssociateInstanceEventWindowCommand.ts b/clients/client-ec2/src/commands/AssociateInstanceEventWindowCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateInstanceEventWindowCommand.ts rename to clients/client-ec2/src/commands/AssociateInstanceEventWindowCommand.ts diff --git a/clients/client-ec2/commands/AssociateRouteTableCommand.ts b/clients/client-ec2/src/commands/AssociateRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateRouteTableCommand.ts rename to clients/client-ec2/src/commands/AssociateRouteTableCommand.ts diff --git a/clients/client-ec2/commands/AssociateSubnetCidrBlockCommand.ts b/clients/client-ec2/src/commands/AssociateSubnetCidrBlockCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateSubnetCidrBlockCommand.ts rename to clients/client-ec2/src/commands/AssociateSubnetCidrBlockCommand.ts diff --git a/clients/client-ec2/commands/AssociateTransitGatewayMulticastDomainCommand.ts b/clients/client-ec2/src/commands/AssociateTransitGatewayMulticastDomainCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateTransitGatewayMulticastDomainCommand.ts rename to clients/client-ec2/src/commands/AssociateTransitGatewayMulticastDomainCommand.ts diff --git a/clients/client-ec2/commands/AssociateTransitGatewayRouteTableCommand.ts b/clients/client-ec2/src/commands/AssociateTransitGatewayRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateTransitGatewayRouteTableCommand.ts rename to clients/client-ec2/src/commands/AssociateTransitGatewayRouteTableCommand.ts diff --git a/clients/client-ec2/commands/AssociateTrunkInterfaceCommand.ts b/clients/client-ec2/src/commands/AssociateTrunkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateTrunkInterfaceCommand.ts rename to clients/client-ec2/src/commands/AssociateTrunkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/AssociateVpcCidrBlockCommand.ts b/clients/client-ec2/src/commands/AssociateVpcCidrBlockCommand.ts similarity index 100% rename from clients/client-ec2/commands/AssociateVpcCidrBlockCommand.ts rename to clients/client-ec2/src/commands/AssociateVpcCidrBlockCommand.ts diff --git a/clients/client-ec2/commands/AttachClassicLinkVpcCommand.ts b/clients/client-ec2/src/commands/AttachClassicLinkVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/AttachClassicLinkVpcCommand.ts rename to clients/client-ec2/src/commands/AttachClassicLinkVpcCommand.ts diff --git a/clients/client-ec2/commands/AttachInternetGatewayCommand.ts b/clients/client-ec2/src/commands/AttachInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/AttachInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/AttachInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/AttachNetworkInterfaceCommand.ts b/clients/client-ec2/src/commands/AttachNetworkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/AttachNetworkInterfaceCommand.ts rename to clients/client-ec2/src/commands/AttachNetworkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/AttachVolumeCommand.ts b/clients/client-ec2/src/commands/AttachVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/AttachVolumeCommand.ts rename to clients/client-ec2/src/commands/AttachVolumeCommand.ts diff --git a/clients/client-ec2/commands/AttachVpnGatewayCommand.ts b/clients/client-ec2/src/commands/AttachVpnGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/AttachVpnGatewayCommand.ts rename to clients/client-ec2/src/commands/AttachVpnGatewayCommand.ts diff --git a/clients/client-ec2/commands/AuthorizeClientVpnIngressCommand.ts b/clients/client-ec2/src/commands/AuthorizeClientVpnIngressCommand.ts similarity index 100% rename from clients/client-ec2/commands/AuthorizeClientVpnIngressCommand.ts rename to clients/client-ec2/src/commands/AuthorizeClientVpnIngressCommand.ts diff --git a/clients/client-ec2/commands/AuthorizeSecurityGroupEgressCommand.ts b/clients/client-ec2/src/commands/AuthorizeSecurityGroupEgressCommand.ts similarity index 100% rename from clients/client-ec2/commands/AuthorizeSecurityGroupEgressCommand.ts rename to clients/client-ec2/src/commands/AuthorizeSecurityGroupEgressCommand.ts diff --git a/clients/client-ec2/commands/AuthorizeSecurityGroupIngressCommand.ts b/clients/client-ec2/src/commands/AuthorizeSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-ec2/commands/AuthorizeSecurityGroupIngressCommand.ts rename to clients/client-ec2/src/commands/AuthorizeSecurityGroupIngressCommand.ts diff --git a/clients/client-ec2/commands/BundleInstanceCommand.ts b/clients/client-ec2/src/commands/BundleInstanceCommand.ts similarity index 100% rename from clients/client-ec2/commands/BundleInstanceCommand.ts rename to clients/client-ec2/src/commands/BundleInstanceCommand.ts diff --git a/clients/client-ec2/commands/CancelBundleTaskCommand.ts b/clients/client-ec2/src/commands/CancelBundleTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelBundleTaskCommand.ts rename to clients/client-ec2/src/commands/CancelBundleTaskCommand.ts diff --git a/clients/client-ec2/commands/CancelCapacityReservationCommand.ts b/clients/client-ec2/src/commands/CancelCapacityReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelCapacityReservationCommand.ts rename to clients/client-ec2/src/commands/CancelCapacityReservationCommand.ts diff --git a/clients/client-ec2/commands/CancelConversionTaskCommand.ts b/clients/client-ec2/src/commands/CancelConversionTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelConversionTaskCommand.ts rename to clients/client-ec2/src/commands/CancelConversionTaskCommand.ts diff --git a/clients/client-ec2/commands/CancelExportTaskCommand.ts b/clients/client-ec2/src/commands/CancelExportTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelExportTaskCommand.ts rename to clients/client-ec2/src/commands/CancelExportTaskCommand.ts diff --git a/clients/client-ec2/commands/CancelImportTaskCommand.ts b/clients/client-ec2/src/commands/CancelImportTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelImportTaskCommand.ts rename to clients/client-ec2/src/commands/CancelImportTaskCommand.ts diff --git a/clients/client-ec2/commands/CancelReservedInstancesListingCommand.ts b/clients/client-ec2/src/commands/CancelReservedInstancesListingCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelReservedInstancesListingCommand.ts rename to clients/client-ec2/src/commands/CancelReservedInstancesListingCommand.ts diff --git a/clients/client-ec2/commands/CancelSpotFleetRequestsCommand.ts b/clients/client-ec2/src/commands/CancelSpotFleetRequestsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelSpotFleetRequestsCommand.ts rename to clients/client-ec2/src/commands/CancelSpotFleetRequestsCommand.ts diff --git a/clients/client-ec2/commands/CancelSpotInstanceRequestsCommand.ts b/clients/client-ec2/src/commands/CancelSpotInstanceRequestsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CancelSpotInstanceRequestsCommand.ts rename to clients/client-ec2/src/commands/CancelSpotInstanceRequestsCommand.ts diff --git a/clients/client-ec2/commands/ConfirmProductInstanceCommand.ts b/clients/client-ec2/src/commands/ConfirmProductInstanceCommand.ts similarity index 100% rename from clients/client-ec2/commands/ConfirmProductInstanceCommand.ts rename to clients/client-ec2/src/commands/ConfirmProductInstanceCommand.ts diff --git a/clients/client-ec2/commands/CopyFpgaImageCommand.ts b/clients/client-ec2/src/commands/CopyFpgaImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/CopyFpgaImageCommand.ts rename to clients/client-ec2/src/commands/CopyFpgaImageCommand.ts diff --git a/clients/client-ec2/commands/CopyImageCommand.ts b/clients/client-ec2/src/commands/CopyImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/CopyImageCommand.ts rename to clients/client-ec2/src/commands/CopyImageCommand.ts diff --git a/clients/client-ec2/commands/CopySnapshotCommand.ts b/clients/client-ec2/src/commands/CopySnapshotCommand.ts similarity index 100% rename from clients/client-ec2/commands/CopySnapshotCommand.ts rename to clients/client-ec2/src/commands/CopySnapshotCommand.ts diff --git a/clients/client-ec2/commands/CreateCapacityReservationCommand.ts b/clients/client-ec2/src/commands/CreateCapacityReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateCapacityReservationCommand.ts rename to clients/client-ec2/src/commands/CreateCapacityReservationCommand.ts diff --git a/clients/client-ec2/commands/CreateCarrierGatewayCommand.ts b/clients/client-ec2/src/commands/CreateCarrierGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateCarrierGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateCarrierGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateClientVpnEndpointCommand.ts b/clients/client-ec2/src/commands/CreateClientVpnEndpointCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateClientVpnEndpointCommand.ts rename to clients/client-ec2/src/commands/CreateClientVpnEndpointCommand.ts diff --git a/clients/client-ec2/commands/CreateClientVpnRouteCommand.ts b/clients/client-ec2/src/commands/CreateClientVpnRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateClientVpnRouteCommand.ts rename to clients/client-ec2/src/commands/CreateClientVpnRouteCommand.ts diff --git a/clients/client-ec2/commands/CreateCustomerGatewayCommand.ts b/clients/client-ec2/src/commands/CreateCustomerGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateCustomerGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateCustomerGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateDefaultSubnetCommand.ts b/clients/client-ec2/src/commands/CreateDefaultSubnetCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateDefaultSubnetCommand.ts rename to clients/client-ec2/src/commands/CreateDefaultSubnetCommand.ts diff --git a/clients/client-ec2/commands/CreateDefaultVpcCommand.ts b/clients/client-ec2/src/commands/CreateDefaultVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateDefaultVpcCommand.ts rename to clients/client-ec2/src/commands/CreateDefaultVpcCommand.ts diff --git a/clients/client-ec2/commands/CreateDhcpOptionsCommand.ts b/clients/client-ec2/src/commands/CreateDhcpOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateDhcpOptionsCommand.ts rename to clients/client-ec2/src/commands/CreateDhcpOptionsCommand.ts diff --git a/clients/client-ec2/commands/CreateEgressOnlyInternetGatewayCommand.ts b/clients/client-ec2/src/commands/CreateEgressOnlyInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateEgressOnlyInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateEgressOnlyInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateFleetCommand.ts b/clients/client-ec2/src/commands/CreateFleetCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateFleetCommand.ts rename to clients/client-ec2/src/commands/CreateFleetCommand.ts diff --git a/clients/client-ec2/commands/CreateFlowLogsCommand.ts b/clients/client-ec2/src/commands/CreateFlowLogsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateFlowLogsCommand.ts rename to clients/client-ec2/src/commands/CreateFlowLogsCommand.ts diff --git a/clients/client-ec2/commands/CreateFpgaImageCommand.ts b/clients/client-ec2/src/commands/CreateFpgaImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateFpgaImageCommand.ts rename to clients/client-ec2/src/commands/CreateFpgaImageCommand.ts diff --git a/clients/client-ec2/commands/CreateImageCommand.ts b/clients/client-ec2/src/commands/CreateImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateImageCommand.ts rename to clients/client-ec2/src/commands/CreateImageCommand.ts diff --git a/clients/client-ec2/commands/CreateInstanceEventWindowCommand.ts b/clients/client-ec2/src/commands/CreateInstanceEventWindowCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateInstanceEventWindowCommand.ts rename to clients/client-ec2/src/commands/CreateInstanceEventWindowCommand.ts diff --git a/clients/client-ec2/commands/CreateInstanceExportTaskCommand.ts b/clients/client-ec2/src/commands/CreateInstanceExportTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateInstanceExportTaskCommand.ts rename to clients/client-ec2/src/commands/CreateInstanceExportTaskCommand.ts diff --git a/clients/client-ec2/commands/CreateInternetGatewayCommand.ts b/clients/client-ec2/src/commands/CreateInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateKeyPairCommand.ts b/clients/client-ec2/src/commands/CreateKeyPairCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateKeyPairCommand.ts rename to clients/client-ec2/src/commands/CreateKeyPairCommand.ts diff --git a/clients/client-ec2/commands/CreateLaunchTemplateCommand.ts b/clients/client-ec2/src/commands/CreateLaunchTemplateCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateLaunchTemplateCommand.ts rename to clients/client-ec2/src/commands/CreateLaunchTemplateCommand.ts diff --git a/clients/client-ec2/commands/CreateLaunchTemplateVersionCommand.ts b/clients/client-ec2/src/commands/CreateLaunchTemplateVersionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateLaunchTemplateVersionCommand.ts rename to clients/client-ec2/src/commands/CreateLaunchTemplateVersionCommand.ts diff --git a/clients/client-ec2/commands/CreateLocalGatewayRouteCommand.ts b/clients/client-ec2/src/commands/CreateLocalGatewayRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateLocalGatewayRouteCommand.ts rename to clients/client-ec2/src/commands/CreateLocalGatewayRouteCommand.ts diff --git a/clients/client-ec2/commands/CreateLocalGatewayRouteTableVpcAssociationCommand.ts b/clients/client-ec2/src/commands/CreateLocalGatewayRouteTableVpcAssociationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateLocalGatewayRouteTableVpcAssociationCommand.ts rename to clients/client-ec2/src/commands/CreateLocalGatewayRouteTableVpcAssociationCommand.ts diff --git a/clients/client-ec2/commands/CreateManagedPrefixListCommand.ts b/clients/client-ec2/src/commands/CreateManagedPrefixListCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateManagedPrefixListCommand.ts rename to clients/client-ec2/src/commands/CreateManagedPrefixListCommand.ts diff --git a/clients/client-ec2/commands/CreateNatGatewayCommand.ts b/clients/client-ec2/src/commands/CreateNatGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNatGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateNatGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateNetworkAclCommand.ts b/clients/client-ec2/src/commands/CreateNetworkAclCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNetworkAclCommand.ts rename to clients/client-ec2/src/commands/CreateNetworkAclCommand.ts diff --git a/clients/client-ec2/commands/CreateNetworkAclEntryCommand.ts b/clients/client-ec2/src/commands/CreateNetworkAclEntryCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNetworkAclEntryCommand.ts rename to clients/client-ec2/src/commands/CreateNetworkAclEntryCommand.ts diff --git a/clients/client-ec2/commands/CreateNetworkInsightsPathCommand.ts b/clients/client-ec2/src/commands/CreateNetworkInsightsPathCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNetworkInsightsPathCommand.ts rename to clients/client-ec2/src/commands/CreateNetworkInsightsPathCommand.ts diff --git a/clients/client-ec2/commands/CreateNetworkInterfaceCommand.ts b/clients/client-ec2/src/commands/CreateNetworkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNetworkInterfaceCommand.ts rename to clients/client-ec2/src/commands/CreateNetworkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/CreateNetworkInterfacePermissionCommand.ts b/clients/client-ec2/src/commands/CreateNetworkInterfacePermissionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateNetworkInterfacePermissionCommand.ts rename to clients/client-ec2/src/commands/CreateNetworkInterfacePermissionCommand.ts diff --git a/clients/client-ec2/commands/CreatePlacementGroupCommand.ts b/clients/client-ec2/src/commands/CreatePlacementGroupCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreatePlacementGroupCommand.ts rename to clients/client-ec2/src/commands/CreatePlacementGroupCommand.ts diff --git a/clients/client-ec2/commands/CreateReplaceRootVolumeTaskCommand.ts b/clients/client-ec2/src/commands/CreateReplaceRootVolumeTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateReplaceRootVolumeTaskCommand.ts rename to clients/client-ec2/src/commands/CreateReplaceRootVolumeTaskCommand.ts diff --git a/clients/client-ec2/commands/CreateReservedInstancesListingCommand.ts b/clients/client-ec2/src/commands/CreateReservedInstancesListingCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateReservedInstancesListingCommand.ts rename to clients/client-ec2/src/commands/CreateReservedInstancesListingCommand.ts diff --git a/clients/client-ec2/commands/CreateRestoreImageTaskCommand.ts b/clients/client-ec2/src/commands/CreateRestoreImageTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateRestoreImageTaskCommand.ts rename to clients/client-ec2/src/commands/CreateRestoreImageTaskCommand.ts diff --git a/clients/client-ec2/commands/CreateRouteCommand.ts b/clients/client-ec2/src/commands/CreateRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateRouteCommand.ts rename to clients/client-ec2/src/commands/CreateRouteCommand.ts diff --git a/clients/client-ec2/commands/CreateRouteTableCommand.ts b/clients/client-ec2/src/commands/CreateRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateRouteTableCommand.ts rename to clients/client-ec2/src/commands/CreateRouteTableCommand.ts diff --git a/clients/client-ec2/commands/CreateSecurityGroupCommand.ts b/clients/client-ec2/src/commands/CreateSecurityGroupCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSecurityGroupCommand.ts rename to clients/client-ec2/src/commands/CreateSecurityGroupCommand.ts diff --git a/clients/client-ec2/commands/CreateSnapshotCommand.ts b/clients/client-ec2/src/commands/CreateSnapshotCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSnapshotCommand.ts rename to clients/client-ec2/src/commands/CreateSnapshotCommand.ts diff --git a/clients/client-ec2/commands/CreateSnapshotsCommand.ts b/clients/client-ec2/src/commands/CreateSnapshotsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSnapshotsCommand.ts rename to clients/client-ec2/src/commands/CreateSnapshotsCommand.ts diff --git a/clients/client-ec2/commands/CreateSpotDatafeedSubscriptionCommand.ts b/clients/client-ec2/src/commands/CreateSpotDatafeedSubscriptionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSpotDatafeedSubscriptionCommand.ts rename to clients/client-ec2/src/commands/CreateSpotDatafeedSubscriptionCommand.ts diff --git a/clients/client-ec2/commands/CreateStoreImageTaskCommand.ts b/clients/client-ec2/src/commands/CreateStoreImageTaskCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateStoreImageTaskCommand.ts rename to clients/client-ec2/src/commands/CreateStoreImageTaskCommand.ts diff --git a/clients/client-ec2/commands/CreateSubnetCidrReservationCommand.ts b/clients/client-ec2/src/commands/CreateSubnetCidrReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSubnetCidrReservationCommand.ts rename to clients/client-ec2/src/commands/CreateSubnetCidrReservationCommand.ts diff --git a/clients/client-ec2/commands/CreateSubnetCommand.ts b/clients/client-ec2/src/commands/CreateSubnetCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateSubnetCommand.ts rename to clients/client-ec2/src/commands/CreateSubnetCommand.ts diff --git a/clients/client-ec2/commands/CreateTagsCommand.ts b/clients/client-ec2/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTagsCommand.ts rename to clients/client-ec2/src/commands/CreateTagsCommand.ts diff --git a/clients/client-ec2/commands/CreateTrafficMirrorFilterCommand.ts b/clients/client-ec2/src/commands/CreateTrafficMirrorFilterCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTrafficMirrorFilterCommand.ts rename to clients/client-ec2/src/commands/CreateTrafficMirrorFilterCommand.ts diff --git a/clients/client-ec2/commands/CreateTrafficMirrorFilterRuleCommand.ts b/clients/client-ec2/src/commands/CreateTrafficMirrorFilterRuleCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTrafficMirrorFilterRuleCommand.ts rename to clients/client-ec2/src/commands/CreateTrafficMirrorFilterRuleCommand.ts diff --git a/clients/client-ec2/commands/CreateTrafficMirrorSessionCommand.ts b/clients/client-ec2/src/commands/CreateTrafficMirrorSessionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTrafficMirrorSessionCommand.ts rename to clients/client-ec2/src/commands/CreateTrafficMirrorSessionCommand.ts diff --git a/clients/client-ec2/commands/CreateTrafficMirrorTargetCommand.ts b/clients/client-ec2/src/commands/CreateTrafficMirrorTargetCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTrafficMirrorTargetCommand.ts rename to clients/client-ec2/src/commands/CreateTrafficMirrorTargetCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayConnectCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayConnectCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayConnectCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayConnectCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayConnectPeerCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayConnectPeerCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayConnectPeerCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayConnectPeerCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayMulticastDomainCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayMulticastDomainCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayMulticastDomainCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayMulticastDomainCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayPeeringAttachmentCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayPeeringAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayPeeringAttachmentCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayPeeringAttachmentCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayPrefixListReferenceCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayPrefixListReferenceCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayPrefixListReferenceCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayPrefixListReferenceCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayRouteCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayRouteCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayRouteCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayRouteTableCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayRouteTableCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayRouteTableCommand.ts diff --git a/clients/client-ec2/commands/CreateTransitGatewayVpcAttachmentCommand.ts b/clients/client-ec2/src/commands/CreateTransitGatewayVpcAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateTransitGatewayVpcAttachmentCommand.ts rename to clients/client-ec2/src/commands/CreateTransitGatewayVpcAttachmentCommand.ts diff --git a/clients/client-ec2/commands/CreateVolumeCommand.ts b/clients/client-ec2/src/commands/CreateVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVolumeCommand.ts rename to clients/client-ec2/src/commands/CreateVolumeCommand.ts diff --git a/clients/client-ec2/commands/CreateVpcCommand.ts b/clients/client-ec2/src/commands/CreateVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpcCommand.ts rename to clients/client-ec2/src/commands/CreateVpcCommand.ts diff --git a/clients/client-ec2/commands/CreateVpcEndpointCommand.ts b/clients/client-ec2/src/commands/CreateVpcEndpointCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpcEndpointCommand.ts rename to clients/client-ec2/src/commands/CreateVpcEndpointCommand.ts diff --git a/clients/client-ec2/commands/CreateVpcEndpointConnectionNotificationCommand.ts b/clients/client-ec2/src/commands/CreateVpcEndpointConnectionNotificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpcEndpointConnectionNotificationCommand.ts rename to clients/client-ec2/src/commands/CreateVpcEndpointConnectionNotificationCommand.ts diff --git a/clients/client-ec2/commands/CreateVpcEndpointServiceConfigurationCommand.ts b/clients/client-ec2/src/commands/CreateVpcEndpointServiceConfigurationCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpcEndpointServiceConfigurationCommand.ts rename to clients/client-ec2/src/commands/CreateVpcEndpointServiceConfigurationCommand.ts diff --git a/clients/client-ec2/commands/CreateVpcPeeringConnectionCommand.ts b/clients/client-ec2/src/commands/CreateVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpcPeeringConnectionCommand.ts rename to clients/client-ec2/src/commands/CreateVpcPeeringConnectionCommand.ts diff --git a/clients/client-ec2/commands/CreateVpnConnectionCommand.ts b/clients/client-ec2/src/commands/CreateVpnConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpnConnectionCommand.ts rename to clients/client-ec2/src/commands/CreateVpnConnectionCommand.ts diff --git a/clients/client-ec2/commands/CreateVpnConnectionRouteCommand.ts b/clients/client-ec2/src/commands/CreateVpnConnectionRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpnConnectionRouteCommand.ts rename to clients/client-ec2/src/commands/CreateVpnConnectionRouteCommand.ts diff --git a/clients/client-ec2/commands/CreateVpnGatewayCommand.ts b/clients/client-ec2/src/commands/CreateVpnGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/CreateVpnGatewayCommand.ts rename to clients/client-ec2/src/commands/CreateVpnGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteCarrierGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteCarrierGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteCarrierGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteCarrierGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteClientVpnEndpointCommand.ts b/clients/client-ec2/src/commands/DeleteClientVpnEndpointCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteClientVpnEndpointCommand.ts rename to clients/client-ec2/src/commands/DeleteClientVpnEndpointCommand.ts diff --git a/clients/client-ec2/commands/DeleteClientVpnRouteCommand.ts b/clients/client-ec2/src/commands/DeleteClientVpnRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteClientVpnRouteCommand.ts rename to clients/client-ec2/src/commands/DeleteClientVpnRouteCommand.ts diff --git a/clients/client-ec2/commands/DeleteCustomerGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteCustomerGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteCustomerGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteCustomerGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteDhcpOptionsCommand.ts b/clients/client-ec2/src/commands/DeleteDhcpOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteDhcpOptionsCommand.ts rename to clients/client-ec2/src/commands/DeleteDhcpOptionsCommand.ts diff --git a/clients/client-ec2/commands/DeleteEgressOnlyInternetGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteEgressOnlyInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteEgressOnlyInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteEgressOnlyInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteFleetsCommand.ts b/clients/client-ec2/src/commands/DeleteFleetsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteFleetsCommand.ts rename to clients/client-ec2/src/commands/DeleteFleetsCommand.ts diff --git a/clients/client-ec2/commands/DeleteFlowLogsCommand.ts b/clients/client-ec2/src/commands/DeleteFlowLogsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteFlowLogsCommand.ts rename to clients/client-ec2/src/commands/DeleteFlowLogsCommand.ts diff --git a/clients/client-ec2/commands/DeleteFpgaImageCommand.ts b/clients/client-ec2/src/commands/DeleteFpgaImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteFpgaImageCommand.ts rename to clients/client-ec2/src/commands/DeleteFpgaImageCommand.ts diff --git a/clients/client-ec2/commands/DeleteInstanceEventWindowCommand.ts b/clients/client-ec2/src/commands/DeleteInstanceEventWindowCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteInstanceEventWindowCommand.ts rename to clients/client-ec2/src/commands/DeleteInstanceEventWindowCommand.ts diff --git a/clients/client-ec2/commands/DeleteInternetGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteKeyPairCommand.ts b/clients/client-ec2/src/commands/DeleteKeyPairCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteKeyPairCommand.ts rename to clients/client-ec2/src/commands/DeleteKeyPairCommand.ts diff --git a/clients/client-ec2/commands/DeleteLaunchTemplateCommand.ts b/clients/client-ec2/src/commands/DeleteLaunchTemplateCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteLaunchTemplateCommand.ts rename to clients/client-ec2/src/commands/DeleteLaunchTemplateCommand.ts diff --git a/clients/client-ec2/commands/DeleteLaunchTemplateVersionsCommand.ts b/clients/client-ec2/src/commands/DeleteLaunchTemplateVersionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteLaunchTemplateVersionsCommand.ts rename to clients/client-ec2/src/commands/DeleteLaunchTemplateVersionsCommand.ts diff --git a/clients/client-ec2/commands/DeleteLocalGatewayRouteCommand.ts b/clients/client-ec2/src/commands/DeleteLocalGatewayRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteLocalGatewayRouteCommand.ts rename to clients/client-ec2/src/commands/DeleteLocalGatewayRouteCommand.ts diff --git a/clients/client-ec2/commands/DeleteLocalGatewayRouteTableVpcAssociationCommand.ts b/clients/client-ec2/src/commands/DeleteLocalGatewayRouteTableVpcAssociationCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteLocalGatewayRouteTableVpcAssociationCommand.ts rename to clients/client-ec2/src/commands/DeleteLocalGatewayRouteTableVpcAssociationCommand.ts diff --git a/clients/client-ec2/commands/DeleteManagedPrefixListCommand.ts b/clients/client-ec2/src/commands/DeleteManagedPrefixListCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteManagedPrefixListCommand.ts rename to clients/client-ec2/src/commands/DeleteManagedPrefixListCommand.ts diff --git a/clients/client-ec2/commands/DeleteNatGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteNatGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNatGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteNatGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkAclCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkAclCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkAclCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkAclCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkAclEntryCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkAclEntryCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkAclEntryCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkAclEntryCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkInsightsAnalysisCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkInsightsAnalysisCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkInsightsAnalysisCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkInsightsAnalysisCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkInsightsPathCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkInsightsPathCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkInsightsPathCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkInsightsPathCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkInterfaceCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkInterfaceCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/DeleteNetworkInterfacePermissionCommand.ts b/clients/client-ec2/src/commands/DeleteNetworkInterfacePermissionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteNetworkInterfacePermissionCommand.ts rename to clients/client-ec2/src/commands/DeleteNetworkInterfacePermissionCommand.ts diff --git a/clients/client-ec2/commands/DeletePlacementGroupCommand.ts b/clients/client-ec2/src/commands/DeletePlacementGroupCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeletePlacementGroupCommand.ts rename to clients/client-ec2/src/commands/DeletePlacementGroupCommand.ts diff --git a/clients/client-ec2/commands/DeleteQueuedReservedInstancesCommand.ts b/clients/client-ec2/src/commands/DeleteQueuedReservedInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteQueuedReservedInstancesCommand.ts rename to clients/client-ec2/src/commands/DeleteQueuedReservedInstancesCommand.ts diff --git a/clients/client-ec2/commands/DeleteRouteCommand.ts b/clients/client-ec2/src/commands/DeleteRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteRouteCommand.ts rename to clients/client-ec2/src/commands/DeleteRouteCommand.ts diff --git a/clients/client-ec2/commands/DeleteRouteTableCommand.ts b/clients/client-ec2/src/commands/DeleteRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteRouteTableCommand.ts rename to clients/client-ec2/src/commands/DeleteRouteTableCommand.ts diff --git a/clients/client-ec2/commands/DeleteSecurityGroupCommand.ts b/clients/client-ec2/src/commands/DeleteSecurityGroupCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteSecurityGroupCommand.ts rename to clients/client-ec2/src/commands/DeleteSecurityGroupCommand.ts diff --git a/clients/client-ec2/commands/DeleteSnapshotCommand.ts b/clients/client-ec2/src/commands/DeleteSnapshotCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteSnapshotCommand.ts rename to clients/client-ec2/src/commands/DeleteSnapshotCommand.ts diff --git a/clients/client-ec2/commands/DeleteSpotDatafeedSubscriptionCommand.ts b/clients/client-ec2/src/commands/DeleteSpotDatafeedSubscriptionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteSpotDatafeedSubscriptionCommand.ts rename to clients/client-ec2/src/commands/DeleteSpotDatafeedSubscriptionCommand.ts diff --git a/clients/client-ec2/commands/DeleteSubnetCidrReservationCommand.ts b/clients/client-ec2/src/commands/DeleteSubnetCidrReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteSubnetCidrReservationCommand.ts rename to clients/client-ec2/src/commands/DeleteSubnetCidrReservationCommand.ts diff --git a/clients/client-ec2/commands/DeleteSubnetCommand.ts b/clients/client-ec2/src/commands/DeleteSubnetCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteSubnetCommand.ts rename to clients/client-ec2/src/commands/DeleteSubnetCommand.ts diff --git a/clients/client-ec2/commands/DeleteTagsCommand.ts b/clients/client-ec2/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTagsCommand.ts rename to clients/client-ec2/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-ec2/commands/DeleteTrafficMirrorFilterCommand.ts b/clients/client-ec2/src/commands/DeleteTrafficMirrorFilterCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTrafficMirrorFilterCommand.ts rename to clients/client-ec2/src/commands/DeleteTrafficMirrorFilterCommand.ts diff --git a/clients/client-ec2/commands/DeleteTrafficMirrorFilterRuleCommand.ts b/clients/client-ec2/src/commands/DeleteTrafficMirrorFilterRuleCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTrafficMirrorFilterRuleCommand.ts rename to clients/client-ec2/src/commands/DeleteTrafficMirrorFilterRuleCommand.ts diff --git a/clients/client-ec2/commands/DeleteTrafficMirrorSessionCommand.ts b/clients/client-ec2/src/commands/DeleteTrafficMirrorSessionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTrafficMirrorSessionCommand.ts rename to clients/client-ec2/src/commands/DeleteTrafficMirrorSessionCommand.ts diff --git a/clients/client-ec2/commands/DeleteTrafficMirrorTargetCommand.ts b/clients/client-ec2/src/commands/DeleteTrafficMirrorTargetCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTrafficMirrorTargetCommand.ts rename to clients/client-ec2/src/commands/DeleteTrafficMirrorTargetCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayConnectCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayConnectCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayConnectCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayConnectCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayConnectPeerCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayConnectPeerCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayConnectPeerCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayConnectPeerCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayMulticastDomainCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayMulticastDomainCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayMulticastDomainCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayMulticastDomainCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayPeeringAttachmentCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayPeeringAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayPeeringAttachmentCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayPeeringAttachmentCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayPrefixListReferenceCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayPrefixListReferenceCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayPrefixListReferenceCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayPrefixListReferenceCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayRouteCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayRouteCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayRouteCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayRouteTableCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayRouteTableCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayRouteTableCommand.ts diff --git a/clients/client-ec2/commands/DeleteTransitGatewayVpcAttachmentCommand.ts b/clients/client-ec2/src/commands/DeleteTransitGatewayVpcAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteTransitGatewayVpcAttachmentCommand.ts rename to clients/client-ec2/src/commands/DeleteTransitGatewayVpcAttachmentCommand.ts diff --git a/clients/client-ec2/commands/DeleteVolumeCommand.ts b/clients/client-ec2/src/commands/DeleteVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVolumeCommand.ts rename to clients/client-ec2/src/commands/DeleteVolumeCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpcCommand.ts b/clients/client-ec2/src/commands/DeleteVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpcCommand.ts rename to clients/client-ec2/src/commands/DeleteVpcCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpcEndpointConnectionNotificationsCommand.ts b/clients/client-ec2/src/commands/DeleteVpcEndpointConnectionNotificationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpcEndpointConnectionNotificationsCommand.ts rename to clients/client-ec2/src/commands/DeleteVpcEndpointConnectionNotificationsCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpcEndpointServiceConfigurationsCommand.ts b/clients/client-ec2/src/commands/DeleteVpcEndpointServiceConfigurationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpcEndpointServiceConfigurationsCommand.ts rename to clients/client-ec2/src/commands/DeleteVpcEndpointServiceConfigurationsCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpcEndpointsCommand.ts b/clients/client-ec2/src/commands/DeleteVpcEndpointsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpcEndpointsCommand.ts rename to clients/client-ec2/src/commands/DeleteVpcEndpointsCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpcPeeringConnectionCommand.ts b/clients/client-ec2/src/commands/DeleteVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpcPeeringConnectionCommand.ts rename to clients/client-ec2/src/commands/DeleteVpcPeeringConnectionCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpnConnectionCommand.ts b/clients/client-ec2/src/commands/DeleteVpnConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpnConnectionCommand.ts rename to clients/client-ec2/src/commands/DeleteVpnConnectionCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpnConnectionRouteCommand.ts b/clients/client-ec2/src/commands/DeleteVpnConnectionRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpnConnectionRouteCommand.ts rename to clients/client-ec2/src/commands/DeleteVpnConnectionRouteCommand.ts diff --git a/clients/client-ec2/commands/DeleteVpnGatewayCommand.ts b/clients/client-ec2/src/commands/DeleteVpnGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeleteVpnGatewayCommand.ts rename to clients/client-ec2/src/commands/DeleteVpnGatewayCommand.ts diff --git a/clients/client-ec2/commands/DeprovisionByoipCidrCommand.ts b/clients/client-ec2/src/commands/DeprovisionByoipCidrCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeprovisionByoipCidrCommand.ts rename to clients/client-ec2/src/commands/DeprovisionByoipCidrCommand.ts diff --git a/clients/client-ec2/commands/DeregisterImageCommand.ts b/clients/client-ec2/src/commands/DeregisterImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeregisterImageCommand.ts rename to clients/client-ec2/src/commands/DeregisterImageCommand.ts diff --git a/clients/client-ec2/commands/DeregisterInstanceEventNotificationAttributesCommand.ts b/clients/client-ec2/src/commands/DeregisterInstanceEventNotificationAttributesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeregisterInstanceEventNotificationAttributesCommand.ts rename to clients/client-ec2/src/commands/DeregisterInstanceEventNotificationAttributesCommand.ts diff --git a/clients/client-ec2/commands/DeregisterTransitGatewayMulticastGroupMembersCommand.ts b/clients/client-ec2/src/commands/DeregisterTransitGatewayMulticastGroupMembersCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeregisterTransitGatewayMulticastGroupMembersCommand.ts rename to clients/client-ec2/src/commands/DeregisterTransitGatewayMulticastGroupMembersCommand.ts diff --git a/clients/client-ec2/commands/DeregisterTransitGatewayMulticastGroupSourcesCommand.ts b/clients/client-ec2/src/commands/DeregisterTransitGatewayMulticastGroupSourcesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DeregisterTransitGatewayMulticastGroupSourcesCommand.ts rename to clients/client-ec2/src/commands/DeregisterTransitGatewayMulticastGroupSourcesCommand.ts diff --git a/clients/client-ec2/commands/DescribeAccountAttributesCommand.ts b/clients/client-ec2/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeAccountAttributesCommand.ts rename to clients/client-ec2/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-ec2/commands/DescribeAddressesAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeAddressesAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeAddressesAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeAddressesAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeAddressesCommand.ts b/clients/client-ec2/src/commands/DescribeAddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeAddressesCommand.ts rename to clients/client-ec2/src/commands/DescribeAddressesCommand.ts diff --git a/clients/client-ec2/commands/DescribeAggregateIdFormatCommand.ts b/clients/client-ec2/src/commands/DescribeAggregateIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeAggregateIdFormatCommand.ts rename to clients/client-ec2/src/commands/DescribeAggregateIdFormatCommand.ts diff --git a/clients/client-ec2/commands/DescribeAvailabilityZonesCommand.ts b/clients/client-ec2/src/commands/DescribeAvailabilityZonesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeAvailabilityZonesCommand.ts rename to clients/client-ec2/src/commands/DescribeAvailabilityZonesCommand.ts diff --git a/clients/client-ec2/commands/DescribeBundleTasksCommand.ts b/clients/client-ec2/src/commands/DescribeBundleTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeBundleTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeBundleTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeByoipCidrsCommand.ts b/clients/client-ec2/src/commands/DescribeByoipCidrsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeByoipCidrsCommand.ts rename to clients/client-ec2/src/commands/DescribeByoipCidrsCommand.ts diff --git a/clients/client-ec2/commands/DescribeCapacityReservationsCommand.ts b/clients/client-ec2/src/commands/DescribeCapacityReservationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeCapacityReservationsCommand.ts rename to clients/client-ec2/src/commands/DescribeCapacityReservationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeCarrierGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeCarrierGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeCarrierGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeCarrierGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeClassicLinkInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeClassicLinkInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClassicLinkInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeClassicLinkInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeClientVpnAuthorizationRulesCommand.ts b/clients/client-ec2/src/commands/DescribeClientVpnAuthorizationRulesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClientVpnAuthorizationRulesCommand.ts rename to clients/client-ec2/src/commands/DescribeClientVpnAuthorizationRulesCommand.ts diff --git a/clients/client-ec2/commands/DescribeClientVpnConnectionsCommand.ts b/clients/client-ec2/src/commands/DescribeClientVpnConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClientVpnConnectionsCommand.ts rename to clients/client-ec2/src/commands/DescribeClientVpnConnectionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeClientVpnEndpointsCommand.ts b/clients/client-ec2/src/commands/DescribeClientVpnEndpointsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClientVpnEndpointsCommand.ts rename to clients/client-ec2/src/commands/DescribeClientVpnEndpointsCommand.ts diff --git a/clients/client-ec2/commands/DescribeClientVpnRoutesCommand.ts b/clients/client-ec2/src/commands/DescribeClientVpnRoutesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClientVpnRoutesCommand.ts rename to clients/client-ec2/src/commands/DescribeClientVpnRoutesCommand.ts diff --git a/clients/client-ec2/commands/DescribeClientVpnTargetNetworksCommand.ts b/clients/client-ec2/src/commands/DescribeClientVpnTargetNetworksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeClientVpnTargetNetworksCommand.ts rename to clients/client-ec2/src/commands/DescribeClientVpnTargetNetworksCommand.ts diff --git a/clients/client-ec2/commands/DescribeCoipPoolsCommand.ts b/clients/client-ec2/src/commands/DescribeCoipPoolsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeCoipPoolsCommand.ts rename to clients/client-ec2/src/commands/DescribeCoipPoolsCommand.ts diff --git a/clients/client-ec2/commands/DescribeConversionTasksCommand.ts b/clients/client-ec2/src/commands/DescribeConversionTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeConversionTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeConversionTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeCustomerGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeCustomerGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeCustomerGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeCustomerGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeDhcpOptionsCommand.ts b/clients/client-ec2/src/commands/DescribeDhcpOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeDhcpOptionsCommand.ts rename to clients/client-ec2/src/commands/DescribeDhcpOptionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeEgressOnlyInternetGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeEgressOnlyInternetGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeEgressOnlyInternetGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeEgressOnlyInternetGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeElasticGpusCommand.ts b/clients/client-ec2/src/commands/DescribeElasticGpusCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeElasticGpusCommand.ts rename to clients/client-ec2/src/commands/DescribeElasticGpusCommand.ts diff --git a/clients/client-ec2/commands/DescribeExportImageTasksCommand.ts b/clients/client-ec2/src/commands/DescribeExportImageTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeExportImageTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeExportImageTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeExportTasksCommand.ts b/clients/client-ec2/src/commands/DescribeExportTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeExportTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeExportTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeFastSnapshotRestoresCommand.ts b/clients/client-ec2/src/commands/DescribeFastSnapshotRestoresCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFastSnapshotRestoresCommand.ts rename to clients/client-ec2/src/commands/DescribeFastSnapshotRestoresCommand.ts diff --git a/clients/client-ec2/commands/DescribeFleetHistoryCommand.ts b/clients/client-ec2/src/commands/DescribeFleetHistoryCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFleetHistoryCommand.ts rename to clients/client-ec2/src/commands/DescribeFleetHistoryCommand.ts diff --git a/clients/client-ec2/commands/DescribeFleetInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeFleetInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFleetInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeFleetInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeFleetsCommand.ts b/clients/client-ec2/src/commands/DescribeFleetsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFleetsCommand.ts rename to clients/client-ec2/src/commands/DescribeFleetsCommand.ts diff --git a/clients/client-ec2/commands/DescribeFlowLogsCommand.ts b/clients/client-ec2/src/commands/DescribeFlowLogsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFlowLogsCommand.ts rename to clients/client-ec2/src/commands/DescribeFlowLogsCommand.ts diff --git a/clients/client-ec2/commands/DescribeFpgaImageAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeFpgaImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFpgaImageAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeFpgaImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeFpgaImagesCommand.ts b/clients/client-ec2/src/commands/DescribeFpgaImagesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeFpgaImagesCommand.ts rename to clients/client-ec2/src/commands/DescribeFpgaImagesCommand.ts diff --git a/clients/client-ec2/commands/DescribeHostReservationOfferingsCommand.ts b/clients/client-ec2/src/commands/DescribeHostReservationOfferingsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeHostReservationOfferingsCommand.ts rename to clients/client-ec2/src/commands/DescribeHostReservationOfferingsCommand.ts diff --git a/clients/client-ec2/commands/DescribeHostReservationsCommand.ts b/clients/client-ec2/src/commands/DescribeHostReservationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeHostReservationsCommand.ts rename to clients/client-ec2/src/commands/DescribeHostReservationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeHostsCommand.ts b/clients/client-ec2/src/commands/DescribeHostsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeHostsCommand.ts rename to clients/client-ec2/src/commands/DescribeHostsCommand.ts diff --git a/clients/client-ec2/commands/DescribeIamInstanceProfileAssociationsCommand.ts b/clients/client-ec2/src/commands/DescribeIamInstanceProfileAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeIamInstanceProfileAssociationsCommand.ts rename to clients/client-ec2/src/commands/DescribeIamInstanceProfileAssociationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeIdFormatCommand.ts b/clients/client-ec2/src/commands/DescribeIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeIdFormatCommand.ts rename to clients/client-ec2/src/commands/DescribeIdFormatCommand.ts diff --git a/clients/client-ec2/commands/DescribeIdentityIdFormatCommand.ts b/clients/client-ec2/src/commands/DescribeIdentityIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeIdentityIdFormatCommand.ts rename to clients/client-ec2/src/commands/DescribeIdentityIdFormatCommand.ts diff --git a/clients/client-ec2/commands/DescribeImageAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeImageAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeImagesCommand.ts b/clients/client-ec2/src/commands/DescribeImagesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeImagesCommand.ts rename to clients/client-ec2/src/commands/DescribeImagesCommand.ts diff --git a/clients/client-ec2/commands/DescribeImportImageTasksCommand.ts b/clients/client-ec2/src/commands/DescribeImportImageTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeImportImageTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeImportImageTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeImportSnapshotTasksCommand.ts b/clients/client-ec2/src/commands/DescribeImportSnapshotTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeImportSnapshotTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeImportSnapshotTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceCreditSpecificationsCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceCreditSpecificationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceCreditSpecificationsCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceCreditSpecificationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceEventNotificationAttributesCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceEventNotificationAttributesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceEventNotificationAttributesCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceEventNotificationAttributesCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceEventWindowsCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceEventWindowsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceEventWindowsCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceEventWindowsCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceStatusCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceStatusCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceStatusCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceStatusCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceTypeOfferingsCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceTypeOfferingsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceTypeOfferingsCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceTypeOfferingsCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstanceTypesCommand.ts b/clients/client-ec2/src/commands/DescribeInstanceTypesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstanceTypesCommand.ts rename to clients/client-ec2/src/commands/DescribeInstanceTypesCommand.ts diff --git a/clients/client-ec2/commands/DescribeInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeInternetGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeInternetGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeInternetGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeInternetGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeIpv6PoolsCommand.ts b/clients/client-ec2/src/commands/DescribeIpv6PoolsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeIpv6PoolsCommand.ts rename to clients/client-ec2/src/commands/DescribeIpv6PoolsCommand.ts diff --git a/clients/client-ec2/commands/DescribeKeyPairsCommand.ts b/clients/client-ec2/src/commands/DescribeKeyPairsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeKeyPairsCommand.ts rename to clients/client-ec2/src/commands/DescribeKeyPairsCommand.ts diff --git a/clients/client-ec2/commands/DescribeLaunchTemplateVersionsCommand.ts b/clients/client-ec2/src/commands/DescribeLaunchTemplateVersionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLaunchTemplateVersionsCommand.ts rename to clients/client-ec2/src/commands/DescribeLaunchTemplateVersionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeLaunchTemplatesCommand.ts b/clients/client-ec2/src/commands/DescribeLaunchTemplatesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLaunchTemplatesCommand.ts rename to clients/client-ec2/src/commands/DescribeLaunchTemplatesCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewayRouteTableVpcAssociationsCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewayRouteTableVpcAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewayRouteTableVpcAssociationsCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewayRouteTableVpcAssociationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewayRouteTablesCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewayRouteTablesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewayRouteTablesCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewayRouteTablesCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewayVirtualInterfaceGroupsCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewayVirtualInterfaceGroupsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewayVirtualInterfaceGroupsCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewayVirtualInterfaceGroupsCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewayVirtualInterfacesCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewayVirtualInterfacesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewayVirtualInterfacesCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewayVirtualInterfacesCommand.ts diff --git a/clients/client-ec2/commands/DescribeLocalGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeLocalGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeLocalGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeLocalGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeManagedPrefixListsCommand.ts b/clients/client-ec2/src/commands/DescribeManagedPrefixListsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeManagedPrefixListsCommand.ts rename to clients/client-ec2/src/commands/DescribeManagedPrefixListsCommand.ts diff --git a/clients/client-ec2/commands/DescribeMovingAddressesCommand.ts b/clients/client-ec2/src/commands/DescribeMovingAddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeMovingAddressesCommand.ts rename to clients/client-ec2/src/commands/DescribeMovingAddressesCommand.ts diff --git a/clients/client-ec2/commands/DescribeNatGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeNatGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNatGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeNatGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkAclsCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkAclsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkAclsCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkAclsCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkInsightsAnalysesCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkInsightsAnalysesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkInsightsAnalysesCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkInsightsAnalysesCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkInsightsPathsCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkInsightsPathsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkInsightsPathsCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkInsightsPathsCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkInterfaceAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkInterfaceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkInterfaceAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkInterfaceAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkInterfacePermissionsCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkInterfacePermissionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkInterfacePermissionsCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkInterfacePermissionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeNetworkInterfacesCommand.ts b/clients/client-ec2/src/commands/DescribeNetworkInterfacesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeNetworkInterfacesCommand.ts rename to clients/client-ec2/src/commands/DescribeNetworkInterfacesCommand.ts diff --git a/clients/client-ec2/commands/DescribePlacementGroupsCommand.ts b/clients/client-ec2/src/commands/DescribePlacementGroupsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribePlacementGroupsCommand.ts rename to clients/client-ec2/src/commands/DescribePlacementGroupsCommand.ts diff --git a/clients/client-ec2/commands/DescribePrefixListsCommand.ts b/clients/client-ec2/src/commands/DescribePrefixListsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribePrefixListsCommand.ts rename to clients/client-ec2/src/commands/DescribePrefixListsCommand.ts diff --git a/clients/client-ec2/commands/DescribePrincipalIdFormatCommand.ts b/clients/client-ec2/src/commands/DescribePrincipalIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribePrincipalIdFormatCommand.ts rename to clients/client-ec2/src/commands/DescribePrincipalIdFormatCommand.ts diff --git a/clients/client-ec2/commands/DescribePublicIpv4PoolsCommand.ts b/clients/client-ec2/src/commands/DescribePublicIpv4PoolsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribePublicIpv4PoolsCommand.ts rename to clients/client-ec2/src/commands/DescribePublicIpv4PoolsCommand.ts diff --git a/clients/client-ec2/commands/DescribeRegionsCommand.ts b/clients/client-ec2/src/commands/DescribeRegionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeRegionsCommand.ts rename to clients/client-ec2/src/commands/DescribeRegionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeReplaceRootVolumeTasksCommand.ts b/clients/client-ec2/src/commands/DescribeReplaceRootVolumeTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeReplaceRootVolumeTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeReplaceRootVolumeTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeReservedInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeReservedInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeReservedInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeReservedInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeReservedInstancesListingsCommand.ts b/clients/client-ec2/src/commands/DescribeReservedInstancesListingsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeReservedInstancesListingsCommand.ts rename to clients/client-ec2/src/commands/DescribeReservedInstancesListingsCommand.ts diff --git a/clients/client-ec2/commands/DescribeReservedInstancesModificationsCommand.ts b/clients/client-ec2/src/commands/DescribeReservedInstancesModificationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeReservedInstancesModificationsCommand.ts rename to clients/client-ec2/src/commands/DescribeReservedInstancesModificationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeReservedInstancesOfferingsCommand.ts b/clients/client-ec2/src/commands/DescribeReservedInstancesOfferingsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeReservedInstancesOfferingsCommand.ts rename to clients/client-ec2/src/commands/DescribeReservedInstancesOfferingsCommand.ts diff --git a/clients/client-ec2/commands/DescribeRouteTablesCommand.ts b/clients/client-ec2/src/commands/DescribeRouteTablesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeRouteTablesCommand.ts rename to clients/client-ec2/src/commands/DescribeRouteTablesCommand.ts diff --git a/clients/client-ec2/commands/DescribeScheduledInstanceAvailabilityCommand.ts b/clients/client-ec2/src/commands/DescribeScheduledInstanceAvailabilityCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeScheduledInstanceAvailabilityCommand.ts rename to clients/client-ec2/src/commands/DescribeScheduledInstanceAvailabilityCommand.ts diff --git a/clients/client-ec2/commands/DescribeScheduledInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeScheduledInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeScheduledInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeScheduledInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeSecurityGroupReferencesCommand.ts b/clients/client-ec2/src/commands/DescribeSecurityGroupReferencesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSecurityGroupReferencesCommand.ts rename to clients/client-ec2/src/commands/DescribeSecurityGroupReferencesCommand.ts diff --git a/clients/client-ec2/commands/DescribeSecurityGroupRulesCommand.ts b/clients/client-ec2/src/commands/DescribeSecurityGroupRulesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSecurityGroupRulesCommand.ts rename to clients/client-ec2/src/commands/DescribeSecurityGroupRulesCommand.ts diff --git a/clients/client-ec2/commands/DescribeSecurityGroupsCommand.ts b/clients/client-ec2/src/commands/DescribeSecurityGroupsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSecurityGroupsCommand.ts rename to clients/client-ec2/src/commands/DescribeSecurityGroupsCommand.ts diff --git a/clients/client-ec2/commands/DescribeSnapshotAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSnapshotAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeSnapshotAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeSnapshotsCommand.ts b/clients/client-ec2/src/commands/DescribeSnapshotsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSnapshotsCommand.ts rename to clients/client-ec2/src/commands/DescribeSnapshotsCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotDatafeedSubscriptionCommand.ts b/clients/client-ec2/src/commands/DescribeSpotDatafeedSubscriptionCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotDatafeedSubscriptionCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotDatafeedSubscriptionCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotFleetInstancesCommand.ts b/clients/client-ec2/src/commands/DescribeSpotFleetInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotFleetInstancesCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotFleetInstancesCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotFleetRequestHistoryCommand.ts b/clients/client-ec2/src/commands/DescribeSpotFleetRequestHistoryCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotFleetRequestHistoryCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotFleetRequestHistoryCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotFleetRequestsCommand.ts b/clients/client-ec2/src/commands/DescribeSpotFleetRequestsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotFleetRequestsCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotFleetRequestsCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotInstanceRequestsCommand.ts b/clients/client-ec2/src/commands/DescribeSpotInstanceRequestsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotInstanceRequestsCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotInstanceRequestsCommand.ts diff --git a/clients/client-ec2/commands/DescribeSpotPriceHistoryCommand.ts b/clients/client-ec2/src/commands/DescribeSpotPriceHistoryCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSpotPriceHistoryCommand.ts rename to clients/client-ec2/src/commands/DescribeSpotPriceHistoryCommand.ts diff --git a/clients/client-ec2/commands/DescribeStaleSecurityGroupsCommand.ts b/clients/client-ec2/src/commands/DescribeStaleSecurityGroupsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeStaleSecurityGroupsCommand.ts rename to clients/client-ec2/src/commands/DescribeStaleSecurityGroupsCommand.ts diff --git a/clients/client-ec2/commands/DescribeStoreImageTasksCommand.ts b/clients/client-ec2/src/commands/DescribeStoreImageTasksCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeStoreImageTasksCommand.ts rename to clients/client-ec2/src/commands/DescribeStoreImageTasksCommand.ts diff --git a/clients/client-ec2/commands/DescribeSubnetsCommand.ts b/clients/client-ec2/src/commands/DescribeSubnetsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeSubnetsCommand.ts rename to clients/client-ec2/src/commands/DescribeSubnetsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTagsCommand.ts b/clients/client-ec2/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTagsCommand.ts rename to clients/client-ec2/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTrafficMirrorFiltersCommand.ts b/clients/client-ec2/src/commands/DescribeTrafficMirrorFiltersCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTrafficMirrorFiltersCommand.ts rename to clients/client-ec2/src/commands/DescribeTrafficMirrorFiltersCommand.ts diff --git a/clients/client-ec2/commands/DescribeTrafficMirrorSessionsCommand.ts b/clients/client-ec2/src/commands/DescribeTrafficMirrorSessionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTrafficMirrorSessionsCommand.ts rename to clients/client-ec2/src/commands/DescribeTrafficMirrorSessionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTrafficMirrorTargetsCommand.ts b/clients/client-ec2/src/commands/DescribeTrafficMirrorTargetsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTrafficMirrorTargetsCommand.ts rename to clients/client-ec2/src/commands/DescribeTrafficMirrorTargetsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayAttachmentsCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayAttachmentsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayAttachmentsCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayAttachmentsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayConnectPeersCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayConnectPeersCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayConnectPeersCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayConnectPeersCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayConnectsCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayConnectsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayConnectsCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayConnectsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayMulticastDomainsCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayMulticastDomainsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayMulticastDomainsCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayMulticastDomainsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayPeeringAttachmentsCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayPeeringAttachmentsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayPeeringAttachmentsCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayPeeringAttachmentsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayRouteTablesCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayRouteTablesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayRouteTablesCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayRouteTablesCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewayVpcAttachmentsCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewayVpcAttachmentsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewayVpcAttachmentsCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewayVpcAttachmentsCommand.ts diff --git a/clients/client-ec2/commands/DescribeTransitGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeTransitGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTransitGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeTransitGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DescribeTrunkInterfaceAssociationsCommand.ts b/clients/client-ec2/src/commands/DescribeTrunkInterfaceAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeTrunkInterfaceAssociationsCommand.ts rename to clients/client-ec2/src/commands/DescribeTrunkInterfaceAssociationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVolumeAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeVolumeAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVolumeAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeVolumeAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeVolumeStatusCommand.ts b/clients/client-ec2/src/commands/DescribeVolumeStatusCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVolumeStatusCommand.ts rename to clients/client-ec2/src/commands/DescribeVolumeStatusCommand.ts diff --git a/clients/client-ec2/commands/DescribeVolumesCommand.ts b/clients/client-ec2/src/commands/DescribeVolumesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVolumesCommand.ts rename to clients/client-ec2/src/commands/DescribeVolumesCommand.ts diff --git a/clients/client-ec2/commands/DescribeVolumesModificationsCommand.ts b/clients/client-ec2/src/commands/DescribeVolumesModificationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVolumesModificationsCommand.ts rename to clients/client-ec2/src/commands/DescribeVolumesModificationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcAttributeCommand.ts b/clients/client-ec2/src/commands/DescribeVpcAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcAttributeCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcAttributeCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcClassicLinkCommand.ts b/clients/client-ec2/src/commands/DescribeVpcClassicLinkCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcClassicLinkCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcClassicLinkCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcClassicLinkDnsSupportCommand.ts b/clients/client-ec2/src/commands/DescribeVpcClassicLinkDnsSupportCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcClassicLinkDnsSupportCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcClassicLinkDnsSupportCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointConnectionNotificationsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointConnectionNotificationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointConnectionNotificationsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointConnectionNotificationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointConnectionsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointConnectionsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointConnectionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointServiceConfigurationsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointServiceConfigurationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointServiceConfigurationsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointServiceConfigurationsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointServicePermissionsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointServicePermissionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointServicePermissionsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointServicePermissionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointServicesCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointServicesCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointServicesCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointServicesCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcEndpointsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcEndpointsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcEndpointsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcEndpointsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcPeeringConnectionsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcPeeringConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcPeeringConnectionsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcPeeringConnectionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpcsCommand.ts b/clients/client-ec2/src/commands/DescribeVpcsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpcsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpcsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpnConnectionsCommand.ts b/clients/client-ec2/src/commands/DescribeVpnConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpnConnectionsCommand.ts rename to clients/client-ec2/src/commands/DescribeVpnConnectionsCommand.ts diff --git a/clients/client-ec2/commands/DescribeVpnGatewaysCommand.ts b/clients/client-ec2/src/commands/DescribeVpnGatewaysCommand.ts similarity index 100% rename from clients/client-ec2/commands/DescribeVpnGatewaysCommand.ts rename to clients/client-ec2/src/commands/DescribeVpnGatewaysCommand.ts diff --git a/clients/client-ec2/commands/DetachClassicLinkVpcCommand.ts b/clients/client-ec2/src/commands/DetachClassicLinkVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/DetachClassicLinkVpcCommand.ts rename to clients/client-ec2/src/commands/DetachClassicLinkVpcCommand.ts diff --git a/clients/client-ec2/commands/DetachInternetGatewayCommand.ts b/clients/client-ec2/src/commands/DetachInternetGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DetachInternetGatewayCommand.ts rename to clients/client-ec2/src/commands/DetachInternetGatewayCommand.ts diff --git a/clients/client-ec2/commands/DetachNetworkInterfaceCommand.ts b/clients/client-ec2/src/commands/DetachNetworkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/DetachNetworkInterfaceCommand.ts rename to clients/client-ec2/src/commands/DetachNetworkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/DetachVolumeCommand.ts b/clients/client-ec2/src/commands/DetachVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/DetachVolumeCommand.ts rename to clients/client-ec2/src/commands/DetachVolumeCommand.ts diff --git a/clients/client-ec2/commands/DetachVpnGatewayCommand.ts b/clients/client-ec2/src/commands/DetachVpnGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/DetachVpnGatewayCommand.ts rename to clients/client-ec2/src/commands/DetachVpnGatewayCommand.ts diff --git a/clients/client-ec2/commands/DisableEbsEncryptionByDefaultCommand.ts b/clients/client-ec2/src/commands/DisableEbsEncryptionByDefaultCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableEbsEncryptionByDefaultCommand.ts rename to clients/client-ec2/src/commands/DisableEbsEncryptionByDefaultCommand.ts diff --git a/clients/client-ec2/commands/DisableFastSnapshotRestoresCommand.ts b/clients/client-ec2/src/commands/DisableFastSnapshotRestoresCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableFastSnapshotRestoresCommand.ts rename to clients/client-ec2/src/commands/DisableFastSnapshotRestoresCommand.ts diff --git a/clients/client-ec2/commands/DisableImageDeprecationCommand.ts b/clients/client-ec2/src/commands/DisableImageDeprecationCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableImageDeprecationCommand.ts rename to clients/client-ec2/src/commands/DisableImageDeprecationCommand.ts diff --git a/clients/client-ec2/commands/DisableSerialConsoleAccessCommand.ts b/clients/client-ec2/src/commands/DisableSerialConsoleAccessCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableSerialConsoleAccessCommand.ts rename to clients/client-ec2/src/commands/DisableSerialConsoleAccessCommand.ts diff --git a/clients/client-ec2/commands/DisableTransitGatewayRouteTablePropagationCommand.ts b/clients/client-ec2/src/commands/DisableTransitGatewayRouteTablePropagationCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableTransitGatewayRouteTablePropagationCommand.ts rename to clients/client-ec2/src/commands/DisableTransitGatewayRouteTablePropagationCommand.ts diff --git a/clients/client-ec2/commands/DisableVgwRoutePropagationCommand.ts b/clients/client-ec2/src/commands/DisableVgwRoutePropagationCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableVgwRoutePropagationCommand.ts rename to clients/client-ec2/src/commands/DisableVgwRoutePropagationCommand.ts diff --git a/clients/client-ec2/commands/DisableVpcClassicLinkCommand.ts b/clients/client-ec2/src/commands/DisableVpcClassicLinkCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableVpcClassicLinkCommand.ts rename to clients/client-ec2/src/commands/DisableVpcClassicLinkCommand.ts diff --git a/clients/client-ec2/commands/DisableVpcClassicLinkDnsSupportCommand.ts b/clients/client-ec2/src/commands/DisableVpcClassicLinkDnsSupportCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisableVpcClassicLinkDnsSupportCommand.ts rename to clients/client-ec2/src/commands/DisableVpcClassicLinkDnsSupportCommand.ts diff --git a/clients/client-ec2/commands/DisassociateAddressCommand.ts b/clients/client-ec2/src/commands/DisassociateAddressCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateAddressCommand.ts rename to clients/client-ec2/src/commands/DisassociateAddressCommand.ts diff --git a/clients/client-ec2/commands/DisassociateClientVpnTargetNetworkCommand.ts b/clients/client-ec2/src/commands/DisassociateClientVpnTargetNetworkCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateClientVpnTargetNetworkCommand.ts rename to clients/client-ec2/src/commands/DisassociateClientVpnTargetNetworkCommand.ts diff --git a/clients/client-ec2/commands/DisassociateEnclaveCertificateIamRoleCommand.ts b/clients/client-ec2/src/commands/DisassociateEnclaveCertificateIamRoleCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateEnclaveCertificateIamRoleCommand.ts rename to clients/client-ec2/src/commands/DisassociateEnclaveCertificateIamRoleCommand.ts diff --git a/clients/client-ec2/commands/DisassociateIamInstanceProfileCommand.ts b/clients/client-ec2/src/commands/DisassociateIamInstanceProfileCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateIamInstanceProfileCommand.ts rename to clients/client-ec2/src/commands/DisassociateIamInstanceProfileCommand.ts diff --git a/clients/client-ec2/commands/DisassociateInstanceEventWindowCommand.ts b/clients/client-ec2/src/commands/DisassociateInstanceEventWindowCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateInstanceEventWindowCommand.ts rename to clients/client-ec2/src/commands/DisassociateInstanceEventWindowCommand.ts diff --git a/clients/client-ec2/commands/DisassociateRouteTableCommand.ts b/clients/client-ec2/src/commands/DisassociateRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateRouteTableCommand.ts rename to clients/client-ec2/src/commands/DisassociateRouteTableCommand.ts diff --git a/clients/client-ec2/commands/DisassociateSubnetCidrBlockCommand.ts b/clients/client-ec2/src/commands/DisassociateSubnetCidrBlockCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateSubnetCidrBlockCommand.ts rename to clients/client-ec2/src/commands/DisassociateSubnetCidrBlockCommand.ts diff --git a/clients/client-ec2/commands/DisassociateTransitGatewayMulticastDomainCommand.ts b/clients/client-ec2/src/commands/DisassociateTransitGatewayMulticastDomainCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateTransitGatewayMulticastDomainCommand.ts rename to clients/client-ec2/src/commands/DisassociateTransitGatewayMulticastDomainCommand.ts diff --git a/clients/client-ec2/commands/DisassociateTransitGatewayRouteTableCommand.ts b/clients/client-ec2/src/commands/DisassociateTransitGatewayRouteTableCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateTransitGatewayRouteTableCommand.ts rename to clients/client-ec2/src/commands/DisassociateTransitGatewayRouteTableCommand.ts diff --git a/clients/client-ec2/commands/DisassociateTrunkInterfaceCommand.ts b/clients/client-ec2/src/commands/DisassociateTrunkInterfaceCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateTrunkInterfaceCommand.ts rename to clients/client-ec2/src/commands/DisassociateTrunkInterfaceCommand.ts diff --git a/clients/client-ec2/commands/DisassociateVpcCidrBlockCommand.ts b/clients/client-ec2/src/commands/DisassociateVpcCidrBlockCommand.ts similarity index 100% rename from clients/client-ec2/commands/DisassociateVpcCidrBlockCommand.ts rename to clients/client-ec2/src/commands/DisassociateVpcCidrBlockCommand.ts diff --git a/clients/client-ec2/commands/EnableEbsEncryptionByDefaultCommand.ts b/clients/client-ec2/src/commands/EnableEbsEncryptionByDefaultCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableEbsEncryptionByDefaultCommand.ts rename to clients/client-ec2/src/commands/EnableEbsEncryptionByDefaultCommand.ts diff --git a/clients/client-ec2/commands/EnableFastSnapshotRestoresCommand.ts b/clients/client-ec2/src/commands/EnableFastSnapshotRestoresCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableFastSnapshotRestoresCommand.ts rename to clients/client-ec2/src/commands/EnableFastSnapshotRestoresCommand.ts diff --git a/clients/client-ec2/commands/EnableImageDeprecationCommand.ts b/clients/client-ec2/src/commands/EnableImageDeprecationCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableImageDeprecationCommand.ts rename to clients/client-ec2/src/commands/EnableImageDeprecationCommand.ts diff --git a/clients/client-ec2/commands/EnableSerialConsoleAccessCommand.ts b/clients/client-ec2/src/commands/EnableSerialConsoleAccessCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableSerialConsoleAccessCommand.ts rename to clients/client-ec2/src/commands/EnableSerialConsoleAccessCommand.ts diff --git a/clients/client-ec2/commands/EnableTransitGatewayRouteTablePropagationCommand.ts b/clients/client-ec2/src/commands/EnableTransitGatewayRouteTablePropagationCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableTransitGatewayRouteTablePropagationCommand.ts rename to clients/client-ec2/src/commands/EnableTransitGatewayRouteTablePropagationCommand.ts diff --git a/clients/client-ec2/commands/EnableVgwRoutePropagationCommand.ts b/clients/client-ec2/src/commands/EnableVgwRoutePropagationCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableVgwRoutePropagationCommand.ts rename to clients/client-ec2/src/commands/EnableVgwRoutePropagationCommand.ts diff --git a/clients/client-ec2/commands/EnableVolumeIOCommand.ts b/clients/client-ec2/src/commands/EnableVolumeIOCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableVolumeIOCommand.ts rename to clients/client-ec2/src/commands/EnableVolumeIOCommand.ts diff --git a/clients/client-ec2/commands/EnableVpcClassicLinkCommand.ts b/clients/client-ec2/src/commands/EnableVpcClassicLinkCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableVpcClassicLinkCommand.ts rename to clients/client-ec2/src/commands/EnableVpcClassicLinkCommand.ts diff --git a/clients/client-ec2/commands/EnableVpcClassicLinkDnsSupportCommand.ts b/clients/client-ec2/src/commands/EnableVpcClassicLinkDnsSupportCommand.ts similarity index 100% rename from clients/client-ec2/commands/EnableVpcClassicLinkDnsSupportCommand.ts rename to clients/client-ec2/src/commands/EnableVpcClassicLinkDnsSupportCommand.ts diff --git a/clients/client-ec2/commands/ExportClientVpnClientCertificateRevocationListCommand.ts b/clients/client-ec2/src/commands/ExportClientVpnClientCertificateRevocationListCommand.ts similarity index 100% rename from clients/client-ec2/commands/ExportClientVpnClientCertificateRevocationListCommand.ts rename to clients/client-ec2/src/commands/ExportClientVpnClientCertificateRevocationListCommand.ts diff --git a/clients/client-ec2/commands/ExportClientVpnClientConfigurationCommand.ts b/clients/client-ec2/src/commands/ExportClientVpnClientConfigurationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ExportClientVpnClientConfigurationCommand.ts rename to clients/client-ec2/src/commands/ExportClientVpnClientConfigurationCommand.ts diff --git a/clients/client-ec2/commands/ExportImageCommand.ts b/clients/client-ec2/src/commands/ExportImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/ExportImageCommand.ts rename to clients/client-ec2/src/commands/ExportImageCommand.ts diff --git a/clients/client-ec2/commands/ExportTransitGatewayRoutesCommand.ts b/clients/client-ec2/src/commands/ExportTransitGatewayRoutesCommand.ts similarity index 100% rename from clients/client-ec2/commands/ExportTransitGatewayRoutesCommand.ts rename to clients/client-ec2/src/commands/ExportTransitGatewayRoutesCommand.ts diff --git a/clients/client-ec2/commands/GetAssociatedEnclaveCertificateIamRolesCommand.ts b/clients/client-ec2/src/commands/GetAssociatedEnclaveCertificateIamRolesCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetAssociatedEnclaveCertificateIamRolesCommand.ts rename to clients/client-ec2/src/commands/GetAssociatedEnclaveCertificateIamRolesCommand.ts diff --git a/clients/client-ec2/commands/GetAssociatedIpv6PoolCidrsCommand.ts b/clients/client-ec2/src/commands/GetAssociatedIpv6PoolCidrsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetAssociatedIpv6PoolCidrsCommand.ts rename to clients/client-ec2/src/commands/GetAssociatedIpv6PoolCidrsCommand.ts diff --git a/clients/client-ec2/commands/GetCapacityReservationUsageCommand.ts b/clients/client-ec2/src/commands/GetCapacityReservationUsageCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetCapacityReservationUsageCommand.ts rename to clients/client-ec2/src/commands/GetCapacityReservationUsageCommand.ts diff --git a/clients/client-ec2/commands/GetCoipPoolUsageCommand.ts b/clients/client-ec2/src/commands/GetCoipPoolUsageCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetCoipPoolUsageCommand.ts rename to clients/client-ec2/src/commands/GetCoipPoolUsageCommand.ts diff --git a/clients/client-ec2/commands/GetConsoleOutputCommand.ts b/clients/client-ec2/src/commands/GetConsoleOutputCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetConsoleOutputCommand.ts rename to clients/client-ec2/src/commands/GetConsoleOutputCommand.ts diff --git a/clients/client-ec2/commands/GetConsoleScreenshotCommand.ts b/clients/client-ec2/src/commands/GetConsoleScreenshotCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetConsoleScreenshotCommand.ts rename to clients/client-ec2/src/commands/GetConsoleScreenshotCommand.ts diff --git a/clients/client-ec2/commands/GetDefaultCreditSpecificationCommand.ts b/clients/client-ec2/src/commands/GetDefaultCreditSpecificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetDefaultCreditSpecificationCommand.ts rename to clients/client-ec2/src/commands/GetDefaultCreditSpecificationCommand.ts diff --git a/clients/client-ec2/commands/GetEbsDefaultKmsKeyIdCommand.ts b/clients/client-ec2/src/commands/GetEbsDefaultKmsKeyIdCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetEbsDefaultKmsKeyIdCommand.ts rename to clients/client-ec2/src/commands/GetEbsDefaultKmsKeyIdCommand.ts diff --git a/clients/client-ec2/commands/GetEbsEncryptionByDefaultCommand.ts b/clients/client-ec2/src/commands/GetEbsEncryptionByDefaultCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetEbsEncryptionByDefaultCommand.ts rename to clients/client-ec2/src/commands/GetEbsEncryptionByDefaultCommand.ts diff --git a/clients/client-ec2/commands/GetFlowLogsIntegrationTemplateCommand.ts b/clients/client-ec2/src/commands/GetFlowLogsIntegrationTemplateCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetFlowLogsIntegrationTemplateCommand.ts rename to clients/client-ec2/src/commands/GetFlowLogsIntegrationTemplateCommand.ts diff --git a/clients/client-ec2/commands/GetGroupsForCapacityReservationCommand.ts b/clients/client-ec2/src/commands/GetGroupsForCapacityReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetGroupsForCapacityReservationCommand.ts rename to clients/client-ec2/src/commands/GetGroupsForCapacityReservationCommand.ts diff --git a/clients/client-ec2/commands/GetHostReservationPurchasePreviewCommand.ts b/clients/client-ec2/src/commands/GetHostReservationPurchasePreviewCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetHostReservationPurchasePreviewCommand.ts rename to clients/client-ec2/src/commands/GetHostReservationPurchasePreviewCommand.ts diff --git a/clients/client-ec2/commands/GetLaunchTemplateDataCommand.ts b/clients/client-ec2/src/commands/GetLaunchTemplateDataCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetLaunchTemplateDataCommand.ts rename to clients/client-ec2/src/commands/GetLaunchTemplateDataCommand.ts diff --git a/clients/client-ec2/commands/GetManagedPrefixListAssociationsCommand.ts b/clients/client-ec2/src/commands/GetManagedPrefixListAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetManagedPrefixListAssociationsCommand.ts rename to clients/client-ec2/src/commands/GetManagedPrefixListAssociationsCommand.ts diff --git a/clients/client-ec2/commands/GetManagedPrefixListEntriesCommand.ts b/clients/client-ec2/src/commands/GetManagedPrefixListEntriesCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetManagedPrefixListEntriesCommand.ts rename to clients/client-ec2/src/commands/GetManagedPrefixListEntriesCommand.ts diff --git a/clients/client-ec2/commands/GetPasswordDataCommand.ts b/clients/client-ec2/src/commands/GetPasswordDataCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetPasswordDataCommand.ts rename to clients/client-ec2/src/commands/GetPasswordDataCommand.ts diff --git a/clients/client-ec2/commands/GetReservedInstancesExchangeQuoteCommand.ts b/clients/client-ec2/src/commands/GetReservedInstancesExchangeQuoteCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetReservedInstancesExchangeQuoteCommand.ts rename to clients/client-ec2/src/commands/GetReservedInstancesExchangeQuoteCommand.ts diff --git a/clients/client-ec2/commands/GetSerialConsoleAccessStatusCommand.ts b/clients/client-ec2/src/commands/GetSerialConsoleAccessStatusCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetSerialConsoleAccessStatusCommand.ts rename to clients/client-ec2/src/commands/GetSerialConsoleAccessStatusCommand.ts diff --git a/clients/client-ec2/commands/GetSubnetCidrReservationsCommand.ts b/clients/client-ec2/src/commands/GetSubnetCidrReservationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetSubnetCidrReservationsCommand.ts rename to clients/client-ec2/src/commands/GetSubnetCidrReservationsCommand.ts diff --git a/clients/client-ec2/commands/GetTransitGatewayAttachmentPropagationsCommand.ts b/clients/client-ec2/src/commands/GetTransitGatewayAttachmentPropagationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetTransitGatewayAttachmentPropagationsCommand.ts rename to clients/client-ec2/src/commands/GetTransitGatewayAttachmentPropagationsCommand.ts diff --git a/clients/client-ec2/commands/GetTransitGatewayMulticastDomainAssociationsCommand.ts b/clients/client-ec2/src/commands/GetTransitGatewayMulticastDomainAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetTransitGatewayMulticastDomainAssociationsCommand.ts rename to clients/client-ec2/src/commands/GetTransitGatewayMulticastDomainAssociationsCommand.ts diff --git a/clients/client-ec2/commands/GetTransitGatewayPrefixListReferencesCommand.ts b/clients/client-ec2/src/commands/GetTransitGatewayPrefixListReferencesCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetTransitGatewayPrefixListReferencesCommand.ts rename to clients/client-ec2/src/commands/GetTransitGatewayPrefixListReferencesCommand.ts diff --git a/clients/client-ec2/commands/GetTransitGatewayRouteTableAssociationsCommand.ts b/clients/client-ec2/src/commands/GetTransitGatewayRouteTableAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetTransitGatewayRouteTableAssociationsCommand.ts rename to clients/client-ec2/src/commands/GetTransitGatewayRouteTableAssociationsCommand.ts diff --git a/clients/client-ec2/commands/GetTransitGatewayRouteTablePropagationsCommand.ts b/clients/client-ec2/src/commands/GetTransitGatewayRouteTablePropagationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetTransitGatewayRouteTablePropagationsCommand.ts rename to clients/client-ec2/src/commands/GetTransitGatewayRouteTablePropagationsCommand.ts diff --git a/clients/client-ec2/commands/GetVpnConnectionDeviceSampleConfigurationCommand.ts b/clients/client-ec2/src/commands/GetVpnConnectionDeviceSampleConfigurationCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetVpnConnectionDeviceSampleConfigurationCommand.ts rename to clients/client-ec2/src/commands/GetVpnConnectionDeviceSampleConfigurationCommand.ts diff --git a/clients/client-ec2/commands/GetVpnConnectionDeviceTypesCommand.ts b/clients/client-ec2/src/commands/GetVpnConnectionDeviceTypesCommand.ts similarity index 100% rename from clients/client-ec2/commands/GetVpnConnectionDeviceTypesCommand.ts rename to clients/client-ec2/src/commands/GetVpnConnectionDeviceTypesCommand.ts diff --git a/clients/client-ec2/commands/ImportClientVpnClientCertificateRevocationListCommand.ts b/clients/client-ec2/src/commands/ImportClientVpnClientCertificateRevocationListCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportClientVpnClientCertificateRevocationListCommand.ts rename to clients/client-ec2/src/commands/ImportClientVpnClientCertificateRevocationListCommand.ts diff --git a/clients/client-ec2/commands/ImportImageCommand.ts b/clients/client-ec2/src/commands/ImportImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportImageCommand.ts rename to clients/client-ec2/src/commands/ImportImageCommand.ts diff --git a/clients/client-ec2/commands/ImportInstanceCommand.ts b/clients/client-ec2/src/commands/ImportInstanceCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportInstanceCommand.ts rename to clients/client-ec2/src/commands/ImportInstanceCommand.ts diff --git a/clients/client-ec2/commands/ImportKeyPairCommand.ts b/clients/client-ec2/src/commands/ImportKeyPairCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportKeyPairCommand.ts rename to clients/client-ec2/src/commands/ImportKeyPairCommand.ts diff --git a/clients/client-ec2/commands/ImportSnapshotCommand.ts b/clients/client-ec2/src/commands/ImportSnapshotCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportSnapshotCommand.ts rename to clients/client-ec2/src/commands/ImportSnapshotCommand.ts diff --git a/clients/client-ec2/commands/ImportVolumeCommand.ts b/clients/client-ec2/src/commands/ImportVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ImportVolumeCommand.ts rename to clients/client-ec2/src/commands/ImportVolumeCommand.ts diff --git a/clients/client-ec2/commands/ModifyAddressAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyAddressAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyAddressAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyAddressAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyAvailabilityZoneGroupCommand.ts b/clients/client-ec2/src/commands/ModifyAvailabilityZoneGroupCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyAvailabilityZoneGroupCommand.ts rename to clients/client-ec2/src/commands/ModifyAvailabilityZoneGroupCommand.ts diff --git a/clients/client-ec2/commands/ModifyCapacityReservationCommand.ts b/clients/client-ec2/src/commands/ModifyCapacityReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyCapacityReservationCommand.ts rename to clients/client-ec2/src/commands/ModifyCapacityReservationCommand.ts diff --git a/clients/client-ec2/commands/ModifyClientVpnEndpointCommand.ts b/clients/client-ec2/src/commands/ModifyClientVpnEndpointCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyClientVpnEndpointCommand.ts rename to clients/client-ec2/src/commands/ModifyClientVpnEndpointCommand.ts diff --git a/clients/client-ec2/commands/ModifyDefaultCreditSpecificationCommand.ts b/clients/client-ec2/src/commands/ModifyDefaultCreditSpecificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyDefaultCreditSpecificationCommand.ts rename to clients/client-ec2/src/commands/ModifyDefaultCreditSpecificationCommand.ts diff --git a/clients/client-ec2/commands/ModifyEbsDefaultKmsKeyIdCommand.ts b/clients/client-ec2/src/commands/ModifyEbsDefaultKmsKeyIdCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyEbsDefaultKmsKeyIdCommand.ts rename to clients/client-ec2/src/commands/ModifyEbsDefaultKmsKeyIdCommand.ts diff --git a/clients/client-ec2/commands/ModifyFleetCommand.ts b/clients/client-ec2/src/commands/ModifyFleetCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyFleetCommand.ts rename to clients/client-ec2/src/commands/ModifyFleetCommand.ts diff --git a/clients/client-ec2/commands/ModifyFpgaImageAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyFpgaImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyFpgaImageAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyFpgaImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyHostsCommand.ts b/clients/client-ec2/src/commands/ModifyHostsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyHostsCommand.ts rename to clients/client-ec2/src/commands/ModifyHostsCommand.ts diff --git a/clients/client-ec2/commands/ModifyIdFormatCommand.ts b/clients/client-ec2/src/commands/ModifyIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyIdFormatCommand.ts rename to clients/client-ec2/src/commands/ModifyIdFormatCommand.ts diff --git a/clients/client-ec2/commands/ModifyIdentityIdFormatCommand.ts b/clients/client-ec2/src/commands/ModifyIdentityIdFormatCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyIdentityIdFormatCommand.ts rename to clients/client-ec2/src/commands/ModifyIdentityIdFormatCommand.ts diff --git a/clients/client-ec2/commands/ModifyImageAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyImageAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceCapacityReservationAttributesCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceCapacityReservationAttributesCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceCapacityReservationAttributesCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceCapacityReservationAttributesCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceCreditSpecificationCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceCreditSpecificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceCreditSpecificationCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceCreditSpecificationCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceEventStartTimeCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceEventStartTimeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceEventStartTimeCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceEventStartTimeCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceEventWindowCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceEventWindowCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceEventWindowCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceEventWindowCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstanceMetadataOptionsCommand.ts b/clients/client-ec2/src/commands/ModifyInstanceMetadataOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstanceMetadataOptionsCommand.ts rename to clients/client-ec2/src/commands/ModifyInstanceMetadataOptionsCommand.ts diff --git a/clients/client-ec2/commands/ModifyInstancePlacementCommand.ts b/clients/client-ec2/src/commands/ModifyInstancePlacementCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyInstancePlacementCommand.ts rename to clients/client-ec2/src/commands/ModifyInstancePlacementCommand.ts diff --git a/clients/client-ec2/commands/ModifyLaunchTemplateCommand.ts b/clients/client-ec2/src/commands/ModifyLaunchTemplateCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyLaunchTemplateCommand.ts rename to clients/client-ec2/src/commands/ModifyLaunchTemplateCommand.ts diff --git a/clients/client-ec2/commands/ModifyManagedPrefixListCommand.ts b/clients/client-ec2/src/commands/ModifyManagedPrefixListCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyManagedPrefixListCommand.ts rename to clients/client-ec2/src/commands/ModifyManagedPrefixListCommand.ts diff --git a/clients/client-ec2/commands/ModifyNetworkInterfaceAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyNetworkInterfaceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyNetworkInterfaceAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyNetworkInterfaceAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyReservedInstancesCommand.ts b/clients/client-ec2/src/commands/ModifyReservedInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyReservedInstancesCommand.ts rename to clients/client-ec2/src/commands/ModifyReservedInstancesCommand.ts diff --git a/clients/client-ec2/commands/ModifySecurityGroupRulesCommand.ts b/clients/client-ec2/src/commands/ModifySecurityGroupRulesCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifySecurityGroupRulesCommand.ts rename to clients/client-ec2/src/commands/ModifySecurityGroupRulesCommand.ts diff --git a/clients/client-ec2/commands/ModifySnapshotAttributeCommand.ts b/clients/client-ec2/src/commands/ModifySnapshotAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifySnapshotAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifySnapshotAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifySpotFleetRequestCommand.ts b/clients/client-ec2/src/commands/ModifySpotFleetRequestCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifySpotFleetRequestCommand.ts rename to clients/client-ec2/src/commands/ModifySpotFleetRequestCommand.ts diff --git a/clients/client-ec2/commands/ModifySubnetAttributeCommand.ts b/clients/client-ec2/src/commands/ModifySubnetAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifySubnetAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifySubnetAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.ts b/clients/client-ec2/src/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.ts rename to clients/client-ec2/src/commands/ModifyTrafficMirrorFilterNetworkServicesCommand.ts diff --git a/clients/client-ec2/commands/ModifyTrafficMirrorFilterRuleCommand.ts b/clients/client-ec2/src/commands/ModifyTrafficMirrorFilterRuleCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTrafficMirrorFilterRuleCommand.ts rename to clients/client-ec2/src/commands/ModifyTrafficMirrorFilterRuleCommand.ts diff --git a/clients/client-ec2/commands/ModifyTrafficMirrorSessionCommand.ts b/clients/client-ec2/src/commands/ModifyTrafficMirrorSessionCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTrafficMirrorSessionCommand.ts rename to clients/client-ec2/src/commands/ModifyTrafficMirrorSessionCommand.ts diff --git a/clients/client-ec2/commands/ModifyTransitGatewayCommand.ts b/clients/client-ec2/src/commands/ModifyTransitGatewayCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTransitGatewayCommand.ts rename to clients/client-ec2/src/commands/ModifyTransitGatewayCommand.ts diff --git a/clients/client-ec2/commands/ModifyTransitGatewayPrefixListReferenceCommand.ts b/clients/client-ec2/src/commands/ModifyTransitGatewayPrefixListReferenceCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTransitGatewayPrefixListReferenceCommand.ts rename to clients/client-ec2/src/commands/ModifyTransitGatewayPrefixListReferenceCommand.ts diff --git a/clients/client-ec2/commands/ModifyTransitGatewayVpcAttachmentCommand.ts b/clients/client-ec2/src/commands/ModifyTransitGatewayVpcAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyTransitGatewayVpcAttachmentCommand.ts rename to clients/client-ec2/src/commands/ModifyTransitGatewayVpcAttachmentCommand.ts diff --git a/clients/client-ec2/commands/ModifyVolumeAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyVolumeAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVolumeAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyVolumeAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyVolumeCommand.ts b/clients/client-ec2/src/commands/ModifyVolumeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVolumeCommand.ts rename to clients/client-ec2/src/commands/ModifyVolumeCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcAttributeCommand.ts b/clients/client-ec2/src/commands/ModifyVpcAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcAttributeCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcAttributeCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcEndpointCommand.ts b/clients/client-ec2/src/commands/ModifyVpcEndpointCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcEndpointCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcEndpointCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcEndpointConnectionNotificationCommand.ts b/clients/client-ec2/src/commands/ModifyVpcEndpointConnectionNotificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcEndpointConnectionNotificationCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcEndpointConnectionNotificationCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcEndpointServiceConfigurationCommand.ts b/clients/client-ec2/src/commands/ModifyVpcEndpointServiceConfigurationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcEndpointServiceConfigurationCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcEndpointServiceConfigurationCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcEndpointServicePermissionsCommand.ts b/clients/client-ec2/src/commands/ModifyVpcEndpointServicePermissionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcEndpointServicePermissionsCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcEndpointServicePermissionsCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcPeeringConnectionOptionsCommand.ts b/clients/client-ec2/src/commands/ModifyVpcPeeringConnectionOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcPeeringConnectionOptionsCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcPeeringConnectionOptionsCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpcTenancyCommand.ts b/clients/client-ec2/src/commands/ModifyVpcTenancyCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpcTenancyCommand.ts rename to clients/client-ec2/src/commands/ModifyVpcTenancyCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpnConnectionCommand.ts b/clients/client-ec2/src/commands/ModifyVpnConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpnConnectionCommand.ts rename to clients/client-ec2/src/commands/ModifyVpnConnectionCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpnConnectionOptionsCommand.ts b/clients/client-ec2/src/commands/ModifyVpnConnectionOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpnConnectionOptionsCommand.ts rename to clients/client-ec2/src/commands/ModifyVpnConnectionOptionsCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpnTunnelCertificateCommand.ts b/clients/client-ec2/src/commands/ModifyVpnTunnelCertificateCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpnTunnelCertificateCommand.ts rename to clients/client-ec2/src/commands/ModifyVpnTunnelCertificateCommand.ts diff --git a/clients/client-ec2/commands/ModifyVpnTunnelOptionsCommand.ts b/clients/client-ec2/src/commands/ModifyVpnTunnelOptionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ModifyVpnTunnelOptionsCommand.ts rename to clients/client-ec2/src/commands/ModifyVpnTunnelOptionsCommand.ts diff --git a/clients/client-ec2/commands/MonitorInstancesCommand.ts b/clients/client-ec2/src/commands/MonitorInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/MonitorInstancesCommand.ts rename to clients/client-ec2/src/commands/MonitorInstancesCommand.ts diff --git a/clients/client-ec2/commands/MoveAddressToVpcCommand.ts b/clients/client-ec2/src/commands/MoveAddressToVpcCommand.ts similarity index 100% rename from clients/client-ec2/commands/MoveAddressToVpcCommand.ts rename to clients/client-ec2/src/commands/MoveAddressToVpcCommand.ts diff --git a/clients/client-ec2/commands/ProvisionByoipCidrCommand.ts b/clients/client-ec2/src/commands/ProvisionByoipCidrCommand.ts similarity index 100% rename from clients/client-ec2/commands/ProvisionByoipCidrCommand.ts rename to clients/client-ec2/src/commands/ProvisionByoipCidrCommand.ts diff --git a/clients/client-ec2/commands/PurchaseHostReservationCommand.ts b/clients/client-ec2/src/commands/PurchaseHostReservationCommand.ts similarity index 100% rename from clients/client-ec2/commands/PurchaseHostReservationCommand.ts rename to clients/client-ec2/src/commands/PurchaseHostReservationCommand.ts diff --git a/clients/client-ec2/commands/PurchaseReservedInstancesOfferingCommand.ts b/clients/client-ec2/src/commands/PurchaseReservedInstancesOfferingCommand.ts similarity index 100% rename from clients/client-ec2/commands/PurchaseReservedInstancesOfferingCommand.ts rename to clients/client-ec2/src/commands/PurchaseReservedInstancesOfferingCommand.ts diff --git a/clients/client-ec2/commands/PurchaseScheduledInstancesCommand.ts b/clients/client-ec2/src/commands/PurchaseScheduledInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/PurchaseScheduledInstancesCommand.ts rename to clients/client-ec2/src/commands/PurchaseScheduledInstancesCommand.ts diff --git a/clients/client-ec2/commands/RebootInstancesCommand.ts b/clients/client-ec2/src/commands/RebootInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RebootInstancesCommand.ts rename to clients/client-ec2/src/commands/RebootInstancesCommand.ts diff --git a/clients/client-ec2/commands/RegisterImageCommand.ts b/clients/client-ec2/src/commands/RegisterImageCommand.ts similarity index 100% rename from clients/client-ec2/commands/RegisterImageCommand.ts rename to clients/client-ec2/src/commands/RegisterImageCommand.ts diff --git a/clients/client-ec2/commands/RegisterInstanceEventNotificationAttributesCommand.ts b/clients/client-ec2/src/commands/RegisterInstanceEventNotificationAttributesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RegisterInstanceEventNotificationAttributesCommand.ts rename to clients/client-ec2/src/commands/RegisterInstanceEventNotificationAttributesCommand.ts diff --git a/clients/client-ec2/commands/RegisterTransitGatewayMulticastGroupMembersCommand.ts b/clients/client-ec2/src/commands/RegisterTransitGatewayMulticastGroupMembersCommand.ts similarity index 100% rename from clients/client-ec2/commands/RegisterTransitGatewayMulticastGroupMembersCommand.ts rename to clients/client-ec2/src/commands/RegisterTransitGatewayMulticastGroupMembersCommand.ts diff --git a/clients/client-ec2/commands/RegisterTransitGatewayMulticastGroupSourcesCommand.ts b/clients/client-ec2/src/commands/RegisterTransitGatewayMulticastGroupSourcesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RegisterTransitGatewayMulticastGroupSourcesCommand.ts rename to clients/client-ec2/src/commands/RegisterTransitGatewayMulticastGroupSourcesCommand.ts diff --git a/clients/client-ec2/commands/RejectTransitGatewayMulticastDomainAssociationsCommand.ts b/clients/client-ec2/src/commands/RejectTransitGatewayMulticastDomainAssociationsCommand.ts similarity index 100% rename from clients/client-ec2/commands/RejectTransitGatewayMulticastDomainAssociationsCommand.ts rename to clients/client-ec2/src/commands/RejectTransitGatewayMulticastDomainAssociationsCommand.ts diff --git a/clients/client-ec2/commands/RejectTransitGatewayPeeringAttachmentCommand.ts b/clients/client-ec2/src/commands/RejectTransitGatewayPeeringAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/RejectTransitGatewayPeeringAttachmentCommand.ts rename to clients/client-ec2/src/commands/RejectTransitGatewayPeeringAttachmentCommand.ts diff --git a/clients/client-ec2/commands/RejectTransitGatewayVpcAttachmentCommand.ts b/clients/client-ec2/src/commands/RejectTransitGatewayVpcAttachmentCommand.ts similarity index 100% rename from clients/client-ec2/commands/RejectTransitGatewayVpcAttachmentCommand.ts rename to clients/client-ec2/src/commands/RejectTransitGatewayVpcAttachmentCommand.ts diff --git a/clients/client-ec2/commands/RejectVpcEndpointConnectionsCommand.ts b/clients/client-ec2/src/commands/RejectVpcEndpointConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/RejectVpcEndpointConnectionsCommand.ts rename to clients/client-ec2/src/commands/RejectVpcEndpointConnectionsCommand.ts diff --git a/clients/client-ec2/commands/RejectVpcPeeringConnectionCommand.ts b/clients/client-ec2/src/commands/RejectVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-ec2/commands/RejectVpcPeeringConnectionCommand.ts rename to clients/client-ec2/src/commands/RejectVpcPeeringConnectionCommand.ts diff --git a/clients/client-ec2/commands/ReleaseAddressCommand.ts b/clients/client-ec2/src/commands/ReleaseAddressCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReleaseAddressCommand.ts rename to clients/client-ec2/src/commands/ReleaseAddressCommand.ts diff --git a/clients/client-ec2/commands/ReleaseHostsCommand.ts b/clients/client-ec2/src/commands/ReleaseHostsCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReleaseHostsCommand.ts rename to clients/client-ec2/src/commands/ReleaseHostsCommand.ts diff --git a/clients/client-ec2/commands/ReplaceIamInstanceProfileAssociationCommand.ts b/clients/client-ec2/src/commands/ReplaceIamInstanceProfileAssociationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceIamInstanceProfileAssociationCommand.ts rename to clients/client-ec2/src/commands/ReplaceIamInstanceProfileAssociationCommand.ts diff --git a/clients/client-ec2/commands/ReplaceNetworkAclAssociationCommand.ts b/clients/client-ec2/src/commands/ReplaceNetworkAclAssociationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceNetworkAclAssociationCommand.ts rename to clients/client-ec2/src/commands/ReplaceNetworkAclAssociationCommand.ts diff --git a/clients/client-ec2/commands/ReplaceNetworkAclEntryCommand.ts b/clients/client-ec2/src/commands/ReplaceNetworkAclEntryCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceNetworkAclEntryCommand.ts rename to clients/client-ec2/src/commands/ReplaceNetworkAclEntryCommand.ts diff --git a/clients/client-ec2/commands/ReplaceRouteCommand.ts b/clients/client-ec2/src/commands/ReplaceRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceRouteCommand.ts rename to clients/client-ec2/src/commands/ReplaceRouteCommand.ts diff --git a/clients/client-ec2/commands/ReplaceRouteTableAssociationCommand.ts b/clients/client-ec2/src/commands/ReplaceRouteTableAssociationCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceRouteTableAssociationCommand.ts rename to clients/client-ec2/src/commands/ReplaceRouteTableAssociationCommand.ts diff --git a/clients/client-ec2/commands/ReplaceTransitGatewayRouteCommand.ts b/clients/client-ec2/src/commands/ReplaceTransitGatewayRouteCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReplaceTransitGatewayRouteCommand.ts rename to clients/client-ec2/src/commands/ReplaceTransitGatewayRouteCommand.ts diff --git a/clients/client-ec2/commands/ReportInstanceStatusCommand.ts b/clients/client-ec2/src/commands/ReportInstanceStatusCommand.ts similarity index 100% rename from clients/client-ec2/commands/ReportInstanceStatusCommand.ts rename to clients/client-ec2/src/commands/ReportInstanceStatusCommand.ts diff --git a/clients/client-ec2/commands/RequestSpotFleetCommand.ts b/clients/client-ec2/src/commands/RequestSpotFleetCommand.ts similarity index 100% rename from clients/client-ec2/commands/RequestSpotFleetCommand.ts rename to clients/client-ec2/src/commands/RequestSpotFleetCommand.ts diff --git a/clients/client-ec2/commands/RequestSpotInstancesCommand.ts b/clients/client-ec2/src/commands/RequestSpotInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RequestSpotInstancesCommand.ts rename to clients/client-ec2/src/commands/RequestSpotInstancesCommand.ts diff --git a/clients/client-ec2/commands/ResetAddressAttributeCommand.ts b/clients/client-ec2/src/commands/ResetAddressAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetAddressAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetAddressAttributeCommand.ts diff --git a/clients/client-ec2/commands/ResetEbsDefaultKmsKeyIdCommand.ts b/clients/client-ec2/src/commands/ResetEbsDefaultKmsKeyIdCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetEbsDefaultKmsKeyIdCommand.ts rename to clients/client-ec2/src/commands/ResetEbsDefaultKmsKeyIdCommand.ts diff --git a/clients/client-ec2/commands/ResetFpgaImageAttributeCommand.ts b/clients/client-ec2/src/commands/ResetFpgaImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetFpgaImageAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetFpgaImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/ResetImageAttributeCommand.ts b/clients/client-ec2/src/commands/ResetImageAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetImageAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetImageAttributeCommand.ts diff --git a/clients/client-ec2/commands/ResetInstanceAttributeCommand.ts b/clients/client-ec2/src/commands/ResetInstanceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetInstanceAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetInstanceAttributeCommand.ts diff --git a/clients/client-ec2/commands/ResetNetworkInterfaceAttributeCommand.ts b/clients/client-ec2/src/commands/ResetNetworkInterfaceAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetNetworkInterfaceAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetNetworkInterfaceAttributeCommand.ts diff --git a/clients/client-ec2/commands/ResetSnapshotAttributeCommand.ts b/clients/client-ec2/src/commands/ResetSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-ec2/commands/ResetSnapshotAttributeCommand.ts rename to clients/client-ec2/src/commands/ResetSnapshotAttributeCommand.ts diff --git a/clients/client-ec2/commands/RestoreAddressToClassicCommand.ts b/clients/client-ec2/src/commands/RestoreAddressToClassicCommand.ts similarity index 100% rename from clients/client-ec2/commands/RestoreAddressToClassicCommand.ts rename to clients/client-ec2/src/commands/RestoreAddressToClassicCommand.ts diff --git a/clients/client-ec2/commands/RestoreManagedPrefixListVersionCommand.ts b/clients/client-ec2/src/commands/RestoreManagedPrefixListVersionCommand.ts similarity index 100% rename from clients/client-ec2/commands/RestoreManagedPrefixListVersionCommand.ts rename to clients/client-ec2/src/commands/RestoreManagedPrefixListVersionCommand.ts diff --git a/clients/client-ec2/commands/RevokeClientVpnIngressCommand.ts b/clients/client-ec2/src/commands/RevokeClientVpnIngressCommand.ts similarity index 100% rename from clients/client-ec2/commands/RevokeClientVpnIngressCommand.ts rename to clients/client-ec2/src/commands/RevokeClientVpnIngressCommand.ts diff --git a/clients/client-ec2/commands/RevokeSecurityGroupEgressCommand.ts b/clients/client-ec2/src/commands/RevokeSecurityGroupEgressCommand.ts similarity index 100% rename from clients/client-ec2/commands/RevokeSecurityGroupEgressCommand.ts rename to clients/client-ec2/src/commands/RevokeSecurityGroupEgressCommand.ts diff --git a/clients/client-ec2/commands/RevokeSecurityGroupIngressCommand.ts b/clients/client-ec2/src/commands/RevokeSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-ec2/commands/RevokeSecurityGroupIngressCommand.ts rename to clients/client-ec2/src/commands/RevokeSecurityGroupIngressCommand.ts diff --git a/clients/client-ec2/commands/RunInstancesCommand.ts b/clients/client-ec2/src/commands/RunInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RunInstancesCommand.ts rename to clients/client-ec2/src/commands/RunInstancesCommand.ts diff --git a/clients/client-ec2/commands/RunScheduledInstancesCommand.ts b/clients/client-ec2/src/commands/RunScheduledInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/RunScheduledInstancesCommand.ts rename to clients/client-ec2/src/commands/RunScheduledInstancesCommand.ts diff --git a/clients/client-ec2/commands/SearchLocalGatewayRoutesCommand.ts b/clients/client-ec2/src/commands/SearchLocalGatewayRoutesCommand.ts similarity index 100% rename from clients/client-ec2/commands/SearchLocalGatewayRoutesCommand.ts rename to clients/client-ec2/src/commands/SearchLocalGatewayRoutesCommand.ts diff --git a/clients/client-ec2/commands/SearchTransitGatewayMulticastGroupsCommand.ts b/clients/client-ec2/src/commands/SearchTransitGatewayMulticastGroupsCommand.ts similarity index 100% rename from clients/client-ec2/commands/SearchTransitGatewayMulticastGroupsCommand.ts rename to clients/client-ec2/src/commands/SearchTransitGatewayMulticastGroupsCommand.ts diff --git a/clients/client-ec2/commands/SearchTransitGatewayRoutesCommand.ts b/clients/client-ec2/src/commands/SearchTransitGatewayRoutesCommand.ts similarity index 100% rename from clients/client-ec2/commands/SearchTransitGatewayRoutesCommand.ts rename to clients/client-ec2/src/commands/SearchTransitGatewayRoutesCommand.ts diff --git a/clients/client-ec2/commands/SendDiagnosticInterruptCommand.ts b/clients/client-ec2/src/commands/SendDiagnosticInterruptCommand.ts similarity index 100% rename from clients/client-ec2/commands/SendDiagnosticInterruptCommand.ts rename to clients/client-ec2/src/commands/SendDiagnosticInterruptCommand.ts diff --git a/clients/client-ec2/commands/StartInstancesCommand.ts b/clients/client-ec2/src/commands/StartInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/StartInstancesCommand.ts rename to clients/client-ec2/src/commands/StartInstancesCommand.ts diff --git a/clients/client-ec2/commands/StartNetworkInsightsAnalysisCommand.ts b/clients/client-ec2/src/commands/StartNetworkInsightsAnalysisCommand.ts similarity index 100% rename from clients/client-ec2/commands/StartNetworkInsightsAnalysisCommand.ts rename to clients/client-ec2/src/commands/StartNetworkInsightsAnalysisCommand.ts diff --git a/clients/client-ec2/commands/StartVpcEndpointServicePrivateDnsVerificationCommand.ts b/clients/client-ec2/src/commands/StartVpcEndpointServicePrivateDnsVerificationCommand.ts similarity index 100% rename from clients/client-ec2/commands/StartVpcEndpointServicePrivateDnsVerificationCommand.ts rename to clients/client-ec2/src/commands/StartVpcEndpointServicePrivateDnsVerificationCommand.ts diff --git a/clients/client-ec2/commands/StopInstancesCommand.ts b/clients/client-ec2/src/commands/StopInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/StopInstancesCommand.ts rename to clients/client-ec2/src/commands/StopInstancesCommand.ts diff --git a/clients/client-ec2/commands/TerminateClientVpnConnectionsCommand.ts b/clients/client-ec2/src/commands/TerminateClientVpnConnectionsCommand.ts similarity index 100% rename from clients/client-ec2/commands/TerminateClientVpnConnectionsCommand.ts rename to clients/client-ec2/src/commands/TerminateClientVpnConnectionsCommand.ts diff --git a/clients/client-ec2/commands/TerminateInstancesCommand.ts b/clients/client-ec2/src/commands/TerminateInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/TerminateInstancesCommand.ts rename to clients/client-ec2/src/commands/TerminateInstancesCommand.ts diff --git a/clients/client-ec2/commands/UnassignIpv6AddressesCommand.ts b/clients/client-ec2/src/commands/UnassignIpv6AddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/UnassignIpv6AddressesCommand.ts rename to clients/client-ec2/src/commands/UnassignIpv6AddressesCommand.ts diff --git a/clients/client-ec2/commands/UnassignPrivateIpAddressesCommand.ts b/clients/client-ec2/src/commands/UnassignPrivateIpAddressesCommand.ts similarity index 100% rename from clients/client-ec2/commands/UnassignPrivateIpAddressesCommand.ts rename to clients/client-ec2/src/commands/UnassignPrivateIpAddressesCommand.ts diff --git a/clients/client-ec2/commands/UnmonitorInstancesCommand.ts b/clients/client-ec2/src/commands/UnmonitorInstancesCommand.ts similarity index 100% rename from clients/client-ec2/commands/UnmonitorInstancesCommand.ts rename to clients/client-ec2/src/commands/UnmonitorInstancesCommand.ts diff --git a/clients/client-ec2/commands/UpdateSecurityGroupRuleDescriptionsEgressCommand.ts b/clients/client-ec2/src/commands/UpdateSecurityGroupRuleDescriptionsEgressCommand.ts similarity index 100% rename from clients/client-ec2/commands/UpdateSecurityGroupRuleDescriptionsEgressCommand.ts rename to clients/client-ec2/src/commands/UpdateSecurityGroupRuleDescriptionsEgressCommand.ts diff --git a/clients/client-ec2/commands/UpdateSecurityGroupRuleDescriptionsIngressCommand.ts b/clients/client-ec2/src/commands/UpdateSecurityGroupRuleDescriptionsIngressCommand.ts similarity index 100% rename from clients/client-ec2/commands/UpdateSecurityGroupRuleDescriptionsIngressCommand.ts rename to clients/client-ec2/src/commands/UpdateSecurityGroupRuleDescriptionsIngressCommand.ts diff --git a/clients/client-ec2/commands/WithdrawByoipCidrCommand.ts b/clients/client-ec2/src/commands/WithdrawByoipCidrCommand.ts similarity index 100% rename from clients/client-ec2/commands/WithdrawByoipCidrCommand.ts rename to clients/client-ec2/src/commands/WithdrawByoipCidrCommand.ts diff --git a/clients/client-ec2/endpoints.ts b/clients/client-ec2/src/endpoints.ts similarity index 100% rename from clients/client-ec2/endpoints.ts rename to clients/client-ec2/src/endpoints.ts diff --git a/clients/client-ec2/index.ts b/clients/client-ec2/src/index.ts similarity index 100% rename from clients/client-ec2/index.ts rename to clients/client-ec2/src/index.ts diff --git a/clients/client-ec2/models/index.ts b/clients/client-ec2/src/models/index.ts similarity index 100% rename from clients/client-ec2/models/index.ts rename to clients/client-ec2/src/models/index.ts diff --git a/clients/client-ec2/models/models_0.ts b/clients/client-ec2/src/models/models_0.ts similarity index 100% rename from clients/client-ec2/models/models_0.ts rename to clients/client-ec2/src/models/models_0.ts diff --git a/clients/client-ec2/models/models_1.ts b/clients/client-ec2/src/models/models_1.ts similarity index 100% rename from clients/client-ec2/models/models_1.ts rename to clients/client-ec2/src/models/models_1.ts diff --git a/clients/client-ec2/models/models_2.ts b/clients/client-ec2/src/models/models_2.ts similarity index 100% rename from clients/client-ec2/models/models_2.ts rename to clients/client-ec2/src/models/models_2.ts diff --git a/clients/client-ec2/models/models_3.ts b/clients/client-ec2/src/models/models_3.ts similarity index 100% rename from clients/client-ec2/models/models_3.ts rename to clients/client-ec2/src/models/models_3.ts diff --git a/clients/client-ec2/models/models_4.ts b/clients/client-ec2/src/models/models_4.ts similarity index 100% rename from clients/client-ec2/models/models_4.ts rename to clients/client-ec2/src/models/models_4.ts diff --git a/clients/client-ec2/models/models_5.ts b/clients/client-ec2/src/models/models_5.ts similarity index 100% rename from clients/client-ec2/models/models_5.ts rename to clients/client-ec2/src/models/models_5.ts diff --git a/clients/client-ec2/pagination/DescribeAddressesAttributePaginator.ts b/clients/client-ec2/src/pagination/DescribeAddressesAttributePaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeAddressesAttributePaginator.ts rename to clients/client-ec2/src/pagination/DescribeAddressesAttributePaginator.ts diff --git a/clients/client-ec2/pagination/DescribeByoipCidrsPaginator.ts b/clients/client-ec2/src/pagination/DescribeByoipCidrsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeByoipCidrsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeByoipCidrsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeCapacityReservationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeCapacityReservationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeCapacityReservationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeCapacityReservationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeCarrierGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeCarrierGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeCarrierGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeCarrierGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClassicLinkInstancesPaginator.ts b/clients/client-ec2/src/pagination/DescribeClassicLinkInstancesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClassicLinkInstancesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClassicLinkInstancesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClientVpnAuthorizationRulesPaginator.ts b/clients/client-ec2/src/pagination/DescribeClientVpnAuthorizationRulesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClientVpnAuthorizationRulesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClientVpnAuthorizationRulesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClientVpnConnectionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeClientVpnConnectionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClientVpnConnectionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClientVpnConnectionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClientVpnEndpointsPaginator.ts b/clients/client-ec2/src/pagination/DescribeClientVpnEndpointsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClientVpnEndpointsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClientVpnEndpointsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClientVpnRoutesPaginator.ts b/clients/client-ec2/src/pagination/DescribeClientVpnRoutesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClientVpnRoutesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClientVpnRoutesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeClientVpnTargetNetworksPaginator.ts b/clients/client-ec2/src/pagination/DescribeClientVpnTargetNetworksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeClientVpnTargetNetworksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeClientVpnTargetNetworksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeCoipPoolsPaginator.ts b/clients/client-ec2/src/pagination/DescribeCoipPoolsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeCoipPoolsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeCoipPoolsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeDhcpOptionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeDhcpOptionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeDhcpOptionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeDhcpOptionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeEgressOnlyInternetGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeEgressOnlyInternetGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeEgressOnlyInternetGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeEgressOnlyInternetGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeExportImageTasksPaginator.ts b/clients/client-ec2/src/pagination/DescribeExportImageTasksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeExportImageTasksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeExportImageTasksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeFastSnapshotRestoresPaginator.ts b/clients/client-ec2/src/pagination/DescribeFastSnapshotRestoresPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeFastSnapshotRestoresPaginator.ts rename to clients/client-ec2/src/pagination/DescribeFastSnapshotRestoresPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeFleetsPaginator.ts b/clients/client-ec2/src/pagination/DescribeFleetsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeFleetsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeFleetsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeFlowLogsPaginator.ts b/clients/client-ec2/src/pagination/DescribeFlowLogsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeFlowLogsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeFlowLogsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeFpgaImagesPaginator.ts b/clients/client-ec2/src/pagination/DescribeFpgaImagesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeFpgaImagesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeFpgaImagesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeHostReservationOfferingsPaginator.ts b/clients/client-ec2/src/pagination/DescribeHostReservationOfferingsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeHostReservationOfferingsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeHostReservationOfferingsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeHostReservationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeHostReservationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeHostReservationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeHostReservationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeHostsPaginator.ts b/clients/client-ec2/src/pagination/DescribeHostsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeHostsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeHostsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeIamInstanceProfileAssociationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeIamInstanceProfileAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeIamInstanceProfileAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeIamInstanceProfileAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeImportImageTasksPaginator.ts b/clients/client-ec2/src/pagination/DescribeImportImageTasksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeImportImageTasksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeImportImageTasksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeImportSnapshotTasksPaginator.ts b/clients/client-ec2/src/pagination/DescribeImportSnapshotTasksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeImportSnapshotTasksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeImportSnapshotTasksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstanceCreditSpecificationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstanceCreditSpecificationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstanceCreditSpecificationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstanceCreditSpecificationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstanceEventWindowsPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstanceEventWindowsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstanceEventWindowsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstanceEventWindowsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstanceStatusPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstanceStatusPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstanceStatusPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstanceStatusPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstanceTypeOfferingsPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstanceTypeOfferingsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstanceTypeOfferingsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstanceTypeOfferingsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstanceTypesPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstanceTypesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstanceTypesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstanceTypesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInstancesPaginator.ts b/clients/client-ec2/src/pagination/DescribeInstancesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInstancesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInstancesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeInternetGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeInternetGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeInternetGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeInternetGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeIpv6PoolsPaginator.ts b/clients/client-ec2/src/pagination/DescribeIpv6PoolsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeIpv6PoolsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeIpv6PoolsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLaunchTemplateVersionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeLaunchTemplateVersionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLaunchTemplateVersionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLaunchTemplateVersionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLaunchTemplatesPaginator.ts b/clients/client-ec2/src/pagination/DescribeLaunchTemplatesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLaunchTemplatesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLaunchTemplatesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewayRouteTableVpcAssociationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTableVpcAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewayRouteTableVpcAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTableVpcAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewayRouteTablesPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTablesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewayRouteTablesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewayRouteTablesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewayVirtualInterfaceGroupsPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewayVirtualInterfaceGroupsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewayVirtualInterfaceGroupsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewayVirtualInterfaceGroupsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewayVirtualInterfacesPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewayVirtualInterfacesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewayVirtualInterfacesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewayVirtualInterfacesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeLocalGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeLocalGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeLocalGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeLocalGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeManagedPrefixListsPaginator.ts b/clients/client-ec2/src/pagination/DescribeManagedPrefixListsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeManagedPrefixListsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeManagedPrefixListsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeMovingAddressesPaginator.ts b/clients/client-ec2/src/pagination/DescribeMovingAddressesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeMovingAddressesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeMovingAddressesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNatGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeNatGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNatGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNatGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNetworkAclsPaginator.ts b/clients/client-ec2/src/pagination/DescribeNetworkAclsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNetworkAclsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNetworkAclsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNetworkInsightsAnalysesPaginator.ts b/clients/client-ec2/src/pagination/DescribeNetworkInsightsAnalysesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNetworkInsightsAnalysesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNetworkInsightsAnalysesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNetworkInsightsPathsPaginator.ts b/clients/client-ec2/src/pagination/DescribeNetworkInsightsPathsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNetworkInsightsPathsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNetworkInsightsPathsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNetworkInterfacePermissionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeNetworkInterfacePermissionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNetworkInterfacePermissionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNetworkInterfacePermissionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeNetworkInterfacesPaginator.ts b/clients/client-ec2/src/pagination/DescribeNetworkInterfacesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeNetworkInterfacesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeNetworkInterfacesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribePrefixListsPaginator.ts b/clients/client-ec2/src/pagination/DescribePrefixListsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribePrefixListsPaginator.ts rename to clients/client-ec2/src/pagination/DescribePrefixListsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribePrincipalIdFormatPaginator.ts b/clients/client-ec2/src/pagination/DescribePrincipalIdFormatPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribePrincipalIdFormatPaginator.ts rename to clients/client-ec2/src/pagination/DescribePrincipalIdFormatPaginator.ts diff --git a/clients/client-ec2/pagination/DescribePublicIpv4PoolsPaginator.ts b/clients/client-ec2/src/pagination/DescribePublicIpv4PoolsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribePublicIpv4PoolsPaginator.ts rename to clients/client-ec2/src/pagination/DescribePublicIpv4PoolsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeReplaceRootVolumeTasksPaginator.ts b/clients/client-ec2/src/pagination/DescribeReplaceRootVolumeTasksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeReplaceRootVolumeTasksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeReplaceRootVolumeTasksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeReservedInstancesModificationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeReservedInstancesModificationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeReservedInstancesModificationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeReservedInstancesModificationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeReservedInstancesOfferingsPaginator.ts b/clients/client-ec2/src/pagination/DescribeReservedInstancesOfferingsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeReservedInstancesOfferingsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeReservedInstancesOfferingsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeRouteTablesPaginator.ts b/clients/client-ec2/src/pagination/DescribeRouteTablesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeRouteTablesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeRouteTablesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeScheduledInstanceAvailabilityPaginator.ts b/clients/client-ec2/src/pagination/DescribeScheduledInstanceAvailabilityPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeScheduledInstanceAvailabilityPaginator.ts rename to clients/client-ec2/src/pagination/DescribeScheduledInstanceAvailabilityPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeScheduledInstancesPaginator.ts b/clients/client-ec2/src/pagination/DescribeScheduledInstancesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeScheduledInstancesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeScheduledInstancesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSecurityGroupRulesPaginator.ts b/clients/client-ec2/src/pagination/DescribeSecurityGroupRulesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSecurityGroupRulesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSecurityGroupRulesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSecurityGroupsPaginator.ts b/clients/client-ec2/src/pagination/DescribeSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSecurityGroupsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSecurityGroupsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSnapshotsPaginator.ts b/clients/client-ec2/src/pagination/DescribeSnapshotsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSnapshotsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSnapshotsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSpotFleetRequestsPaginator.ts b/clients/client-ec2/src/pagination/DescribeSpotFleetRequestsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSpotFleetRequestsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSpotFleetRequestsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSpotInstanceRequestsPaginator.ts b/clients/client-ec2/src/pagination/DescribeSpotInstanceRequestsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSpotInstanceRequestsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSpotInstanceRequestsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSpotPriceHistoryPaginator.ts b/clients/client-ec2/src/pagination/DescribeSpotPriceHistoryPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSpotPriceHistoryPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSpotPriceHistoryPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeStaleSecurityGroupsPaginator.ts b/clients/client-ec2/src/pagination/DescribeStaleSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeStaleSecurityGroupsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeStaleSecurityGroupsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeStoreImageTasksPaginator.ts b/clients/client-ec2/src/pagination/DescribeStoreImageTasksPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeStoreImageTasksPaginator.ts rename to clients/client-ec2/src/pagination/DescribeStoreImageTasksPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeSubnetsPaginator.ts b/clients/client-ec2/src/pagination/DescribeSubnetsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeSubnetsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeSubnetsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTagsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTagsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTagsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTagsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTrafficMirrorFiltersPaginator.ts b/clients/client-ec2/src/pagination/DescribeTrafficMirrorFiltersPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTrafficMirrorFiltersPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTrafficMirrorFiltersPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTrafficMirrorSessionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTrafficMirrorSessionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTrafficMirrorSessionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTrafficMirrorSessionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTrafficMirrorTargetsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTrafficMirrorTargetsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTrafficMirrorTargetsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTrafficMirrorTargetsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayAttachmentsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayAttachmentsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayAttachmentsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayAttachmentsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayConnectPeersPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayConnectPeersPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayConnectPeersPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayConnectPeersPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayConnectsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayConnectsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayConnectsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayConnectsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayMulticastDomainsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayMulticastDomainsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayMulticastDomainsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayMulticastDomainsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayPeeringAttachmentsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayPeeringAttachmentsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayPeeringAttachmentsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayPeeringAttachmentsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayRouteTablesPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayRouteTablesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayRouteTablesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayRouteTablesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewayVpcAttachmentsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewayVpcAttachmentsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewayVpcAttachmentsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewayVpcAttachmentsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTransitGatewaysPaginator.ts b/clients/client-ec2/src/pagination/DescribeTransitGatewaysPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTransitGatewaysPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTransitGatewaysPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeTrunkInterfaceAssociationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeTrunkInterfaceAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeTrunkInterfaceAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeTrunkInterfaceAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVolumeStatusPaginator.ts b/clients/client-ec2/src/pagination/DescribeVolumeStatusPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVolumeStatusPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVolumeStatusPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVolumesModificationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVolumesModificationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVolumesModificationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVolumesModificationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVolumesPaginator.ts b/clients/client-ec2/src/pagination/DescribeVolumesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVolumesPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVolumesPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcClassicLinkDnsSupportPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcClassicLinkDnsSupportPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcClassicLinkDnsSupportPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcClassicLinkDnsSupportPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcEndpointConnectionNotificationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcEndpointConnectionNotificationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcEndpointConnectionNotificationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcEndpointConnectionNotificationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcEndpointConnectionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcEndpointConnectionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcEndpointConnectionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcEndpointConnectionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcEndpointServiceConfigurationsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcEndpointServiceConfigurationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcEndpointServiceConfigurationsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcEndpointServiceConfigurationsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcEndpointServicePermissionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcEndpointServicePermissionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcEndpointServicePermissionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcEndpointServicePermissionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcEndpointsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcEndpointsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcEndpointsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcEndpointsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcPeeringConnectionsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcPeeringConnectionsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcPeeringConnectionsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcPeeringConnectionsPaginator.ts diff --git a/clients/client-ec2/pagination/DescribeVpcsPaginator.ts b/clients/client-ec2/src/pagination/DescribeVpcsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/DescribeVpcsPaginator.ts rename to clients/client-ec2/src/pagination/DescribeVpcsPaginator.ts diff --git a/clients/client-ec2/pagination/GetAssociatedIpv6PoolCidrsPaginator.ts b/clients/client-ec2/src/pagination/GetAssociatedIpv6PoolCidrsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetAssociatedIpv6PoolCidrsPaginator.ts rename to clients/client-ec2/src/pagination/GetAssociatedIpv6PoolCidrsPaginator.ts diff --git a/clients/client-ec2/pagination/GetGroupsForCapacityReservationPaginator.ts b/clients/client-ec2/src/pagination/GetGroupsForCapacityReservationPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetGroupsForCapacityReservationPaginator.ts rename to clients/client-ec2/src/pagination/GetGroupsForCapacityReservationPaginator.ts diff --git a/clients/client-ec2/pagination/GetManagedPrefixListAssociationsPaginator.ts b/clients/client-ec2/src/pagination/GetManagedPrefixListAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetManagedPrefixListAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/GetManagedPrefixListAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/GetManagedPrefixListEntriesPaginator.ts b/clients/client-ec2/src/pagination/GetManagedPrefixListEntriesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetManagedPrefixListEntriesPaginator.ts rename to clients/client-ec2/src/pagination/GetManagedPrefixListEntriesPaginator.ts diff --git a/clients/client-ec2/pagination/GetTransitGatewayAttachmentPropagationsPaginator.ts b/clients/client-ec2/src/pagination/GetTransitGatewayAttachmentPropagationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetTransitGatewayAttachmentPropagationsPaginator.ts rename to clients/client-ec2/src/pagination/GetTransitGatewayAttachmentPropagationsPaginator.ts diff --git a/clients/client-ec2/pagination/GetTransitGatewayMulticastDomainAssociationsPaginator.ts b/clients/client-ec2/src/pagination/GetTransitGatewayMulticastDomainAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetTransitGatewayMulticastDomainAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/GetTransitGatewayMulticastDomainAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/GetTransitGatewayPrefixListReferencesPaginator.ts b/clients/client-ec2/src/pagination/GetTransitGatewayPrefixListReferencesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetTransitGatewayPrefixListReferencesPaginator.ts rename to clients/client-ec2/src/pagination/GetTransitGatewayPrefixListReferencesPaginator.ts diff --git a/clients/client-ec2/pagination/GetTransitGatewayRouteTableAssociationsPaginator.ts b/clients/client-ec2/src/pagination/GetTransitGatewayRouteTableAssociationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetTransitGatewayRouteTableAssociationsPaginator.ts rename to clients/client-ec2/src/pagination/GetTransitGatewayRouteTableAssociationsPaginator.ts diff --git a/clients/client-ec2/pagination/GetTransitGatewayRouteTablePropagationsPaginator.ts b/clients/client-ec2/src/pagination/GetTransitGatewayRouteTablePropagationsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetTransitGatewayRouteTablePropagationsPaginator.ts rename to clients/client-ec2/src/pagination/GetTransitGatewayRouteTablePropagationsPaginator.ts diff --git a/clients/client-ec2/pagination/GetVpnConnectionDeviceTypesPaginator.ts b/clients/client-ec2/src/pagination/GetVpnConnectionDeviceTypesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/GetVpnConnectionDeviceTypesPaginator.ts rename to clients/client-ec2/src/pagination/GetVpnConnectionDeviceTypesPaginator.ts diff --git a/clients/client-ec2/pagination/Interfaces.ts b/clients/client-ec2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ec2/pagination/Interfaces.ts rename to clients/client-ec2/src/pagination/Interfaces.ts diff --git a/clients/client-ec2/pagination/SearchLocalGatewayRoutesPaginator.ts b/clients/client-ec2/src/pagination/SearchLocalGatewayRoutesPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/SearchLocalGatewayRoutesPaginator.ts rename to clients/client-ec2/src/pagination/SearchLocalGatewayRoutesPaginator.ts diff --git a/clients/client-ec2/pagination/SearchTransitGatewayMulticastGroupsPaginator.ts b/clients/client-ec2/src/pagination/SearchTransitGatewayMulticastGroupsPaginator.ts similarity index 100% rename from clients/client-ec2/pagination/SearchTransitGatewayMulticastGroupsPaginator.ts rename to clients/client-ec2/src/pagination/SearchTransitGatewayMulticastGroupsPaginator.ts diff --git a/clients/client-ec2/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts similarity index 100% rename from clients/client-ec2/protocols/Aws_ec2.ts rename to clients/client-ec2/src/protocols/Aws_ec2.ts diff --git a/clients/client-ec2/src/runtimeConfig.browser.ts b/clients/client-ec2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3d6e13843815 --- /dev/null +++ b/clients/client-ec2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EC2ClientConfig } from "./EC2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ec2/runtimeConfig.native.ts b/clients/client-ec2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ec2/runtimeConfig.native.ts rename to clients/client-ec2/src/runtimeConfig.native.ts diff --git a/clients/client-ec2/runtimeConfig.shared.ts b/clients/client-ec2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ec2/runtimeConfig.shared.ts rename to clients/client-ec2/src/runtimeConfig.shared.ts diff --git a/clients/client-ec2/src/runtimeConfig.ts b/clients/client-ec2/src/runtimeConfig.ts new file mode 100644 index 000000000000..f185b563401d --- /dev/null +++ b/clients/client-ec2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EC2ClientConfig } from "./EC2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ec2/waiters/waitForBundleTaskComplete.ts b/clients/client-ec2/src/waiters/waitForBundleTaskComplete.ts similarity index 100% rename from clients/client-ec2/waiters/waitForBundleTaskComplete.ts rename to clients/client-ec2/src/waiters/waitForBundleTaskComplete.ts diff --git a/clients/client-ec2/waiters/waitForConversionTaskCancelled.ts b/clients/client-ec2/src/waiters/waitForConversionTaskCancelled.ts similarity index 100% rename from clients/client-ec2/waiters/waitForConversionTaskCancelled.ts rename to clients/client-ec2/src/waiters/waitForConversionTaskCancelled.ts diff --git a/clients/client-ec2/waiters/waitForConversionTaskCompleted.ts b/clients/client-ec2/src/waiters/waitForConversionTaskCompleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForConversionTaskCompleted.ts rename to clients/client-ec2/src/waiters/waitForConversionTaskCompleted.ts diff --git a/clients/client-ec2/waiters/waitForConversionTaskDeleted.ts b/clients/client-ec2/src/waiters/waitForConversionTaskDeleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForConversionTaskDeleted.ts rename to clients/client-ec2/src/waiters/waitForConversionTaskDeleted.ts diff --git a/clients/client-ec2/waiters/waitForCustomerGatewayAvailable.ts b/clients/client-ec2/src/waiters/waitForCustomerGatewayAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForCustomerGatewayAvailable.ts rename to clients/client-ec2/src/waiters/waitForCustomerGatewayAvailable.ts diff --git a/clients/client-ec2/waiters/waitForExportTaskCancelled.ts b/clients/client-ec2/src/waiters/waitForExportTaskCancelled.ts similarity index 100% rename from clients/client-ec2/waiters/waitForExportTaskCancelled.ts rename to clients/client-ec2/src/waiters/waitForExportTaskCancelled.ts diff --git a/clients/client-ec2/waiters/waitForExportTaskCompleted.ts b/clients/client-ec2/src/waiters/waitForExportTaskCompleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForExportTaskCompleted.ts rename to clients/client-ec2/src/waiters/waitForExportTaskCompleted.ts diff --git a/clients/client-ec2/waiters/waitForImageAvailable.ts b/clients/client-ec2/src/waiters/waitForImageAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForImageAvailable.ts rename to clients/client-ec2/src/waiters/waitForImageAvailable.ts diff --git a/clients/client-ec2/waiters/waitForImageExists.ts b/clients/client-ec2/src/waiters/waitForImageExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForImageExists.ts rename to clients/client-ec2/src/waiters/waitForImageExists.ts diff --git a/clients/client-ec2/waiters/waitForInstanceExists.ts b/clients/client-ec2/src/waiters/waitForInstanceExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForInstanceExists.ts rename to clients/client-ec2/src/waiters/waitForInstanceExists.ts diff --git a/clients/client-ec2/waiters/waitForInstanceRunning.ts b/clients/client-ec2/src/waiters/waitForInstanceRunning.ts similarity index 100% rename from clients/client-ec2/waiters/waitForInstanceRunning.ts rename to clients/client-ec2/src/waiters/waitForInstanceRunning.ts diff --git a/clients/client-ec2/waiters/waitForInstanceStatusOk.ts b/clients/client-ec2/src/waiters/waitForInstanceStatusOk.ts similarity index 100% rename from clients/client-ec2/waiters/waitForInstanceStatusOk.ts rename to clients/client-ec2/src/waiters/waitForInstanceStatusOk.ts diff --git a/clients/client-ec2/waiters/waitForInstanceStopped.ts b/clients/client-ec2/src/waiters/waitForInstanceStopped.ts similarity index 100% rename from clients/client-ec2/waiters/waitForInstanceStopped.ts rename to clients/client-ec2/src/waiters/waitForInstanceStopped.ts diff --git a/clients/client-ec2/waiters/waitForInstanceTerminated.ts b/clients/client-ec2/src/waiters/waitForInstanceTerminated.ts similarity index 100% rename from clients/client-ec2/waiters/waitForInstanceTerminated.ts rename to clients/client-ec2/src/waiters/waitForInstanceTerminated.ts diff --git a/clients/client-ec2/waiters/waitForKeyPairExists.ts b/clients/client-ec2/src/waiters/waitForKeyPairExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForKeyPairExists.ts rename to clients/client-ec2/src/waiters/waitForKeyPairExists.ts diff --git a/clients/client-ec2/waiters/waitForNatGatewayAvailable.ts b/clients/client-ec2/src/waiters/waitForNatGatewayAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForNatGatewayAvailable.ts rename to clients/client-ec2/src/waiters/waitForNatGatewayAvailable.ts diff --git a/clients/client-ec2/waiters/waitForNetworkInterfaceAvailable.ts b/clients/client-ec2/src/waiters/waitForNetworkInterfaceAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForNetworkInterfaceAvailable.ts rename to clients/client-ec2/src/waiters/waitForNetworkInterfaceAvailable.ts diff --git a/clients/client-ec2/waiters/waitForPasswordDataAvailable.ts b/clients/client-ec2/src/waiters/waitForPasswordDataAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForPasswordDataAvailable.ts rename to clients/client-ec2/src/waiters/waitForPasswordDataAvailable.ts diff --git a/clients/client-ec2/waiters/waitForSecurityGroupExists.ts b/clients/client-ec2/src/waiters/waitForSecurityGroupExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForSecurityGroupExists.ts rename to clients/client-ec2/src/waiters/waitForSecurityGroupExists.ts diff --git a/clients/client-ec2/waiters/waitForSnapshotCompleted.ts b/clients/client-ec2/src/waiters/waitForSnapshotCompleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForSnapshotCompleted.ts rename to clients/client-ec2/src/waiters/waitForSnapshotCompleted.ts diff --git a/clients/client-ec2/waiters/waitForSpotInstanceRequestFulfilled.ts b/clients/client-ec2/src/waiters/waitForSpotInstanceRequestFulfilled.ts similarity index 100% rename from clients/client-ec2/waiters/waitForSpotInstanceRequestFulfilled.ts rename to clients/client-ec2/src/waiters/waitForSpotInstanceRequestFulfilled.ts diff --git a/clients/client-ec2/waiters/waitForSubnetAvailable.ts b/clients/client-ec2/src/waiters/waitForSubnetAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForSubnetAvailable.ts rename to clients/client-ec2/src/waiters/waitForSubnetAvailable.ts diff --git a/clients/client-ec2/waiters/waitForSystemStatusOk.ts b/clients/client-ec2/src/waiters/waitForSystemStatusOk.ts similarity index 100% rename from clients/client-ec2/waiters/waitForSystemStatusOk.ts rename to clients/client-ec2/src/waiters/waitForSystemStatusOk.ts diff --git a/clients/client-ec2/waiters/waitForVolumeAvailable.ts b/clients/client-ec2/src/waiters/waitForVolumeAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVolumeAvailable.ts rename to clients/client-ec2/src/waiters/waitForVolumeAvailable.ts diff --git a/clients/client-ec2/waiters/waitForVolumeDeleted.ts b/clients/client-ec2/src/waiters/waitForVolumeDeleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVolumeDeleted.ts rename to clients/client-ec2/src/waiters/waitForVolumeDeleted.ts diff --git a/clients/client-ec2/waiters/waitForVolumeInUse.ts b/clients/client-ec2/src/waiters/waitForVolumeInUse.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVolumeInUse.ts rename to clients/client-ec2/src/waiters/waitForVolumeInUse.ts diff --git a/clients/client-ec2/waiters/waitForVpcAvailable.ts b/clients/client-ec2/src/waiters/waitForVpcAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpcAvailable.ts rename to clients/client-ec2/src/waiters/waitForVpcAvailable.ts diff --git a/clients/client-ec2/waiters/waitForVpcExists.ts b/clients/client-ec2/src/waiters/waitForVpcExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpcExists.ts rename to clients/client-ec2/src/waiters/waitForVpcExists.ts diff --git a/clients/client-ec2/waiters/waitForVpcPeeringConnectionDeleted.ts b/clients/client-ec2/src/waiters/waitForVpcPeeringConnectionDeleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpcPeeringConnectionDeleted.ts rename to clients/client-ec2/src/waiters/waitForVpcPeeringConnectionDeleted.ts diff --git a/clients/client-ec2/waiters/waitForVpcPeeringConnectionExists.ts b/clients/client-ec2/src/waiters/waitForVpcPeeringConnectionExists.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpcPeeringConnectionExists.ts rename to clients/client-ec2/src/waiters/waitForVpcPeeringConnectionExists.ts diff --git a/clients/client-ec2/waiters/waitForVpnConnectionAvailable.ts b/clients/client-ec2/src/waiters/waitForVpnConnectionAvailable.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpnConnectionAvailable.ts rename to clients/client-ec2/src/waiters/waitForVpnConnectionAvailable.ts diff --git a/clients/client-ec2/waiters/waitForVpnConnectionDeleted.ts b/clients/client-ec2/src/waiters/waitForVpnConnectionDeleted.ts similarity index 100% rename from clients/client-ec2/waiters/waitForVpnConnectionDeleted.ts rename to clients/client-ec2/src/waiters/waitForVpnConnectionDeleted.ts diff --git a/clients/client-ec2/tsconfig.es.json b/clients/client-ec2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ec2/tsconfig.es.json +++ b/clients/client-ec2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ec2/tsconfig.json b/clients/client-ec2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ec2/tsconfig.json +++ b/clients/client-ec2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ec2/tsconfig.types.json b/clients/client-ec2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ec2/tsconfig.types.json +++ b/clients/client-ec2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ecr-public/.gitignore b/clients/client-ecr-public/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ecr-public/.gitignore +++ b/clients/client-ecr-public/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ecr-public/package.json b/clients/client-ecr-public/package.json index 58f4a1ed5f5f..911790d61b9d 100644 --- a/clients/client-ecr-public/package.json +++ b/clients/client-ecr-public/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ecr-public", "repository": { "type": "git", diff --git a/clients/client-ecr-public/runtimeConfig.browser.ts b/clients/client-ecr-public/runtimeConfig.browser.ts deleted file mode 100644 index 4d635ac549db..000000000000 --- a/clients/client-ecr-public/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ECRPUBLICClientConfig } from "./ECRPUBLICClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecr-public/runtimeConfig.ts b/clients/client-ecr-public/runtimeConfig.ts deleted file mode 100644 index 2343bceebcc0..000000000000 --- a/clients/client-ecr-public/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ECRPUBLICClientConfig } from "./ECRPUBLICClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecr-public/ECRPUBLIC.ts b/clients/client-ecr-public/src/ECRPUBLIC.ts similarity index 100% rename from clients/client-ecr-public/ECRPUBLIC.ts rename to clients/client-ecr-public/src/ECRPUBLIC.ts diff --git a/clients/client-ecr-public/ECRPUBLICClient.ts b/clients/client-ecr-public/src/ECRPUBLICClient.ts similarity index 100% rename from clients/client-ecr-public/ECRPUBLICClient.ts rename to clients/client-ecr-public/src/ECRPUBLICClient.ts diff --git a/clients/client-ecr-public/commands/BatchCheckLayerAvailabilityCommand.ts b/clients/client-ecr-public/src/commands/BatchCheckLayerAvailabilityCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/BatchCheckLayerAvailabilityCommand.ts rename to clients/client-ecr-public/src/commands/BatchCheckLayerAvailabilityCommand.ts diff --git a/clients/client-ecr-public/commands/BatchDeleteImageCommand.ts b/clients/client-ecr-public/src/commands/BatchDeleteImageCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/BatchDeleteImageCommand.ts rename to clients/client-ecr-public/src/commands/BatchDeleteImageCommand.ts diff --git a/clients/client-ecr-public/commands/CompleteLayerUploadCommand.ts b/clients/client-ecr-public/src/commands/CompleteLayerUploadCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/CompleteLayerUploadCommand.ts rename to clients/client-ecr-public/src/commands/CompleteLayerUploadCommand.ts diff --git a/clients/client-ecr-public/commands/CreateRepositoryCommand.ts b/clients/client-ecr-public/src/commands/CreateRepositoryCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/CreateRepositoryCommand.ts rename to clients/client-ecr-public/src/commands/CreateRepositoryCommand.ts diff --git a/clients/client-ecr-public/commands/DeleteRepositoryCommand.ts b/clients/client-ecr-public/src/commands/DeleteRepositoryCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DeleteRepositoryCommand.ts rename to clients/client-ecr-public/src/commands/DeleteRepositoryCommand.ts diff --git a/clients/client-ecr-public/commands/DeleteRepositoryPolicyCommand.ts b/clients/client-ecr-public/src/commands/DeleteRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DeleteRepositoryPolicyCommand.ts rename to clients/client-ecr-public/src/commands/DeleteRepositoryPolicyCommand.ts diff --git a/clients/client-ecr-public/commands/DescribeImageTagsCommand.ts b/clients/client-ecr-public/src/commands/DescribeImageTagsCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DescribeImageTagsCommand.ts rename to clients/client-ecr-public/src/commands/DescribeImageTagsCommand.ts diff --git a/clients/client-ecr-public/commands/DescribeImagesCommand.ts b/clients/client-ecr-public/src/commands/DescribeImagesCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DescribeImagesCommand.ts rename to clients/client-ecr-public/src/commands/DescribeImagesCommand.ts diff --git a/clients/client-ecr-public/commands/DescribeRegistriesCommand.ts b/clients/client-ecr-public/src/commands/DescribeRegistriesCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DescribeRegistriesCommand.ts rename to clients/client-ecr-public/src/commands/DescribeRegistriesCommand.ts diff --git a/clients/client-ecr-public/commands/DescribeRepositoriesCommand.ts b/clients/client-ecr-public/src/commands/DescribeRepositoriesCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/DescribeRepositoriesCommand.ts rename to clients/client-ecr-public/src/commands/DescribeRepositoriesCommand.ts diff --git a/clients/client-ecr-public/commands/GetAuthorizationTokenCommand.ts b/clients/client-ecr-public/src/commands/GetAuthorizationTokenCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/GetAuthorizationTokenCommand.ts rename to clients/client-ecr-public/src/commands/GetAuthorizationTokenCommand.ts diff --git a/clients/client-ecr-public/commands/GetRegistryCatalogDataCommand.ts b/clients/client-ecr-public/src/commands/GetRegistryCatalogDataCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/GetRegistryCatalogDataCommand.ts rename to clients/client-ecr-public/src/commands/GetRegistryCatalogDataCommand.ts diff --git a/clients/client-ecr-public/commands/GetRepositoryCatalogDataCommand.ts b/clients/client-ecr-public/src/commands/GetRepositoryCatalogDataCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/GetRepositoryCatalogDataCommand.ts rename to clients/client-ecr-public/src/commands/GetRepositoryCatalogDataCommand.ts diff --git a/clients/client-ecr-public/commands/GetRepositoryPolicyCommand.ts b/clients/client-ecr-public/src/commands/GetRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/GetRepositoryPolicyCommand.ts rename to clients/client-ecr-public/src/commands/GetRepositoryPolicyCommand.ts diff --git a/clients/client-ecr-public/commands/InitiateLayerUploadCommand.ts b/clients/client-ecr-public/src/commands/InitiateLayerUploadCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/InitiateLayerUploadCommand.ts rename to clients/client-ecr-public/src/commands/InitiateLayerUploadCommand.ts diff --git a/clients/client-ecr-public/commands/ListTagsForResourceCommand.ts b/clients/client-ecr-public/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/ListTagsForResourceCommand.ts rename to clients/client-ecr-public/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ecr-public/commands/PutImageCommand.ts b/clients/client-ecr-public/src/commands/PutImageCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/PutImageCommand.ts rename to clients/client-ecr-public/src/commands/PutImageCommand.ts diff --git a/clients/client-ecr-public/commands/PutRegistryCatalogDataCommand.ts b/clients/client-ecr-public/src/commands/PutRegistryCatalogDataCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/PutRegistryCatalogDataCommand.ts rename to clients/client-ecr-public/src/commands/PutRegistryCatalogDataCommand.ts diff --git a/clients/client-ecr-public/commands/PutRepositoryCatalogDataCommand.ts b/clients/client-ecr-public/src/commands/PutRepositoryCatalogDataCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/PutRepositoryCatalogDataCommand.ts rename to clients/client-ecr-public/src/commands/PutRepositoryCatalogDataCommand.ts diff --git a/clients/client-ecr-public/commands/SetRepositoryPolicyCommand.ts b/clients/client-ecr-public/src/commands/SetRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/SetRepositoryPolicyCommand.ts rename to clients/client-ecr-public/src/commands/SetRepositoryPolicyCommand.ts diff --git a/clients/client-ecr-public/commands/TagResourceCommand.ts b/clients/client-ecr-public/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/TagResourceCommand.ts rename to clients/client-ecr-public/src/commands/TagResourceCommand.ts diff --git a/clients/client-ecr-public/commands/UntagResourceCommand.ts b/clients/client-ecr-public/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/UntagResourceCommand.ts rename to clients/client-ecr-public/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ecr-public/commands/UploadLayerPartCommand.ts b/clients/client-ecr-public/src/commands/UploadLayerPartCommand.ts similarity index 100% rename from clients/client-ecr-public/commands/UploadLayerPartCommand.ts rename to clients/client-ecr-public/src/commands/UploadLayerPartCommand.ts diff --git a/clients/client-ecr-public/endpoints.ts b/clients/client-ecr-public/src/endpoints.ts similarity index 100% rename from clients/client-ecr-public/endpoints.ts rename to clients/client-ecr-public/src/endpoints.ts diff --git a/clients/client-ecr-public/index.ts b/clients/client-ecr-public/src/index.ts similarity index 100% rename from clients/client-ecr-public/index.ts rename to clients/client-ecr-public/src/index.ts diff --git a/clients/client-ecr-public/models/index.ts b/clients/client-ecr-public/src/models/index.ts similarity index 100% rename from clients/client-ecr-public/models/index.ts rename to clients/client-ecr-public/src/models/index.ts diff --git a/clients/client-ecr-public/models/models_0.ts b/clients/client-ecr-public/src/models/models_0.ts similarity index 100% rename from clients/client-ecr-public/models/models_0.ts rename to clients/client-ecr-public/src/models/models_0.ts diff --git a/clients/client-ecr-public/pagination/DescribeImageTagsPaginator.ts b/clients/client-ecr-public/src/pagination/DescribeImageTagsPaginator.ts similarity index 100% rename from clients/client-ecr-public/pagination/DescribeImageTagsPaginator.ts rename to clients/client-ecr-public/src/pagination/DescribeImageTagsPaginator.ts diff --git a/clients/client-ecr-public/pagination/DescribeImagesPaginator.ts b/clients/client-ecr-public/src/pagination/DescribeImagesPaginator.ts similarity index 100% rename from clients/client-ecr-public/pagination/DescribeImagesPaginator.ts rename to clients/client-ecr-public/src/pagination/DescribeImagesPaginator.ts diff --git a/clients/client-ecr-public/pagination/DescribeRegistriesPaginator.ts b/clients/client-ecr-public/src/pagination/DescribeRegistriesPaginator.ts similarity index 100% rename from clients/client-ecr-public/pagination/DescribeRegistriesPaginator.ts rename to clients/client-ecr-public/src/pagination/DescribeRegistriesPaginator.ts diff --git a/clients/client-ecr-public/pagination/DescribeRepositoriesPaginator.ts b/clients/client-ecr-public/src/pagination/DescribeRepositoriesPaginator.ts similarity index 100% rename from clients/client-ecr-public/pagination/DescribeRepositoriesPaginator.ts rename to clients/client-ecr-public/src/pagination/DescribeRepositoriesPaginator.ts diff --git a/clients/client-ecr-public/pagination/Interfaces.ts b/clients/client-ecr-public/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ecr-public/pagination/Interfaces.ts rename to clients/client-ecr-public/src/pagination/Interfaces.ts diff --git a/clients/client-ecr-public/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ecr-public/protocols/Aws_json1_1.ts rename to clients/client-ecr-public/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ecr-public/src/runtimeConfig.browser.ts b/clients/client-ecr-public/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..08452964130a --- /dev/null +++ b/clients/client-ecr-public/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ECRPUBLICClientConfig } from "./ECRPUBLICClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecr-public/runtimeConfig.native.ts b/clients/client-ecr-public/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ecr-public/runtimeConfig.native.ts rename to clients/client-ecr-public/src/runtimeConfig.native.ts diff --git a/clients/client-ecr-public/runtimeConfig.shared.ts b/clients/client-ecr-public/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ecr-public/runtimeConfig.shared.ts rename to clients/client-ecr-public/src/runtimeConfig.shared.ts diff --git a/clients/client-ecr-public/src/runtimeConfig.ts b/clients/client-ecr-public/src/runtimeConfig.ts new file mode 100644 index 000000000000..5f073faab10b --- /dev/null +++ b/clients/client-ecr-public/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ECRPUBLICClientConfig } from "./ECRPUBLICClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecr-public/tsconfig.es.json b/clients/client-ecr-public/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ecr-public/tsconfig.es.json +++ b/clients/client-ecr-public/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ecr-public/tsconfig.json b/clients/client-ecr-public/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ecr-public/tsconfig.json +++ b/clients/client-ecr-public/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ecr-public/tsconfig.types.json b/clients/client-ecr-public/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ecr-public/tsconfig.types.json +++ b/clients/client-ecr-public/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ecr/.gitignore b/clients/client-ecr/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ecr/.gitignore +++ b/clients/client-ecr/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ecr/package.json b/clients/client-ecr/package.json index ef256bb42d12..59e2f2eeec93 100644 --- a/clients/client-ecr/package.json +++ b/clients/client-ecr/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ecr", "repository": { "type": "git", diff --git a/clients/client-ecr/runtimeConfig.browser.ts b/clients/client-ecr/runtimeConfig.browser.ts deleted file mode 100644 index 74b5fff30641..000000000000 --- a/clients/client-ecr/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ECRClientConfig } from "./ECRClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECRClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecr/runtimeConfig.ts b/clients/client-ecr/runtimeConfig.ts deleted file mode 100644 index 869aca1a18f6..000000000000 --- a/clients/client-ecr/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ECRClientConfig } from "./ECRClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECRClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecr/ECR.ts b/clients/client-ecr/src/ECR.ts similarity index 100% rename from clients/client-ecr/ECR.ts rename to clients/client-ecr/src/ECR.ts diff --git a/clients/client-ecr/ECRClient.ts b/clients/client-ecr/src/ECRClient.ts similarity index 100% rename from clients/client-ecr/ECRClient.ts rename to clients/client-ecr/src/ECRClient.ts diff --git a/clients/client-ecr/commands/BatchCheckLayerAvailabilityCommand.ts b/clients/client-ecr/src/commands/BatchCheckLayerAvailabilityCommand.ts similarity index 100% rename from clients/client-ecr/commands/BatchCheckLayerAvailabilityCommand.ts rename to clients/client-ecr/src/commands/BatchCheckLayerAvailabilityCommand.ts diff --git a/clients/client-ecr/commands/BatchDeleteImageCommand.ts b/clients/client-ecr/src/commands/BatchDeleteImageCommand.ts similarity index 100% rename from clients/client-ecr/commands/BatchDeleteImageCommand.ts rename to clients/client-ecr/src/commands/BatchDeleteImageCommand.ts diff --git a/clients/client-ecr/commands/BatchGetImageCommand.ts b/clients/client-ecr/src/commands/BatchGetImageCommand.ts similarity index 100% rename from clients/client-ecr/commands/BatchGetImageCommand.ts rename to clients/client-ecr/src/commands/BatchGetImageCommand.ts diff --git a/clients/client-ecr/commands/CompleteLayerUploadCommand.ts b/clients/client-ecr/src/commands/CompleteLayerUploadCommand.ts similarity index 100% rename from clients/client-ecr/commands/CompleteLayerUploadCommand.ts rename to clients/client-ecr/src/commands/CompleteLayerUploadCommand.ts diff --git a/clients/client-ecr/commands/CreateRepositoryCommand.ts b/clients/client-ecr/src/commands/CreateRepositoryCommand.ts similarity index 100% rename from clients/client-ecr/commands/CreateRepositoryCommand.ts rename to clients/client-ecr/src/commands/CreateRepositoryCommand.ts diff --git a/clients/client-ecr/commands/DeleteLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/DeleteLifecyclePolicyCommand.ts rename to clients/client-ecr/src/commands/DeleteLifecyclePolicyCommand.ts diff --git a/clients/client-ecr/commands/DeleteRegistryPolicyCommand.ts b/clients/client-ecr/src/commands/DeleteRegistryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/DeleteRegistryPolicyCommand.ts rename to clients/client-ecr/src/commands/DeleteRegistryPolicyCommand.ts diff --git a/clients/client-ecr/commands/DeleteRepositoryCommand.ts b/clients/client-ecr/src/commands/DeleteRepositoryCommand.ts similarity index 100% rename from clients/client-ecr/commands/DeleteRepositoryCommand.ts rename to clients/client-ecr/src/commands/DeleteRepositoryCommand.ts diff --git a/clients/client-ecr/commands/DeleteRepositoryPolicyCommand.ts b/clients/client-ecr/src/commands/DeleteRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/DeleteRepositoryPolicyCommand.ts rename to clients/client-ecr/src/commands/DeleteRepositoryPolicyCommand.ts diff --git a/clients/client-ecr/commands/DescribeImageReplicationStatusCommand.ts b/clients/client-ecr/src/commands/DescribeImageReplicationStatusCommand.ts similarity index 100% rename from clients/client-ecr/commands/DescribeImageReplicationStatusCommand.ts rename to clients/client-ecr/src/commands/DescribeImageReplicationStatusCommand.ts diff --git a/clients/client-ecr/commands/DescribeImageScanFindingsCommand.ts b/clients/client-ecr/src/commands/DescribeImageScanFindingsCommand.ts similarity index 100% rename from clients/client-ecr/commands/DescribeImageScanFindingsCommand.ts rename to clients/client-ecr/src/commands/DescribeImageScanFindingsCommand.ts diff --git a/clients/client-ecr/commands/DescribeImagesCommand.ts b/clients/client-ecr/src/commands/DescribeImagesCommand.ts similarity index 100% rename from clients/client-ecr/commands/DescribeImagesCommand.ts rename to clients/client-ecr/src/commands/DescribeImagesCommand.ts diff --git a/clients/client-ecr/commands/DescribeRegistryCommand.ts b/clients/client-ecr/src/commands/DescribeRegistryCommand.ts similarity index 100% rename from clients/client-ecr/commands/DescribeRegistryCommand.ts rename to clients/client-ecr/src/commands/DescribeRegistryCommand.ts diff --git a/clients/client-ecr/commands/DescribeRepositoriesCommand.ts b/clients/client-ecr/src/commands/DescribeRepositoriesCommand.ts similarity index 100% rename from clients/client-ecr/commands/DescribeRepositoriesCommand.ts rename to clients/client-ecr/src/commands/DescribeRepositoriesCommand.ts diff --git a/clients/client-ecr/commands/GetAuthorizationTokenCommand.ts b/clients/client-ecr/src/commands/GetAuthorizationTokenCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetAuthorizationTokenCommand.ts rename to clients/client-ecr/src/commands/GetAuthorizationTokenCommand.ts diff --git a/clients/client-ecr/commands/GetDownloadUrlForLayerCommand.ts b/clients/client-ecr/src/commands/GetDownloadUrlForLayerCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetDownloadUrlForLayerCommand.ts rename to clients/client-ecr/src/commands/GetDownloadUrlForLayerCommand.ts diff --git a/clients/client-ecr/commands/GetLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetLifecyclePolicyCommand.ts rename to clients/client-ecr/src/commands/GetLifecyclePolicyCommand.ts diff --git a/clients/client-ecr/commands/GetLifecyclePolicyPreviewCommand.ts b/clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetLifecyclePolicyPreviewCommand.ts rename to clients/client-ecr/src/commands/GetLifecyclePolicyPreviewCommand.ts diff --git a/clients/client-ecr/commands/GetRegistryPolicyCommand.ts b/clients/client-ecr/src/commands/GetRegistryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetRegistryPolicyCommand.ts rename to clients/client-ecr/src/commands/GetRegistryPolicyCommand.ts diff --git a/clients/client-ecr/commands/GetRepositoryPolicyCommand.ts b/clients/client-ecr/src/commands/GetRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/GetRepositoryPolicyCommand.ts rename to clients/client-ecr/src/commands/GetRepositoryPolicyCommand.ts diff --git a/clients/client-ecr/commands/InitiateLayerUploadCommand.ts b/clients/client-ecr/src/commands/InitiateLayerUploadCommand.ts similarity index 100% rename from clients/client-ecr/commands/InitiateLayerUploadCommand.ts rename to clients/client-ecr/src/commands/InitiateLayerUploadCommand.ts diff --git a/clients/client-ecr/commands/ListImagesCommand.ts b/clients/client-ecr/src/commands/ListImagesCommand.ts similarity index 100% rename from clients/client-ecr/commands/ListImagesCommand.ts rename to clients/client-ecr/src/commands/ListImagesCommand.ts diff --git a/clients/client-ecr/commands/ListTagsForResourceCommand.ts b/clients/client-ecr/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ecr/commands/ListTagsForResourceCommand.ts rename to clients/client-ecr/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ecr/commands/PutImageCommand.ts b/clients/client-ecr/src/commands/PutImageCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutImageCommand.ts rename to clients/client-ecr/src/commands/PutImageCommand.ts diff --git a/clients/client-ecr/commands/PutImageScanningConfigurationCommand.ts b/clients/client-ecr/src/commands/PutImageScanningConfigurationCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutImageScanningConfigurationCommand.ts rename to clients/client-ecr/src/commands/PutImageScanningConfigurationCommand.ts diff --git a/clients/client-ecr/commands/PutImageTagMutabilityCommand.ts b/clients/client-ecr/src/commands/PutImageTagMutabilityCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutImageTagMutabilityCommand.ts rename to clients/client-ecr/src/commands/PutImageTagMutabilityCommand.ts diff --git a/clients/client-ecr/commands/PutLifecyclePolicyCommand.ts b/clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutLifecyclePolicyCommand.ts rename to clients/client-ecr/src/commands/PutLifecyclePolicyCommand.ts diff --git a/clients/client-ecr/commands/PutRegistryPolicyCommand.ts b/clients/client-ecr/src/commands/PutRegistryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutRegistryPolicyCommand.ts rename to clients/client-ecr/src/commands/PutRegistryPolicyCommand.ts diff --git a/clients/client-ecr/commands/PutReplicationConfigurationCommand.ts b/clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-ecr/commands/PutReplicationConfigurationCommand.ts rename to clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts diff --git a/clients/client-ecr/commands/SetRepositoryPolicyCommand.ts b/clients/client-ecr/src/commands/SetRepositoryPolicyCommand.ts similarity index 100% rename from clients/client-ecr/commands/SetRepositoryPolicyCommand.ts rename to clients/client-ecr/src/commands/SetRepositoryPolicyCommand.ts diff --git a/clients/client-ecr/commands/StartImageScanCommand.ts b/clients/client-ecr/src/commands/StartImageScanCommand.ts similarity index 100% rename from clients/client-ecr/commands/StartImageScanCommand.ts rename to clients/client-ecr/src/commands/StartImageScanCommand.ts diff --git a/clients/client-ecr/commands/StartLifecyclePolicyPreviewCommand.ts b/clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts similarity index 100% rename from clients/client-ecr/commands/StartLifecyclePolicyPreviewCommand.ts rename to clients/client-ecr/src/commands/StartLifecyclePolicyPreviewCommand.ts diff --git a/clients/client-ecr/commands/TagResourceCommand.ts b/clients/client-ecr/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ecr/commands/TagResourceCommand.ts rename to clients/client-ecr/src/commands/TagResourceCommand.ts diff --git a/clients/client-ecr/commands/UntagResourceCommand.ts b/clients/client-ecr/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ecr/commands/UntagResourceCommand.ts rename to clients/client-ecr/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ecr/commands/UploadLayerPartCommand.ts b/clients/client-ecr/src/commands/UploadLayerPartCommand.ts similarity index 100% rename from clients/client-ecr/commands/UploadLayerPartCommand.ts rename to clients/client-ecr/src/commands/UploadLayerPartCommand.ts diff --git a/clients/client-ecr/endpoints.ts b/clients/client-ecr/src/endpoints.ts similarity index 100% rename from clients/client-ecr/endpoints.ts rename to clients/client-ecr/src/endpoints.ts diff --git a/clients/client-ecr/index.ts b/clients/client-ecr/src/index.ts similarity index 100% rename from clients/client-ecr/index.ts rename to clients/client-ecr/src/index.ts diff --git a/clients/client-ecr/models/index.ts b/clients/client-ecr/src/models/index.ts similarity index 100% rename from clients/client-ecr/models/index.ts rename to clients/client-ecr/src/models/index.ts diff --git a/clients/client-ecr/models/models_0.ts b/clients/client-ecr/src/models/models_0.ts similarity index 100% rename from clients/client-ecr/models/models_0.ts rename to clients/client-ecr/src/models/models_0.ts diff --git a/clients/client-ecr/pagination/DescribeImageScanFindingsPaginator.ts b/clients/client-ecr/src/pagination/DescribeImageScanFindingsPaginator.ts similarity index 100% rename from clients/client-ecr/pagination/DescribeImageScanFindingsPaginator.ts rename to clients/client-ecr/src/pagination/DescribeImageScanFindingsPaginator.ts diff --git a/clients/client-ecr/pagination/DescribeImagesPaginator.ts b/clients/client-ecr/src/pagination/DescribeImagesPaginator.ts similarity index 100% rename from clients/client-ecr/pagination/DescribeImagesPaginator.ts rename to clients/client-ecr/src/pagination/DescribeImagesPaginator.ts diff --git a/clients/client-ecr/pagination/DescribeRepositoriesPaginator.ts b/clients/client-ecr/src/pagination/DescribeRepositoriesPaginator.ts similarity index 100% rename from clients/client-ecr/pagination/DescribeRepositoriesPaginator.ts rename to clients/client-ecr/src/pagination/DescribeRepositoriesPaginator.ts diff --git a/clients/client-ecr/pagination/GetLifecyclePolicyPreviewPaginator.ts b/clients/client-ecr/src/pagination/GetLifecyclePolicyPreviewPaginator.ts similarity index 100% rename from clients/client-ecr/pagination/GetLifecyclePolicyPreviewPaginator.ts rename to clients/client-ecr/src/pagination/GetLifecyclePolicyPreviewPaginator.ts diff --git a/clients/client-ecr/pagination/Interfaces.ts b/clients/client-ecr/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ecr/pagination/Interfaces.ts rename to clients/client-ecr/src/pagination/Interfaces.ts diff --git a/clients/client-ecr/pagination/ListImagesPaginator.ts b/clients/client-ecr/src/pagination/ListImagesPaginator.ts similarity index 100% rename from clients/client-ecr/pagination/ListImagesPaginator.ts rename to clients/client-ecr/src/pagination/ListImagesPaginator.ts diff --git a/clients/client-ecr/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ecr/protocols/Aws_json1_1.ts rename to clients/client-ecr/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ecr/src/runtimeConfig.browser.ts b/clients/client-ecr/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f39a28f1d0a0 --- /dev/null +++ b/clients/client-ecr/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ECRClientConfig } from "./ECRClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECRClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecr/runtimeConfig.native.ts b/clients/client-ecr/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ecr/runtimeConfig.native.ts rename to clients/client-ecr/src/runtimeConfig.native.ts diff --git a/clients/client-ecr/runtimeConfig.shared.ts b/clients/client-ecr/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ecr/runtimeConfig.shared.ts rename to clients/client-ecr/src/runtimeConfig.shared.ts diff --git a/clients/client-ecr/src/runtimeConfig.ts b/clients/client-ecr/src/runtimeConfig.ts new file mode 100644 index 000000000000..aaa36af24def --- /dev/null +++ b/clients/client-ecr/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ECRClientConfig } from "./ECRClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECRClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecr/waiters/waitForImageScanComplete.ts b/clients/client-ecr/src/waiters/waitForImageScanComplete.ts similarity index 100% rename from clients/client-ecr/waiters/waitForImageScanComplete.ts rename to clients/client-ecr/src/waiters/waitForImageScanComplete.ts diff --git a/clients/client-ecr/waiters/waitForLifecyclePolicyPreviewComplete.ts b/clients/client-ecr/src/waiters/waitForLifecyclePolicyPreviewComplete.ts similarity index 100% rename from clients/client-ecr/waiters/waitForLifecyclePolicyPreviewComplete.ts rename to clients/client-ecr/src/waiters/waitForLifecyclePolicyPreviewComplete.ts diff --git a/clients/client-ecr/tsconfig.es.json b/clients/client-ecr/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ecr/tsconfig.es.json +++ b/clients/client-ecr/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ecr/tsconfig.json b/clients/client-ecr/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ecr/tsconfig.json +++ b/clients/client-ecr/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ecr/tsconfig.types.json b/clients/client-ecr/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ecr/tsconfig.types.json +++ b/clients/client-ecr/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ecs/.gitignore b/clients/client-ecs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ecs/.gitignore +++ b/clients/client-ecs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ecs/package.json b/clients/client-ecs/package.json index 146da340de1f..354f208138b1 100644 --- a/clients/client-ecs/package.json +++ b/clients/client-ecs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ecs", "repository": { "type": "git", diff --git a/clients/client-ecs/runtimeConfig.browser.ts b/clients/client-ecs/runtimeConfig.browser.ts deleted file mode 100644 index 3ec74325a1c0..000000000000 --- a/clients/client-ecs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ECSClientConfig } from "./ECSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecs/runtimeConfig.ts b/clients/client-ecs/runtimeConfig.ts deleted file mode 100644 index ba168080e7c5..000000000000 --- a/clients/client-ecs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ECSClientConfig } from "./ECSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ECSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ecs/ECS.ts b/clients/client-ecs/src/ECS.ts similarity index 100% rename from clients/client-ecs/ECS.ts rename to clients/client-ecs/src/ECS.ts diff --git a/clients/client-ecs/ECSClient.ts b/clients/client-ecs/src/ECSClient.ts similarity index 100% rename from clients/client-ecs/ECSClient.ts rename to clients/client-ecs/src/ECSClient.ts diff --git a/clients/client-ecs/commands/CreateCapacityProviderCommand.ts b/clients/client-ecs/src/commands/CreateCapacityProviderCommand.ts similarity index 100% rename from clients/client-ecs/commands/CreateCapacityProviderCommand.ts rename to clients/client-ecs/src/commands/CreateCapacityProviderCommand.ts diff --git a/clients/client-ecs/commands/CreateClusterCommand.ts b/clients/client-ecs/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-ecs/commands/CreateClusterCommand.ts rename to clients/client-ecs/src/commands/CreateClusterCommand.ts diff --git a/clients/client-ecs/commands/CreateServiceCommand.ts b/clients/client-ecs/src/commands/CreateServiceCommand.ts similarity index 100% rename from clients/client-ecs/commands/CreateServiceCommand.ts rename to clients/client-ecs/src/commands/CreateServiceCommand.ts diff --git a/clients/client-ecs/commands/CreateTaskSetCommand.ts b/clients/client-ecs/src/commands/CreateTaskSetCommand.ts similarity index 100% rename from clients/client-ecs/commands/CreateTaskSetCommand.ts rename to clients/client-ecs/src/commands/CreateTaskSetCommand.ts diff --git a/clients/client-ecs/commands/DeleteAccountSettingCommand.ts b/clients/client-ecs/src/commands/DeleteAccountSettingCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteAccountSettingCommand.ts rename to clients/client-ecs/src/commands/DeleteAccountSettingCommand.ts diff --git a/clients/client-ecs/commands/DeleteAttributesCommand.ts b/clients/client-ecs/src/commands/DeleteAttributesCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteAttributesCommand.ts rename to clients/client-ecs/src/commands/DeleteAttributesCommand.ts diff --git a/clients/client-ecs/commands/DeleteCapacityProviderCommand.ts b/clients/client-ecs/src/commands/DeleteCapacityProviderCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteCapacityProviderCommand.ts rename to clients/client-ecs/src/commands/DeleteCapacityProviderCommand.ts diff --git a/clients/client-ecs/commands/DeleteClusterCommand.ts b/clients/client-ecs/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteClusterCommand.ts rename to clients/client-ecs/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-ecs/commands/DeleteServiceCommand.ts b/clients/client-ecs/src/commands/DeleteServiceCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteServiceCommand.ts rename to clients/client-ecs/src/commands/DeleteServiceCommand.ts diff --git a/clients/client-ecs/commands/DeleteTaskSetCommand.ts b/clients/client-ecs/src/commands/DeleteTaskSetCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeleteTaskSetCommand.ts rename to clients/client-ecs/src/commands/DeleteTaskSetCommand.ts diff --git a/clients/client-ecs/commands/DeregisterContainerInstanceCommand.ts b/clients/client-ecs/src/commands/DeregisterContainerInstanceCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeregisterContainerInstanceCommand.ts rename to clients/client-ecs/src/commands/DeregisterContainerInstanceCommand.ts diff --git a/clients/client-ecs/commands/DeregisterTaskDefinitionCommand.ts b/clients/client-ecs/src/commands/DeregisterTaskDefinitionCommand.ts similarity index 100% rename from clients/client-ecs/commands/DeregisterTaskDefinitionCommand.ts rename to clients/client-ecs/src/commands/DeregisterTaskDefinitionCommand.ts diff --git a/clients/client-ecs/commands/DescribeCapacityProvidersCommand.ts b/clients/client-ecs/src/commands/DescribeCapacityProvidersCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeCapacityProvidersCommand.ts rename to clients/client-ecs/src/commands/DescribeCapacityProvidersCommand.ts diff --git a/clients/client-ecs/commands/DescribeClustersCommand.ts b/clients/client-ecs/src/commands/DescribeClustersCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeClustersCommand.ts rename to clients/client-ecs/src/commands/DescribeClustersCommand.ts diff --git a/clients/client-ecs/commands/DescribeContainerInstancesCommand.ts b/clients/client-ecs/src/commands/DescribeContainerInstancesCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeContainerInstancesCommand.ts rename to clients/client-ecs/src/commands/DescribeContainerInstancesCommand.ts diff --git a/clients/client-ecs/commands/DescribeServicesCommand.ts b/clients/client-ecs/src/commands/DescribeServicesCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeServicesCommand.ts rename to clients/client-ecs/src/commands/DescribeServicesCommand.ts diff --git a/clients/client-ecs/commands/DescribeTaskDefinitionCommand.ts b/clients/client-ecs/src/commands/DescribeTaskDefinitionCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeTaskDefinitionCommand.ts rename to clients/client-ecs/src/commands/DescribeTaskDefinitionCommand.ts diff --git a/clients/client-ecs/commands/DescribeTaskSetsCommand.ts b/clients/client-ecs/src/commands/DescribeTaskSetsCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeTaskSetsCommand.ts rename to clients/client-ecs/src/commands/DescribeTaskSetsCommand.ts diff --git a/clients/client-ecs/commands/DescribeTasksCommand.ts b/clients/client-ecs/src/commands/DescribeTasksCommand.ts similarity index 100% rename from clients/client-ecs/commands/DescribeTasksCommand.ts rename to clients/client-ecs/src/commands/DescribeTasksCommand.ts diff --git a/clients/client-ecs/commands/DiscoverPollEndpointCommand.ts b/clients/client-ecs/src/commands/DiscoverPollEndpointCommand.ts similarity index 100% rename from clients/client-ecs/commands/DiscoverPollEndpointCommand.ts rename to clients/client-ecs/src/commands/DiscoverPollEndpointCommand.ts diff --git a/clients/client-ecs/commands/ExecuteCommandCommand.ts b/clients/client-ecs/src/commands/ExecuteCommandCommand.ts similarity index 100% rename from clients/client-ecs/commands/ExecuteCommandCommand.ts rename to clients/client-ecs/src/commands/ExecuteCommandCommand.ts diff --git a/clients/client-ecs/commands/ListAccountSettingsCommand.ts b/clients/client-ecs/src/commands/ListAccountSettingsCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListAccountSettingsCommand.ts rename to clients/client-ecs/src/commands/ListAccountSettingsCommand.ts diff --git a/clients/client-ecs/commands/ListAttributesCommand.ts b/clients/client-ecs/src/commands/ListAttributesCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListAttributesCommand.ts rename to clients/client-ecs/src/commands/ListAttributesCommand.ts diff --git a/clients/client-ecs/commands/ListClustersCommand.ts b/clients/client-ecs/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListClustersCommand.ts rename to clients/client-ecs/src/commands/ListClustersCommand.ts diff --git a/clients/client-ecs/commands/ListContainerInstancesCommand.ts b/clients/client-ecs/src/commands/ListContainerInstancesCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListContainerInstancesCommand.ts rename to clients/client-ecs/src/commands/ListContainerInstancesCommand.ts diff --git a/clients/client-ecs/commands/ListServicesCommand.ts b/clients/client-ecs/src/commands/ListServicesCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListServicesCommand.ts rename to clients/client-ecs/src/commands/ListServicesCommand.ts diff --git a/clients/client-ecs/commands/ListTagsForResourceCommand.ts b/clients/client-ecs/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListTagsForResourceCommand.ts rename to clients/client-ecs/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ecs/commands/ListTaskDefinitionFamiliesCommand.ts b/clients/client-ecs/src/commands/ListTaskDefinitionFamiliesCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListTaskDefinitionFamiliesCommand.ts rename to clients/client-ecs/src/commands/ListTaskDefinitionFamiliesCommand.ts diff --git a/clients/client-ecs/commands/ListTaskDefinitionsCommand.ts b/clients/client-ecs/src/commands/ListTaskDefinitionsCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListTaskDefinitionsCommand.ts rename to clients/client-ecs/src/commands/ListTaskDefinitionsCommand.ts diff --git a/clients/client-ecs/commands/ListTasksCommand.ts b/clients/client-ecs/src/commands/ListTasksCommand.ts similarity index 100% rename from clients/client-ecs/commands/ListTasksCommand.ts rename to clients/client-ecs/src/commands/ListTasksCommand.ts diff --git a/clients/client-ecs/commands/PutAccountSettingCommand.ts b/clients/client-ecs/src/commands/PutAccountSettingCommand.ts similarity index 100% rename from clients/client-ecs/commands/PutAccountSettingCommand.ts rename to clients/client-ecs/src/commands/PutAccountSettingCommand.ts diff --git a/clients/client-ecs/commands/PutAccountSettingDefaultCommand.ts b/clients/client-ecs/src/commands/PutAccountSettingDefaultCommand.ts similarity index 100% rename from clients/client-ecs/commands/PutAccountSettingDefaultCommand.ts rename to clients/client-ecs/src/commands/PutAccountSettingDefaultCommand.ts diff --git a/clients/client-ecs/commands/PutAttributesCommand.ts b/clients/client-ecs/src/commands/PutAttributesCommand.ts similarity index 100% rename from clients/client-ecs/commands/PutAttributesCommand.ts rename to clients/client-ecs/src/commands/PutAttributesCommand.ts diff --git a/clients/client-ecs/commands/PutClusterCapacityProvidersCommand.ts b/clients/client-ecs/src/commands/PutClusterCapacityProvidersCommand.ts similarity index 100% rename from clients/client-ecs/commands/PutClusterCapacityProvidersCommand.ts rename to clients/client-ecs/src/commands/PutClusterCapacityProvidersCommand.ts diff --git a/clients/client-ecs/commands/RegisterContainerInstanceCommand.ts b/clients/client-ecs/src/commands/RegisterContainerInstanceCommand.ts similarity index 100% rename from clients/client-ecs/commands/RegisterContainerInstanceCommand.ts rename to clients/client-ecs/src/commands/RegisterContainerInstanceCommand.ts diff --git a/clients/client-ecs/commands/RegisterTaskDefinitionCommand.ts b/clients/client-ecs/src/commands/RegisterTaskDefinitionCommand.ts similarity index 100% rename from clients/client-ecs/commands/RegisterTaskDefinitionCommand.ts rename to clients/client-ecs/src/commands/RegisterTaskDefinitionCommand.ts diff --git a/clients/client-ecs/commands/RunTaskCommand.ts b/clients/client-ecs/src/commands/RunTaskCommand.ts similarity index 100% rename from clients/client-ecs/commands/RunTaskCommand.ts rename to clients/client-ecs/src/commands/RunTaskCommand.ts diff --git a/clients/client-ecs/commands/StartTaskCommand.ts b/clients/client-ecs/src/commands/StartTaskCommand.ts similarity index 100% rename from clients/client-ecs/commands/StartTaskCommand.ts rename to clients/client-ecs/src/commands/StartTaskCommand.ts diff --git a/clients/client-ecs/commands/StopTaskCommand.ts b/clients/client-ecs/src/commands/StopTaskCommand.ts similarity index 100% rename from clients/client-ecs/commands/StopTaskCommand.ts rename to clients/client-ecs/src/commands/StopTaskCommand.ts diff --git a/clients/client-ecs/commands/SubmitAttachmentStateChangesCommand.ts b/clients/client-ecs/src/commands/SubmitAttachmentStateChangesCommand.ts similarity index 100% rename from clients/client-ecs/commands/SubmitAttachmentStateChangesCommand.ts rename to clients/client-ecs/src/commands/SubmitAttachmentStateChangesCommand.ts diff --git a/clients/client-ecs/commands/SubmitContainerStateChangeCommand.ts b/clients/client-ecs/src/commands/SubmitContainerStateChangeCommand.ts similarity index 100% rename from clients/client-ecs/commands/SubmitContainerStateChangeCommand.ts rename to clients/client-ecs/src/commands/SubmitContainerStateChangeCommand.ts diff --git a/clients/client-ecs/commands/SubmitTaskStateChangeCommand.ts b/clients/client-ecs/src/commands/SubmitTaskStateChangeCommand.ts similarity index 100% rename from clients/client-ecs/commands/SubmitTaskStateChangeCommand.ts rename to clients/client-ecs/src/commands/SubmitTaskStateChangeCommand.ts diff --git a/clients/client-ecs/commands/TagResourceCommand.ts b/clients/client-ecs/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ecs/commands/TagResourceCommand.ts rename to clients/client-ecs/src/commands/TagResourceCommand.ts diff --git a/clients/client-ecs/commands/UntagResourceCommand.ts b/clients/client-ecs/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ecs/commands/UntagResourceCommand.ts rename to clients/client-ecs/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ecs/commands/UpdateCapacityProviderCommand.ts b/clients/client-ecs/src/commands/UpdateCapacityProviderCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateCapacityProviderCommand.ts rename to clients/client-ecs/src/commands/UpdateCapacityProviderCommand.ts diff --git a/clients/client-ecs/commands/UpdateClusterCommand.ts b/clients/client-ecs/src/commands/UpdateClusterCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateClusterCommand.ts rename to clients/client-ecs/src/commands/UpdateClusterCommand.ts diff --git a/clients/client-ecs/commands/UpdateClusterSettingsCommand.ts b/clients/client-ecs/src/commands/UpdateClusterSettingsCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateClusterSettingsCommand.ts rename to clients/client-ecs/src/commands/UpdateClusterSettingsCommand.ts diff --git a/clients/client-ecs/commands/UpdateContainerAgentCommand.ts b/clients/client-ecs/src/commands/UpdateContainerAgentCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateContainerAgentCommand.ts rename to clients/client-ecs/src/commands/UpdateContainerAgentCommand.ts diff --git a/clients/client-ecs/commands/UpdateContainerInstancesStateCommand.ts b/clients/client-ecs/src/commands/UpdateContainerInstancesStateCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateContainerInstancesStateCommand.ts rename to clients/client-ecs/src/commands/UpdateContainerInstancesStateCommand.ts diff --git a/clients/client-ecs/commands/UpdateServiceCommand.ts b/clients/client-ecs/src/commands/UpdateServiceCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateServiceCommand.ts rename to clients/client-ecs/src/commands/UpdateServiceCommand.ts diff --git a/clients/client-ecs/commands/UpdateServicePrimaryTaskSetCommand.ts b/clients/client-ecs/src/commands/UpdateServicePrimaryTaskSetCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateServicePrimaryTaskSetCommand.ts rename to clients/client-ecs/src/commands/UpdateServicePrimaryTaskSetCommand.ts diff --git a/clients/client-ecs/commands/UpdateTaskSetCommand.ts b/clients/client-ecs/src/commands/UpdateTaskSetCommand.ts similarity index 100% rename from clients/client-ecs/commands/UpdateTaskSetCommand.ts rename to clients/client-ecs/src/commands/UpdateTaskSetCommand.ts diff --git a/clients/client-ecs/endpoints.ts b/clients/client-ecs/src/endpoints.ts similarity index 100% rename from clients/client-ecs/endpoints.ts rename to clients/client-ecs/src/endpoints.ts diff --git a/clients/client-ecs/index.ts b/clients/client-ecs/src/index.ts similarity index 100% rename from clients/client-ecs/index.ts rename to clients/client-ecs/src/index.ts diff --git a/clients/client-ecs/models/index.ts b/clients/client-ecs/src/models/index.ts similarity index 100% rename from clients/client-ecs/models/index.ts rename to clients/client-ecs/src/models/index.ts diff --git a/clients/client-ecs/models/models_0.ts b/clients/client-ecs/src/models/models_0.ts similarity index 100% rename from clients/client-ecs/models/models_0.ts rename to clients/client-ecs/src/models/models_0.ts diff --git a/clients/client-ecs/pagination/Interfaces.ts b/clients/client-ecs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ecs/pagination/Interfaces.ts rename to clients/client-ecs/src/pagination/Interfaces.ts diff --git a/clients/client-ecs/pagination/ListAccountSettingsPaginator.ts b/clients/client-ecs/src/pagination/ListAccountSettingsPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListAccountSettingsPaginator.ts rename to clients/client-ecs/src/pagination/ListAccountSettingsPaginator.ts diff --git a/clients/client-ecs/pagination/ListAttributesPaginator.ts b/clients/client-ecs/src/pagination/ListAttributesPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListAttributesPaginator.ts rename to clients/client-ecs/src/pagination/ListAttributesPaginator.ts diff --git a/clients/client-ecs/pagination/ListClustersPaginator.ts b/clients/client-ecs/src/pagination/ListClustersPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListClustersPaginator.ts rename to clients/client-ecs/src/pagination/ListClustersPaginator.ts diff --git a/clients/client-ecs/pagination/ListContainerInstancesPaginator.ts b/clients/client-ecs/src/pagination/ListContainerInstancesPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListContainerInstancesPaginator.ts rename to clients/client-ecs/src/pagination/ListContainerInstancesPaginator.ts diff --git a/clients/client-ecs/pagination/ListServicesPaginator.ts b/clients/client-ecs/src/pagination/ListServicesPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListServicesPaginator.ts rename to clients/client-ecs/src/pagination/ListServicesPaginator.ts diff --git a/clients/client-ecs/pagination/ListTaskDefinitionFamiliesPaginator.ts b/clients/client-ecs/src/pagination/ListTaskDefinitionFamiliesPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListTaskDefinitionFamiliesPaginator.ts rename to clients/client-ecs/src/pagination/ListTaskDefinitionFamiliesPaginator.ts diff --git a/clients/client-ecs/pagination/ListTaskDefinitionsPaginator.ts b/clients/client-ecs/src/pagination/ListTaskDefinitionsPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListTaskDefinitionsPaginator.ts rename to clients/client-ecs/src/pagination/ListTaskDefinitionsPaginator.ts diff --git a/clients/client-ecs/pagination/ListTasksPaginator.ts b/clients/client-ecs/src/pagination/ListTasksPaginator.ts similarity index 100% rename from clients/client-ecs/pagination/ListTasksPaginator.ts rename to clients/client-ecs/src/pagination/ListTasksPaginator.ts diff --git a/clients/client-ecs/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ecs/protocols/Aws_json1_1.ts rename to clients/client-ecs/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ecs/src/runtimeConfig.browser.ts b/clients/client-ecs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..31c4c4e5d895 --- /dev/null +++ b/clients/client-ecs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ECSClientConfig } from "./ECSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecs/runtimeConfig.native.ts b/clients/client-ecs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ecs/runtimeConfig.native.ts rename to clients/client-ecs/src/runtimeConfig.native.ts diff --git a/clients/client-ecs/runtimeConfig.shared.ts b/clients/client-ecs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ecs/runtimeConfig.shared.ts rename to clients/client-ecs/src/runtimeConfig.shared.ts diff --git a/clients/client-ecs/src/runtimeConfig.ts b/clients/client-ecs/src/runtimeConfig.ts new file mode 100644 index 000000000000..c13dd755bdfa --- /dev/null +++ b/clients/client-ecs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ECSClientConfig } from "./ECSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ECSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ecs/waiters/waitForServicesInactive.ts b/clients/client-ecs/src/waiters/waitForServicesInactive.ts similarity index 100% rename from clients/client-ecs/waiters/waitForServicesInactive.ts rename to clients/client-ecs/src/waiters/waitForServicesInactive.ts diff --git a/clients/client-ecs/waiters/waitForTasksRunning.ts b/clients/client-ecs/src/waiters/waitForTasksRunning.ts similarity index 100% rename from clients/client-ecs/waiters/waitForTasksRunning.ts rename to clients/client-ecs/src/waiters/waitForTasksRunning.ts diff --git a/clients/client-ecs/waiters/waitForTasksStopped.ts b/clients/client-ecs/src/waiters/waitForTasksStopped.ts similarity index 100% rename from clients/client-ecs/waiters/waitForTasksStopped.ts rename to clients/client-ecs/src/waiters/waitForTasksStopped.ts diff --git a/clients/client-ecs/tsconfig.es.json b/clients/client-ecs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ecs/tsconfig.es.json +++ b/clients/client-ecs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ecs/tsconfig.json b/clients/client-ecs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ecs/tsconfig.json +++ b/clients/client-ecs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ecs/tsconfig.types.json b/clients/client-ecs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ecs/tsconfig.types.json +++ b/clients/client-ecs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-efs/.gitignore b/clients/client-efs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-efs/.gitignore +++ b/clients/client-efs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-efs/package.json b/clients/client-efs/package.json index 6b790f52964c..dc7a10b3e3b2 100644 --- a/clients/client-efs/package.json +++ b/clients/client-efs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-efs", "repository": { "type": "git", diff --git a/clients/client-efs/runtimeConfig.browser.ts b/clients/client-efs/runtimeConfig.browser.ts deleted file mode 100644 index 163d6707cdee..000000000000 --- a/clients/client-efs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EFSClientConfig } from "./EFSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EFSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-efs/runtimeConfig.ts b/clients/client-efs/runtimeConfig.ts deleted file mode 100644 index 8bd4a1079535..000000000000 --- a/clients/client-efs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EFSClientConfig } from "./EFSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EFSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-efs/EFS.ts b/clients/client-efs/src/EFS.ts similarity index 100% rename from clients/client-efs/EFS.ts rename to clients/client-efs/src/EFS.ts diff --git a/clients/client-efs/EFSClient.ts b/clients/client-efs/src/EFSClient.ts similarity index 100% rename from clients/client-efs/EFSClient.ts rename to clients/client-efs/src/EFSClient.ts diff --git a/clients/client-efs/commands/CreateAccessPointCommand.ts b/clients/client-efs/src/commands/CreateAccessPointCommand.ts similarity index 100% rename from clients/client-efs/commands/CreateAccessPointCommand.ts rename to clients/client-efs/src/commands/CreateAccessPointCommand.ts diff --git a/clients/client-efs/commands/CreateFileSystemCommand.ts b/clients/client-efs/src/commands/CreateFileSystemCommand.ts similarity index 100% rename from clients/client-efs/commands/CreateFileSystemCommand.ts rename to clients/client-efs/src/commands/CreateFileSystemCommand.ts diff --git a/clients/client-efs/commands/CreateMountTargetCommand.ts b/clients/client-efs/src/commands/CreateMountTargetCommand.ts similarity index 100% rename from clients/client-efs/commands/CreateMountTargetCommand.ts rename to clients/client-efs/src/commands/CreateMountTargetCommand.ts diff --git a/clients/client-efs/commands/CreateTagsCommand.ts b/clients/client-efs/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-efs/commands/CreateTagsCommand.ts rename to clients/client-efs/src/commands/CreateTagsCommand.ts diff --git a/clients/client-efs/commands/DeleteAccessPointCommand.ts b/clients/client-efs/src/commands/DeleteAccessPointCommand.ts similarity index 100% rename from clients/client-efs/commands/DeleteAccessPointCommand.ts rename to clients/client-efs/src/commands/DeleteAccessPointCommand.ts diff --git a/clients/client-efs/commands/DeleteFileSystemCommand.ts b/clients/client-efs/src/commands/DeleteFileSystemCommand.ts similarity index 100% rename from clients/client-efs/commands/DeleteFileSystemCommand.ts rename to clients/client-efs/src/commands/DeleteFileSystemCommand.ts diff --git a/clients/client-efs/commands/DeleteFileSystemPolicyCommand.ts b/clients/client-efs/src/commands/DeleteFileSystemPolicyCommand.ts similarity index 100% rename from clients/client-efs/commands/DeleteFileSystemPolicyCommand.ts rename to clients/client-efs/src/commands/DeleteFileSystemPolicyCommand.ts diff --git a/clients/client-efs/commands/DeleteMountTargetCommand.ts b/clients/client-efs/src/commands/DeleteMountTargetCommand.ts similarity index 100% rename from clients/client-efs/commands/DeleteMountTargetCommand.ts rename to clients/client-efs/src/commands/DeleteMountTargetCommand.ts diff --git a/clients/client-efs/commands/DeleteTagsCommand.ts b/clients/client-efs/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-efs/commands/DeleteTagsCommand.ts rename to clients/client-efs/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-efs/commands/DescribeAccessPointsCommand.ts b/clients/client-efs/src/commands/DescribeAccessPointsCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeAccessPointsCommand.ts rename to clients/client-efs/src/commands/DescribeAccessPointsCommand.ts diff --git a/clients/client-efs/commands/DescribeAccountPreferencesCommand.ts b/clients/client-efs/src/commands/DescribeAccountPreferencesCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeAccountPreferencesCommand.ts rename to clients/client-efs/src/commands/DescribeAccountPreferencesCommand.ts diff --git a/clients/client-efs/commands/DescribeBackupPolicyCommand.ts b/clients/client-efs/src/commands/DescribeBackupPolicyCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeBackupPolicyCommand.ts rename to clients/client-efs/src/commands/DescribeBackupPolicyCommand.ts diff --git a/clients/client-efs/commands/DescribeFileSystemPolicyCommand.ts b/clients/client-efs/src/commands/DescribeFileSystemPolicyCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeFileSystemPolicyCommand.ts rename to clients/client-efs/src/commands/DescribeFileSystemPolicyCommand.ts diff --git a/clients/client-efs/commands/DescribeFileSystemsCommand.ts b/clients/client-efs/src/commands/DescribeFileSystemsCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeFileSystemsCommand.ts rename to clients/client-efs/src/commands/DescribeFileSystemsCommand.ts diff --git a/clients/client-efs/commands/DescribeLifecycleConfigurationCommand.ts b/clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeLifecycleConfigurationCommand.ts rename to clients/client-efs/src/commands/DescribeLifecycleConfigurationCommand.ts diff --git a/clients/client-efs/commands/DescribeMountTargetSecurityGroupsCommand.ts b/clients/client-efs/src/commands/DescribeMountTargetSecurityGroupsCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeMountTargetSecurityGroupsCommand.ts rename to clients/client-efs/src/commands/DescribeMountTargetSecurityGroupsCommand.ts diff --git a/clients/client-efs/commands/DescribeMountTargetsCommand.ts b/clients/client-efs/src/commands/DescribeMountTargetsCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeMountTargetsCommand.ts rename to clients/client-efs/src/commands/DescribeMountTargetsCommand.ts diff --git a/clients/client-efs/commands/DescribeTagsCommand.ts b/clients/client-efs/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-efs/commands/DescribeTagsCommand.ts rename to clients/client-efs/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-efs/commands/ListTagsForResourceCommand.ts b/clients/client-efs/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-efs/commands/ListTagsForResourceCommand.ts rename to clients/client-efs/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-efs/commands/ModifyMountTargetSecurityGroupsCommand.ts b/clients/client-efs/src/commands/ModifyMountTargetSecurityGroupsCommand.ts similarity index 100% rename from clients/client-efs/commands/ModifyMountTargetSecurityGroupsCommand.ts rename to clients/client-efs/src/commands/ModifyMountTargetSecurityGroupsCommand.ts diff --git a/clients/client-efs/commands/PutAccountPreferencesCommand.ts b/clients/client-efs/src/commands/PutAccountPreferencesCommand.ts similarity index 100% rename from clients/client-efs/commands/PutAccountPreferencesCommand.ts rename to clients/client-efs/src/commands/PutAccountPreferencesCommand.ts diff --git a/clients/client-efs/commands/PutBackupPolicyCommand.ts b/clients/client-efs/src/commands/PutBackupPolicyCommand.ts similarity index 100% rename from clients/client-efs/commands/PutBackupPolicyCommand.ts rename to clients/client-efs/src/commands/PutBackupPolicyCommand.ts diff --git a/clients/client-efs/commands/PutFileSystemPolicyCommand.ts b/clients/client-efs/src/commands/PutFileSystemPolicyCommand.ts similarity index 100% rename from clients/client-efs/commands/PutFileSystemPolicyCommand.ts rename to clients/client-efs/src/commands/PutFileSystemPolicyCommand.ts diff --git a/clients/client-efs/commands/PutLifecycleConfigurationCommand.ts b/clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-efs/commands/PutLifecycleConfigurationCommand.ts rename to clients/client-efs/src/commands/PutLifecycleConfigurationCommand.ts diff --git a/clients/client-efs/commands/TagResourceCommand.ts b/clients/client-efs/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-efs/commands/TagResourceCommand.ts rename to clients/client-efs/src/commands/TagResourceCommand.ts diff --git a/clients/client-efs/commands/UntagResourceCommand.ts b/clients/client-efs/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-efs/commands/UntagResourceCommand.ts rename to clients/client-efs/src/commands/UntagResourceCommand.ts diff --git a/clients/client-efs/commands/UpdateFileSystemCommand.ts b/clients/client-efs/src/commands/UpdateFileSystemCommand.ts similarity index 100% rename from clients/client-efs/commands/UpdateFileSystemCommand.ts rename to clients/client-efs/src/commands/UpdateFileSystemCommand.ts diff --git a/clients/client-efs/endpoints.ts b/clients/client-efs/src/endpoints.ts similarity index 100% rename from clients/client-efs/endpoints.ts rename to clients/client-efs/src/endpoints.ts diff --git a/clients/client-efs/index.ts b/clients/client-efs/src/index.ts similarity index 100% rename from clients/client-efs/index.ts rename to clients/client-efs/src/index.ts diff --git a/clients/client-efs/models/index.ts b/clients/client-efs/src/models/index.ts similarity index 100% rename from clients/client-efs/models/index.ts rename to clients/client-efs/src/models/index.ts diff --git a/clients/client-efs/models/models_0.ts b/clients/client-efs/src/models/models_0.ts similarity index 100% rename from clients/client-efs/models/models_0.ts rename to clients/client-efs/src/models/models_0.ts diff --git a/clients/client-efs/pagination/DescribeAccessPointsPaginator.ts b/clients/client-efs/src/pagination/DescribeAccessPointsPaginator.ts similarity index 100% rename from clients/client-efs/pagination/DescribeAccessPointsPaginator.ts rename to clients/client-efs/src/pagination/DescribeAccessPointsPaginator.ts diff --git a/clients/client-efs/pagination/DescribeFileSystemsPaginator.ts b/clients/client-efs/src/pagination/DescribeFileSystemsPaginator.ts similarity index 100% rename from clients/client-efs/pagination/DescribeFileSystemsPaginator.ts rename to clients/client-efs/src/pagination/DescribeFileSystemsPaginator.ts diff --git a/clients/client-efs/pagination/DescribeTagsPaginator.ts b/clients/client-efs/src/pagination/DescribeTagsPaginator.ts similarity index 100% rename from clients/client-efs/pagination/DescribeTagsPaginator.ts rename to clients/client-efs/src/pagination/DescribeTagsPaginator.ts diff --git a/clients/client-efs/pagination/Interfaces.ts b/clients/client-efs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-efs/pagination/Interfaces.ts rename to clients/client-efs/src/pagination/Interfaces.ts diff --git a/clients/client-efs/pagination/ListTagsForResourcePaginator.ts b/clients/client-efs/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-efs/pagination/ListTagsForResourcePaginator.ts rename to clients/client-efs/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-efs/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-efs/protocols/Aws_restJson1.ts rename to clients/client-efs/src/protocols/Aws_restJson1.ts diff --git a/clients/client-efs/src/runtimeConfig.browser.ts b/clients/client-efs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a9707d9c1924 --- /dev/null +++ b/clients/client-efs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EFSClientConfig } from "./EFSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EFSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-efs/runtimeConfig.native.ts b/clients/client-efs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-efs/runtimeConfig.native.ts rename to clients/client-efs/src/runtimeConfig.native.ts diff --git a/clients/client-efs/runtimeConfig.shared.ts b/clients/client-efs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-efs/runtimeConfig.shared.ts rename to clients/client-efs/src/runtimeConfig.shared.ts diff --git a/clients/client-efs/src/runtimeConfig.ts b/clients/client-efs/src/runtimeConfig.ts new file mode 100644 index 000000000000..fea33a040175 --- /dev/null +++ b/clients/client-efs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EFSClientConfig } from "./EFSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EFSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-efs/tsconfig.es.json b/clients/client-efs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-efs/tsconfig.es.json +++ b/clients/client-efs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-efs/tsconfig.json b/clients/client-efs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-efs/tsconfig.json +++ b/clients/client-efs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-efs/tsconfig.types.json b/clients/client-efs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-efs/tsconfig.types.json +++ b/clients/client-efs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-eks/.gitignore b/clients/client-eks/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-eks/.gitignore +++ b/clients/client-eks/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-eks/package.json b/clients/client-eks/package.json index b962eb0e5ceb..64055a9693b7 100644 --- a/clients/client-eks/package.json +++ b/clients/client-eks/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-eks", "repository": { "type": "git", diff --git a/clients/client-eks/runtimeConfig.browser.ts b/clients/client-eks/runtimeConfig.browser.ts deleted file mode 100644 index df291e982c35..000000000000 --- a/clients/client-eks/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EKSClientConfig } from "./EKSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EKSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-eks/runtimeConfig.ts b/clients/client-eks/runtimeConfig.ts deleted file mode 100644 index 5b51a035acb7..000000000000 --- a/clients/client-eks/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EKSClientConfig } from "./EKSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EKSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-eks/EKS.ts b/clients/client-eks/src/EKS.ts similarity index 100% rename from clients/client-eks/EKS.ts rename to clients/client-eks/src/EKS.ts diff --git a/clients/client-eks/EKSClient.ts b/clients/client-eks/src/EKSClient.ts similarity index 100% rename from clients/client-eks/EKSClient.ts rename to clients/client-eks/src/EKSClient.ts diff --git a/clients/client-eks/commands/AssociateEncryptionConfigCommand.ts b/clients/client-eks/src/commands/AssociateEncryptionConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/AssociateEncryptionConfigCommand.ts rename to clients/client-eks/src/commands/AssociateEncryptionConfigCommand.ts diff --git a/clients/client-eks/commands/AssociateIdentityProviderConfigCommand.ts b/clients/client-eks/src/commands/AssociateIdentityProviderConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/AssociateIdentityProviderConfigCommand.ts rename to clients/client-eks/src/commands/AssociateIdentityProviderConfigCommand.ts diff --git a/clients/client-eks/commands/CreateAddonCommand.ts b/clients/client-eks/src/commands/CreateAddonCommand.ts similarity index 100% rename from clients/client-eks/commands/CreateAddonCommand.ts rename to clients/client-eks/src/commands/CreateAddonCommand.ts diff --git a/clients/client-eks/commands/CreateClusterCommand.ts b/clients/client-eks/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-eks/commands/CreateClusterCommand.ts rename to clients/client-eks/src/commands/CreateClusterCommand.ts diff --git a/clients/client-eks/commands/CreateFargateProfileCommand.ts b/clients/client-eks/src/commands/CreateFargateProfileCommand.ts similarity index 100% rename from clients/client-eks/commands/CreateFargateProfileCommand.ts rename to clients/client-eks/src/commands/CreateFargateProfileCommand.ts diff --git a/clients/client-eks/commands/CreateNodegroupCommand.ts b/clients/client-eks/src/commands/CreateNodegroupCommand.ts similarity index 100% rename from clients/client-eks/commands/CreateNodegroupCommand.ts rename to clients/client-eks/src/commands/CreateNodegroupCommand.ts diff --git a/clients/client-eks/commands/DeleteAddonCommand.ts b/clients/client-eks/src/commands/DeleteAddonCommand.ts similarity index 100% rename from clients/client-eks/commands/DeleteAddonCommand.ts rename to clients/client-eks/src/commands/DeleteAddonCommand.ts diff --git a/clients/client-eks/commands/DeleteClusterCommand.ts b/clients/client-eks/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-eks/commands/DeleteClusterCommand.ts rename to clients/client-eks/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-eks/commands/DeleteFargateProfileCommand.ts b/clients/client-eks/src/commands/DeleteFargateProfileCommand.ts similarity index 100% rename from clients/client-eks/commands/DeleteFargateProfileCommand.ts rename to clients/client-eks/src/commands/DeleteFargateProfileCommand.ts diff --git a/clients/client-eks/commands/DeleteNodegroupCommand.ts b/clients/client-eks/src/commands/DeleteNodegroupCommand.ts similarity index 100% rename from clients/client-eks/commands/DeleteNodegroupCommand.ts rename to clients/client-eks/src/commands/DeleteNodegroupCommand.ts diff --git a/clients/client-eks/commands/DeregisterClusterCommand.ts b/clients/client-eks/src/commands/DeregisterClusterCommand.ts similarity index 100% rename from clients/client-eks/commands/DeregisterClusterCommand.ts rename to clients/client-eks/src/commands/DeregisterClusterCommand.ts diff --git a/clients/client-eks/commands/DescribeAddonCommand.ts b/clients/client-eks/src/commands/DescribeAddonCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeAddonCommand.ts rename to clients/client-eks/src/commands/DescribeAddonCommand.ts diff --git a/clients/client-eks/commands/DescribeAddonVersionsCommand.ts b/clients/client-eks/src/commands/DescribeAddonVersionsCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeAddonVersionsCommand.ts rename to clients/client-eks/src/commands/DescribeAddonVersionsCommand.ts diff --git a/clients/client-eks/commands/DescribeClusterCommand.ts b/clients/client-eks/src/commands/DescribeClusterCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeClusterCommand.ts rename to clients/client-eks/src/commands/DescribeClusterCommand.ts diff --git a/clients/client-eks/commands/DescribeFargateProfileCommand.ts b/clients/client-eks/src/commands/DescribeFargateProfileCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeFargateProfileCommand.ts rename to clients/client-eks/src/commands/DescribeFargateProfileCommand.ts diff --git a/clients/client-eks/commands/DescribeIdentityProviderConfigCommand.ts b/clients/client-eks/src/commands/DescribeIdentityProviderConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeIdentityProviderConfigCommand.ts rename to clients/client-eks/src/commands/DescribeIdentityProviderConfigCommand.ts diff --git a/clients/client-eks/commands/DescribeNodegroupCommand.ts b/clients/client-eks/src/commands/DescribeNodegroupCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeNodegroupCommand.ts rename to clients/client-eks/src/commands/DescribeNodegroupCommand.ts diff --git a/clients/client-eks/commands/DescribeUpdateCommand.ts b/clients/client-eks/src/commands/DescribeUpdateCommand.ts similarity index 100% rename from clients/client-eks/commands/DescribeUpdateCommand.ts rename to clients/client-eks/src/commands/DescribeUpdateCommand.ts diff --git a/clients/client-eks/commands/DisassociateIdentityProviderConfigCommand.ts b/clients/client-eks/src/commands/DisassociateIdentityProviderConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/DisassociateIdentityProviderConfigCommand.ts rename to clients/client-eks/src/commands/DisassociateIdentityProviderConfigCommand.ts diff --git a/clients/client-eks/commands/ListAddonsCommand.ts b/clients/client-eks/src/commands/ListAddonsCommand.ts similarity index 100% rename from clients/client-eks/commands/ListAddonsCommand.ts rename to clients/client-eks/src/commands/ListAddonsCommand.ts diff --git a/clients/client-eks/commands/ListClustersCommand.ts b/clients/client-eks/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-eks/commands/ListClustersCommand.ts rename to clients/client-eks/src/commands/ListClustersCommand.ts diff --git a/clients/client-eks/commands/ListFargateProfilesCommand.ts b/clients/client-eks/src/commands/ListFargateProfilesCommand.ts similarity index 100% rename from clients/client-eks/commands/ListFargateProfilesCommand.ts rename to clients/client-eks/src/commands/ListFargateProfilesCommand.ts diff --git a/clients/client-eks/commands/ListIdentityProviderConfigsCommand.ts b/clients/client-eks/src/commands/ListIdentityProviderConfigsCommand.ts similarity index 100% rename from clients/client-eks/commands/ListIdentityProviderConfigsCommand.ts rename to clients/client-eks/src/commands/ListIdentityProviderConfigsCommand.ts diff --git a/clients/client-eks/commands/ListNodegroupsCommand.ts b/clients/client-eks/src/commands/ListNodegroupsCommand.ts similarity index 100% rename from clients/client-eks/commands/ListNodegroupsCommand.ts rename to clients/client-eks/src/commands/ListNodegroupsCommand.ts diff --git a/clients/client-eks/commands/ListTagsForResourceCommand.ts b/clients/client-eks/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-eks/commands/ListTagsForResourceCommand.ts rename to clients/client-eks/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-eks/commands/ListUpdatesCommand.ts b/clients/client-eks/src/commands/ListUpdatesCommand.ts similarity index 100% rename from clients/client-eks/commands/ListUpdatesCommand.ts rename to clients/client-eks/src/commands/ListUpdatesCommand.ts diff --git a/clients/client-eks/commands/RegisterClusterCommand.ts b/clients/client-eks/src/commands/RegisterClusterCommand.ts similarity index 100% rename from clients/client-eks/commands/RegisterClusterCommand.ts rename to clients/client-eks/src/commands/RegisterClusterCommand.ts diff --git a/clients/client-eks/commands/TagResourceCommand.ts b/clients/client-eks/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-eks/commands/TagResourceCommand.ts rename to clients/client-eks/src/commands/TagResourceCommand.ts diff --git a/clients/client-eks/commands/UntagResourceCommand.ts b/clients/client-eks/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-eks/commands/UntagResourceCommand.ts rename to clients/client-eks/src/commands/UntagResourceCommand.ts diff --git a/clients/client-eks/commands/UpdateAddonCommand.ts b/clients/client-eks/src/commands/UpdateAddonCommand.ts similarity index 100% rename from clients/client-eks/commands/UpdateAddonCommand.ts rename to clients/client-eks/src/commands/UpdateAddonCommand.ts diff --git a/clients/client-eks/commands/UpdateClusterConfigCommand.ts b/clients/client-eks/src/commands/UpdateClusterConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/UpdateClusterConfigCommand.ts rename to clients/client-eks/src/commands/UpdateClusterConfigCommand.ts diff --git a/clients/client-eks/commands/UpdateClusterVersionCommand.ts b/clients/client-eks/src/commands/UpdateClusterVersionCommand.ts similarity index 100% rename from clients/client-eks/commands/UpdateClusterVersionCommand.ts rename to clients/client-eks/src/commands/UpdateClusterVersionCommand.ts diff --git a/clients/client-eks/commands/UpdateNodegroupConfigCommand.ts b/clients/client-eks/src/commands/UpdateNodegroupConfigCommand.ts similarity index 100% rename from clients/client-eks/commands/UpdateNodegroupConfigCommand.ts rename to clients/client-eks/src/commands/UpdateNodegroupConfigCommand.ts diff --git a/clients/client-eks/commands/UpdateNodegroupVersionCommand.ts b/clients/client-eks/src/commands/UpdateNodegroupVersionCommand.ts similarity index 100% rename from clients/client-eks/commands/UpdateNodegroupVersionCommand.ts rename to clients/client-eks/src/commands/UpdateNodegroupVersionCommand.ts diff --git a/clients/client-eks/endpoints.ts b/clients/client-eks/src/endpoints.ts similarity index 100% rename from clients/client-eks/endpoints.ts rename to clients/client-eks/src/endpoints.ts diff --git a/clients/client-eks/index.ts b/clients/client-eks/src/index.ts similarity index 100% rename from clients/client-eks/index.ts rename to clients/client-eks/src/index.ts diff --git a/clients/client-eks/models/index.ts b/clients/client-eks/src/models/index.ts similarity index 100% rename from clients/client-eks/models/index.ts rename to clients/client-eks/src/models/index.ts diff --git a/clients/client-eks/models/models_0.ts b/clients/client-eks/src/models/models_0.ts similarity index 100% rename from clients/client-eks/models/models_0.ts rename to clients/client-eks/src/models/models_0.ts diff --git a/clients/client-eks/pagination/DescribeAddonVersionsPaginator.ts b/clients/client-eks/src/pagination/DescribeAddonVersionsPaginator.ts similarity index 100% rename from clients/client-eks/pagination/DescribeAddonVersionsPaginator.ts rename to clients/client-eks/src/pagination/DescribeAddonVersionsPaginator.ts diff --git a/clients/client-eks/pagination/Interfaces.ts b/clients/client-eks/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-eks/pagination/Interfaces.ts rename to clients/client-eks/src/pagination/Interfaces.ts diff --git a/clients/client-eks/pagination/ListAddonsPaginator.ts b/clients/client-eks/src/pagination/ListAddonsPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListAddonsPaginator.ts rename to clients/client-eks/src/pagination/ListAddonsPaginator.ts diff --git a/clients/client-eks/pagination/ListClustersPaginator.ts b/clients/client-eks/src/pagination/ListClustersPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListClustersPaginator.ts rename to clients/client-eks/src/pagination/ListClustersPaginator.ts diff --git a/clients/client-eks/pagination/ListFargateProfilesPaginator.ts b/clients/client-eks/src/pagination/ListFargateProfilesPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListFargateProfilesPaginator.ts rename to clients/client-eks/src/pagination/ListFargateProfilesPaginator.ts diff --git a/clients/client-eks/pagination/ListIdentityProviderConfigsPaginator.ts b/clients/client-eks/src/pagination/ListIdentityProviderConfigsPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListIdentityProviderConfigsPaginator.ts rename to clients/client-eks/src/pagination/ListIdentityProviderConfigsPaginator.ts diff --git a/clients/client-eks/pagination/ListNodegroupsPaginator.ts b/clients/client-eks/src/pagination/ListNodegroupsPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListNodegroupsPaginator.ts rename to clients/client-eks/src/pagination/ListNodegroupsPaginator.ts diff --git a/clients/client-eks/pagination/ListUpdatesPaginator.ts b/clients/client-eks/src/pagination/ListUpdatesPaginator.ts similarity index 100% rename from clients/client-eks/pagination/ListUpdatesPaginator.ts rename to clients/client-eks/src/pagination/ListUpdatesPaginator.ts diff --git a/clients/client-eks/protocols/Aws_restJson1.ts b/clients/client-eks/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-eks/protocols/Aws_restJson1.ts rename to clients/client-eks/src/protocols/Aws_restJson1.ts diff --git a/clients/client-eks/src/runtimeConfig.browser.ts b/clients/client-eks/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b101b446daac --- /dev/null +++ b/clients/client-eks/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EKSClientConfig } from "./EKSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EKSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-eks/runtimeConfig.native.ts b/clients/client-eks/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-eks/runtimeConfig.native.ts rename to clients/client-eks/src/runtimeConfig.native.ts diff --git a/clients/client-eks/runtimeConfig.shared.ts b/clients/client-eks/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-eks/runtimeConfig.shared.ts rename to clients/client-eks/src/runtimeConfig.shared.ts diff --git a/clients/client-eks/src/runtimeConfig.ts b/clients/client-eks/src/runtimeConfig.ts new file mode 100644 index 000000000000..55dd1c62dbae --- /dev/null +++ b/clients/client-eks/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EKSClientConfig } from "./EKSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EKSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-eks/waiters/waitForAddonActive.ts b/clients/client-eks/src/waiters/waitForAddonActive.ts similarity index 100% rename from clients/client-eks/waiters/waitForAddonActive.ts rename to clients/client-eks/src/waiters/waitForAddonActive.ts diff --git a/clients/client-eks/waiters/waitForAddonDeleted.ts b/clients/client-eks/src/waiters/waitForAddonDeleted.ts similarity index 100% rename from clients/client-eks/waiters/waitForAddonDeleted.ts rename to clients/client-eks/src/waiters/waitForAddonDeleted.ts diff --git a/clients/client-eks/waiters/waitForClusterActive.ts b/clients/client-eks/src/waiters/waitForClusterActive.ts similarity index 100% rename from clients/client-eks/waiters/waitForClusterActive.ts rename to clients/client-eks/src/waiters/waitForClusterActive.ts diff --git a/clients/client-eks/waiters/waitForClusterDeleted.ts b/clients/client-eks/src/waiters/waitForClusterDeleted.ts similarity index 100% rename from clients/client-eks/waiters/waitForClusterDeleted.ts rename to clients/client-eks/src/waiters/waitForClusterDeleted.ts diff --git a/clients/client-eks/waiters/waitForFargateProfileActive.ts b/clients/client-eks/src/waiters/waitForFargateProfileActive.ts similarity index 100% rename from clients/client-eks/waiters/waitForFargateProfileActive.ts rename to clients/client-eks/src/waiters/waitForFargateProfileActive.ts diff --git a/clients/client-eks/waiters/waitForFargateProfileDeleted.ts b/clients/client-eks/src/waiters/waitForFargateProfileDeleted.ts similarity index 100% rename from clients/client-eks/waiters/waitForFargateProfileDeleted.ts rename to clients/client-eks/src/waiters/waitForFargateProfileDeleted.ts diff --git a/clients/client-eks/waiters/waitForNodegroupActive.ts b/clients/client-eks/src/waiters/waitForNodegroupActive.ts similarity index 100% rename from clients/client-eks/waiters/waitForNodegroupActive.ts rename to clients/client-eks/src/waiters/waitForNodegroupActive.ts diff --git a/clients/client-eks/waiters/waitForNodegroupDeleted.ts b/clients/client-eks/src/waiters/waitForNodegroupDeleted.ts similarity index 100% rename from clients/client-eks/waiters/waitForNodegroupDeleted.ts rename to clients/client-eks/src/waiters/waitForNodegroupDeleted.ts diff --git a/clients/client-eks/tsconfig.es.json b/clients/client-eks/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-eks/tsconfig.es.json +++ b/clients/client-eks/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-eks/tsconfig.json b/clients/client-eks/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-eks/tsconfig.json +++ b/clients/client-eks/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-eks/tsconfig.types.json b/clients/client-eks/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-eks/tsconfig.types.json +++ b/clients/client-eks/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elastic-beanstalk/.gitignore b/clients/client-elastic-beanstalk/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elastic-beanstalk/.gitignore +++ b/clients/client-elastic-beanstalk/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elastic-beanstalk/package.json b/clients/client-elastic-beanstalk/package.json index e4fabb9ac667..25db1bcd0d1a 100644 --- a/clients/client-elastic-beanstalk/package.json +++ b/clients/client-elastic-beanstalk/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elastic-beanstalk", "repository": { "type": "git", diff --git a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts b/clients/client-elastic-beanstalk/runtimeConfig.browser.ts deleted file mode 100644 index 2cfca106f46d..000000000000 --- a/clients/client-elastic-beanstalk/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticBeanstalkClientConfig } from "./ElasticBeanstalkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-beanstalk/runtimeConfig.ts b/clients/client-elastic-beanstalk/runtimeConfig.ts deleted file mode 100644 index 88b50f6560fe..000000000000 --- a/clients/client-elastic-beanstalk/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticBeanstalkClientConfig } from "./ElasticBeanstalkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-beanstalk/ElasticBeanstalk.ts b/clients/client-elastic-beanstalk/src/ElasticBeanstalk.ts similarity index 100% rename from clients/client-elastic-beanstalk/ElasticBeanstalk.ts rename to clients/client-elastic-beanstalk/src/ElasticBeanstalk.ts diff --git a/clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts b/clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts similarity index 100% rename from clients/client-elastic-beanstalk/ElasticBeanstalkClient.ts rename to clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts diff --git a/clients/client-elastic-beanstalk/commands/AbortEnvironmentUpdateCommand.ts b/clients/client-elastic-beanstalk/src/commands/AbortEnvironmentUpdateCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/AbortEnvironmentUpdateCommand.ts rename to clients/client-elastic-beanstalk/src/commands/AbortEnvironmentUpdateCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ApplyEnvironmentManagedActionCommand.ts b/clients/client-elastic-beanstalk/src/commands/ApplyEnvironmentManagedActionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ApplyEnvironmentManagedActionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ApplyEnvironmentManagedActionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/AssociateEnvironmentOperationsRoleCommand.ts b/clients/client-elastic-beanstalk/src/commands/AssociateEnvironmentOperationsRoleCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/AssociateEnvironmentOperationsRoleCommand.ts rename to clients/client-elastic-beanstalk/src/commands/AssociateEnvironmentOperationsRoleCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CheckDNSAvailabilityCommand.ts b/clients/client-elastic-beanstalk/src/commands/CheckDNSAvailabilityCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CheckDNSAvailabilityCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CheckDNSAvailabilityCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ComposeEnvironmentsCommand.ts b/clients/client-elastic-beanstalk/src/commands/ComposeEnvironmentsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ComposeEnvironmentsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ComposeEnvironmentsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreateApplicationCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreateApplicationCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreateApplicationVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreateApplicationVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreateApplicationVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreateApplicationVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreateConfigurationTemplateCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreateConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreateConfigurationTemplateCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreateConfigurationTemplateCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreateEnvironmentCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreateEnvironmentCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreateEnvironmentCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreateEnvironmentCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreatePlatformVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreatePlatformVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreatePlatformVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreatePlatformVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/CreateStorageLocationCommand.ts b/clients/client-elastic-beanstalk/src/commands/CreateStorageLocationCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/CreateStorageLocationCommand.ts rename to clients/client-elastic-beanstalk/src/commands/CreateStorageLocationCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DeleteApplicationCommand.ts b/clients/client-elastic-beanstalk/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DeleteApplicationCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DeleteApplicationVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/DeleteApplicationVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DeleteApplicationVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DeleteApplicationVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DeleteConfigurationTemplateCommand.ts b/clients/client-elastic-beanstalk/src/commands/DeleteConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DeleteConfigurationTemplateCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DeleteConfigurationTemplateCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DeleteEnvironmentConfigurationCommand.ts b/clients/client-elastic-beanstalk/src/commands/DeleteEnvironmentConfigurationCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DeleteEnvironmentConfigurationCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DeleteEnvironmentConfigurationCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DeletePlatformVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/DeletePlatformVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DeletePlatformVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DeletePlatformVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeAccountAttributesCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeAccountAttributesCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeApplicationVersionsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeApplicationVersionsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeApplicationVersionsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeApplicationVersionsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeApplicationsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeApplicationsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeApplicationsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeApplicationsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeConfigurationOptionsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeConfigurationOptionsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeConfigurationOptionsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeConfigurationOptionsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeConfigurationSettingsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeConfigurationSettingsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeConfigurationSettingsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeConfigurationSettingsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEnvironmentHealthCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentHealthCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEnvironmentHealthCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentHealthCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEnvironmentManagedActionHistoryCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentManagedActionHistoryCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEnvironmentManagedActionHistoryCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentManagedActionHistoryCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEnvironmentManagedActionsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentManagedActionsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEnvironmentManagedActionsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentManagedActionsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEnvironmentResourcesCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentResourcesCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEnvironmentResourcesCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentResourcesCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEnvironmentsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEnvironmentsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEnvironmentsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeEventsCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeEventsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribeInstancesHealthCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribeInstancesHealthCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribeInstancesHealthCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribeInstancesHealthCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DescribePlatformVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/DescribePlatformVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DescribePlatformVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DescribePlatformVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/DisassociateEnvironmentOperationsRoleCommand.ts b/clients/client-elastic-beanstalk/src/commands/DisassociateEnvironmentOperationsRoleCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/DisassociateEnvironmentOperationsRoleCommand.ts rename to clients/client-elastic-beanstalk/src/commands/DisassociateEnvironmentOperationsRoleCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ListAvailableSolutionStacksCommand.ts b/clients/client-elastic-beanstalk/src/commands/ListAvailableSolutionStacksCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ListAvailableSolutionStacksCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ListAvailableSolutionStacksCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ListPlatformBranchesCommand.ts b/clients/client-elastic-beanstalk/src/commands/ListPlatformBranchesCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ListPlatformBranchesCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ListPlatformBranchesCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ListPlatformVersionsCommand.ts b/clients/client-elastic-beanstalk/src/commands/ListPlatformVersionsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ListPlatformVersionsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ListPlatformVersionsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ListTagsForResourceCommand.ts b/clients/client-elastic-beanstalk/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ListTagsForResourceCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/RebuildEnvironmentCommand.ts b/clients/client-elastic-beanstalk/src/commands/RebuildEnvironmentCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/RebuildEnvironmentCommand.ts rename to clients/client-elastic-beanstalk/src/commands/RebuildEnvironmentCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/RequestEnvironmentInfoCommand.ts b/clients/client-elastic-beanstalk/src/commands/RequestEnvironmentInfoCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/RequestEnvironmentInfoCommand.ts rename to clients/client-elastic-beanstalk/src/commands/RequestEnvironmentInfoCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/RestartAppServerCommand.ts b/clients/client-elastic-beanstalk/src/commands/RestartAppServerCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/RestartAppServerCommand.ts rename to clients/client-elastic-beanstalk/src/commands/RestartAppServerCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/RetrieveEnvironmentInfoCommand.ts b/clients/client-elastic-beanstalk/src/commands/RetrieveEnvironmentInfoCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/RetrieveEnvironmentInfoCommand.ts rename to clients/client-elastic-beanstalk/src/commands/RetrieveEnvironmentInfoCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/SwapEnvironmentCNAMEsCommand.ts b/clients/client-elastic-beanstalk/src/commands/SwapEnvironmentCNAMEsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/SwapEnvironmentCNAMEsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/SwapEnvironmentCNAMEsCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/TerminateEnvironmentCommand.ts b/clients/client-elastic-beanstalk/src/commands/TerminateEnvironmentCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/TerminateEnvironmentCommand.ts rename to clients/client-elastic-beanstalk/src/commands/TerminateEnvironmentCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateApplicationCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateApplicationCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateApplicationResourceLifecycleCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateApplicationResourceLifecycleCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateApplicationResourceLifecycleCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateApplicationResourceLifecycleCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateApplicationVersionCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateApplicationVersionCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateApplicationVersionCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateApplicationVersionCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateConfigurationTemplateCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateConfigurationTemplateCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateConfigurationTemplateCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateEnvironmentCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateEnvironmentCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/UpdateTagsForResourceCommand.ts b/clients/client-elastic-beanstalk/src/commands/UpdateTagsForResourceCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/UpdateTagsForResourceCommand.ts rename to clients/client-elastic-beanstalk/src/commands/UpdateTagsForResourceCommand.ts diff --git a/clients/client-elastic-beanstalk/commands/ValidateConfigurationSettingsCommand.ts b/clients/client-elastic-beanstalk/src/commands/ValidateConfigurationSettingsCommand.ts similarity index 100% rename from clients/client-elastic-beanstalk/commands/ValidateConfigurationSettingsCommand.ts rename to clients/client-elastic-beanstalk/src/commands/ValidateConfigurationSettingsCommand.ts diff --git a/clients/client-elastic-beanstalk/endpoints.ts b/clients/client-elastic-beanstalk/src/endpoints.ts similarity index 100% rename from clients/client-elastic-beanstalk/endpoints.ts rename to clients/client-elastic-beanstalk/src/endpoints.ts diff --git a/clients/client-elastic-beanstalk/index.ts b/clients/client-elastic-beanstalk/src/index.ts similarity index 100% rename from clients/client-elastic-beanstalk/index.ts rename to clients/client-elastic-beanstalk/src/index.ts diff --git a/clients/client-elastic-beanstalk/models/index.ts b/clients/client-elastic-beanstalk/src/models/index.ts similarity index 100% rename from clients/client-elastic-beanstalk/models/index.ts rename to clients/client-elastic-beanstalk/src/models/index.ts diff --git a/clients/client-elastic-beanstalk/models/models_0.ts b/clients/client-elastic-beanstalk/src/models/models_0.ts similarity index 100% rename from clients/client-elastic-beanstalk/models/models_0.ts rename to clients/client-elastic-beanstalk/src/models/models_0.ts diff --git a/clients/client-elastic-beanstalk/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts b/clients/client-elastic-beanstalk/src/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts similarity index 100% rename from clients/client-elastic-beanstalk/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts rename to clients/client-elastic-beanstalk/src/pagination/DescribeEnvironmentManagedActionHistoryPaginator.ts diff --git a/clients/client-elastic-beanstalk/pagination/DescribeEventsPaginator.ts b/clients/client-elastic-beanstalk/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-elastic-beanstalk/pagination/DescribeEventsPaginator.ts rename to clients/client-elastic-beanstalk/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-elastic-beanstalk/pagination/Interfaces.ts b/clients/client-elastic-beanstalk/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elastic-beanstalk/pagination/Interfaces.ts rename to clients/client-elastic-beanstalk/src/pagination/Interfaces.ts diff --git a/clients/client-elastic-beanstalk/pagination/ListPlatformBranchesPaginator.ts b/clients/client-elastic-beanstalk/src/pagination/ListPlatformBranchesPaginator.ts similarity index 100% rename from clients/client-elastic-beanstalk/pagination/ListPlatformBranchesPaginator.ts rename to clients/client-elastic-beanstalk/src/pagination/ListPlatformBranchesPaginator.ts diff --git a/clients/client-elastic-beanstalk/pagination/ListPlatformVersionsPaginator.ts b/clients/client-elastic-beanstalk/src/pagination/ListPlatformVersionsPaginator.ts similarity index 100% rename from clients/client-elastic-beanstalk/pagination/ListPlatformVersionsPaginator.ts rename to clients/client-elastic-beanstalk/src/pagination/ListPlatformVersionsPaginator.ts diff --git a/clients/client-elastic-beanstalk/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-elastic-beanstalk/protocols/Aws_query.ts rename to clients/client-elastic-beanstalk/src/protocols/Aws_query.ts diff --git a/clients/client-elastic-beanstalk/src/runtimeConfig.browser.ts b/clients/client-elastic-beanstalk/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a2b8c6cb5435 --- /dev/null +++ b/clients/client-elastic-beanstalk/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticBeanstalkClientConfig } from "./ElasticBeanstalkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-beanstalk/runtimeConfig.native.ts b/clients/client-elastic-beanstalk/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elastic-beanstalk/runtimeConfig.native.ts rename to clients/client-elastic-beanstalk/src/runtimeConfig.native.ts diff --git a/clients/client-elastic-beanstalk/runtimeConfig.shared.ts b/clients/client-elastic-beanstalk/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elastic-beanstalk/runtimeConfig.shared.ts rename to clients/client-elastic-beanstalk/src/runtimeConfig.shared.ts diff --git a/clients/client-elastic-beanstalk/src/runtimeConfig.ts b/clients/client-elastic-beanstalk/src/runtimeConfig.ts new file mode 100644 index 000000000000..6f9054c3781f --- /dev/null +++ b/clients/client-elastic-beanstalk/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticBeanstalkClientConfig } from "./ElasticBeanstalkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-beanstalk/waiters/waitForEnvironmentExists.ts b/clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentExists.ts similarity index 100% rename from clients/client-elastic-beanstalk/waiters/waitForEnvironmentExists.ts rename to clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentExists.ts diff --git a/clients/client-elastic-beanstalk/waiters/waitForEnvironmentTerminated.ts b/clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentTerminated.ts similarity index 100% rename from clients/client-elastic-beanstalk/waiters/waitForEnvironmentTerminated.ts rename to clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentTerminated.ts diff --git a/clients/client-elastic-beanstalk/waiters/waitForEnvironmentUpdated.ts b/clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentUpdated.ts similarity index 100% rename from clients/client-elastic-beanstalk/waiters/waitForEnvironmentUpdated.ts rename to clients/client-elastic-beanstalk/src/waiters/waitForEnvironmentUpdated.ts diff --git a/clients/client-elastic-beanstalk/tsconfig.es.json b/clients/client-elastic-beanstalk/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elastic-beanstalk/tsconfig.es.json +++ b/clients/client-elastic-beanstalk/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elastic-beanstalk/tsconfig.json b/clients/client-elastic-beanstalk/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elastic-beanstalk/tsconfig.json +++ b/clients/client-elastic-beanstalk/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elastic-beanstalk/tsconfig.types.json b/clients/client-elastic-beanstalk/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elastic-beanstalk/tsconfig.types.json +++ b/clients/client-elastic-beanstalk/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elastic-inference/.gitignore b/clients/client-elastic-inference/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elastic-inference/.gitignore +++ b/clients/client-elastic-inference/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elastic-inference/package.json b/clients/client-elastic-inference/package.json index d3746d74e26e..49a593f7f61e 100644 --- a/clients/client-elastic-inference/package.json +++ b/clients/client-elastic-inference/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elastic-inference", "repository": { "type": "git", diff --git a/clients/client-elastic-inference/runtimeConfig.browser.ts b/clients/client-elastic-inference/runtimeConfig.browser.ts deleted file mode 100644 index 20f398b11fc9..000000000000 --- a/clients/client-elastic-inference/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticInferenceClientConfig } from "./ElasticInferenceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-inference/runtimeConfig.ts b/clients/client-elastic-inference/runtimeConfig.ts deleted file mode 100644 index 0798eff35e3f..000000000000 --- a/clients/client-elastic-inference/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticInferenceClientConfig } from "./ElasticInferenceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-inference/ElasticInference.ts b/clients/client-elastic-inference/src/ElasticInference.ts similarity index 100% rename from clients/client-elastic-inference/ElasticInference.ts rename to clients/client-elastic-inference/src/ElasticInference.ts diff --git a/clients/client-elastic-inference/ElasticInferenceClient.ts b/clients/client-elastic-inference/src/ElasticInferenceClient.ts similarity index 100% rename from clients/client-elastic-inference/ElasticInferenceClient.ts rename to clients/client-elastic-inference/src/ElasticInferenceClient.ts diff --git a/clients/client-elastic-inference/commands/DescribeAcceleratorOfferingsCommand.ts b/clients/client-elastic-inference/src/commands/DescribeAcceleratorOfferingsCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/DescribeAcceleratorOfferingsCommand.ts rename to clients/client-elastic-inference/src/commands/DescribeAcceleratorOfferingsCommand.ts diff --git a/clients/client-elastic-inference/commands/DescribeAcceleratorTypesCommand.ts b/clients/client-elastic-inference/src/commands/DescribeAcceleratorTypesCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/DescribeAcceleratorTypesCommand.ts rename to clients/client-elastic-inference/src/commands/DescribeAcceleratorTypesCommand.ts diff --git a/clients/client-elastic-inference/commands/DescribeAcceleratorsCommand.ts b/clients/client-elastic-inference/src/commands/DescribeAcceleratorsCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/DescribeAcceleratorsCommand.ts rename to clients/client-elastic-inference/src/commands/DescribeAcceleratorsCommand.ts diff --git a/clients/client-elastic-inference/commands/ListTagsForResourceCommand.ts b/clients/client-elastic-inference/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/ListTagsForResourceCommand.ts rename to clients/client-elastic-inference/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-elastic-inference/commands/TagResourceCommand.ts b/clients/client-elastic-inference/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/TagResourceCommand.ts rename to clients/client-elastic-inference/src/commands/TagResourceCommand.ts diff --git a/clients/client-elastic-inference/commands/UntagResourceCommand.ts b/clients/client-elastic-inference/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-elastic-inference/commands/UntagResourceCommand.ts rename to clients/client-elastic-inference/src/commands/UntagResourceCommand.ts diff --git a/clients/client-elastic-inference/endpoints.ts b/clients/client-elastic-inference/src/endpoints.ts similarity index 100% rename from clients/client-elastic-inference/endpoints.ts rename to clients/client-elastic-inference/src/endpoints.ts diff --git a/clients/client-elastic-inference/index.ts b/clients/client-elastic-inference/src/index.ts similarity index 100% rename from clients/client-elastic-inference/index.ts rename to clients/client-elastic-inference/src/index.ts diff --git a/clients/client-elastic-inference/models/index.ts b/clients/client-elastic-inference/src/models/index.ts similarity index 100% rename from clients/client-elastic-inference/models/index.ts rename to clients/client-elastic-inference/src/models/index.ts diff --git a/clients/client-elastic-inference/models/models_0.ts b/clients/client-elastic-inference/src/models/models_0.ts similarity index 100% rename from clients/client-elastic-inference/models/models_0.ts rename to clients/client-elastic-inference/src/models/models_0.ts diff --git a/clients/client-elastic-inference/pagination/DescribeAcceleratorsPaginator.ts b/clients/client-elastic-inference/src/pagination/DescribeAcceleratorsPaginator.ts similarity index 100% rename from clients/client-elastic-inference/pagination/DescribeAcceleratorsPaginator.ts rename to clients/client-elastic-inference/src/pagination/DescribeAcceleratorsPaginator.ts diff --git a/clients/client-elastic-inference/pagination/Interfaces.ts b/clients/client-elastic-inference/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elastic-inference/pagination/Interfaces.ts rename to clients/client-elastic-inference/src/pagination/Interfaces.ts diff --git a/clients/client-elastic-inference/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-elastic-inference/protocols/Aws_restJson1.ts rename to clients/client-elastic-inference/src/protocols/Aws_restJson1.ts diff --git a/clients/client-elastic-inference/src/runtimeConfig.browser.ts b/clients/client-elastic-inference/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bc9da87ebf75 --- /dev/null +++ b/clients/client-elastic-inference/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticInferenceClientConfig } from "./ElasticInferenceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-inference/runtimeConfig.native.ts b/clients/client-elastic-inference/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elastic-inference/runtimeConfig.native.ts rename to clients/client-elastic-inference/src/runtimeConfig.native.ts diff --git a/clients/client-elastic-inference/runtimeConfig.shared.ts b/clients/client-elastic-inference/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elastic-inference/runtimeConfig.shared.ts rename to clients/client-elastic-inference/src/runtimeConfig.shared.ts diff --git a/clients/client-elastic-inference/src/runtimeConfig.ts b/clients/client-elastic-inference/src/runtimeConfig.ts new file mode 100644 index 000000000000..f7988bdd1602 --- /dev/null +++ b/clients/client-elastic-inference/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticInferenceClientConfig } from "./ElasticInferenceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-inference/tsconfig.es.json b/clients/client-elastic-inference/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elastic-inference/tsconfig.es.json +++ b/clients/client-elastic-inference/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elastic-inference/tsconfig.json b/clients/client-elastic-inference/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elastic-inference/tsconfig.json +++ b/clients/client-elastic-inference/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elastic-inference/tsconfig.types.json b/clients/client-elastic-inference/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elastic-inference/tsconfig.types.json +++ b/clients/client-elastic-inference/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elastic-load-balancing-v2/.gitignore b/clients/client-elastic-load-balancing-v2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elastic-load-balancing-v2/.gitignore +++ b/clients/client-elastic-load-balancing-v2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elastic-load-balancing-v2/package.json b/clients/client-elastic-load-balancing-v2/package.json index 06a7faa0466a..b34d9b2d76d8 100644 --- a/clients/client-elastic-load-balancing-v2/package.json +++ b/clients/client-elastic-load-balancing-v2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elastic-load-balancing-v2", "repository": { "type": "git", diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts deleted file mode 100644 index 49d94da7fd26..000000000000 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticLoadBalancingV2ClientConfig } from "./ElasticLoadBalancingV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/runtimeConfig.ts deleted file mode 100644 index b7abefeb63d9..000000000000 --- a/clients/client-elastic-load-balancing-v2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticLoadBalancingV2ClientConfig } from "./ElasticLoadBalancingV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2.ts b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2.ts rename to clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2.ts diff --git a/clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/ElasticLoadBalancingV2Client.ts rename to clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/AddListenerCertificatesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/AddListenerCertificatesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/AddListenerCertificatesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/AddListenerCertificatesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/AddTagsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/AddTagsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/AddTagsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/CreateListenerCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/CreateListenerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/CreateListenerCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/CreateListenerCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/CreateLoadBalancerCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/CreateLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/CreateLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/CreateLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/CreateRuleCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/CreateRuleCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/CreateRuleCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/CreateRuleCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/CreateTargetGroupCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/CreateTargetGroupCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/CreateTargetGroupCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/CreateTargetGroupCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DeleteListenerCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DeleteListenerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DeleteListenerCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DeleteListenerCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DeleteLoadBalancerCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DeleteLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DeleteLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DeleteLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DeleteRuleCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DeleteRuleCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DeleteTargetGroupCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DeleteTargetGroupCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DeleteTargetGroupCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DeleteTargetGroupCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DeregisterTargetsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DeregisterTargetsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DeregisterTargetsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DeregisterTargetsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeAccountLimitsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeAccountLimitsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeAccountLimitsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeAccountLimitsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeListenerCertificatesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeListenerCertificatesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeListenerCertificatesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeListenerCertificatesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeListenersCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeListenersCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeListenersCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeListenersCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeLoadBalancerAttributesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeLoadBalancerAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeLoadBalancerAttributesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeLoadBalancerAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeLoadBalancersCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeLoadBalancersCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeLoadBalancersCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeLoadBalancersCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeRulesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeRulesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeRulesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeRulesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeSSLPoliciesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeSSLPoliciesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeSSLPoliciesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeSSLPoliciesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeTagsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeTagsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeTargetGroupAttributesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetGroupAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeTargetGroupAttributesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetGroupAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeTargetGroupsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetGroupsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeTargetGroupsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetGroupsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/DescribeTargetHealthCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetHealthCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/DescribeTargetHealthCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/DescribeTargetHealthCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/ModifyListenerCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyListenerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/ModifyListenerCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/ModifyListenerCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/ModifyLoadBalancerAttributesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyLoadBalancerAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/ModifyLoadBalancerAttributesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/ModifyLoadBalancerAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/ModifyRuleCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyRuleCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/ModifyRuleCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/ModifyRuleCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/ModifyTargetGroupAttributesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyTargetGroupAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/ModifyTargetGroupAttributesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/ModifyTargetGroupAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/ModifyTargetGroupCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/ModifyTargetGroupCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/ModifyTargetGroupCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/ModifyTargetGroupCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/RegisterTargetsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/RegisterTargetsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/RegisterTargetsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/RegisterTargetsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/RemoveListenerCertificatesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/RemoveListenerCertificatesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/RemoveListenerCertificatesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/RemoveListenerCertificatesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/RemoveTagsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/RemoveTagsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/SetIpAddressTypeCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/SetIpAddressTypeCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/SetIpAddressTypeCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/SetIpAddressTypeCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/SetRulePrioritiesCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/SetRulePrioritiesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/SetRulePrioritiesCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/SetRulePrioritiesCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/SetSecurityGroupsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/SetSecurityGroupsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/SetSecurityGroupsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/SetSecurityGroupsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/commands/SetSubnetsCommand.ts b/clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/commands/SetSubnetsCommand.ts rename to clients/client-elastic-load-balancing-v2/src/commands/SetSubnetsCommand.ts diff --git a/clients/client-elastic-load-balancing-v2/endpoints.ts b/clients/client-elastic-load-balancing-v2/src/endpoints.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/endpoints.ts rename to clients/client-elastic-load-balancing-v2/src/endpoints.ts diff --git a/clients/client-elastic-load-balancing-v2/index.ts b/clients/client-elastic-load-balancing-v2/src/index.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/index.ts rename to clients/client-elastic-load-balancing-v2/src/index.ts diff --git a/clients/client-elastic-load-balancing-v2/models/index.ts b/clients/client-elastic-load-balancing-v2/src/models/index.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/models/index.ts rename to clients/client-elastic-load-balancing-v2/src/models/index.ts diff --git a/clients/client-elastic-load-balancing-v2/models/models_0.ts b/clients/client-elastic-load-balancing-v2/src/models/models_0.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/models/models_0.ts rename to clients/client-elastic-load-balancing-v2/src/models/models_0.ts diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeListenersPaginator.ts b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenersPaginator.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/pagination/DescribeListenersPaginator.ts rename to clients/client-elastic-load-balancing-v2/src/pagination/DescribeListenersPaginator.ts diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeLoadBalancersPaginator.ts b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeLoadBalancersPaginator.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/pagination/DescribeLoadBalancersPaginator.ts rename to clients/client-elastic-load-balancing-v2/src/pagination/DescribeLoadBalancersPaginator.ts diff --git a/clients/client-elastic-load-balancing-v2/pagination/DescribeTargetGroupsPaginator.ts b/clients/client-elastic-load-balancing-v2/src/pagination/DescribeTargetGroupsPaginator.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/pagination/DescribeTargetGroupsPaginator.ts rename to clients/client-elastic-load-balancing-v2/src/pagination/DescribeTargetGroupsPaginator.ts diff --git a/clients/client-elastic-load-balancing-v2/pagination/Interfaces.ts b/clients/client-elastic-load-balancing-v2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/pagination/Interfaces.ts rename to clients/client-elastic-load-balancing-v2/src/pagination/Interfaces.ts diff --git a/clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/protocols/Aws_query.ts rename to clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts diff --git a/clients/client-elastic-load-balancing-v2/src/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3283a4741b9f --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticLoadBalancingV2ClientConfig } from "./ElasticLoadBalancingV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/runtimeConfig.native.ts rename to clients/client-elastic-load-balancing-v2/src/runtimeConfig.native.ts diff --git a/clients/client-elastic-load-balancing-v2/runtimeConfig.shared.ts b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/runtimeConfig.shared.ts rename to clients/client-elastic-load-balancing-v2/src/runtimeConfig.shared.ts diff --git a/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts new file mode 100644 index 000000000000..99c2f1ab5aac --- /dev/null +++ b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticLoadBalancingV2ClientConfig } from "./ElasticLoadBalancingV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancerAvailable.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancerAvailable.ts rename to clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerAvailable.ts diff --git a/clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancerExists.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancerExists.ts rename to clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancerExists.ts diff --git a/clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancersDeleted.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/waiters/waitForLoadBalancersDeleted.ts rename to clients/client-elastic-load-balancing-v2/src/waiters/waitForLoadBalancersDeleted.ts diff --git a/clients/client-elastic-load-balancing-v2/waiters/waitForTargetDeregistered.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForTargetDeregistered.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/waiters/waitForTargetDeregistered.ts rename to clients/client-elastic-load-balancing-v2/src/waiters/waitForTargetDeregistered.ts diff --git a/clients/client-elastic-load-balancing-v2/waiters/waitForTargetInService.ts b/clients/client-elastic-load-balancing-v2/src/waiters/waitForTargetInService.ts similarity index 100% rename from clients/client-elastic-load-balancing-v2/waiters/waitForTargetInService.ts rename to clients/client-elastic-load-balancing-v2/src/waiters/waitForTargetInService.ts diff --git a/clients/client-elastic-load-balancing-v2/tsconfig.es.json b/clients/client-elastic-load-balancing-v2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elastic-load-balancing-v2/tsconfig.es.json +++ b/clients/client-elastic-load-balancing-v2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elastic-load-balancing-v2/tsconfig.json b/clients/client-elastic-load-balancing-v2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elastic-load-balancing-v2/tsconfig.json +++ b/clients/client-elastic-load-balancing-v2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elastic-load-balancing-v2/tsconfig.types.json b/clients/client-elastic-load-balancing-v2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elastic-load-balancing-v2/tsconfig.types.json +++ b/clients/client-elastic-load-balancing-v2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elastic-load-balancing/.gitignore b/clients/client-elastic-load-balancing/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elastic-load-balancing/.gitignore +++ b/clients/client-elastic-load-balancing/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elastic-load-balancing/package.json b/clients/client-elastic-load-balancing/package.json index 723b234ec13e..4cd79518d610 100644 --- a/clients/client-elastic-load-balancing/package.json +++ b/clients/client-elastic-load-balancing/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elastic-load-balancing", "repository": { "type": "git", diff --git a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing/runtimeConfig.browser.ts deleted file mode 100644 index 612d8c85e021..000000000000 --- a/clients/client-elastic-load-balancing/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticLoadBalancingClientConfig } from "./ElasticLoadBalancingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-load-balancing/runtimeConfig.ts b/clients/client-elastic-load-balancing/runtimeConfig.ts deleted file mode 100644 index adc365dbc497..000000000000 --- a/clients/client-elastic-load-balancing/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticLoadBalancingClientConfig } from "./ElasticLoadBalancingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-load-balancing/ElasticLoadBalancing.ts b/clients/client-elastic-load-balancing/src/ElasticLoadBalancing.ts similarity index 100% rename from clients/client-elastic-load-balancing/ElasticLoadBalancing.ts rename to clients/client-elastic-load-balancing/src/ElasticLoadBalancing.ts diff --git a/clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts b/clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts similarity index 100% rename from clients/client-elastic-load-balancing/ElasticLoadBalancingClient.ts rename to clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts diff --git a/clients/client-elastic-load-balancing/commands/AddTagsCommand.ts b/clients/client-elastic-load-balancing/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/AddTagsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/AddTagsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/ApplySecurityGroupsToLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/ApplySecurityGroupsToLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/ApplySecurityGroupsToLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/ApplySecurityGroupsToLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/AttachLoadBalancerToSubnetsCommand.ts b/clients/client-elastic-load-balancing/src/commands/AttachLoadBalancerToSubnetsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/AttachLoadBalancerToSubnetsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/AttachLoadBalancerToSubnetsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/ConfigureHealthCheckCommand.ts b/clients/client-elastic-load-balancing/src/commands/ConfigureHealthCheckCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/ConfigureHealthCheckCommand.ts rename to clients/client-elastic-load-balancing/src/commands/ConfigureHealthCheckCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/CreateAppCookieStickinessPolicyCommand.ts b/clients/client-elastic-load-balancing/src/commands/CreateAppCookieStickinessPolicyCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/CreateAppCookieStickinessPolicyCommand.ts rename to clients/client-elastic-load-balancing/src/commands/CreateAppCookieStickinessPolicyCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/CreateLBCookieStickinessPolicyCommand.ts b/clients/client-elastic-load-balancing/src/commands/CreateLBCookieStickinessPolicyCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/CreateLBCookieStickinessPolicyCommand.ts rename to clients/client-elastic-load-balancing/src/commands/CreateLBCookieStickinessPolicyCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/CreateLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/CreateLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/CreateLoadBalancerListenersCommand.ts b/clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerListenersCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/CreateLoadBalancerListenersCommand.ts rename to clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerListenersCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/CreateLoadBalancerPolicyCommand.ts b/clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerPolicyCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/CreateLoadBalancerPolicyCommand.ts rename to clients/client-elastic-load-balancing/src/commands/CreateLoadBalancerPolicyCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DeleteLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DeleteLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DeleteLoadBalancerListenersCommand.ts b/clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerListenersCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DeleteLoadBalancerListenersCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerListenersCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DeleteLoadBalancerPolicyCommand.ts b/clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerPolicyCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DeleteLoadBalancerPolicyCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DeleteLoadBalancerPolicyCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DeregisterInstancesFromLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/DeregisterInstancesFromLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DeregisterInstancesFromLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DeregisterInstancesFromLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeAccountLimitsCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeAccountLimitsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeAccountLimitsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeAccountLimitsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeInstanceHealthCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeInstanceHealthCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeInstanceHealthCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeInstanceHealthCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeLoadBalancerAttributesCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeLoadBalancerAttributesCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeLoadBalancerPoliciesCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerPoliciesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeLoadBalancerPoliciesCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerPoliciesCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeLoadBalancerPolicyTypesCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerPolicyTypesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeLoadBalancerPolicyTypesCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancerPolicyTypesCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeLoadBalancersCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancersCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeLoadBalancersCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeLoadBalancersCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DescribeTagsCommand.ts b/clients/client-elastic-load-balancing/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DescribeTagsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DetachLoadBalancerFromSubnetsCommand.ts b/clients/client-elastic-load-balancing/src/commands/DetachLoadBalancerFromSubnetsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DetachLoadBalancerFromSubnetsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DetachLoadBalancerFromSubnetsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/DisableAvailabilityZonesForLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/DisableAvailabilityZonesForLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/DisableAvailabilityZonesForLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/DisableAvailabilityZonesForLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/EnableAvailabilityZonesForLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/EnableAvailabilityZonesForLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/EnableAvailabilityZonesForLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/EnableAvailabilityZonesForLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/ModifyLoadBalancerAttributesCommand.ts b/clients/client-elastic-load-balancing/src/commands/ModifyLoadBalancerAttributesCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/ModifyLoadBalancerAttributesCommand.ts rename to clients/client-elastic-load-balancing/src/commands/ModifyLoadBalancerAttributesCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/RegisterInstancesWithLoadBalancerCommand.ts b/clients/client-elastic-load-balancing/src/commands/RegisterInstancesWithLoadBalancerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/RegisterInstancesWithLoadBalancerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/RegisterInstancesWithLoadBalancerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/RemoveTagsCommand.ts b/clients/client-elastic-load-balancing/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/RemoveTagsCommand.ts rename to clients/client-elastic-load-balancing/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/SetLoadBalancerListenerSSLCertificateCommand.ts b/clients/client-elastic-load-balancing/src/commands/SetLoadBalancerListenerSSLCertificateCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/SetLoadBalancerListenerSSLCertificateCommand.ts rename to clients/client-elastic-load-balancing/src/commands/SetLoadBalancerListenerSSLCertificateCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/SetLoadBalancerPoliciesForBackendServerCommand.ts b/clients/client-elastic-load-balancing/src/commands/SetLoadBalancerPoliciesForBackendServerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/SetLoadBalancerPoliciesForBackendServerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/SetLoadBalancerPoliciesForBackendServerCommand.ts diff --git a/clients/client-elastic-load-balancing/commands/SetLoadBalancerPoliciesOfListenerCommand.ts b/clients/client-elastic-load-balancing/src/commands/SetLoadBalancerPoliciesOfListenerCommand.ts similarity index 100% rename from clients/client-elastic-load-balancing/commands/SetLoadBalancerPoliciesOfListenerCommand.ts rename to clients/client-elastic-load-balancing/src/commands/SetLoadBalancerPoliciesOfListenerCommand.ts diff --git a/clients/client-elastic-load-balancing/endpoints.ts b/clients/client-elastic-load-balancing/src/endpoints.ts similarity index 100% rename from clients/client-elastic-load-balancing/endpoints.ts rename to clients/client-elastic-load-balancing/src/endpoints.ts diff --git a/clients/client-elastic-load-balancing/index.ts b/clients/client-elastic-load-balancing/src/index.ts similarity index 100% rename from clients/client-elastic-load-balancing/index.ts rename to clients/client-elastic-load-balancing/src/index.ts diff --git a/clients/client-elastic-load-balancing/models/index.ts b/clients/client-elastic-load-balancing/src/models/index.ts similarity index 100% rename from clients/client-elastic-load-balancing/models/index.ts rename to clients/client-elastic-load-balancing/src/models/index.ts diff --git a/clients/client-elastic-load-balancing/models/models_0.ts b/clients/client-elastic-load-balancing/src/models/models_0.ts similarity index 100% rename from clients/client-elastic-load-balancing/models/models_0.ts rename to clients/client-elastic-load-balancing/src/models/models_0.ts diff --git a/clients/client-elastic-load-balancing/pagination/DescribeLoadBalancersPaginator.ts b/clients/client-elastic-load-balancing/src/pagination/DescribeLoadBalancersPaginator.ts similarity index 100% rename from clients/client-elastic-load-balancing/pagination/DescribeLoadBalancersPaginator.ts rename to clients/client-elastic-load-balancing/src/pagination/DescribeLoadBalancersPaginator.ts diff --git a/clients/client-elastic-load-balancing/pagination/Interfaces.ts b/clients/client-elastic-load-balancing/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elastic-load-balancing/pagination/Interfaces.ts rename to clients/client-elastic-load-balancing/src/pagination/Interfaces.ts diff --git a/clients/client-elastic-load-balancing/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-elastic-load-balancing/protocols/Aws_query.ts rename to clients/client-elastic-load-balancing/src/protocols/Aws_query.ts diff --git a/clients/client-elastic-load-balancing/src/runtimeConfig.browser.ts b/clients/client-elastic-load-balancing/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1ca2a2f13621 --- /dev/null +++ b/clients/client-elastic-load-balancing/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticLoadBalancingClientConfig } from "./ElasticLoadBalancingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-load-balancing/runtimeConfig.native.ts b/clients/client-elastic-load-balancing/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elastic-load-balancing/runtimeConfig.native.ts rename to clients/client-elastic-load-balancing/src/runtimeConfig.native.ts diff --git a/clients/client-elastic-load-balancing/runtimeConfig.shared.ts b/clients/client-elastic-load-balancing/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elastic-load-balancing/runtimeConfig.shared.ts rename to clients/client-elastic-load-balancing/src/runtimeConfig.shared.ts diff --git a/clients/client-elastic-load-balancing/src/runtimeConfig.ts b/clients/client-elastic-load-balancing/src/runtimeConfig.ts new file mode 100644 index 000000000000..7515d3ce0c4b --- /dev/null +++ b/clients/client-elastic-load-balancing/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticLoadBalancingClientConfig } from "./ElasticLoadBalancingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-load-balancing/waiters/waitForAnyInstanceInService.ts b/clients/client-elastic-load-balancing/src/waiters/waitForAnyInstanceInService.ts similarity index 100% rename from clients/client-elastic-load-balancing/waiters/waitForAnyInstanceInService.ts rename to clients/client-elastic-load-balancing/src/waiters/waitForAnyInstanceInService.ts diff --git a/clients/client-elastic-load-balancing/tsconfig.es.json b/clients/client-elastic-load-balancing/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elastic-load-balancing/tsconfig.es.json +++ b/clients/client-elastic-load-balancing/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elastic-load-balancing/tsconfig.json b/clients/client-elastic-load-balancing/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elastic-load-balancing/tsconfig.json +++ b/clients/client-elastic-load-balancing/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elastic-load-balancing/tsconfig.types.json b/clients/client-elastic-load-balancing/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elastic-load-balancing/tsconfig.types.json +++ b/clients/client-elastic-load-balancing/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elastic-transcoder/.gitignore b/clients/client-elastic-transcoder/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elastic-transcoder/.gitignore +++ b/clients/client-elastic-transcoder/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elastic-transcoder/package.json b/clients/client-elastic-transcoder/package.json index d9bed0676486..88d9a4075942 100644 --- a/clients/client-elastic-transcoder/package.json +++ b/clients/client-elastic-transcoder/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elastic-transcoder", "repository": { "type": "git", diff --git a/clients/client-elastic-transcoder/runtimeConfig.browser.ts b/clients/client-elastic-transcoder/runtimeConfig.browser.ts deleted file mode 100644 index d75c828f600b..000000000000 --- a/clients/client-elastic-transcoder/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticTranscoderClientConfig } from "./ElasticTranscoderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-transcoder/runtimeConfig.ts b/clients/client-elastic-transcoder/runtimeConfig.ts deleted file mode 100644 index 1d052019b06d..000000000000 --- a/clients/client-elastic-transcoder/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticTranscoderClientConfig } from "./ElasticTranscoderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elastic-transcoder/ElasticTranscoder.ts b/clients/client-elastic-transcoder/src/ElasticTranscoder.ts similarity index 100% rename from clients/client-elastic-transcoder/ElasticTranscoder.ts rename to clients/client-elastic-transcoder/src/ElasticTranscoder.ts diff --git a/clients/client-elastic-transcoder/ElasticTranscoderClient.ts b/clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts similarity index 100% rename from clients/client-elastic-transcoder/ElasticTranscoderClient.ts rename to clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts diff --git a/clients/client-elastic-transcoder/commands/CancelJobCommand.ts b/clients/client-elastic-transcoder/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/CancelJobCommand.ts rename to clients/client-elastic-transcoder/src/commands/CancelJobCommand.ts diff --git a/clients/client-elastic-transcoder/commands/CreateJobCommand.ts b/clients/client-elastic-transcoder/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/CreateJobCommand.ts rename to clients/client-elastic-transcoder/src/commands/CreateJobCommand.ts diff --git a/clients/client-elastic-transcoder/commands/CreatePipelineCommand.ts b/clients/client-elastic-transcoder/src/commands/CreatePipelineCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/CreatePipelineCommand.ts rename to clients/client-elastic-transcoder/src/commands/CreatePipelineCommand.ts diff --git a/clients/client-elastic-transcoder/commands/CreatePresetCommand.ts b/clients/client-elastic-transcoder/src/commands/CreatePresetCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/CreatePresetCommand.ts rename to clients/client-elastic-transcoder/src/commands/CreatePresetCommand.ts diff --git a/clients/client-elastic-transcoder/commands/DeletePipelineCommand.ts b/clients/client-elastic-transcoder/src/commands/DeletePipelineCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/DeletePipelineCommand.ts rename to clients/client-elastic-transcoder/src/commands/DeletePipelineCommand.ts diff --git a/clients/client-elastic-transcoder/commands/DeletePresetCommand.ts b/clients/client-elastic-transcoder/src/commands/DeletePresetCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/DeletePresetCommand.ts rename to clients/client-elastic-transcoder/src/commands/DeletePresetCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ListJobsByPipelineCommand.ts b/clients/client-elastic-transcoder/src/commands/ListJobsByPipelineCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ListJobsByPipelineCommand.ts rename to clients/client-elastic-transcoder/src/commands/ListJobsByPipelineCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ListJobsByStatusCommand.ts b/clients/client-elastic-transcoder/src/commands/ListJobsByStatusCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ListJobsByStatusCommand.ts rename to clients/client-elastic-transcoder/src/commands/ListJobsByStatusCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ListPipelinesCommand.ts b/clients/client-elastic-transcoder/src/commands/ListPipelinesCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ListPipelinesCommand.ts rename to clients/client-elastic-transcoder/src/commands/ListPipelinesCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ListPresetsCommand.ts b/clients/client-elastic-transcoder/src/commands/ListPresetsCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ListPresetsCommand.ts rename to clients/client-elastic-transcoder/src/commands/ListPresetsCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ReadJobCommand.ts b/clients/client-elastic-transcoder/src/commands/ReadJobCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ReadJobCommand.ts rename to clients/client-elastic-transcoder/src/commands/ReadJobCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ReadPipelineCommand.ts b/clients/client-elastic-transcoder/src/commands/ReadPipelineCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ReadPipelineCommand.ts rename to clients/client-elastic-transcoder/src/commands/ReadPipelineCommand.ts diff --git a/clients/client-elastic-transcoder/commands/ReadPresetCommand.ts b/clients/client-elastic-transcoder/src/commands/ReadPresetCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/ReadPresetCommand.ts rename to clients/client-elastic-transcoder/src/commands/ReadPresetCommand.ts diff --git a/clients/client-elastic-transcoder/commands/TestRoleCommand.ts b/clients/client-elastic-transcoder/src/commands/TestRoleCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/TestRoleCommand.ts rename to clients/client-elastic-transcoder/src/commands/TestRoleCommand.ts diff --git a/clients/client-elastic-transcoder/commands/UpdatePipelineCommand.ts b/clients/client-elastic-transcoder/src/commands/UpdatePipelineCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/UpdatePipelineCommand.ts rename to clients/client-elastic-transcoder/src/commands/UpdatePipelineCommand.ts diff --git a/clients/client-elastic-transcoder/commands/UpdatePipelineNotificationsCommand.ts b/clients/client-elastic-transcoder/src/commands/UpdatePipelineNotificationsCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/UpdatePipelineNotificationsCommand.ts rename to clients/client-elastic-transcoder/src/commands/UpdatePipelineNotificationsCommand.ts diff --git a/clients/client-elastic-transcoder/commands/UpdatePipelineStatusCommand.ts b/clients/client-elastic-transcoder/src/commands/UpdatePipelineStatusCommand.ts similarity index 100% rename from clients/client-elastic-transcoder/commands/UpdatePipelineStatusCommand.ts rename to clients/client-elastic-transcoder/src/commands/UpdatePipelineStatusCommand.ts diff --git a/clients/client-elastic-transcoder/endpoints.ts b/clients/client-elastic-transcoder/src/endpoints.ts similarity index 100% rename from clients/client-elastic-transcoder/endpoints.ts rename to clients/client-elastic-transcoder/src/endpoints.ts diff --git a/clients/client-elastic-transcoder/index.ts b/clients/client-elastic-transcoder/src/index.ts similarity index 100% rename from clients/client-elastic-transcoder/index.ts rename to clients/client-elastic-transcoder/src/index.ts diff --git a/clients/client-elastic-transcoder/models/index.ts b/clients/client-elastic-transcoder/src/models/index.ts similarity index 100% rename from clients/client-elastic-transcoder/models/index.ts rename to clients/client-elastic-transcoder/src/models/index.ts diff --git a/clients/client-elastic-transcoder/models/models_0.ts b/clients/client-elastic-transcoder/src/models/models_0.ts similarity index 100% rename from clients/client-elastic-transcoder/models/models_0.ts rename to clients/client-elastic-transcoder/src/models/models_0.ts diff --git a/clients/client-elastic-transcoder/pagination/Interfaces.ts b/clients/client-elastic-transcoder/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elastic-transcoder/pagination/Interfaces.ts rename to clients/client-elastic-transcoder/src/pagination/Interfaces.ts diff --git a/clients/client-elastic-transcoder/pagination/ListJobsByPipelinePaginator.ts b/clients/client-elastic-transcoder/src/pagination/ListJobsByPipelinePaginator.ts similarity index 100% rename from clients/client-elastic-transcoder/pagination/ListJobsByPipelinePaginator.ts rename to clients/client-elastic-transcoder/src/pagination/ListJobsByPipelinePaginator.ts diff --git a/clients/client-elastic-transcoder/pagination/ListJobsByStatusPaginator.ts b/clients/client-elastic-transcoder/src/pagination/ListJobsByStatusPaginator.ts similarity index 100% rename from clients/client-elastic-transcoder/pagination/ListJobsByStatusPaginator.ts rename to clients/client-elastic-transcoder/src/pagination/ListJobsByStatusPaginator.ts diff --git a/clients/client-elastic-transcoder/pagination/ListPipelinesPaginator.ts b/clients/client-elastic-transcoder/src/pagination/ListPipelinesPaginator.ts similarity index 100% rename from clients/client-elastic-transcoder/pagination/ListPipelinesPaginator.ts rename to clients/client-elastic-transcoder/src/pagination/ListPipelinesPaginator.ts diff --git a/clients/client-elastic-transcoder/pagination/ListPresetsPaginator.ts b/clients/client-elastic-transcoder/src/pagination/ListPresetsPaginator.ts similarity index 100% rename from clients/client-elastic-transcoder/pagination/ListPresetsPaginator.ts rename to clients/client-elastic-transcoder/src/pagination/ListPresetsPaginator.ts diff --git a/clients/client-elastic-transcoder/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-elastic-transcoder/protocols/Aws_restJson1.ts rename to clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts diff --git a/clients/client-elastic-transcoder/src/runtimeConfig.browser.ts b/clients/client-elastic-transcoder/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..dd71dc63d65c --- /dev/null +++ b/clients/client-elastic-transcoder/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticTranscoderClientConfig } from "./ElasticTranscoderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-transcoder/runtimeConfig.native.ts b/clients/client-elastic-transcoder/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elastic-transcoder/runtimeConfig.native.ts rename to clients/client-elastic-transcoder/src/runtimeConfig.native.ts diff --git a/clients/client-elastic-transcoder/runtimeConfig.shared.ts b/clients/client-elastic-transcoder/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elastic-transcoder/runtimeConfig.shared.ts rename to clients/client-elastic-transcoder/src/runtimeConfig.shared.ts diff --git a/clients/client-elastic-transcoder/src/runtimeConfig.ts b/clients/client-elastic-transcoder/src/runtimeConfig.ts new file mode 100644 index 000000000000..2e3a24673d4b --- /dev/null +++ b/clients/client-elastic-transcoder/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticTranscoderClientConfig } from "./ElasticTranscoderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elastic-transcoder/waiters/waitForJobComplete.ts b/clients/client-elastic-transcoder/src/waiters/waitForJobComplete.ts similarity index 100% rename from clients/client-elastic-transcoder/waiters/waitForJobComplete.ts rename to clients/client-elastic-transcoder/src/waiters/waitForJobComplete.ts diff --git a/clients/client-elastic-transcoder/tsconfig.es.json b/clients/client-elastic-transcoder/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elastic-transcoder/tsconfig.es.json +++ b/clients/client-elastic-transcoder/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elastic-transcoder/tsconfig.json b/clients/client-elastic-transcoder/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elastic-transcoder/tsconfig.json +++ b/clients/client-elastic-transcoder/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elastic-transcoder/tsconfig.types.json b/clients/client-elastic-transcoder/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elastic-transcoder/tsconfig.types.json +++ b/clients/client-elastic-transcoder/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elasticache/.gitignore b/clients/client-elasticache/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elasticache/.gitignore +++ b/clients/client-elasticache/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elasticache/package.json b/clients/client-elasticache/package.json index 98a7952b9362..f5cb87d0c24f 100644 --- a/clients/client-elasticache/package.json +++ b/clients/client-elasticache/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elasticache", "repository": { "type": "git", diff --git a/clients/client-elasticache/runtimeConfig.browser.ts b/clients/client-elasticache/runtimeConfig.browser.ts deleted file mode 100644 index 4a8506688331..000000000000 --- a/clients/client-elasticache/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElastiCacheClientConfig } from "./ElastiCacheClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elasticache/runtimeConfig.ts b/clients/client-elasticache/runtimeConfig.ts deleted file mode 100644 index eabd5ca8552d..000000000000 --- a/clients/client-elasticache/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElastiCacheClientConfig } from "./ElastiCacheClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elasticache/ElastiCache.ts b/clients/client-elasticache/src/ElastiCache.ts similarity index 100% rename from clients/client-elasticache/ElastiCache.ts rename to clients/client-elasticache/src/ElastiCache.ts diff --git a/clients/client-elasticache/ElastiCacheClient.ts b/clients/client-elasticache/src/ElastiCacheClient.ts similarity index 100% rename from clients/client-elasticache/ElastiCacheClient.ts rename to clients/client-elasticache/src/ElastiCacheClient.ts diff --git a/clients/client-elasticache/commands/AddTagsToResourceCommand.ts b/clients/client-elasticache/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-elasticache/commands/AddTagsToResourceCommand.ts rename to clients/client-elasticache/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-elasticache/commands/AuthorizeCacheSecurityGroupIngressCommand.ts b/clients/client-elasticache/src/commands/AuthorizeCacheSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-elasticache/commands/AuthorizeCacheSecurityGroupIngressCommand.ts rename to clients/client-elasticache/src/commands/AuthorizeCacheSecurityGroupIngressCommand.ts diff --git a/clients/client-elasticache/commands/BatchApplyUpdateActionCommand.ts b/clients/client-elasticache/src/commands/BatchApplyUpdateActionCommand.ts similarity index 100% rename from clients/client-elasticache/commands/BatchApplyUpdateActionCommand.ts rename to clients/client-elasticache/src/commands/BatchApplyUpdateActionCommand.ts diff --git a/clients/client-elasticache/commands/BatchStopUpdateActionCommand.ts b/clients/client-elasticache/src/commands/BatchStopUpdateActionCommand.ts similarity index 100% rename from clients/client-elasticache/commands/BatchStopUpdateActionCommand.ts rename to clients/client-elasticache/src/commands/BatchStopUpdateActionCommand.ts diff --git a/clients/client-elasticache/commands/CompleteMigrationCommand.ts b/clients/client-elasticache/src/commands/CompleteMigrationCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CompleteMigrationCommand.ts rename to clients/client-elasticache/src/commands/CompleteMigrationCommand.ts diff --git a/clients/client-elasticache/commands/CopySnapshotCommand.ts b/clients/client-elasticache/src/commands/CopySnapshotCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CopySnapshotCommand.ts rename to clients/client-elasticache/src/commands/CopySnapshotCommand.ts diff --git a/clients/client-elasticache/commands/CreateCacheClusterCommand.ts b/clients/client-elasticache/src/commands/CreateCacheClusterCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateCacheClusterCommand.ts rename to clients/client-elasticache/src/commands/CreateCacheClusterCommand.ts diff --git a/clients/client-elasticache/commands/CreateCacheParameterGroupCommand.ts b/clients/client-elasticache/src/commands/CreateCacheParameterGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateCacheParameterGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateCacheParameterGroupCommand.ts diff --git a/clients/client-elasticache/commands/CreateCacheSecurityGroupCommand.ts b/clients/client-elasticache/src/commands/CreateCacheSecurityGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateCacheSecurityGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateCacheSecurityGroupCommand.ts diff --git a/clients/client-elasticache/commands/CreateCacheSubnetGroupCommand.ts b/clients/client-elasticache/src/commands/CreateCacheSubnetGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateCacheSubnetGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateCacheSubnetGroupCommand.ts diff --git a/clients/client-elasticache/commands/CreateGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/CreateGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/CreateReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/CreateReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/CreateSnapshotCommand.ts b/clients/client-elasticache/src/commands/CreateSnapshotCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateSnapshotCommand.ts rename to clients/client-elasticache/src/commands/CreateSnapshotCommand.ts diff --git a/clients/client-elasticache/commands/CreateUserCommand.ts b/clients/client-elasticache/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateUserCommand.ts rename to clients/client-elasticache/src/commands/CreateUserCommand.ts diff --git a/clients/client-elasticache/commands/CreateUserGroupCommand.ts b/clients/client-elasticache/src/commands/CreateUserGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/CreateUserGroupCommand.ts rename to clients/client-elasticache/src/commands/CreateUserGroupCommand.ts diff --git a/clients/client-elasticache/commands/DecreaseNodeGroupsInGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/DecreaseNodeGroupsInGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DecreaseNodeGroupsInGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/DecreaseNodeGroupsInGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/DecreaseReplicaCountCommand.ts b/clients/client-elasticache/src/commands/DecreaseReplicaCountCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DecreaseReplicaCountCommand.ts rename to clients/client-elasticache/src/commands/DecreaseReplicaCountCommand.ts diff --git a/clients/client-elasticache/commands/DeleteCacheClusterCommand.ts b/clients/client-elasticache/src/commands/DeleteCacheClusterCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteCacheClusterCommand.ts rename to clients/client-elasticache/src/commands/DeleteCacheClusterCommand.ts diff --git a/clients/client-elasticache/commands/DeleteCacheParameterGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteCacheParameterGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteCacheParameterGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteCacheParameterGroupCommand.ts diff --git a/clients/client-elasticache/commands/DeleteCacheSecurityGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteCacheSecurityGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteCacheSecurityGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteCacheSecurityGroupCommand.ts diff --git a/clients/client-elasticache/commands/DeleteCacheSubnetGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteCacheSubnetGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteCacheSubnetGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteCacheSubnetGroupCommand.ts diff --git a/clients/client-elasticache/commands/DeleteGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/DeleteReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/DeleteSnapshotCommand.ts b/clients/client-elasticache/src/commands/DeleteSnapshotCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteSnapshotCommand.ts rename to clients/client-elasticache/src/commands/DeleteSnapshotCommand.ts diff --git a/clients/client-elasticache/commands/DeleteUserCommand.ts b/clients/client-elasticache/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteUserCommand.ts rename to clients/client-elasticache/src/commands/DeleteUserCommand.ts diff --git a/clients/client-elasticache/commands/DeleteUserGroupCommand.ts b/clients/client-elasticache/src/commands/DeleteUserGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DeleteUserGroupCommand.ts rename to clients/client-elasticache/src/commands/DeleteUserGroupCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheClustersCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheClustersCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheClustersCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheClustersCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheEngineVersionsCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheEngineVersionsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheEngineVersionsCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheEngineVersionsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheParameterGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheParameterGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheParameterGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheParameterGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheParametersCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheParametersCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheParametersCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheParametersCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheSecurityGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheSecurityGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheSecurityGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheSecurityGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeCacheSubnetGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeCacheSubnetGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeCacheSubnetGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeCacheSubnetGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeEngineDefaultParametersCommand.ts b/clients/client-elasticache/src/commands/DescribeEngineDefaultParametersCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeEngineDefaultParametersCommand.ts rename to clients/client-elasticache/src/commands/DescribeEngineDefaultParametersCommand.ts diff --git a/clients/client-elasticache/commands/DescribeEventsCommand.ts b/clients/client-elasticache/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeEventsCommand.ts rename to clients/client-elasticache/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeGlobalReplicationGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeGlobalReplicationGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeGlobalReplicationGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeGlobalReplicationGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeReplicationGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeReplicationGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeReplicationGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeReplicationGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeReservedCacheNodesCommand.ts b/clients/client-elasticache/src/commands/DescribeReservedCacheNodesCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeReservedCacheNodesCommand.ts rename to clients/client-elasticache/src/commands/DescribeReservedCacheNodesCommand.ts diff --git a/clients/client-elasticache/commands/DescribeReservedCacheNodesOfferingsCommand.ts b/clients/client-elasticache/src/commands/DescribeReservedCacheNodesOfferingsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeReservedCacheNodesOfferingsCommand.ts rename to clients/client-elasticache/src/commands/DescribeReservedCacheNodesOfferingsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeServiceUpdatesCommand.ts b/clients/client-elasticache/src/commands/DescribeServiceUpdatesCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeServiceUpdatesCommand.ts rename to clients/client-elasticache/src/commands/DescribeServiceUpdatesCommand.ts diff --git a/clients/client-elasticache/commands/DescribeSnapshotsCommand.ts b/clients/client-elasticache/src/commands/DescribeSnapshotsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeSnapshotsCommand.ts rename to clients/client-elasticache/src/commands/DescribeSnapshotsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeUpdateActionsCommand.ts b/clients/client-elasticache/src/commands/DescribeUpdateActionsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeUpdateActionsCommand.ts rename to clients/client-elasticache/src/commands/DescribeUpdateActionsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeUserGroupsCommand.ts b/clients/client-elasticache/src/commands/DescribeUserGroupsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeUserGroupsCommand.ts rename to clients/client-elasticache/src/commands/DescribeUserGroupsCommand.ts diff --git a/clients/client-elasticache/commands/DescribeUsersCommand.ts b/clients/client-elasticache/src/commands/DescribeUsersCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DescribeUsersCommand.ts rename to clients/client-elasticache/src/commands/DescribeUsersCommand.ts diff --git a/clients/client-elasticache/commands/DisassociateGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/DisassociateGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/DisassociateGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/DisassociateGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/FailoverGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/FailoverGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/FailoverGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/FailoverGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/IncreaseNodeGroupsInGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/IncreaseNodeGroupsInGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/IncreaseNodeGroupsInGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/IncreaseNodeGroupsInGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/IncreaseReplicaCountCommand.ts b/clients/client-elasticache/src/commands/IncreaseReplicaCountCommand.ts similarity index 100% rename from clients/client-elasticache/commands/IncreaseReplicaCountCommand.ts rename to clients/client-elasticache/src/commands/IncreaseReplicaCountCommand.ts diff --git a/clients/client-elasticache/commands/ListAllowedNodeTypeModificationsCommand.ts b/clients/client-elasticache/src/commands/ListAllowedNodeTypeModificationsCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ListAllowedNodeTypeModificationsCommand.ts rename to clients/client-elasticache/src/commands/ListAllowedNodeTypeModificationsCommand.ts diff --git a/clients/client-elasticache/commands/ListTagsForResourceCommand.ts b/clients/client-elasticache/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ListTagsForResourceCommand.ts rename to clients/client-elasticache/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-elasticache/commands/ModifyCacheClusterCommand.ts b/clients/client-elasticache/src/commands/ModifyCacheClusterCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyCacheClusterCommand.ts rename to clients/client-elasticache/src/commands/ModifyCacheClusterCommand.ts diff --git a/clients/client-elasticache/commands/ModifyCacheParameterGroupCommand.ts b/clients/client-elasticache/src/commands/ModifyCacheParameterGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyCacheParameterGroupCommand.ts rename to clients/client-elasticache/src/commands/ModifyCacheParameterGroupCommand.ts diff --git a/clients/client-elasticache/commands/ModifyCacheSubnetGroupCommand.ts b/clients/client-elasticache/src/commands/ModifyCacheSubnetGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyCacheSubnetGroupCommand.ts rename to clients/client-elasticache/src/commands/ModifyCacheSubnetGroupCommand.ts diff --git a/clients/client-elasticache/commands/ModifyGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/ModifyGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/ModifyGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/ModifyReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/ModifyReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/ModifyReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/ModifyReplicationGroupShardConfigurationCommand.ts b/clients/client-elasticache/src/commands/ModifyReplicationGroupShardConfigurationCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyReplicationGroupShardConfigurationCommand.ts rename to clients/client-elasticache/src/commands/ModifyReplicationGroupShardConfigurationCommand.ts diff --git a/clients/client-elasticache/commands/ModifyUserCommand.ts b/clients/client-elasticache/src/commands/ModifyUserCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyUserCommand.ts rename to clients/client-elasticache/src/commands/ModifyUserCommand.ts diff --git a/clients/client-elasticache/commands/ModifyUserGroupCommand.ts b/clients/client-elasticache/src/commands/ModifyUserGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ModifyUserGroupCommand.ts rename to clients/client-elasticache/src/commands/ModifyUserGroupCommand.ts diff --git a/clients/client-elasticache/commands/PurchaseReservedCacheNodesOfferingCommand.ts b/clients/client-elasticache/src/commands/PurchaseReservedCacheNodesOfferingCommand.ts similarity index 100% rename from clients/client-elasticache/commands/PurchaseReservedCacheNodesOfferingCommand.ts rename to clients/client-elasticache/src/commands/PurchaseReservedCacheNodesOfferingCommand.ts diff --git a/clients/client-elasticache/commands/RebalanceSlotsInGlobalReplicationGroupCommand.ts b/clients/client-elasticache/src/commands/RebalanceSlotsInGlobalReplicationGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/RebalanceSlotsInGlobalReplicationGroupCommand.ts rename to clients/client-elasticache/src/commands/RebalanceSlotsInGlobalReplicationGroupCommand.ts diff --git a/clients/client-elasticache/commands/RebootCacheClusterCommand.ts b/clients/client-elasticache/src/commands/RebootCacheClusterCommand.ts similarity index 100% rename from clients/client-elasticache/commands/RebootCacheClusterCommand.ts rename to clients/client-elasticache/src/commands/RebootCacheClusterCommand.ts diff --git a/clients/client-elasticache/commands/RemoveTagsFromResourceCommand.ts b/clients/client-elasticache/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-elasticache/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-elasticache/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-elasticache/commands/ResetCacheParameterGroupCommand.ts b/clients/client-elasticache/src/commands/ResetCacheParameterGroupCommand.ts similarity index 100% rename from clients/client-elasticache/commands/ResetCacheParameterGroupCommand.ts rename to clients/client-elasticache/src/commands/ResetCacheParameterGroupCommand.ts diff --git a/clients/client-elasticache/commands/RevokeCacheSecurityGroupIngressCommand.ts b/clients/client-elasticache/src/commands/RevokeCacheSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-elasticache/commands/RevokeCacheSecurityGroupIngressCommand.ts rename to clients/client-elasticache/src/commands/RevokeCacheSecurityGroupIngressCommand.ts diff --git a/clients/client-elasticache/commands/StartMigrationCommand.ts b/clients/client-elasticache/src/commands/StartMigrationCommand.ts similarity index 100% rename from clients/client-elasticache/commands/StartMigrationCommand.ts rename to clients/client-elasticache/src/commands/StartMigrationCommand.ts diff --git a/clients/client-elasticache/commands/TestFailoverCommand.ts b/clients/client-elasticache/src/commands/TestFailoverCommand.ts similarity index 100% rename from clients/client-elasticache/commands/TestFailoverCommand.ts rename to clients/client-elasticache/src/commands/TestFailoverCommand.ts diff --git a/clients/client-elasticache/endpoints.ts b/clients/client-elasticache/src/endpoints.ts similarity index 100% rename from clients/client-elasticache/endpoints.ts rename to clients/client-elasticache/src/endpoints.ts diff --git a/clients/client-elasticache/index.ts b/clients/client-elasticache/src/index.ts similarity index 100% rename from clients/client-elasticache/index.ts rename to clients/client-elasticache/src/index.ts diff --git a/clients/client-elasticache/models/index.ts b/clients/client-elasticache/src/models/index.ts similarity index 100% rename from clients/client-elasticache/models/index.ts rename to clients/client-elasticache/src/models/index.ts diff --git a/clients/client-elasticache/models/models_0.ts b/clients/client-elasticache/src/models/models_0.ts similarity index 100% rename from clients/client-elasticache/models/models_0.ts rename to clients/client-elasticache/src/models/models_0.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheClustersPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheClustersPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheClustersPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheClustersPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheEngineVersionsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheEngineVersionsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheEngineVersionsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheEngineVersionsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheParameterGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheParameterGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheParameterGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheParameterGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheParametersPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheParametersPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheParametersPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheParametersPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheSecurityGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheSecurityGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheSecurityGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeCacheSubnetGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeCacheSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeCacheSubnetGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeCacheSubnetGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeEngineDefaultParametersPaginator.ts b/clients/client-elasticache/src/pagination/DescribeEngineDefaultParametersPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeEngineDefaultParametersPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeEngineDefaultParametersPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeEventsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeEventsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeGlobalReplicationGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeGlobalReplicationGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeGlobalReplicationGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeGlobalReplicationGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeReplicationGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeReplicationGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeReplicationGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeReplicationGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeReservedCacheNodesOfferingsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeReservedCacheNodesPaginator.ts b/clients/client-elasticache/src/pagination/DescribeReservedCacheNodesPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeReservedCacheNodesPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeReservedCacheNodesPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeServiceUpdatesPaginator.ts b/clients/client-elasticache/src/pagination/DescribeServiceUpdatesPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeServiceUpdatesPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeServiceUpdatesPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeSnapshotsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeSnapshotsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeSnapshotsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeSnapshotsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeUpdateActionsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeUpdateActionsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeUpdateActionsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeUpdateActionsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeUserGroupsPaginator.ts b/clients/client-elasticache/src/pagination/DescribeUserGroupsPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeUserGroupsPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeUserGroupsPaginator.ts diff --git a/clients/client-elasticache/pagination/DescribeUsersPaginator.ts b/clients/client-elasticache/src/pagination/DescribeUsersPaginator.ts similarity index 100% rename from clients/client-elasticache/pagination/DescribeUsersPaginator.ts rename to clients/client-elasticache/src/pagination/DescribeUsersPaginator.ts diff --git a/clients/client-elasticache/pagination/Interfaces.ts b/clients/client-elasticache/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elasticache/pagination/Interfaces.ts rename to clients/client-elasticache/src/pagination/Interfaces.ts diff --git a/clients/client-elasticache/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-elasticache/protocols/Aws_query.ts rename to clients/client-elasticache/src/protocols/Aws_query.ts diff --git a/clients/client-elasticache/src/runtimeConfig.browser.ts b/clients/client-elasticache/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..373174162040 --- /dev/null +++ b/clients/client-elasticache/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElastiCacheClientConfig } from "./ElastiCacheClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elasticache/runtimeConfig.native.ts b/clients/client-elasticache/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elasticache/runtimeConfig.native.ts rename to clients/client-elasticache/src/runtimeConfig.native.ts diff --git a/clients/client-elasticache/runtimeConfig.shared.ts b/clients/client-elasticache/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elasticache/runtimeConfig.shared.ts rename to clients/client-elasticache/src/runtimeConfig.shared.ts diff --git a/clients/client-elasticache/src/runtimeConfig.ts b/clients/client-elasticache/src/runtimeConfig.ts new file mode 100644 index 000000000000..e663609260a1 --- /dev/null +++ b/clients/client-elasticache/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElastiCacheClientConfig } from "./ElastiCacheClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elasticache/waiters/waitForCacheClusterAvailable.ts b/clients/client-elasticache/src/waiters/waitForCacheClusterAvailable.ts similarity index 100% rename from clients/client-elasticache/waiters/waitForCacheClusterAvailable.ts rename to clients/client-elasticache/src/waiters/waitForCacheClusterAvailable.ts diff --git a/clients/client-elasticache/waiters/waitForCacheClusterDeleted.ts b/clients/client-elasticache/src/waiters/waitForCacheClusterDeleted.ts similarity index 100% rename from clients/client-elasticache/waiters/waitForCacheClusterDeleted.ts rename to clients/client-elasticache/src/waiters/waitForCacheClusterDeleted.ts diff --git a/clients/client-elasticache/waiters/waitForReplicationGroupAvailable.ts b/clients/client-elasticache/src/waiters/waitForReplicationGroupAvailable.ts similarity index 100% rename from clients/client-elasticache/waiters/waitForReplicationGroupAvailable.ts rename to clients/client-elasticache/src/waiters/waitForReplicationGroupAvailable.ts diff --git a/clients/client-elasticache/waiters/waitForReplicationGroupDeleted.ts b/clients/client-elasticache/src/waiters/waitForReplicationGroupDeleted.ts similarity index 100% rename from clients/client-elasticache/waiters/waitForReplicationGroupDeleted.ts rename to clients/client-elasticache/src/waiters/waitForReplicationGroupDeleted.ts diff --git a/clients/client-elasticache/tsconfig.es.json b/clients/client-elasticache/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elasticache/tsconfig.es.json +++ b/clients/client-elasticache/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elasticache/tsconfig.json b/clients/client-elasticache/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elasticache/tsconfig.json +++ b/clients/client-elasticache/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elasticache/tsconfig.types.json b/clients/client-elasticache/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elasticache/tsconfig.types.json +++ b/clients/client-elasticache/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-elasticsearch-service/.gitignore b/clients/client-elasticsearch-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-elasticsearch-service/.gitignore +++ b/clients/client-elasticsearch-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-elasticsearch-service/package.json b/clients/client-elasticsearch-service/package.json index bf36dce31b55..6018288b2703 100644 --- a/clients/client-elasticsearch-service/package.json +++ b/clients/client-elasticsearch-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-elasticsearch-service", "repository": { "type": "git", diff --git a/clients/client-elasticsearch-service/runtimeConfig.browser.ts b/clients/client-elasticsearch-service/runtimeConfig.browser.ts deleted file mode 100644 index 9283ab145029..000000000000 --- a/clients/client-elasticsearch-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ElasticsearchServiceClientConfig } from "./ElasticsearchServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elasticsearch-service/runtimeConfig.ts b/clients/client-elasticsearch-service/runtimeConfig.ts deleted file mode 100644 index 14694afc6bdb..000000000000 --- a/clients/client-elasticsearch-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ElasticsearchServiceClientConfig } from "./ElasticsearchServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-elasticsearch-service/ElasticsearchService.ts b/clients/client-elasticsearch-service/src/ElasticsearchService.ts similarity index 100% rename from clients/client-elasticsearch-service/ElasticsearchService.ts rename to clients/client-elasticsearch-service/src/ElasticsearchService.ts diff --git a/clients/client-elasticsearch-service/ElasticsearchServiceClient.ts b/clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts similarity index 100% rename from clients/client-elasticsearch-service/ElasticsearchServiceClient.ts rename to clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts diff --git a/clients/client-elasticsearch-service/commands/AcceptInboundCrossClusterSearchConnectionCommand.ts b/clients/client-elasticsearch-service/src/commands/AcceptInboundCrossClusterSearchConnectionCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/AcceptInboundCrossClusterSearchConnectionCommand.ts rename to clients/client-elasticsearch-service/src/commands/AcceptInboundCrossClusterSearchConnectionCommand.ts diff --git a/clients/client-elasticsearch-service/commands/AddTagsCommand.ts b/clients/client-elasticsearch-service/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/AddTagsCommand.ts rename to clients/client-elasticsearch-service/src/commands/AddTagsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/AssociatePackageCommand.ts b/clients/client-elasticsearch-service/src/commands/AssociatePackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/AssociatePackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/AssociatePackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/CancelElasticsearchServiceSoftwareUpdateCommand.ts b/clients/client-elasticsearch-service/src/commands/CancelElasticsearchServiceSoftwareUpdateCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/CancelElasticsearchServiceSoftwareUpdateCommand.ts rename to clients/client-elasticsearch-service/src/commands/CancelElasticsearchServiceSoftwareUpdateCommand.ts diff --git a/clients/client-elasticsearch-service/commands/CreateElasticsearchDomainCommand.ts b/clients/client-elasticsearch-service/src/commands/CreateElasticsearchDomainCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/CreateElasticsearchDomainCommand.ts rename to clients/client-elasticsearch-service/src/commands/CreateElasticsearchDomainCommand.ts diff --git a/clients/client-elasticsearch-service/commands/CreateOutboundCrossClusterSearchConnectionCommand.ts b/clients/client-elasticsearch-service/src/commands/CreateOutboundCrossClusterSearchConnectionCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/CreateOutboundCrossClusterSearchConnectionCommand.ts rename to clients/client-elasticsearch-service/src/commands/CreateOutboundCrossClusterSearchConnectionCommand.ts diff --git a/clients/client-elasticsearch-service/commands/CreatePackageCommand.ts b/clients/client-elasticsearch-service/src/commands/CreatePackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/CreatePackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/CreatePackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DeleteElasticsearchDomainCommand.ts b/clients/client-elasticsearch-service/src/commands/DeleteElasticsearchDomainCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DeleteElasticsearchDomainCommand.ts rename to clients/client-elasticsearch-service/src/commands/DeleteElasticsearchDomainCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DeleteElasticsearchServiceRoleCommand.ts b/clients/client-elasticsearch-service/src/commands/DeleteElasticsearchServiceRoleCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DeleteElasticsearchServiceRoleCommand.ts rename to clients/client-elasticsearch-service/src/commands/DeleteElasticsearchServiceRoleCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DeleteInboundCrossClusterSearchConnectionCommand.ts b/clients/client-elasticsearch-service/src/commands/DeleteInboundCrossClusterSearchConnectionCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DeleteInboundCrossClusterSearchConnectionCommand.ts rename to clients/client-elasticsearch-service/src/commands/DeleteInboundCrossClusterSearchConnectionCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DeleteOutboundCrossClusterSearchConnectionCommand.ts b/clients/client-elasticsearch-service/src/commands/DeleteOutboundCrossClusterSearchConnectionCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DeleteOutboundCrossClusterSearchConnectionCommand.ts rename to clients/client-elasticsearch-service/src/commands/DeleteOutboundCrossClusterSearchConnectionCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DeletePackageCommand.ts b/clients/client-elasticsearch-service/src/commands/DeletePackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DeletePackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/DeletePackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeDomainAutoTunesCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeDomainAutoTunesCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeDomainAutoTunesCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeDomainAutoTunesCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainConfigCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainConfigCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainConfigCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainConfigCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainsCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeElasticsearchDomainsCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeElasticsearchDomainsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeElasticsearchInstanceTypeLimitsCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeElasticsearchInstanceTypeLimitsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeElasticsearchInstanceTypeLimitsCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeElasticsearchInstanceTypeLimitsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeInboundCrossClusterSearchConnectionsCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeInboundCrossClusterSearchConnectionsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeInboundCrossClusterSearchConnectionsCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeInboundCrossClusterSearchConnectionsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeOutboundCrossClusterSearchConnectionsCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeOutboundCrossClusterSearchConnectionsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeOutboundCrossClusterSearchConnectionsCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeOutboundCrossClusterSearchConnectionsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribePackagesCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribePackagesCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribePackagesCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribePackagesCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeReservedElasticsearchInstanceOfferingsCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeReservedElasticsearchInstanceOfferingsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeReservedElasticsearchInstanceOfferingsCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeReservedElasticsearchInstanceOfferingsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DescribeReservedElasticsearchInstancesCommand.ts b/clients/client-elasticsearch-service/src/commands/DescribeReservedElasticsearchInstancesCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DescribeReservedElasticsearchInstancesCommand.ts rename to clients/client-elasticsearch-service/src/commands/DescribeReservedElasticsearchInstancesCommand.ts diff --git a/clients/client-elasticsearch-service/commands/DissociatePackageCommand.ts b/clients/client-elasticsearch-service/src/commands/DissociatePackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/DissociatePackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/DissociatePackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/GetCompatibleElasticsearchVersionsCommand.ts b/clients/client-elasticsearch-service/src/commands/GetCompatibleElasticsearchVersionsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/GetCompatibleElasticsearchVersionsCommand.ts rename to clients/client-elasticsearch-service/src/commands/GetCompatibleElasticsearchVersionsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/GetPackageVersionHistoryCommand.ts b/clients/client-elasticsearch-service/src/commands/GetPackageVersionHistoryCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/GetPackageVersionHistoryCommand.ts rename to clients/client-elasticsearch-service/src/commands/GetPackageVersionHistoryCommand.ts diff --git a/clients/client-elasticsearch-service/commands/GetUpgradeHistoryCommand.ts b/clients/client-elasticsearch-service/src/commands/GetUpgradeHistoryCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/GetUpgradeHistoryCommand.ts rename to clients/client-elasticsearch-service/src/commands/GetUpgradeHistoryCommand.ts diff --git a/clients/client-elasticsearch-service/commands/GetUpgradeStatusCommand.ts b/clients/client-elasticsearch-service/src/commands/GetUpgradeStatusCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/GetUpgradeStatusCommand.ts rename to clients/client-elasticsearch-service/src/commands/GetUpgradeStatusCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListDomainNamesCommand.ts b/clients/client-elasticsearch-service/src/commands/ListDomainNamesCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListDomainNamesCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListDomainNamesCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListDomainsForPackageCommand.ts b/clients/client-elasticsearch-service/src/commands/ListDomainsForPackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListDomainsForPackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListDomainsForPackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListElasticsearchInstanceTypesCommand.ts b/clients/client-elasticsearch-service/src/commands/ListElasticsearchInstanceTypesCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListElasticsearchInstanceTypesCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListElasticsearchInstanceTypesCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListElasticsearchVersionsCommand.ts b/clients/client-elasticsearch-service/src/commands/ListElasticsearchVersionsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListElasticsearchVersionsCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListElasticsearchVersionsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListPackagesForDomainCommand.ts b/clients/client-elasticsearch-service/src/commands/ListPackagesForDomainCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListPackagesForDomainCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListPackagesForDomainCommand.ts diff --git a/clients/client-elasticsearch-service/commands/ListTagsCommand.ts b/clients/client-elasticsearch-service/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/ListTagsCommand.ts rename to clients/client-elasticsearch-service/src/commands/ListTagsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/PurchaseReservedElasticsearchInstanceOfferingCommand.ts b/clients/client-elasticsearch-service/src/commands/PurchaseReservedElasticsearchInstanceOfferingCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/PurchaseReservedElasticsearchInstanceOfferingCommand.ts rename to clients/client-elasticsearch-service/src/commands/PurchaseReservedElasticsearchInstanceOfferingCommand.ts diff --git a/clients/client-elasticsearch-service/commands/RejectInboundCrossClusterSearchConnectionCommand.ts b/clients/client-elasticsearch-service/src/commands/RejectInboundCrossClusterSearchConnectionCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/RejectInboundCrossClusterSearchConnectionCommand.ts rename to clients/client-elasticsearch-service/src/commands/RejectInboundCrossClusterSearchConnectionCommand.ts diff --git a/clients/client-elasticsearch-service/commands/RemoveTagsCommand.ts b/clients/client-elasticsearch-service/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/RemoveTagsCommand.ts rename to clients/client-elasticsearch-service/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-elasticsearch-service/commands/StartElasticsearchServiceSoftwareUpdateCommand.ts b/clients/client-elasticsearch-service/src/commands/StartElasticsearchServiceSoftwareUpdateCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/StartElasticsearchServiceSoftwareUpdateCommand.ts rename to clients/client-elasticsearch-service/src/commands/StartElasticsearchServiceSoftwareUpdateCommand.ts diff --git a/clients/client-elasticsearch-service/commands/UpdateElasticsearchDomainConfigCommand.ts b/clients/client-elasticsearch-service/src/commands/UpdateElasticsearchDomainConfigCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/UpdateElasticsearchDomainConfigCommand.ts rename to clients/client-elasticsearch-service/src/commands/UpdateElasticsearchDomainConfigCommand.ts diff --git a/clients/client-elasticsearch-service/commands/UpdatePackageCommand.ts b/clients/client-elasticsearch-service/src/commands/UpdatePackageCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/UpdatePackageCommand.ts rename to clients/client-elasticsearch-service/src/commands/UpdatePackageCommand.ts diff --git a/clients/client-elasticsearch-service/commands/UpgradeElasticsearchDomainCommand.ts b/clients/client-elasticsearch-service/src/commands/UpgradeElasticsearchDomainCommand.ts similarity index 100% rename from clients/client-elasticsearch-service/commands/UpgradeElasticsearchDomainCommand.ts rename to clients/client-elasticsearch-service/src/commands/UpgradeElasticsearchDomainCommand.ts diff --git a/clients/client-elasticsearch-service/endpoints.ts b/clients/client-elasticsearch-service/src/endpoints.ts similarity index 100% rename from clients/client-elasticsearch-service/endpoints.ts rename to clients/client-elasticsearch-service/src/endpoints.ts diff --git a/clients/client-elasticsearch-service/index.ts b/clients/client-elasticsearch-service/src/index.ts similarity index 100% rename from clients/client-elasticsearch-service/index.ts rename to clients/client-elasticsearch-service/src/index.ts diff --git a/clients/client-elasticsearch-service/models/index.ts b/clients/client-elasticsearch-service/src/models/index.ts similarity index 100% rename from clients/client-elasticsearch-service/models/index.ts rename to clients/client-elasticsearch-service/src/models/index.ts diff --git a/clients/client-elasticsearch-service/models/models_0.ts b/clients/client-elasticsearch-service/src/models/models_0.ts similarity index 100% rename from clients/client-elasticsearch-service/models/models_0.ts rename to clients/client-elasticsearch-service/src/models/models_0.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribeDomainAutoTunesPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribeDomainAutoTunesPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribeDomainAutoTunesPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribeDomainAutoTunesPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribeInboundCrossClusterSearchConnectionsPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribeOutboundCrossClusterSearchConnectionsPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribePackagesPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribePackagesPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribePackagesPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribePackagesPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribeReservedElasticsearchInstanceOfferingsPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstancesPaginator.ts b/clients/client-elasticsearch-service/src/pagination/DescribeReservedElasticsearchInstancesPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/DescribeReservedElasticsearchInstancesPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/DescribeReservedElasticsearchInstancesPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/GetPackageVersionHistoryPaginator.ts b/clients/client-elasticsearch-service/src/pagination/GetPackageVersionHistoryPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/GetPackageVersionHistoryPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/GetPackageVersionHistoryPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/GetUpgradeHistoryPaginator.ts b/clients/client-elasticsearch-service/src/pagination/GetUpgradeHistoryPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/GetUpgradeHistoryPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/GetUpgradeHistoryPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/Interfaces.ts b/clients/client-elasticsearch-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/Interfaces.ts rename to clients/client-elasticsearch-service/src/pagination/Interfaces.ts diff --git a/clients/client-elasticsearch-service/pagination/ListDomainsForPackagePaginator.ts b/clients/client-elasticsearch-service/src/pagination/ListDomainsForPackagePaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/ListDomainsForPackagePaginator.ts rename to clients/client-elasticsearch-service/src/pagination/ListDomainsForPackagePaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/ListElasticsearchInstanceTypesPaginator.ts b/clients/client-elasticsearch-service/src/pagination/ListElasticsearchInstanceTypesPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/ListElasticsearchInstanceTypesPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/ListElasticsearchInstanceTypesPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/ListElasticsearchVersionsPaginator.ts b/clients/client-elasticsearch-service/src/pagination/ListElasticsearchVersionsPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/ListElasticsearchVersionsPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/ListElasticsearchVersionsPaginator.ts diff --git a/clients/client-elasticsearch-service/pagination/ListPackagesForDomainPaginator.ts b/clients/client-elasticsearch-service/src/pagination/ListPackagesForDomainPaginator.ts similarity index 100% rename from clients/client-elasticsearch-service/pagination/ListPackagesForDomainPaginator.ts rename to clients/client-elasticsearch-service/src/pagination/ListPackagesForDomainPaginator.ts diff --git a/clients/client-elasticsearch-service/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-elasticsearch-service/protocols/Aws_restJson1.ts rename to clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts diff --git a/clients/client-elasticsearch-service/src/runtimeConfig.browser.ts b/clients/client-elasticsearch-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6153e5c4b50a --- /dev/null +++ b/clients/client-elasticsearch-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ElasticsearchServiceClientConfig } from "./ElasticsearchServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elasticsearch-service/runtimeConfig.native.ts b/clients/client-elasticsearch-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-elasticsearch-service/runtimeConfig.native.ts rename to clients/client-elasticsearch-service/src/runtimeConfig.native.ts diff --git a/clients/client-elasticsearch-service/runtimeConfig.shared.ts b/clients/client-elasticsearch-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-elasticsearch-service/runtimeConfig.shared.ts rename to clients/client-elasticsearch-service/src/runtimeConfig.shared.ts diff --git a/clients/client-elasticsearch-service/src/runtimeConfig.ts b/clients/client-elasticsearch-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..b123dcf2dcd6 --- /dev/null +++ b/clients/client-elasticsearch-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ElasticsearchServiceClientConfig } from "./ElasticsearchServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-elasticsearch-service/tsconfig.es.json b/clients/client-elasticsearch-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-elasticsearch-service/tsconfig.es.json +++ b/clients/client-elasticsearch-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-elasticsearch-service/tsconfig.json b/clients/client-elasticsearch-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-elasticsearch-service/tsconfig.json +++ b/clients/client-elasticsearch-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-elasticsearch-service/tsconfig.types.json b/clients/client-elasticsearch-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-elasticsearch-service/tsconfig.types.json +++ b/clients/client-elasticsearch-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-emr-containers/.gitignore b/clients/client-emr-containers/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-emr-containers/.gitignore +++ b/clients/client-emr-containers/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-emr-containers/package.json b/clients/client-emr-containers/package.json index 9d43dd7f27dc..e93ed4b6f1e6 100644 --- a/clients/client-emr-containers/package.json +++ b/clients/client-emr-containers/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-emr-containers", "repository": { "type": "git", diff --git a/clients/client-emr-containers/runtimeConfig.browser.ts b/clients/client-emr-containers/runtimeConfig.browser.ts deleted file mode 100644 index 95bb711b05e0..000000000000 --- a/clients/client-emr-containers/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EMRContainersClientConfig } from "./EMRContainersClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EMRContainersClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-emr-containers/runtimeConfig.ts b/clients/client-emr-containers/runtimeConfig.ts deleted file mode 100644 index 850f40496389..000000000000 --- a/clients/client-emr-containers/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EMRContainersClientConfig } from "./EMRContainersClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EMRContainersClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-emr-containers/EMRContainers.ts b/clients/client-emr-containers/src/EMRContainers.ts similarity index 100% rename from clients/client-emr-containers/EMRContainers.ts rename to clients/client-emr-containers/src/EMRContainers.ts diff --git a/clients/client-emr-containers/EMRContainersClient.ts b/clients/client-emr-containers/src/EMRContainersClient.ts similarity index 100% rename from clients/client-emr-containers/EMRContainersClient.ts rename to clients/client-emr-containers/src/EMRContainersClient.ts diff --git a/clients/client-emr-containers/commands/CancelJobRunCommand.ts b/clients/client-emr-containers/src/commands/CancelJobRunCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/CancelJobRunCommand.ts rename to clients/client-emr-containers/src/commands/CancelJobRunCommand.ts diff --git a/clients/client-emr-containers/commands/CreateManagedEndpointCommand.ts b/clients/client-emr-containers/src/commands/CreateManagedEndpointCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/CreateManagedEndpointCommand.ts rename to clients/client-emr-containers/src/commands/CreateManagedEndpointCommand.ts diff --git a/clients/client-emr-containers/commands/CreateVirtualClusterCommand.ts b/clients/client-emr-containers/src/commands/CreateVirtualClusterCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/CreateVirtualClusterCommand.ts rename to clients/client-emr-containers/src/commands/CreateVirtualClusterCommand.ts diff --git a/clients/client-emr-containers/commands/DeleteManagedEndpointCommand.ts b/clients/client-emr-containers/src/commands/DeleteManagedEndpointCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/DeleteManagedEndpointCommand.ts rename to clients/client-emr-containers/src/commands/DeleteManagedEndpointCommand.ts diff --git a/clients/client-emr-containers/commands/DeleteVirtualClusterCommand.ts b/clients/client-emr-containers/src/commands/DeleteVirtualClusterCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/DeleteVirtualClusterCommand.ts rename to clients/client-emr-containers/src/commands/DeleteVirtualClusterCommand.ts diff --git a/clients/client-emr-containers/commands/DescribeJobRunCommand.ts b/clients/client-emr-containers/src/commands/DescribeJobRunCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/DescribeJobRunCommand.ts rename to clients/client-emr-containers/src/commands/DescribeJobRunCommand.ts diff --git a/clients/client-emr-containers/commands/DescribeManagedEndpointCommand.ts b/clients/client-emr-containers/src/commands/DescribeManagedEndpointCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/DescribeManagedEndpointCommand.ts rename to clients/client-emr-containers/src/commands/DescribeManagedEndpointCommand.ts diff --git a/clients/client-emr-containers/commands/DescribeVirtualClusterCommand.ts b/clients/client-emr-containers/src/commands/DescribeVirtualClusterCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/DescribeVirtualClusterCommand.ts rename to clients/client-emr-containers/src/commands/DescribeVirtualClusterCommand.ts diff --git a/clients/client-emr-containers/commands/ListJobRunsCommand.ts b/clients/client-emr-containers/src/commands/ListJobRunsCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/ListJobRunsCommand.ts rename to clients/client-emr-containers/src/commands/ListJobRunsCommand.ts diff --git a/clients/client-emr-containers/commands/ListManagedEndpointsCommand.ts b/clients/client-emr-containers/src/commands/ListManagedEndpointsCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/ListManagedEndpointsCommand.ts rename to clients/client-emr-containers/src/commands/ListManagedEndpointsCommand.ts diff --git a/clients/client-emr-containers/commands/ListTagsForResourceCommand.ts b/clients/client-emr-containers/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/ListTagsForResourceCommand.ts rename to clients/client-emr-containers/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-emr-containers/commands/ListVirtualClustersCommand.ts b/clients/client-emr-containers/src/commands/ListVirtualClustersCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/ListVirtualClustersCommand.ts rename to clients/client-emr-containers/src/commands/ListVirtualClustersCommand.ts diff --git a/clients/client-emr-containers/commands/StartJobRunCommand.ts b/clients/client-emr-containers/src/commands/StartJobRunCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/StartJobRunCommand.ts rename to clients/client-emr-containers/src/commands/StartJobRunCommand.ts diff --git a/clients/client-emr-containers/commands/TagResourceCommand.ts b/clients/client-emr-containers/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/TagResourceCommand.ts rename to clients/client-emr-containers/src/commands/TagResourceCommand.ts diff --git a/clients/client-emr-containers/commands/UntagResourceCommand.ts b/clients/client-emr-containers/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-emr-containers/commands/UntagResourceCommand.ts rename to clients/client-emr-containers/src/commands/UntagResourceCommand.ts diff --git a/clients/client-emr-containers/endpoints.ts b/clients/client-emr-containers/src/endpoints.ts similarity index 100% rename from clients/client-emr-containers/endpoints.ts rename to clients/client-emr-containers/src/endpoints.ts diff --git a/clients/client-emr-containers/index.ts b/clients/client-emr-containers/src/index.ts similarity index 100% rename from clients/client-emr-containers/index.ts rename to clients/client-emr-containers/src/index.ts diff --git a/clients/client-emr-containers/models/index.ts b/clients/client-emr-containers/src/models/index.ts similarity index 100% rename from clients/client-emr-containers/models/index.ts rename to clients/client-emr-containers/src/models/index.ts diff --git a/clients/client-emr-containers/models/models_0.ts b/clients/client-emr-containers/src/models/models_0.ts similarity index 100% rename from clients/client-emr-containers/models/models_0.ts rename to clients/client-emr-containers/src/models/models_0.ts diff --git a/clients/client-emr-containers/pagination/Interfaces.ts b/clients/client-emr-containers/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-emr-containers/pagination/Interfaces.ts rename to clients/client-emr-containers/src/pagination/Interfaces.ts diff --git a/clients/client-emr-containers/pagination/ListJobRunsPaginator.ts b/clients/client-emr-containers/src/pagination/ListJobRunsPaginator.ts similarity index 100% rename from clients/client-emr-containers/pagination/ListJobRunsPaginator.ts rename to clients/client-emr-containers/src/pagination/ListJobRunsPaginator.ts diff --git a/clients/client-emr-containers/pagination/ListManagedEndpointsPaginator.ts b/clients/client-emr-containers/src/pagination/ListManagedEndpointsPaginator.ts similarity index 100% rename from clients/client-emr-containers/pagination/ListManagedEndpointsPaginator.ts rename to clients/client-emr-containers/src/pagination/ListManagedEndpointsPaginator.ts diff --git a/clients/client-emr-containers/pagination/ListVirtualClustersPaginator.ts b/clients/client-emr-containers/src/pagination/ListVirtualClustersPaginator.ts similarity index 100% rename from clients/client-emr-containers/pagination/ListVirtualClustersPaginator.ts rename to clients/client-emr-containers/src/pagination/ListVirtualClustersPaginator.ts diff --git a/clients/client-emr-containers/protocols/Aws_restJson1.ts b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-emr-containers/protocols/Aws_restJson1.ts rename to clients/client-emr-containers/src/protocols/Aws_restJson1.ts diff --git a/clients/client-emr-containers/src/runtimeConfig.browser.ts b/clients/client-emr-containers/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..335e849595aa --- /dev/null +++ b/clients/client-emr-containers/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EMRContainersClientConfig } from "./EMRContainersClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EMRContainersClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-emr-containers/runtimeConfig.native.ts b/clients/client-emr-containers/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-emr-containers/runtimeConfig.native.ts rename to clients/client-emr-containers/src/runtimeConfig.native.ts diff --git a/clients/client-emr-containers/runtimeConfig.shared.ts b/clients/client-emr-containers/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-emr-containers/runtimeConfig.shared.ts rename to clients/client-emr-containers/src/runtimeConfig.shared.ts diff --git a/clients/client-emr-containers/src/runtimeConfig.ts b/clients/client-emr-containers/src/runtimeConfig.ts new file mode 100644 index 000000000000..f90034abbb1a --- /dev/null +++ b/clients/client-emr-containers/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EMRContainersClientConfig } from "./EMRContainersClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EMRContainersClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-emr-containers/tsconfig.es.json b/clients/client-emr-containers/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-emr-containers/tsconfig.es.json +++ b/clients/client-emr-containers/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-emr-containers/tsconfig.json b/clients/client-emr-containers/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-emr-containers/tsconfig.json +++ b/clients/client-emr-containers/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-emr-containers/tsconfig.types.json b/clients/client-emr-containers/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-emr-containers/tsconfig.types.json +++ b/clients/client-emr-containers/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-emr/.gitignore b/clients/client-emr/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-emr/.gitignore +++ b/clients/client-emr/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-emr/package.json b/clients/client-emr/package.json index 07f206cf6725..94f2231aa3fe 100644 --- a/clients/client-emr/package.json +++ b/clients/client-emr/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-emr", "repository": { "type": "git", diff --git a/clients/client-emr/runtimeConfig.browser.ts b/clients/client-emr/runtimeConfig.browser.ts deleted file mode 100644 index a4492e5ddc7e..000000000000 --- a/clients/client-emr/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EMRClientConfig } from "./EMRClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EMRClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-emr/runtimeConfig.ts b/clients/client-emr/runtimeConfig.ts deleted file mode 100644 index 0e7aa409efec..000000000000 --- a/clients/client-emr/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EMRClientConfig } from "./EMRClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EMRClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-emr/EMR.ts b/clients/client-emr/src/EMR.ts similarity index 100% rename from clients/client-emr/EMR.ts rename to clients/client-emr/src/EMR.ts diff --git a/clients/client-emr/EMRClient.ts b/clients/client-emr/src/EMRClient.ts similarity index 100% rename from clients/client-emr/EMRClient.ts rename to clients/client-emr/src/EMRClient.ts diff --git a/clients/client-emr/commands/AddInstanceFleetCommand.ts b/clients/client-emr/src/commands/AddInstanceFleetCommand.ts similarity index 100% rename from clients/client-emr/commands/AddInstanceFleetCommand.ts rename to clients/client-emr/src/commands/AddInstanceFleetCommand.ts diff --git a/clients/client-emr/commands/AddInstanceGroupsCommand.ts b/clients/client-emr/src/commands/AddInstanceGroupsCommand.ts similarity index 100% rename from clients/client-emr/commands/AddInstanceGroupsCommand.ts rename to clients/client-emr/src/commands/AddInstanceGroupsCommand.ts diff --git a/clients/client-emr/commands/AddJobFlowStepsCommand.ts b/clients/client-emr/src/commands/AddJobFlowStepsCommand.ts similarity index 100% rename from clients/client-emr/commands/AddJobFlowStepsCommand.ts rename to clients/client-emr/src/commands/AddJobFlowStepsCommand.ts diff --git a/clients/client-emr/commands/AddTagsCommand.ts b/clients/client-emr/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-emr/commands/AddTagsCommand.ts rename to clients/client-emr/src/commands/AddTagsCommand.ts diff --git a/clients/client-emr/commands/CancelStepsCommand.ts b/clients/client-emr/src/commands/CancelStepsCommand.ts similarity index 100% rename from clients/client-emr/commands/CancelStepsCommand.ts rename to clients/client-emr/src/commands/CancelStepsCommand.ts diff --git a/clients/client-emr/commands/CreateSecurityConfigurationCommand.ts b/clients/client-emr/src/commands/CreateSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-emr/commands/CreateSecurityConfigurationCommand.ts rename to clients/client-emr/src/commands/CreateSecurityConfigurationCommand.ts diff --git a/clients/client-emr/commands/CreateStudioCommand.ts b/clients/client-emr/src/commands/CreateStudioCommand.ts similarity index 100% rename from clients/client-emr/commands/CreateStudioCommand.ts rename to clients/client-emr/src/commands/CreateStudioCommand.ts diff --git a/clients/client-emr/commands/CreateStudioSessionMappingCommand.ts b/clients/client-emr/src/commands/CreateStudioSessionMappingCommand.ts similarity index 100% rename from clients/client-emr/commands/CreateStudioSessionMappingCommand.ts rename to clients/client-emr/src/commands/CreateStudioSessionMappingCommand.ts diff --git a/clients/client-emr/commands/DeleteSecurityConfigurationCommand.ts b/clients/client-emr/src/commands/DeleteSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-emr/commands/DeleteSecurityConfigurationCommand.ts rename to clients/client-emr/src/commands/DeleteSecurityConfigurationCommand.ts diff --git a/clients/client-emr/commands/DeleteStudioCommand.ts b/clients/client-emr/src/commands/DeleteStudioCommand.ts similarity index 100% rename from clients/client-emr/commands/DeleteStudioCommand.ts rename to clients/client-emr/src/commands/DeleteStudioCommand.ts diff --git a/clients/client-emr/commands/DeleteStudioSessionMappingCommand.ts b/clients/client-emr/src/commands/DeleteStudioSessionMappingCommand.ts similarity index 100% rename from clients/client-emr/commands/DeleteStudioSessionMappingCommand.ts rename to clients/client-emr/src/commands/DeleteStudioSessionMappingCommand.ts diff --git a/clients/client-emr/commands/DescribeClusterCommand.ts b/clients/client-emr/src/commands/DescribeClusterCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeClusterCommand.ts rename to clients/client-emr/src/commands/DescribeClusterCommand.ts diff --git a/clients/client-emr/commands/DescribeJobFlowsCommand.ts b/clients/client-emr/src/commands/DescribeJobFlowsCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeJobFlowsCommand.ts rename to clients/client-emr/src/commands/DescribeJobFlowsCommand.ts diff --git a/clients/client-emr/commands/DescribeNotebookExecutionCommand.ts b/clients/client-emr/src/commands/DescribeNotebookExecutionCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeNotebookExecutionCommand.ts rename to clients/client-emr/src/commands/DescribeNotebookExecutionCommand.ts diff --git a/clients/client-emr/commands/DescribeReleaseLabelCommand.ts b/clients/client-emr/src/commands/DescribeReleaseLabelCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeReleaseLabelCommand.ts rename to clients/client-emr/src/commands/DescribeReleaseLabelCommand.ts diff --git a/clients/client-emr/commands/DescribeSecurityConfigurationCommand.ts b/clients/client-emr/src/commands/DescribeSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeSecurityConfigurationCommand.ts rename to clients/client-emr/src/commands/DescribeSecurityConfigurationCommand.ts diff --git a/clients/client-emr/commands/DescribeStepCommand.ts b/clients/client-emr/src/commands/DescribeStepCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeStepCommand.ts rename to clients/client-emr/src/commands/DescribeStepCommand.ts diff --git a/clients/client-emr/commands/DescribeStudioCommand.ts b/clients/client-emr/src/commands/DescribeStudioCommand.ts similarity index 100% rename from clients/client-emr/commands/DescribeStudioCommand.ts rename to clients/client-emr/src/commands/DescribeStudioCommand.ts diff --git a/clients/client-emr/commands/GetAutoTerminationPolicyCommand.ts b/clients/client-emr/src/commands/GetAutoTerminationPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/GetAutoTerminationPolicyCommand.ts rename to clients/client-emr/src/commands/GetAutoTerminationPolicyCommand.ts diff --git a/clients/client-emr/commands/GetBlockPublicAccessConfigurationCommand.ts b/clients/client-emr/src/commands/GetBlockPublicAccessConfigurationCommand.ts similarity index 100% rename from clients/client-emr/commands/GetBlockPublicAccessConfigurationCommand.ts rename to clients/client-emr/src/commands/GetBlockPublicAccessConfigurationCommand.ts diff --git a/clients/client-emr/commands/GetManagedScalingPolicyCommand.ts b/clients/client-emr/src/commands/GetManagedScalingPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/GetManagedScalingPolicyCommand.ts rename to clients/client-emr/src/commands/GetManagedScalingPolicyCommand.ts diff --git a/clients/client-emr/commands/GetStudioSessionMappingCommand.ts b/clients/client-emr/src/commands/GetStudioSessionMappingCommand.ts similarity index 100% rename from clients/client-emr/commands/GetStudioSessionMappingCommand.ts rename to clients/client-emr/src/commands/GetStudioSessionMappingCommand.ts diff --git a/clients/client-emr/commands/ListBootstrapActionsCommand.ts b/clients/client-emr/src/commands/ListBootstrapActionsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListBootstrapActionsCommand.ts rename to clients/client-emr/src/commands/ListBootstrapActionsCommand.ts diff --git a/clients/client-emr/commands/ListClustersCommand.ts b/clients/client-emr/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-emr/commands/ListClustersCommand.ts rename to clients/client-emr/src/commands/ListClustersCommand.ts diff --git a/clients/client-emr/commands/ListInstanceFleetsCommand.ts b/clients/client-emr/src/commands/ListInstanceFleetsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListInstanceFleetsCommand.ts rename to clients/client-emr/src/commands/ListInstanceFleetsCommand.ts diff --git a/clients/client-emr/commands/ListInstanceGroupsCommand.ts b/clients/client-emr/src/commands/ListInstanceGroupsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListInstanceGroupsCommand.ts rename to clients/client-emr/src/commands/ListInstanceGroupsCommand.ts diff --git a/clients/client-emr/commands/ListInstancesCommand.ts b/clients/client-emr/src/commands/ListInstancesCommand.ts similarity index 100% rename from clients/client-emr/commands/ListInstancesCommand.ts rename to clients/client-emr/src/commands/ListInstancesCommand.ts diff --git a/clients/client-emr/commands/ListNotebookExecutionsCommand.ts b/clients/client-emr/src/commands/ListNotebookExecutionsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListNotebookExecutionsCommand.ts rename to clients/client-emr/src/commands/ListNotebookExecutionsCommand.ts diff --git a/clients/client-emr/commands/ListReleaseLabelsCommand.ts b/clients/client-emr/src/commands/ListReleaseLabelsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListReleaseLabelsCommand.ts rename to clients/client-emr/src/commands/ListReleaseLabelsCommand.ts diff --git a/clients/client-emr/commands/ListSecurityConfigurationsCommand.ts b/clients/client-emr/src/commands/ListSecurityConfigurationsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListSecurityConfigurationsCommand.ts rename to clients/client-emr/src/commands/ListSecurityConfigurationsCommand.ts diff --git a/clients/client-emr/commands/ListStepsCommand.ts b/clients/client-emr/src/commands/ListStepsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListStepsCommand.ts rename to clients/client-emr/src/commands/ListStepsCommand.ts diff --git a/clients/client-emr/commands/ListStudioSessionMappingsCommand.ts b/clients/client-emr/src/commands/ListStudioSessionMappingsCommand.ts similarity index 100% rename from clients/client-emr/commands/ListStudioSessionMappingsCommand.ts rename to clients/client-emr/src/commands/ListStudioSessionMappingsCommand.ts diff --git a/clients/client-emr/commands/ListStudiosCommand.ts b/clients/client-emr/src/commands/ListStudiosCommand.ts similarity index 100% rename from clients/client-emr/commands/ListStudiosCommand.ts rename to clients/client-emr/src/commands/ListStudiosCommand.ts diff --git a/clients/client-emr/commands/ModifyClusterCommand.ts b/clients/client-emr/src/commands/ModifyClusterCommand.ts similarity index 100% rename from clients/client-emr/commands/ModifyClusterCommand.ts rename to clients/client-emr/src/commands/ModifyClusterCommand.ts diff --git a/clients/client-emr/commands/ModifyInstanceFleetCommand.ts b/clients/client-emr/src/commands/ModifyInstanceFleetCommand.ts similarity index 100% rename from clients/client-emr/commands/ModifyInstanceFleetCommand.ts rename to clients/client-emr/src/commands/ModifyInstanceFleetCommand.ts diff --git a/clients/client-emr/commands/ModifyInstanceGroupsCommand.ts b/clients/client-emr/src/commands/ModifyInstanceGroupsCommand.ts similarity index 100% rename from clients/client-emr/commands/ModifyInstanceGroupsCommand.ts rename to clients/client-emr/src/commands/ModifyInstanceGroupsCommand.ts diff --git a/clients/client-emr/commands/PutAutoScalingPolicyCommand.ts b/clients/client-emr/src/commands/PutAutoScalingPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/PutAutoScalingPolicyCommand.ts rename to clients/client-emr/src/commands/PutAutoScalingPolicyCommand.ts diff --git a/clients/client-emr/commands/PutAutoTerminationPolicyCommand.ts b/clients/client-emr/src/commands/PutAutoTerminationPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/PutAutoTerminationPolicyCommand.ts rename to clients/client-emr/src/commands/PutAutoTerminationPolicyCommand.ts diff --git a/clients/client-emr/commands/PutBlockPublicAccessConfigurationCommand.ts b/clients/client-emr/src/commands/PutBlockPublicAccessConfigurationCommand.ts similarity index 100% rename from clients/client-emr/commands/PutBlockPublicAccessConfigurationCommand.ts rename to clients/client-emr/src/commands/PutBlockPublicAccessConfigurationCommand.ts diff --git a/clients/client-emr/commands/PutManagedScalingPolicyCommand.ts b/clients/client-emr/src/commands/PutManagedScalingPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/PutManagedScalingPolicyCommand.ts rename to clients/client-emr/src/commands/PutManagedScalingPolicyCommand.ts diff --git a/clients/client-emr/commands/RemoveAutoScalingPolicyCommand.ts b/clients/client-emr/src/commands/RemoveAutoScalingPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/RemoveAutoScalingPolicyCommand.ts rename to clients/client-emr/src/commands/RemoveAutoScalingPolicyCommand.ts diff --git a/clients/client-emr/commands/RemoveAutoTerminationPolicyCommand.ts b/clients/client-emr/src/commands/RemoveAutoTerminationPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/RemoveAutoTerminationPolicyCommand.ts rename to clients/client-emr/src/commands/RemoveAutoTerminationPolicyCommand.ts diff --git a/clients/client-emr/commands/RemoveManagedScalingPolicyCommand.ts b/clients/client-emr/src/commands/RemoveManagedScalingPolicyCommand.ts similarity index 100% rename from clients/client-emr/commands/RemoveManagedScalingPolicyCommand.ts rename to clients/client-emr/src/commands/RemoveManagedScalingPolicyCommand.ts diff --git a/clients/client-emr/commands/RemoveTagsCommand.ts b/clients/client-emr/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-emr/commands/RemoveTagsCommand.ts rename to clients/client-emr/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-emr/commands/RunJobFlowCommand.ts b/clients/client-emr/src/commands/RunJobFlowCommand.ts similarity index 100% rename from clients/client-emr/commands/RunJobFlowCommand.ts rename to clients/client-emr/src/commands/RunJobFlowCommand.ts diff --git a/clients/client-emr/commands/SetTerminationProtectionCommand.ts b/clients/client-emr/src/commands/SetTerminationProtectionCommand.ts similarity index 100% rename from clients/client-emr/commands/SetTerminationProtectionCommand.ts rename to clients/client-emr/src/commands/SetTerminationProtectionCommand.ts diff --git a/clients/client-emr/commands/SetVisibleToAllUsersCommand.ts b/clients/client-emr/src/commands/SetVisibleToAllUsersCommand.ts similarity index 100% rename from clients/client-emr/commands/SetVisibleToAllUsersCommand.ts rename to clients/client-emr/src/commands/SetVisibleToAllUsersCommand.ts diff --git a/clients/client-emr/commands/StartNotebookExecutionCommand.ts b/clients/client-emr/src/commands/StartNotebookExecutionCommand.ts similarity index 100% rename from clients/client-emr/commands/StartNotebookExecutionCommand.ts rename to clients/client-emr/src/commands/StartNotebookExecutionCommand.ts diff --git a/clients/client-emr/commands/StopNotebookExecutionCommand.ts b/clients/client-emr/src/commands/StopNotebookExecutionCommand.ts similarity index 100% rename from clients/client-emr/commands/StopNotebookExecutionCommand.ts rename to clients/client-emr/src/commands/StopNotebookExecutionCommand.ts diff --git a/clients/client-emr/commands/TerminateJobFlowsCommand.ts b/clients/client-emr/src/commands/TerminateJobFlowsCommand.ts similarity index 100% rename from clients/client-emr/commands/TerminateJobFlowsCommand.ts rename to clients/client-emr/src/commands/TerminateJobFlowsCommand.ts diff --git a/clients/client-emr/commands/UpdateStudioCommand.ts b/clients/client-emr/src/commands/UpdateStudioCommand.ts similarity index 100% rename from clients/client-emr/commands/UpdateStudioCommand.ts rename to clients/client-emr/src/commands/UpdateStudioCommand.ts diff --git a/clients/client-emr/commands/UpdateStudioSessionMappingCommand.ts b/clients/client-emr/src/commands/UpdateStudioSessionMappingCommand.ts similarity index 100% rename from clients/client-emr/commands/UpdateStudioSessionMappingCommand.ts rename to clients/client-emr/src/commands/UpdateStudioSessionMappingCommand.ts diff --git a/clients/client-emr/endpoints.ts b/clients/client-emr/src/endpoints.ts similarity index 100% rename from clients/client-emr/endpoints.ts rename to clients/client-emr/src/endpoints.ts diff --git a/clients/client-emr/index.ts b/clients/client-emr/src/index.ts similarity index 100% rename from clients/client-emr/index.ts rename to clients/client-emr/src/index.ts diff --git a/clients/client-emr/models/index.ts b/clients/client-emr/src/models/index.ts similarity index 100% rename from clients/client-emr/models/index.ts rename to clients/client-emr/src/models/index.ts diff --git a/clients/client-emr/models/models_0.ts b/clients/client-emr/src/models/models_0.ts similarity index 100% rename from clients/client-emr/models/models_0.ts rename to clients/client-emr/src/models/models_0.ts diff --git a/clients/client-emr/pagination/Interfaces.ts b/clients/client-emr/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-emr/pagination/Interfaces.ts rename to clients/client-emr/src/pagination/Interfaces.ts diff --git a/clients/client-emr/pagination/ListBootstrapActionsPaginator.ts b/clients/client-emr/src/pagination/ListBootstrapActionsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListBootstrapActionsPaginator.ts rename to clients/client-emr/src/pagination/ListBootstrapActionsPaginator.ts diff --git a/clients/client-emr/pagination/ListClustersPaginator.ts b/clients/client-emr/src/pagination/ListClustersPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListClustersPaginator.ts rename to clients/client-emr/src/pagination/ListClustersPaginator.ts diff --git a/clients/client-emr/pagination/ListInstanceFleetsPaginator.ts b/clients/client-emr/src/pagination/ListInstanceFleetsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListInstanceFleetsPaginator.ts rename to clients/client-emr/src/pagination/ListInstanceFleetsPaginator.ts diff --git a/clients/client-emr/pagination/ListInstanceGroupsPaginator.ts b/clients/client-emr/src/pagination/ListInstanceGroupsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListInstanceGroupsPaginator.ts rename to clients/client-emr/src/pagination/ListInstanceGroupsPaginator.ts diff --git a/clients/client-emr/pagination/ListInstancesPaginator.ts b/clients/client-emr/src/pagination/ListInstancesPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListInstancesPaginator.ts rename to clients/client-emr/src/pagination/ListInstancesPaginator.ts diff --git a/clients/client-emr/pagination/ListNotebookExecutionsPaginator.ts b/clients/client-emr/src/pagination/ListNotebookExecutionsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListNotebookExecutionsPaginator.ts rename to clients/client-emr/src/pagination/ListNotebookExecutionsPaginator.ts diff --git a/clients/client-emr/pagination/ListReleaseLabelsPaginator.ts b/clients/client-emr/src/pagination/ListReleaseLabelsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListReleaseLabelsPaginator.ts rename to clients/client-emr/src/pagination/ListReleaseLabelsPaginator.ts diff --git a/clients/client-emr/pagination/ListSecurityConfigurationsPaginator.ts b/clients/client-emr/src/pagination/ListSecurityConfigurationsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListSecurityConfigurationsPaginator.ts rename to clients/client-emr/src/pagination/ListSecurityConfigurationsPaginator.ts diff --git a/clients/client-emr/pagination/ListStepsPaginator.ts b/clients/client-emr/src/pagination/ListStepsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListStepsPaginator.ts rename to clients/client-emr/src/pagination/ListStepsPaginator.ts diff --git a/clients/client-emr/pagination/ListStudioSessionMappingsPaginator.ts b/clients/client-emr/src/pagination/ListStudioSessionMappingsPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListStudioSessionMappingsPaginator.ts rename to clients/client-emr/src/pagination/ListStudioSessionMappingsPaginator.ts diff --git a/clients/client-emr/pagination/ListStudiosPaginator.ts b/clients/client-emr/src/pagination/ListStudiosPaginator.ts similarity index 100% rename from clients/client-emr/pagination/ListStudiosPaginator.ts rename to clients/client-emr/src/pagination/ListStudiosPaginator.ts diff --git a/clients/client-emr/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-emr/protocols/Aws_json1_1.ts rename to clients/client-emr/src/protocols/Aws_json1_1.ts diff --git a/clients/client-emr/src/runtimeConfig.browser.ts b/clients/client-emr/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6c783661d3e4 --- /dev/null +++ b/clients/client-emr/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EMRClientConfig } from "./EMRClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EMRClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-emr/runtimeConfig.native.ts b/clients/client-emr/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-emr/runtimeConfig.native.ts rename to clients/client-emr/src/runtimeConfig.native.ts diff --git a/clients/client-emr/runtimeConfig.shared.ts b/clients/client-emr/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-emr/runtimeConfig.shared.ts rename to clients/client-emr/src/runtimeConfig.shared.ts diff --git a/clients/client-emr/src/runtimeConfig.ts b/clients/client-emr/src/runtimeConfig.ts new file mode 100644 index 000000000000..b5063fa257af --- /dev/null +++ b/clients/client-emr/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EMRClientConfig } from "./EMRClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EMRClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-emr/waiters/waitForClusterRunning.ts b/clients/client-emr/src/waiters/waitForClusterRunning.ts similarity index 100% rename from clients/client-emr/waiters/waitForClusterRunning.ts rename to clients/client-emr/src/waiters/waitForClusterRunning.ts diff --git a/clients/client-emr/waiters/waitForClusterTerminated.ts b/clients/client-emr/src/waiters/waitForClusterTerminated.ts similarity index 100% rename from clients/client-emr/waiters/waitForClusterTerminated.ts rename to clients/client-emr/src/waiters/waitForClusterTerminated.ts diff --git a/clients/client-emr/waiters/waitForStepComplete.ts b/clients/client-emr/src/waiters/waitForStepComplete.ts similarity index 100% rename from clients/client-emr/waiters/waitForStepComplete.ts rename to clients/client-emr/src/waiters/waitForStepComplete.ts diff --git a/clients/client-emr/tsconfig.es.json b/clients/client-emr/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-emr/tsconfig.es.json +++ b/clients/client-emr/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-emr/tsconfig.json b/clients/client-emr/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-emr/tsconfig.json +++ b/clients/client-emr/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-emr/tsconfig.types.json b/clients/client-emr/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-emr/tsconfig.types.json +++ b/clients/client-emr/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-eventbridge/.gitignore b/clients/client-eventbridge/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-eventbridge/.gitignore +++ b/clients/client-eventbridge/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-eventbridge/package.json b/clients/client-eventbridge/package.json index d46daccd3d94..83aa6b737d71 100644 --- a/clients/client-eventbridge/package.json +++ b/clients/client-eventbridge/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-eventbridge", "repository": { "type": "git", diff --git a/clients/client-eventbridge/runtimeConfig.browser.ts b/clients/client-eventbridge/runtimeConfig.browser.ts deleted file mode 100644 index fb98cf2f4295..000000000000 --- a/clients/client-eventbridge/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EventBridgeClientConfig } from "./EventBridgeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EventBridgeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-eventbridge/runtimeConfig.ts b/clients/client-eventbridge/runtimeConfig.ts deleted file mode 100644 index 9b75608430bf..000000000000 --- a/clients/client-eventbridge/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EventBridgeClientConfig } from "./EventBridgeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EventBridgeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-eventbridge/EventBridge.ts b/clients/client-eventbridge/src/EventBridge.ts similarity index 100% rename from clients/client-eventbridge/EventBridge.ts rename to clients/client-eventbridge/src/EventBridge.ts diff --git a/clients/client-eventbridge/EventBridgeClient.ts b/clients/client-eventbridge/src/EventBridgeClient.ts similarity index 100% rename from clients/client-eventbridge/EventBridgeClient.ts rename to clients/client-eventbridge/src/EventBridgeClient.ts diff --git a/clients/client-eventbridge/commands/ActivateEventSourceCommand.ts b/clients/client-eventbridge/src/commands/ActivateEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ActivateEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/ActivateEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/CancelReplayCommand.ts b/clients/client-eventbridge/src/commands/CancelReplayCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CancelReplayCommand.ts rename to clients/client-eventbridge/src/commands/CancelReplayCommand.ts diff --git a/clients/client-eventbridge/commands/CreateApiDestinationCommand.ts b/clients/client-eventbridge/src/commands/CreateApiDestinationCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CreateApiDestinationCommand.ts rename to clients/client-eventbridge/src/commands/CreateApiDestinationCommand.ts diff --git a/clients/client-eventbridge/commands/CreateArchiveCommand.ts b/clients/client-eventbridge/src/commands/CreateArchiveCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CreateArchiveCommand.ts rename to clients/client-eventbridge/src/commands/CreateArchiveCommand.ts diff --git a/clients/client-eventbridge/commands/CreateConnectionCommand.ts b/clients/client-eventbridge/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CreateConnectionCommand.ts rename to clients/client-eventbridge/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-eventbridge/commands/CreateEventBusCommand.ts b/clients/client-eventbridge/src/commands/CreateEventBusCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CreateEventBusCommand.ts rename to clients/client-eventbridge/src/commands/CreateEventBusCommand.ts diff --git a/clients/client-eventbridge/commands/CreatePartnerEventSourceCommand.ts b/clients/client-eventbridge/src/commands/CreatePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/CreatePartnerEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/CreatePartnerEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/DeactivateEventSourceCommand.ts b/clients/client-eventbridge/src/commands/DeactivateEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeactivateEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/DeactivateEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/DeauthorizeConnectionCommand.ts b/clients/client-eventbridge/src/commands/DeauthorizeConnectionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeauthorizeConnectionCommand.ts rename to clients/client-eventbridge/src/commands/DeauthorizeConnectionCommand.ts diff --git a/clients/client-eventbridge/commands/DeleteApiDestinationCommand.ts b/clients/client-eventbridge/src/commands/DeleteApiDestinationCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeleteApiDestinationCommand.ts rename to clients/client-eventbridge/src/commands/DeleteApiDestinationCommand.ts diff --git a/clients/client-eventbridge/commands/DeleteArchiveCommand.ts b/clients/client-eventbridge/src/commands/DeleteArchiveCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeleteArchiveCommand.ts rename to clients/client-eventbridge/src/commands/DeleteArchiveCommand.ts diff --git a/clients/client-eventbridge/commands/DeleteConnectionCommand.ts b/clients/client-eventbridge/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeleteConnectionCommand.ts rename to clients/client-eventbridge/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-eventbridge/commands/DeleteEventBusCommand.ts b/clients/client-eventbridge/src/commands/DeleteEventBusCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeleteEventBusCommand.ts rename to clients/client-eventbridge/src/commands/DeleteEventBusCommand.ts diff --git a/clients/client-eventbridge/commands/DeletePartnerEventSourceCommand.ts b/clients/client-eventbridge/src/commands/DeletePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeletePartnerEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/DeletePartnerEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/DeleteRuleCommand.ts b/clients/client-eventbridge/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DeleteRuleCommand.ts rename to clients/client-eventbridge/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeApiDestinationCommand.ts b/clients/client-eventbridge/src/commands/DescribeApiDestinationCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeApiDestinationCommand.ts rename to clients/client-eventbridge/src/commands/DescribeApiDestinationCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeArchiveCommand.ts b/clients/client-eventbridge/src/commands/DescribeArchiveCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeArchiveCommand.ts rename to clients/client-eventbridge/src/commands/DescribeArchiveCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeConnectionCommand.ts b/clients/client-eventbridge/src/commands/DescribeConnectionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeConnectionCommand.ts rename to clients/client-eventbridge/src/commands/DescribeConnectionCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeEventBusCommand.ts b/clients/client-eventbridge/src/commands/DescribeEventBusCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeEventBusCommand.ts rename to clients/client-eventbridge/src/commands/DescribeEventBusCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeEventSourceCommand.ts b/clients/client-eventbridge/src/commands/DescribeEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/DescribeEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/DescribePartnerEventSourceCommand.ts b/clients/client-eventbridge/src/commands/DescribePartnerEventSourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribePartnerEventSourceCommand.ts rename to clients/client-eventbridge/src/commands/DescribePartnerEventSourceCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeReplayCommand.ts b/clients/client-eventbridge/src/commands/DescribeReplayCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeReplayCommand.ts rename to clients/client-eventbridge/src/commands/DescribeReplayCommand.ts diff --git a/clients/client-eventbridge/commands/DescribeRuleCommand.ts b/clients/client-eventbridge/src/commands/DescribeRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DescribeRuleCommand.ts rename to clients/client-eventbridge/src/commands/DescribeRuleCommand.ts diff --git a/clients/client-eventbridge/commands/DisableRuleCommand.ts b/clients/client-eventbridge/src/commands/DisableRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/DisableRuleCommand.ts rename to clients/client-eventbridge/src/commands/DisableRuleCommand.ts diff --git a/clients/client-eventbridge/commands/EnableRuleCommand.ts b/clients/client-eventbridge/src/commands/EnableRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/EnableRuleCommand.ts rename to clients/client-eventbridge/src/commands/EnableRuleCommand.ts diff --git a/clients/client-eventbridge/commands/ListApiDestinationsCommand.ts b/clients/client-eventbridge/src/commands/ListApiDestinationsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListApiDestinationsCommand.ts rename to clients/client-eventbridge/src/commands/ListApiDestinationsCommand.ts diff --git a/clients/client-eventbridge/commands/ListArchivesCommand.ts b/clients/client-eventbridge/src/commands/ListArchivesCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListArchivesCommand.ts rename to clients/client-eventbridge/src/commands/ListArchivesCommand.ts diff --git a/clients/client-eventbridge/commands/ListConnectionsCommand.ts b/clients/client-eventbridge/src/commands/ListConnectionsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListConnectionsCommand.ts rename to clients/client-eventbridge/src/commands/ListConnectionsCommand.ts diff --git a/clients/client-eventbridge/commands/ListEventBusesCommand.ts b/clients/client-eventbridge/src/commands/ListEventBusesCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListEventBusesCommand.ts rename to clients/client-eventbridge/src/commands/ListEventBusesCommand.ts diff --git a/clients/client-eventbridge/commands/ListEventSourcesCommand.ts b/clients/client-eventbridge/src/commands/ListEventSourcesCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListEventSourcesCommand.ts rename to clients/client-eventbridge/src/commands/ListEventSourcesCommand.ts diff --git a/clients/client-eventbridge/commands/ListPartnerEventSourceAccountsCommand.ts b/clients/client-eventbridge/src/commands/ListPartnerEventSourceAccountsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListPartnerEventSourceAccountsCommand.ts rename to clients/client-eventbridge/src/commands/ListPartnerEventSourceAccountsCommand.ts diff --git a/clients/client-eventbridge/commands/ListPartnerEventSourcesCommand.ts b/clients/client-eventbridge/src/commands/ListPartnerEventSourcesCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListPartnerEventSourcesCommand.ts rename to clients/client-eventbridge/src/commands/ListPartnerEventSourcesCommand.ts diff --git a/clients/client-eventbridge/commands/ListReplaysCommand.ts b/clients/client-eventbridge/src/commands/ListReplaysCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListReplaysCommand.ts rename to clients/client-eventbridge/src/commands/ListReplaysCommand.ts diff --git a/clients/client-eventbridge/commands/ListRuleNamesByTargetCommand.ts b/clients/client-eventbridge/src/commands/ListRuleNamesByTargetCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListRuleNamesByTargetCommand.ts rename to clients/client-eventbridge/src/commands/ListRuleNamesByTargetCommand.ts diff --git a/clients/client-eventbridge/commands/ListRulesCommand.ts b/clients/client-eventbridge/src/commands/ListRulesCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListRulesCommand.ts rename to clients/client-eventbridge/src/commands/ListRulesCommand.ts diff --git a/clients/client-eventbridge/commands/ListTagsForResourceCommand.ts b/clients/client-eventbridge/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListTagsForResourceCommand.ts rename to clients/client-eventbridge/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-eventbridge/commands/ListTargetsByRuleCommand.ts b/clients/client-eventbridge/src/commands/ListTargetsByRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/ListTargetsByRuleCommand.ts rename to clients/client-eventbridge/src/commands/ListTargetsByRuleCommand.ts diff --git a/clients/client-eventbridge/commands/PutEventsCommand.ts b/clients/client-eventbridge/src/commands/PutEventsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/PutEventsCommand.ts rename to clients/client-eventbridge/src/commands/PutEventsCommand.ts diff --git a/clients/client-eventbridge/commands/PutPartnerEventsCommand.ts b/clients/client-eventbridge/src/commands/PutPartnerEventsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/PutPartnerEventsCommand.ts rename to clients/client-eventbridge/src/commands/PutPartnerEventsCommand.ts diff --git a/clients/client-eventbridge/commands/PutPermissionCommand.ts b/clients/client-eventbridge/src/commands/PutPermissionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/PutPermissionCommand.ts rename to clients/client-eventbridge/src/commands/PutPermissionCommand.ts diff --git a/clients/client-eventbridge/commands/PutRuleCommand.ts b/clients/client-eventbridge/src/commands/PutRuleCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/PutRuleCommand.ts rename to clients/client-eventbridge/src/commands/PutRuleCommand.ts diff --git a/clients/client-eventbridge/commands/PutTargetsCommand.ts b/clients/client-eventbridge/src/commands/PutTargetsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/PutTargetsCommand.ts rename to clients/client-eventbridge/src/commands/PutTargetsCommand.ts diff --git a/clients/client-eventbridge/commands/RemovePermissionCommand.ts b/clients/client-eventbridge/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/RemovePermissionCommand.ts rename to clients/client-eventbridge/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-eventbridge/commands/RemoveTargetsCommand.ts b/clients/client-eventbridge/src/commands/RemoveTargetsCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/RemoveTargetsCommand.ts rename to clients/client-eventbridge/src/commands/RemoveTargetsCommand.ts diff --git a/clients/client-eventbridge/commands/StartReplayCommand.ts b/clients/client-eventbridge/src/commands/StartReplayCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/StartReplayCommand.ts rename to clients/client-eventbridge/src/commands/StartReplayCommand.ts diff --git a/clients/client-eventbridge/commands/TagResourceCommand.ts b/clients/client-eventbridge/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/TagResourceCommand.ts rename to clients/client-eventbridge/src/commands/TagResourceCommand.ts diff --git a/clients/client-eventbridge/commands/TestEventPatternCommand.ts b/clients/client-eventbridge/src/commands/TestEventPatternCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/TestEventPatternCommand.ts rename to clients/client-eventbridge/src/commands/TestEventPatternCommand.ts diff --git a/clients/client-eventbridge/commands/UntagResourceCommand.ts b/clients/client-eventbridge/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/UntagResourceCommand.ts rename to clients/client-eventbridge/src/commands/UntagResourceCommand.ts diff --git a/clients/client-eventbridge/commands/UpdateApiDestinationCommand.ts b/clients/client-eventbridge/src/commands/UpdateApiDestinationCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/UpdateApiDestinationCommand.ts rename to clients/client-eventbridge/src/commands/UpdateApiDestinationCommand.ts diff --git a/clients/client-eventbridge/commands/UpdateArchiveCommand.ts b/clients/client-eventbridge/src/commands/UpdateArchiveCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/UpdateArchiveCommand.ts rename to clients/client-eventbridge/src/commands/UpdateArchiveCommand.ts diff --git a/clients/client-eventbridge/commands/UpdateConnectionCommand.ts b/clients/client-eventbridge/src/commands/UpdateConnectionCommand.ts similarity index 100% rename from clients/client-eventbridge/commands/UpdateConnectionCommand.ts rename to clients/client-eventbridge/src/commands/UpdateConnectionCommand.ts diff --git a/clients/client-eventbridge/endpoints.ts b/clients/client-eventbridge/src/endpoints.ts similarity index 100% rename from clients/client-eventbridge/endpoints.ts rename to clients/client-eventbridge/src/endpoints.ts diff --git a/clients/client-eventbridge/index.ts b/clients/client-eventbridge/src/index.ts similarity index 100% rename from clients/client-eventbridge/index.ts rename to clients/client-eventbridge/src/index.ts diff --git a/clients/client-eventbridge/models/index.ts b/clients/client-eventbridge/src/models/index.ts similarity index 100% rename from clients/client-eventbridge/models/index.ts rename to clients/client-eventbridge/src/models/index.ts diff --git a/clients/client-eventbridge/models/models_0.ts b/clients/client-eventbridge/src/models/models_0.ts similarity index 100% rename from clients/client-eventbridge/models/models_0.ts rename to clients/client-eventbridge/src/models/models_0.ts diff --git a/clients/client-eventbridge/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-eventbridge/protocols/Aws_json1_1.ts rename to clients/client-eventbridge/src/protocols/Aws_json1_1.ts diff --git a/clients/client-eventbridge/src/runtimeConfig.browser.ts b/clients/client-eventbridge/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b27de2ea867f --- /dev/null +++ b/clients/client-eventbridge/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EventBridgeClientConfig } from "./EventBridgeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EventBridgeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-eventbridge/runtimeConfig.native.ts b/clients/client-eventbridge/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-eventbridge/runtimeConfig.native.ts rename to clients/client-eventbridge/src/runtimeConfig.native.ts diff --git a/clients/client-eventbridge/runtimeConfig.shared.ts b/clients/client-eventbridge/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-eventbridge/runtimeConfig.shared.ts rename to clients/client-eventbridge/src/runtimeConfig.shared.ts diff --git a/clients/client-eventbridge/src/runtimeConfig.ts b/clients/client-eventbridge/src/runtimeConfig.ts new file mode 100644 index 000000000000..d377f6e1e0de --- /dev/null +++ b/clients/client-eventbridge/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EventBridgeClientConfig } from "./EventBridgeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EventBridgeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-eventbridge/tsconfig.es.json b/clients/client-eventbridge/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-eventbridge/tsconfig.es.json +++ b/clients/client-eventbridge/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-eventbridge/tsconfig.json b/clients/client-eventbridge/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-eventbridge/tsconfig.json +++ b/clients/client-eventbridge/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-eventbridge/tsconfig.types.json b/clients/client-eventbridge/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-eventbridge/tsconfig.types.json +++ b/clients/client-eventbridge/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-finspace-data/.gitignore b/clients/client-finspace-data/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-finspace-data/.gitignore +++ b/clients/client-finspace-data/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-finspace-data/package.json b/clients/client-finspace-data/package.json index 239ed77b4282..bc52287e1a3d 100644 --- a/clients/client-finspace-data/package.json +++ b/clients/client-finspace-data/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-finspace-data", "repository": { "type": "git", diff --git a/clients/client-finspace-data/runtimeConfig.browser.ts b/clients/client-finspace-data/runtimeConfig.browser.ts deleted file mode 100644 index 53291d34cdd1..000000000000 --- a/clients/client-finspace-data/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FinspaceDataClientConfig } from "./FinspaceDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-finspace-data/runtimeConfig.ts b/clients/client-finspace-data/runtimeConfig.ts deleted file mode 100644 index 77316e2d5f77..000000000000 --- a/clients/client-finspace-data/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FinspaceDataClientConfig } from "./FinspaceDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-finspace-data/FinspaceData.ts b/clients/client-finspace-data/src/FinspaceData.ts similarity index 100% rename from clients/client-finspace-data/FinspaceData.ts rename to clients/client-finspace-data/src/FinspaceData.ts diff --git a/clients/client-finspace-data/FinspaceDataClient.ts b/clients/client-finspace-data/src/FinspaceDataClient.ts similarity index 100% rename from clients/client-finspace-data/FinspaceDataClient.ts rename to clients/client-finspace-data/src/FinspaceDataClient.ts diff --git a/clients/client-finspace-data/commands/CreateChangesetCommand.ts b/clients/client-finspace-data/src/commands/CreateChangesetCommand.ts similarity index 100% rename from clients/client-finspace-data/commands/CreateChangesetCommand.ts rename to clients/client-finspace-data/src/commands/CreateChangesetCommand.ts diff --git a/clients/client-finspace-data/commands/GetProgrammaticAccessCredentialsCommand.ts b/clients/client-finspace-data/src/commands/GetProgrammaticAccessCredentialsCommand.ts similarity index 100% rename from clients/client-finspace-data/commands/GetProgrammaticAccessCredentialsCommand.ts rename to clients/client-finspace-data/src/commands/GetProgrammaticAccessCredentialsCommand.ts diff --git a/clients/client-finspace-data/commands/GetWorkingLocationCommand.ts b/clients/client-finspace-data/src/commands/GetWorkingLocationCommand.ts similarity index 100% rename from clients/client-finspace-data/commands/GetWorkingLocationCommand.ts rename to clients/client-finspace-data/src/commands/GetWorkingLocationCommand.ts diff --git a/clients/client-finspace-data/endpoints.ts b/clients/client-finspace-data/src/endpoints.ts similarity index 100% rename from clients/client-finspace-data/endpoints.ts rename to clients/client-finspace-data/src/endpoints.ts diff --git a/clients/client-finspace-data/index.ts b/clients/client-finspace-data/src/index.ts similarity index 100% rename from clients/client-finspace-data/index.ts rename to clients/client-finspace-data/src/index.ts diff --git a/clients/client-finspace-data/models/index.ts b/clients/client-finspace-data/src/models/index.ts similarity index 100% rename from clients/client-finspace-data/models/index.ts rename to clients/client-finspace-data/src/models/index.ts diff --git a/clients/client-finspace-data/models/models_0.ts b/clients/client-finspace-data/src/models/models_0.ts similarity index 100% rename from clients/client-finspace-data/models/models_0.ts rename to clients/client-finspace-data/src/models/models_0.ts diff --git a/clients/client-finspace-data/protocols/Aws_restJson1.ts b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-finspace-data/protocols/Aws_restJson1.ts rename to clients/client-finspace-data/src/protocols/Aws_restJson1.ts diff --git a/clients/client-finspace-data/src/runtimeConfig.browser.ts b/clients/client-finspace-data/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4d4d89cb3dd2 --- /dev/null +++ b/clients/client-finspace-data/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FinspaceDataClientConfig } from "./FinspaceDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-finspace-data/runtimeConfig.native.ts b/clients/client-finspace-data/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-finspace-data/runtimeConfig.native.ts rename to clients/client-finspace-data/src/runtimeConfig.native.ts diff --git a/clients/client-finspace-data/runtimeConfig.shared.ts b/clients/client-finspace-data/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-finspace-data/runtimeConfig.shared.ts rename to clients/client-finspace-data/src/runtimeConfig.shared.ts diff --git a/clients/client-finspace-data/src/runtimeConfig.ts b/clients/client-finspace-data/src/runtimeConfig.ts new file mode 100644 index 000000000000..6f563f4e0df4 --- /dev/null +++ b/clients/client-finspace-data/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FinspaceDataClientConfig } from "./FinspaceDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-finspace-data/tsconfig.es.json b/clients/client-finspace-data/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-finspace-data/tsconfig.es.json +++ b/clients/client-finspace-data/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-finspace-data/tsconfig.json b/clients/client-finspace-data/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-finspace-data/tsconfig.json +++ b/clients/client-finspace-data/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-finspace-data/tsconfig.types.json b/clients/client-finspace-data/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-finspace-data/tsconfig.types.json +++ b/clients/client-finspace-data/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-finspace/.gitignore b/clients/client-finspace/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-finspace/.gitignore +++ b/clients/client-finspace/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-finspace/package.json b/clients/client-finspace/package.json index e8ed0315944a..e8a7585aa543 100644 --- a/clients/client-finspace/package.json +++ b/clients/client-finspace/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-finspace", "repository": { "type": "git", diff --git a/clients/client-finspace/runtimeConfig.browser.ts b/clients/client-finspace/runtimeConfig.browser.ts deleted file mode 100644 index 705f91b9bb60..000000000000 --- a/clients/client-finspace/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FinspaceClientConfig } from "./FinspaceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FinspaceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-finspace/runtimeConfig.ts b/clients/client-finspace/runtimeConfig.ts deleted file mode 100644 index 7b381d00ff25..000000000000 --- a/clients/client-finspace/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FinspaceClientConfig } from "./FinspaceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FinspaceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-finspace/Finspace.ts b/clients/client-finspace/src/Finspace.ts similarity index 100% rename from clients/client-finspace/Finspace.ts rename to clients/client-finspace/src/Finspace.ts diff --git a/clients/client-finspace/FinspaceClient.ts b/clients/client-finspace/src/FinspaceClient.ts similarity index 100% rename from clients/client-finspace/FinspaceClient.ts rename to clients/client-finspace/src/FinspaceClient.ts diff --git a/clients/client-finspace/commands/CreateEnvironmentCommand.ts b/clients/client-finspace/src/commands/CreateEnvironmentCommand.ts similarity index 100% rename from clients/client-finspace/commands/CreateEnvironmentCommand.ts rename to clients/client-finspace/src/commands/CreateEnvironmentCommand.ts diff --git a/clients/client-finspace/commands/DeleteEnvironmentCommand.ts b/clients/client-finspace/src/commands/DeleteEnvironmentCommand.ts similarity index 100% rename from clients/client-finspace/commands/DeleteEnvironmentCommand.ts rename to clients/client-finspace/src/commands/DeleteEnvironmentCommand.ts diff --git a/clients/client-finspace/commands/GetEnvironmentCommand.ts b/clients/client-finspace/src/commands/GetEnvironmentCommand.ts similarity index 100% rename from clients/client-finspace/commands/GetEnvironmentCommand.ts rename to clients/client-finspace/src/commands/GetEnvironmentCommand.ts diff --git a/clients/client-finspace/commands/ListEnvironmentsCommand.ts b/clients/client-finspace/src/commands/ListEnvironmentsCommand.ts similarity index 100% rename from clients/client-finspace/commands/ListEnvironmentsCommand.ts rename to clients/client-finspace/src/commands/ListEnvironmentsCommand.ts diff --git a/clients/client-finspace/commands/ListTagsForResourceCommand.ts b/clients/client-finspace/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-finspace/commands/ListTagsForResourceCommand.ts rename to clients/client-finspace/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-finspace/commands/TagResourceCommand.ts b/clients/client-finspace/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-finspace/commands/TagResourceCommand.ts rename to clients/client-finspace/src/commands/TagResourceCommand.ts diff --git a/clients/client-finspace/commands/UntagResourceCommand.ts b/clients/client-finspace/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-finspace/commands/UntagResourceCommand.ts rename to clients/client-finspace/src/commands/UntagResourceCommand.ts diff --git a/clients/client-finspace/commands/UpdateEnvironmentCommand.ts b/clients/client-finspace/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-finspace/commands/UpdateEnvironmentCommand.ts rename to clients/client-finspace/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-finspace/endpoints.ts b/clients/client-finspace/src/endpoints.ts similarity index 100% rename from clients/client-finspace/endpoints.ts rename to clients/client-finspace/src/endpoints.ts diff --git a/clients/client-finspace/index.ts b/clients/client-finspace/src/index.ts similarity index 100% rename from clients/client-finspace/index.ts rename to clients/client-finspace/src/index.ts diff --git a/clients/client-finspace/models/index.ts b/clients/client-finspace/src/models/index.ts similarity index 100% rename from clients/client-finspace/models/index.ts rename to clients/client-finspace/src/models/index.ts diff --git a/clients/client-finspace/models/models_0.ts b/clients/client-finspace/src/models/models_0.ts similarity index 100% rename from clients/client-finspace/models/models_0.ts rename to clients/client-finspace/src/models/models_0.ts diff --git a/clients/client-finspace/protocols/Aws_restJson1.ts b/clients/client-finspace/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-finspace/protocols/Aws_restJson1.ts rename to clients/client-finspace/src/protocols/Aws_restJson1.ts diff --git a/clients/client-finspace/src/runtimeConfig.browser.ts b/clients/client-finspace/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..30eac62e8093 --- /dev/null +++ b/clients/client-finspace/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FinspaceClientConfig } from "./FinspaceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FinspaceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-finspace/runtimeConfig.native.ts b/clients/client-finspace/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-finspace/runtimeConfig.native.ts rename to clients/client-finspace/src/runtimeConfig.native.ts diff --git a/clients/client-finspace/runtimeConfig.shared.ts b/clients/client-finspace/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-finspace/runtimeConfig.shared.ts rename to clients/client-finspace/src/runtimeConfig.shared.ts diff --git a/clients/client-finspace/src/runtimeConfig.ts b/clients/client-finspace/src/runtimeConfig.ts new file mode 100644 index 000000000000..864ac4b57718 --- /dev/null +++ b/clients/client-finspace/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FinspaceClientConfig } from "./FinspaceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FinspaceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-finspace/tsconfig.es.json b/clients/client-finspace/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-finspace/tsconfig.es.json +++ b/clients/client-finspace/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-finspace/tsconfig.json b/clients/client-finspace/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-finspace/tsconfig.json +++ b/clients/client-finspace/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-finspace/tsconfig.types.json b/clients/client-finspace/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-finspace/tsconfig.types.json +++ b/clients/client-finspace/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-firehose/.gitignore b/clients/client-firehose/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-firehose/.gitignore +++ b/clients/client-firehose/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-firehose/package.json b/clients/client-firehose/package.json index b3da25a75207..7423449011aa 100644 --- a/clients/client-firehose/package.json +++ b/clients/client-firehose/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-firehose", "repository": { "type": "git", diff --git a/clients/client-firehose/runtimeConfig.browser.ts b/clients/client-firehose/runtimeConfig.browser.ts deleted file mode 100644 index a57459cf1ad8..000000000000 --- a/clients/client-firehose/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FirehoseClientConfig } from "./FirehoseClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FirehoseClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-firehose/runtimeConfig.ts b/clients/client-firehose/runtimeConfig.ts deleted file mode 100644 index 099276d4a399..000000000000 --- a/clients/client-firehose/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FirehoseClientConfig } from "./FirehoseClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FirehoseClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-firehose/Firehose.ts b/clients/client-firehose/src/Firehose.ts similarity index 100% rename from clients/client-firehose/Firehose.ts rename to clients/client-firehose/src/Firehose.ts diff --git a/clients/client-firehose/FirehoseClient.ts b/clients/client-firehose/src/FirehoseClient.ts similarity index 100% rename from clients/client-firehose/FirehoseClient.ts rename to clients/client-firehose/src/FirehoseClient.ts diff --git a/clients/client-firehose/commands/CreateDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/CreateDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/CreateDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/CreateDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/DeleteDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/DeleteDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/DeleteDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/DeleteDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/DescribeDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/DescribeDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/DescribeDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/DescribeDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/ListDeliveryStreamsCommand.ts b/clients/client-firehose/src/commands/ListDeliveryStreamsCommand.ts similarity index 100% rename from clients/client-firehose/commands/ListDeliveryStreamsCommand.ts rename to clients/client-firehose/src/commands/ListDeliveryStreamsCommand.ts diff --git a/clients/client-firehose/commands/ListTagsForDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/ListTagsForDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/ListTagsForDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/ListTagsForDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/PutRecordBatchCommand.ts b/clients/client-firehose/src/commands/PutRecordBatchCommand.ts similarity index 100% rename from clients/client-firehose/commands/PutRecordBatchCommand.ts rename to clients/client-firehose/src/commands/PutRecordBatchCommand.ts diff --git a/clients/client-firehose/commands/PutRecordCommand.ts b/clients/client-firehose/src/commands/PutRecordCommand.ts similarity index 100% rename from clients/client-firehose/commands/PutRecordCommand.ts rename to clients/client-firehose/src/commands/PutRecordCommand.ts diff --git a/clients/client-firehose/commands/StartDeliveryStreamEncryptionCommand.ts b/clients/client-firehose/src/commands/StartDeliveryStreamEncryptionCommand.ts similarity index 100% rename from clients/client-firehose/commands/StartDeliveryStreamEncryptionCommand.ts rename to clients/client-firehose/src/commands/StartDeliveryStreamEncryptionCommand.ts diff --git a/clients/client-firehose/commands/StopDeliveryStreamEncryptionCommand.ts b/clients/client-firehose/src/commands/StopDeliveryStreamEncryptionCommand.ts similarity index 100% rename from clients/client-firehose/commands/StopDeliveryStreamEncryptionCommand.ts rename to clients/client-firehose/src/commands/StopDeliveryStreamEncryptionCommand.ts diff --git a/clients/client-firehose/commands/TagDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/TagDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/TagDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/TagDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/UntagDeliveryStreamCommand.ts b/clients/client-firehose/src/commands/UntagDeliveryStreamCommand.ts similarity index 100% rename from clients/client-firehose/commands/UntagDeliveryStreamCommand.ts rename to clients/client-firehose/src/commands/UntagDeliveryStreamCommand.ts diff --git a/clients/client-firehose/commands/UpdateDestinationCommand.ts b/clients/client-firehose/src/commands/UpdateDestinationCommand.ts similarity index 100% rename from clients/client-firehose/commands/UpdateDestinationCommand.ts rename to clients/client-firehose/src/commands/UpdateDestinationCommand.ts diff --git a/clients/client-firehose/endpoints.ts b/clients/client-firehose/src/endpoints.ts similarity index 100% rename from clients/client-firehose/endpoints.ts rename to clients/client-firehose/src/endpoints.ts diff --git a/clients/client-firehose/index.ts b/clients/client-firehose/src/index.ts similarity index 100% rename from clients/client-firehose/index.ts rename to clients/client-firehose/src/index.ts diff --git a/clients/client-firehose/models/index.ts b/clients/client-firehose/src/models/index.ts similarity index 100% rename from clients/client-firehose/models/index.ts rename to clients/client-firehose/src/models/index.ts diff --git a/clients/client-firehose/models/models_0.ts b/clients/client-firehose/src/models/models_0.ts similarity index 100% rename from clients/client-firehose/models/models_0.ts rename to clients/client-firehose/src/models/models_0.ts diff --git a/clients/client-firehose/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-firehose/protocols/Aws_json1_1.ts rename to clients/client-firehose/src/protocols/Aws_json1_1.ts diff --git a/clients/client-firehose/src/runtimeConfig.browser.ts b/clients/client-firehose/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a8c9e79c56c0 --- /dev/null +++ b/clients/client-firehose/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FirehoseClientConfig } from "./FirehoseClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FirehoseClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-firehose/runtimeConfig.native.ts b/clients/client-firehose/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-firehose/runtimeConfig.native.ts rename to clients/client-firehose/src/runtimeConfig.native.ts diff --git a/clients/client-firehose/runtimeConfig.shared.ts b/clients/client-firehose/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-firehose/runtimeConfig.shared.ts rename to clients/client-firehose/src/runtimeConfig.shared.ts diff --git a/clients/client-firehose/src/runtimeConfig.ts b/clients/client-firehose/src/runtimeConfig.ts new file mode 100644 index 000000000000..c2965fce242a --- /dev/null +++ b/clients/client-firehose/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FirehoseClientConfig } from "./FirehoseClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FirehoseClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-firehose/tsconfig.es.json b/clients/client-firehose/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-firehose/tsconfig.es.json +++ b/clients/client-firehose/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-firehose/tsconfig.json b/clients/client-firehose/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-firehose/tsconfig.json +++ b/clients/client-firehose/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-firehose/tsconfig.types.json b/clients/client-firehose/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-firehose/tsconfig.types.json +++ b/clients/client-firehose/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-fis/.gitignore b/clients/client-fis/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-fis/.gitignore +++ b/clients/client-fis/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-fis/package.json b/clients/client-fis/package.json index ea4727616a8e..13a7b4aec82f 100644 --- a/clients/client-fis/package.json +++ b/clients/client-fis/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-fis", "repository": { "type": "git", diff --git a/clients/client-fis/runtimeConfig.browser.ts b/clients/client-fis/runtimeConfig.browser.ts deleted file mode 100644 index 4344054a82f0..000000000000 --- a/clients/client-fis/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FisClientConfig } from "./FisClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FisClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fis/runtimeConfig.ts b/clients/client-fis/runtimeConfig.ts deleted file mode 100644 index a04c21faab9e..000000000000 --- a/clients/client-fis/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FisClientConfig } from "./FisClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FisClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fis/Fis.ts b/clients/client-fis/src/Fis.ts similarity index 100% rename from clients/client-fis/Fis.ts rename to clients/client-fis/src/Fis.ts diff --git a/clients/client-fis/FisClient.ts b/clients/client-fis/src/FisClient.ts similarity index 100% rename from clients/client-fis/FisClient.ts rename to clients/client-fis/src/FisClient.ts diff --git a/clients/client-fis/commands/CreateExperimentTemplateCommand.ts b/clients/client-fis/src/commands/CreateExperimentTemplateCommand.ts similarity index 100% rename from clients/client-fis/commands/CreateExperimentTemplateCommand.ts rename to clients/client-fis/src/commands/CreateExperimentTemplateCommand.ts diff --git a/clients/client-fis/commands/DeleteExperimentTemplateCommand.ts b/clients/client-fis/src/commands/DeleteExperimentTemplateCommand.ts similarity index 100% rename from clients/client-fis/commands/DeleteExperimentTemplateCommand.ts rename to clients/client-fis/src/commands/DeleteExperimentTemplateCommand.ts diff --git a/clients/client-fis/commands/GetActionCommand.ts b/clients/client-fis/src/commands/GetActionCommand.ts similarity index 100% rename from clients/client-fis/commands/GetActionCommand.ts rename to clients/client-fis/src/commands/GetActionCommand.ts diff --git a/clients/client-fis/commands/GetExperimentCommand.ts b/clients/client-fis/src/commands/GetExperimentCommand.ts similarity index 100% rename from clients/client-fis/commands/GetExperimentCommand.ts rename to clients/client-fis/src/commands/GetExperimentCommand.ts diff --git a/clients/client-fis/commands/GetExperimentTemplateCommand.ts b/clients/client-fis/src/commands/GetExperimentTemplateCommand.ts similarity index 100% rename from clients/client-fis/commands/GetExperimentTemplateCommand.ts rename to clients/client-fis/src/commands/GetExperimentTemplateCommand.ts diff --git a/clients/client-fis/commands/ListActionsCommand.ts b/clients/client-fis/src/commands/ListActionsCommand.ts similarity index 100% rename from clients/client-fis/commands/ListActionsCommand.ts rename to clients/client-fis/src/commands/ListActionsCommand.ts diff --git a/clients/client-fis/commands/ListExperimentTemplatesCommand.ts b/clients/client-fis/src/commands/ListExperimentTemplatesCommand.ts similarity index 100% rename from clients/client-fis/commands/ListExperimentTemplatesCommand.ts rename to clients/client-fis/src/commands/ListExperimentTemplatesCommand.ts diff --git a/clients/client-fis/commands/ListExperimentsCommand.ts b/clients/client-fis/src/commands/ListExperimentsCommand.ts similarity index 100% rename from clients/client-fis/commands/ListExperimentsCommand.ts rename to clients/client-fis/src/commands/ListExperimentsCommand.ts diff --git a/clients/client-fis/commands/ListTagsForResourceCommand.ts b/clients/client-fis/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-fis/commands/ListTagsForResourceCommand.ts rename to clients/client-fis/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-fis/commands/StartExperimentCommand.ts b/clients/client-fis/src/commands/StartExperimentCommand.ts similarity index 100% rename from clients/client-fis/commands/StartExperimentCommand.ts rename to clients/client-fis/src/commands/StartExperimentCommand.ts diff --git a/clients/client-fis/commands/StopExperimentCommand.ts b/clients/client-fis/src/commands/StopExperimentCommand.ts similarity index 100% rename from clients/client-fis/commands/StopExperimentCommand.ts rename to clients/client-fis/src/commands/StopExperimentCommand.ts diff --git a/clients/client-fis/commands/TagResourceCommand.ts b/clients/client-fis/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-fis/commands/TagResourceCommand.ts rename to clients/client-fis/src/commands/TagResourceCommand.ts diff --git a/clients/client-fis/commands/UntagResourceCommand.ts b/clients/client-fis/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-fis/commands/UntagResourceCommand.ts rename to clients/client-fis/src/commands/UntagResourceCommand.ts diff --git a/clients/client-fis/commands/UpdateExperimentTemplateCommand.ts b/clients/client-fis/src/commands/UpdateExperimentTemplateCommand.ts similarity index 100% rename from clients/client-fis/commands/UpdateExperimentTemplateCommand.ts rename to clients/client-fis/src/commands/UpdateExperimentTemplateCommand.ts diff --git a/clients/client-fis/endpoints.ts b/clients/client-fis/src/endpoints.ts similarity index 100% rename from clients/client-fis/endpoints.ts rename to clients/client-fis/src/endpoints.ts diff --git a/clients/client-fis/index.ts b/clients/client-fis/src/index.ts similarity index 100% rename from clients/client-fis/index.ts rename to clients/client-fis/src/index.ts diff --git a/clients/client-fis/models/index.ts b/clients/client-fis/src/models/index.ts similarity index 100% rename from clients/client-fis/models/index.ts rename to clients/client-fis/src/models/index.ts diff --git a/clients/client-fis/models/models_0.ts b/clients/client-fis/src/models/models_0.ts similarity index 100% rename from clients/client-fis/models/models_0.ts rename to clients/client-fis/src/models/models_0.ts diff --git a/clients/client-fis/pagination/Interfaces.ts b/clients/client-fis/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-fis/pagination/Interfaces.ts rename to clients/client-fis/src/pagination/Interfaces.ts diff --git a/clients/client-fis/pagination/ListActionsPaginator.ts b/clients/client-fis/src/pagination/ListActionsPaginator.ts similarity index 100% rename from clients/client-fis/pagination/ListActionsPaginator.ts rename to clients/client-fis/src/pagination/ListActionsPaginator.ts diff --git a/clients/client-fis/pagination/ListExperimentTemplatesPaginator.ts b/clients/client-fis/src/pagination/ListExperimentTemplatesPaginator.ts similarity index 100% rename from clients/client-fis/pagination/ListExperimentTemplatesPaginator.ts rename to clients/client-fis/src/pagination/ListExperimentTemplatesPaginator.ts diff --git a/clients/client-fis/pagination/ListExperimentsPaginator.ts b/clients/client-fis/src/pagination/ListExperimentsPaginator.ts similarity index 100% rename from clients/client-fis/pagination/ListExperimentsPaginator.ts rename to clients/client-fis/src/pagination/ListExperimentsPaginator.ts diff --git a/clients/client-fis/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-fis/protocols/Aws_restJson1.ts rename to clients/client-fis/src/protocols/Aws_restJson1.ts diff --git a/clients/client-fis/src/runtimeConfig.browser.ts b/clients/client-fis/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6ffac63604c9 --- /dev/null +++ b/clients/client-fis/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FisClientConfig } from "./FisClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FisClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fis/runtimeConfig.native.ts b/clients/client-fis/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-fis/runtimeConfig.native.ts rename to clients/client-fis/src/runtimeConfig.native.ts diff --git a/clients/client-fis/runtimeConfig.shared.ts b/clients/client-fis/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-fis/runtimeConfig.shared.ts rename to clients/client-fis/src/runtimeConfig.shared.ts diff --git a/clients/client-fis/src/runtimeConfig.ts b/clients/client-fis/src/runtimeConfig.ts new file mode 100644 index 000000000000..bc5f343dd1e1 --- /dev/null +++ b/clients/client-fis/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FisClientConfig } from "./FisClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FisClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fis/tsconfig.es.json b/clients/client-fis/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-fis/tsconfig.es.json +++ b/clients/client-fis/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-fis/tsconfig.json b/clients/client-fis/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-fis/tsconfig.json +++ b/clients/client-fis/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-fis/tsconfig.types.json b/clients/client-fis/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-fis/tsconfig.types.json +++ b/clients/client-fis/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-fms/.gitignore b/clients/client-fms/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-fms/.gitignore +++ b/clients/client-fms/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-fms/package.json b/clients/client-fms/package.json index 0f070e191872..bf33132e36f9 100644 --- a/clients/client-fms/package.json +++ b/clients/client-fms/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-fms", "repository": { "type": "git", diff --git a/clients/client-fms/runtimeConfig.browser.ts b/clients/client-fms/runtimeConfig.browser.ts deleted file mode 100644 index 8ffe3243f640..000000000000 --- a/clients/client-fms/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FMSClientConfig } from "./FMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FMSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fms/runtimeConfig.ts b/clients/client-fms/runtimeConfig.ts deleted file mode 100644 index e60ac81f5fd1..000000000000 --- a/clients/client-fms/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FMSClientConfig } from "./FMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FMSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fms/FMS.ts b/clients/client-fms/src/FMS.ts similarity index 100% rename from clients/client-fms/FMS.ts rename to clients/client-fms/src/FMS.ts diff --git a/clients/client-fms/FMSClient.ts b/clients/client-fms/src/FMSClient.ts similarity index 100% rename from clients/client-fms/FMSClient.ts rename to clients/client-fms/src/FMSClient.ts diff --git a/clients/client-fms/commands/AssociateAdminAccountCommand.ts b/clients/client-fms/src/commands/AssociateAdminAccountCommand.ts similarity index 100% rename from clients/client-fms/commands/AssociateAdminAccountCommand.ts rename to clients/client-fms/src/commands/AssociateAdminAccountCommand.ts diff --git a/clients/client-fms/commands/DeleteAppsListCommand.ts b/clients/client-fms/src/commands/DeleteAppsListCommand.ts similarity index 100% rename from clients/client-fms/commands/DeleteAppsListCommand.ts rename to clients/client-fms/src/commands/DeleteAppsListCommand.ts diff --git a/clients/client-fms/commands/DeleteNotificationChannelCommand.ts b/clients/client-fms/src/commands/DeleteNotificationChannelCommand.ts similarity index 100% rename from clients/client-fms/commands/DeleteNotificationChannelCommand.ts rename to clients/client-fms/src/commands/DeleteNotificationChannelCommand.ts diff --git a/clients/client-fms/commands/DeletePolicyCommand.ts b/clients/client-fms/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-fms/commands/DeletePolicyCommand.ts rename to clients/client-fms/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-fms/commands/DeleteProtocolsListCommand.ts b/clients/client-fms/src/commands/DeleteProtocolsListCommand.ts similarity index 100% rename from clients/client-fms/commands/DeleteProtocolsListCommand.ts rename to clients/client-fms/src/commands/DeleteProtocolsListCommand.ts diff --git a/clients/client-fms/commands/DisassociateAdminAccountCommand.ts b/clients/client-fms/src/commands/DisassociateAdminAccountCommand.ts similarity index 100% rename from clients/client-fms/commands/DisassociateAdminAccountCommand.ts rename to clients/client-fms/src/commands/DisassociateAdminAccountCommand.ts diff --git a/clients/client-fms/commands/GetAdminAccountCommand.ts b/clients/client-fms/src/commands/GetAdminAccountCommand.ts similarity index 100% rename from clients/client-fms/commands/GetAdminAccountCommand.ts rename to clients/client-fms/src/commands/GetAdminAccountCommand.ts diff --git a/clients/client-fms/commands/GetAppsListCommand.ts b/clients/client-fms/src/commands/GetAppsListCommand.ts similarity index 100% rename from clients/client-fms/commands/GetAppsListCommand.ts rename to clients/client-fms/src/commands/GetAppsListCommand.ts diff --git a/clients/client-fms/commands/GetComplianceDetailCommand.ts b/clients/client-fms/src/commands/GetComplianceDetailCommand.ts similarity index 100% rename from clients/client-fms/commands/GetComplianceDetailCommand.ts rename to clients/client-fms/src/commands/GetComplianceDetailCommand.ts diff --git a/clients/client-fms/commands/GetNotificationChannelCommand.ts b/clients/client-fms/src/commands/GetNotificationChannelCommand.ts similarity index 100% rename from clients/client-fms/commands/GetNotificationChannelCommand.ts rename to clients/client-fms/src/commands/GetNotificationChannelCommand.ts diff --git a/clients/client-fms/commands/GetPolicyCommand.ts b/clients/client-fms/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-fms/commands/GetPolicyCommand.ts rename to clients/client-fms/src/commands/GetPolicyCommand.ts diff --git a/clients/client-fms/commands/GetProtectionStatusCommand.ts b/clients/client-fms/src/commands/GetProtectionStatusCommand.ts similarity index 100% rename from clients/client-fms/commands/GetProtectionStatusCommand.ts rename to clients/client-fms/src/commands/GetProtectionStatusCommand.ts diff --git a/clients/client-fms/commands/GetProtocolsListCommand.ts b/clients/client-fms/src/commands/GetProtocolsListCommand.ts similarity index 100% rename from clients/client-fms/commands/GetProtocolsListCommand.ts rename to clients/client-fms/src/commands/GetProtocolsListCommand.ts diff --git a/clients/client-fms/commands/GetViolationDetailsCommand.ts b/clients/client-fms/src/commands/GetViolationDetailsCommand.ts similarity index 100% rename from clients/client-fms/commands/GetViolationDetailsCommand.ts rename to clients/client-fms/src/commands/GetViolationDetailsCommand.ts diff --git a/clients/client-fms/commands/ListAppsListsCommand.ts b/clients/client-fms/src/commands/ListAppsListsCommand.ts similarity index 100% rename from clients/client-fms/commands/ListAppsListsCommand.ts rename to clients/client-fms/src/commands/ListAppsListsCommand.ts diff --git a/clients/client-fms/commands/ListComplianceStatusCommand.ts b/clients/client-fms/src/commands/ListComplianceStatusCommand.ts similarity index 100% rename from clients/client-fms/commands/ListComplianceStatusCommand.ts rename to clients/client-fms/src/commands/ListComplianceStatusCommand.ts diff --git a/clients/client-fms/commands/ListMemberAccountsCommand.ts b/clients/client-fms/src/commands/ListMemberAccountsCommand.ts similarity index 100% rename from clients/client-fms/commands/ListMemberAccountsCommand.ts rename to clients/client-fms/src/commands/ListMemberAccountsCommand.ts diff --git a/clients/client-fms/commands/ListPoliciesCommand.ts b/clients/client-fms/src/commands/ListPoliciesCommand.ts similarity index 100% rename from clients/client-fms/commands/ListPoliciesCommand.ts rename to clients/client-fms/src/commands/ListPoliciesCommand.ts diff --git a/clients/client-fms/commands/ListProtocolsListsCommand.ts b/clients/client-fms/src/commands/ListProtocolsListsCommand.ts similarity index 100% rename from clients/client-fms/commands/ListProtocolsListsCommand.ts rename to clients/client-fms/src/commands/ListProtocolsListsCommand.ts diff --git a/clients/client-fms/commands/ListTagsForResourceCommand.ts b/clients/client-fms/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-fms/commands/ListTagsForResourceCommand.ts rename to clients/client-fms/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-fms/commands/PutAppsListCommand.ts b/clients/client-fms/src/commands/PutAppsListCommand.ts similarity index 100% rename from clients/client-fms/commands/PutAppsListCommand.ts rename to clients/client-fms/src/commands/PutAppsListCommand.ts diff --git a/clients/client-fms/commands/PutNotificationChannelCommand.ts b/clients/client-fms/src/commands/PutNotificationChannelCommand.ts similarity index 100% rename from clients/client-fms/commands/PutNotificationChannelCommand.ts rename to clients/client-fms/src/commands/PutNotificationChannelCommand.ts diff --git a/clients/client-fms/commands/PutPolicyCommand.ts b/clients/client-fms/src/commands/PutPolicyCommand.ts similarity index 100% rename from clients/client-fms/commands/PutPolicyCommand.ts rename to clients/client-fms/src/commands/PutPolicyCommand.ts diff --git a/clients/client-fms/commands/PutProtocolsListCommand.ts b/clients/client-fms/src/commands/PutProtocolsListCommand.ts similarity index 100% rename from clients/client-fms/commands/PutProtocolsListCommand.ts rename to clients/client-fms/src/commands/PutProtocolsListCommand.ts diff --git a/clients/client-fms/commands/TagResourceCommand.ts b/clients/client-fms/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-fms/commands/TagResourceCommand.ts rename to clients/client-fms/src/commands/TagResourceCommand.ts diff --git a/clients/client-fms/commands/UntagResourceCommand.ts b/clients/client-fms/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-fms/commands/UntagResourceCommand.ts rename to clients/client-fms/src/commands/UntagResourceCommand.ts diff --git a/clients/client-fms/endpoints.ts b/clients/client-fms/src/endpoints.ts similarity index 100% rename from clients/client-fms/endpoints.ts rename to clients/client-fms/src/endpoints.ts diff --git a/clients/client-fms/index.ts b/clients/client-fms/src/index.ts similarity index 100% rename from clients/client-fms/index.ts rename to clients/client-fms/src/index.ts diff --git a/clients/client-fms/models/index.ts b/clients/client-fms/src/models/index.ts similarity index 100% rename from clients/client-fms/models/index.ts rename to clients/client-fms/src/models/index.ts diff --git a/clients/client-fms/models/models_0.ts b/clients/client-fms/src/models/models_0.ts similarity index 100% rename from clients/client-fms/models/models_0.ts rename to clients/client-fms/src/models/models_0.ts diff --git a/clients/client-fms/pagination/Interfaces.ts b/clients/client-fms/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-fms/pagination/Interfaces.ts rename to clients/client-fms/src/pagination/Interfaces.ts diff --git a/clients/client-fms/pagination/ListAppsListsPaginator.ts b/clients/client-fms/src/pagination/ListAppsListsPaginator.ts similarity index 100% rename from clients/client-fms/pagination/ListAppsListsPaginator.ts rename to clients/client-fms/src/pagination/ListAppsListsPaginator.ts diff --git a/clients/client-fms/pagination/ListComplianceStatusPaginator.ts b/clients/client-fms/src/pagination/ListComplianceStatusPaginator.ts similarity index 100% rename from clients/client-fms/pagination/ListComplianceStatusPaginator.ts rename to clients/client-fms/src/pagination/ListComplianceStatusPaginator.ts diff --git a/clients/client-fms/pagination/ListMemberAccountsPaginator.ts b/clients/client-fms/src/pagination/ListMemberAccountsPaginator.ts similarity index 100% rename from clients/client-fms/pagination/ListMemberAccountsPaginator.ts rename to clients/client-fms/src/pagination/ListMemberAccountsPaginator.ts diff --git a/clients/client-fms/pagination/ListPoliciesPaginator.ts b/clients/client-fms/src/pagination/ListPoliciesPaginator.ts similarity index 100% rename from clients/client-fms/pagination/ListPoliciesPaginator.ts rename to clients/client-fms/src/pagination/ListPoliciesPaginator.ts diff --git a/clients/client-fms/pagination/ListProtocolsListsPaginator.ts b/clients/client-fms/src/pagination/ListProtocolsListsPaginator.ts similarity index 100% rename from clients/client-fms/pagination/ListProtocolsListsPaginator.ts rename to clients/client-fms/src/pagination/ListProtocolsListsPaginator.ts diff --git a/clients/client-fms/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-fms/protocols/Aws_json1_1.ts rename to clients/client-fms/src/protocols/Aws_json1_1.ts diff --git a/clients/client-fms/src/runtimeConfig.browser.ts b/clients/client-fms/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..399a3e56a703 --- /dev/null +++ b/clients/client-fms/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FMSClientConfig } from "./FMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FMSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fms/runtimeConfig.native.ts b/clients/client-fms/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-fms/runtimeConfig.native.ts rename to clients/client-fms/src/runtimeConfig.native.ts diff --git a/clients/client-fms/runtimeConfig.shared.ts b/clients/client-fms/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-fms/runtimeConfig.shared.ts rename to clients/client-fms/src/runtimeConfig.shared.ts diff --git a/clients/client-fms/src/runtimeConfig.ts b/clients/client-fms/src/runtimeConfig.ts new file mode 100644 index 000000000000..a0ab689add91 --- /dev/null +++ b/clients/client-fms/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FMSClientConfig } from "./FMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FMSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fms/tsconfig.es.json b/clients/client-fms/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-fms/tsconfig.es.json +++ b/clients/client-fms/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-fms/tsconfig.json b/clients/client-fms/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-fms/tsconfig.json +++ b/clients/client-fms/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-fms/tsconfig.types.json b/clients/client-fms/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-fms/tsconfig.types.json +++ b/clients/client-fms/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-forecast/.gitignore b/clients/client-forecast/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-forecast/.gitignore +++ b/clients/client-forecast/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-forecast/package.json b/clients/client-forecast/package.json index 69317e3d9dc3..339aafd61a6c 100644 --- a/clients/client-forecast/package.json +++ b/clients/client-forecast/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-forecast", "repository": { "type": "git", diff --git a/clients/client-forecast/runtimeConfig.browser.ts b/clients/client-forecast/runtimeConfig.browser.ts deleted file mode 100644 index c5a9d3835cc7..000000000000 --- a/clients/client-forecast/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ForecastClientConfig } from "./ForecastClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ForecastClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-forecast/runtimeConfig.ts b/clients/client-forecast/runtimeConfig.ts deleted file mode 100644 index b4e288e082d1..000000000000 --- a/clients/client-forecast/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ForecastClientConfig } from "./ForecastClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ForecastClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-forecast/Forecast.ts b/clients/client-forecast/src/Forecast.ts similarity index 100% rename from clients/client-forecast/Forecast.ts rename to clients/client-forecast/src/Forecast.ts diff --git a/clients/client-forecast/ForecastClient.ts b/clients/client-forecast/src/ForecastClient.ts similarity index 100% rename from clients/client-forecast/ForecastClient.ts rename to clients/client-forecast/src/ForecastClient.ts diff --git a/clients/client-forecast/commands/CreateDatasetCommand.ts b/clients/client-forecast/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreateDatasetCommand.ts rename to clients/client-forecast/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-forecast/commands/CreateDatasetGroupCommand.ts b/clients/client-forecast/src/commands/CreateDatasetGroupCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreateDatasetGroupCommand.ts rename to clients/client-forecast/src/commands/CreateDatasetGroupCommand.ts diff --git a/clients/client-forecast/commands/CreateDatasetImportJobCommand.ts b/clients/client-forecast/src/commands/CreateDatasetImportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreateDatasetImportJobCommand.ts rename to clients/client-forecast/src/commands/CreateDatasetImportJobCommand.ts diff --git a/clients/client-forecast/commands/CreateForecastCommand.ts b/clients/client-forecast/src/commands/CreateForecastCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreateForecastCommand.ts rename to clients/client-forecast/src/commands/CreateForecastCommand.ts diff --git a/clients/client-forecast/commands/CreateForecastExportJobCommand.ts b/clients/client-forecast/src/commands/CreateForecastExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreateForecastExportJobCommand.ts rename to clients/client-forecast/src/commands/CreateForecastExportJobCommand.ts diff --git a/clients/client-forecast/commands/CreatePredictorBacktestExportJobCommand.ts b/clients/client-forecast/src/commands/CreatePredictorBacktestExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreatePredictorBacktestExportJobCommand.ts rename to clients/client-forecast/src/commands/CreatePredictorBacktestExportJobCommand.ts diff --git a/clients/client-forecast/commands/CreatePredictorCommand.ts b/clients/client-forecast/src/commands/CreatePredictorCommand.ts similarity index 100% rename from clients/client-forecast/commands/CreatePredictorCommand.ts rename to clients/client-forecast/src/commands/CreatePredictorCommand.ts diff --git a/clients/client-forecast/commands/DeleteDatasetCommand.ts b/clients/client-forecast/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteDatasetCommand.ts rename to clients/client-forecast/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-forecast/commands/DeleteDatasetGroupCommand.ts b/clients/client-forecast/src/commands/DeleteDatasetGroupCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteDatasetGroupCommand.ts rename to clients/client-forecast/src/commands/DeleteDatasetGroupCommand.ts diff --git a/clients/client-forecast/commands/DeleteDatasetImportJobCommand.ts b/clients/client-forecast/src/commands/DeleteDatasetImportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteDatasetImportJobCommand.ts rename to clients/client-forecast/src/commands/DeleteDatasetImportJobCommand.ts diff --git a/clients/client-forecast/commands/DeleteForecastCommand.ts b/clients/client-forecast/src/commands/DeleteForecastCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteForecastCommand.ts rename to clients/client-forecast/src/commands/DeleteForecastCommand.ts diff --git a/clients/client-forecast/commands/DeleteForecastExportJobCommand.ts b/clients/client-forecast/src/commands/DeleteForecastExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteForecastExportJobCommand.ts rename to clients/client-forecast/src/commands/DeleteForecastExportJobCommand.ts diff --git a/clients/client-forecast/commands/DeletePredictorBacktestExportJobCommand.ts b/clients/client-forecast/src/commands/DeletePredictorBacktestExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeletePredictorBacktestExportJobCommand.ts rename to clients/client-forecast/src/commands/DeletePredictorBacktestExportJobCommand.ts diff --git a/clients/client-forecast/commands/DeletePredictorCommand.ts b/clients/client-forecast/src/commands/DeletePredictorCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeletePredictorCommand.ts rename to clients/client-forecast/src/commands/DeletePredictorCommand.ts diff --git a/clients/client-forecast/commands/DeleteResourceTreeCommand.ts b/clients/client-forecast/src/commands/DeleteResourceTreeCommand.ts similarity index 100% rename from clients/client-forecast/commands/DeleteResourceTreeCommand.ts rename to clients/client-forecast/src/commands/DeleteResourceTreeCommand.ts diff --git a/clients/client-forecast/commands/DescribeDatasetCommand.ts b/clients/client-forecast/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribeDatasetCommand.ts rename to clients/client-forecast/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-forecast/commands/DescribeDatasetGroupCommand.ts b/clients/client-forecast/src/commands/DescribeDatasetGroupCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribeDatasetGroupCommand.ts rename to clients/client-forecast/src/commands/DescribeDatasetGroupCommand.ts diff --git a/clients/client-forecast/commands/DescribeDatasetImportJobCommand.ts b/clients/client-forecast/src/commands/DescribeDatasetImportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribeDatasetImportJobCommand.ts rename to clients/client-forecast/src/commands/DescribeDatasetImportJobCommand.ts diff --git a/clients/client-forecast/commands/DescribeForecastCommand.ts b/clients/client-forecast/src/commands/DescribeForecastCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribeForecastCommand.ts rename to clients/client-forecast/src/commands/DescribeForecastCommand.ts diff --git a/clients/client-forecast/commands/DescribeForecastExportJobCommand.ts b/clients/client-forecast/src/commands/DescribeForecastExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribeForecastExportJobCommand.ts rename to clients/client-forecast/src/commands/DescribeForecastExportJobCommand.ts diff --git a/clients/client-forecast/commands/DescribePredictorBacktestExportJobCommand.ts b/clients/client-forecast/src/commands/DescribePredictorBacktestExportJobCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribePredictorBacktestExportJobCommand.ts rename to clients/client-forecast/src/commands/DescribePredictorBacktestExportJobCommand.ts diff --git a/clients/client-forecast/commands/DescribePredictorCommand.ts b/clients/client-forecast/src/commands/DescribePredictorCommand.ts similarity index 100% rename from clients/client-forecast/commands/DescribePredictorCommand.ts rename to clients/client-forecast/src/commands/DescribePredictorCommand.ts diff --git a/clients/client-forecast/commands/GetAccuracyMetricsCommand.ts b/clients/client-forecast/src/commands/GetAccuracyMetricsCommand.ts similarity index 100% rename from clients/client-forecast/commands/GetAccuracyMetricsCommand.ts rename to clients/client-forecast/src/commands/GetAccuracyMetricsCommand.ts diff --git a/clients/client-forecast/commands/ListDatasetGroupsCommand.ts b/clients/client-forecast/src/commands/ListDatasetGroupsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListDatasetGroupsCommand.ts rename to clients/client-forecast/src/commands/ListDatasetGroupsCommand.ts diff --git a/clients/client-forecast/commands/ListDatasetImportJobsCommand.ts b/clients/client-forecast/src/commands/ListDatasetImportJobsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListDatasetImportJobsCommand.ts rename to clients/client-forecast/src/commands/ListDatasetImportJobsCommand.ts diff --git a/clients/client-forecast/commands/ListDatasetsCommand.ts b/clients/client-forecast/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListDatasetsCommand.ts rename to clients/client-forecast/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-forecast/commands/ListForecastExportJobsCommand.ts b/clients/client-forecast/src/commands/ListForecastExportJobsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListForecastExportJobsCommand.ts rename to clients/client-forecast/src/commands/ListForecastExportJobsCommand.ts diff --git a/clients/client-forecast/commands/ListForecastsCommand.ts b/clients/client-forecast/src/commands/ListForecastsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListForecastsCommand.ts rename to clients/client-forecast/src/commands/ListForecastsCommand.ts diff --git a/clients/client-forecast/commands/ListPredictorBacktestExportJobsCommand.ts b/clients/client-forecast/src/commands/ListPredictorBacktestExportJobsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListPredictorBacktestExportJobsCommand.ts rename to clients/client-forecast/src/commands/ListPredictorBacktestExportJobsCommand.ts diff --git a/clients/client-forecast/commands/ListPredictorsCommand.ts b/clients/client-forecast/src/commands/ListPredictorsCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListPredictorsCommand.ts rename to clients/client-forecast/src/commands/ListPredictorsCommand.ts diff --git a/clients/client-forecast/commands/ListTagsForResourceCommand.ts b/clients/client-forecast/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-forecast/commands/ListTagsForResourceCommand.ts rename to clients/client-forecast/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-forecast/commands/StopResourceCommand.ts b/clients/client-forecast/src/commands/StopResourceCommand.ts similarity index 100% rename from clients/client-forecast/commands/StopResourceCommand.ts rename to clients/client-forecast/src/commands/StopResourceCommand.ts diff --git a/clients/client-forecast/commands/TagResourceCommand.ts b/clients/client-forecast/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-forecast/commands/TagResourceCommand.ts rename to clients/client-forecast/src/commands/TagResourceCommand.ts diff --git a/clients/client-forecast/commands/UntagResourceCommand.ts b/clients/client-forecast/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-forecast/commands/UntagResourceCommand.ts rename to clients/client-forecast/src/commands/UntagResourceCommand.ts diff --git a/clients/client-forecast/commands/UpdateDatasetGroupCommand.ts b/clients/client-forecast/src/commands/UpdateDatasetGroupCommand.ts similarity index 100% rename from clients/client-forecast/commands/UpdateDatasetGroupCommand.ts rename to clients/client-forecast/src/commands/UpdateDatasetGroupCommand.ts diff --git a/clients/client-forecast/endpoints.ts b/clients/client-forecast/src/endpoints.ts similarity index 100% rename from clients/client-forecast/endpoints.ts rename to clients/client-forecast/src/endpoints.ts diff --git a/clients/client-forecast/index.ts b/clients/client-forecast/src/index.ts similarity index 100% rename from clients/client-forecast/index.ts rename to clients/client-forecast/src/index.ts diff --git a/clients/client-forecast/models/index.ts b/clients/client-forecast/src/models/index.ts similarity index 100% rename from clients/client-forecast/models/index.ts rename to clients/client-forecast/src/models/index.ts diff --git a/clients/client-forecast/models/models_0.ts b/clients/client-forecast/src/models/models_0.ts similarity index 100% rename from clients/client-forecast/models/models_0.ts rename to clients/client-forecast/src/models/models_0.ts diff --git a/clients/client-forecast/pagination/Interfaces.ts b/clients/client-forecast/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-forecast/pagination/Interfaces.ts rename to clients/client-forecast/src/pagination/Interfaces.ts diff --git a/clients/client-forecast/pagination/ListDatasetGroupsPaginator.ts b/clients/client-forecast/src/pagination/ListDatasetGroupsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListDatasetGroupsPaginator.ts rename to clients/client-forecast/src/pagination/ListDatasetGroupsPaginator.ts diff --git a/clients/client-forecast/pagination/ListDatasetImportJobsPaginator.ts b/clients/client-forecast/src/pagination/ListDatasetImportJobsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListDatasetImportJobsPaginator.ts rename to clients/client-forecast/src/pagination/ListDatasetImportJobsPaginator.ts diff --git a/clients/client-forecast/pagination/ListDatasetsPaginator.ts b/clients/client-forecast/src/pagination/ListDatasetsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListDatasetsPaginator.ts rename to clients/client-forecast/src/pagination/ListDatasetsPaginator.ts diff --git a/clients/client-forecast/pagination/ListForecastExportJobsPaginator.ts b/clients/client-forecast/src/pagination/ListForecastExportJobsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListForecastExportJobsPaginator.ts rename to clients/client-forecast/src/pagination/ListForecastExportJobsPaginator.ts diff --git a/clients/client-forecast/pagination/ListForecastsPaginator.ts b/clients/client-forecast/src/pagination/ListForecastsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListForecastsPaginator.ts rename to clients/client-forecast/src/pagination/ListForecastsPaginator.ts diff --git a/clients/client-forecast/pagination/ListPredictorBacktestExportJobsPaginator.ts b/clients/client-forecast/src/pagination/ListPredictorBacktestExportJobsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListPredictorBacktestExportJobsPaginator.ts rename to clients/client-forecast/src/pagination/ListPredictorBacktestExportJobsPaginator.ts diff --git a/clients/client-forecast/pagination/ListPredictorsPaginator.ts b/clients/client-forecast/src/pagination/ListPredictorsPaginator.ts similarity index 100% rename from clients/client-forecast/pagination/ListPredictorsPaginator.ts rename to clients/client-forecast/src/pagination/ListPredictorsPaginator.ts diff --git a/clients/client-forecast/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-forecast/protocols/Aws_json1_1.ts rename to clients/client-forecast/src/protocols/Aws_json1_1.ts diff --git a/clients/client-forecast/src/runtimeConfig.browser.ts b/clients/client-forecast/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c367a28caff0 --- /dev/null +++ b/clients/client-forecast/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ForecastClientConfig } from "./ForecastClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ForecastClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-forecast/runtimeConfig.native.ts b/clients/client-forecast/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-forecast/runtimeConfig.native.ts rename to clients/client-forecast/src/runtimeConfig.native.ts diff --git a/clients/client-forecast/runtimeConfig.shared.ts b/clients/client-forecast/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-forecast/runtimeConfig.shared.ts rename to clients/client-forecast/src/runtimeConfig.shared.ts diff --git a/clients/client-forecast/src/runtimeConfig.ts b/clients/client-forecast/src/runtimeConfig.ts new file mode 100644 index 000000000000..3479bae6ab0c --- /dev/null +++ b/clients/client-forecast/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ForecastClientConfig } from "./ForecastClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ForecastClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-forecast/tsconfig.es.json b/clients/client-forecast/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-forecast/tsconfig.es.json +++ b/clients/client-forecast/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-forecast/tsconfig.json b/clients/client-forecast/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-forecast/tsconfig.json +++ b/clients/client-forecast/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-forecast/tsconfig.types.json b/clients/client-forecast/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-forecast/tsconfig.types.json +++ b/clients/client-forecast/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-forecastquery/.gitignore b/clients/client-forecastquery/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-forecastquery/.gitignore +++ b/clients/client-forecastquery/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-forecastquery/package.json b/clients/client-forecastquery/package.json index 3835a7be4668..d232341db9cb 100644 --- a/clients/client-forecastquery/package.json +++ b/clients/client-forecastquery/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-forecastquery", "repository": { "type": "git", diff --git a/clients/client-forecastquery/runtimeConfig.browser.ts b/clients/client-forecastquery/runtimeConfig.browser.ts deleted file mode 100644 index eca312e4d3af..000000000000 --- a/clients/client-forecastquery/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ForecastqueryClientConfig } from "./ForecastqueryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-forecastquery/runtimeConfig.ts b/clients/client-forecastquery/runtimeConfig.ts deleted file mode 100644 index 85dabd37b191..000000000000 --- a/clients/client-forecastquery/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ForecastqueryClientConfig } from "./ForecastqueryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-forecastquery/Forecastquery.ts b/clients/client-forecastquery/src/Forecastquery.ts similarity index 100% rename from clients/client-forecastquery/Forecastquery.ts rename to clients/client-forecastquery/src/Forecastquery.ts diff --git a/clients/client-forecastquery/ForecastqueryClient.ts b/clients/client-forecastquery/src/ForecastqueryClient.ts similarity index 100% rename from clients/client-forecastquery/ForecastqueryClient.ts rename to clients/client-forecastquery/src/ForecastqueryClient.ts diff --git a/clients/client-forecastquery/commands/QueryForecastCommand.ts b/clients/client-forecastquery/src/commands/QueryForecastCommand.ts similarity index 100% rename from clients/client-forecastquery/commands/QueryForecastCommand.ts rename to clients/client-forecastquery/src/commands/QueryForecastCommand.ts diff --git a/clients/client-forecastquery/endpoints.ts b/clients/client-forecastquery/src/endpoints.ts similarity index 100% rename from clients/client-forecastquery/endpoints.ts rename to clients/client-forecastquery/src/endpoints.ts diff --git a/clients/client-forecastquery/index.ts b/clients/client-forecastquery/src/index.ts similarity index 100% rename from clients/client-forecastquery/index.ts rename to clients/client-forecastquery/src/index.ts diff --git a/clients/client-forecastquery/models/index.ts b/clients/client-forecastquery/src/models/index.ts similarity index 100% rename from clients/client-forecastquery/models/index.ts rename to clients/client-forecastquery/src/models/index.ts diff --git a/clients/client-forecastquery/models/models_0.ts b/clients/client-forecastquery/src/models/models_0.ts similarity index 100% rename from clients/client-forecastquery/models/models_0.ts rename to clients/client-forecastquery/src/models/models_0.ts diff --git a/clients/client-forecastquery/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-forecastquery/protocols/Aws_json1_1.ts rename to clients/client-forecastquery/src/protocols/Aws_json1_1.ts diff --git a/clients/client-forecastquery/src/runtimeConfig.browser.ts b/clients/client-forecastquery/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9f4f0a54783f --- /dev/null +++ b/clients/client-forecastquery/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ForecastqueryClientConfig } from "./ForecastqueryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-forecastquery/runtimeConfig.native.ts b/clients/client-forecastquery/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-forecastquery/runtimeConfig.native.ts rename to clients/client-forecastquery/src/runtimeConfig.native.ts diff --git a/clients/client-forecastquery/runtimeConfig.shared.ts b/clients/client-forecastquery/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-forecastquery/runtimeConfig.shared.ts rename to clients/client-forecastquery/src/runtimeConfig.shared.ts diff --git a/clients/client-forecastquery/src/runtimeConfig.ts b/clients/client-forecastquery/src/runtimeConfig.ts new file mode 100644 index 000000000000..bc70aed769ef --- /dev/null +++ b/clients/client-forecastquery/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ForecastqueryClientConfig } from "./ForecastqueryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-forecastquery/tsconfig.es.json b/clients/client-forecastquery/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-forecastquery/tsconfig.es.json +++ b/clients/client-forecastquery/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-forecastquery/tsconfig.json b/clients/client-forecastquery/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-forecastquery/tsconfig.json +++ b/clients/client-forecastquery/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-forecastquery/tsconfig.types.json b/clients/client-forecastquery/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-forecastquery/tsconfig.types.json +++ b/clients/client-forecastquery/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-frauddetector/.gitignore b/clients/client-frauddetector/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-frauddetector/.gitignore +++ b/clients/client-frauddetector/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-frauddetector/package.json b/clients/client-frauddetector/package.json index 2b468165bc48..6e91cfd42028 100644 --- a/clients/client-frauddetector/package.json +++ b/clients/client-frauddetector/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-frauddetector", "repository": { "type": "git", diff --git a/clients/client-frauddetector/runtimeConfig.browser.ts b/clients/client-frauddetector/runtimeConfig.browser.ts deleted file mode 100644 index e486760e5168..000000000000 --- a/clients/client-frauddetector/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FraudDetectorClientConfig } from "./FraudDetectorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-frauddetector/runtimeConfig.ts b/clients/client-frauddetector/runtimeConfig.ts deleted file mode 100644 index c8107cf3d582..000000000000 --- a/clients/client-frauddetector/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FraudDetectorClientConfig } from "./FraudDetectorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-frauddetector/FraudDetector.ts b/clients/client-frauddetector/src/FraudDetector.ts similarity index 100% rename from clients/client-frauddetector/FraudDetector.ts rename to clients/client-frauddetector/src/FraudDetector.ts diff --git a/clients/client-frauddetector/FraudDetectorClient.ts b/clients/client-frauddetector/src/FraudDetectorClient.ts similarity index 100% rename from clients/client-frauddetector/FraudDetectorClient.ts rename to clients/client-frauddetector/src/FraudDetectorClient.ts diff --git a/clients/client-frauddetector/commands/BatchCreateVariableCommand.ts b/clients/client-frauddetector/src/commands/BatchCreateVariableCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/BatchCreateVariableCommand.ts rename to clients/client-frauddetector/src/commands/BatchCreateVariableCommand.ts diff --git a/clients/client-frauddetector/commands/BatchGetVariableCommand.ts b/clients/client-frauddetector/src/commands/BatchGetVariableCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/BatchGetVariableCommand.ts rename to clients/client-frauddetector/src/commands/BatchGetVariableCommand.ts diff --git a/clients/client-frauddetector/commands/CancelBatchPredictionJobCommand.ts b/clients/client-frauddetector/src/commands/CancelBatchPredictionJobCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CancelBatchPredictionJobCommand.ts rename to clients/client-frauddetector/src/commands/CancelBatchPredictionJobCommand.ts diff --git a/clients/client-frauddetector/commands/CreateBatchPredictionJobCommand.ts b/clients/client-frauddetector/src/commands/CreateBatchPredictionJobCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateBatchPredictionJobCommand.ts rename to clients/client-frauddetector/src/commands/CreateBatchPredictionJobCommand.ts diff --git a/clients/client-frauddetector/commands/CreateDetectorVersionCommand.ts b/clients/client-frauddetector/src/commands/CreateDetectorVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateDetectorVersionCommand.ts rename to clients/client-frauddetector/src/commands/CreateDetectorVersionCommand.ts diff --git a/clients/client-frauddetector/commands/CreateModelCommand.ts b/clients/client-frauddetector/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateModelCommand.ts rename to clients/client-frauddetector/src/commands/CreateModelCommand.ts diff --git a/clients/client-frauddetector/commands/CreateModelVersionCommand.ts b/clients/client-frauddetector/src/commands/CreateModelVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateModelVersionCommand.ts rename to clients/client-frauddetector/src/commands/CreateModelVersionCommand.ts diff --git a/clients/client-frauddetector/commands/CreateRuleCommand.ts b/clients/client-frauddetector/src/commands/CreateRuleCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateRuleCommand.ts rename to clients/client-frauddetector/src/commands/CreateRuleCommand.ts diff --git a/clients/client-frauddetector/commands/CreateVariableCommand.ts b/clients/client-frauddetector/src/commands/CreateVariableCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/CreateVariableCommand.ts rename to clients/client-frauddetector/src/commands/CreateVariableCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteBatchPredictionJobCommand.ts b/clients/client-frauddetector/src/commands/DeleteBatchPredictionJobCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteBatchPredictionJobCommand.ts rename to clients/client-frauddetector/src/commands/DeleteBatchPredictionJobCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteDetectorCommand.ts b/clients/client-frauddetector/src/commands/DeleteDetectorCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteDetectorCommand.ts rename to clients/client-frauddetector/src/commands/DeleteDetectorCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteDetectorVersionCommand.ts b/clients/client-frauddetector/src/commands/DeleteDetectorVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteDetectorVersionCommand.ts rename to clients/client-frauddetector/src/commands/DeleteDetectorVersionCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteEntityTypeCommand.ts b/clients/client-frauddetector/src/commands/DeleteEntityTypeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteEntityTypeCommand.ts rename to clients/client-frauddetector/src/commands/DeleteEntityTypeCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteEventCommand.ts b/clients/client-frauddetector/src/commands/DeleteEventCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteEventCommand.ts rename to clients/client-frauddetector/src/commands/DeleteEventCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteEventTypeCommand.ts b/clients/client-frauddetector/src/commands/DeleteEventTypeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteEventTypeCommand.ts rename to clients/client-frauddetector/src/commands/DeleteEventTypeCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteExternalModelCommand.ts b/clients/client-frauddetector/src/commands/DeleteExternalModelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteExternalModelCommand.ts rename to clients/client-frauddetector/src/commands/DeleteExternalModelCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteLabelCommand.ts b/clients/client-frauddetector/src/commands/DeleteLabelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteLabelCommand.ts rename to clients/client-frauddetector/src/commands/DeleteLabelCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteModelCommand.ts b/clients/client-frauddetector/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteModelCommand.ts rename to clients/client-frauddetector/src/commands/DeleteModelCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteModelVersionCommand.ts b/clients/client-frauddetector/src/commands/DeleteModelVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteModelVersionCommand.ts rename to clients/client-frauddetector/src/commands/DeleteModelVersionCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteOutcomeCommand.ts b/clients/client-frauddetector/src/commands/DeleteOutcomeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteOutcomeCommand.ts rename to clients/client-frauddetector/src/commands/DeleteOutcomeCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteRuleCommand.ts b/clients/client-frauddetector/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteRuleCommand.ts rename to clients/client-frauddetector/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-frauddetector/commands/DeleteVariableCommand.ts b/clients/client-frauddetector/src/commands/DeleteVariableCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DeleteVariableCommand.ts rename to clients/client-frauddetector/src/commands/DeleteVariableCommand.ts diff --git a/clients/client-frauddetector/commands/DescribeDetectorCommand.ts b/clients/client-frauddetector/src/commands/DescribeDetectorCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DescribeDetectorCommand.ts rename to clients/client-frauddetector/src/commands/DescribeDetectorCommand.ts diff --git a/clients/client-frauddetector/commands/DescribeModelVersionsCommand.ts b/clients/client-frauddetector/src/commands/DescribeModelVersionsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/DescribeModelVersionsCommand.ts rename to clients/client-frauddetector/src/commands/DescribeModelVersionsCommand.ts diff --git a/clients/client-frauddetector/commands/GetBatchPredictionJobsCommand.ts b/clients/client-frauddetector/src/commands/GetBatchPredictionJobsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetBatchPredictionJobsCommand.ts rename to clients/client-frauddetector/src/commands/GetBatchPredictionJobsCommand.ts diff --git a/clients/client-frauddetector/commands/GetDetectorVersionCommand.ts b/clients/client-frauddetector/src/commands/GetDetectorVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetDetectorVersionCommand.ts rename to clients/client-frauddetector/src/commands/GetDetectorVersionCommand.ts diff --git a/clients/client-frauddetector/commands/GetDetectorsCommand.ts b/clients/client-frauddetector/src/commands/GetDetectorsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetDetectorsCommand.ts rename to clients/client-frauddetector/src/commands/GetDetectorsCommand.ts diff --git a/clients/client-frauddetector/commands/GetEntityTypesCommand.ts b/clients/client-frauddetector/src/commands/GetEntityTypesCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetEntityTypesCommand.ts rename to clients/client-frauddetector/src/commands/GetEntityTypesCommand.ts diff --git a/clients/client-frauddetector/commands/GetEventPredictionCommand.ts b/clients/client-frauddetector/src/commands/GetEventPredictionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetEventPredictionCommand.ts rename to clients/client-frauddetector/src/commands/GetEventPredictionCommand.ts diff --git a/clients/client-frauddetector/commands/GetEventTypesCommand.ts b/clients/client-frauddetector/src/commands/GetEventTypesCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetEventTypesCommand.ts rename to clients/client-frauddetector/src/commands/GetEventTypesCommand.ts diff --git a/clients/client-frauddetector/commands/GetExternalModelsCommand.ts b/clients/client-frauddetector/src/commands/GetExternalModelsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetExternalModelsCommand.ts rename to clients/client-frauddetector/src/commands/GetExternalModelsCommand.ts diff --git a/clients/client-frauddetector/commands/GetKMSEncryptionKeyCommand.ts b/clients/client-frauddetector/src/commands/GetKMSEncryptionKeyCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetKMSEncryptionKeyCommand.ts rename to clients/client-frauddetector/src/commands/GetKMSEncryptionKeyCommand.ts diff --git a/clients/client-frauddetector/commands/GetLabelsCommand.ts b/clients/client-frauddetector/src/commands/GetLabelsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetLabelsCommand.ts rename to clients/client-frauddetector/src/commands/GetLabelsCommand.ts diff --git a/clients/client-frauddetector/commands/GetModelVersionCommand.ts b/clients/client-frauddetector/src/commands/GetModelVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetModelVersionCommand.ts rename to clients/client-frauddetector/src/commands/GetModelVersionCommand.ts diff --git a/clients/client-frauddetector/commands/GetModelsCommand.ts b/clients/client-frauddetector/src/commands/GetModelsCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetModelsCommand.ts rename to clients/client-frauddetector/src/commands/GetModelsCommand.ts diff --git a/clients/client-frauddetector/commands/GetOutcomesCommand.ts b/clients/client-frauddetector/src/commands/GetOutcomesCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetOutcomesCommand.ts rename to clients/client-frauddetector/src/commands/GetOutcomesCommand.ts diff --git a/clients/client-frauddetector/commands/GetRulesCommand.ts b/clients/client-frauddetector/src/commands/GetRulesCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetRulesCommand.ts rename to clients/client-frauddetector/src/commands/GetRulesCommand.ts diff --git a/clients/client-frauddetector/commands/GetVariablesCommand.ts b/clients/client-frauddetector/src/commands/GetVariablesCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/GetVariablesCommand.ts rename to clients/client-frauddetector/src/commands/GetVariablesCommand.ts diff --git a/clients/client-frauddetector/commands/ListTagsForResourceCommand.ts b/clients/client-frauddetector/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/ListTagsForResourceCommand.ts rename to clients/client-frauddetector/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-frauddetector/commands/PutDetectorCommand.ts b/clients/client-frauddetector/src/commands/PutDetectorCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutDetectorCommand.ts rename to clients/client-frauddetector/src/commands/PutDetectorCommand.ts diff --git a/clients/client-frauddetector/commands/PutEntityTypeCommand.ts b/clients/client-frauddetector/src/commands/PutEntityTypeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutEntityTypeCommand.ts rename to clients/client-frauddetector/src/commands/PutEntityTypeCommand.ts diff --git a/clients/client-frauddetector/commands/PutEventTypeCommand.ts b/clients/client-frauddetector/src/commands/PutEventTypeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutEventTypeCommand.ts rename to clients/client-frauddetector/src/commands/PutEventTypeCommand.ts diff --git a/clients/client-frauddetector/commands/PutExternalModelCommand.ts b/clients/client-frauddetector/src/commands/PutExternalModelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutExternalModelCommand.ts rename to clients/client-frauddetector/src/commands/PutExternalModelCommand.ts diff --git a/clients/client-frauddetector/commands/PutKMSEncryptionKeyCommand.ts b/clients/client-frauddetector/src/commands/PutKMSEncryptionKeyCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutKMSEncryptionKeyCommand.ts rename to clients/client-frauddetector/src/commands/PutKMSEncryptionKeyCommand.ts diff --git a/clients/client-frauddetector/commands/PutLabelCommand.ts b/clients/client-frauddetector/src/commands/PutLabelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutLabelCommand.ts rename to clients/client-frauddetector/src/commands/PutLabelCommand.ts diff --git a/clients/client-frauddetector/commands/PutOutcomeCommand.ts b/clients/client-frauddetector/src/commands/PutOutcomeCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/PutOutcomeCommand.ts rename to clients/client-frauddetector/src/commands/PutOutcomeCommand.ts diff --git a/clients/client-frauddetector/commands/TagResourceCommand.ts b/clients/client-frauddetector/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/TagResourceCommand.ts rename to clients/client-frauddetector/src/commands/TagResourceCommand.ts diff --git a/clients/client-frauddetector/commands/UntagResourceCommand.ts b/clients/client-frauddetector/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UntagResourceCommand.ts rename to clients/client-frauddetector/src/commands/UntagResourceCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateDetectorVersionCommand.ts b/clients/client-frauddetector/src/commands/UpdateDetectorVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateDetectorVersionCommand.ts rename to clients/client-frauddetector/src/commands/UpdateDetectorVersionCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateDetectorVersionMetadataCommand.ts b/clients/client-frauddetector/src/commands/UpdateDetectorVersionMetadataCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateDetectorVersionMetadataCommand.ts rename to clients/client-frauddetector/src/commands/UpdateDetectorVersionMetadataCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateDetectorVersionStatusCommand.ts b/clients/client-frauddetector/src/commands/UpdateDetectorVersionStatusCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateDetectorVersionStatusCommand.ts rename to clients/client-frauddetector/src/commands/UpdateDetectorVersionStatusCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateModelCommand.ts b/clients/client-frauddetector/src/commands/UpdateModelCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateModelCommand.ts rename to clients/client-frauddetector/src/commands/UpdateModelCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateModelVersionCommand.ts b/clients/client-frauddetector/src/commands/UpdateModelVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateModelVersionCommand.ts rename to clients/client-frauddetector/src/commands/UpdateModelVersionCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateModelVersionStatusCommand.ts b/clients/client-frauddetector/src/commands/UpdateModelVersionStatusCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateModelVersionStatusCommand.ts rename to clients/client-frauddetector/src/commands/UpdateModelVersionStatusCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateRuleMetadataCommand.ts b/clients/client-frauddetector/src/commands/UpdateRuleMetadataCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateRuleMetadataCommand.ts rename to clients/client-frauddetector/src/commands/UpdateRuleMetadataCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateRuleVersionCommand.ts b/clients/client-frauddetector/src/commands/UpdateRuleVersionCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateRuleVersionCommand.ts rename to clients/client-frauddetector/src/commands/UpdateRuleVersionCommand.ts diff --git a/clients/client-frauddetector/commands/UpdateVariableCommand.ts b/clients/client-frauddetector/src/commands/UpdateVariableCommand.ts similarity index 100% rename from clients/client-frauddetector/commands/UpdateVariableCommand.ts rename to clients/client-frauddetector/src/commands/UpdateVariableCommand.ts diff --git a/clients/client-frauddetector/endpoints.ts b/clients/client-frauddetector/src/endpoints.ts similarity index 100% rename from clients/client-frauddetector/endpoints.ts rename to clients/client-frauddetector/src/endpoints.ts diff --git a/clients/client-frauddetector/index.ts b/clients/client-frauddetector/src/index.ts similarity index 100% rename from clients/client-frauddetector/index.ts rename to clients/client-frauddetector/src/index.ts diff --git a/clients/client-frauddetector/models/index.ts b/clients/client-frauddetector/src/models/index.ts similarity index 100% rename from clients/client-frauddetector/models/index.ts rename to clients/client-frauddetector/src/models/index.ts diff --git a/clients/client-frauddetector/models/models_0.ts b/clients/client-frauddetector/src/models/models_0.ts similarity index 100% rename from clients/client-frauddetector/models/models_0.ts rename to clients/client-frauddetector/src/models/models_0.ts diff --git a/clients/client-frauddetector/pagination/DescribeModelVersionsPaginator.ts b/clients/client-frauddetector/src/pagination/DescribeModelVersionsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/DescribeModelVersionsPaginator.ts rename to clients/client-frauddetector/src/pagination/DescribeModelVersionsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetBatchPredictionJobsPaginator.ts b/clients/client-frauddetector/src/pagination/GetBatchPredictionJobsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetBatchPredictionJobsPaginator.ts rename to clients/client-frauddetector/src/pagination/GetBatchPredictionJobsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetDetectorsPaginator.ts b/clients/client-frauddetector/src/pagination/GetDetectorsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetDetectorsPaginator.ts rename to clients/client-frauddetector/src/pagination/GetDetectorsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetEntityTypesPaginator.ts b/clients/client-frauddetector/src/pagination/GetEntityTypesPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetEntityTypesPaginator.ts rename to clients/client-frauddetector/src/pagination/GetEntityTypesPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetEventTypesPaginator.ts b/clients/client-frauddetector/src/pagination/GetEventTypesPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetEventTypesPaginator.ts rename to clients/client-frauddetector/src/pagination/GetEventTypesPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetExternalModelsPaginator.ts b/clients/client-frauddetector/src/pagination/GetExternalModelsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetExternalModelsPaginator.ts rename to clients/client-frauddetector/src/pagination/GetExternalModelsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetLabelsPaginator.ts b/clients/client-frauddetector/src/pagination/GetLabelsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetLabelsPaginator.ts rename to clients/client-frauddetector/src/pagination/GetLabelsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetModelsPaginator.ts b/clients/client-frauddetector/src/pagination/GetModelsPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetModelsPaginator.ts rename to clients/client-frauddetector/src/pagination/GetModelsPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetOutcomesPaginator.ts b/clients/client-frauddetector/src/pagination/GetOutcomesPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetOutcomesPaginator.ts rename to clients/client-frauddetector/src/pagination/GetOutcomesPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetRulesPaginator.ts b/clients/client-frauddetector/src/pagination/GetRulesPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetRulesPaginator.ts rename to clients/client-frauddetector/src/pagination/GetRulesPaginator.ts diff --git a/clients/client-frauddetector/pagination/GetVariablesPaginator.ts b/clients/client-frauddetector/src/pagination/GetVariablesPaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/GetVariablesPaginator.ts rename to clients/client-frauddetector/src/pagination/GetVariablesPaginator.ts diff --git a/clients/client-frauddetector/pagination/Interfaces.ts b/clients/client-frauddetector/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-frauddetector/pagination/Interfaces.ts rename to clients/client-frauddetector/src/pagination/Interfaces.ts diff --git a/clients/client-frauddetector/pagination/ListTagsForResourcePaginator.ts b/clients/client-frauddetector/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-frauddetector/pagination/ListTagsForResourcePaginator.ts rename to clients/client-frauddetector/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-frauddetector/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-frauddetector/protocols/Aws_json1_1.ts rename to clients/client-frauddetector/src/protocols/Aws_json1_1.ts diff --git a/clients/client-frauddetector/src/runtimeConfig.browser.ts b/clients/client-frauddetector/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..48cc947d06ff --- /dev/null +++ b/clients/client-frauddetector/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FraudDetectorClientConfig } from "./FraudDetectorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-frauddetector/runtimeConfig.native.ts b/clients/client-frauddetector/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-frauddetector/runtimeConfig.native.ts rename to clients/client-frauddetector/src/runtimeConfig.native.ts diff --git a/clients/client-frauddetector/runtimeConfig.shared.ts b/clients/client-frauddetector/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-frauddetector/runtimeConfig.shared.ts rename to clients/client-frauddetector/src/runtimeConfig.shared.ts diff --git a/clients/client-frauddetector/src/runtimeConfig.ts b/clients/client-frauddetector/src/runtimeConfig.ts new file mode 100644 index 000000000000..904b9483bb50 --- /dev/null +++ b/clients/client-frauddetector/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FraudDetectorClientConfig } from "./FraudDetectorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-frauddetector/tsconfig.es.json b/clients/client-frauddetector/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-frauddetector/tsconfig.es.json +++ b/clients/client-frauddetector/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-frauddetector/tsconfig.json b/clients/client-frauddetector/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-frauddetector/tsconfig.json +++ b/clients/client-frauddetector/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-frauddetector/tsconfig.types.json b/clients/client-frauddetector/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-frauddetector/tsconfig.types.json +++ b/clients/client-frauddetector/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-fsx/.gitignore b/clients/client-fsx/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-fsx/.gitignore +++ b/clients/client-fsx/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-fsx/package.json b/clients/client-fsx/package.json index a11e2fde6d2c..f99ac567454c 100644 --- a/clients/client-fsx/package.json +++ b/clients/client-fsx/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-fsx", "repository": { "type": "git", diff --git a/clients/client-fsx/runtimeConfig.browser.ts b/clients/client-fsx/runtimeConfig.browser.ts deleted file mode 100644 index 412011d96aa4..000000000000 --- a/clients/client-fsx/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { FSxClientConfig } from "./FSxClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FSxClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fsx/runtimeConfig.ts b/clients/client-fsx/runtimeConfig.ts deleted file mode 100644 index bb8b95176b99..000000000000 --- a/clients/client-fsx/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { FSxClientConfig } from "./FSxClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: FSxClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-fsx/FSx.ts b/clients/client-fsx/src/FSx.ts similarity index 100% rename from clients/client-fsx/FSx.ts rename to clients/client-fsx/src/FSx.ts diff --git a/clients/client-fsx/FSxClient.ts b/clients/client-fsx/src/FSxClient.ts similarity index 100% rename from clients/client-fsx/FSxClient.ts rename to clients/client-fsx/src/FSxClient.ts diff --git a/clients/client-fsx/commands/AssociateFileSystemAliasesCommand.ts b/clients/client-fsx/src/commands/AssociateFileSystemAliasesCommand.ts similarity index 100% rename from clients/client-fsx/commands/AssociateFileSystemAliasesCommand.ts rename to clients/client-fsx/src/commands/AssociateFileSystemAliasesCommand.ts diff --git a/clients/client-fsx/commands/CancelDataRepositoryTaskCommand.ts b/clients/client-fsx/src/commands/CancelDataRepositoryTaskCommand.ts similarity index 100% rename from clients/client-fsx/commands/CancelDataRepositoryTaskCommand.ts rename to clients/client-fsx/src/commands/CancelDataRepositoryTaskCommand.ts diff --git a/clients/client-fsx/commands/CopyBackupCommand.ts b/clients/client-fsx/src/commands/CopyBackupCommand.ts similarity index 100% rename from clients/client-fsx/commands/CopyBackupCommand.ts rename to clients/client-fsx/src/commands/CopyBackupCommand.ts diff --git a/clients/client-fsx/commands/CreateBackupCommand.ts b/clients/client-fsx/src/commands/CreateBackupCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateBackupCommand.ts rename to clients/client-fsx/src/commands/CreateBackupCommand.ts diff --git a/clients/client-fsx/commands/CreateDataRepositoryTaskCommand.ts b/clients/client-fsx/src/commands/CreateDataRepositoryTaskCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateDataRepositoryTaskCommand.ts rename to clients/client-fsx/src/commands/CreateDataRepositoryTaskCommand.ts diff --git a/clients/client-fsx/commands/CreateFileSystemCommand.ts b/clients/client-fsx/src/commands/CreateFileSystemCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateFileSystemCommand.ts rename to clients/client-fsx/src/commands/CreateFileSystemCommand.ts diff --git a/clients/client-fsx/commands/CreateFileSystemFromBackupCommand.ts b/clients/client-fsx/src/commands/CreateFileSystemFromBackupCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateFileSystemFromBackupCommand.ts rename to clients/client-fsx/src/commands/CreateFileSystemFromBackupCommand.ts diff --git a/clients/client-fsx/commands/CreateStorageVirtualMachineCommand.ts b/clients/client-fsx/src/commands/CreateStorageVirtualMachineCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateStorageVirtualMachineCommand.ts rename to clients/client-fsx/src/commands/CreateStorageVirtualMachineCommand.ts diff --git a/clients/client-fsx/commands/CreateVolumeCommand.ts b/clients/client-fsx/src/commands/CreateVolumeCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateVolumeCommand.ts rename to clients/client-fsx/src/commands/CreateVolumeCommand.ts diff --git a/clients/client-fsx/commands/CreateVolumeFromBackupCommand.ts b/clients/client-fsx/src/commands/CreateVolumeFromBackupCommand.ts similarity index 100% rename from clients/client-fsx/commands/CreateVolumeFromBackupCommand.ts rename to clients/client-fsx/src/commands/CreateVolumeFromBackupCommand.ts diff --git a/clients/client-fsx/commands/DeleteBackupCommand.ts b/clients/client-fsx/src/commands/DeleteBackupCommand.ts similarity index 100% rename from clients/client-fsx/commands/DeleteBackupCommand.ts rename to clients/client-fsx/src/commands/DeleteBackupCommand.ts diff --git a/clients/client-fsx/commands/DeleteFileSystemCommand.ts b/clients/client-fsx/src/commands/DeleteFileSystemCommand.ts similarity index 100% rename from clients/client-fsx/commands/DeleteFileSystemCommand.ts rename to clients/client-fsx/src/commands/DeleteFileSystemCommand.ts diff --git a/clients/client-fsx/commands/DeleteStorageVirtualMachineCommand.ts b/clients/client-fsx/src/commands/DeleteStorageVirtualMachineCommand.ts similarity index 100% rename from clients/client-fsx/commands/DeleteStorageVirtualMachineCommand.ts rename to clients/client-fsx/src/commands/DeleteStorageVirtualMachineCommand.ts diff --git a/clients/client-fsx/commands/DeleteVolumeCommand.ts b/clients/client-fsx/src/commands/DeleteVolumeCommand.ts similarity index 100% rename from clients/client-fsx/commands/DeleteVolumeCommand.ts rename to clients/client-fsx/src/commands/DeleteVolumeCommand.ts diff --git a/clients/client-fsx/commands/DescribeBackupsCommand.ts b/clients/client-fsx/src/commands/DescribeBackupsCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeBackupsCommand.ts rename to clients/client-fsx/src/commands/DescribeBackupsCommand.ts diff --git a/clients/client-fsx/commands/DescribeDataRepositoryTasksCommand.ts b/clients/client-fsx/src/commands/DescribeDataRepositoryTasksCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeDataRepositoryTasksCommand.ts rename to clients/client-fsx/src/commands/DescribeDataRepositoryTasksCommand.ts diff --git a/clients/client-fsx/commands/DescribeFileSystemAliasesCommand.ts b/clients/client-fsx/src/commands/DescribeFileSystemAliasesCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeFileSystemAliasesCommand.ts rename to clients/client-fsx/src/commands/DescribeFileSystemAliasesCommand.ts diff --git a/clients/client-fsx/commands/DescribeFileSystemsCommand.ts b/clients/client-fsx/src/commands/DescribeFileSystemsCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeFileSystemsCommand.ts rename to clients/client-fsx/src/commands/DescribeFileSystemsCommand.ts diff --git a/clients/client-fsx/commands/DescribeStorageVirtualMachinesCommand.ts b/clients/client-fsx/src/commands/DescribeStorageVirtualMachinesCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeStorageVirtualMachinesCommand.ts rename to clients/client-fsx/src/commands/DescribeStorageVirtualMachinesCommand.ts diff --git a/clients/client-fsx/commands/DescribeVolumesCommand.ts b/clients/client-fsx/src/commands/DescribeVolumesCommand.ts similarity index 100% rename from clients/client-fsx/commands/DescribeVolumesCommand.ts rename to clients/client-fsx/src/commands/DescribeVolumesCommand.ts diff --git a/clients/client-fsx/commands/DisassociateFileSystemAliasesCommand.ts b/clients/client-fsx/src/commands/DisassociateFileSystemAliasesCommand.ts similarity index 100% rename from clients/client-fsx/commands/DisassociateFileSystemAliasesCommand.ts rename to clients/client-fsx/src/commands/DisassociateFileSystemAliasesCommand.ts diff --git a/clients/client-fsx/commands/ListTagsForResourceCommand.ts b/clients/client-fsx/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-fsx/commands/ListTagsForResourceCommand.ts rename to clients/client-fsx/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-fsx/commands/TagResourceCommand.ts b/clients/client-fsx/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-fsx/commands/TagResourceCommand.ts rename to clients/client-fsx/src/commands/TagResourceCommand.ts diff --git a/clients/client-fsx/commands/UntagResourceCommand.ts b/clients/client-fsx/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-fsx/commands/UntagResourceCommand.ts rename to clients/client-fsx/src/commands/UntagResourceCommand.ts diff --git a/clients/client-fsx/commands/UpdateFileSystemCommand.ts b/clients/client-fsx/src/commands/UpdateFileSystemCommand.ts similarity index 100% rename from clients/client-fsx/commands/UpdateFileSystemCommand.ts rename to clients/client-fsx/src/commands/UpdateFileSystemCommand.ts diff --git a/clients/client-fsx/commands/UpdateStorageVirtualMachineCommand.ts b/clients/client-fsx/src/commands/UpdateStorageVirtualMachineCommand.ts similarity index 100% rename from clients/client-fsx/commands/UpdateStorageVirtualMachineCommand.ts rename to clients/client-fsx/src/commands/UpdateStorageVirtualMachineCommand.ts diff --git a/clients/client-fsx/commands/UpdateVolumeCommand.ts b/clients/client-fsx/src/commands/UpdateVolumeCommand.ts similarity index 100% rename from clients/client-fsx/commands/UpdateVolumeCommand.ts rename to clients/client-fsx/src/commands/UpdateVolumeCommand.ts diff --git a/clients/client-fsx/endpoints.ts b/clients/client-fsx/src/endpoints.ts similarity index 100% rename from clients/client-fsx/endpoints.ts rename to clients/client-fsx/src/endpoints.ts diff --git a/clients/client-fsx/index.ts b/clients/client-fsx/src/index.ts similarity index 100% rename from clients/client-fsx/index.ts rename to clients/client-fsx/src/index.ts diff --git a/clients/client-fsx/models/index.ts b/clients/client-fsx/src/models/index.ts similarity index 100% rename from clients/client-fsx/models/index.ts rename to clients/client-fsx/src/models/index.ts diff --git a/clients/client-fsx/models/models_0.ts b/clients/client-fsx/src/models/models_0.ts similarity index 100% rename from clients/client-fsx/models/models_0.ts rename to clients/client-fsx/src/models/models_0.ts diff --git a/clients/client-fsx/pagination/DescribeBackupsPaginator.ts b/clients/client-fsx/src/pagination/DescribeBackupsPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeBackupsPaginator.ts rename to clients/client-fsx/src/pagination/DescribeBackupsPaginator.ts diff --git a/clients/client-fsx/pagination/DescribeDataRepositoryTasksPaginator.ts b/clients/client-fsx/src/pagination/DescribeDataRepositoryTasksPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeDataRepositoryTasksPaginator.ts rename to clients/client-fsx/src/pagination/DescribeDataRepositoryTasksPaginator.ts diff --git a/clients/client-fsx/pagination/DescribeFileSystemAliasesPaginator.ts b/clients/client-fsx/src/pagination/DescribeFileSystemAliasesPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeFileSystemAliasesPaginator.ts rename to clients/client-fsx/src/pagination/DescribeFileSystemAliasesPaginator.ts diff --git a/clients/client-fsx/pagination/DescribeFileSystemsPaginator.ts b/clients/client-fsx/src/pagination/DescribeFileSystemsPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeFileSystemsPaginator.ts rename to clients/client-fsx/src/pagination/DescribeFileSystemsPaginator.ts diff --git a/clients/client-fsx/pagination/DescribeStorageVirtualMachinesPaginator.ts b/clients/client-fsx/src/pagination/DescribeStorageVirtualMachinesPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeStorageVirtualMachinesPaginator.ts rename to clients/client-fsx/src/pagination/DescribeStorageVirtualMachinesPaginator.ts diff --git a/clients/client-fsx/pagination/DescribeVolumesPaginator.ts b/clients/client-fsx/src/pagination/DescribeVolumesPaginator.ts similarity index 100% rename from clients/client-fsx/pagination/DescribeVolumesPaginator.ts rename to clients/client-fsx/src/pagination/DescribeVolumesPaginator.ts diff --git a/clients/client-fsx/pagination/Interfaces.ts b/clients/client-fsx/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-fsx/pagination/Interfaces.ts rename to clients/client-fsx/src/pagination/Interfaces.ts diff --git a/clients/client-fsx/pagination/ListTagsForResourcePaginator.ts b/clients/client-fsx/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-fsx/pagination/ListTagsForResourcePaginator.ts rename to clients/client-fsx/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-fsx/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-fsx/protocols/Aws_json1_1.ts rename to clients/client-fsx/src/protocols/Aws_json1_1.ts diff --git a/clients/client-fsx/src/runtimeConfig.browser.ts b/clients/client-fsx/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6dd118d1f28f --- /dev/null +++ b/clients/client-fsx/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { FSxClientConfig } from "./FSxClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FSxClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fsx/runtimeConfig.native.ts b/clients/client-fsx/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-fsx/runtimeConfig.native.ts rename to clients/client-fsx/src/runtimeConfig.native.ts diff --git a/clients/client-fsx/runtimeConfig.shared.ts b/clients/client-fsx/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-fsx/runtimeConfig.shared.ts rename to clients/client-fsx/src/runtimeConfig.shared.ts diff --git a/clients/client-fsx/src/runtimeConfig.ts b/clients/client-fsx/src/runtimeConfig.ts new file mode 100644 index 000000000000..8fd298d7cfe8 --- /dev/null +++ b/clients/client-fsx/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { FSxClientConfig } from "./FSxClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: FSxClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-fsx/tsconfig.es.json b/clients/client-fsx/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-fsx/tsconfig.es.json +++ b/clients/client-fsx/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-fsx/tsconfig.json b/clients/client-fsx/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-fsx/tsconfig.json +++ b/clients/client-fsx/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-fsx/tsconfig.types.json b/clients/client-fsx/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-fsx/tsconfig.types.json +++ b/clients/client-fsx/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-gamelift/.gitignore b/clients/client-gamelift/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-gamelift/.gitignore +++ b/clients/client-gamelift/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-gamelift/package.json b/clients/client-gamelift/package.json index 45a19d63182d..073134b7420e 100644 --- a/clients/client-gamelift/package.json +++ b/clients/client-gamelift/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-gamelift", "repository": { "type": "git", diff --git a/clients/client-gamelift/runtimeConfig.browser.ts b/clients/client-gamelift/runtimeConfig.browser.ts deleted file mode 100644 index 4bd162634a41..000000000000 --- a/clients/client-gamelift/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GameLiftClientConfig } from "./GameLiftClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GameLiftClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-gamelift/runtimeConfig.ts b/clients/client-gamelift/runtimeConfig.ts deleted file mode 100644 index f7ddb7fa2bf7..000000000000 --- a/clients/client-gamelift/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GameLiftClientConfig } from "./GameLiftClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GameLiftClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-gamelift/GameLift.ts b/clients/client-gamelift/src/GameLift.ts similarity index 100% rename from clients/client-gamelift/GameLift.ts rename to clients/client-gamelift/src/GameLift.ts diff --git a/clients/client-gamelift/GameLiftClient.ts b/clients/client-gamelift/src/GameLiftClient.ts similarity index 100% rename from clients/client-gamelift/GameLiftClient.ts rename to clients/client-gamelift/src/GameLiftClient.ts diff --git a/clients/client-gamelift/commands/AcceptMatchCommand.ts b/clients/client-gamelift/src/commands/AcceptMatchCommand.ts similarity index 100% rename from clients/client-gamelift/commands/AcceptMatchCommand.ts rename to clients/client-gamelift/src/commands/AcceptMatchCommand.ts diff --git a/clients/client-gamelift/commands/ClaimGameServerCommand.ts b/clients/client-gamelift/src/commands/ClaimGameServerCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ClaimGameServerCommand.ts rename to clients/client-gamelift/src/commands/ClaimGameServerCommand.ts diff --git a/clients/client-gamelift/commands/CreateAliasCommand.ts b/clients/client-gamelift/src/commands/CreateAliasCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateAliasCommand.ts rename to clients/client-gamelift/src/commands/CreateAliasCommand.ts diff --git a/clients/client-gamelift/commands/CreateBuildCommand.ts b/clients/client-gamelift/src/commands/CreateBuildCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateBuildCommand.ts rename to clients/client-gamelift/src/commands/CreateBuildCommand.ts diff --git a/clients/client-gamelift/commands/CreateFleetCommand.ts b/clients/client-gamelift/src/commands/CreateFleetCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateFleetCommand.ts rename to clients/client-gamelift/src/commands/CreateFleetCommand.ts diff --git a/clients/client-gamelift/commands/CreateFleetLocationsCommand.ts b/clients/client-gamelift/src/commands/CreateFleetLocationsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateFleetLocationsCommand.ts rename to clients/client-gamelift/src/commands/CreateFleetLocationsCommand.ts diff --git a/clients/client-gamelift/commands/CreateGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/CreateGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/CreateGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/CreateGameSessionCommand.ts b/clients/client-gamelift/src/commands/CreateGameSessionCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateGameSessionCommand.ts rename to clients/client-gamelift/src/commands/CreateGameSessionCommand.ts diff --git a/clients/client-gamelift/commands/CreateGameSessionQueueCommand.ts b/clients/client-gamelift/src/commands/CreateGameSessionQueueCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateGameSessionQueueCommand.ts rename to clients/client-gamelift/src/commands/CreateGameSessionQueueCommand.ts diff --git a/clients/client-gamelift/commands/CreateMatchmakingConfigurationCommand.ts b/clients/client-gamelift/src/commands/CreateMatchmakingConfigurationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateMatchmakingConfigurationCommand.ts rename to clients/client-gamelift/src/commands/CreateMatchmakingConfigurationCommand.ts diff --git a/clients/client-gamelift/commands/CreateMatchmakingRuleSetCommand.ts b/clients/client-gamelift/src/commands/CreateMatchmakingRuleSetCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateMatchmakingRuleSetCommand.ts rename to clients/client-gamelift/src/commands/CreateMatchmakingRuleSetCommand.ts diff --git a/clients/client-gamelift/commands/CreatePlayerSessionCommand.ts b/clients/client-gamelift/src/commands/CreatePlayerSessionCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreatePlayerSessionCommand.ts rename to clients/client-gamelift/src/commands/CreatePlayerSessionCommand.ts diff --git a/clients/client-gamelift/commands/CreatePlayerSessionsCommand.ts b/clients/client-gamelift/src/commands/CreatePlayerSessionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreatePlayerSessionsCommand.ts rename to clients/client-gamelift/src/commands/CreatePlayerSessionsCommand.ts diff --git a/clients/client-gamelift/commands/CreateScriptCommand.ts b/clients/client-gamelift/src/commands/CreateScriptCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateScriptCommand.ts rename to clients/client-gamelift/src/commands/CreateScriptCommand.ts diff --git a/clients/client-gamelift/commands/CreateVpcPeeringAuthorizationCommand.ts b/clients/client-gamelift/src/commands/CreateVpcPeeringAuthorizationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateVpcPeeringAuthorizationCommand.ts rename to clients/client-gamelift/src/commands/CreateVpcPeeringAuthorizationCommand.ts diff --git a/clients/client-gamelift/commands/CreateVpcPeeringConnectionCommand.ts b/clients/client-gamelift/src/commands/CreateVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-gamelift/commands/CreateVpcPeeringConnectionCommand.ts rename to clients/client-gamelift/src/commands/CreateVpcPeeringConnectionCommand.ts diff --git a/clients/client-gamelift/commands/DeleteAliasCommand.ts b/clients/client-gamelift/src/commands/DeleteAliasCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteAliasCommand.ts rename to clients/client-gamelift/src/commands/DeleteAliasCommand.ts diff --git a/clients/client-gamelift/commands/DeleteBuildCommand.ts b/clients/client-gamelift/src/commands/DeleteBuildCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteBuildCommand.ts rename to clients/client-gamelift/src/commands/DeleteBuildCommand.ts diff --git a/clients/client-gamelift/commands/DeleteFleetCommand.ts b/clients/client-gamelift/src/commands/DeleteFleetCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteFleetCommand.ts rename to clients/client-gamelift/src/commands/DeleteFleetCommand.ts diff --git a/clients/client-gamelift/commands/DeleteFleetLocationsCommand.ts b/clients/client-gamelift/src/commands/DeleteFleetLocationsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteFleetLocationsCommand.ts rename to clients/client-gamelift/src/commands/DeleteFleetLocationsCommand.ts diff --git a/clients/client-gamelift/commands/DeleteGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/DeleteGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/DeleteGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/DeleteGameSessionQueueCommand.ts b/clients/client-gamelift/src/commands/DeleteGameSessionQueueCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteGameSessionQueueCommand.ts rename to clients/client-gamelift/src/commands/DeleteGameSessionQueueCommand.ts diff --git a/clients/client-gamelift/commands/DeleteMatchmakingConfigurationCommand.ts b/clients/client-gamelift/src/commands/DeleteMatchmakingConfigurationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteMatchmakingConfigurationCommand.ts rename to clients/client-gamelift/src/commands/DeleteMatchmakingConfigurationCommand.ts diff --git a/clients/client-gamelift/commands/DeleteMatchmakingRuleSetCommand.ts b/clients/client-gamelift/src/commands/DeleteMatchmakingRuleSetCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteMatchmakingRuleSetCommand.ts rename to clients/client-gamelift/src/commands/DeleteMatchmakingRuleSetCommand.ts diff --git a/clients/client-gamelift/commands/DeleteScalingPolicyCommand.ts b/clients/client-gamelift/src/commands/DeleteScalingPolicyCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteScalingPolicyCommand.ts rename to clients/client-gamelift/src/commands/DeleteScalingPolicyCommand.ts diff --git a/clients/client-gamelift/commands/DeleteScriptCommand.ts b/clients/client-gamelift/src/commands/DeleteScriptCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteScriptCommand.ts rename to clients/client-gamelift/src/commands/DeleteScriptCommand.ts diff --git a/clients/client-gamelift/commands/DeleteVpcPeeringAuthorizationCommand.ts b/clients/client-gamelift/src/commands/DeleteVpcPeeringAuthorizationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteVpcPeeringAuthorizationCommand.ts rename to clients/client-gamelift/src/commands/DeleteVpcPeeringAuthorizationCommand.ts diff --git a/clients/client-gamelift/commands/DeleteVpcPeeringConnectionCommand.ts b/clients/client-gamelift/src/commands/DeleteVpcPeeringConnectionCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeleteVpcPeeringConnectionCommand.ts rename to clients/client-gamelift/src/commands/DeleteVpcPeeringConnectionCommand.ts diff --git a/clients/client-gamelift/commands/DeregisterGameServerCommand.ts b/clients/client-gamelift/src/commands/DeregisterGameServerCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DeregisterGameServerCommand.ts rename to clients/client-gamelift/src/commands/DeregisterGameServerCommand.ts diff --git a/clients/client-gamelift/commands/DescribeAliasCommand.ts b/clients/client-gamelift/src/commands/DescribeAliasCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeAliasCommand.ts rename to clients/client-gamelift/src/commands/DescribeAliasCommand.ts diff --git a/clients/client-gamelift/commands/DescribeBuildCommand.ts b/clients/client-gamelift/src/commands/DescribeBuildCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeBuildCommand.ts rename to clients/client-gamelift/src/commands/DescribeBuildCommand.ts diff --git a/clients/client-gamelift/commands/DescribeEC2InstanceLimitsCommand.ts b/clients/client-gamelift/src/commands/DescribeEC2InstanceLimitsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeEC2InstanceLimitsCommand.ts rename to clients/client-gamelift/src/commands/DescribeEC2InstanceLimitsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetAttributesCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetAttributesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetAttributesCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetAttributesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetCapacityCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetCapacityCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetCapacityCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetCapacityCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetEventsCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetEventsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetEventsCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetEventsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetLocationAttributesCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetLocationAttributesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetLocationAttributesCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetLocationAttributesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetLocationCapacityCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetLocationCapacityCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetLocationCapacityCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetLocationCapacityCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetLocationUtilizationCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetLocationUtilizationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetLocationUtilizationCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetLocationUtilizationCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetPortSettingsCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetPortSettingsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetPortSettingsCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetPortSettingsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeFleetUtilizationCommand.ts b/clients/client-gamelift/src/commands/DescribeFleetUtilizationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeFleetUtilizationCommand.ts rename to clients/client-gamelift/src/commands/DescribeFleetUtilizationCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameServerCommand.ts b/clients/client-gamelift/src/commands/DescribeGameServerCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameServerCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameServerCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/DescribeGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameServerInstancesCommand.ts b/clients/client-gamelift/src/commands/DescribeGameServerInstancesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameServerInstancesCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameServerInstancesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameSessionDetailsCommand.ts b/clients/client-gamelift/src/commands/DescribeGameSessionDetailsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameSessionDetailsCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameSessionDetailsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameSessionPlacementCommand.ts b/clients/client-gamelift/src/commands/DescribeGameSessionPlacementCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameSessionPlacementCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameSessionPlacementCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameSessionQueuesCommand.ts b/clients/client-gamelift/src/commands/DescribeGameSessionQueuesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameSessionQueuesCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameSessionQueuesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeGameSessionsCommand.ts b/clients/client-gamelift/src/commands/DescribeGameSessionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeGameSessionsCommand.ts rename to clients/client-gamelift/src/commands/DescribeGameSessionsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeInstancesCommand.ts b/clients/client-gamelift/src/commands/DescribeInstancesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeInstancesCommand.ts rename to clients/client-gamelift/src/commands/DescribeInstancesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeMatchmakingCommand.ts b/clients/client-gamelift/src/commands/DescribeMatchmakingCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeMatchmakingCommand.ts rename to clients/client-gamelift/src/commands/DescribeMatchmakingCommand.ts diff --git a/clients/client-gamelift/commands/DescribeMatchmakingConfigurationsCommand.ts b/clients/client-gamelift/src/commands/DescribeMatchmakingConfigurationsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeMatchmakingConfigurationsCommand.ts rename to clients/client-gamelift/src/commands/DescribeMatchmakingConfigurationsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeMatchmakingRuleSetsCommand.ts b/clients/client-gamelift/src/commands/DescribeMatchmakingRuleSetsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeMatchmakingRuleSetsCommand.ts rename to clients/client-gamelift/src/commands/DescribeMatchmakingRuleSetsCommand.ts diff --git a/clients/client-gamelift/commands/DescribePlayerSessionsCommand.ts b/clients/client-gamelift/src/commands/DescribePlayerSessionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribePlayerSessionsCommand.ts rename to clients/client-gamelift/src/commands/DescribePlayerSessionsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeRuntimeConfigurationCommand.ts b/clients/client-gamelift/src/commands/DescribeRuntimeConfigurationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeRuntimeConfigurationCommand.ts rename to clients/client-gamelift/src/commands/DescribeRuntimeConfigurationCommand.ts diff --git a/clients/client-gamelift/commands/DescribeScalingPoliciesCommand.ts b/clients/client-gamelift/src/commands/DescribeScalingPoliciesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeScalingPoliciesCommand.ts rename to clients/client-gamelift/src/commands/DescribeScalingPoliciesCommand.ts diff --git a/clients/client-gamelift/commands/DescribeScriptCommand.ts b/clients/client-gamelift/src/commands/DescribeScriptCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeScriptCommand.ts rename to clients/client-gamelift/src/commands/DescribeScriptCommand.ts diff --git a/clients/client-gamelift/commands/DescribeVpcPeeringAuthorizationsCommand.ts b/clients/client-gamelift/src/commands/DescribeVpcPeeringAuthorizationsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeVpcPeeringAuthorizationsCommand.ts rename to clients/client-gamelift/src/commands/DescribeVpcPeeringAuthorizationsCommand.ts diff --git a/clients/client-gamelift/commands/DescribeVpcPeeringConnectionsCommand.ts b/clients/client-gamelift/src/commands/DescribeVpcPeeringConnectionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/DescribeVpcPeeringConnectionsCommand.ts rename to clients/client-gamelift/src/commands/DescribeVpcPeeringConnectionsCommand.ts diff --git a/clients/client-gamelift/commands/GetGameSessionLogUrlCommand.ts b/clients/client-gamelift/src/commands/GetGameSessionLogUrlCommand.ts similarity index 100% rename from clients/client-gamelift/commands/GetGameSessionLogUrlCommand.ts rename to clients/client-gamelift/src/commands/GetGameSessionLogUrlCommand.ts diff --git a/clients/client-gamelift/commands/GetInstanceAccessCommand.ts b/clients/client-gamelift/src/commands/GetInstanceAccessCommand.ts similarity index 100% rename from clients/client-gamelift/commands/GetInstanceAccessCommand.ts rename to clients/client-gamelift/src/commands/GetInstanceAccessCommand.ts diff --git a/clients/client-gamelift/commands/ListAliasesCommand.ts b/clients/client-gamelift/src/commands/ListAliasesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListAliasesCommand.ts rename to clients/client-gamelift/src/commands/ListAliasesCommand.ts diff --git a/clients/client-gamelift/commands/ListBuildsCommand.ts b/clients/client-gamelift/src/commands/ListBuildsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListBuildsCommand.ts rename to clients/client-gamelift/src/commands/ListBuildsCommand.ts diff --git a/clients/client-gamelift/commands/ListFleetsCommand.ts b/clients/client-gamelift/src/commands/ListFleetsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListFleetsCommand.ts rename to clients/client-gamelift/src/commands/ListFleetsCommand.ts diff --git a/clients/client-gamelift/commands/ListGameServerGroupsCommand.ts b/clients/client-gamelift/src/commands/ListGameServerGroupsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListGameServerGroupsCommand.ts rename to clients/client-gamelift/src/commands/ListGameServerGroupsCommand.ts diff --git a/clients/client-gamelift/commands/ListGameServersCommand.ts b/clients/client-gamelift/src/commands/ListGameServersCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListGameServersCommand.ts rename to clients/client-gamelift/src/commands/ListGameServersCommand.ts diff --git a/clients/client-gamelift/commands/ListScriptsCommand.ts b/clients/client-gamelift/src/commands/ListScriptsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListScriptsCommand.ts rename to clients/client-gamelift/src/commands/ListScriptsCommand.ts diff --git a/clients/client-gamelift/commands/ListTagsForResourceCommand.ts b/clients/client-gamelift/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ListTagsForResourceCommand.ts rename to clients/client-gamelift/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-gamelift/commands/PutScalingPolicyCommand.ts b/clients/client-gamelift/src/commands/PutScalingPolicyCommand.ts similarity index 100% rename from clients/client-gamelift/commands/PutScalingPolicyCommand.ts rename to clients/client-gamelift/src/commands/PutScalingPolicyCommand.ts diff --git a/clients/client-gamelift/commands/RegisterGameServerCommand.ts b/clients/client-gamelift/src/commands/RegisterGameServerCommand.ts similarity index 100% rename from clients/client-gamelift/commands/RegisterGameServerCommand.ts rename to clients/client-gamelift/src/commands/RegisterGameServerCommand.ts diff --git a/clients/client-gamelift/commands/RequestUploadCredentialsCommand.ts b/clients/client-gamelift/src/commands/RequestUploadCredentialsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/RequestUploadCredentialsCommand.ts rename to clients/client-gamelift/src/commands/RequestUploadCredentialsCommand.ts diff --git a/clients/client-gamelift/commands/ResolveAliasCommand.ts b/clients/client-gamelift/src/commands/ResolveAliasCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ResolveAliasCommand.ts rename to clients/client-gamelift/src/commands/ResolveAliasCommand.ts diff --git a/clients/client-gamelift/commands/ResumeGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/ResumeGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ResumeGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/ResumeGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/SearchGameSessionsCommand.ts b/clients/client-gamelift/src/commands/SearchGameSessionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/SearchGameSessionsCommand.ts rename to clients/client-gamelift/src/commands/SearchGameSessionsCommand.ts diff --git a/clients/client-gamelift/commands/StartFleetActionsCommand.ts b/clients/client-gamelift/src/commands/StartFleetActionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StartFleetActionsCommand.ts rename to clients/client-gamelift/src/commands/StartFleetActionsCommand.ts diff --git a/clients/client-gamelift/commands/StartGameSessionPlacementCommand.ts b/clients/client-gamelift/src/commands/StartGameSessionPlacementCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StartGameSessionPlacementCommand.ts rename to clients/client-gamelift/src/commands/StartGameSessionPlacementCommand.ts diff --git a/clients/client-gamelift/commands/StartMatchBackfillCommand.ts b/clients/client-gamelift/src/commands/StartMatchBackfillCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StartMatchBackfillCommand.ts rename to clients/client-gamelift/src/commands/StartMatchBackfillCommand.ts diff --git a/clients/client-gamelift/commands/StartMatchmakingCommand.ts b/clients/client-gamelift/src/commands/StartMatchmakingCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StartMatchmakingCommand.ts rename to clients/client-gamelift/src/commands/StartMatchmakingCommand.ts diff --git a/clients/client-gamelift/commands/StopFleetActionsCommand.ts b/clients/client-gamelift/src/commands/StopFleetActionsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StopFleetActionsCommand.ts rename to clients/client-gamelift/src/commands/StopFleetActionsCommand.ts diff --git a/clients/client-gamelift/commands/StopGameSessionPlacementCommand.ts b/clients/client-gamelift/src/commands/StopGameSessionPlacementCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StopGameSessionPlacementCommand.ts rename to clients/client-gamelift/src/commands/StopGameSessionPlacementCommand.ts diff --git a/clients/client-gamelift/commands/StopMatchmakingCommand.ts b/clients/client-gamelift/src/commands/StopMatchmakingCommand.ts similarity index 100% rename from clients/client-gamelift/commands/StopMatchmakingCommand.ts rename to clients/client-gamelift/src/commands/StopMatchmakingCommand.ts diff --git a/clients/client-gamelift/commands/SuspendGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/SuspendGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/SuspendGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/SuspendGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/TagResourceCommand.ts b/clients/client-gamelift/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-gamelift/commands/TagResourceCommand.ts rename to clients/client-gamelift/src/commands/TagResourceCommand.ts diff --git a/clients/client-gamelift/commands/UntagResourceCommand.ts b/clients/client-gamelift/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UntagResourceCommand.ts rename to clients/client-gamelift/src/commands/UntagResourceCommand.ts diff --git a/clients/client-gamelift/commands/UpdateAliasCommand.ts b/clients/client-gamelift/src/commands/UpdateAliasCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateAliasCommand.ts rename to clients/client-gamelift/src/commands/UpdateAliasCommand.ts diff --git a/clients/client-gamelift/commands/UpdateBuildCommand.ts b/clients/client-gamelift/src/commands/UpdateBuildCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateBuildCommand.ts rename to clients/client-gamelift/src/commands/UpdateBuildCommand.ts diff --git a/clients/client-gamelift/commands/UpdateFleetAttributesCommand.ts b/clients/client-gamelift/src/commands/UpdateFleetAttributesCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateFleetAttributesCommand.ts rename to clients/client-gamelift/src/commands/UpdateFleetAttributesCommand.ts diff --git a/clients/client-gamelift/commands/UpdateFleetCapacityCommand.ts b/clients/client-gamelift/src/commands/UpdateFleetCapacityCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateFleetCapacityCommand.ts rename to clients/client-gamelift/src/commands/UpdateFleetCapacityCommand.ts diff --git a/clients/client-gamelift/commands/UpdateFleetPortSettingsCommand.ts b/clients/client-gamelift/src/commands/UpdateFleetPortSettingsCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateFleetPortSettingsCommand.ts rename to clients/client-gamelift/src/commands/UpdateFleetPortSettingsCommand.ts diff --git a/clients/client-gamelift/commands/UpdateGameServerCommand.ts b/clients/client-gamelift/src/commands/UpdateGameServerCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateGameServerCommand.ts rename to clients/client-gamelift/src/commands/UpdateGameServerCommand.ts diff --git a/clients/client-gamelift/commands/UpdateGameServerGroupCommand.ts b/clients/client-gamelift/src/commands/UpdateGameServerGroupCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateGameServerGroupCommand.ts rename to clients/client-gamelift/src/commands/UpdateGameServerGroupCommand.ts diff --git a/clients/client-gamelift/commands/UpdateGameSessionCommand.ts b/clients/client-gamelift/src/commands/UpdateGameSessionCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateGameSessionCommand.ts rename to clients/client-gamelift/src/commands/UpdateGameSessionCommand.ts diff --git a/clients/client-gamelift/commands/UpdateGameSessionQueueCommand.ts b/clients/client-gamelift/src/commands/UpdateGameSessionQueueCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateGameSessionQueueCommand.ts rename to clients/client-gamelift/src/commands/UpdateGameSessionQueueCommand.ts diff --git a/clients/client-gamelift/commands/UpdateMatchmakingConfigurationCommand.ts b/clients/client-gamelift/src/commands/UpdateMatchmakingConfigurationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateMatchmakingConfigurationCommand.ts rename to clients/client-gamelift/src/commands/UpdateMatchmakingConfigurationCommand.ts diff --git a/clients/client-gamelift/commands/UpdateRuntimeConfigurationCommand.ts b/clients/client-gamelift/src/commands/UpdateRuntimeConfigurationCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateRuntimeConfigurationCommand.ts rename to clients/client-gamelift/src/commands/UpdateRuntimeConfigurationCommand.ts diff --git a/clients/client-gamelift/commands/UpdateScriptCommand.ts b/clients/client-gamelift/src/commands/UpdateScriptCommand.ts similarity index 100% rename from clients/client-gamelift/commands/UpdateScriptCommand.ts rename to clients/client-gamelift/src/commands/UpdateScriptCommand.ts diff --git a/clients/client-gamelift/commands/ValidateMatchmakingRuleSetCommand.ts b/clients/client-gamelift/src/commands/ValidateMatchmakingRuleSetCommand.ts similarity index 100% rename from clients/client-gamelift/commands/ValidateMatchmakingRuleSetCommand.ts rename to clients/client-gamelift/src/commands/ValidateMatchmakingRuleSetCommand.ts diff --git a/clients/client-gamelift/endpoints.ts b/clients/client-gamelift/src/endpoints.ts similarity index 100% rename from clients/client-gamelift/endpoints.ts rename to clients/client-gamelift/src/endpoints.ts diff --git a/clients/client-gamelift/index.ts b/clients/client-gamelift/src/index.ts similarity index 100% rename from clients/client-gamelift/index.ts rename to clients/client-gamelift/src/index.ts diff --git a/clients/client-gamelift/models/index.ts b/clients/client-gamelift/src/models/index.ts similarity index 100% rename from clients/client-gamelift/models/index.ts rename to clients/client-gamelift/src/models/index.ts diff --git a/clients/client-gamelift/models/models_0.ts b/clients/client-gamelift/src/models/models_0.ts similarity index 100% rename from clients/client-gamelift/models/models_0.ts rename to clients/client-gamelift/src/models/models_0.ts diff --git a/clients/client-gamelift/pagination/DescribeFleetAttributesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeFleetAttributesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeFleetAttributesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeFleetAttributesPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeFleetCapacityPaginator.ts b/clients/client-gamelift/src/pagination/DescribeFleetCapacityPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeFleetCapacityPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeFleetCapacityPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeFleetEventsPaginator.ts b/clients/client-gamelift/src/pagination/DescribeFleetEventsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeFleetEventsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeFleetEventsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeFleetLocationAttributesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeFleetLocationAttributesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeFleetLocationAttributesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeFleetLocationAttributesPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeFleetUtilizationPaginator.ts b/clients/client-gamelift/src/pagination/DescribeFleetUtilizationPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeFleetUtilizationPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeFleetUtilizationPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeGameServerInstancesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeGameServerInstancesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeGameServerInstancesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeGameServerInstancesPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeGameSessionDetailsPaginator.ts b/clients/client-gamelift/src/pagination/DescribeGameSessionDetailsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeGameSessionDetailsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeGameSessionDetailsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeGameSessionQueuesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeGameSessionQueuesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeGameSessionQueuesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeGameSessionQueuesPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeGameSessionsPaginator.ts b/clients/client-gamelift/src/pagination/DescribeGameSessionsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeGameSessionsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeGameSessionsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeInstancesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeInstancesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeInstancesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeInstancesPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeMatchmakingConfigurationsPaginator.ts b/clients/client-gamelift/src/pagination/DescribeMatchmakingConfigurationsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeMatchmakingConfigurationsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeMatchmakingConfigurationsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeMatchmakingRuleSetsPaginator.ts b/clients/client-gamelift/src/pagination/DescribeMatchmakingRuleSetsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeMatchmakingRuleSetsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeMatchmakingRuleSetsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribePlayerSessionsPaginator.ts b/clients/client-gamelift/src/pagination/DescribePlayerSessionsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribePlayerSessionsPaginator.ts rename to clients/client-gamelift/src/pagination/DescribePlayerSessionsPaginator.ts diff --git a/clients/client-gamelift/pagination/DescribeScalingPoliciesPaginator.ts b/clients/client-gamelift/src/pagination/DescribeScalingPoliciesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/DescribeScalingPoliciesPaginator.ts rename to clients/client-gamelift/src/pagination/DescribeScalingPoliciesPaginator.ts diff --git a/clients/client-gamelift/pagination/Interfaces.ts b/clients/client-gamelift/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-gamelift/pagination/Interfaces.ts rename to clients/client-gamelift/src/pagination/Interfaces.ts diff --git a/clients/client-gamelift/pagination/ListAliasesPaginator.ts b/clients/client-gamelift/src/pagination/ListAliasesPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListAliasesPaginator.ts rename to clients/client-gamelift/src/pagination/ListAliasesPaginator.ts diff --git a/clients/client-gamelift/pagination/ListBuildsPaginator.ts b/clients/client-gamelift/src/pagination/ListBuildsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListBuildsPaginator.ts rename to clients/client-gamelift/src/pagination/ListBuildsPaginator.ts diff --git a/clients/client-gamelift/pagination/ListFleetsPaginator.ts b/clients/client-gamelift/src/pagination/ListFleetsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListFleetsPaginator.ts rename to clients/client-gamelift/src/pagination/ListFleetsPaginator.ts diff --git a/clients/client-gamelift/pagination/ListGameServerGroupsPaginator.ts b/clients/client-gamelift/src/pagination/ListGameServerGroupsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListGameServerGroupsPaginator.ts rename to clients/client-gamelift/src/pagination/ListGameServerGroupsPaginator.ts diff --git a/clients/client-gamelift/pagination/ListGameServersPaginator.ts b/clients/client-gamelift/src/pagination/ListGameServersPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListGameServersPaginator.ts rename to clients/client-gamelift/src/pagination/ListGameServersPaginator.ts diff --git a/clients/client-gamelift/pagination/ListScriptsPaginator.ts b/clients/client-gamelift/src/pagination/ListScriptsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/ListScriptsPaginator.ts rename to clients/client-gamelift/src/pagination/ListScriptsPaginator.ts diff --git a/clients/client-gamelift/pagination/SearchGameSessionsPaginator.ts b/clients/client-gamelift/src/pagination/SearchGameSessionsPaginator.ts similarity index 100% rename from clients/client-gamelift/pagination/SearchGameSessionsPaginator.ts rename to clients/client-gamelift/src/pagination/SearchGameSessionsPaginator.ts diff --git a/clients/client-gamelift/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-gamelift/protocols/Aws_json1_1.ts rename to clients/client-gamelift/src/protocols/Aws_json1_1.ts diff --git a/clients/client-gamelift/src/runtimeConfig.browser.ts b/clients/client-gamelift/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e5431b28e902 --- /dev/null +++ b/clients/client-gamelift/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GameLiftClientConfig } from "./GameLiftClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GameLiftClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-gamelift/runtimeConfig.native.ts b/clients/client-gamelift/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-gamelift/runtimeConfig.native.ts rename to clients/client-gamelift/src/runtimeConfig.native.ts diff --git a/clients/client-gamelift/runtimeConfig.shared.ts b/clients/client-gamelift/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-gamelift/runtimeConfig.shared.ts rename to clients/client-gamelift/src/runtimeConfig.shared.ts diff --git a/clients/client-gamelift/src/runtimeConfig.ts b/clients/client-gamelift/src/runtimeConfig.ts new file mode 100644 index 000000000000..2be08992dfd2 --- /dev/null +++ b/clients/client-gamelift/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GameLiftClientConfig } from "./GameLiftClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GameLiftClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-gamelift/tsconfig.es.json b/clients/client-gamelift/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-gamelift/tsconfig.es.json +++ b/clients/client-gamelift/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-gamelift/tsconfig.json b/clients/client-gamelift/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-gamelift/tsconfig.json +++ b/clients/client-gamelift/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-gamelift/tsconfig.types.json b/clients/client-gamelift/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-gamelift/tsconfig.types.json +++ b/clients/client-gamelift/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-glacier/.gitignore b/clients/client-glacier/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-glacier/.gitignore +++ b/clients/client-glacier/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-glacier/package.json b/clients/client-glacier/package.json index 4065ceffa61b..438413a9b1e6 100644 --- a/clients/client-glacier/package.json +++ b/clients/client-glacier/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-glacier", "repository": { "type": "git", diff --git a/clients/client-glacier/runtimeConfig.browser.ts b/clients/client-glacier/runtimeConfig.browser.ts deleted file mode 100644 index a8e1c87fe4eb..000000000000 --- a/clients/client-glacier/runtimeConfig.browser.ts +++ /dev/null @@ -1,42 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { bodyChecksumGenerator } from "@aws-sdk/body-checksum-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GlacierClientConfig } from "./GlacierClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlacierClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyChecksumGenerator: config?.bodyChecksumGenerator ?? bodyChecksumGenerator, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-glacier/runtimeConfig.ts b/clients/client-glacier/runtimeConfig.ts deleted file mode 100644 index 5fbcc31eb5e1..000000000000 --- a/clients/client-glacier/runtimeConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -import packageInfo from "./package.json"; - -import { bodyChecksumGenerator } from "@aws-sdk/body-checksum-node"; -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GlacierClientConfig } from "./GlacierClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlacierClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyChecksumGenerator: config?.bodyChecksumGenerator ?? bodyChecksumGenerator, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-glacier/Glacier.ts b/clients/client-glacier/src/Glacier.ts similarity index 100% rename from clients/client-glacier/Glacier.ts rename to clients/client-glacier/src/Glacier.ts diff --git a/clients/client-glacier/GlacierClient.ts b/clients/client-glacier/src/GlacierClient.ts similarity index 100% rename from clients/client-glacier/GlacierClient.ts rename to clients/client-glacier/src/GlacierClient.ts diff --git a/clients/client-glacier/commands/AbortMultipartUploadCommand.ts b/clients/client-glacier/src/commands/AbortMultipartUploadCommand.ts similarity index 100% rename from clients/client-glacier/commands/AbortMultipartUploadCommand.ts rename to clients/client-glacier/src/commands/AbortMultipartUploadCommand.ts diff --git a/clients/client-glacier/commands/AbortVaultLockCommand.ts b/clients/client-glacier/src/commands/AbortVaultLockCommand.ts similarity index 100% rename from clients/client-glacier/commands/AbortVaultLockCommand.ts rename to clients/client-glacier/src/commands/AbortVaultLockCommand.ts diff --git a/clients/client-glacier/commands/AddTagsToVaultCommand.ts b/clients/client-glacier/src/commands/AddTagsToVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/AddTagsToVaultCommand.ts rename to clients/client-glacier/src/commands/AddTagsToVaultCommand.ts diff --git a/clients/client-glacier/commands/CompleteMultipartUploadCommand.ts b/clients/client-glacier/src/commands/CompleteMultipartUploadCommand.ts similarity index 100% rename from clients/client-glacier/commands/CompleteMultipartUploadCommand.ts rename to clients/client-glacier/src/commands/CompleteMultipartUploadCommand.ts diff --git a/clients/client-glacier/commands/CompleteVaultLockCommand.ts b/clients/client-glacier/src/commands/CompleteVaultLockCommand.ts similarity index 100% rename from clients/client-glacier/commands/CompleteVaultLockCommand.ts rename to clients/client-glacier/src/commands/CompleteVaultLockCommand.ts diff --git a/clients/client-glacier/commands/CreateVaultCommand.ts b/clients/client-glacier/src/commands/CreateVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/CreateVaultCommand.ts rename to clients/client-glacier/src/commands/CreateVaultCommand.ts diff --git a/clients/client-glacier/commands/DeleteArchiveCommand.ts b/clients/client-glacier/src/commands/DeleteArchiveCommand.ts similarity index 100% rename from clients/client-glacier/commands/DeleteArchiveCommand.ts rename to clients/client-glacier/src/commands/DeleteArchiveCommand.ts diff --git a/clients/client-glacier/commands/DeleteVaultAccessPolicyCommand.ts b/clients/client-glacier/src/commands/DeleteVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-glacier/commands/DeleteVaultAccessPolicyCommand.ts rename to clients/client-glacier/src/commands/DeleteVaultAccessPolicyCommand.ts diff --git a/clients/client-glacier/commands/DeleteVaultCommand.ts b/clients/client-glacier/src/commands/DeleteVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/DeleteVaultCommand.ts rename to clients/client-glacier/src/commands/DeleteVaultCommand.ts diff --git a/clients/client-glacier/commands/DeleteVaultNotificationsCommand.ts b/clients/client-glacier/src/commands/DeleteVaultNotificationsCommand.ts similarity index 100% rename from clients/client-glacier/commands/DeleteVaultNotificationsCommand.ts rename to clients/client-glacier/src/commands/DeleteVaultNotificationsCommand.ts diff --git a/clients/client-glacier/commands/DescribeJobCommand.ts b/clients/client-glacier/src/commands/DescribeJobCommand.ts similarity index 100% rename from clients/client-glacier/commands/DescribeJobCommand.ts rename to clients/client-glacier/src/commands/DescribeJobCommand.ts diff --git a/clients/client-glacier/commands/DescribeVaultCommand.ts b/clients/client-glacier/src/commands/DescribeVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/DescribeVaultCommand.ts rename to clients/client-glacier/src/commands/DescribeVaultCommand.ts diff --git a/clients/client-glacier/commands/GetDataRetrievalPolicyCommand.ts b/clients/client-glacier/src/commands/GetDataRetrievalPolicyCommand.ts similarity index 100% rename from clients/client-glacier/commands/GetDataRetrievalPolicyCommand.ts rename to clients/client-glacier/src/commands/GetDataRetrievalPolicyCommand.ts diff --git a/clients/client-glacier/commands/GetJobOutputCommand.ts b/clients/client-glacier/src/commands/GetJobOutputCommand.ts similarity index 100% rename from clients/client-glacier/commands/GetJobOutputCommand.ts rename to clients/client-glacier/src/commands/GetJobOutputCommand.ts diff --git a/clients/client-glacier/commands/GetVaultAccessPolicyCommand.ts b/clients/client-glacier/src/commands/GetVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-glacier/commands/GetVaultAccessPolicyCommand.ts rename to clients/client-glacier/src/commands/GetVaultAccessPolicyCommand.ts diff --git a/clients/client-glacier/commands/GetVaultLockCommand.ts b/clients/client-glacier/src/commands/GetVaultLockCommand.ts similarity index 100% rename from clients/client-glacier/commands/GetVaultLockCommand.ts rename to clients/client-glacier/src/commands/GetVaultLockCommand.ts diff --git a/clients/client-glacier/commands/GetVaultNotificationsCommand.ts b/clients/client-glacier/src/commands/GetVaultNotificationsCommand.ts similarity index 100% rename from clients/client-glacier/commands/GetVaultNotificationsCommand.ts rename to clients/client-glacier/src/commands/GetVaultNotificationsCommand.ts diff --git a/clients/client-glacier/commands/InitiateJobCommand.ts b/clients/client-glacier/src/commands/InitiateJobCommand.ts similarity index 100% rename from clients/client-glacier/commands/InitiateJobCommand.ts rename to clients/client-glacier/src/commands/InitiateJobCommand.ts diff --git a/clients/client-glacier/commands/InitiateMultipartUploadCommand.ts b/clients/client-glacier/src/commands/InitiateMultipartUploadCommand.ts similarity index 100% rename from clients/client-glacier/commands/InitiateMultipartUploadCommand.ts rename to clients/client-glacier/src/commands/InitiateMultipartUploadCommand.ts diff --git a/clients/client-glacier/commands/InitiateVaultLockCommand.ts b/clients/client-glacier/src/commands/InitiateVaultLockCommand.ts similarity index 100% rename from clients/client-glacier/commands/InitiateVaultLockCommand.ts rename to clients/client-glacier/src/commands/InitiateVaultLockCommand.ts diff --git a/clients/client-glacier/commands/ListJobsCommand.ts b/clients/client-glacier/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListJobsCommand.ts rename to clients/client-glacier/src/commands/ListJobsCommand.ts diff --git a/clients/client-glacier/commands/ListMultipartUploadsCommand.ts b/clients/client-glacier/src/commands/ListMultipartUploadsCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListMultipartUploadsCommand.ts rename to clients/client-glacier/src/commands/ListMultipartUploadsCommand.ts diff --git a/clients/client-glacier/commands/ListPartsCommand.ts b/clients/client-glacier/src/commands/ListPartsCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListPartsCommand.ts rename to clients/client-glacier/src/commands/ListPartsCommand.ts diff --git a/clients/client-glacier/commands/ListProvisionedCapacityCommand.ts b/clients/client-glacier/src/commands/ListProvisionedCapacityCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListProvisionedCapacityCommand.ts rename to clients/client-glacier/src/commands/ListProvisionedCapacityCommand.ts diff --git a/clients/client-glacier/commands/ListTagsForVaultCommand.ts b/clients/client-glacier/src/commands/ListTagsForVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListTagsForVaultCommand.ts rename to clients/client-glacier/src/commands/ListTagsForVaultCommand.ts diff --git a/clients/client-glacier/commands/ListVaultsCommand.ts b/clients/client-glacier/src/commands/ListVaultsCommand.ts similarity index 100% rename from clients/client-glacier/commands/ListVaultsCommand.ts rename to clients/client-glacier/src/commands/ListVaultsCommand.ts diff --git a/clients/client-glacier/commands/PurchaseProvisionedCapacityCommand.ts b/clients/client-glacier/src/commands/PurchaseProvisionedCapacityCommand.ts similarity index 100% rename from clients/client-glacier/commands/PurchaseProvisionedCapacityCommand.ts rename to clients/client-glacier/src/commands/PurchaseProvisionedCapacityCommand.ts diff --git a/clients/client-glacier/commands/RemoveTagsFromVaultCommand.ts b/clients/client-glacier/src/commands/RemoveTagsFromVaultCommand.ts similarity index 100% rename from clients/client-glacier/commands/RemoveTagsFromVaultCommand.ts rename to clients/client-glacier/src/commands/RemoveTagsFromVaultCommand.ts diff --git a/clients/client-glacier/commands/SetDataRetrievalPolicyCommand.ts b/clients/client-glacier/src/commands/SetDataRetrievalPolicyCommand.ts similarity index 100% rename from clients/client-glacier/commands/SetDataRetrievalPolicyCommand.ts rename to clients/client-glacier/src/commands/SetDataRetrievalPolicyCommand.ts diff --git a/clients/client-glacier/commands/SetVaultAccessPolicyCommand.ts b/clients/client-glacier/src/commands/SetVaultAccessPolicyCommand.ts similarity index 100% rename from clients/client-glacier/commands/SetVaultAccessPolicyCommand.ts rename to clients/client-glacier/src/commands/SetVaultAccessPolicyCommand.ts diff --git a/clients/client-glacier/commands/SetVaultNotificationsCommand.ts b/clients/client-glacier/src/commands/SetVaultNotificationsCommand.ts similarity index 100% rename from clients/client-glacier/commands/SetVaultNotificationsCommand.ts rename to clients/client-glacier/src/commands/SetVaultNotificationsCommand.ts diff --git a/clients/client-glacier/commands/UploadArchiveCommand.ts b/clients/client-glacier/src/commands/UploadArchiveCommand.ts similarity index 100% rename from clients/client-glacier/commands/UploadArchiveCommand.ts rename to clients/client-glacier/src/commands/UploadArchiveCommand.ts diff --git a/clients/client-glacier/commands/UploadMultipartPartCommand.ts b/clients/client-glacier/src/commands/UploadMultipartPartCommand.ts similarity index 100% rename from clients/client-glacier/commands/UploadMultipartPartCommand.ts rename to clients/client-glacier/src/commands/UploadMultipartPartCommand.ts diff --git a/clients/client-glacier/endpoints.ts b/clients/client-glacier/src/endpoints.ts similarity index 100% rename from clients/client-glacier/endpoints.ts rename to clients/client-glacier/src/endpoints.ts diff --git a/clients/client-glacier/index.ts b/clients/client-glacier/src/index.ts similarity index 100% rename from clients/client-glacier/index.ts rename to clients/client-glacier/src/index.ts diff --git a/clients/client-glacier/models/index.ts b/clients/client-glacier/src/models/index.ts similarity index 100% rename from clients/client-glacier/models/index.ts rename to clients/client-glacier/src/models/index.ts diff --git a/clients/client-glacier/models/models_0.ts b/clients/client-glacier/src/models/models_0.ts similarity index 100% rename from clients/client-glacier/models/models_0.ts rename to clients/client-glacier/src/models/models_0.ts diff --git a/clients/client-glacier/pagination/Interfaces.ts b/clients/client-glacier/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-glacier/pagination/Interfaces.ts rename to clients/client-glacier/src/pagination/Interfaces.ts diff --git a/clients/client-glacier/pagination/ListJobsPaginator.ts b/clients/client-glacier/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-glacier/pagination/ListJobsPaginator.ts rename to clients/client-glacier/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-glacier/pagination/ListMultipartUploadsPaginator.ts b/clients/client-glacier/src/pagination/ListMultipartUploadsPaginator.ts similarity index 100% rename from clients/client-glacier/pagination/ListMultipartUploadsPaginator.ts rename to clients/client-glacier/src/pagination/ListMultipartUploadsPaginator.ts diff --git a/clients/client-glacier/pagination/ListPartsPaginator.ts b/clients/client-glacier/src/pagination/ListPartsPaginator.ts similarity index 100% rename from clients/client-glacier/pagination/ListPartsPaginator.ts rename to clients/client-glacier/src/pagination/ListPartsPaginator.ts diff --git a/clients/client-glacier/pagination/ListVaultsPaginator.ts b/clients/client-glacier/src/pagination/ListVaultsPaginator.ts similarity index 100% rename from clients/client-glacier/pagination/ListVaultsPaginator.ts rename to clients/client-glacier/src/pagination/ListVaultsPaginator.ts diff --git a/clients/client-glacier/protocols/Aws_restJson1.ts b/clients/client-glacier/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-glacier/protocols/Aws_restJson1.ts rename to clients/client-glacier/src/protocols/Aws_restJson1.ts diff --git a/clients/client-glacier/src/runtimeConfig.browser.ts b/clients/client-glacier/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..adfe40ee0c1a --- /dev/null +++ b/clients/client-glacier/src/runtimeConfig.browser.ts @@ -0,0 +1,43 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { bodyChecksumGenerator } from "@aws-sdk/body-checksum-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GlacierClientConfig } from "./GlacierClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlacierClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyChecksumGenerator: config?.bodyChecksumGenerator ?? bodyChecksumGenerator, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-glacier/runtimeConfig.native.ts b/clients/client-glacier/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-glacier/runtimeConfig.native.ts rename to clients/client-glacier/src/runtimeConfig.native.ts diff --git a/clients/client-glacier/runtimeConfig.shared.ts b/clients/client-glacier/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-glacier/runtimeConfig.shared.ts rename to clients/client-glacier/src/runtimeConfig.shared.ts diff --git a/clients/client-glacier/src/runtimeConfig.ts b/clients/client-glacier/src/runtimeConfig.ts new file mode 100644 index 000000000000..08f3f631cc90 --- /dev/null +++ b/clients/client-glacier/src/runtimeConfig.ts @@ -0,0 +1,48 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { bodyChecksumGenerator } from "@aws-sdk/body-checksum-node"; +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GlacierClientConfig } from "./GlacierClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlacierClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyChecksumGenerator: config?.bodyChecksumGenerator ?? bodyChecksumGenerator, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-glacier/waiters/waitForVaultExists.ts b/clients/client-glacier/src/waiters/waitForVaultExists.ts similarity index 100% rename from clients/client-glacier/waiters/waitForVaultExists.ts rename to clients/client-glacier/src/waiters/waitForVaultExists.ts diff --git a/clients/client-glacier/waiters/waitForVaultNotExists.ts b/clients/client-glacier/src/waiters/waitForVaultNotExists.ts similarity index 100% rename from clients/client-glacier/waiters/waitForVaultNotExists.ts rename to clients/client-glacier/src/waiters/waitForVaultNotExists.ts diff --git a/clients/client-glacier/tsconfig.es.json b/clients/client-glacier/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-glacier/tsconfig.es.json +++ b/clients/client-glacier/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-glacier/tsconfig.json b/clients/client-glacier/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-glacier/tsconfig.json +++ b/clients/client-glacier/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-glacier/tsconfig.types.json b/clients/client-glacier/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-glacier/tsconfig.types.json +++ b/clients/client-glacier/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-global-accelerator/.gitignore b/clients/client-global-accelerator/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-global-accelerator/.gitignore +++ b/clients/client-global-accelerator/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-global-accelerator/package.json b/clients/client-global-accelerator/package.json index a0d2127f5f47..c47c5314c70a 100644 --- a/clients/client-global-accelerator/package.json +++ b/clients/client-global-accelerator/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-global-accelerator", "repository": { "type": "git", diff --git a/clients/client-global-accelerator/runtimeConfig.browser.ts b/clients/client-global-accelerator/runtimeConfig.browser.ts deleted file mode 100644 index ae8652de41ad..000000000000 --- a/clients/client-global-accelerator/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GlobalAcceleratorClientConfig } from "./GlobalAcceleratorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-global-accelerator/runtimeConfig.ts b/clients/client-global-accelerator/runtimeConfig.ts deleted file mode 100644 index a840e7a62074..000000000000 --- a/clients/client-global-accelerator/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GlobalAcceleratorClientConfig } from "./GlobalAcceleratorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-global-accelerator/GlobalAccelerator.ts b/clients/client-global-accelerator/src/GlobalAccelerator.ts similarity index 100% rename from clients/client-global-accelerator/GlobalAccelerator.ts rename to clients/client-global-accelerator/src/GlobalAccelerator.ts diff --git a/clients/client-global-accelerator/GlobalAcceleratorClient.ts b/clients/client-global-accelerator/src/GlobalAcceleratorClient.ts similarity index 100% rename from clients/client-global-accelerator/GlobalAcceleratorClient.ts rename to clients/client-global-accelerator/src/GlobalAcceleratorClient.ts diff --git a/clients/client-global-accelerator/commands/AddCustomRoutingEndpointsCommand.ts b/clients/client-global-accelerator/src/commands/AddCustomRoutingEndpointsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/AddCustomRoutingEndpointsCommand.ts rename to clients/client-global-accelerator/src/commands/AddCustomRoutingEndpointsCommand.ts diff --git a/clients/client-global-accelerator/commands/AdvertiseByoipCidrCommand.ts b/clients/client-global-accelerator/src/commands/AdvertiseByoipCidrCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/AdvertiseByoipCidrCommand.ts rename to clients/client-global-accelerator/src/commands/AdvertiseByoipCidrCommand.ts diff --git a/clients/client-global-accelerator/commands/AllowCustomRoutingTrafficCommand.ts b/clients/client-global-accelerator/src/commands/AllowCustomRoutingTrafficCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/AllowCustomRoutingTrafficCommand.ts rename to clients/client-global-accelerator/src/commands/AllowCustomRoutingTrafficCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/CreateAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/CreateAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateCustomRoutingAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/CreateCustomRoutingAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateCustomRoutingAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/CreateCustomRoutingAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateCustomRoutingEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/CreateCustomRoutingEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateCustomRoutingEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/CreateCustomRoutingEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateCustomRoutingListenerCommand.ts b/clients/client-global-accelerator/src/commands/CreateCustomRoutingListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateCustomRoutingListenerCommand.ts rename to clients/client-global-accelerator/src/commands/CreateCustomRoutingListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/CreateEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/CreateEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/CreateListenerCommand.ts b/clients/client-global-accelerator/src/commands/CreateListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/CreateListenerCommand.ts rename to clients/client-global-accelerator/src/commands/CreateListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/DeleteAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteCustomRoutingAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/DeleteCustomRoutingAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteCustomRoutingAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteCustomRoutingAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteCustomRoutingEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/DeleteCustomRoutingEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteCustomRoutingEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteCustomRoutingEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteCustomRoutingListenerCommand.ts b/clients/client-global-accelerator/src/commands/DeleteCustomRoutingListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteCustomRoutingListenerCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteCustomRoutingListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/DeleteEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/DeleteListenerCommand.ts b/clients/client-global-accelerator/src/commands/DeleteListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeleteListenerCommand.ts rename to clients/client-global-accelerator/src/commands/DeleteListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/DenyCustomRoutingTrafficCommand.ts b/clients/client-global-accelerator/src/commands/DenyCustomRoutingTrafficCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DenyCustomRoutingTrafficCommand.ts rename to clients/client-global-accelerator/src/commands/DenyCustomRoutingTrafficCommand.ts diff --git a/clients/client-global-accelerator/commands/DeprovisionByoipCidrCommand.ts b/clients/client-global-accelerator/src/commands/DeprovisionByoipCidrCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DeprovisionByoipCidrCommand.ts rename to clients/client-global-accelerator/src/commands/DeprovisionByoipCidrCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeAcceleratorAttributesCommand.ts b/clients/client-global-accelerator/src/commands/DescribeAcceleratorAttributesCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeAcceleratorAttributesCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeAcceleratorAttributesCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/DescribeAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeCustomRoutingAcceleratorAttributesCommand.ts b/clients/client-global-accelerator/src/commands/DescribeCustomRoutingAcceleratorAttributesCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeCustomRoutingAcceleratorAttributesCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeCustomRoutingAcceleratorAttributesCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeCustomRoutingAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/DescribeCustomRoutingAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeCustomRoutingAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeCustomRoutingAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeCustomRoutingEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/DescribeCustomRoutingEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeCustomRoutingEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeCustomRoutingEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeCustomRoutingListenerCommand.ts b/clients/client-global-accelerator/src/commands/DescribeCustomRoutingListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeCustomRoutingListenerCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeCustomRoutingListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/DescribeEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/DescribeListenerCommand.ts b/clients/client-global-accelerator/src/commands/DescribeListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/DescribeListenerCommand.ts rename to clients/client-global-accelerator/src/commands/DescribeListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/ListAcceleratorsCommand.ts b/clients/client-global-accelerator/src/commands/ListAcceleratorsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListAcceleratorsCommand.ts rename to clients/client-global-accelerator/src/commands/ListAcceleratorsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListByoipCidrsCommand.ts b/clients/client-global-accelerator/src/commands/ListByoipCidrsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListByoipCidrsCommand.ts rename to clients/client-global-accelerator/src/commands/ListByoipCidrsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListCustomRoutingAcceleratorsCommand.ts b/clients/client-global-accelerator/src/commands/ListCustomRoutingAcceleratorsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListCustomRoutingAcceleratorsCommand.ts rename to clients/client-global-accelerator/src/commands/ListCustomRoutingAcceleratorsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListCustomRoutingEndpointGroupsCommand.ts b/clients/client-global-accelerator/src/commands/ListCustomRoutingEndpointGroupsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListCustomRoutingEndpointGroupsCommand.ts rename to clients/client-global-accelerator/src/commands/ListCustomRoutingEndpointGroupsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListCustomRoutingListenersCommand.ts b/clients/client-global-accelerator/src/commands/ListCustomRoutingListenersCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListCustomRoutingListenersCommand.ts rename to clients/client-global-accelerator/src/commands/ListCustomRoutingListenersCommand.ts diff --git a/clients/client-global-accelerator/commands/ListCustomRoutingPortMappingsByDestinationCommand.ts b/clients/client-global-accelerator/src/commands/ListCustomRoutingPortMappingsByDestinationCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListCustomRoutingPortMappingsByDestinationCommand.ts rename to clients/client-global-accelerator/src/commands/ListCustomRoutingPortMappingsByDestinationCommand.ts diff --git a/clients/client-global-accelerator/commands/ListCustomRoutingPortMappingsCommand.ts b/clients/client-global-accelerator/src/commands/ListCustomRoutingPortMappingsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListCustomRoutingPortMappingsCommand.ts rename to clients/client-global-accelerator/src/commands/ListCustomRoutingPortMappingsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListEndpointGroupsCommand.ts b/clients/client-global-accelerator/src/commands/ListEndpointGroupsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListEndpointGroupsCommand.ts rename to clients/client-global-accelerator/src/commands/ListEndpointGroupsCommand.ts diff --git a/clients/client-global-accelerator/commands/ListListenersCommand.ts b/clients/client-global-accelerator/src/commands/ListListenersCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListListenersCommand.ts rename to clients/client-global-accelerator/src/commands/ListListenersCommand.ts diff --git a/clients/client-global-accelerator/commands/ListTagsForResourceCommand.ts b/clients/client-global-accelerator/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ListTagsForResourceCommand.ts rename to clients/client-global-accelerator/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-global-accelerator/commands/ProvisionByoipCidrCommand.ts b/clients/client-global-accelerator/src/commands/ProvisionByoipCidrCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/ProvisionByoipCidrCommand.ts rename to clients/client-global-accelerator/src/commands/ProvisionByoipCidrCommand.ts diff --git a/clients/client-global-accelerator/commands/RemoveCustomRoutingEndpointsCommand.ts b/clients/client-global-accelerator/src/commands/RemoveCustomRoutingEndpointsCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/RemoveCustomRoutingEndpointsCommand.ts rename to clients/client-global-accelerator/src/commands/RemoveCustomRoutingEndpointsCommand.ts diff --git a/clients/client-global-accelerator/commands/TagResourceCommand.ts b/clients/client-global-accelerator/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/TagResourceCommand.ts rename to clients/client-global-accelerator/src/commands/TagResourceCommand.ts diff --git a/clients/client-global-accelerator/commands/UntagResourceCommand.ts b/clients/client-global-accelerator/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UntagResourceCommand.ts rename to clients/client-global-accelerator/src/commands/UntagResourceCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateAcceleratorAttributesCommand.ts b/clients/client-global-accelerator/src/commands/UpdateAcceleratorAttributesCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateAcceleratorAttributesCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateAcceleratorAttributesCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/UpdateAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateCustomRoutingAcceleratorAttributesCommand.ts b/clients/client-global-accelerator/src/commands/UpdateCustomRoutingAcceleratorAttributesCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateCustomRoutingAcceleratorAttributesCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateCustomRoutingAcceleratorAttributesCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateCustomRoutingAcceleratorCommand.ts b/clients/client-global-accelerator/src/commands/UpdateCustomRoutingAcceleratorCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateCustomRoutingAcceleratorCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateCustomRoutingAcceleratorCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateCustomRoutingListenerCommand.ts b/clients/client-global-accelerator/src/commands/UpdateCustomRoutingListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateCustomRoutingListenerCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateCustomRoutingListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateEndpointGroupCommand.ts b/clients/client-global-accelerator/src/commands/UpdateEndpointGroupCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateEndpointGroupCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateEndpointGroupCommand.ts diff --git a/clients/client-global-accelerator/commands/UpdateListenerCommand.ts b/clients/client-global-accelerator/src/commands/UpdateListenerCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/UpdateListenerCommand.ts rename to clients/client-global-accelerator/src/commands/UpdateListenerCommand.ts diff --git a/clients/client-global-accelerator/commands/WithdrawByoipCidrCommand.ts b/clients/client-global-accelerator/src/commands/WithdrawByoipCidrCommand.ts similarity index 100% rename from clients/client-global-accelerator/commands/WithdrawByoipCidrCommand.ts rename to clients/client-global-accelerator/src/commands/WithdrawByoipCidrCommand.ts diff --git a/clients/client-global-accelerator/endpoints.ts b/clients/client-global-accelerator/src/endpoints.ts similarity index 100% rename from clients/client-global-accelerator/endpoints.ts rename to clients/client-global-accelerator/src/endpoints.ts diff --git a/clients/client-global-accelerator/index.ts b/clients/client-global-accelerator/src/index.ts similarity index 100% rename from clients/client-global-accelerator/index.ts rename to clients/client-global-accelerator/src/index.ts diff --git a/clients/client-global-accelerator/models/index.ts b/clients/client-global-accelerator/src/models/index.ts similarity index 100% rename from clients/client-global-accelerator/models/index.ts rename to clients/client-global-accelerator/src/models/index.ts diff --git a/clients/client-global-accelerator/models/models_0.ts b/clients/client-global-accelerator/src/models/models_0.ts similarity index 100% rename from clients/client-global-accelerator/models/models_0.ts rename to clients/client-global-accelerator/src/models/models_0.ts diff --git a/clients/client-global-accelerator/pagination/Interfaces.ts b/clients/client-global-accelerator/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-global-accelerator/pagination/Interfaces.ts rename to clients/client-global-accelerator/src/pagination/Interfaces.ts diff --git a/clients/client-global-accelerator/pagination/ListAcceleratorsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListAcceleratorsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListAcceleratorsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListAcceleratorsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListByoipCidrsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListByoipCidrsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListByoipCidrsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListByoipCidrsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListCustomRoutingAcceleratorsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListCustomRoutingAcceleratorsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListCustomRoutingAcceleratorsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListCustomRoutingAcceleratorsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListCustomRoutingEndpointGroupsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListCustomRoutingEndpointGroupsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListCustomRoutingEndpointGroupsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListCustomRoutingEndpointGroupsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListCustomRoutingListenersPaginator.ts b/clients/client-global-accelerator/src/pagination/ListCustomRoutingListenersPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListCustomRoutingListenersPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListCustomRoutingListenersPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListCustomRoutingPortMappingsByDestinationPaginator.ts b/clients/client-global-accelerator/src/pagination/ListCustomRoutingPortMappingsByDestinationPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListCustomRoutingPortMappingsByDestinationPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListCustomRoutingPortMappingsByDestinationPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListCustomRoutingPortMappingsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListCustomRoutingPortMappingsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListCustomRoutingPortMappingsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListCustomRoutingPortMappingsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListEndpointGroupsPaginator.ts b/clients/client-global-accelerator/src/pagination/ListEndpointGroupsPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListEndpointGroupsPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListEndpointGroupsPaginator.ts diff --git a/clients/client-global-accelerator/pagination/ListListenersPaginator.ts b/clients/client-global-accelerator/src/pagination/ListListenersPaginator.ts similarity index 100% rename from clients/client-global-accelerator/pagination/ListListenersPaginator.ts rename to clients/client-global-accelerator/src/pagination/ListListenersPaginator.ts diff --git a/clients/client-global-accelerator/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-global-accelerator/protocols/Aws_json1_1.ts rename to clients/client-global-accelerator/src/protocols/Aws_json1_1.ts diff --git a/clients/client-global-accelerator/src/runtimeConfig.browser.ts b/clients/client-global-accelerator/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..35bdcf25bd72 --- /dev/null +++ b/clients/client-global-accelerator/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GlobalAcceleratorClientConfig } from "./GlobalAcceleratorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-global-accelerator/runtimeConfig.native.ts b/clients/client-global-accelerator/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-global-accelerator/runtimeConfig.native.ts rename to clients/client-global-accelerator/src/runtimeConfig.native.ts diff --git a/clients/client-global-accelerator/runtimeConfig.shared.ts b/clients/client-global-accelerator/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-global-accelerator/runtimeConfig.shared.ts rename to clients/client-global-accelerator/src/runtimeConfig.shared.ts diff --git a/clients/client-global-accelerator/src/runtimeConfig.ts b/clients/client-global-accelerator/src/runtimeConfig.ts new file mode 100644 index 000000000000..53be08fe7593 --- /dev/null +++ b/clients/client-global-accelerator/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GlobalAcceleratorClientConfig } from "./GlobalAcceleratorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-global-accelerator/tsconfig.es.json b/clients/client-global-accelerator/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-global-accelerator/tsconfig.es.json +++ b/clients/client-global-accelerator/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-global-accelerator/tsconfig.json b/clients/client-global-accelerator/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-global-accelerator/tsconfig.json +++ b/clients/client-global-accelerator/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-global-accelerator/tsconfig.types.json b/clients/client-global-accelerator/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-global-accelerator/tsconfig.types.json +++ b/clients/client-global-accelerator/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-glue/.gitignore b/clients/client-glue/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-glue/.gitignore +++ b/clients/client-glue/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-glue/package.json b/clients/client-glue/package.json index 364a2240b3c3..abdee94a56eb 100644 --- a/clients/client-glue/package.json +++ b/clients/client-glue/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-glue", "repository": { "type": "git", diff --git a/clients/client-glue/runtimeConfig.browser.ts b/clients/client-glue/runtimeConfig.browser.ts deleted file mode 100644 index fedc3ea89e0e..000000000000 --- a/clients/client-glue/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GlueClientConfig } from "./GlueClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlueClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-glue/runtimeConfig.ts b/clients/client-glue/runtimeConfig.ts deleted file mode 100644 index 8063496909c6..000000000000 --- a/clients/client-glue/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GlueClientConfig } from "./GlueClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GlueClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-glue/Glue.ts b/clients/client-glue/src/Glue.ts similarity index 100% rename from clients/client-glue/Glue.ts rename to clients/client-glue/src/Glue.ts diff --git a/clients/client-glue/GlueClient.ts b/clients/client-glue/src/GlueClient.ts similarity index 100% rename from clients/client-glue/GlueClient.ts rename to clients/client-glue/src/GlueClient.ts diff --git a/clients/client-glue/commands/BatchCreatePartitionCommand.ts b/clients/client-glue/src/commands/BatchCreatePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchCreatePartitionCommand.ts rename to clients/client-glue/src/commands/BatchCreatePartitionCommand.ts diff --git a/clients/client-glue/commands/BatchDeleteConnectionCommand.ts b/clients/client-glue/src/commands/BatchDeleteConnectionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchDeleteConnectionCommand.ts rename to clients/client-glue/src/commands/BatchDeleteConnectionCommand.ts diff --git a/clients/client-glue/commands/BatchDeletePartitionCommand.ts b/clients/client-glue/src/commands/BatchDeletePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchDeletePartitionCommand.ts rename to clients/client-glue/src/commands/BatchDeletePartitionCommand.ts diff --git a/clients/client-glue/commands/BatchDeleteTableCommand.ts b/clients/client-glue/src/commands/BatchDeleteTableCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchDeleteTableCommand.ts rename to clients/client-glue/src/commands/BatchDeleteTableCommand.ts diff --git a/clients/client-glue/commands/BatchDeleteTableVersionCommand.ts b/clients/client-glue/src/commands/BatchDeleteTableVersionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchDeleteTableVersionCommand.ts rename to clients/client-glue/src/commands/BatchDeleteTableVersionCommand.ts diff --git a/clients/client-glue/commands/BatchGetBlueprintsCommand.ts b/clients/client-glue/src/commands/BatchGetBlueprintsCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetBlueprintsCommand.ts rename to clients/client-glue/src/commands/BatchGetBlueprintsCommand.ts diff --git a/clients/client-glue/commands/BatchGetCrawlersCommand.ts b/clients/client-glue/src/commands/BatchGetCrawlersCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetCrawlersCommand.ts rename to clients/client-glue/src/commands/BatchGetCrawlersCommand.ts diff --git a/clients/client-glue/commands/BatchGetDevEndpointsCommand.ts b/clients/client-glue/src/commands/BatchGetDevEndpointsCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetDevEndpointsCommand.ts rename to clients/client-glue/src/commands/BatchGetDevEndpointsCommand.ts diff --git a/clients/client-glue/commands/BatchGetJobsCommand.ts b/clients/client-glue/src/commands/BatchGetJobsCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetJobsCommand.ts rename to clients/client-glue/src/commands/BatchGetJobsCommand.ts diff --git a/clients/client-glue/commands/BatchGetPartitionCommand.ts b/clients/client-glue/src/commands/BatchGetPartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetPartitionCommand.ts rename to clients/client-glue/src/commands/BatchGetPartitionCommand.ts diff --git a/clients/client-glue/commands/BatchGetTriggersCommand.ts b/clients/client-glue/src/commands/BatchGetTriggersCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetTriggersCommand.ts rename to clients/client-glue/src/commands/BatchGetTriggersCommand.ts diff --git a/clients/client-glue/commands/BatchGetWorkflowsCommand.ts b/clients/client-glue/src/commands/BatchGetWorkflowsCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchGetWorkflowsCommand.ts rename to clients/client-glue/src/commands/BatchGetWorkflowsCommand.ts diff --git a/clients/client-glue/commands/BatchStopJobRunCommand.ts b/clients/client-glue/src/commands/BatchStopJobRunCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchStopJobRunCommand.ts rename to clients/client-glue/src/commands/BatchStopJobRunCommand.ts diff --git a/clients/client-glue/commands/BatchUpdatePartitionCommand.ts b/clients/client-glue/src/commands/BatchUpdatePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/BatchUpdatePartitionCommand.ts rename to clients/client-glue/src/commands/BatchUpdatePartitionCommand.ts diff --git a/clients/client-glue/commands/CancelMLTaskRunCommand.ts b/clients/client-glue/src/commands/CancelMLTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/CancelMLTaskRunCommand.ts rename to clients/client-glue/src/commands/CancelMLTaskRunCommand.ts diff --git a/clients/client-glue/commands/CheckSchemaVersionValidityCommand.ts b/clients/client-glue/src/commands/CheckSchemaVersionValidityCommand.ts similarity index 100% rename from clients/client-glue/commands/CheckSchemaVersionValidityCommand.ts rename to clients/client-glue/src/commands/CheckSchemaVersionValidityCommand.ts diff --git a/clients/client-glue/commands/CreateBlueprintCommand.ts b/clients/client-glue/src/commands/CreateBlueprintCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateBlueprintCommand.ts rename to clients/client-glue/src/commands/CreateBlueprintCommand.ts diff --git a/clients/client-glue/commands/CreateClassifierCommand.ts b/clients/client-glue/src/commands/CreateClassifierCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateClassifierCommand.ts rename to clients/client-glue/src/commands/CreateClassifierCommand.ts diff --git a/clients/client-glue/commands/CreateConnectionCommand.ts b/clients/client-glue/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateConnectionCommand.ts rename to clients/client-glue/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-glue/commands/CreateCrawlerCommand.ts b/clients/client-glue/src/commands/CreateCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateCrawlerCommand.ts rename to clients/client-glue/src/commands/CreateCrawlerCommand.ts diff --git a/clients/client-glue/commands/CreateDatabaseCommand.ts b/clients/client-glue/src/commands/CreateDatabaseCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateDatabaseCommand.ts rename to clients/client-glue/src/commands/CreateDatabaseCommand.ts diff --git a/clients/client-glue/commands/CreateDevEndpointCommand.ts b/clients/client-glue/src/commands/CreateDevEndpointCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateDevEndpointCommand.ts rename to clients/client-glue/src/commands/CreateDevEndpointCommand.ts diff --git a/clients/client-glue/commands/CreateJobCommand.ts b/clients/client-glue/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateJobCommand.ts rename to clients/client-glue/src/commands/CreateJobCommand.ts diff --git a/clients/client-glue/commands/CreateMLTransformCommand.ts b/clients/client-glue/src/commands/CreateMLTransformCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateMLTransformCommand.ts rename to clients/client-glue/src/commands/CreateMLTransformCommand.ts diff --git a/clients/client-glue/commands/CreatePartitionCommand.ts b/clients/client-glue/src/commands/CreatePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/CreatePartitionCommand.ts rename to clients/client-glue/src/commands/CreatePartitionCommand.ts diff --git a/clients/client-glue/commands/CreatePartitionIndexCommand.ts b/clients/client-glue/src/commands/CreatePartitionIndexCommand.ts similarity index 100% rename from clients/client-glue/commands/CreatePartitionIndexCommand.ts rename to clients/client-glue/src/commands/CreatePartitionIndexCommand.ts diff --git a/clients/client-glue/commands/CreateRegistryCommand.ts b/clients/client-glue/src/commands/CreateRegistryCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateRegistryCommand.ts rename to clients/client-glue/src/commands/CreateRegistryCommand.ts diff --git a/clients/client-glue/commands/CreateSchemaCommand.ts b/clients/client-glue/src/commands/CreateSchemaCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateSchemaCommand.ts rename to clients/client-glue/src/commands/CreateSchemaCommand.ts diff --git a/clients/client-glue/commands/CreateScriptCommand.ts b/clients/client-glue/src/commands/CreateScriptCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateScriptCommand.ts rename to clients/client-glue/src/commands/CreateScriptCommand.ts diff --git a/clients/client-glue/commands/CreateSecurityConfigurationCommand.ts b/clients/client-glue/src/commands/CreateSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateSecurityConfigurationCommand.ts rename to clients/client-glue/src/commands/CreateSecurityConfigurationCommand.ts diff --git a/clients/client-glue/commands/CreateTableCommand.ts b/clients/client-glue/src/commands/CreateTableCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateTableCommand.ts rename to clients/client-glue/src/commands/CreateTableCommand.ts diff --git a/clients/client-glue/commands/CreateTriggerCommand.ts b/clients/client-glue/src/commands/CreateTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateTriggerCommand.ts rename to clients/client-glue/src/commands/CreateTriggerCommand.ts diff --git a/clients/client-glue/commands/CreateUserDefinedFunctionCommand.ts b/clients/client-glue/src/commands/CreateUserDefinedFunctionCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateUserDefinedFunctionCommand.ts rename to clients/client-glue/src/commands/CreateUserDefinedFunctionCommand.ts diff --git a/clients/client-glue/commands/CreateWorkflowCommand.ts b/clients/client-glue/src/commands/CreateWorkflowCommand.ts similarity index 100% rename from clients/client-glue/commands/CreateWorkflowCommand.ts rename to clients/client-glue/src/commands/CreateWorkflowCommand.ts diff --git a/clients/client-glue/commands/DeleteBlueprintCommand.ts b/clients/client-glue/src/commands/DeleteBlueprintCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteBlueprintCommand.ts rename to clients/client-glue/src/commands/DeleteBlueprintCommand.ts diff --git a/clients/client-glue/commands/DeleteClassifierCommand.ts b/clients/client-glue/src/commands/DeleteClassifierCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteClassifierCommand.ts rename to clients/client-glue/src/commands/DeleteClassifierCommand.ts diff --git a/clients/client-glue/commands/DeleteColumnStatisticsForPartitionCommand.ts b/clients/client-glue/src/commands/DeleteColumnStatisticsForPartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteColumnStatisticsForPartitionCommand.ts rename to clients/client-glue/src/commands/DeleteColumnStatisticsForPartitionCommand.ts diff --git a/clients/client-glue/commands/DeleteColumnStatisticsForTableCommand.ts b/clients/client-glue/src/commands/DeleteColumnStatisticsForTableCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteColumnStatisticsForTableCommand.ts rename to clients/client-glue/src/commands/DeleteColumnStatisticsForTableCommand.ts diff --git a/clients/client-glue/commands/DeleteConnectionCommand.ts b/clients/client-glue/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteConnectionCommand.ts rename to clients/client-glue/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-glue/commands/DeleteCrawlerCommand.ts b/clients/client-glue/src/commands/DeleteCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteCrawlerCommand.ts rename to clients/client-glue/src/commands/DeleteCrawlerCommand.ts diff --git a/clients/client-glue/commands/DeleteDatabaseCommand.ts b/clients/client-glue/src/commands/DeleteDatabaseCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteDatabaseCommand.ts rename to clients/client-glue/src/commands/DeleteDatabaseCommand.ts diff --git a/clients/client-glue/commands/DeleteDevEndpointCommand.ts b/clients/client-glue/src/commands/DeleteDevEndpointCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteDevEndpointCommand.ts rename to clients/client-glue/src/commands/DeleteDevEndpointCommand.ts diff --git a/clients/client-glue/commands/DeleteJobCommand.ts b/clients/client-glue/src/commands/DeleteJobCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteJobCommand.ts rename to clients/client-glue/src/commands/DeleteJobCommand.ts diff --git a/clients/client-glue/commands/DeleteMLTransformCommand.ts b/clients/client-glue/src/commands/DeleteMLTransformCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteMLTransformCommand.ts rename to clients/client-glue/src/commands/DeleteMLTransformCommand.ts diff --git a/clients/client-glue/commands/DeletePartitionCommand.ts b/clients/client-glue/src/commands/DeletePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/DeletePartitionCommand.ts rename to clients/client-glue/src/commands/DeletePartitionCommand.ts diff --git a/clients/client-glue/commands/DeletePartitionIndexCommand.ts b/clients/client-glue/src/commands/DeletePartitionIndexCommand.ts similarity index 100% rename from clients/client-glue/commands/DeletePartitionIndexCommand.ts rename to clients/client-glue/src/commands/DeletePartitionIndexCommand.ts diff --git a/clients/client-glue/commands/DeleteRegistryCommand.ts b/clients/client-glue/src/commands/DeleteRegistryCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteRegistryCommand.ts rename to clients/client-glue/src/commands/DeleteRegistryCommand.ts diff --git a/clients/client-glue/commands/DeleteResourcePolicyCommand.ts b/clients/client-glue/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteResourcePolicyCommand.ts rename to clients/client-glue/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-glue/commands/DeleteSchemaCommand.ts b/clients/client-glue/src/commands/DeleteSchemaCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteSchemaCommand.ts rename to clients/client-glue/src/commands/DeleteSchemaCommand.ts diff --git a/clients/client-glue/commands/DeleteSchemaVersionsCommand.ts b/clients/client-glue/src/commands/DeleteSchemaVersionsCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteSchemaVersionsCommand.ts rename to clients/client-glue/src/commands/DeleteSchemaVersionsCommand.ts diff --git a/clients/client-glue/commands/DeleteSecurityConfigurationCommand.ts b/clients/client-glue/src/commands/DeleteSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteSecurityConfigurationCommand.ts rename to clients/client-glue/src/commands/DeleteSecurityConfigurationCommand.ts diff --git a/clients/client-glue/commands/DeleteTableCommand.ts b/clients/client-glue/src/commands/DeleteTableCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteTableCommand.ts rename to clients/client-glue/src/commands/DeleteTableCommand.ts diff --git a/clients/client-glue/commands/DeleteTableVersionCommand.ts b/clients/client-glue/src/commands/DeleteTableVersionCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteTableVersionCommand.ts rename to clients/client-glue/src/commands/DeleteTableVersionCommand.ts diff --git a/clients/client-glue/commands/DeleteTriggerCommand.ts b/clients/client-glue/src/commands/DeleteTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteTriggerCommand.ts rename to clients/client-glue/src/commands/DeleteTriggerCommand.ts diff --git a/clients/client-glue/commands/DeleteUserDefinedFunctionCommand.ts b/clients/client-glue/src/commands/DeleteUserDefinedFunctionCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteUserDefinedFunctionCommand.ts rename to clients/client-glue/src/commands/DeleteUserDefinedFunctionCommand.ts diff --git a/clients/client-glue/commands/DeleteWorkflowCommand.ts b/clients/client-glue/src/commands/DeleteWorkflowCommand.ts similarity index 100% rename from clients/client-glue/commands/DeleteWorkflowCommand.ts rename to clients/client-glue/src/commands/DeleteWorkflowCommand.ts diff --git a/clients/client-glue/commands/GetBlueprintCommand.ts b/clients/client-glue/src/commands/GetBlueprintCommand.ts similarity index 100% rename from clients/client-glue/commands/GetBlueprintCommand.ts rename to clients/client-glue/src/commands/GetBlueprintCommand.ts diff --git a/clients/client-glue/commands/GetBlueprintRunCommand.ts b/clients/client-glue/src/commands/GetBlueprintRunCommand.ts similarity index 100% rename from clients/client-glue/commands/GetBlueprintRunCommand.ts rename to clients/client-glue/src/commands/GetBlueprintRunCommand.ts diff --git a/clients/client-glue/commands/GetBlueprintRunsCommand.ts b/clients/client-glue/src/commands/GetBlueprintRunsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetBlueprintRunsCommand.ts rename to clients/client-glue/src/commands/GetBlueprintRunsCommand.ts diff --git a/clients/client-glue/commands/GetCatalogImportStatusCommand.ts b/clients/client-glue/src/commands/GetCatalogImportStatusCommand.ts similarity index 100% rename from clients/client-glue/commands/GetCatalogImportStatusCommand.ts rename to clients/client-glue/src/commands/GetCatalogImportStatusCommand.ts diff --git a/clients/client-glue/commands/GetClassifierCommand.ts b/clients/client-glue/src/commands/GetClassifierCommand.ts similarity index 100% rename from clients/client-glue/commands/GetClassifierCommand.ts rename to clients/client-glue/src/commands/GetClassifierCommand.ts diff --git a/clients/client-glue/commands/GetClassifiersCommand.ts b/clients/client-glue/src/commands/GetClassifiersCommand.ts similarity index 100% rename from clients/client-glue/commands/GetClassifiersCommand.ts rename to clients/client-glue/src/commands/GetClassifiersCommand.ts diff --git a/clients/client-glue/commands/GetColumnStatisticsForPartitionCommand.ts b/clients/client-glue/src/commands/GetColumnStatisticsForPartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetColumnStatisticsForPartitionCommand.ts rename to clients/client-glue/src/commands/GetColumnStatisticsForPartitionCommand.ts diff --git a/clients/client-glue/commands/GetColumnStatisticsForTableCommand.ts b/clients/client-glue/src/commands/GetColumnStatisticsForTableCommand.ts similarity index 100% rename from clients/client-glue/commands/GetColumnStatisticsForTableCommand.ts rename to clients/client-glue/src/commands/GetColumnStatisticsForTableCommand.ts diff --git a/clients/client-glue/commands/GetConnectionCommand.ts b/clients/client-glue/src/commands/GetConnectionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetConnectionCommand.ts rename to clients/client-glue/src/commands/GetConnectionCommand.ts diff --git a/clients/client-glue/commands/GetConnectionsCommand.ts b/clients/client-glue/src/commands/GetConnectionsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetConnectionsCommand.ts rename to clients/client-glue/src/commands/GetConnectionsCommand.ts diff --git a/clients/client-glue/commands/GetCrawlerCommand.ts b/clients/client-glue/src/commands/GetCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/GetCrawlerCommand.ts rename to clients/client-glue/src/commands/GetCrawlerCommand.ts diff --git a/clients/client-glue/commands/GetCrawlerMetricsCommand.ts b/clients/client-glue/src/commands/GetCrawlerMetricsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetCrawlerMetricsCommand.ts rename to clients/client-glue/src/commands/GetCrawlerMetricsCommand.ts diff --git a/clients/client-glue/commands/GetCrawlersCommand.ts b/clients/client-glue/src/commands/GetCrawlersCommand.ts similarity index 100% rename from clients/client-glue/commands/GetCrawlersCommand.ts rename to clients/client-glue/src/commands/GetCrawlersCommand.ts diff --git a/clients/client-glue/commands/GetDataCatalogEncryptionSettingsCommand.ts b/clients/client-glue/src/commands/GetDataCatalogEncryptionSettingsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDataCatalogEncryptionSettingsCommand.ts rename to clients/client-glue/src/commands/GetDataCatalogEncryptionSettingsCommand.ts diff --git a/clients/client-glue/commands/GetDatabaseCommand.ts b/clients/client-glue/src/commands/GetDatabaseCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDatabaseCommand.ts rename to clients/client-glue/src/commands/GetDatabaseCommand.ts diff --git a/clients/client-glue/commands/GetDatabasesCommand.ts b/clients/client-glue/src/commands/GetDatabasesCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDatabasesCommand.ts rename to clients/client-glue/src/commands/GetDatabasesCommand.ts diff --git a/clients/client-glue/commands/GetDataflowGraphCommand.ts b/clients/client-glue/src/commands/GetDataflowGraphCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDataflowGraphCommand.ts rename to clients/client-glue/src/commands/GetDataflowGraphCommand.ts diff --git a/clients/client-glue/commands/GetDevEndpointCommand.ts b/clients/client-glue/src/commands/GetDevEndpointCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDevEndpointCommand.ts rename to clients/client-glue/src/commands/GetDevEndpointCommand.ts diff --git a/clients/client-glue/commands/GetDevEndpointsCommand.ts b/clients/client-glue/src/commands/GetDevEndpointsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetDevEndpointsCommand.ts rename to clients/client-glue/src/commands/GetDevEndpointsCommand.ts diff --git a/clients/client-glue/commands/GetJobBookmarkCommand.ts b/clients/client-glue/src/commands/GetJobBookmarkCommand.ts similarity index 100% rename from clients/client-glue/commands/GetJobBookmarkCommand.ts rename to clients/client-glue/src/commands/GetJobBookmarkCommand.ts diff --git a/clients/client-glue/commands/GetJobCommand.ts b/clients/client-glue/src/commands/GetJobCommand.ts similarity index 100% rename from clients/client-glue/commands/GetJobCommand.ts rename to clients/client-glue/src/commands/GetJobCommand.ts diff --git a/clients/client-glue/commands/GetJobRunCommand.ts b/clients/client-glue/src/commands/GetJobRunCommand.ts similarity index 100% rename from clients/client-glue/commands/GetJobRunCommand.ts rename to clients/client-glue/src/commands/GetJobRunCommand.ts diff --git a/clients/client-glue/commands/GetJobRunsCommand.ts b/clients/client-glue/src/commands/GetJobRunsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetJobRunsCommand.ts rename to clients/client-glue/src/commands/GetJobRunsCommand.ts diff --git a/clients/client-glue/commands/GetJobsCommand.ts b/clients/client-glue/src/commands/GetJobsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetJobsCommand.ts rename to clients/client-glue/src/commands/GetJobsCommand.ts diff --git a/clients/client-glue/commands/GetMLTaskRunCommand.ts b/clients/client-glue/src/commands/GetMLTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/GetMLTaskRunCommand.ts rename to clients/client-glue/src/commands/GetMLTaskRunCommand.ts diff --git a/clients/client-glue/commands/GetMLTaskRunsCommand.ts b/clients/client-glue/src/commands/GetMLTaskRunsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetMLTaskRunsCommand.ts rename to clients/client-glue/src/commands/GetMLTaskRunsCommand.ts diff --git a/clients/client-glue/commands/GetMLTransformCommand.ts b/clients/client-glue/src/commands/GetMLTransformCommand.ts similarity index 100% rename from clients/client-glue/commands/GetMLTransformCommand.ts rename to clients/client-glue/src/commands/GetMLTransformCommand.ts diff --git a/clients/client-glue/commands/GetMLTransformsCommand.ts b/clients/client-glue/src/commands/GetMLTransformsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetMLTransformsCommand.ts rename to clients/client-glue/src/commands/GetMLTransformsCommand.ts diff --git a/clients/client-glue/commands/GetMappingCommand.ts b/clients/client-glue/src/commands/GetMappingCommand.ts similarity index 100% rename from clients/client-glue/commands/GetMappingCommand.ts rename to clients/client-glue/src/commands/GetMappingCommand.ts diff --git a/clients/client-glue/commands/GetPartitionCommand.ts b/clients/client-glue/src/commands/GetPartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetPartitionCommand.ts rename to clients/client-glue/src/commands/GetPartitionCommand.ts diff --git a/clients/client-glue/commands/GetPartitionIndexesCommand.ts b/clients/client-glue/src/commands/GetPartitionIndexesCommand.ts similarity index 100% rename from clients/client-glue/commands/GetPartitionIndexesCommand.ts rename to clients/client-glue/src/commands/GetPartitionIndexesCommand.ts diff --git a/clients/client-glue/commands/GetPartitionsCommand.ts b/clients/client-glue/src/commands/GetPartitionsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetPartitionsCommand.ts rename to clients/client-glue/src/commands/GetPartitionsCommand.ts diff --git a/clients/client-glue/commands/GetPlanCommand.ts b/clients/client-glue/src/commands/GetPlanCommand.ts similarity index 100% rename from clients/client-glue/commands/GetPlanCommand.ts rename to clients/client-glue/src/commands/GetPlanCommand.ts diff --git a/clients/client-glue/commands/GetRegistryCommand.ts b/clients/client-glue/src/commands/GetRegistryCommand.ts similarity index 100% rename from clients/client-glue/commands/GetRegistryCommand.ts rename to clients/client-glue/src/commands/GetRegistryCommand.ts diff --git a/clients/client-glue/commands/GetResourcePoliciesCommand.ts b/clients/client-glue/src/commands/GetResourcePoliciesCommand.ts similarity index 100% rename from clients/client-glue/commands/GetResourcePoliciesCommand.ts rename to clients/client-glue/src/commands/GetResourcePoliciesCommand.ts diff --git a/clients/client-glue/commands/GetResourcePolicyCommand.ts b/clients/client-glue/src/commands/GetResourcePolicyCommand.ts similarity index 100% rename from clients/client-glue/commands/GetResourcePolicyCommand.ts rename to clients/client-glue/src/commands/GetResourcePolicyCommand.ts diff --git a/clients/client-glue/commands/GetSchemaByDefinitionCommand.ts b/clients/client-glue/src/commands/GetSchemaByDefinitionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSchemaByDefinitionCommand.ts rename to clients/client-glue/src/commands/GetSchemaByDefinitionCommand.ts diff --git a/clients/client-glue/commands/GetSchemaCommand.ts b/clients/client-glue/src/commands/GetSchemaCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSchemaCommand.ts rename to clients/client-glue/src/commands/GetSchemaCommand.ts diff --git a/clients/client-glue/commands/GetSchemaVersionCommand.ts b/clients/client-glue/src/commands/GetSchemaVersionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSchemaVersionCommand.ts rename to clients/client-glue/src/commands/GetSchemaVersionCommand.ts diff --git a/clients/client-glue/commands/GetSchemaVersionsDiffCommand.ts b/clients/client-glue/src/commands/GetSchemaVersionsDiffCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSchemaVersionsDiffCommand.ts rename to clients/client-glue/src/commands/GetSchemaVersionsDiffCommand.ts diff --git a/clients/client-glue/commands/GetSecurityConfigurationCommand.ts b/clients/client-glue/src/commands/GetSecurityConfigurationCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSecurityConfigurationCommand.ts rename to clients/client-glue/src/commands/GetSecurityConfigurationCommand.ts diff --git a/clients/client-glue/commands/GetSecurityConfigurationsCommand.ts b/clients/client-glue/src/commands/GetSecurityConfigurationsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetSecurityConfigurationsCommand.ts rename to clients/client-glue/src/commands/GetSecurityConfigurationsCommand.ts diff --git a/clients/client-glue/commands/GetTableCommand.ts b/clients/client-glue/src/commands/GetTableCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTableCommand.ts rename to clients/client-glue/src/commands/GetTableCommand.ts diff --git a/clients/client-glue/commands/GetTableVersionCommand.ts b/clients/client-glue/src/commands/GetTableVersionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTableVersionCommand.ts rename to clients/client-glue/src/commands/GetTableVersionCommand.ts diff --git a/clients/client-glue/commands/GetTableVersionsCommand.ts b/clients/client-glue/src/commands/GetTableVersionsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTableVersionsCommand.ts rename to clients/client-glue/src/commands/GetTableVersionsCommand.ts diff --git a/clients/client-glue/commands/GetTablesCommand.ts b/clients/client-glue/src/commands/GetTablesCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTablesCommand.ts rename to clients/client-glue/src/commands/GetTablesCommand.ts diff --git a/clients/client-glue/commands/GetTagsCommand.ts b/clients/client-glue/src/commands/GetTagsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTagsCommand.ts rename to clients/client-glue/src/commands/GetTagsCommand.ts diff --git a/clients/client-glue/commands/GetTriggerCommand.ts b/clients/client-glue/src/commands/GetTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTriggerCommand.ts rename to clients/client-glue/src/commands/GetTriggerCommand.ts diff --git a/clients/client-glue/commands/GetTriggersCommand.ts b/clients/client-glue/src/commands/GetTriggersCommand.ts similarity index 100% rename from clients/client-glue/commands/GetTriggersCommand.ts rename to clients/client-glue/src/commands/GetTriggersCommand.ts diff --git a/clients/client-glue/commands/GetUserDefinedFunctionCommand.ts b/clients/client-glue/src/commands/GetUserDefinedFunctionCommand.ts similarity index 100% rename from clients/client-glue/commands/GetUserDefinedFunctionCommand.ts rename to clients/client-glue/src/commands/GetUserDefinedFunctionCommand.ts diff --git a/clients/client-glue/commands/GetUserDefinedFunctionsCommand.ts b/clients/client-glue/src/commands/GetUserDefinedFunctionsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetUserDefinedFunctionsCommand.ts rename to clients/client-glue/src/commands/GetUserDefinedFunctionsCommand.ts diff --git a/clients/client-glue/commands/GetWorkflowCommand.ts b/clients/client-glue/src/commands/GetWorkflowCommand.ts similarity index 100% rename from clients/client-glue/commands/GetWorkflowCommand.ts rename to clients/client-glue/src/commands/GetWorkflowCommand.ts diff --git a/clients/client-glue/commands/GetWorkflowRunCommand.ts b/clients/client-glue/src/commands/GetWorkflowRunCommand.ts similarity index 100% rename from clients/client-glue/commands/GetWorkflowRunCommand.ts rename to clients/client-glue/src/commands/GetWorkflowRunCommand.ts diff --git a/clients/client-glue/commands/GetWorkflowRunPropertiesCommand.ts b/clients/client-glue/src/commands/GetWorkflowRunPropertiesCommand.ts similarity index 100% rename from clients/client-glue/commands/GetWorkflowRunPropertiesCommand.ts rename to clients/client-glue/src/commands/GetWorkflowRunPropertiesCommand.ts diff --git a/clients/client-glue/commands/GetWorkflowRunsCommand.ts b/clients/client-glue/src/commands/GetWorkflowRunsCommand.ts similarity index 100% rename from clients/client-glue/commands/GetWorkflowRunsCommand.ts rename to clients/client-glue/src/commands/GetWorkflowRunsCommand.ts diff --git a/clients/client-glue/commands/ImportCatalogToGlueCommand.ts b/clients/client-glue/src/commands/ImportCatalogToGlueCommand.ts similarity index 100% rename from clients/client-glue/commands/ImportCatalogToGlueCommand.ts rename to clients/client-glue/src/commands/ImportCatalogToGlueCommand.ts diff --git a/clients/client-glue/commands/ListBlueprintsCommand.ts b/clients/client-glue/src/commands/ListBlueprintsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListBlueprintsCommand.ts rename to clients/client-glue/src/commands/ListBlueprintsCommand.ts diff --git a/clients/client-glue/commands/ListCrawlersCommand.ts b/clients/client-glue/src/commands/ListCrawlersCommand.ts similarity index 100% rename from clients/client-glue/commands/ListCrawlersCommand.ts rename to clients/client-glue/src/commands/ListCrawlersCommand.ts diff --git a/clients/client-glue/commands/ListDevEndpointsCommand.ts b/clients/client-glue/src/commands/ListDevEndpointsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListDevEndpointsCommand.ts rename to clients/client-glue/src/commands/ListDevEndpointsCommand.ts diff --git a/clients/client-glue/commands/ListJobsCommand.ts b/clients/client-glue/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListJobsCommand.ts rename to clients/client-glue/src/commands/ListJobsCommand.ts diff --git a/clients/client-glue/commands/ListMLTransformsCommand.ts b/clients/client-glue/src/commands/ListMLTransformsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListMLTransformsCommand.ts rename to clients/client-glue/src/commands/ListMLTransformsCommand.ts diff --git a/clients/client-glue/commands/ListRegistriesCommand.ts b/clients/client-glue/src/commands/ListRegistriesCommand.ts similarity index 100% rename from clients/client-glue/commands/ListRegistriesCommand.ts rename to clients/client-glue/src/commands/ListRegistriesCommand.ts diff --git a/clients/client-glue/commands/ListSchemaVersionsCommand.ts b/clients/client-glue/src/commands/ListSchemaVersionsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListSchemaVersionsCommand.ts rename to clients/client-glue/src/commands/ListSchemaVersionsCommand.ts diff --git a/clients/client-glue/commands/ListSchemasCommand.ts b/clients/client-glue/src/commands/ListSchemasCommand.ts similarity index 100% rename from clients/client-glue/commands/ListSchemasCommand.ts rename to clients/client-glue/src/commands/ListSchemasCommand.ts diff --git a/clients/client-glue/commands/ListTriggersCommand.ts b/clients/client-glue/src/commands/ListTriggersCommand.ts similarity index 100% rename from clients/client-glue/commands/ListTriggersCommand.ts rename to clients/client-glue/src/commands/ListTriggersCommand.ts diff --git a/clients/client-glue/commands/ListWorkflowsCommand.ts b/clients/client-glue/src/commands/ListWorkflowsCommand.ts similarity index 100% rename from clients/client-glue/commands/ListWorkflowsCommand.ts rename to clients/client-glue/src/commands/ListWorkflowsCommand.ts diff --git a/clients/client-glue/commands/PutDataCatalogEncryptionSettingsCommand.ts b/clients/client-glue/src/commands/PutDataCatalogEncryptionSettingsCommand.ts similarity index 100% rename from clients/client-glue/commands/PutDataCatalogEncryptionSettingsCommand.ts rename to clients/client-glue/src/commands/PutDataCatalogEncryptionSettingsCommand.ts diff --git a/clients/client-glue/commands/PutResourcePolicyCommand.ts b/clients/client-glue/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-glue/commands/PutResourcePolicyCommand.ts rename to clients/client-glue/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-glue/commands/PutSchemaVersionMetadataCommand.ts b/clients/client-glue/src/commands/PutSchemaVersionMetadataCommand.ts similarity index 100% rename from clients/client-glue/commands/PutSchemaVersionMetadataCommand.ts rename to clients/client-glue/src/commands/PutSchemaVersionMetadataCommand.ts diff --git a/clients/client-glue/commands/PutWorkflowRunPropertiesCommand.ts b/clients/client-glue/src/commands/PutWorkflowRunPropertiesCommand.ts similarity index 100% rename from clients/client-glue/commands/PutWorkflowRunPropertiesCommand.ts rename to clients/client-glue/src/commands/PutWorkflowRunPropertiesCommand.ts diff --git a/clients/client-glue/commands/QuerySchemaVersionMetadataCommand.ts b/clients/client-glue/src/commands/QuerySchemaVersionMetadataCommand.ts similarity index 100% rename from clients/client-glue/commands/QuerySchemaVersionMetadataCommand.ts rename to clients/client-glue/src/commands/QuerySchemaVersionMetadataCommand.ts diff --git a/clients/client-glue/commands/RegisterSchemaVersionCommand.ts b/clients/client-glue/src/commands/RegisterSchemaVersionCommand.ts similarity index 100% rename from clients/client-glue/commands/RegisterSchemaVersionCommand.ts rename to clients/client-glue/src/commands/RegisterSchemaVersionCommand.ts diff --git a/clients/client-glue/commands/RemoveSchemaVersionMetadataCommand.ts b/clients/client-glue/src/commands/RemoveSchemaVersionMetadataCommand.ts similarity index 100% rename from clients/client-glue/commands/RemoveSchemaVersionMetadataCommand.ts rename to clients/client-glue/src/commands/RemoveSchemaVersionMetadataCommand.ts diff --git a/clients/client-glue/commands/ResetJobBookmarkCommand.ts b/clients/client-glue/src/commands/ResetJobBookmarkCommand.ts similarity index 100% rename from clients/client-glue/commands/ResetJobBookmarkCommand.ts rename to clients/client-glue/src/commands/ResetJobBookmarkCommand.ts diff --git a/clients/client-glue/commands/ResumeWorkflowRunCommand.ts b/clients/client-glue/src/commands/ResumeWorkflowRunCommand.ts similarity index 100% rename from clients/client-glue/commands/ResumeWorkflowRunCommand.ts rename to clients/client-glue/src/commands/ResumeWorkflowRunCommand.ts diff --git a/clients/client-glue/commands/SearchTablesCommand.ts b/clients/client-glue/src/commands/SearchTablesCommand.ts similarity index 100% rename from clients/client-glue/commands/SearchTablesCommand.ts rename to clients/client-glue/src/commands/SearchTablesCommand.ts diff --git a/clients/client-glue/commands/StartBlueprintRunCommand.ts b/clients/client-glue/src/commands/StartBlueprintRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartBlueprintRunCommand.ts rename to clients/client-glue/src/commands/StartBlueprintRunCommand.ts diff --git a/clients/client-glue/commands/StartCrawlerCommand.ts b/clients/client-glue/src/commands/StartCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/StartCrawlerCommand.ts rename to clients/client-glue/src/commands/StartCrawlerCommand.ts diff --git a/clients/client-glue/commands/StartCrawlerScheduleCommand.ts b/clients/client-glue/src/commands/StartCrawlerScheduleCommand.ts similarity index 100% rename from clients/client-glue/commands/StartCrawlerScheduleCommand.ts rename to clients/client-glue/src/commands/StartCrawlerScheduleCommand.ts diff --git a/clients/client-glue/commands/StartExportLabelsTaskRunCommand.ts b/clients/client-glue/src/commands/StartExportLabelsTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartExportLabelsTaskRunCommand.ts rename to clients/client-glue/src/commands/StartExportLabelsTaskRunCommand.ts diff --git a/clients/client-glue/commands/StartImportLabelsTaskRunCommand.ts b/clients/client-glue/src/commands/StartImportLabelsTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartImportLabelsTaskRunCommand.ts rename to clients/client-glue/src/commands/StartImportLabelsTaskRunCommand.ts diff --git a/clients/client-glue/commands/StartJobRunCommand.ts b/clients/client-glue/src/commands/StartJobRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartJobRunCommand.ts rename to clients/client-glue/src/commands/StartJobRunCommand.ts diff --git a/clients/client-glue/commands/StartMLEvaluationTaskRunCommand.ts b/clients/client-glue/src/commands/StartMLEvaluationTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartMLEvaluationTaskRunCommand.ts rename to clients/client-glue/src/commands/StartMLEvaluationTaskRunCommand.ts diff --git a/clients/client-glue/commands/StartMLLabelingSetGenerationTaskRunCommand.ts b/clients/client-glue/src/commands/StartMLLabelingSetGenerationTaskRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartMLLabelingSetGenerationTaskRunCommand.ts rename to clients/client-glue/src/commands/StartMLLabelingSetGenerationTaskRunCommand.ts diff --git a/clients/client-glue/commands/StartTriggerCommand.ts b/clients/client-glue/src/commands/StartTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/StartTriggerCommand.ts rename to clients/client-glue/src/commands/StartTriggerCommand.ts diff --git a/clients/client-glue/commands/StartWorkflowRunCommand.ts b/clients/client-glue/src/commands/StartWorkflowRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StartWorkflowRunCommand.ts rename to clients/client-glue/src/commands/StartWorkflowRunCommand.ts diff --git a/clients/client-glue/commands/StopCrawlerCommand.ts b/clients/client-glue/src/commands/StopCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/StopCrawlerCommand.ts rename to clients/client-glue/src/commands/StopCrawlerCommand.ts diff --git a/clients/client-glue/commands/StopCrawlerScheduleCommand.ts b/clients/client-glue/src/commands/StopCrawlerScheduleCommand.ts similarity index 100% rename from clients/client-glue/commands/StopCrawlerScheduleCommand.ts rename to clients/client-glue/src/commands/StopCrawlerScheduleCommand.ts diff --git a/clients/client-glue/commands/StopTriggerCommand.ts b/clients/client-glue/src/commands/StopTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/StopTriggerCommand.ts rename to clients/client-glue/src/commands/StopTriggerCommand.ts diff --git a/clients/client-glue/commands/StopWorkflowRunCommand.ts b/clients/client-glue/src/commands/StopWorkflowRunCommand.ts similarity index 100% rename from clients/client-glue/commands/StopWorkflowRunCommand.ts rename to clients/client-glue/src/commands/StopWorkflowRunCommand.ts diff --git a/clients/client-glue/commands/TagResourceCommand.ts b/clients/client-glue/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-glue/commands/TagResourceCommand.ts rename to clients/client-glue/src/commands/TagResourceCommand.ts diff --git a/clients/client-glue/commands/UntagResourceCommand.ts b/clients/client-glue/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-glue/commands/UntagResourceCommand.ts rename to clients/client-glue/src/commands/UntagResourceCommand.ts diff --git a/clients/client-glue/commands/UpdateBlueprintCommand.ts b/clients/client-glue/src/commands/UpdateBlueprintCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateBlueprintCommand.ts rename to clients/client-glue/src/commands/UpdateBlueprintCommand.ts diff --git a/clients/client-glue/commands/UpdateClassifierCommand.ts b/clients/client-glue/src/commands/UpdateClassifierCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateClassifierCommand.ts rename to clients/client-glue/src/commands/UpdateClassifierCommand.ts diff --git a/clients/client-glue/commands/UpdateColumnStatisticsForPartitionCommand.ts b/clients/client-glue/src/commands/UpdateColumnStatisticsForPartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateColumnStatisticsForPartitionCommand.ts rename to clients/client-glue/src/commands/UpdateColumnStatisticsForPartitionCommand.ts diff --git a/clients/client-glue/commands/UpdateColumnStatisticsForTableCommand.ts b/clients/client-glue/src/commands/UpdateColumnStatisticsForTableCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateColumnStatisticsForTableCommand.ts rename to clients/client-glue/src/commands/UpdateColumnStatisticsForTableCommand.ts diff --git a/clients/client-glue/commands/UpdateConnectionCommand.ts b/clients/client-glue/src/commands/UpdateConnectionCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateConnectionCommand.ts rename to clients/client-glue/src/commands/UpdateConnectionCommand.ts diff --git a/clients/client-glue/commands/UpdateCrawlerCommand.ts b/clients/client-glue/src/commands/UpdateCrawlerCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateCrawlerCommand.ts rename to clients/client-glue/src/commands/UpdateCrawlerCommand.ts diff --git a/clients/client-glue/commands/UpdateCrawlerScheduleCommand.ts b/clients/client-glue/src/commands/UpdateCrawlerScheduleCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateCrawlerScheduleCommand.ts rename to clients/client-glue/src/commands/UpdateCrawlerScheduleCommand.ts diff --git a/clients/client-glue/commands/UpdateDatabaseCommand.ts b/clients/client-glue/src/commands/UpdateDatabaseCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateDatabaseCommand.ts rename to clients/client-glue/src/commands/UpdateDatabaseCommand.ts diff --git a/clients/client-glue/commands/UpdateDevEndpointCommand.ts b/clients/client-glue/src/commands/UpdateDevEndpointCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateDevEndpointCommand.ts rename to clients/client-glue/src/commands/UpdateDevEndpointCommand.ts diff --git a/clients/client-glue/commands/UpdateJobCommand.ts b/clients/client-glue/src/commands/UpdateJobCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateJobCommand.ts rename to clients/client-glue/src/commands/UpdateJobCommand.ts diff --git a/clients/client-glue/commands/UpdateMLTransformCommand.ts b/clients/client-glue/src/commands/UpdateMLTransformCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateMLTransformCommand.ts rename to clients/client-glue/src/commands/UpdateMLTransformCommand.ts diff --git a/clients/client-glue/commands/UpdatePartitionCommand.ts b/clients/client-glue/src/commands/UpdatePartitionCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdatePartitionCommand.ts rename to clients/client-glue/src/commands/UpdatePartitionCommand.ts diff --git a/clients/client-glue/commands/UpdateRegistryCommand.ts b/clients/client-glue/src/commands/UpdateRegistryCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateRegistryCommand.ts rename to clients/client-glue/src/commands/UpdateRegistryCommand.ts diff --git a/clients/client-glue/commands/UpdateSchemaCommand.ts b/clients/client-glue/src/commands/UpdateSchemaCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateSchemaCommand.ts rename to clients/client-glue/src/commands/UpdateSchemaCommand.ts diff --git a/clients/client-glue/commands/UpdateTableCommand.ts b/clients/client-glue/src/commands/UpdateTableCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateTableCommand.ts rename to clients/client-glue/src/commands/UpdateTableCommand.ts diff --git a/clients/client-glue/commands/UpdateTriggerCommand.ts b/clients/client-glue/src/commands/UpdateTriggerCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateTriggerCommand.ts rename to clients/client-glue/src/commands/UpdateTriggerCommand.ts diff --git a/clients/client-glue/commands/UpdateUserDefinedFunctionCommand.ts b/clients/client-glue/src/commands/UpdateUserDefinedFunctionCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateUserDefinedFunctionCommand.ts rename to clients/client-glue/src/commands/UpdateUserDefinedFunctionCommand.ts diff --git a/clients/client-glue/commands/UpdateWorkflowCommand.ts b/clients/client-glue/src/commands/UpdateWorkflowCommand.ts similarity index 100% rename from clients/client-glue/commands/UpdateWorkflowCommand.ts rename to clients/client-glue/src/commands/UpdateWorkflowCommand.ts diff --git a/clients/client-glue/endpoints.ts b/clients/client-glue/src/endpoints.ts similarity index 100% rename from clients/client-glue/endpoints.ts rename to clients/client-glue/src/endpoints.ts diff --git a/clients/client-glue/index.ts b/clients/client-glue/src/index.ts similarity index 100% rename from clients/client-glue/index.ts rename to clients/client-glue/src/index.ts diff --git a/clients/client-glue/models/index.ts b/clients/client-glue/src/models/index.ts similarity index 100% rename from clients/client-glue/models/index.ts rename to clients/client-glue/src/models/index.ts diff --git a/clients/client-glue/models/models_0.ts b/clients/client-glue/src/models/models_0.ts similarity index 100% rename from clients/client-glue/models/models_0.ts rename to clients/client-glue/src/models/models_0.ts diff --git a/clients/client-glue/models/models_1.ts b/clients/client-glue/src/models/models_1.ts similarity index 100% rename from clients/client-glue/models/models_1.ts rename to clients/client-glue/src/models/models_1.ts diff --git a/clients/client-glue/pagination/GetBlueprintRunsPaginator.ts b/clients/client-glue/src/pagination/GetBlueprintRunsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetBlueprintRunsPaginator.ts rename to clients/client-glue/src/pagination/GetBlueprintRunsPaginator.ts diff --git a/clients/client-glue/pagination/GetClassifiersPaginator.ts b/clients/client-glue/src/pagination/GetClassifiersPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetClassifiersPaginator.ts rename to clients/client-glue/src/pagination/GetClassifiersPaginator.ts diff --git a/clients/client-glue/pagination/GetConnectionsPaginator.ts b/clients/client-glue/src/pagination/GetConnectionsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetConnectionsPaginator.ts rename to clients/client-glue/src/pagination/GetConnectionsPaginator.ts diff --git a/clients/client-glue/pagination/GetCrawlerMetricsPaginator.ts b/clients/client-glue/src/pagination/GetCrawlerMetricsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetCrawlerMetricsPaginator.ts rename to clients/client-glue/src/pagination/GetCrawlerMetricsPaginator.ts diff --git a/clients/client-glue/pagination/GetCrawlersPaginator.ts b/clients/client-glue/src/pagination/GetCrawlersPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetCrawlersPaginator.ts rename to clients/client-glue/src/pagination/GetCrawlersPaginator.ts diff --git a/clients/client-glue/pagination/GetDatabasesPaginator.ts b/clients/client-glue/src/pagination/GetDatabasesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetDatabasesPaginator.ts rename to clients/client-glue/src/pagination/GetDatabasesPaginator.ts diff --git a/clients/client-glue/pagination/GetDevEndpointsPaginator.ts b/clients/client-glue/src/pagination/GetDevEndpointsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetDevEndpointsPaginator.ts rename to clients/client-glue/src/pagination/GetDevEndpointsPaginator.ts diff --git a/clients/client-glue/pagination/GetJobRunsPaginator.ts b/clients/client-glue/src/pagination/GetJobRunsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetJobRunsPaginator.ts rename to clients/client-glue/src/pagination/GetJobRunsPaginator.ts diff --git a/clients/client-glue/pagination/GetJobsPaginator.ts b/clients/client-glue/src/pagination/GetJobsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetJobsPaginator.ts rename to clients/client-glue/src/pagination/GetJobsPaginator.ts diff --git a/clients/client-glue/pagination/GetMLTaskRunsPaginator.ts b/clients/client-glue/src/pagination/GetMLTaskRunsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetMLTaskRunsPaginator.ts rename to clients/client-glue/src/pagination/GetMLTaskRunsPaginator.ts diff --git a/clients/client-glue/pagination/GetMLTransformsPaginator.ts b/clients/client-glue/src/pagination/GetMLTransformsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetMLTransformsPaginator.ts rename to clients/client-glue/src/pagination/GetMLTransformsPaginator.ts diff --git a/clients/client-glue/pagination/GetPartitionIndexesPaginator.ts b/clients/client-glue/src/pagination/GetPartitionIndexesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetPartitionIndexesPaginator.ts rename to clients/client-glue/src/pagination/GetPartitionIndexesPaginator.ts diff --git a/clients/client-glue/pagination/GetPartitionsPaginator.ts b/clients/client-glue/src/pagination/GetPartitionsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetPartitionsPaginator.ts rename to clients/client-glue/src/pagination/GetPartitionsPaginator.ts diff --git a/clients/client-glue/pagination/GetResourcePoliciesPaginator.ts b/clients/client-glue/src/pagination/GetResourcePoliciesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetResourcePoliciesPaginator.ts rename to clients/client-glue/src/pagination/GetResourcePoliciesPaginator.ts diff --git a/clients/client-glue/pagination/GetSecurityConfigurationsPaginator.ts b/clients/client-glue/src/pagination/GetSecurityConfigurationsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetSecurityConfigurationsPaginator.ts rename to clients/client-glue/src/pagination/GetSecurityConfigurationsPaginator.ts diff --git a/clients/client-glue/pagination/GetTableVersionsPaginator.ts b/clients/client-glue/src/pagination/GetTableVersionsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetTableVersionsPaginator.ts rename to clients/client-glue/src/pagination/GetTableVersionsPaginator.ts diff --git a/clients/client-glue/pagination/GetTablesPaginator.ts b/clients/client-glue/src/pagination/GetTablesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetTablesPaginator.ts rename to clients/client-glue/src/pagination/GetTablesPaginator.ts diff --git a/clients/client-glue/pagination/GetTriggersPaginator.ts b/clients/client-glue/src/pagination/GetTriggersPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetTriggersPaginator.ts rename to clients/client-glue/src/pagination/GetTriggersPaginator.ts diff --git a/clients/client-glue/pagination/GetUserDefinedFunctionsPaginator.ts b/clients/client-glue/src/pagination/GetUserDefinedFunctionsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetUserDefinedFunctionsPaginator.ts rename to clients/client-glue/src/pagination/GetUserDefinedFunctionsPaginator.ts diff --git a/clients/client-glue/pagination/GetWorkflowRunsPaginator.ts b/clients/client-glue/src/pagination/GetWorkflowRunsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/GetWorkflowRunsPaginator.ts rename to clients/client-glue/src/pagination/GetWorkflowRunsPaginator.ts diff --git a/clients/client-glue/pagination/Interfaces.ts b/clients/client-glue/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-glue/pagination/Interfaces.ts rename to clients/client-glue/src/pagination/Interfaces.ts diff --git a/clients/client-glue/pagination/ListBlueprintsPaginator.ts b/clients/client-glue/src/pagination/ListBlueprintsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListBlueprintsPaginator.ts rename to clients/client-glue/src/pagination/ListBlueprintsPaginator.ts diff --git a/clients/client-glue/pagination/ListCrawlersPaginator.ts b/clients/client-glue/src/pagination/ListCrawlersPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListCrawlersPaginator.ts rename to clients/client-glue/src/pagination/ListCrawlersPaginator.ts diff --git a/clients/client-glue/pagination/ListDevEndpointsPaginator.ts b/clients/client-glue/src/pagination/ListDevEndpointsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListDevEndpointsPaginator.ts rename to clients/client-glue/src/pagination/ListDevEndpointsPaginator.ts diff --git a/clients/client-glue/pagination/ListJobsPaginator.ts b/clients/client-glue/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListJobsPaginator.ts rename to clients/client-glue/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-glue/pagination/ListMLTransformsPaginator.ts b/clients/client-glue/src/pagination/ListMLTransformsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListMLTransformsPaginator.ts rename to clients/client-glue/src/pagination/ListMLTransformsPaginator.ts diff --git a/clients/client-glue/pagination/ListRegistriesPaginator.ts b/clients/client-glue/src/pagination/ListRegistriesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListRegistriesPaginator.ts rename to clients/client-glue/src/pagination/ListRegistriesPaginator.ts diff --git a/clients/client-glue/pagination/ListSchemaVersionsPaginator.ts b/clients/client-glue/src/pagination/ListSchemaVersionsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListSchemaVersionsPaginator.ts rename to clients/client-glue/src/pagination/ListSchemaVersionsPaginator.ts diff --git a/clients/client-glue/pagination/ListSchemasPaginator.ts b/clients/client-glue/src/pagination/ListSchemasPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListSchemasPaginator.ts rename to clients/client-glue/src/pagination/ListSchemasPaginator.ts diff --git a/clients/client-glue/pagination/ListTriggersPaginator.ts b/clients/client-glue/src/pagination/ListTriggersPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListTriggersPaginator.ts rename to clients/client-glue/src/pagination/ListTriggersPaginator.ts diff --git a/clients/client-glue/pagination/ListWorkflowsPaginator.ts b/clients/client-glue/src/pagination/ListWorkflowsPaginator.ts similarity index 100% rename from clients/client-glue/pagination/ListWorkflowsPaginator.ts rename to clients/client-glue/src/pagination/ListWorkflowsPaginator.ts diff --git a/clients/client-glue/pagination/SearchTablesPaginator.ts b/clients/client-glue/src/pagination/SearchTablesPaginator.ts similarity index 100% rename from clients/client-glue/pagination/SearchTablesPaginator.ts rename to clients/client-glue/src/pagination/SearchTablesPaginator.ts diff --git a/clients/client-glue/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-glue/protocols/Aws_json1_1.ts rename to clients/client-glue/src/protocols/Aws_json1_1.ts diff --git a/clients/client-glue/src/runtimeConfig.browser.ts b/clients/client-glue/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c326847068ac --- /dev/null +++ b/clients/client-glue/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GlueClientConfig } from "./GlueClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlueClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-glue/runtimeConfig.native.ts b/clients/client-glue/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-glue/runtimeConfig.native.ts rename to clients/client-glue/src/runtimeConfig.native.ts diff --git a/clients/client-glue/runtimeConfig.shared.ts b/clients/client-glue/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-glue/runtimeConfig.shared.ts rename to clients/client-glue/src/runtimeConfig.shared.ts diff --git a/clients/client-glue/src/runtimeConfig.ts b/clients/client-glue/src/runtimeConfig.ts new file mode 100644 index 000000000000..94901f6eeb49 --- /dev/null +++ b/clients/client-glue/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GlueClientConfig } from "./GlueClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GlueClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-glue/tsconfig.es.json b/clients/client-glue/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-glue/tsconfig.es.json +++ b/clients/client-glue/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-glue/tsconfig.json b/clients/client-glue/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-glue/tsconfig.json +++ b/clients/client-glue/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-glue/tsconfig.types.json b/clients/client-glue/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-glue/tsconfig.types.json +++ b/clients/client-glue/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-greengrass/.gitignore b/clients/client-greengrass/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-greengrass/.gitignore +++ b/clients/client-greengrass/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-greengrass/package.json b/clients/client-greengrass/package.json index c56335cbcd8d..43cd71289baf 100644 --- a/clients/client-greengrass/package.json +++ b/clients/client-greengrass/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-greengrass", "repository": { "type": "git", diff --git a/clients/client-greengrass/runtimeConfig.browser.ts b/clients/client-greengrass/runtimeConfig.browser.ts deleted file mode 100644 index 8d233e9991d1..000000000000 --- a/clients/client-greengrass/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GreengrassClientConfig } from "./GreengrassClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GreengrassClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-greengrass/runtimeConfig.ts b/clients/client-greengrass/runtimeConfig.ts deleted file mode 100644 index 03b75e4957a5..000000000000 --- a/clients/client-greengrass/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GreengrassClientConfig } from "./GreengrassClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GreengrassClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-greengrass/Greengrass.ts b/clients/client-greengrass/src/Greengrass.ts similarity index 100% rename from clients/client-greengrass/Greengrass.ts rename to clients/client-greengrass/src/Greengrass.ts diff --git a/clients/client-greengrass/GreengrassClient.ts b/clients/client-greengrass/src/GreengrassClient.ts similarity index 100% rename from clients/client-greengrass/GreengrassClient.ts rename to clients/client-greengrass/src/GreengrassClient.ts diff --git a/clients/client-greengrass/commands/AssociateRoleToGroupCommand.ts b/clients/client-greengrass/src/commands/AssociateRoleToGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/AssociateRoleToGroupCommand.ts rename to clients/client-greengrass/src/commands/AssociateRoleToGroupCommand.ts diff --git a/clients/client-greengrass/commands/AssociateServiceRoleToAccountCommand.ts b/clients/client-greengrass/src/commands/AssociateServiceRoleToAccountCommand.ts similarity index 100% rename from clients/client-greengrass/commands/AssociateServiceRoleToAccountCommand.ts rename to clients/client-greengrass/src/commands/AssociateServiceRoleToAccountCommand.ts diff --git a/clients/client-greengrass/commands/CreateConnectorDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateConnectorDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateConnectorDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateConnectorDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateConnectorDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateConnectorDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateConnectorDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateConnectorDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateCoreDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateCoreDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateCoreDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateCoreDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateCoreDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateCoreDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateCoreDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateCoreDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateDeploymentCommand.ts b/clients/client-greengrass/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateDeploymentCommand.ts rename to clients/client-greengrass/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-greengrass/commands/CreateDeviceDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateDeviceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateDeviceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateDeviceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateDeviceDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateDeviceDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateDeviceDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateDeviceDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateFunctionDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateFunctionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateFunctionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateFunctionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateFunctionDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateFunctionDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateFunctionDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateFunctionDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateGroupCertificateAuthorityCommand.ts b/clients/client-greengrass/src/commands/CreateGroupCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateGroupCertificateAuthorityCommand.ts rename to clients/client-greengrass/src/commands/CreateGroupCertificateAuthorityCommand.ts diff --git a/clients/client-greengrass/commands/CreateGroupCommand.ts b/clients/client-greengrass/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateGroupCommand.ts rename to clients/client-greengrass/src/commands/CreateGroupCommand.ts diff --git a/clients/client-greengrass/commands/CreateGroupVersionCommand.ts b/clients/client-greengrass/src/commands/CreateGroupVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateGroupVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateGroupVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateLoggerDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateLoggerDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateLoggerDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateLoggerDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateLoggerDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateLoggerDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateLoggerDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateLoggerDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateResourceDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateResourceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateResourceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateResourceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateResourceDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateResourceDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateResourceDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateResourceDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/CreateSoftwareUpdateJobCommand.ts b/clients/client-greengrass/src/commands/CreateSoftwareUpdateJobCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateSoftwareUpdateJobCommand.ts rename to clients/client-greengrass/src/commands/CreateSoftwareUpdateJobCommand.ts diff --git a/clients/client-greengrass/commands/CreateSubscriptionDefinitionCommand.ts b/clients/client-greengrass/src/commands/CreateSubscriptionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateSubscriptionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/CreateSubscriptionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/CreateSubscriptionDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/CreateSubscriptionDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/CreateSubscriptionDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/CreateSubscriptionDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteConnectorDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteConnectorDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteConnectorDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteConnectorDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteCoreDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteCoreDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteCoreDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteCoreDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteDeviceDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteDeviceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteDeviceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteDeviceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteFunctionDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteFunctionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteFunctionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteFunctionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteGroupCommand.ts b/clients/client-greengrass/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteGroupCommand.ts rename to clients/client-greengrass/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-greengrass/commands/DeleteLoggerDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteLoggerDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteLoggerDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteLoggerDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteResourceDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteResourceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteResourceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteResourceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DeleteSubscriptionDefinitionCommand.ts b/clients/client-greengrass/src/commands/DeleteSubscriptionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DeleteSubscriptionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/DeleteSubscriptionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/DisassociateRoleFromGroupCommand.ts b/clients/client-greengrass/src/commands/DisassociateRoleFromGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DisassociateRoleFromGroupCommand.ts rename to clients/client-greengrass/src/commands/DisassociateRoleFromGroupCommand.ts diff --git a/clients/client-greengrass/commands/DisassociateServiceRoleFromAccountCommand.ts b/clients/client-greengrass/src/commands/DisassociateServiceRoleFromAccountCommand.ts similarity index 100% rename from clients/client-greengrass/commands/DisassociateServiceRoleFromAccountCommand.ts rename to clients/client-greengrass/src/commands/DisassociateServiceRoleFromAccountCommand.ts diff --git a/clients/client-greengrass/commands/GetAssociatedRoleCommand.ts b/clients/client-greengrass/src/commands/GetAssociatedRoleCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetAssociatedRoleCommand.ts rename to clients/client-greengrass/src/commands/GetAssociatedRoleCommand.ts diff --git a/clients/client-greengrass/commands/GetBulkDeploymentStatusCommand.ts b/clients/client-greengrass/src/commands/GetBulkDeploymentStatusCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetBulkDeploymentStatusCommand.ts rename to clients/client-greengrass/src/commands/GetBulkDeploymentStatusCommand.ts diff --git a/clients/client-greengrass/commands/GetConnectivityInfoCommand.ts b/clients/client-greengrass/src/commands/GetConnectivityInfoCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetConnectivityInfoCommand.ts rename to clients/client-greengrass/src/commands/GetConnectivityInfoCommand.ts diff --git a/clients/client-greengrass/commands/GetConnectorDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetConnectorDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetConnectorDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetConnectorDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetConnectorDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetConnectorDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetConnectorDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetConnectorDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetCoreDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetCoreDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetCoreDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetCoreDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetCoreDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetCoreDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetCoreDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetCoreDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetDeploymentStatusCommand.ts b/clients/client-greengrass/src/commands/GetDeploymentStatusCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetDeploymentStatusCommand.ts rename to clients/client-greengrass/src/commands/GetDeploymentStatusCommand.ts diff --git a/clients/client-greengrass/commands/GetDeviceDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetDeviceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetDeviceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetDeviceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetDeviceDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetDeviceDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetDeviceDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetDeviceDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetFunctionDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetFunctionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetFunctionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetFunctionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetFunctionDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetFunctionDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetFunctionDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetFunctionDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetGroupCertificateAuthorityCommand.ts b/clients/client-greengrass/src/commands/GetGroupCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetGroupCertificateAuthorityCommand.ts rename to clients/client-greengrass/src/commands/GetGroupCertificateAuthorityCommand.ts diff --git a/clients/client-greengrass/commands/GetGroupCertificateConfigurationCommand.ts b/clients/client-greengrass/src/commands/GetGroupCertificateConfigurationCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetGroupCertificateConfigurationCommand.ts rename to clients/client-greengrass/src/commands/GetGroupCertificateConfigurationCommand.ts diff --git a/clients/client-greengrass/commands/GetGroupCommand.ts b/clients/client-greengrass/src/commands/GetGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetGroupCommand.ts rename to clients/client-greengrass/src/commands/GetGroupCommand.ts diff --git a/clients/client-greengrass/commands/GetGroupVersionCommand.ts b/clients/client-greengrass/src/commands/GetGroupVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetGroupVersionCommand.ts rename to clients/client-greengrass/src/commands/GetGroupVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetLoggerDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetLoggerDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetLoggerDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetLoggerDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetLoggerDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetLoggerDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetLoggerDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetLoggerDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetResourceDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetResourceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetResourceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetResourceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetResourceDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetResourceDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetResourceDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetResourceDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetServiceRoleForAccountCommand.ts b/clients/client-greengrass/src/commands/GetServiceRoleForAccountCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetServiceRoleForAccountCommand.ts rename to clients/client-greengrass/src/commands/GetServiceRoleForAccountCommand.ts diff --git a/clients/client-greengrass/commands/GetSubscriptionDefinitionCommand.ts b/clients/client-greengrass/src/commands/GetSubscriptionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetSubscriptionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/GetSubscriptionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/GetSubscriptionDefinitionVersionCommand.ts b/clients/client-greengrass/src/commands/GetSubscriptionDefinitionVersionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetSubscriptionDefinitionVersionCommand.ts rename to clients/client-greengrass/src/commands/GetSubscriptionDefinitionVersionCommand.ts diff --git a/clients/client-greengrass/commands/GetThingRuntimeConfigurationCommand.ts b/clients/client-greengrass/src/commands/GetThingRuntimeConfigurationCommand.ts similarity index 100% rename from clients/client-greengrass/commands/GetThingRuntimeConfigurationCommand.ts rename to clients/client-greengrass/src/commands/GetThingRuntimeConfigurationCommand.ts diff --git a/clients/client-greengrass/commands/ListBulkDeploymentDetailedReportsCommand.ts b/clients/client-greengrass/src/commands/ListBulkDeploymentDetailedReportsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListBulkDeploymentDetailedReportsCommand.ts rename to clients/client-greengrass/src/commands/ListBulkDeploymentDetailedReportsCommand.ts diff --git a/clients/client-greengrass/commands/ListBulkDeploymentsCommand.ts b/clients/client-greengrass/src/commands/ListBulkDeploymentsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListBulkDeploymentsCommand.ts rename to clients/client-greengrass/src/commands/ListBulkDeploymentsCommand.ts diff --git a/clients/client-greengrass/commands/ListConnectorDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListConnectorDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListConnectorDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListConnectorDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListConnectorDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListConnectorDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListConnectorDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListConnectorDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListCoreDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListCoreDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListCoreDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListCoreDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListCoreDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListCoreDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListCoreDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListCoreDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListDeploymentsCommand.ts b/clients/client-greengrass/src/commands/ListDeploymentsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListDeploymentsCommand.ts rename to clients/client-greengrass/src/commands/ListDeploymentsCommand.ts diff --git a/clients/client-greengrass/commands/ListDeviceDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListDeviceDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListDeviceDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListDeviceDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListDeviceDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListDeviceDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListDeviceDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListDeviceDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListFunctionDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListFunctionDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListFunctionDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListFunctionDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListFunctionDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListFunctionDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListFunctionDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListFunctionDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListGroupCertificateAuthoritiesCommand.ts b/clients/client-greengrass/src/commands/ListGroupCertificateAuthoritiesCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListGroupCertificateAuthoritiesCommand.ts rename to clients/client-greengrass/src/commands/ListGroupCertificateAuthoritiesCommand.ts diff --git a/clients/client-greengrass/commands/ListGroupVersionsCommand.ts b/clients/client-greengrass/src/commands/ListGroupVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListGroupVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListGroupVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListGroupsCommand.ts b/clients/client-greengrass/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListGroupsCommand.ts rename to clients/client-greengrass/src/commands/ListGroupsCommand.ts diff --git a/clients/client-greengrass/commands/ListLoggerDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListLoggerDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListLoggerDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListLoggerDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListLoggerDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListLoggerDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListLoggerDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListLoggerDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListResourceDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListResourceDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListResourceDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListResourceDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListResourceDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListResourceDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListResourceDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListResourceDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListSubscriptionDefinitionVersionsCommand.ts b/clients/client-greengrass/src/commands/ListSubscriptionDefinitionVersionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListSubscriptionDefinitionVersionsCommand.ts rename to clients/client-greengrass/src/commands/ListSubscriptionDefinitionVersionsCommand.ts diff --git a/clients/client-greengrass/commands/ListSubscriptionDefinitionsCommand.ts b/clients/client-greengrass/src/commands/ListSubscriptionDefinitionsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListSubscriptionDefinitionsCommand.ts rename to clients/client-greengrass/src/commands/ListSubscriptionDefinitionsCommand.ts diff --git a/clients/client-greengrass/commands/ListTagsForResourceCommand.ts b/clients/client-greengrass/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ListTagsForResourceCommand.ts rename to clients/client-greengrass/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-greengrass/commands/ResetDeploymentsCommand.ts b/clients/client-greengrass/src/commands/ResetDeploymentsCommand.ts similarity index 100% rename from clients/client-greengrass/commands/ResetDeploymentsCommand.ts rename to clients/client-greengrass/src/commands/ResetDeploymentsCommand.ts diff --git a/clients/client-greengrass/commands/StartBulkDeploymentCommand.ts b/clients/client-greengrass/src/commands/StartBulkDeploymentCommand.ts similarity index 100% rename from clients/client-greengrass/commands/StartBulkDeploymentCommand.ts rename to clients/client-greengrass/src/commands/StartBulkDeploymentCommand.ts diff --git a/clients/client-greengrass/commands/StopBulkDeploymentCommand.ts b/clients/client-greengrass/src/commands/StopBulkDeploymentCommand.ts similarity index 100% rename from clients/client-greengrass/commands/StopBulkDeploymentCommand.ts rename to clients/client-greengrass/src/commands/StopBulkDeploymentCommand.ts diff --git a/clients/client-greengrass/commands/TagResourceCommand.ts b/clients/client-greengrass/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-greengrass/commands/TagResourceCommand.ts rename to clients/client-greengrass/src/commands/TagResourceCommand.ts diff --git a/clients/client-greengrass/commands/UntagResourceCommand.ts b/clients/client-greengrass/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UntagResourceCommand.ts rename to clients/client-greengrass/src/commands/UntagResourceCommand.ts diff --git a/clients/client-greengrass/commands/UpdateConnectivityInfoCommand.ts b/clients/client-greengrass/src/commands/UpdateConnectivityInfoCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateConnectivityInfoCommand.ts rename to clients/client-greengrass/src/commands/UpdateConnectivityInfoCommand.ts diff --git a/clients/client-greengrass/commands/UpdateConnectorDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateConnectorDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateConnectorDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateConnectorDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateCoreDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateCoreDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateCoreDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateCoreDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateDeviceDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateDeviceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateDeviceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateDeviceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateFunctionDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateFunctionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateFunctionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateFunctionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateGroupCertificateConfigurationCommand.ts b/clients/client-greengrass/src/commands/UpdateGroupCertificateConfigurationCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateGroupCertificateConfigurationCommand.ts rename to clients/client-greengrass/src/commands/UpdateGroupCertificateConfigurationCommand.ts diff --git a/clients/client-greengrass/commands/UpdateGroupCommand.ts b/clients/client-greengrass/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateGroupCommand.ts rename to clients/client-greengrass/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-greengrass/commands/UpdateLoggerDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateLoggerDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateLoggerDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateLoggerDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateResourceDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateResourceDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateResourceDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateResourceDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateSubscriptionDefinitionCommand.ts b/clients/client-greengrass/src/commands/UpdateSubscriptionDefinitionCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateSubscriptionDefinitionCommand.ts rename to clients/client-greengrass/src/commands/UpdateSubscriptionDefinitionCommand.ts diff --git a/clients/client-greengrass/commands/UpdateThingRuntimeConfigurationCommand.ts b/clients/client-greengrass/src/commands/UpdateThingRuntimeConfigurationCommand.ts similarity index 100% rename from clients/client-greengrass/commands/UpdateThingRuntimeConfigurationCommand.ts rename to clients/client-greengrass/src/commands/UpdateThingRuntimeConfigurationCommand.ts diff --git a/clients/client-greengrass/endpoints.ts b/clients/client-greengrass/src/endpoints.ts similarity index 100% rename from clients/client-greengrass/endpoints.ts rename to clients/client-greengrass/src/endpoints.ts diff --git a/clients/client-greengrass/index.ts b/clients/client-greengrass/src/index.ts similarity index 100% rename from clients/client-greengrass/index.ts rename to clients/client-greengrass/src/index.ts diff --git a/clients/client-greengrass/models/index.ts b/clients/client-greengrass/src/models/index.ts similarity index 100% rename from clients/client-greengrass/models/index.ts rename to clients/client-greengrass/src/models/index.ts diff --git a/clients/client-greengrass/models/models_0.ts b/clients/client-greengrass/src/models/models_0.ts similarity index 100% rename from clients/client-greengrass/models/models_0.ts rename to clients/client-greengrass/src/models/models_0.ts diff --git a/clients/client-greengrass/protocols/Aws_restJson1.ts b/clients/client-greengrass/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-greengrass/protocols/Aws_restJson1.ts rename to clients/client-greengrass/src/protocols/Aws_restJson1.ts diff --git a/clients/client-greengrass/src/runtimeConfig.browser.ts b/clients/client-greengrass/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0aabeab586d7 --- /dev/null +++ b/clients/client-greengrass/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GreengrassClientConfig } from "./GreengrassClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GreengrassClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-greengrass/runtimeConfig.native.ts b/clients/client-greengrass/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-greengrass/runtimeConfig.native.ts rename to clients/client-greengrass/src/runtimeConfig.native.ts diff --git a/clients/client-greengrass/runtimeConfig.shared.ts b/clients/client-greengrass/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-greengrass/runtimeConfig.shared.ts rename to clients/client-greengrass/src/runtimeConfig.shared.ts diff --git a/clients/client-greengrass/src/runtimeConfig.ts b/clients/client-greengrass/src/runtimeConfig.ts new file mode 100644 index 000000000000..92d6230bfa2b --- /dev/null +++ b/clients/client-greengrass/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GreengrassClientConfig } from "./GreengrassClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GreengrassClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-greengrass/tsconfig.es.json b/clients/client-greengrass/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-greengrass/tsconfig.es.json +++ b/clients/client-greengrass/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-greengrass/tsconfig.json b/clients/client-greengrass/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-greengrass/tsconfig.json +++ b/clients/client-greengrass/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-greengrass/tsconfig.types.json b/clients/client-greengrass/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-greengrass/tsconfig.types.json +++ b/clients/client-greengrass/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-greengrassv2/.gitignore b/clients/client-greengrassv2/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-greengrassv2/.gitignore +++ b/clients/client-greengrassv2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-greengrassv2/package.json b/clients/client-greengrassv2/package.json index 0db85c5b10ae..a493538476de 100644 --- a/clients/client-greengrassv2/package.json +++ b/clients/client-greengrassv2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-greengrassv2", "repository": { "type": "git", diff --git a/clients/client-greengrassv2/runtimeConfig.browser.ts b/clients/client-greengrassv2/runtimeConfig.browser.ts deleted file mode 100644 index d4369c1a5ed0..000000000000 --- a/clients/client-greengrassv2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GreengrassV2ClientConfig } from "./GreengrassV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-greengrassv2/runtimeConfig.ts b/clients/client-greengrassv2/runtimeConfig.ts deleted file mode 100644 index 655a68c62deb..000000000000 --- a/clients/client-greengrassv2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GreengrassV2ClientConfig } from "./GreengrassV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-greengrassv2/GreengrassV2.ts b/clients/client-greengrassv2/src/GreengrassV2.ts similarity index 100% rename from clients/client-greengrassv2/GreengrassV2.ts rename to clients/client-greengrassv2/src/GreengrassV2.ts diff --git a/clients/client-greengrassv2/GreengrassV2Client.ts b/clients/client-greengrassv2/src/GreengrassV2Client.ts similarity index 100% rename from clients/client-greengrassv2/GreengrassV2Client.ts rename to clients/client-greengrassv2/src/GreengrassV2Client.ts diff --git a/clients/client-greengrassv2/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.ts b/clients/client-greengrassv2/src/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.ts rename to clients/client-greengrassv2/src/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.ts diff --git a/clients/client-greengrassv2/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.ts b/clients/client-greengrassv2/src/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.ts rename to clients/client-greengrassv2/src/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.ts diff --git a/clients/client-greengrassv2/commands/CancelDeploymentCommand.ts b/clients/client-greengrassv2/src/commands/CancelDeploymentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/CancelDeploymentCommand.ts rename to clients/client-greengrassv2/src/commands/CancelDeploymentCommand.ts diff --git a/clients/client-greengrassv2/commands/CreateComponentVersionCommand.ts b/clients/client-greengrassv2/src/commands/CreateComponentVersionCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/CreateComponentVersionCommand.ts rename to clients/client-greengrassv2/src/commands/CreateComponentVersionCommand.ts diff --git a/clients/client-greengrassv2/commands/CreateDeploymentCommand.ts b/clients/client-greengrassv2/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/CreateDeploymentCommand.ts rename to clients/client-greengrassv2/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-greengrassv2/commands/DeleteComponentCommand.ts b/clients/client-greengrassv2/src/commands/DeleteComponentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/DeleteComponentCommand.ts rename to clients/client-greengrassv2/src/commands/DeleteComponentCommand.ts diff --git a/clients/client-greengrassv2/commands/DeleteCoreDeviceCommand.ts b/clients/client-greengrassv2/src/commands/DeleteCoreDeviceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/DeleteCoreDeviceCommand.ts rename to clients/client-greengrassv2/src/commands/DeleteCoreDeviceCommand.ts diff --git a/clients/client-greengrassv2/commands/DescribeComponentCommand.ts b/clients/client-greengrassv2/src/commands/DescribeComponentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/DescribeComponentCommand.ts rename to clients/client-greengrassv2/src/commands/DescribeComponentCommand.ts diff --git a/clients/client-greengrassv2/commands/GetComponentCommand.ts b/clients/client-greengrassv2/src/commands/GetComponentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/GetComponentCommand.ts rename to clients/client-greengrassv2/src/commands/GetComponentCommand.ts diff --git a/clients/client-greengrassv2/commands/GetComponentVersionArtifactCommand.ts b/clients/client-greengrassv2/src/commands/GetComponentVersionArtifactCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/GetComponentVersionArtifactCommand.ts rename to clients/client-greengrassv2/src/commands/GetComponentVersionArtifactCommand.ts diff --git a/clients/client-greengrassv2/commands/GetCoreDeviceCommand.ts b/clients/client-greengrassv2/src/commands/GetCoreDeviceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/GetCoreDeviceCommand.ts rename to clients/client-greengrassv2/src/commands/GetCoreDeviceCommand.ts diff --git a/clients/client-greengrassv2/commands/GetDeploymentCommand.ts b/clients/client-greengrassv2/src/commands/GetDeploymentCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/GetDeploymentCommand.ts rename to clients/client-greengrassv2/src/commands/GetDeploymentCommand.ts diff --git a/clients/client-greengrassv2/commands/ListClientDevicesAssociatedWithCoreDeviceCommand.ts b/clients/client-greengrassv2/src/commands/ListClientDevicesAssociatedWithCoreDeviceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListClientDevicesAssociatedWithCoreDeviceCommand.ts rename to clients/client-greengrassv2/src/commands/ListClientDevicesAssociatedWithCoreDeviceCommand.ts diff --git a/clients/client-greengrassv2/commands/ListComponentVersionsCommand.ts b/clients/client-greengrassv2/src/commands/ListComponentVersionsCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListComponentVersionsCommand.ts rename to clients/client-greengrassv2/src/commands/ListComponentVersionsCommand.ts diff --git a/clients/client-greengrassv2/commands/ListComponentsCommand.ts b/clients/client-greengrassv2/src/commands/ListComponentsCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListComponentsCommand.ts rename to clients/client-greengrassv2/src/commands/ListComponentsCommand.ts diff --git a/clients/client-greengrassv2/commands/ListCoreDevicesCommand.ts b/clients/client-greengrassv2/src/commands/ListCoreDevicesCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListCoreDevicesCommand.ts rename to clients/client-greengrassv2/src/commands/ListCoreDevicesCommand.ts diff --git a/clients/client-greengrassv2/commands/ListDeploymentsCommand.ts b/clients/client-greengrassv2/src/commands/ListDeploymentsCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListDeploymentsCommand.ts rename to clients/client-greengrassv2/src/commands/ListDeploymentsCommand.ts diff --git a/clients/client-greengrassv2/commands/ListEffectiveDeploymentsCommand.ts b/clients/client-greengrassv2/src/commands/ListEffectiveDeploymentsCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListEffectiveDeploymentsCommand.ts rename to clients/client-greengrassv2/src/commands/ListEffectiveDeploymentsCommand.ts diff --git a/clients/client-greengrassv2/commands/ListInstalledComponentsCommand.ts b/clients/client-greengrassv2/src/commands/ListInstalledComponentsCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListInstalledComponentsCommand.ts rename to clients/client-greengrassv2/src/commands/ListInstalledComponentsCommand.ts diff --git a/clients/client-greengrassv2/commands/ListTagsForResourceCommand.ts b/clients/client-greengrassv2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ListTagsForResourceCommand.ts rename to clients/client-greengrassv2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-greengrassv2/commands/ResolveComponentCandidatesCommand.ts b/clients/client-greengrassv2/src/commands/ResolveComponentCandidatesCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/ResolveComponentCandidatesCommand.ts rename to clients/client-greengrassv2/src/commands/ResolveComponentCandidatesCommand.ts diff --git a/clients/client-greengrassv2/commands/TagResourceCommand.ts b/clients/client-greengrassv2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/TagResourceCommand.ts rename to clients/client-greengrassv2/src/commands/TagResourceCommand.ts diff --git a/clients/client-greengrassv2/commands/UntagResourceCommand.ts b/clients/client-greengrassv2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-greengrassv2/commands/UntagResourceCommand.ts rename to clients/client-greengrassv2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-greengrassv2/endpoints.ts b/clients/client-greengrassv2/src/endpoints.ts similarity index 100% rename from clients/client-greengrassv2/endpoints.ts rename to clients/client-greengrassv2/src/endpoints.ts diff --git a/clients/client-greengrassv2/index.ts b/clients/client-greengrassv2/src/index.ts similarity index 100% rename from clients/client-greengrassv2/index.ts rename to clients/client-greengrassv2/src/index.ts diff --git a/clients/client-greengrassv2/models/index.ts b/clients/client-greengrassv2/src/models/index.ts similarity index 100% rename from clients/client-greengrassv2/models/index.ts rename to clients/client-greengrassv2/src/models/index.ts diff --git a/clients/client-greengrassv2/models/models_0.ts b/clients/client-greengrassv2/src/models/models_0.ts similarity index 100% rename from clients/client-greengrassv2/models/models_0.ts rename to clients/client-greengrassv2/src/models/models_0.ts diff --git a/clients/client-greengrassv2/pagination/Interfaces.ts b/clients/client-greengrassv2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-greengrassv2/pagination/Interfaces.ts rename to clients/client-greengrassv2/src/pagination/Interfaces.ts diff --git a/clients/client-greengrassv2/pagination/ListClientDevicesAssociatedWithCoreDevicePaginator.ts b/clients/client-greengrassv2/src/pagination/ListClientDevicesAssociatedWithCoreDevicePaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListClientDevicesAssociatedWithCoreDevicePaginator.ts rename to clients/client-greengrassv2/src/pagination/ListClientDevicesAssociatedWithCoreDevicePaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListComponentVersionsPaginator.ts b/clients/client-greengrassv2/src/pagination/ListComponentVersionsPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListComponentVersionsPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListComponentVersionsPaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListComponentsPaginator.ts b/clients/client-greengrassv2/src/pagination/ListComponentsPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListComponentsPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListComponentsPaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListCoreDevicesPaginator.ts b/clients/client-greengrassv2/src/pagination/ListCoreDevicesPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListCoreDevicesPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListCoreDevicesPaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListDeploymentsPaginator.ts b/clients/client-greengrassv2/src/pagination/ListDeploymentsPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListDeploymentsPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListDeploymentsPaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListEffectiveDeploymentsPaginator.ts b/clients/client-greengrassv2/src/pagination/ListEffectiveDeploymentsPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListEffectiveDeploymentsPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListEffectiveDeploymentsPaginator.ts diff --git a/clients/client-greengrassv2/pagination/ListInstalledComponentsPaginator.ts b/clients/client-greengrassv2/src/pagination/ListInstalledComponentsPaginator.ts similarity index 100% rename from clients/client-greengrassv2/pagination/ListInstalledComponentsPaginator.ts rename to clients/client-greengrassv2/src/pagination/ListInstalledComponentsPaginator.ts diff --git a/clients/client-greengrassv2/protocols/Aws_restJson1.ts b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-greengrassv2/protocols/Aws_restJson1.ts rename to clients/client-greengrassv2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-greengrassv2/src/runtimeConfig.browser.ts b/clients/client-greengrassv2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4ae65f9b1aff --- /dev/null +++ b/clients/client-greengrassv2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GreengrassV2ClientConfig } from "./GreengrassV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-greengrassv2/runtimeConfig.native.ts b/clients/client-greengrassv2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-greengrassv2/runtimeConfig.native.ts rename to clients/client-greengrassv2/src/runtimeConfig.native.ts diff --git a/clients/client-greengrassv2/runtimeConfig.shared.ts b/clients/client-greengrassv2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-greengrassv2/runtimeConfig.shared.ts rename to clients/client-greengrassv2/src/runtimeConfig.shared.ts diff --git a/clients/client-greengrassv2/src/runtimeConfig.ts b/clients/client-greengrassv2/src/runtimeConfig.ts new file mode 100644 index 000000000000..cac2b525a79e --- /dev/null +++ b/clients/client-greengrassv2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GreengrassV2ClientConfig } from "./GreengrassV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-greengrassv2/tsconfig.es.json b/clients/client-greengrassv2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-greengrassv2/tsconfig.es.json +++ b/clients/client-greengrassv2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-greengrassv2/tsconfig.json b/clients/client-greengrassv2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-greengrassv2/tsconfig.json +++ b/clients/client-greengrassv2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-greengrassv2/tsconfig.types.json b/clients/client-greengrassv2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-greengrassv2/tsconfig.types.json +++ b/clients/client-greengrassv2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-groundstation/.gitignore b/clients/client-groundstation/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-groundstation/.gitignore +++ b/clients/client-groundstation/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-groundstation/package.json b/clients/client-groundstation/package.json index f7d0a54fdb63..ddbc872383da 100644 --- a/clients/client-groundstation/package.json +++ b/clients/client-groundstation/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-groundstation", "repository": { "type": "git", diff --git a/clients/client-groundstation/runtimeConfig.browser.ts b/clients/client-groundstation/runtimeConfig.browser.ts deleted file mode 100644 index 623cd422d6c5..000000000000 --- a/clients/client-groundstation/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GroundStationClientConfig } from "./GroundStationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GroundStationClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-groundstation/runtimeConfig.ts b/clients/client-groundstation/runtimeConfig.ts deleted file mode 100644 index 911b70d59712..000000000000 --- a/clients/client-groundstation/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GroundStationClientConfig } from "./GroundStationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GroundStationClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-groundstation/GroundStation.ts b/clients/client-groundstation/src/GroundStation.ts similarity index 100% rename from clients/client-groundstation/GroundStation.ts rename to clients/client-groundstation/src/GroundStation.ts diff --git a/clients/client-groundstation/GroundStationClient.ts b/clients/client-groundstation/src/GroundStationClient.ts similarity index 100% rename from clients/client-groundstation/GroundStationClient.ts rename to clients/client-groundstation/src/GroundStationClient.ts diff --git a/clients/client-groundstation/commands/CancelContactCommand.ts b/clients/client-groundstation/src/commands/CancelContactCommand.ts similarity index 100% rename from clients/client-groundstation/commands/CancelContactCommand.ts rename to clients/client-groundstation/src/commands/CancelContactCommand.ts diff --git a/clients/client-groundstation/commands/CreateConfigCommand.ts b/clients/client-groundstation/src/commands/CreateConfigCommand.ts similarity index 100% rename from clients/client-groundstation/commands/CreateConfigCommand.ts rename to clients/client-groundstation/src/commands/CreateConfigCommand.ts diff --git a/clients/client-groundstation/commands/CreateDataflowEndpointGroupCommand.ts b/clients/client-groundstation/src/commands/CreateDataflowEndpointGroupCommand.ts similarity index 100% rename from clients/client-groundstation/commands/CreateDataflowEndpointGroupCommand.ts rename to clients/client-groundstation/src/commands/CreateDataflowEndpointGroupCommand.ts diff --git a/clients/client-groundstation/commands/CreateMissionProfileCommand.ts b/clients/client-groundstation/src/commands/CreateMissionProfileCommand.ts similarity index 100% rename from clients/client-groundstation/commands/CreateMissionProfileCommand.ts rename to clients/client-groundstation/src/commands/CreateMissionProfileCommand.ts diff --git a/clients/client-groundstation/commands/DeleteConfigCommand.ts b/clients/client-groundstation/src/commands/DeleteConfigCommand.ts similarity index 100% rename from clients/client-groundstation/commands/DeleteConfigCommand.ts rename to clients/client-groundstation/src/commands/DeleteConfigCommand.ts diff --git a/clients/client-groundstation/commands/DeleteDataflowEndpointGroupCommand.ts b/clients/client-groundstation/src/commands/DeleteDataflowEndpointGroupCommand.ts similarity index 100% rename from clients/client-groundstation/commands/DeleteDataflowEndpointGroupCommand.ts rename to clients/client-groundstation/src/commands/DeleteDataflowEndpointGroupCommand.ts diff --git a/clients/client-groundstation/commands/DeleteMissionProfileCommand.ts b/clients/client-groundstation/src/commands/DeleteMissionProfileCommand.ts similarity index 100% rename from clients/client-groundstation/commands/DeleteMissionProfileCommand.ts rename to clients/client-groundstation/src/commands/DeleteMissionProfileCommand.ts diff --git a/clients/client-groundstation/commands/DescribeContactCommand.ts b/clients/client-groundstation/src/commands/DescribeContactCommand.ts similarity index 100% rename from clients/client-groundstation/commands/DescribeContactCommand.ts rename to clients/client-groundstation/src/commands/DescribeContactCommand.ts diff --git a/clients/client-groundstation/commands/GetConfigCommand.ts b/clients/client-groundstation/src/commands/GetConfigCommand.ts similarity index 100% rename from clients/client-groundstation/commands/GetConfigCommand.ts rename to clients/client-groundstation/src/commands/GetConfigCommand.ts diff --git a/clients/client-groundstation/commands/GetDataflowEndpointGroupCommand.ts b/clients/client-groundstation/src/commands/GetDataflowEndpointGroupCommand.ts similarity index 100% rename from clients/client-groundstation/commands/GetDataflowEndpointGroupCommand.ts rename to clients/client-groundstation/src/commands/GetDataflowEndpointGroupCommand.ts diff --git a/clients/client-groundstation/commands/GetMinuteUsageCommand.ts b/clients/client-groundstation/src/commands/GetMinuteUsageCommand.ts similarity index 100% rename from clients/client-groundstation/commands/GetMinuteUsageCommand.ts rename to clients/client-groundstation/src/commands/GetMinuteUsageCommand.ts diff --git a/clients/client-groundstation/commands/GetMissionProfileCommand.ts b/clients/client-groundstation/src/commands/GetMissionProfileCommand.ts similarity index 100% rename from clients/client-groundstation/commands/GetMissionProfileCommand.ts rename to clients/client-groundstation/src/commands/GetMissionProfileCommand.ts diff --git a/clients/client-groundstation/commands/GetSatelliteCommand.ts b/clients/client-groundstation/src/commands/GetSatelliteCommand.ts similarity index 100% rename from clients/client-groundstation/commands/GetSatelliteCommand.ts rename to clients/client-groundstation/src/commands/GetSatelliteCommand.ts diff --git a/clients/client-groundstation/commands/ListConfigsCommand.ts b/clients/client-groundstation/src/commands/ListConfigsCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListConfigsCommand.ts rename to clients/client-groundstation/src/commands/ListConfigsCommand.ts diff --git a/clients/client-groundstation/commands/ListContactsCommand.ts b/clients/client-groundstation/src/commands/ListContactsCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListContactsCommand.ts rename to clients/client-groundstation/src/commands/ListContactsCommand.ts diff --git a/clients/client-groundstation/commands/ListDataflowEndpointGroupsCommand.ts b/clients/client-groundstation/src/commands/ListDataflowEndpointGroupsCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListDataflowEndpointGroupsCommand.ts rename to clients/client-groundstation/src/commands/ListDataflowEndpointGroupsCommand.ts diff --git a/clients/client-groundstation/commands/ListGroundStationsCommand.ts b/clients/client-groundstation/src/commands/ListGroundStationsCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListGroundStationsCommand.ts rename to clients/client-groundstation/src/commands/ListGroundStationsCommand.ts diff --git a/clients/client-groundstation/commands/ListMissionProfilesCommand.ts b/clients/client-groundstation/src/commands/ListMissionProfilesCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListMissionProfilesCommand.ts rename to clients/client-groundstation/src/commands/ListMissionProfilesCommand.ts diff --git a/clients/client-groundstation/commands/ListSatellitesCommand.ts b/clients/client-groundstation/src/commands/ListSatellitesCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListSatellitesCommand.ts rename to clients/client-groundstation/src/commands/ListSatellitesCommand.ts diff --git a/clients/client-groundstation/commands/ListTagsForResourceCommand.ts b/clients/client-groundstation/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ListTagsForResourceCommand.ts rename to clients/client-groundstation/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-groundstation/commands/ReserveContactCommand.ts b/clients/client-groundstation/src/commands/ReserveContactCommand.ts similarity index 100% rename from clients/client-groundstation/commands/ReserveContactCommand.ts rename to clients/client-groundstation/src/commands/ReserveContactCommand.ts diff --git a/clients/client-groundstation/commands/TagResourceCommand.ts b/clients/client-groundstation/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-groundstation/commands/TagResourceCommand.ts rename to clients/client-groundstation/src/commands/TagResourceCommand.ts diff --git a/clients/client-groundstation/commands/UntagResourceCommand.ts b/clients/client-groundstation/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-groundstation/commands/UntagResourceCommand.ts rename to clients/client-groundstation/src/commands/UntagResourceCommand.ts diff --git a/clients/client-groundstation/commands/UpdateConfigCommand.ts b/clients/client-groundstation/src/commands/UpdateConfigCommand.ts similarity index 100% rename from clients/client-groundstation/commands/UpdateConfigCommand.ts rename to clients/client-groundstation/src/commands/UpdateConfigCommand.ts diff --git a/clients/client-groundstation/commands/UpdateMissionProfileCommand.ts b/clients/client-groundstation/src/commands/UpdateMissionProfileCommand.ts similarity index 100% rename from clients/client-groundstation/commands/UpdateMissionProfileCommand.ts rename to clients/client-groundstation/src/commands/UpdateMissionProfileCommand.ts diff --git a/clients/client-groundstation/endpoints.ts b/clients/client-groundstation/src/endpoints.ts similarity index 100% rename from clients/client-groundstation/endpoints.ts rename to clients/client-groundstation/src/endpoints.ts diff --git a/clients/client-groundstation/index.ts b/clients/client-groundstation/src/index.ts similarity index 100% rename from clients/client-groundstation/index.ts rename to clients/client-groundstation/src/index.ts diff --git a/clients/client-groundstation/models/index.ts b/clients/client-groundstation/src/models/index.ts similarity index 100% rename from clients/client-groundstation/models/index.ts rename to clients/client-groundstation/src/models/index.ts diff --git a/clients/client-groundstation/models/models_0.ts b/clients/client-groundstation/src/models/models_0.ts similarity index 100% rename from clients/client-groundstation/models/models_0.ts rename to clients/client-groundstation/src/models/models_0.ts diff --git a/clients/client-groundstation/pagination/Interfaces.ts b/clients/client-groundstation/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-groundstation/pagination/Interfaces.ts rename to clients/client-groundstation/src/pagination/Interfaces.ts diff --git a/clients/client-groundstation/pagination/ListConfigsPaginator.ts b/clients/client-groundstation/src/pagination/ListConfigsPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListConfigsPaginator.ts rename to clients/client-groundstation/src/pagination/ListConfigsPaginator.ts diff --git a/clients/client-groundstation/pagination/ListContactsPaginator.ts b/clients/client-groundstation/src/pagination/ListContactsPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListContactsPaginator.ts rename to clients/client-groundstation/src/pagination/ListContactsPaginator.ts diff --git a/clients/client-groundstation/pagination/ListDataflowEndpointGroupsPaginator.ts b/clients/client-groundstation/src/pagination/ListDataflowEndpointGroupsPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListDataflowEndpointGroupsPaginator.ts rename to clients/client-groundstation/src/pagination/ListDataflowEndpointGroupsPaginator.ts diff --git a/clients/client-groundstation/pagination/ListGroundStationsPaginator.ts b/clients/client-groundstation/src/pagination/ListGroundStationsPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListGroundStationsPaginator.ts rename to clients/client-groundstation/src/pagination/ListGroundStationsPaginator.ts diff --git a/clients/client-groundstation/pagination/ListMissionProfilesPaginator.ts b/clients/client-groundstation/src/pagination/ListMissionProfilesPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListMissionProfilesPaginator.ts rename to clients/client-groundstation/src/pagination/ListMissionProfilesPaginator.ts diff --git a/clients/client-groundstation/pagination/ListSatellitesPaginator.ts b/clients/client-groundstation/src/pagination/ListSatellitesPaginator.ts similarity index 100% rename from clients/client-groundstation/pagination/ListSatellitesPaginator.ts rename to clients/client-groundstation/src/pagination/ListSatellitesPaginator.ts diff --git a/clients/client-groundstation/protocols/Aws_restJson1.ts b/clients/client-groundstation/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-groundstation/protocols/Aws_restJson1.ts rename to clients/client-groundstation/src/protocols/Aws_restJson1.ts diff --git a/clients/client-groundstation/src/runtimeConfig.browser.ts b/clients/client-groundstation/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6aec87135978 --- /dev/null +++ b/clients/client-groundstation/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GroundStationClientConfig } from "./GroundStationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GroundStationClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-groundstation/runtimeConfig.native.ts b/clients/client-groundstation/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-groundstation/runtimeConfig.native.ts rename to clients/client-groundstation/src/runtimeConfig.native.ts diff --git a/clients/client-groundstation/runtimeConfig.shared.ts b/clients/client-groundstation/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-groundstation/runtimeConfig.shared.ts rename to clients/client-groundstation/src/runtimeConfig.shared.ts diff --git a/clients/client-groundstation/src/runtimeConfig.ts b/clients/client-groundstation/src/runtimeConfig.ts new file mode 100644 index 000000000000..8bef2f860064 --- /dev/null +++ b/clients/client-groundstation/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GroundStationClientConfig } from "./GroundStationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GroundStationClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-groundstation/tsconfig.es.json b/clients/client-groundstation/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-groundstation/tsconfig.es.json +++ b/clients/client-groundstation/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-groundstation/tsconfig.json b/clients/client-groundstation/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-groundstation/tsconfig.json +++ b/clients/client-groundstation/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-groundstation/tsconfig.types.json b/clients/client-groundstation/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-groundstation/tsconfig.types.json +++ b/clients/client-groundstation/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-guardduty/.gitignore b/clients/client-guardduty/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-guardduty/.gitignore +++ b/clients/client-guardduty/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-guardduty/package.json b/clients/client-guardduty/package.json index 0c3c508a9b75..d1039f9d82f5 100644 --- a/clients/client-guardduty/package.json +++ b/clients/client-guardduty/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-guardduty", "repository": { "type": "git", diff --git a/clients/client-guardduty/runtimeConfig.browser.ts b/clients/client-guardduty/runtimeConfig.browser.ts deleted file mode 100644 index a8dc046d514e..000000000000 --- a/clients/client-guardduty/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { GuardDutyClientConfig } from "./GuardDutyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GuardDutyClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-guardduty/runtimeConfig.ts b/clients/client-guardduty/runtimeConfig.ts deleted file mode 100644 index da869cff62e7..000000000000 --- a/clients/client-guardduty/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { GuardDutyClientConfig } from "./GuardDutyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: GuardDutyClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-guardduty/GuardDuty.ts b/clients/client-guardduty/src/GuardDuty.ts similarity index 100% rename from clients/client-guardduty/GuardDuty.ts rename to clients/client-guardduty/src/GuardDuty.ts diff --git a/clients/client-guardduty/GuardDutyClient.ts b/clients/client-guardduty/src/GuardDutyClient.ts similarity index 100% rename from clients/client-guardduty/GuardDutyClient.ts rename to clients/client-guardduty/src/GuardDutyClient.ts diff --git a/clients/client-guardduty/commands/AcceptInvitationCommand.ts b/clients/client-guardduty/src/commands/AcceptInvitationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/AcceptInvitationCommand.ts rename to clients/client-guardduty/src/commands/AcceptInvitationCommand.ts diff --git a/clients/client-guardduty/commands/ArchiveFindingsCommand.ts b/clients/client-guardduty/src/commands/ArchiveFindingsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ArchiveFindingsCommand.ts rename to clients/client-guardduty/src/commands/ArchiveFindingsCommand.ts diff --git a/clients/client-guardduty/commands/CreateDetectorCommand.ts b/clients/client-guardduty/src/commands/CreateDetectorCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateDetectorCommand.ts rename to clients/client-guardduty/src/commands/CreateDetectorCommand.ts diff --git a/clients/client-guardduty/commands/CreateFilterCommand.ts b/clients/client-guardduty/src/commands/CreateFilterCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateFilterCommand.ts rename to clients/client-guardduty/src/commands/CreateFilterCommand.ts diff --git a/clients/client-guardduty/commands/CreateIPSetCommand.ts b/clients/client-guardduty/src/commands/CreateIPSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateIPSetCommand.ts rename to clients/client-guardduty/src/commands/CreateIPSetCommand.ts diff --git a/clients/client-guardduty/commands/CreateMembersCommand.ts b/clients/client-guardduty/src/commands/CreateMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateMembersCommand.ts rename to clients/client-guardduty/src/commands/CreateMembersCommand.ts diff --git a/clients/client-guardduty/commands/CreatePublishingDestinationCommand.ts b/clients/client-guardduty/src/commands/CreatePublishingDestinationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreatePublishingDestinationCommand.ts rename to clients/client-guardduty/src/commands/CreatePublishingDestinationCommand.ts diff --git a/clients/client-guardduty/commands/CreateSampleFindingsCommand.ts b/clients/client-guardduty/src/commands/CreateSampleFindingsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateSampleFindingsCommand.ts rename to clients/client-guardduty/src/commands/CreateSampleFindingsCommand.ts diff --git a/clients/client-guardduty/commands/CreateThreatIntelSetCommand.ts b/clients/client-guardduty/src/commands/CreateThreatIntelSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/CreateThreatIntelSetCommand.ts rename to clients/client-guardduty/src/commands/CreateThreatIntelSetCommand.ts diff --git a/clients/client-guardduty/commands/DeclineInvitationsCommand.ts b/clients/client-guardduty/src/commands/DeclineInvitationsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeclineInvitationsCommand.ts rename to clients/client-guardduty/src/commands/DeclineInvitationsCommand.ts diff --git a/clients/client-guardduty/commands/DeleteDetectorCommand.ts b/clients/client-guardduty/src/commands/DeleteDetectorCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteDetectorCommand.ts rename to clients/client-guardduty/src/commands/DeleteDetectorCommand.ts diff --git a/clients/client-guardduty/commands/DeleteFilterCommand.ts b/clients/client-guardduty/src/commands/DeleteFilterCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteFilterCommand.ts rename to clients/client-guardduty/src/commands/DeleteFilterCommand.ts diff --git a/clients/client-guardduty/commands/DeleteIPSetCommand.ts b/clients/client-guardduty/src/commands/DeleteIPSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteIPSetCommand.ts rename to clients/client-guardduty/src/commands/DeleteIPSetCommand.ts diff --git a/clients/client-guardduty/commands/DeleteInvitationsCommand.ts b/clients/client-guardduty/src/commands/DeleteInvitationsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteInvitationsCommand.ts rename to clients/client-guardduty/src/commands/DeleteInvitationsCommand.ts diff --git a/clients/client-guardduty/commands/DeleteMembersCommand.ts b/clients/client-guardduty/src/commands/DeleteMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteMembersCommand.ts rename to clients/client-guardduty/src/commands/DeleteMembersCommand.ts diff --git a/clients/client-guardduty/commands/DeletePublishingDestinationCommand.ts b/clients/client-guardduty/src/commands/DeletePublishingDestinationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeletePublishingDestinationCommand.ts rename to clients/client-guardduty/src/commands/DeletePublishingDestinationCommand.ts diff --git a/clients/client-guardduty/commands/DeleteThreatIntelSetCommand.ts b/clients/client-guardduty/src/commands/DeleteThreatIntelSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DeleteThreatIntelSetCommand.ts rename to clients/client-guardduty/src/commands/DeleteThreatIntelSetCommand.ts diff --git a/clients/client-guardduty/commands/DescribeOrganizationConfigurationCommand.ts b/clients/client-guardduty/src/commands/DescribeOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DescribeOrganizationConfigurationCommand.ts rename to clients/client-guardduty/src/commands/DescribeOrganizationConfigurationCommand.ts diff --git a/clients/client-guardduty/commands/DescribePublishingDestinationCommand.ts b/clients/client-guardduty/src/commands/DescribePublishingDestinationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DescribePublishingDestinationCommand.ts rename to clients/client-guardduty/src/commands/DescribePublishingDestinationCommand.ts diff --git a/clients/client-guardduty/commands/DisableOrganizationAdminAccountCommand.ts b/clients/client-guardduty/src/commands/DisableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DisableOrganizationAdminAccountCommand.ts rename to clients/client-guardduty/src/commands/DisableOrganizationAdminAccountCommand.ts diff --git a/clients/client-guardduty/commands/DisassociateFromMasterAccountCommand.ts b/clients/client-guardduty/src/commands/DisassociateFromMasterAccountCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DisassociateFromMasterAccountCommand.ts rename to clients/client-guardduty/src/commands/DisassociateFromMasterAccountCommand.ts diff --git a/clients/client-guardduty/commands/DisassociateMembersCommand.ts b/clients/client-guardduty/src/commands/DisassociateMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/DisassociateMembersCommand.ts rename to clients/client-guardduty/src/commands/DisassociateMembersCommand.ts diff --git a/clients/client-guardduty/commands/EnableOrganizationAdminAccountCommand.ts b/clients/client-guardduty/src/commands/EnableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-guardduty/commands/EnableOrganizationAdminAccountCommand.ts rename to clients/client-guardduty/src/commands/EnableOrganizationAdminAccountCommand.ts diff --git a/clients/client-guardduty/commands/GetDetectorCommand.ts b/clients/client-guardduty/src/commands/GetDetectorCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetDetectorCommand.ts rename to clients/client-guardduty/src/commands/GetDetectorCommand.ts diff --git a/clients/client-guardduty/commands/GetFilterCommand.ts b/clients/client-guardduty/src/commands/GetFilterCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetFilterCommand.ts rename to clients/client-guardduty/src/commands/GetFilterCommand.ts diff --git a/clients/client-guardduty/commands/GetFindingsCommand.ts b/clients/client-guardduty/src/commands/GetFindingsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetFindingsCommand.ts rename to clients/client-guardduty/src/commands/GetFindingsCommand.ts diff --git a/clients/client-guardduty/commands/GetFindingsStatisticsCommand.ts b/clients/client-guardduty/src/commands/GetFindingsStatisticsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetFindingsStatisticsCommand.ts rename to clients/client-guardduty/src/commands/GetFindingsStatisticsCommand.ts diff --git a/clients/client-guardduty/commands/GetIPSetCommand.ts b/clients/client-guardduty/src/commands/GetIPSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetIPSetCommand.ts rename to clients/client-guardduty/src/commands/GetIPSetCommand.ts diff --git a/clients/client-guardduty/commands/GetInvitationsCountCommand.ts b/clients/client-guardduty/src/commands/GetInvitationsCountCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetInvitationsCountCommand.ts rename to clients/client-guardduty/src/commands/GetInvitationsCountCommand.ts diff --git a/clients/client-guardduty/commands/GetMasterAccountCommand.ts b/clients/client-guardduty/src/commands/GetMasterAccountCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetMasterAccountCommand.ts rename to clients/client-guardduty/src/commands/GetMasterAccountCommand.ts diff --git a/clients/client-guardduty/commands/GetMemberDetectorsCommand.ts b/clients/client-guardduty/src/commands/GetMemberDetectorsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetMemberDetectorsCommand.ts rename to clients/client-guardduty/src/commands/GetMemberDetectorsCommand.ts diff --git a/clients/client-guardduty/commands/GetMembersCommand.ts b/clients/client-guardduty/src/commands/GetMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetMembersCommand.ts rename to clients/client-guardduty/src/commands/GetMembersCommand.ts diff --git a/clients/client-guardduty/commands/GetThreatIntelSetCommand.ts b/clients/client-guardduty/src/commands/GetThreatIntelSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetThreatIntelSetCommand.ts rename to clients/client-guardduty/src/commands/GetThreatIntelSetCommand.ts diff --git a/clients/client-guardduty/commands/GetUsageStatisticsCommand.ts b/clients/client-guardduty/src/commands/GetUsageStatisticsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/GetUsageStatisticsCommand.ts rename to clients/client-guardduty/src/commands/GetUsageStatisticsCommand.ts diff --git a/clients/client-guardduty/commands/InviteMembersCommand.ts b/clients/client-guardduty/src/commands/InviteMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/InviteMembersCommand.ts rename to clients/client-guardduty/src/commands/InviteMembersCommand.ts diff --git a/clients/client-guardduty/commands/ListDetectorsCommand.ts b/clients/client-guardduty/src/commands/ListDetectorsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListDetectorsCommand.ts rename to clients/client-guardduty/src/commands/ListDetectorsCommand.ts diff --git a/clients/client-guardduty/commands/ListFiltersCommand.ts b/clients/client-guardduty/src/commands/ListFiltersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListFiltersCommand.ts rename to clients/client-guardduty/src/commands/ListFiltersCommand.ts diff --git a/clients/client-guardduty/commands/ListFindingsCommand.ts b/clients/client-guardduty/src/commands/ListFindingsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListFindingsCommand.ts rename to clients/client-guardduty/src/commands/ListFindingsCommand.ts diff --git a/clients/client-guardduty/commands/ListIPSetsCommand.ts b/clients/client-guardduty/src/commands/ListIPSetsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListIPSetsCommand.ts rename to clients/client-guardduty/src/commands/ListIPSetsCommand.ts diff --git a/clients/client-guardduty/commands/ListInvitationsCommand.ts b/clients/client-guardduty/src/commands/ListInvitationsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListInvitationsCommand.ts rename to clients/client-guardduty/src/commands/ListInvitationsCommand.ts diff --git a/clients/client-guardduty/commands/ListMembersCommand.ts b/clients/client-guardduty/src/commands/ListMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListMembersCommand.ts rename to clients/client-guardduty/src/commands/ListMembersCommand.ts diff --git a/clients/client-guardduty/commands/ListOrganizationAdminAccountsCommand.ts b/clients/client-guardduty/src/commands/ListOrganizationAdminAccountsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListOrganizationAdminAccountsCommand.ts rename to clients/client-guardduty/src/commands/ListOrganizationAdminAccountsCommand.ts diff --git a/clients/client-guardduty/commands/ListPublishingDestinationsCommand.ts b/clients/client-guardduty/src/commands/ListPublishingDestinationsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListPublishingDestinationsCommand.ts rename to clients/client-guardduty/src/commands/ListPublishingDestinationsCommand.ts diff --git a/clients/client-guardduty/commands/ListTagsForResourceCommand.ts b/clients/client-guardduty/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListTagsForResourceCommand.ts rename to clients/client-guardduty/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-guardduty/commands/ListThreatIntelSetsCommand.ts b/clients/client-guardduty/src/commands/ListThreatIntelSetsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/ListThreatIntelSetsCommand.ts rename to clients/client-guardduty/src/commands/ListThreatIntelSetsCommand.ts diff --git a/clients/client-guardduty/commands/StartMonitoringMembersCommand.ts b/clients/client-guardduty/src/commands/StartMonitoringMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/StartMonitoringMembersCommand.ts rename to clients/client-guardduty/src/commands/StartMonitoringMembersCommand.ts diff --git a/clients/client-guardduty/commands/StopMonitoringMembersCommand.ts b/clients/client-guardduty/src/commands/StopMonitoringMembersCommand.ts similarity index 100% rename from clients/client-guardduty/commands/StopMonitoringMembersCommand.ts rename to clients/client-guardduty/src/commands/StopMonitoringMembersCommand.ts diff --git a/clients/client-guardduty/commands/TagResourceCommand.ts b/clients/client-guardduty/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-guardduty/commands/TagResourceCommand.ts rename to clients/client-guardduty/src/commands/TagResourceCommand.ts diff --git a/clients/client-guardduty/commands/UnarchiveFindingsCommand.ts b/clients/client-guardduty/src/commands/UnarchiveFindingsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UnarchiveFindingsCommand.ts rename to clients/client-guardduty/src/commands/UnarchiveFindingsCommand.ts diff --git a/clients/client-guardduty/commands/UntagResourceCommand.ts b/clients/client-guardduty/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UntagResourceCommand.ts rename to clients/client-guardduty/src/commands/UntagResourceCommand.ts diff --git a/clients/client-guardduty/commands/UpdateDetectorCommand.ts b/clients/client-guardduty/src/commands/UpdateDetectorCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateDetectorCommand.ts rename to clients/client-guardduty/src/commands/UpdateDetectorCommand.ts diff --git a/clients/client-guardduty/commands/UpdateFilterCommand.ts b/clients/client-guardduty/src/commands/UpdateFilterCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateFilterCommand.ts rename to clients/client-guardduty/src/commands/UpdateFilterCommand.ts diff --git a/clients/client-guardduty/commands/UpdateFindingsFeedbackCommand.ts b/clients/client-guardduty/src/commands/UpdateFindingsFeedbackCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateFindingsFeedbackCommand.ts rename to clients/client-guardduty/src/commands/UpdateFindingsFeedbackCommand.ts diff --git a/clients/client-guardduty/commands/UpdateIPSetCommand.ts b/clients/client-guardduty/src/commands/UpdateIPSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateIPSetCommand.ts rename to clients/client-guardduty/src/commands/UpdateIPSetCommand.ts diff --git a/clients/client-guardduty/commands/UpdateMemberDetectorsCommand.ts b/clients/client-guardduty/src/commands/UpdateMemberDetectorsCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateMemberDetectorsCommand.ts rename to clients/client-guardduty/src/commands/UpdateMemberDetectorsCommand.ts diff --git a/clients/client-guardduty/commands/UpdateOrganizationConfigurationCommand.ts b/clients/client-guardduty/src/commands/UpdateOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateOrganizationConfigurationCommand.ts rename to clients/client-guardduty/src/commands/UpdateOrganizationConfigurationCommand.ts diff --git a/clients/client-guardduty/commands/UpdatePublishingDestinationCommand.ts b/clients/client-guardduty/src/commands/UpdatePublishingDestinationCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdatePublishingDestinationCommand.ts rename to clients/client-guardduty/src/commands/UpdatePublishingDestinationCommand.ts diff --git a/clients/client-guardduty/commands/UpdateThreatIntelSetCommand.ts b/clients/client-guardduty/src/commands/UpdateThreatIntelSetCommand.ts similarity index 100% rename from clients/client-guardduty/commands/UpdateThreatIntelSetCommand.ts rename to clients/client-guardduty/src/commands/UpdateThreatIntelSetCommand.ts diff --git a/clients/client-guardduty/endpoints.ts b/clients/client-guardduty/src/endpoints.ts similarity index 100% rename from clients/client-guardduty/endpoints.ts rename to clients/client-guardduty/src/endpoints.ts diff --git a/clients/client-guardduty/index.ts b/clients/client-guardduty/src/index.ts similarity index 100% rename from clients/client-guardduty/index.ts rename to clients/client-guardduty/src/index.ts diff --git a/clients/client-guardduty/models/index.ts b/clients/client-guardduty/src/models/index.ts similarity index 100% rename from clients/client-guardduty/models/index.ts rename to clients/client-guardduty/src/models/index.ts diff --git a/clients/client-guardduty/models/models_0.ts b/clients/client-guardduty/src/models/models_0.ts similarity index 100% rename from clients/client-guardduty/models/models_0.ts rename to clients/client-guardduty/src/models/models_0.ts diff --git a/clients/client-guardduty/pagination/GetUsageStatisticsPaginator.ts b/clients/client-guardduty/src/pagination/GetUsageStatisticsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/GetUsageStatisticsPaginator.ts rename to clients/client-guardduty/src/pagination/GetUsageStatisticsPaginator.ts diff --git a/clients/client-guardduty/pagination/Interfaces.ts b/clients/client-guardduty/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-guardduty/pagination/Interfaces.ts rename to clients/client-guardduty/src/pagination/Interfaces.ts diff --git a/clients/client-guardduty/pagination/ListDetectorsPaginator.ts b/clients/client-guardduty/src/pagination/ListDetectorsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListDetectorsPaginator.ts rename to clients/client-guardduty/src/pagination/ListDetectorsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListFiltersPaginator.ts b/clients/client-guardduty/src/pagination/ListFiltersPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListFiltersPaginator.ts rename to clients/client-guardduty/src/pagination/ListFiltersPaginator.ts diff --git a/clients/client-guardduty/pagination/ListFindingsPaginator.ts b/clients/client-guardduty/src/pagination/ListFindingsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListFindingsPaginator.ts rename to clients/client-guardduty/src/pagination/ListFindingsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListIPSetsPaginator.ts b/clients/client-guardduty/src/pagination/ListIPSetsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListIPSetsPaginator.ts rename to clients/client-guardduty/src/pagination/ListIPSetsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListInvitationsPaginator.ts b/clients/client-guardduty/src/pagination/ListInvitationsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListInvitationsPaginator.ts rename to clients/client-guardduty/src/pagination/ListInvitationsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListMembersPaginator.ts b/clients/client-guardduty/src/pagination/ListMembersPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListMembersPaginator.ts rename to clients/client-guardduty/src/pagination/ListMembersPaginator.ts diff --git a/clients/client-guardduty/pagination/ListOrganizationAdminAccountsPaginator.ts b/clients/client-guardduty/src/pagination/ListOrganizationAdminAccountsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListOrganizationAdminAccountsPaginator.ts rename to clients/client-guardduty/src/pagination/ListOrganizationAdminAccountsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListPublishingDestinationsPaginator.ts b/clients/client-guardduty/src/pagination/ListPublishingDestinationsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListPublishingDestinationsPaginator.ts rename to clients/client-guardduty/src/pagination/ListPublishingDestinationsPaginator.ts diff --git a/clients/client-guardduty/pagination/ListThreatIntelSetsPaginator.ts b/clients/client-guardduty/src/pagination/ListThreatIntelSetsPaginator.ts similarity index 100% rename from clients/client-guardduty/pagination/ListThreatIntelSetsPaginator.ts rename to clients/client-guardduty/src/pagination/ListThreatIntelSetsPaginator.ts diff --git a/clients/client-guardduty/protocols/Aws_restJson1.ts b/clients/client-guardduty/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-guardduty/protocols/Aws_restJson1.ts rename to clients/client-guardduty/src/protocols/Aws_restJson1.ts diff --git a/clients/client-guardduty/src/runtimeConfig.browser.ts b/clients/client-guardduty/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d2dc09c4cc38 --- /dev/null +++ b/clients/client-guardduty/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { GuardDutyClientConfig } from "./GuardDutyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GuardDutyClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-guardduty/runtimeConfig.native.ts b/clients/client-guardduty/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-guardduty/runtimeConfig.native.ts rename to clients/client-guardduty/src/runtimeConfig.native.ts diff --git a/clients/client-guardduty/runtimeConfig.shared.ts b/clients/client-guardduty/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-guardduty/runtimeConfig.shared.ts rename to clients/client-guardduty/src/runtimeConfig.shared.ts diff --git a/clients/client-guardduty/src/runtimeConfig.ts b/clients/client-guardduty/src/runtimeConfig.ts new file mode 100644 index 000000000000..05c658370877 --- /dev/null +++ b/clients/client-guardduty/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { GuardDutyClientConfig } from "./GuardDutyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: GuardDutyClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-guardduty/tsconfig.es.json b/clients/client-guardduty/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-guardduty/tsconfig.es.json +++ b/clients/client-guardduty/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-guardduty/tsconfig.json b/clients/client-guardduty/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-guardduty/tsconfig.json +++ b/clients/client-guardduty/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-guardduty/tsconfig.types.json b/clients/client-guardduty/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-guardduty/tsconfig.types.json +++ b/clients/client-guardduty/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-health/.gitignore b/clients/client-health/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-health/.gitignore +++ b/clients/client-health/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-health/package.json b/clients/client-health/package.json index 6c0730c5ec94..c4a8f92e0143 100644 --- a/clients/client-health/package.json +++ b/clients/client-health/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-health", "repository": { "type": "git", diff --git a/clients/client-health/runtimeConfig.browser.ts b/clients/client-health/runtimeConfig.browser.ts deleted file mode 100644 index 7f85e15d259a..000000000000 --- a/clients/client-health/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { HealthClientConfig } from "./HealthClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HealthClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-health/runtimeConfig.ts b/clients/client-health/runtimeConfig.ts deleted file mode 100644 index ba093b77dc42..000000000000 --- a/clients/client-health/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { HealthClientConfig } from "./HealthClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HealthClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-health/Health.ts b/clients/client-health/src/Health.ts similarity index 100% rename from clients/client-health/Health.ts rename to clients/client-health/src/Health.ts diff --git a/clients/client-health/HealthClient.ts b/clients/client-health/src/HealthClient.ts similarity index 100% rename from clients/client-health/HealthClient.ts rename to clients/client-health/src/HealthClient.ts diff --git a/clients/client-health/commands/DescribeAffectedAccountsForOrganizationCommand.ts b/clients/client-health/src/commands/DescribeAffectedAccountsForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeAffectedAccountsForOrganizationCommand.ts rename to clients/client-health/src/commands/DescribeAffectedAccountsForOrganizationCommand.ts diff --git a/clients/client-health/commands/DescribeAffectedEntitiesCommand.ts b/clients/client-health/src/commands/DescribeAffectedEntitiesCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeAffectedEntitiesCommand.ts rename to clients/client-health/src/commands/DescribeAffectedEntitiesCommand.ts diff --git a/clients/client-health/commands/DescribeAffectedEntitiesForOrganizationCommand.ts b/clients/client-health/src/commands/DescribeAffectedEntitiesForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeAffectedEntitiesForOrganizationCommand.ts rename to clients/client-health/src/commands/DescribeAffectedEntitiesForOrganizationCommand.ts diff --git a/clients/client-health/commands/DescribeEntityAggregatesCommand.ts b/clients/client-health/src/commands/DescribeEntityAggregatesCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEntityAggregatesCommand.ts rename to clients/client-health/src/commands/DescribeEntityAggregatesCommand.ts diff --git a/clients/client-health/commands/DescribeEventAggregatesCommand.ts b/clients/client-health/src/commands/DescribeEventAggregatesCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventAggregatesCommand.ts rename to clients/client-health/src/commands/DescribeEventAggregatesCommand.ts diff --git a/clients/client-health/commands/DescribeEventDetailsCommand.ts b/clients/client-health/src/commands/DescribeEventDetailsCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventDetailsCommand.ts rename to clients/client-health/src/commands/DescribeEventDetailsCommand.ts diff --git a/clients/client-health/commands/DescribeEventDetailsForOrganizationCommand.ts b/clients/client-health/src/commands/DescribeEventDetailsForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventDetailsForOrganizationCommand.ts rename to clients/client-health/src/commands/DescribeEventDetailsForOrganizationCommand.ts diff --git a/clients/client-health/commands/DescribeEventTypesCommand.ts b/clients/client-health/src/commands/DescribeEventTypesCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventTypesCommand.ts rename to clients/client-health/src/commands/DescribeEventTypesCommand.ts diff --git a/clients/client-health/commands/DescribeEventsCommand.ts b/clients/client-health/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventsCommand.ts rename to clients/client-health/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-health/commands/DescribeEventsForOrganizationCommand.ts b/clients/client-health/src/commands/DescribeEventsForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeEventsForOrganizationCommand.ts rename to clients/client-health/src/commands/DescribeEventsForOrganizationCommand.ts diff --git a/clients/client-health/commands/DescribeHealthServiceStatusForOrganizationCommand.ts b/clients/client-health/src/commands/DescribeHealthServiceStatusForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DescribeHealthServiceStatusForOrganizationCommand.ts rename to clients/client-health/src/commands/DescribeHealthServiceStatusForOrganizationCommand.ts diff --git a/clients/client-health/commands/DisableHealthServiceAccessForOrganizationCommand.ts b/clients/client-health/src/commands/DisableHealthServiceAccessForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/DisableHealthServiceAccessForOrganizationCommand.ts rename to clients/client-health/src/commands/DisableHealthServiceAccessForOrganizationCommand.ts diff --git a/clients/client-health/commands/EnableHealthServiceAccessForOrganizationCommand.ts b/clients/client-health/src/commands/EnableHealthServiceAccessForOrganizationCommand.ts similarity index 100% rename from clients/client-health/commands/EnableHealthServiceAccessForOrganizationCommand.ts rename to clients/client-health/src/commands/EnableHealthServiceAccessForOrganizationCommand.ts diff --git a/clients/client-health/endpoints.ts b/clients/client-health/src/endpoints.ts similarity index 100% rename from clients/client-health/endpoints.ts rename to clients/client-health/src/endpoints.ts diff --git a/clients/client-health/index.ts b/clients/client-health/src/index.ts similarity index 100% rename from clients/client-health/index.ts rename to clients/client-health/src/index.ts diff --git a/clients/client-health/models/index.ts b/clients/client-health/src/models/index.ts similarity index 100% rename from clients/client-health/models/index.ts rename to clients/client-health/src/models/index.ts diff --git a/clients/client-health/models/models_0.ts b/clients/client-health/src/models/models_0.ts similarity index 100% rename from clients/client-health/models/models_0.ts rename to clients/client-health/src/models/models_0.ts diff --git a/clients/client-health/pagination/DescribeAffectedAccountsForOrganizationPaginator.ts b/clients/client-health/src/pagination/DescribeAffectedAccountsForOrganizationPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeAffectedAccountsForOrganizationPaginator.ts rename to clients/client-health/src/pagination/DescribeAffectedAccountsForOrganizationPaginator.ts diff --git a/clients/client-health/pagination/DescribeAffectedEntitiesForOrganizationPaginator.ts b/clients/client-health/src/pagination/DescribeAffectedEntitiesForOrganizationPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeAffectedEntitiesForOrganizationPaginator.ts rename to clients/client-health/src/pagination/DescribeAffectedEntitiesForOrganizationPaginator.ts diff --git a/clients/client-health/pagination/DescribeAffectedEntitiesPaginator.ts b/clients/client-health/src/pagination/DescribeAffectedEntitiesPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeAffectedEntitiesPaginator.ts rename to clients/client-health/src/pagination/DescribeAffectedEntitiesPaginator.ts diff --git a/clients/client-health/pagination/DescribeEventAggregatesPaginator.ts b/clients/client-health/src/pagination/DescribeEventAggregatesPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeEventAggregatesPaginator.ts rename to clients/client-health/src/pagination/DescribeEventAggregatesPaginator.ts diff --git a/clients/client-health/pagination/DescribeEventTypesPaginator.ts b/clients/client-health/src/pagination/DescribeEventTypesPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeEventTypesPaginator.ts rename to clients/client-health/src/pagination/DescribeEventTypesPaginator.ts diff --git a/clients/client-health/pagination/DescribeEventsForOrganizationPaginator.ts b/clients/client-health/src/pagination/DescribeEventsForOrganizationPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeEventsForOrganizationPaginator.ts rename to clients/client-health/src/pagination/DescribeEventsForOrganizationPaginator.ts diff --git a/clients/client-health/pagination/DescribeEventsPaginator.ts b/clients/client-health/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-health/pagination/DescribeEventsPaginator.ts rename to clients/client-health/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-health/pagination/Interfaces.ts b/clients/client-health/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-health/pagination/Interfaces.ts rename to clients/client-health/src/pagination/Interfaces.ts diff --git a/clients/client-health/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-health/protocols/Aws_json1_1.ts rename to clients/client-health/src/protocols/Aws_json1_1.ts diff --git a/clients/client-health/src/runtimeConfig.browser.ts b/clients/client-health/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..07cf182dd742 --- /dev/null +++ b/clients/client-health/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { HealthClientConfig } from "./HealthClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HealthClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-health/runtimeConfig.native.ts b/clients/client-health/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-health/runtimeConfig.native.ts rename to clients/client-health/src/runtimeConfig.native.ts diff --git a/clients/client-health/runtimeConfig.shared.ts b/clients/client-health/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-health/runtimeConfig.shared.ts rename to clients/client-health/src/runtimeConfig.shared.ts diff --git a/clients/client-health/src/runtimeConfig.ts b/clients/client-health/src/runtimeConfig.ts new file mode 100644 index 000000000000..d182694d528d --- /dev/null +++ b/clients/client-health/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { HealthClientConfig } from "./HealthClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HealthClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-health/tsconfig.es.json b/clients/client-health/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-health/tsconfig.es.json +++ b/clients/client-health/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-health/tsconfig.json b/clients/client-health/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-health/tsconfig.json +++ b/clients/client-health/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-health/tsconfig.types.json b/clients/client-health/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-health/tsconfig.types.json +++ b/clients/client-health/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-healthlake/.gitignore b/clients/client-healthlake/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-healthlake/.gitignore +++ b/clients/client-healthlake/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-healthlake/package.json b/clients/client-healthlake/package.json index 99ca45711f20..001913132ec3 100644 --- a/clients/client-healthlake/package.json +++ b/clients/client-healthlake/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-healthlake", "repository": { "type": "git", diff --git a/clients/client-healthlake/runtimeConfig.browser.ts b/clients/client-healthlake/runtimeConfig.browser.ts deleted file mode 100644 index 66bc54d7b75d..000000000000 --- a/clients/client-healthlake/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { HealthLakeClientConfig } from "./HealthLakeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HealthLakeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-healthlake/runtimeConfig.ts b/clients/client-healthlake/runtimeConfig.ts deleted file mode 100644 index 857180c18ab0..000000000000 --- a/clients/client-healthlake/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { HealthLakeClientConfig } from "./HealthLakeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HealthLakeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-healthlake/HealthLake.ts b/clients/client-healthlake/src/HealthLake.ts similarity index 100% rename from clients/client-healthlake/HealthLake.ts rename to clients/client-healthlake/src/HealthLake.ts diff --git a/clients/client-healthlake/HealthLakeClient.ts b/clients/client-healthlake/src/HealthLakeClient.ts similarity index 100% rename from clients/client-healthlake/HealthLakeClient.ts rename to clients/client-healthlake/src/HealthLakeClient.ts diff --git a/clients/client-healthlake/commands/CreateFHIRDatastoreCommand.ts b/clients/client-healthlake/src/commands/CreateFHIRDatastoreCommand.ts similarity index 100% rename from clients/client-healthlake/commands/CreateFHIRDatastoreCommand.ts rename to clients/client-healthlake/src/commands/CreateFHIRDatastoreCommand.ts diff --git a/clients/client-healthlake/commands/DeleteFHIRDatastoreCommand.ts b/clients/client-healthlake/src/commands/DeleteFHIRDatastoreCommand.ts similarity index 100% rename from clients/client-healthlake/commands/DeleteFHIRDatastoreCommand.ts rename to clients/client-healthlake/src/commands/DeleteFHIRDatastoreCommand.ts diff --git a/clients/client-healthlake/commands/DescribeFHIRDatastoreCommand.ts b/clients/client-healthlake/src/commands/DescribeFHIRDatastoreCommand.ts similarity index 100% rename from clients/client-healthlake/commands/DescribeFHIRDatastoreCommand.ts rename to clients/client-healthlake/src/commands/DescribeFHIRDatastoreCommand.ts diff --git a/clients/client-healthlake/commands/DescribeFHIRExportJobCommand.ts b/clients/client-healthlake/src/commands/DescribeFHIRExportJobCommand.ts similarity index 100% rename from clients/client-healthlake/commands/DescribeFHIRExportJobCommand.ts rename to clients/client-healthlake/src/commands/DescribeFHIRExportJobCommand.ts diff --git a/clients/client-healthlake/commands/DescribeFHIRImportJobCommand.ts b/clients/client-healthlake/src/commands/DescribeFHIRImportJobCommand.ts similarity index 100% rename from clients/client-healthlake/commands/DescribeFHIRImportJobCommand.ts rename to clients/client-healthlake/src/commands/DescribeFHIRImportJobCommand.ts diff --git a/clients/client-healthlake/commands/ListFHIRDatastoresCommand.ts b/clients/client-healthlake/src/commands/ListFHIRDatastoresCommand.ts similarity index 100% rename from clients/client-healthlake/commands/ListFHIRDatastoresCommand.ts rename to clients/client-healthlake/src/commands/ListFHIRDatastoresCommand.ts diff --git a/clients/client-healthlake/commands/ListFHIRExportJobsCommand.ts b/clients/client-healthlake/src/commands/ListFHIRExportJobsCommand.ts similarity index 100% rename from clients/client-healthlake/commands/ListFHIRExportJobsCommand.ts rename to clients/client-healthlake/src/commands/ListFHIRExportJobsCommand.ts diff --git a/clients/client-healthlake/commands/ListFHIRImportJobsCommand.ts b/clients/client-healthlake/src/commands/ListFHIRImportJobsCommand.ts similarity index 100% rename from clients/client-healthlake/commands/ListFHIRImportJobsCommand.ts rename to clients/client-healthlake/src/commands/ListFHIRImportJobsCommand.ts diff --git a/clients/client-healthlake/commands/ListTagsForResourceCommand.ts b/clients/client-healthlake/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-healthlake/commands/ListTagsForResourceCommand.ts rename to clients/client-healthlake/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-healthlake/commands/StartFHIRExportJobCommand.ts b/clients/client-healthlake/src/commands/StartFHIRExportJobCommand.ts similarity index 100% rename from clients/client-healthlake/commands/StartFHIRExportJobCommand.ts rename to clients/client-healthlake/src/commands/StartFHIRExportJobCommand.ts diff --git a/clients/client-healthlake/commands/StartFHIRImportJobCommand.ts b/clients/client-healthlake/src/commands/StartFHIRImportJobCommand.ts similarity index 100% rename from clients/client-healthlake/commands/StartFHIRImportJobCommand.ts rename to clients/client-healthlake/src/commands/StartFHIRImportJobCommand.ts diff --git a/clients/client-healthlake/commands/TagResourceCommand.ts b/clients/client-healthlake/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-healthlake/commands/TagResourceCommand.ts rename to clients/client-healthlake/src/commands/TagResourceCommand.ts diff --git a/clients/client-healthlake/commands/UntagResourceCommand.ts b/clients/client-healthlake/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-healthlake/commands/UntagResourceCommand.ts rename to clients/client-healthlake/src/commands/UntagResourceCommand.ts diff --git a/clients/client-healthlake/endpoints.ts b/clients/client-healthlake/src/endpoints.ts similarity index 100% rename from clients/client-healthlake/endpoints.ts rename to clients/client-healthlake/src/endpoints.ts diff --git a/clients/client-healthlake/index.ts b/clients/client-healthlake/src/index.ts similarity index 100% rename from clients/client-healthlake/index.ts rename to clients/client-healthlake/src/index.ts diff --git a/clients/client-healthlake/models/index.ts b/clients/client-healthlake/src/models/index.ts similarity index 100% rename from clients/client-healthlake/models/index.ts rename to clients/client-healthlake/src/models/index.ts diff --git a/clients/client-healthlake/models/models_0.ts b/clients/client-healthlake/src/models/models_0.ts similarity index 100% rename from clients/client-healthlake/models/models_0.ts rename to clients/client-healthlake/src/models/models_0.ts diff --git a/clients/client-healthlake/pagination/Interfaces.ts b/clients/client-healthlake/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-healthlake/pagination/Interfaces.ts rename to clients/client-healthlake/src/pagination/Interfaces.ts diff --git a/clients/client-healthlake/pagination/ListFHIRDatastoresPaginator.ts b/clients/client-healthlake/src/pagination/ListFHIRDatastoresPaginator.ts similarity index 100% rename from clients/client-healthlake/pagination/ListFHIRDatastoresPaginator.ts rename to clients/client-healthlake/src/pagination/ListFHIRDatastoresPaginator.ts diff --git a/clients/client-healthlake/pagination/ListFHIRExportJobsPaginator.ts b/clients/client-healthlake/src/pagination/ListFHIRExportJobsPaginator.ts similarity index 100% rename from clients/client-healthlake/pagination/ListFHIRExportJobsPaginator.ts rename to clients/client-healthlake/src/pagination/ListFHIRExportJobsPaginator.ts diff --git a/clients/client-healthlake/pagination/ListFHIRImportJobsPaginator.ts b/clients/client-healthlake/src/pagination/ListFHIRImportJobsPaginator.ts similarity index 100% rename from clients/client-healthlake/pagination/ListFHIRImportJobsPaginator.ts rename to clients/client-healthlake/src/pagination/ListFHIRImportJobsPaginator.ts diff --git a/clients/client-healthlake/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-healthlake/protocols/Aws_json1_0.ts rename to clients/client-healthlake/src/protocols/Aws_json1_0.ts diff --git a/clients/client-healthlake/src/runtimeConfig.browser.ts b/clients/client-healthlake/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..22bccce1082b --- /dev/null +++ b/clients/client-healthlake/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { HealthLakeClientConfig } from "./HealthLakeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HealthLakeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-healthlake/runtimeConfig.native.ts b/clients/client-healthlake/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-healthlake/runtimeConfig.native.ts rename to clients/client-healthlake/src/runtimeConfig.native.ts diff --git a/clients/client-healthlake/runtimeConfig.shared.ts b/clients/client-healthlake/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-healthlake/runtimeConfig.shared.ts rename to clients/client-healthlake/src/runtimeConfig.shared.ts diff --git a/clients/client-healthlake/src/runtimeConfig.ts b/clients/client-healthlake/src/runtimeConfig.ts new file mode 100644 index 000000000000..786bcfeafbb3 --- /dev/null +++ b/clients/client-healthlake/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { HealthLakeClientConfig } from "./HealthLakeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HealthLakeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-healthlake/tsconfig.es.json b/clients/client-healthlake/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-healthlake/tsconfig.es.json +++ b/clients/client-healthlake/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-healthlake/tsconfig.json b/clients/client-healthlake/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-healthlake/tsconfig.json +++ b/clients/client-healthlake/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-healthlake/tsconfig.types.json b/clients/client-healthlake/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-healthlake/tsconfig.types.json +++ b/clients/client-healthlake/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-honeycode/.gitignore b/clients/client-honeycode/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-honeycode/.gitignore +++ b/clients/client-honeycode/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-honeycode/package.json b/clients/client-honeycode/package.json index 6720517572ba..0f46427f6a4f 100644 --- a/clients/client-honeycode/package.json +++ b/clients/client-honeycode/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-honeycode", "repository": { "type": "git", diff --git a/clients/client-honeycode/runtimeConfig.browser.ts b/clients/client-honeycode/runtimeConfig.browser.ts deleted file mode 100644 index 72d235fde9eb..000000000000 --- a/clients/client-honeycode/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { HoneycodeClientConfig } from "./HoneycodeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HoneycodeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-honeycode/runtimeConfig.ts b/clients/client-honeycode/runtimeConfig.ts deleted file mode 100644 index 1c551a64be77..000000000000 --- a/clients/client-honeycode/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { HoneycodeClientConfig } from "./HoneycodeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: HoneycodeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-honeycode/Honeycode.ts b/clients/client-honeycode/src/Honeycode.ts similarity index 100% rename from clients/client-honeycode/Honeycode.ts rename to clients/client-honeycode/src/Honeycode.ts diff --git a/clients/client-honeycode/HoneycodeClient.ts b/clients/client-honeycode/src/HoneycodeClient.ts similarity index 100% rename from clients/client-honeycode/HoneycodeClient.ts rename to clients/client-honeycode/src/HoneycodeClient.ts diff --git a/clients/client-honeycode/commands/BatchCreateTableRowsCommand.ts b/clients/client-honeycode/src/commands/BatchCreateTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/BatchCreateTableRowsCommand.ts rename to clients/client-honeycode/src/commands/BatchCreateTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/BatchDeleteTableRowsCommand.ts b/clients/client-honeycode/src/commands/BatchDeleteTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/BatchDeleteTableRowsCommand.ts rename to clients/client-honeycode/src/commands/BatchDeleteTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/BatchUpdateTableRowsCommand.ts b/clients/client-honeycode/src/commands/BatchUpdateTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/BatchUpdateTableRowsCommand.ts rename to clients/client-honeycode/src/commands/BatchUpdateTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/BatchUpsertTableRowsCommand.ts b/clients/client-honeycode/src/commands/BatchUpsertTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/BatchUpsertTableRowsCommand.ts rename to clients/client-honeycode/src/commands/BatchUpsertTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/DescribeTableDataImportJobCommand.ts b/clients/client-honeycode/src/commands/DescribeTableDataImportJobCommand.ts similarity index 100% rename from clients/client-honeycode/commands/DescribeTableDataImportJobCommand.ts rename to clients/client-honeycode/src/commands/DescribeTableDataImportJobCommand.ts diff --git a/clients/client-honeycode/commands/GetScreenDataCommand.ts b/clients/client-honeycode/src/commands/GetScreenDataCommand.ts similarity index 100% rename from clients/client-honeycode/commands/GetScreenDataCommand.ts rename to clients/client-honeycode/src/commands/GetScreenDataCommand.ts diff --git a/clients/client-honeycode/commands/InvokeScreenAutomationCommand.ts b/clients/client-honeycode/src/commands/InvokeScreenAutomationCommand.ts similarity index 100% rename from clients/client-honeycode/commands/InvokeScreenAutomationCommand.ts rename to clients/client-honeycode/src/commands/InvokeScreenAutomationCommand.ts diff --git a/clients/client-honeycode/commands/ListTableColumnsCommand.ts b/clients/client-honeycode/src/commands/ListTableColumnsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/ListTableColumnsCommand.ts rename to clients/client-honeycode/src/commands/ListTableColumnsCommand.ts diff --git a/clients/client-honeycode/commands/ListTableRowsCommand.ts b/clients/client-honeycode/src/commands/ListTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/ListTableRowsCommand.ts rename to clients/client-honeycode/src/commands/ListTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/ListTablesCommand.ts b/clients/client-honeycode/src/commands/ListTablesCommand.ts similarity index 100% rename from clients/client-honeycode/commands/ListTablesCommand.ts rename to clients/client-honeycode/src/commands/ListTablesCommand.ts diff --git a/clients/client-honeycode/commands/QueryTableRowsCommand.ts b/clients/client-honeycode/src/commands/QueryTableRowsCommand.ts similarity index 100% rename from clients/client-honeycode/commands/QueryTableRowsCommand.ts rename to clients/client-honeycode/src/commands/QueryTableRowsCommand.ts diff --git a/clients/client-honeycode/commands/StartTableDataImportJobCommand.ts b/clients/client-honeycode/src/commands/StartTableDataImportJobCommand.ts similarity index 100% rename from clients/client-honeycode/commands/StartTableDataImportJobCommand.ts rename to clients/client-honeycode/src/commands/StartTableDataImportJobCommand.ts diff --git a/clients/client-honeycode/endpoints.ts b/clients/client-honeycode/src/endpoints.ts similarity index 100% rename from clients/client-honeycode/endpoints.ts rename to clients/client-honeycode/src/endpoints.ts diff --git a/clients/client-honeycode/index.ts b/clients/client-honeycode/src/index.ts similarity index 100% rename from clients/client-honeycode/index.ts rename to clients/client-honeycode/src/index.ts diff --git a/clients/client-honeycode/models/index.ts b/clients/client-honeycode/src/models/index.ts similarity index 100% rename from clients/client-honeycode/models/index.ts rename to clients/client-honeycode/src/models/index.ts diff --git a/clients/client-honeycode/models/models_0.ts b/clients/client-honeycode/src/models/models_0.ts similarity index 100% rename from clients/client-honeycode/models/models_0.ts rename to clients/client-honeycode/src/models/models_0.ts diff --git a/clients/client-honeycode/pagination/Interfaces.ts b/clients/client-honeycode/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-honeycode/pagination/Interfaces.ts rename to clients/client-honeycode/src/pagination/Interfaces.ts diff --git a/clients/client-honeycode/pagination/ListTableColumnsPaginator.ts b/clients/client-honeycode/src/pagination/ListTableColumnsPaginator.ts similarity index 100% rename from clients/client-honeycode/pagination/ListTableColumnsPaginator.ts rename to clients/client-honeycode/src/pagination/ListTableColumnsPaginator.ts diff --git a/clients/client-honeycode/pagination/ListTableRowsPaginator.ts b/clients/client-honeycode/src/pagination/ListTableRowsPaginator.ts similarity index 100% rename from clients/client-honeycode/pagination/ListTableRowsPaginator.ts rename to clients/client-honeycode/src/pagination/ListTableRowsPaginator.ts diff --git a/clients/client-honeycode/pagination/ListTablesPaginator.ts b/clients/client-honeycode/src/pagination/ListTablesPaginator.ts similarity index 100% rename from clients/client-honeycode/pagination/ListTablesPaginator.ts rename to clients/client-honeycode/src/pagination/ListTablesPaginator.ts diff --git a/clients/client-honeycode/pagination/QueryTableRowsPaginator.ts b/clients/client-honeycode/src/pagination/QueryTableRowsPaginator.ts similarity index 100% rename from clients/client-honeycode/pagination/QueryTableRowsPaginator.ts rename to clients/client-honeycode/src/pagination/QueryTableRowsPaginator.ts diff --git a/clients/client-honeycode/protocols/Aws_restJson1.ts b/clients/client-honeycode/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-honeycode/protocols/Aws_restJson1.ts rename to clients/client-honeycode/src/protocols/Aws_restJson1.ts diff --git a/clients/client-honeycode/src/runtimeConfig.browser.ts b/clients/client-honeycode/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e92204281184 --- /dev/null +++ b/clients/client-honeycode/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { HoneycodeClientConfig } from "./HoneycodeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HoneycodeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-honeycode/runtimeConfig.native.ts b/clients/client-honeycode/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-honeycode/runtimeConfig.native.ts rename to clients/client-honeycode/src/runtimeConfig.native.ts diff --git a/clients/client-honeycode/runtimeConfig.shared.ts b/clients/client-honeycode/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-honeycode/runtimeConfig.shared.ts rename to clients/client-honeycode/src/runtimeConfig.shared.ts diff --git a/clients/client-honeycode/src/runtimeConfig.ts b/clients/client-honeycode/src/runtimeConfig.ts new file mode 100644 index 000000000000..13150c2bd4ce --- /dev/null +++ b/clients/client-honeycode/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { HoneycodeClientConfig } from "./HoneycodeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: HoneycodeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-honeycode/tsconfig.es.json b/clients/client-honeycode/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-honeycode/tsconfig.es.json +++ b/clients/client-honeycode/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-honeycode/tsconfig.json b/clients/client-honeycode/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-honeycode/tsconfig.json +++ b/clients/client-honeycode/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-honeycode/tsconfig.types.json b/clients/client-honeycode/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-honeycode/tsconfig.types.json +++ b/clients/client-honeycode/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iam/.gitignore b/clients/client-iam/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iam/.gitignore +++ b/clients/client-iam/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iam/package.json b/clients/client-iam/package.json index 81ac7d7afcd3..4e5b13f1fe7b 100644 --- a/clients/client-iam/package.json +++ b/clients/client-iam/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iam", "repository": { "type": "git", diff --git a/clients/client-iam/runtimeConfig.browser.ts b/clients/client-iam/runtimeConfig.browser.ts deleted file mode 100644 index f6e758344c09..000000000000 --- a/clients/client-iam/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IAMClientConfig } from "./IAMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IAMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iam/runtimeConfig.ts b/clients/client-iam/runtimeConfig.ts deleted file mode 100644 index b0e18da6cc0b..000000000000 --- a/clients/client-iam/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IAMClientConfig } from "./IAMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IAMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iam/IAM.ts b/clients/client-iam/src/IAM.ts similarity index 100% rename from clients/client-iam/IAM.ts rename to clients/client-iam/src/IAM.ts diff --git a/clients/client-iam/IAMClient.ts b/clients/client-iam/src/IAMClient.ts similarity index 100% rename from clients/client-iam/IAMClient.ts rename to clients/client-iam/src/IAMClient.ts diff --git a/clients/client-iam/commands/AddClientIDToOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/AddClientIDToOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/AddClientIDToOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/AddClientIDToOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/AddRoleToInstanceProfileCommand.ts b/clients/client-iam/src/commands/AddRoleToInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/AddRoleToInstanceProfileCommand.ts rename to clients/client-iam/src/commands/AddRoleToInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/AddUserToGroupCommand.ts b/clients/client-iam/src/commands/AddUserToGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/AddUserToGroupCommand.ts rename to clients/client-iam/src/commands/AddUserToGroupCommand.ts diff --git a/clients/client-iam/commands/AttachGroupPolicyCommand.ts b/clients/client-iam/src/commands/AttachGroupPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/AttachGroupPolicyCommand.ts rename to clients/client-iam/src/commands/AttachGroupPolicyCommand.ts diff --git a/clients/client-iam/commands/AttachRolePolicyCommand.ts b/clients/client-iam/src/commands/AttachRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/AttachRolePolicyCommand.ts rename to clients/client-iam/src/commands/AttachRolePolicyCommand.ts diff --git a/clients/client-iam/commands/AttachUserPolicyCommand.ts b/clients/client-iam/src/commands/AttachUserPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/AttachUserPolicyCommand.ts rename to clients/client-iam/src/commands/AttachUserPolicyCommand.ts diff --git a/clients/client-iam/commands/ChangePasswordCommand.ts b/clients/client-iam/src/commands/ChangePasswordCommand.ts similarity index 100% rename from clients/client-iam/commands/ChangePasswordCommand.ts rename to clients/client-iam/src/commands/ChangePasswordCommand.ts diff --git a/clients/client-iam/commands/CreateAccessKeyCommand.ts b/clients/client-iam/src/commands/CreateAccessKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateAccessKeyCommand.ts rename to clients/client-iam/src/commands/CreateAccessKeyCommand.ts diff --git a/clients/client-iam/commands/CreateAccountAliasCommand.ts b/clients/client-iam/src/commands/CreateAccountAliasCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateAccountAliasCommand.ts rename to clients/client-iam/src/commands/CreateAccountAliasCommand.ts diff --git a/clients/client-iam/commands/CreateGroupCommand.ts b/clients/client-iam/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateGroupCommand.ts rename to clients/client-iam/src/commands/CreateGroupCommand.ts diff --git a/clients/client-iam/commands/CreateInstanceProfileCommand.ts b/clients/client-iam/src/commands/CreateInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateInstanceProfileCommand.ts rename to clients/client-iam/src/commands/CreateInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/CreateLoginProfileCommand.ts b/clients/client-iam/src/commands/CreateLoginProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateLoginProfileCommand.ts rename to clients/client-iam/src/commands/CreateLoginProfileCommand.ts diff --git a/clients/client-iam/commands/CreateOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/CreateOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/CreateOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/CreatePolicyCommand.ts b/clients/client-iam/src/commands/CreatePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/CreatePolicyCommand.ts rename to clients/client-iam/src/commands/CreatePolicyCommand.ts diff --git a/clients/client-iam/commands/CreatePolicyVersionCommand.ts b/clients/client-iam/src/commands/CreatePolicyVersionCommand.ts similarity index 100% rename from clients/client-iam/commands/CreatePolicyVersionCommand.ts rename to clients/client-iam/src/commands/CreatePolicyVersionCommand.ts diff --git a/clients/client-iam/commands/CreateRoleCommand.ts b/clients/client-iam/src/commands/CreateRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateRoleCommand.ts rename to clients/client-iam/src/commands/CreateRoleCommand.ts diff --git a/clients/client-iam/commands/CreateSAMLProviderCommand.ts b/clients/client-iam/src/commands/CreateSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateSAMLProviderCommand.ts rename to clients/client-iam/src/commands/CreateSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/CreateServiceLinkedRoleCommand.ts b/clients/client-iam/src/commands/CreateServiceLinkedRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateServiceLinkedRoleCommand.ts rename to clients/client-iam/src/commands/CreateServiceLinkedRoleCommand.ts diff --git a/clients/client-iam/commands/CreateServiceSpecificCredentialCommand.ts b/clients/client-iam/src/commands/CreateServiceSpecificCredentialCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateServiceSpecificCredentialCommand.ts rename to clients/client-iam/src/commands/CreateServiceSpecificCredentialCommand.ts diff --git a/clients/client-iam/commands/CreateUserCommand.ts b/clients/client-iam/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateUserCommand.ts rename to clients/client-iam/src/commands/CreateUserCommand.ts diff --git a/clients/client-iam/commands/CreateVirtualMFADeviceCommand.ts b/clients/client-iam/src/commands/CreateVirtualMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/CreateVirtualMFADeviceCommand.ts rename to clients/client-iam/src/commands/CreateVirtualMFADeviceCommand.ts diff --git a/clients/client-iam/commands/DeactivateMFADeviceCommand.ts b/clients/client-iam/src/commands/DeactivateMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/DeactivateMFADeviceCommand.ts rename to clients/client-iam/src/commands/DeactivateMFADeviceCommand.ts diff --git a/clients/client-iam/commands/DeleteAccessKeyCommand.ts b/clients/client-iam/src/commands/DeleteAccessKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteAccessKeyCommand.ts rename to clients/client-iam/src/commands/DeleteAccessKeyCommand.ts diff --git a/clients/client-iam/commands/DeleteAccountAliasCommand.ts b/clients/client-iam/src/commands/DeleteAccountAliasCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteAccountAliasCommand.ts rename to clients/client-iam/src/commands/DeleteAccountAliasCommand.ts diff --git a/clients/client-iam/commands/DeleteAccountPasswordPolicyCommand.ts b/clients/client-iam/src/commands/DeleteAccountPasswordPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteAccountPasswordPolicyCommand.ts rename to clients/client-iam/src/commands/DeleteAccountPasswordPolicyCommand.ts diff --git a/clients/client-iam/commands/DeleteGroupCommand.ts b/clients/client-iam/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteGroupCommand.ts rename to clients/client-iam/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-iam/commands/DeleteGroupPolicyCommand.ts b/clients/client-iam/src/commands/DeleteGroupPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteGroupPolicyCommand.ts rename to clients/client-iam/src/commands/DeleteGroupPolicyCommand.ts diff --git a/clients/client-iam/commands/DeleteInstanceProfileCommand.ts b/clients/client-iam/src/commands/DeleteInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteInstanceProfileCommand.ts rename to clients/client-iam/src/commands/DeleteInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/DeleteLoginProfileCommand.ts b/clients/client-iam/src/commands/DeleteLoginProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteLoginProfileCommand.ts rename to clients/client-iam/src/commands/DeleteLoginProfileCommand.ts diff --git a/clients/client-iam/commands/DeleteOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/DeleteOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/DeleteOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/DeletePolicyCommand.ts b/clients/client-iam/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeletePolicyCommand.ts rename to clients/client-iam/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-iam/commands/DeletePolicyVersionCommand.ts b/clients/client-iam/src/commands/DeletePolicyVersionCommand.ts similarity index 100% rename from clients/client-iam/commands/DeletePolicyVersionCommand.ts rename to clients/client-iam/src/commands/DeletePolicyVersionCommand.ts diff --git a/clients/client-iam/commands/DeleteRoleCommand.ts b/clients/client-iam/src/commands/DeleteRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteRoleCommand.ts rename to clients/client-iam/src/commands/DeleteRoleCommand.ts diff --git a/clients/client-iam/commands/DeleteRolePermissionsBoundaryCommand.ts b/clients/client-iam/src/commands/DeleteRolePermissionsBoundaryCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteRolePermissionsBoundaryCommand.ts rename to clients/client-iam/src/commands/DeleteRolePermissionsBoundaryCommand.ts diff --git a/clients/client-iam/commands/DeleteRolePolicyCommand.ts b/clients/client-iam/src/commands/DeleteRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteRolePolicyCommand.ts rename to clients/client-iam/src/commands/DeleteRolePolicyCommand.ts diff --git a/clients/client-iam/commands/DeleteSAMLProviderCommand.ts b/clients/client-iam/src/commands/DeleteSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteSAMLProviderCommand.ts rename to clients/client-iam/src/commands/DeleteSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/DeleteSSHPublicKeyCommand.ts b/clients/client-iam/src/commands/DeleteSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteSSHPublicKeyCommand.ts rename to clients/client-iam/src/commands/DeleteSSHPublicKeyCommand.ts diff --git a/clients/client-iam/commands/DeleteServerCertificateCommand.ts b/clients/client-iam/src/commands/DeleteServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteServerCertificateCommand.ts rename to clients/client-iam/src/commands/DeleteServerCertificateCommand.ts diff --git a/clients/client-iam/commands/DeleteServiceLinkedRoleCommand.ts b/clients/client-iam/src/commands/DeleteServiceLinkedRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteServiceLinkedRoleCommand.ts rename to clients/client-iam/src/commands/DeleteServiceLinkedRoleCommand.ts diff --git a/clients/client-iam/commands/DeleteServiceSpecificCredentialCommand.ts b/clients/client-iam/src/commands/DeleteServiceSpecificCredentialCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteServiceSpecificCredentialCommand.ts rename to clients/client-iam/src/commands/DeleteServiceSpecificCredentialCommand.ts diff --git a/clients/client-iam/commands/DeleteSigningCertificateCommand.ts b/clients/client-iam/src/commands/DeleteSigningCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteSigningCertificateCommand.ts rename to clients/client-iam/src/commands/DeleteSigningCertificateCommand.ts diff --git a/clients/client-iam/commands/DeleteUserCommand.ts b/clients/client-iam/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteUserCommand.ts rename to clients/client-iam/src/commands/DeleteUserCommand.ts diff --git a/clients/client-iam/commands/DeleteUserPermissionsBoundaryCommand.ts b/clients/client-iam/src/commands/DeleteUserPermissionsBoundaryCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteUserPermissionsBoundaryCommand.ts rename to clients/client-iam/src/commands/DeleteUserPermissionsBoundaryCommand.ts diff --git a/clients/client-iam/commands/DeleteUserPolicyCommand.ts b/clients/client-iam/src/commands/DeleteUserPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteUserPolicyCommand.ts rename to clients/client-iam/src/commands/DeleteUserPolicyCommand.ts diff --git a/clients/client-iam/commands/DeleteVirtualMFADeviceCommand.ts b/clients/client-iam/src/commands/DeleteVirtualMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/DeleteVirtualMFADeviceCommand.ts rename to clients/client-iam/src/commands/DeleteVirtualMFADeviceCommand.ts diff --git a/clients/client-iam/commands/DetachGroupPolicyCommand.ts b/clients/client-iam/src/commands/DetachGroupPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DetachGroupPolicyCommand.ts rename to clients/client-iam/src/commands/DetachGroupPolicyCommand.ts diff --git a/clients/client-iam/commands/DetachRolePolicyCommand.ts b/clients/client-iam/src/commands/DetachRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DetachRolePolicyCommand.ts rename to clients/client-iam/src/commands/DetachRolePolicyCommand.ts diff --git a/clients/client-iam/commands/DetachUserPolicyCommand.ts b/clients/client-iam/src/commands/DetachUserPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/DetachUserPolicyCommand.ts rename to clients/client-iam/src/commands/DetachUserPolicyCommand.ts diff --git a/clients/client-iam/commands/EnableMFADeviceCommand.ts b/clients/client-iam/src/commands/EnableMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/EnableMFADeviceCommand.ts rename to clients/client-iam/src/commands/EnableMFADeviceCommand.ts diff --git a/clients/client-iam/commands/GenerateCredentialReportCommand.ts b/clients/client-iam/src/commands/GenerateCredentialReportCommand.ts similarity index 100% rename from clients/client-iam/commands/GenerateCredentialReportCommand.ts rename to clients/client-iam/src/commands/GenerateCredentialReportCommand.ts diff --git a/clients/client-iam/commands/GenerateOrganizationsAccessReportCommand.ts b/clients/client-iam/src/commands/GenerateOrganizationsAccessReportCommand.ts similarity index 100% rename from clients/client-iam/commands/GenerateOrganizationsAccessReportCommand.ts rename to clients/client-iam/src/commands/GenerateOrganizationsAccessReportCommand.ts diff --git a/clients/client-iam/commands/GenerateServiceLastAccessedDetailsCommand.ts b/clients/client-iam/src/commands/GenerateServiceLastAccessedDetailsCommand.ts similarity index 100% rename from clients/client-iam/commands/GenerateServiceLastAccessedDetailsCommand.ts rename to clients/client-iam/src/commands/GenerateServiceLastAccessedDetailsCommand.ts diff --git a/clients/client-iam/commands/GetAccessKeyLastUsedCommand.ts b/clients/client-iam/src/commands/GetAccessKeyLastUsedCommand.ts similarity index 100% rename from clients/client-iam/commands/GetAccessKeyLastUsedCommand.ts rename to clients/client-iam/src/commands/GetAccessKeyLastUsedCommand.ts diff --git a/clients/client-iam/commands/GetAccountAuthorizationDetailsCommand.ts b/clients/client-iam/src/commands/GetAccountAuthorizationDetailsCommand.ts similarity index 100% rename from clients/client-iam/commands/GetAccountAuthorizationDetailsCommand.ts rename to clients/client-iam/src/commands/GetAccountAuthorizationDetailsCommand.ts diff --git a/clients/client-iam/commands/GetAccountPasswordPolicyCommand.ts b/clients/client-iam/src/commands/GetAccountPasswordPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetAccountPasswordPolicyCommand.ts rename to clients/client-iam/src/commands/GetAccountPasswordPolicyCommand.ts diff --git a/clients/client-iam/commands/GetAccountSummaryCommand.ts b/clients/client-iam/src/commands/GetAccountSummaryCommand.ts similarity index 100% rename from clients/client-iam/commands/GetAccountSummaryCommand.ts rename to clients/client-iam/src/commands/GetAccountSummaryCommand.ts diff --git a/clients/client-iam/commands/GetContextKeysForCustomPolicyCommand.ts b/clients/client-iam/src/commands/GetContextKeysForCustomPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetContextKeysForCustomPolicyCommand.ts rename to clients/client-iam/src/commands/GetContextKeysForCustomPolicyCommand.ts diff --git a/clients/client-iam/commands/GetContextKeysForPrincipalPolicyCommand.ts b/clients/client-iam/src/commands/GetContextKeysForPrincipalPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetContextKeysForPrincipalPolicyCommand.ts rename to clients/client-iam/src/commands/GetContextKeysForPrincipalPolicyCommand.ts diff --git a/clients/client-iam/commands/GetCredentialReportCommand.ts b/clients/client-iam/src/commands/GetCredentialReportCommand.ts similarity index 100% rename from clients/client-iam/commands/GetCredentialReportCommand.ts rename to clients/client-iam/src/commands/GetCredentialReportCommand.ts diff --git a/clients/client-iam/commands/GetGroupCommand.ts b/clients/client-iam/src/commands/GetGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/GetGroupCommand.ts rename to clients/client-iam/src/commands/GetGroupCommand.ts diff --git a/clients/client-iam/commands/GetGroupPolicyCommand.ts b/clients/client-iam/src/commands/GetGroupPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetGroupPolicyCommand.ts rename to clients/client-iam/src/commands/GetGroupPolicyCommand.ts diff --git a/clients/client-iam/commands/GetInstanceProfileCommand.ts b/clients/client-iam/src/commands/GetInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/GetInstanceProfileCommand.ts rename to clients/client-iam/src/commands/GetInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/GetLoginProfileCommand.ts b/clients/client-iam/src/commands/GetLoginProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/GetLoginProfileCommand.ts rename to clients/client-iam/src/commands/GetLoginProfileCommand.ts diff --git a/clients/client-iam/commands/GetOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/GetOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/GetOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/GetOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/GetOrganizationsAccessReportCommand.ts b/clients/client-iam/src/commands/GetOrganizationsAccessReportCommand.ts similarity index 100% rename from clients/client-iam/commands/GetOrganizationsAccessReportCommand.ts rename to clients/client-iam/src/commands/GetOrganizationsAccessReportCommand.ts diff --git a/clients/client-iam/commands/GetPolicyCommand.ts b/clients/client-iam/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetPolicyCommand.ts rename to clients/client-iam/src/commands/GetPolicyCommand.ts diff --git a/clients/client-iam/commands/GetPolicyVersionCommand.ts b/clients/client-iam/src/commands/GetPolicyVersionCommand.ts similarity index 100% rename from clients/client-iam/commands/GetPolicyVersionCommand.ts rename to clients/client-iam/src/commands/GetPolicyVersionCommand.ts diff --git a/clients/client-iam/commands/GetRoleCommand.ts b/clients/client-iam/src/commands/GetRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/GetRoleCommand.ts rename to clients/client-iam/src/commands/GetRoleCommand.ts diff --git a/clients/client-iam/commands/GetRolePolicyCommand.ts b/clients/client-iam/src/commands/GetRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetRolePolicyCommand.ts rename to clients/client-iam/src/commands/GetRolePolicyCommand.ts diff --git a/clients/client-iam/commands/GetSAMLProviderCommand.ts b/clients/client-iam/src/commands/GetSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/GetSAMLProviderCommand.ts rename to clients/client-iam/src/commands/GetSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/GetSSHPublicKeyCommand.ts b/clients/client-iam/src/commands/GetSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetSSHPublicKeyCommand.ts rename to clients/client-iam/src/commands/GetSSHPublicKeyCommand.ts diff --git a/clients/client-iam/commands/GetServerCertificateCommand.ts b/clients/client-iam/src/commands/GetServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/GetServerCertificateCommand.ts rename to clients/client-iam/src/commands/GetServerCertificateCommand.ts diff --git a/clients/client-iam/commands/GetServiceLastAccessedDetailsCommand.ts b/clients/client-iam/src/commands/GetServiceLastAccessedDetailsCommand.ts similarity index 100% rename from clients/client-iam/commands/GetServiceLastAccessedDetailsCommand.ts rename to clients/client-iam/src/commands/GetServiceLastAccessedDetailsCommand.ts diff --git a/clients/client-iam/commands/GetServiceLastAccessedDetailsWithEntitiesCommand.ts b/clients/client-iam/src/commands/GetServiceLastAccessedDetailsWithEntitiesCommand.ts similarity index 100% rename from clients/client-iam/commands/GetServiceLastAccessedDetailsWithEntitiesCommand.ts rename to clients/client-iam/src/commands/GetServiceLastAccessedDetailsWithEntitiesCommand.ts diff --git a/clients/client-iam/commands/GetServiceLinkedRoleDeletionStatusCommand.ts b/clients/client-iam/src/commands/GetServiceLinkedRoleDeletionStatusCommand.ts similarity index 100% rename from clients/client-iam/commands/GetServiceLinkedRoleDeletionStatusCommand.ts rename to clients/client-iam/src/commands/GetServiceLinkedRoleDeletionStatusCommand.ts diff --git a/clients/client-iam/commands/GetUserCommand.ts b/clients/client-iam/src/commands/GetUserCommand.ts similarity index 100% rename from clients/client-iam/commands/GetUserCommand.ts rename to clients/client-iam/src/commands/GetUserCommand.ts diff --git a/clients/client-iam/commands/GetUserPolicyCommand.ts b/clients/client-iam/src/commands/GetUserPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/GetUserPolicyCommand.ts rename to clients/client-iam/src/commands/GetUserPolicyCommand.ts diff --git a/clients/client-iam/commands/ListAccessKeysCommand.ts b/clients/client-iam/src/commands/ListAccessKeysCommand.ts similarity index 100% rename from clients/client-iam/commands/ListAccessKeysCommand.ts rename to clients/client-iam/src/commands/ListAccessKeysCommand.ts diff --git a/clients/client-iam/commands/ListAccountAliasesCommand.ts b/clients/client-iam/src/commands/ListAccountAliasesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListAccountAliasesCommand.ts rename to clients/client-iam/src/commands/ListAccountAliasesCommand.ts diff --git a/clients/client-iam/commands/ListAttachedGroupPoliciesCommand.ts b/clients/client-iam/src/commands/ListAttachedGroupPoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListAttachedGroupPoliciesCommand.ts rename to clients/client-iam/src/commands/ListAttachedGroupPoliciesCommand.ts diff --git a/clients/client-iam/commands/ListAttachedRolePoliciesCommand.ts b/clients/client-iam/src/commands/ListAttachedRolePoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListAttachedRolePoliciesCommand.ts rename to clients/client-iam/src/commands/ListAttachedRolePoliciesCommand.ts diff --git a/clients/client-iam/commands/ListAttachedUserPoliciesCommand.ts b/clients/client-iam/src/commands/ListAttachedUserPoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListAttachedUserPoliciesCommand.ts rename to clients/client-iam/src/commands/ListAttachedUserPoliciesCommand.ts diff --git a/clients/client-iam/commands/ListEntitiesForPolicyCommand.ts b/clients/client-iam/src/commands/ListEntitiesForPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/ListEntitiesForPolicyCommand.ts rename to clients/client-iam/src/commands/ListEntitiesForPolicyCommand.ts diff --git a/clients/client-iam/commands/ListGroupPoliciesCommand.ts b/clients/client-iam/src/commands/ListGroupPoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListGroupPoliciesCommand.ts rename to clients/client-iam/src/commands/ListGroupPoliciesCommand.ts diff --git a/clients/client-iam/commands/ListGroupsCommand.ts b/clients/client-iam/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListGroupsCommand.ts rename to clients/client-iam/src/commands/ListGroupsCommand.ts diff --git a/clients/client-iam/commands/ListGroupsForUserCommand.ts b/clients/client-iam/src/commands/ListGroupsForUserCommand.ts similarity index 100% rename from clients/client-iam/commands/ListGroupsForUserCommand.ts rename to clients/client-iam/src/commands/ListGroupsForUserCommand.ts diff --git a/clients/client-iam/commands/ListInstanceProfileTagsCommand.ts b/clients/client-iam/src/commands/ListInstanceProfileTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListInstanceProfileTagsCommand.ts rename to clients/client-iam/src/commands/ListInstanceProfileTagsCommand.ts diff --git a/clients/client-iam/commands/ListInstanceProfilesCommand.ts b/clients/client-iam/src/commands/ListInstanceProfilesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListInstanceProfilesCommand.ts rename to clients/client-iam/src/commands/ListInstanceProfilesCommand.ts diff --git a/clients/client-iam/commands/ListInstanceProfilesForRoleCommand.ts b/clients/client-iam/src/commands/ListInstanceProfilesForRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/ListInstanceProfilesForRoleCommand.ts rename to clients/client-iam/src/commands/ListInstanceProfilesForRoleCommand.ts diff --git a/clients/client-iam/commands/ListMFADeviceTagsCommand.ts b/clients/client-iam/src/commands/ListMFADeviceTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListMFADeviceTagsCommand.ts rename to clients/client-iam/src/commands/ListMFADeviceTagsCommand.ts diff --git a/clients/client-iam/commands/ListMFADevicesCommand.ts b/clients/client-iam/src/commands/ListMFADevicesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListMFADevicesCommand.ts rename to clients/client-iam/src/commands/ListMFADevicesCommand.ts diff --git a/clients/client-iam/commands/ListOpenIDConnectProviderTagsCommand.ts b/clients/client-iam/src/commands/ListOpenIDConnectProviderTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListOpenIDConnectProviderTagsCommand.ts rename to clients/client-iam/src/commands/ListOpenIDConnectProviderTagsCommand.ts diff --git a/clients/client-iam/commands/ListOpenIDConnectProvidersCommand.ts b/clients/client-iam/src/commands/ListOpenIDConnectProvidersCommand.ts similarity index 100% rename from clients/client-iam/commands/ListOpenIDConnectProvidersCommand.ts rename to clients/client-iam/src/commands/ListOpenIDConnectProvidersCommand.ts diff --git a/clients/client-iam/commands/ListPoliciesCommand.ts b/clients/client-iam/src/commands/ListPoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListPoliciesCommand.ts rename to clients/client-iam/src/commands/ListPoliciesCommand.ts diff --git a/clients/client-iam/commands/ListPoliciesGrantingServiceAccessCommand.ts b/clients/client-iam/src/commands/ListPoliciesGrantingServiceAccessCommand.ts similarity index 100% rename from clients/client-iam/commands/ListPoliciesGrantingServiceAccessCommand.ts rename to clients/client-iam/src/commands/ListPoliciesGrantingServiceAccessCommand.ts diff --git a/clients/client-iam/commands/ListPolicyTagsCommand.ts b/clients/client-iam/src/commands/ListPolicyTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListPolicyTagsCommand.ts rename to clients/client-iam/src/commands/ListPolicyTagsCommand.ts diff --git a/clients/client-iam/commands/ListPolicyVersionsCommand.ts b/clients/client-iam/src/commands/ListPolicyVersionsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListPolicyVersionsCommand.ts rename to clients/client-iam/src/commands/ListPolicyVersionsCommand.ts diff --git a/clients/client-iam/commands/ListRolePoliciesCommand.ts b/clients/client-iam/src/commands/ListRolePoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListRolePoliciesCommand.ts rename to clients/client-iam/src/commands/ListRolePoliciesCommand.ts diff --git a/clients/client-iam/commands/ListRoleTagsCommand.ts b/clients/client-iam/src/commands/ListRoleTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListRoleTagsCommand.ts rename to clients/client-iam/src/commands/ListRoleTagsCommand.ts diff --git a/clients/client-iam/commands/ListRolesCommand.ts b/clients/client-iam/src/commands/ListRolesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListRolesCommand.ts rename to clients/client-iam/src/commands/ListRolesCommand.ts diff --git a/clients/client-iam/commands/ListSAMLProviderTagsCommand.ts b/clients/client-iam/src/commands/ListSAMLProviderTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListSAMLProviderTagsCommand.ts rename to clients/client-iam/src/commands/ListSAMLProviderTagsCommand.ts diff --git a/clients/client-iam/commands/ListSAMLProvidersCommand.ts b/clients/client-iam/src/commands/ListSAMLProvidersCommand.ts similarity index 100% rename from clients/client-iam/commands/ListSAMLProvidersCommand.ts rename to clients/client-iam/src/commands/ListSAMLProvidersCommand.ts diff --git a/clients/client-iam/commands/ListSSHPublicKeysCommand.ts b/clients/client-iam/src/commands/ListSSHPublicKeysCommand.ts similarity index 100% rename from clients/client-iam/commands/ListSSHPublicKeysCommand.ts rename to clients/client-iam/src/commands/ListSSHPublicKeysCommand.ts diff --git a/clients/client-iam/commands/ListServerCertificateTagsCommand.ts b/clients/client-iam/src/commands/ListServerCertificateTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListServerCertificateTagsCommand.ts rename to clients/client-iam/src/commands/ListServerCertificateTagsCommand.ts diff --git a/clients/client-iam/commands/ListServerCertificatesCommand.ts b/clients/client-iam/src/commands/ListServerCertificatesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListServerCertificatesCommand.ts rename to clients/client-iam/src/commands/ListServerCertificatesCommand.ts diff --git a/clients/client-iam/commands/ListServiceSpecificCredentialsCommand.ts b/clients/client-iam/src/commands/ListServiceSpecificCredentialsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListServiceSpecificCredentialsCommand.ts rename to clients/client-iam/src/commands/ListServiceSpecificCredentialsCommand.ts diff --git a/clients/client-iam/commands/ListSigningCertificatesCommand.ts b/clients/client-iam/src/commands/ListSigningCertificatesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListSigningCertificatesCommand.ts rename to clients/client-iam/src/commands/ListSigningCertificatesCommand.ts diff --git a/clients/client-iam/commands/ListUserPoliciesCommand.ts b/clients/client-iam/src/commands/ListUserPoliciesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListUserPoliciesCommand.ts rename to clients/client-iam/src/commands/ListUserPoliciesCommand.ts diff --git a/clients/client-iam/commands/ListUserTagsCommand.ts b/clients/client-iam/src/commands/ListUserTagsCommand.ts similarity index 100% rename from clients/client-iam/commands/ListUserTagsCommand.ts rename to clients/client-iam/src/commands/ListUserTagsCommand.ts diff --git a/clients/client-iam/commands/ListUsersCommand.ts b/clients/client-iam/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-iam/commands/ListUsersCommand.ts rename to clients/client-iam/src/commands/ListUsersCommand.ts diff --git a/clients/client-iam/commands/ListVirtualMFADevicesCommand.ts b/clients/client-iam/src/commands/ListVirtualMFADevicesCommand.ts similarity index 100% rename from clients/client-iam/commands/ListVirtualMFADevicesCommand.ts rename to clients/client-iam/src/commands/ListVirtualMFADevicesCommand.ts diff --git a/clients/client-iam/commands/PutGroupPolicyCommand.ts b/clients/client-iam/src/commands/PutGroupPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/PutGroupPolicyCommand.ts rename to clients/client-iam/src/commands/PutGroupPolicyCommand.ts diff --git a/clients/client-iam/commands/PutRolePermissionsBoundaryCommand.ts b/clients/client-iam/src/commands/PutRolePermissionsBoundaryCommand.ts similarity index 100% rename from clients/client-iam/commands/PutRolePermissionsBoundaryCommand.ts rename to clients/client-iam/src/commands/PutRolePermissionsBoundaryCommand.ts diff --git a/clients/client-iam/commands/PutRolePolicyCommand.ts b/clients/client-iam/src/commands/PutRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/PutRolePolicyCommand.ts rename to clients/client-iam/src/commands/PutRolePolicyCommand.ts diff --git a/clients/client-iam/commands/PutUserPermissionsBoundaryCommand.ts b/clients/client-iam/src/commands/PutUserPermissionsBoundaryCommand.ts similarity index 100% rename from clients/client-iam/commands/PutUserPermissionsBoundaryCommand.ts rename to clients/client-iam/src/commands/PutUserPermissionsBoundaryCommand.ts diff --git a/clients/client-iam/commands/PutUserPolicyCommand.ts b/clients/client-iam/src/commands/PutUserPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/PutUserPolicyCommand.ts rename to clients/client-iam/src/commands/PutUserPolicyCommand.ts diff --git a/clients/client-iam/commands/RemoveClientIDFromOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/RemoveClientIDFromOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/RemoveClientIDFromOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/RemoveClientIDFromOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/RemoveRoleFromInstanceProfileCommand.ts b/clients/client-iam/src/commands/RemoveRoleFromInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/RemoveRoleFromInstanceProfileCommand.ts rename to clients/client-iam/src/commands/RemoveRoleFromInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/RemoveUserFromGroupCommand.ts b/clients/client-iam/src/commands/RemoveUserFromGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/RemoveUserFromGroupCommand.ts rename to clients/client-iam/src/commands/RemoveUserFromGroupCommand.ts diff --git a/clients/client-iam/commands/ResetServiceSpecificCredentialCommand.ts b/clients/client-iam/src/commands/ResetServiceSpecificCredentialCommand.ts similarity index 100% rename from clients/client-iam/commands/ResetServiceSpecificCredentialCommand.ts rename to clients/client-iam/src/commands/ResetServiceSpecificCredentialCommand.ts diff --git a/clients/client-iam/commands/ResyncMFADeviceCommand.ts b/clients/client-iam/src/commands/ResyncMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/ResyncMFADeviceCommand.ts rename to clients/client-iam/src/commands/ResyncMFADeviceCommand.ts diff --git a/clients/client-iam/commands/SetDefaultPolicyVersionCommand.ts b/clients/client-iam/src/commands/SetDefaultPolicyVersionCommand.ts similarity index 100% rename from clients/client-iam/commands/SetDefaultPolicyVersionCommand.ts rename to clients/client-iam/src/commands/SetDefaultPolicyVersionCommand.ts diff --git a/clients/client-iam/commands/SetSecurityTokenServicePreferencesCommand.ts b/clients/client-iam/src/commands/SetSecurityTokenServicePreferencesCommand.ts similarity index 100% rename from clients/client-iam/commands/SetSecurityTokenServicePreferencesCommand.ts rename to clients/client-iam/src/commands/SetSecurityTokenServicePreferencesCommand.ts diff --git a/clients/client-iam/commands/SimulateCustomPolicyCommand.ts b/clients/client-iam/src/commands/SimulateCustomPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/SimulateCustomPolicyCommand.ts rename to clients/client-iam/src/commands/SimulateCustomPolicyCommand.ts diff --git a/clients/client-iam/commands/SimulatePrincipalPolicyCommand.ts b/clients/client-iam/src/commands/SimulatePrincipalPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/SimulatePrincipalPolicyCommand.ts rename to clients/client-iam/src/commands/SimulatePrincipalPolicyCommand.ts diff --git a/clients/client-iam/commands/TagInstanceProfileCommand.ts b/clients/client-iam/src/commands/TagInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/TagInstanceProfileCommand.ts rename to clients/client-iam/src/commands/TagInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/TagMFADeviceCommand.ts b/clients/client-iam/src/commands/TagMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/TagMFADeviceCommand.ts rename to clients/client-iam/src/commands/TagMFADeviceCommand.ts diff --git a/clients/client-iam/commands/TagOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/TagOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/TagOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/TagOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/TagPolicyCommand.ts b/clients/client-iam/src/commands/TagPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/TagPolicyCommand.ts rename to clients/client-iam/src/commands/TagPolicyCommand.ts diff --git a/clients/client-iam/commands/TagRoleCommand.ts b/clients/client-iam/src/commands/TagRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/TagRoleCommand.ts rename to clients/client-iam/src/commands/TagRoleCommand.ts diff --git a/clients/client-iam/commands/TagSAMLProviderCommand.ts b/clients/client-iam/src/commands/TagSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/TagSAMLProviderCommand.ts rename to clients/client-iam/src/commands/TagSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/TagServerCertificateCommand.ts b/clients/client-iam/src/commands/TagServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/TagServerCertificateCommand.ts rename to clients/client-iam/src/commands/TagServerCertificateCommand.ts diff --git a/clients/client-iam/commands/TagUserCommand.ts b/clients/client-iam/src/commands/TagUserCommand.ts similarity index 100% rename from clients/client-iam/commands/TagUserCommand.ts rename to clients/client-iam/src/commands/TagUserCommand.ts diff --git a/clients/client-iam/commands/UntagInstanceProfileCommand.ts b/clients/client-iam/src/commands/UntagInstanceProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagInstanceProfileCommand.ts rename to clients/client-iam/src/commands/UntagInstanceProfileCommand.ts diff --git a/clients/client-iam/commands/UntagMFADeviceCommand.ts b/clients/client-iam/src/commands/UntagMFADeviceCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagMFADeviceCommand.ts rename to clients/client-iam/src/commands/UntagMFADeviceCommand.ts diff --git a/clients/client-iam/commands/UntagOpenIDConnectProviderCommand.ts b/clients/client-iam/src/commands/UntagOpenIDConnectProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagOpenIDConnectProviderCommand.ts rename to clients/client-iam/src/commands/UntagOpenIDConnectProviderCommand.ts diff --git a/clients/client-iam/commands/UntagPolicyCommand.ts b/clients/client-iam/src/commands/UntagPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagPolicyCommand.ts rename to clients/client-iam/src/commands/UntagPolicyCommand.ts diff --git a/clients/client-iam/commands/UntagRoleCommand.ts b/clients/client-iam/src/commands/UntagRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagRoleCommand.ts rename to clients/client-iam/src/commands/UntagRoleCommand.ts diff --git a/clients/client-iam/commands/UntagSAMLProviderCommand.ts b/clients/client-iam/src/commands/UntagSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagSAMLProviderCommand.ts rename to clients/client-iam/src/commands/UntagSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/UntagServerCertificateCommand.ts b/clients/client-iam/src/commands/UntagServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagServerCertificateCommand.ts rename to clients/client-iam/src/commands/UntagServerCertificateCommand.ts diff --git a/clients/client-iam/commands/UntagUserCommand.ts b/clients/client-iam/src/commands/UntagUserCommand.ts similarity index 100% rename from clients/client-iam/commands/UntagUserCommand.ts rename to clients/client-iam/src/commands/UntagUserCommand.ts diff --git a/clients/client-iam/commands/UpdateAccessKeyCommand.ts b/clients/client-iam/src/commands/UpdateAccessKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateAccessKeyCommand.ts rename to clients/client-iam/src/commands/UpdateAccessKeyCommand.ts diff --git a/clients/client-iam/commands/UpdateAccountPasswordPolicyCommand.ts b/clients/client-iam/src/commands/UpdateAccountPasswordPolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateAccountPasswordPolicyCommand.ts rename to clients/client-iam/src/commands/UpdateAccountPasswordPolicyCommand.ts diff --git a/clients/client-iam/commands/UpdateAssumeRolePolicyCommand.ts b/clients/client-iam/src/commands/UpdateAssumeRolePolicyCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateAssumeRolePolicyCommand.ts rename to clients/client-iam/src/commands/UpdateAssumeRolePolicyCommand.ts diff --git a/clients/client-iam/commands/UpdateGroupCommand.ts b/clients/client-iam/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateGroupCommand.ts rename to clients/client-iam/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-iam/commands/UpdateLoginProfileCommand.ts b/clients/client-iam/src/commands/UpdateLoginProfileCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateLoginProfileCommand.ts rename to clients/client-iam/src/commands/UpdateLoginProfileCommand.ts diff --git a/clients/client-iam/commands/UpdateOpenIDConnectProviderThumbprintCommand.ts b/clients/client-iam/src/commands/UpdateOpenIDConnectProviderThumbprintCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateOpenIDConnectProviderThumbprintCommand.ts rename to clients/client-iam/src/commands/UpdateOpenIDConnectProviderThumbprintCommand.ts diff --git a/clients/client-iam/commands/UpdateRoleCommand.ts b/clients/client-iam/src/commands/UpdateRoleCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateRoleCommand.ts rename to clients/client-iam/src/commands/UpdateRoleCommand.ts diff --git a/clients/client-iam/commands/UpdateRoleDescriptionCommand.ts b/clients/client-iam/src/commands/UpdateRoleDescriptionCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateRoleDescriptionCommand.ts rename to clients/client-iam/src/commands/UpdateRoleDescriptionCommand.ts diff --git a/clients/client-iam/commands/UpdateSAMLProviderCommand.ts b/clients/client-iam/src/commands/UpdateSAMLProviderCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateSAMLProviderCommand.ts rename to clients/client-iam/src/commands/UpdateSAMLProviderCommand.ts diff --git a/clients/client-iam/commands/UpdateSSHPublicKeyCommand.ts b/clients/client-iam/src/commands/UpdateSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateSSHPublicKeyCommand.ts rename to clients/client-iam/src/commands/UpdateSSHPublicKeyCommand.ts diff --git a/clients/client-iam/commands/UpdateServerCertificateCommand.ts b/clients/client-iam/src/commands/UpdateServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateServerCertificateCommand.ts rename to clients/client-iam/src/commands/UpdateServerCertificateCommand.ts diff --git a/clients/client-iam/commands/UpdateServiceSpecificCredentialCommand.ts b/clients/client-iam/src/commands/UpdateServiceSpecificCredentialCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateServiceSpecificCredentialCommand.ts rename to clients/client-iam/src/commands/UpdateServiceSpecificCredentialCommand.ts diff --git a/clients/client-iam/commands/UpdateSigningCertificateCommand.ts b/clients/client-iam/src/commands/UpdateSigningCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateSigningCertificateCommand.ts rename to clients/client-iam/src/commands/UpdateSigningCertificateCommand.ts diff --git a/clients/client-iam/commands/UpdateUserCommand.ts b/clients/client-iam/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-iam/commands/UpdateUserCommand.ts rename to clients/client-iam/src/commands/UpdateUserCommand.ts diff --git a/clients/client-iam/commands/UploadSSHPublicKeyCommand.ts b/clients/client-iam/src/commands/UploadSSHPublicKeyCommand.ts similarity index 100% rename from clients/client-iam/commands/UploadSSHPublicKeyCommand.ts rename to clients/client-iam/src/commands/UploadSSHPublicKeyCommand.ts diff --git a/clients/client-iam/commands/UploadServerCertificateCommand.ts b/clients/client-iam/src/commands/UploadServerCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/UploadServerCertificateCommand.ts rename to clients/client-iam/src/commands/UploadServerCertificateCommand.ts diff --git a/clients/client-iam/commands/UploadSigningCertificateCommand.ts b/clients/client-iam/src/commands/UploadSigningCertificateCommand.ts similarity index 100% rename from clients/client-iam/commands/UploadSigningCertificateCommand.ts rename to clients/client-iam/src/commands/UploadSigningCertificateCommand.ts diff --git a/clients/client-iam/endpoints.ts b/clients/client-iam/src/endpoints.ts similarity index 100% rename from clients/client-iam/endpoints.ts rename to clients/client-iam/src/endpoints.ts diff --git a/clients/client-iam/index.ts b/clients/client-iam/src/index.ts similarity index 100% rename from clients/client-iam/index.ts rename to clients/client-iam/src/index.ts diff --git a/clients/client-iam/models/index.ts b/clients/client-iam/src/models/index.ts similarity index 100% rename from clients/client-iam/models/index.ts rename to clients/client-iam/src/models/index.ts diff --git a/clients/client-iam/models/models_0.ts b/clients/client-iam/src/models/models_0.ts similarity index 100% rename from clients/client-iam/models/models_0.ts rename to clients/client-iam/src/models/models_0.ts diff --git a/clients/client-iam/models/models_1.ts b/clients/client-iam/src/models/models_1.ts similarity index 100% rename from clients/client-iam/models/models_1.ts rename to clients/client-iam/src/models/models_1.ts diff --git a/clients/client-iam/pagination/GetAccountAuthorizationDetailsPaginator.ts b/clients/client-iam/src/pagination/GetAccountAuthorizationDetailsPaginator.ts similarity index 100% rename from clients/client-iam/pagination/GetAccountAuthorizationDetailsPaginator.ts rename to clients/client-iam/src/pagination/GetAccountAuthorizationDetailsPaginator.ts diff --git a/clients/client-iam/pagination/GetGroupPaginator.ts b/clients/client-iam/src/pagination/GetGroupPaginator.ts similarity index 100% rename from clients/client-iam/pagination/GetGroupPaginator.ts rename to clients/client-iam/src/pagination/GetGroupPaginator.ts diff --git a/clients/client-iam/pagination/Interfaces.ts b/clients/client-iam/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iam/pagination/Interfaces.ts rename to clients/client-iam/src/pagination/Interfaces.ts diff --git a/clients/client-iam/pagination/ListAccessKeysPaginator.ts b/clients/client-iam/src/pagination/ListAccessKeysPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListAccessKeysPaginator.ts rename to clients/client-iam/src/pagination/ListAccessKeysPaginator.ts diff --git a/clients/client-iam/pagination/ListAccountAliasesPaginator.ts b/clients/client-iam/src/pagination/ListAccountAliasesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListAccountAliasesPaginator.ts rename to clients/client-iam/src/pagination/ListAccountAliasesPaginator.ts diff --git a/clients/client-iam/pagination/ListAttachedGroupPoliciesPaginator.ts b/clients/client-iam/src/pagination/ListAttachedGroupPoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListAttachedGroupPoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListAttachedGroupPoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListAttachedRolePoliciesPaginator.ts b/clients/client-iam/src/pagination/ListAttachedRolePoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListAttachedRolePoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListAttachedRolePoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListAttachedUserPoliciesPaginator.ts b/clients/client-iam/src/pagination/ListAttachedUserPoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListAttachedUserPoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListAttachedUserPoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListEntitiesForPolicyPaginator.ts b/clients/client-iam/src/pagination/ListEntitiesForPolicyPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListEntitiesForPolicyPaginator.ts rename to clients/client-iam/src/pagination/ListEntitiesForPolicyPaginator.ts diff --git a/clients/client-iam/pagination/ListGroupPoliciesPaginator.ts b/clients/client-iam/src/pagination/ListGroupPoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListGroupPoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListGroupPoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListGroupsForUserPaginator.ts b/clients/client-iam/src/pagination/ListGroupsForUserPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListGroupsForUserPaginator.ts rename to clients/client-iam/src/pagination/ListGroupsForUserPaginator.ts diff --git a/clients/client-iam/pagination/ListGroupsPaginator.ts b/clients/client-iam/src/pagination/ListGroupsPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListGroupsPaginator.ts rename to clients/client-iam/src/pagination/ListGroupsPaginator.ts diff --git a/clients/client-iam/pagination/ListInstanceProfilesForRolePaginator.ts b/clients/client-iam/src/pagination/ListInstanceProfilesForRolePaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListInstanceProfilesForRolePaginator.ts rename to clients/client-iam/src/pagination/ListInstanceProfilesForRolePaginator.ts diff --git a/clients/client-iam/pagination/ListInstanceProfilesPaginator.ts b/clients/client-iam/src/pagination/ListInstanceProfilesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListInstanceProfilesPaginator.ts rename to clients/client-iam/src/pagination/ListInstanceProfilesPaginator.ts diff --git a/clients/client-iam/pagination/ListMFADevicesPaginator.ts b/clients/client-iam/src/pagination/ListMFADevicesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListMFADevicesPaginator.ts rename to clients/client-iam/src/pagination/ListMFADevicesPaginator.ts diff --git a/clients/client-iam/pagination/ListPoliciesPaginator.ts b/clients/client-iam/src/pagination/ListPoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListPoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListPoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListPolicyVersionsPaginator.ts b/clients/client-iam/src/pagination/ListPolicyVersionsPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListPolicyVersionsPaginator.ts rename to clients/client-iam/src/pagination/ListPolicyVersionsPaginator.ts diff --git a/clients/client-iam/pagination/ListRolePoliciesPaginator.ts b/clients/client-iam/src/pagination/ListRolePoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListRolePoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListRolePoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListRolesPaginator.ts b/clients/client-iam/src/pagination/ListRolesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListRolesPaginator.ts rename to clients/client-iam/src/pagination/ListRolesPaginator.ts diff --git a/clients/client-iam/pagination/ListSSHPublicKeysPaginator.ts b/clients/client-iam/src/pagination/ListSSHPublicKeysPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListSSHPublicKeysPaginator.ts rename to clients/client-iam/src/pagination/ListSSHPublicKeysPaginator.ts diff --git a/clients/client-iam/pagination/ListServerCertificatesPaginator.ts b/clients/client-iam/src/pagination/ListServerCertificatesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListServerCertificatesPaginator.ts rename to clients/client-iam/src/pagination/ListServerCertificatesPaginator.ts diff --git a/clients/client-iam/pagination/ListSigningCertificatesPaginator.ts b/clients/client-iam/src/pagination/ListSigningCertificatesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListSigningCertificatesPaginator.ts rename to clients/client-iam/src/pagination/ListSigningCertificatesPaginator.ts diff --git a/clients/client-iam/pagination/ListUserPoliciesPaginator.ts b/clients/client-iam/src/pagination/ListUserPoliciesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListUserPoliciesPaginator.ts rename to clients/client-iam/src/pagination/ListUserPoliciesPaginator.ts diff --git a/clients/client-iam/pagination/ListUserTagsPaginator.ts b/clients/client-iam/src/pagination/ListUserTagsPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListUserTagsPaginator.ts rename to clients/client-iam/src/pagination/ListUserTagsPaginator.ts diff --git a/clients/client-iam/pagination/ListUsersPaginator.ts b/clients/client-iam/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListUsersPaginator.ts rename to clients/client-iam/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-iam/pagination/ListVirtualMFADevicesPaginator.ts b/clients/client-iam/src/pagination/ListVirtualMFADevicesPaginator.ts similarity index 100% rename from clients/client-iam/pagination/ListVirtualMFADevicesPaginator.ts rename to clients/client-iam/src/pagination/ListVirtualMFADevicesPaginator.ts diff --git a/clients/client-iam/pagination/SimulateCustomPolicyPaginator.ts b/clients/client-iam/src/pagination/SimulateCustomPolicyPaginator.ts similarity index 100% rename from clients/client-iam/pagination/SimulateCustomPolicyPaginator.ts rename to clients/client-iam/src/pagination/SimulateCustomPolicyPaginator.ts diff --git a/clients/client-iam/pagination/SimulatePrincipalPolicyPaginator.ts b/clients/client-iam/src/pagination/SimulatePrincipalPolicyPaginator.ts similarity index 100% rename from clients/client-iam/pagination/SimulatePrincipalPolicyPaginator.ts rename to clients/client-iam/src/pagination/SimulatePrincipalPolicyPaginator.ts diff --git a/clients/client-iam/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-iam/protocols/Aws_query.ts rename to clients/client-iam/src/protocols/Aws_query.ts diff --git a/clients/client-iam/src/runtimeConfig.browser.ts b/clients/client-iam/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..01a7ccdf04a5 --- /dev/null +++ b/clients/client-iam/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IAMClientConfig } from "./IAMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IAMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iam/runtimeConfig.native.ts b/clients/client-iam/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iam/runtimeConfig.native.ts rename to clients/client-iam/src/runtimeConfig.native.ts diff --git a/clients/client-iam/runtimeConfig.shared.ts b/clients/client-iam/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iam/runtimeConfig.shared.ts rename to clients/client-iam/src/runtimeConfig.shared.ts diff --git a/clients/client-iam/src/runtimeConfig.ts b/clients/client-iam/src/runtimeConfig.ts new file mode 100644 index 000000000000..f8fd90400ed5 --- /dev/null +++ b/clients/client-iam/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IAMClientConfig } from "./IAMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IAMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iam/waiters/waitForInstanceProfileExists.ts b/clients/client-iam/src/waiters/waitForInstanceProfileExists.ts similarity index 100% rename from clients/client-iam/waiters/waitForInstanceProfileExists.ts rename to clients/client-iam/src/waiters/waitForInstanceProfileExists.ts diff --git a/clients/client-iam/waiters/waitForPolicyExists.ts b/clients/client-iam/src/waiters/waitForPolicyExists.ts similarity index 100% rename from clients/client-iam/waiters/waitForPolicyExists.ts rename to clients/client-iam/src/waiters/waitForPolicyExists.ts diff --git a/clients/client-iam/waiters/waitForRoleExists.ts b/clients/client-iam/src/waiters/waitForRoleExists.ts similarity index 100% rename from clients/client-iam/waiters/waitForRoleExists.ts rename to clients/client-iam/src/waiters/waitForRoleExists.ts diff --git a/clients/client-iam/waiters/waitForUserExists.ts b/clients/client-iam/src/waiters/waitForUserExists.ts similarity index 100% rename from clients/client-iam/waiters/waitForUserExists.ts rename to clients/client-iam/src/waiters/waitForUserExists.ts diff --git a/clients/client-iam/tsconfig.es.json b/clients/client-iam/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iam/tsconfig.es.json +++ b/clients/client-iam/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iam/tsconfig.json b/clients/client-iam/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iam/tsconfig.json +++ b/clients/client-iam/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iam/tsconfig.types.json b/clients/client-iam/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iam/tsconfig.types.json +++ b/clients/client-iam/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-identitystore/.gitignore b/clients/client-identitystore/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-identitystore/.gitignore +++ b/clients/client-identitystore/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-identitystore/package.json b/clients/client-identitystore/package.json index 1d1062199660..682931e0b76e 100644 --- a/clients/client-identitystore/package.json +++ b/clients/client-identitystore/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-identitystore", "repository": { "type": "git", diff --git a/clients/client-identitystore/runtimeConfig.browser.ts b/clients/client-identitystore/runtimeConfig.browser.ts deleted file mode 100644 index b534f6bb6686..000000000000 --- a/clients/client-identitystore/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IdentitystoreClientConfig } from "./IdentitystoreClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-identitystore/runtimeConfig.ts b/clients/client-identitystore/runtimeConfig.ts deleted file mode 100644 index 78f87e947daf..000000000000 --- a/clients/client-identitystore/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IdentitystoreClientConfig } from "./IdentitystoreClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-identitystore/Identitystore.ts b/clients/client-identitystore/src/Identitystore.ts similarity index 100% rename from clients/client-identitystore/Identitystore.ts rename to clients/client-identitystore/src/Identitystore.ts diff --git a/clients/client-identitystore/IdentitystoreClient.ts b/clients/client-identitystore/src/IdentitystoreClient.ts similarity index 100% rename from clients/client-identitystore/IdentitystoreClient.ts rename to clients/client-identitystore/src/IdentitystoreClient.ts diff --git a/clients/client-identitystore/commands/DescribeGroupCommand.ts b/clients/client-identitystore/src/commands/DescribeGroupCommand.ts similarity index 100% rename from clients/client-identitystore/commands/DescribeGroupCommand.ts rename to clients/client-identitystore/src/commands/DescribeGroupCommand.ts diff --git a/clients/client-identitystore/commands/DescribeUserCommand.ts b/clients/client-identitystore/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-identitystore/commands/DescribeUserCommand.ts rename to clients/client-identitystore/src/commands/DescribeUserCommand.ts diff --git a/clients/client-identitystore/commands/ListGroupsCommand.ts b/clients/client-identitystore/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-identitystore/commands/ListGroupsCommand.ts rename to clients/client-identitystore/src/commands/ListGroupsCommand.ts diff --git a/clients/client-identitystore/commands/ListUsersCommand.ts b/clients/client-identitystore/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-identitystore/commands/ListUsersCommand.ts rename to clients/client-identitystore/src/commands/ListUsersCommand.ts diff --git a/clients/client-identitystore/endpoints.ts b/clients/client-identitystore/src/endpoints.ts similarity index 100% rename from clients/client-identitystore/endpoints.ts rename to clients/client-identitystore/src/endpoints.ts diff --git a/clients/client-identitystore/index.ts b/clients/client-identitystore/src/index.ts similarity index 100% rename from clients/client-identitystore/index.ts rename to clients/client-identitystore/src/index.ts diff --git a/clients/client-identitystore/models/index.ts b/clients/client-identitystore/src/models/index.ts similarity index 100% rename from clients/client-identitystore/models/index.ts rename to clients/client-identitystore/src/models/index.ts diff --git a/clients/client-identitystore/models/models_0.ts b/clients/client-identitystore/src/models/models_0.ts similarity index 100% rename from clients/client-identitystore/models/models_0.ts rename to clients/client-identitystore/src/models/models_0.ts diff --git a/clients/client-identitystore/pagination/Interfaces.ts b/clients/client-identitystore/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-identitystore/pagination/Interfaces.ts rename to clients/client-identitystore/src/pagination/Interfaces.ts diff --git a/clients/client-identitystore/pagination/ListGroupsPaginator.ts b/clients/client-identitystore/src/pagination/ListGroupsPaginator.ts similarity index 100% rename from clients/client-identitystore/pagination/ListGroupsPaginator.ts rename to clients/client-identitystore/src/pagination/ListGroupsPaginator.ts diff --git a/clients/client-identitystore/pagination/ListUsersPaginator.ts b/clients/client-identitystore/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-identitystore/pagination/ListUsersPaginator.ts rename to clients/client-identitystore/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-identitystore/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-identitystore/protocols/Aws_json1_1.ts rename to clients/client-identitystore/src/protocols/Aws_json1_1.ts diff --git a/clients/client-identitystore/src/runtimeConfig.browser.ts b/clients/client-identitystore/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..64fa2354f853 --- /dev/null +++ b/clients/client-identitystore/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IdentitystoreClientConfig } from "./IdentitystoreClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-identitystore/runtimeConfig.native.ts b/clients/client-identitystore/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-identitystore/runtimeConfig.native.ts rename to clients/client-identitystore/src/runtimeConfig.native.ts diff --git a/clients/client-identitystore/runtimeConfig.shared.ts b/clients/client-identitystore/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-identitystore/runtimeConfig.shared.ts rename to clients/client-identitystore/src/runtimeConfig.shared.ts diff --git a/clients/client-identitystore/src/runtimeConfig.ts b/clients/client-identitystore/src/runtimeConfig.ts new file mode 100644 index 000000000000..8ab13408abd4 --- /dev/null +++ b/clients/client-identitystore/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IdentitystoreClientConfig } from "./IdentitystoreClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-identitystore/tsconfig.es.json b/clients/client-identitystore/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-identitystore/tsconfig.es.json +++ b/clients/client-identitystore/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-identitystore/tsconfig.json b/clients/client-identitystore/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-identitystore/tsconfig.json +++ b/clients/client-identitystore/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-identitystore/tsconfig.types.json b/clients/client-identitystore/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-identitystore/tsconfig.types.json +++ b/clients/client-identitystore/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-imagebuilder/.gitignore b/clients/client-imagebuilder/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-imagebuilder/.gitignore +++ b/clients/client-imagebuilder/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-imagebuilder/package.json b/clients/client-imagebuilder/package.json index 09e2b56756a1..de9afb5a17a6 100644 --- a/clients/client-imagebuilder/package.json +++ b/clients/client-imagebuilder/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-imagebuilder", "repository": { "type": "git", diff --git a/clients/client-imagebuilder/runtimeConfig.browser.ts b/clients/client-imagebuilder/runtimeConfig.browser.ts deleted file mode 100644 index 5d81378d243e..000000000000 --- a/clients/client-imagebuilder/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ImagebuilderClientConfig } from "./ImagebuilderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-imagebuilder/runtimeConfig.ts b/clients/client-imagebuilder/runtimeConfig.ts deleted file mode 100644 index de0a93990161..000000000000 --- a/clients/client-imagebuilder/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ImagebuilderClientConfig } from "./ImagebuilderClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-imagebuilder/Imagebuilder.ts b/clients/client-imagebuilder/src/Imagebuilder.ts similarity index 100% rename from clients/client-imagebuilder/Imagebuilder.ts rename to clients/client-imagebuilder/src/Imagebuilder.ts diff --git a/clients/client-imagebuilder/ImagebuilderClient.ts b/clients/client-imagebuilder/src/ImagebuilderClient.ts similarity index 100% rename from clients/client-imagebuilder/ImagebuilderClient.ts rename to clients/client-imagebuilder/src/ImagebuilderClient.ts diff --git a/clients/client-imagebuilder/commands/CancelImageCreationCommand.ts b/clients/client-imagebuilder/src/commands/CancelImageCreationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CancelImageCreationCommand.ts rename to clients/client-imagebuilder/src/commands/CancelImageCreationCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateComponentCommand.ts b/clients/client-imagebuilder/src/commands/CreateComponentCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateComponentCommand.ts rename to clients/client-imagebuilder/src/commands/CreateComponentCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateContainerRecipeCommand.ts b/clients/client-imagebuilder/src/commands/CreateContainerRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateContainerRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/CreateContainerRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateDistributionConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/CreateDistributionConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateDistributionConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/CreateDistributionConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateImageCommand.ts b/clients/client-imagebuilder/src/commands/CreateImageCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateImageCommand.ts rename to clients/client-imagebuilder/src/commands/CreateImageCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateImagePipelineCommand.ts b/clients/client-imagebuilder/src/commands/CreateImagePipelineCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateImagePipelineCommand.ts rename to clients/client-imagebuilder/src/commands/CreateImagePipelineCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateImageRecipeCommand.ts b/clients/client-imagebuilder/src/commands/CreateImageRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateImageRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/CreateImageRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/CreateInfrastructureConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/CreateInfrastructureConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/CreateInfrastructureConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/CreateInfrastructureConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteComponentCommand.ts b/clients/client-imagebuilder/src/commands/DeleteComponentCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteComponentCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteComponentCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteContainerRecipeCommand.ts b/clients/client-imagebuilder/src/commands/DeleteContainerRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteContainerRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteContainerRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteDistributionConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/DeleteDistributionConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteDistributionConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteDistributionConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteImageCommand.ts b/clients/client-imagebuilder/src/commands/DeleteImageCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteImageCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteImageCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteImagePipelineCommand.ts b/clients/client-imagebuilder/src/commands/DeleteImagePipelineCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteImagePipelineCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteImagePipelineCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteImageRecipeCommand.ts b/clients/client-imagebuilder/src/commands/DeleteImageRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteImageRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteImageRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/DeleteInfrastructureConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/DeleteInfrastructureConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/DeleteInfrastructureConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/DeleteInfrastructureConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/GetComponentCommand.ts b/clients/client-imagebuilder/src/commands/GetComponentCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetComponentCommand.ts rename to clients/client-imagebuilder/src/commands/GetComponentCommand.ts diff --git a/clients/client-imagebuilder/commands/GetComponentPolicyCommand.ts b/clients/client-imagebuilder/src/commands/GetComponentPolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetComponentPolicyCommand.ts rename to clients/client-imagebuilder/src/commands/GetComponentPolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/GetContainerRecipeCommand.ts b/clients/client-imagebuilder/src/commands/GetContainerRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetContainerRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/GetContainerRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/GetContainerRecipePolicyCommand.ts b/clients/client-imagebuilder/src/commands/GetContainerRecipePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetContainerRecipePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/GetContainerRecipePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/GetDistributionConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/GetDistributionConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetDistributionConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/GetDistributionConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/GetImageCommand.ts b/clients/client-imagebuilder/src/commands/GetImageCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetImageCommand.ts rename to clients/client-imagebuilder/src/commands/GetImageCommand.ts diff --git a/clients/client-imagebuilder/commands/GetImagePipelineCommand.ts b/clients/client-imagebuilder/src/commands/GetImagePipelineCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetImagePipelineCommand.ts rename to clients/client-imagebuilder/src/commands/GetImagePipelineCommand.ts diff --git a/clients/client-imagebuilder/commands/GetImagePolicyCommand.ts b/clients/client-imagebuilder/src/commands/GetImagePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetImagePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/GetImagePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/GetImageRecipeCommand.ts b/clients/client-imagebuilder/src/commands/GetImageRecipeCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetImageRecipeCommand.ts rename to clients/client-imagebuilder/src/commands/GetImageRecipeCommand.ts diff --git a/clients/client-imagebuilder/commands/GetImageRecipePolicyCommand.ts b/clients/client-imagebuilder/src/commands/GetImageRecipePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetImageRecipePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/GetImageRecipePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/GetInfrastructureConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/GetInfrastructureConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/GetInfrastructureConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/GetInfrastructureConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/ImportComponentCommand.ts b/clients/client-imagebuilder/src/commands/ImportComponentCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ImportComponentCommand.ts rename to clients/client-imagebuilder/src/commands/ImportComponentCommand.ts diff --git a/clients/client-imagebuilder/commands/ListComponentBuildVersionsCommand.ts b/clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListComponentBuildVersionsCommand.ts rename to clients/client-imagebuilder/src/commands/ListComponentBuildVersionsCommand.ts diff --git a/clients/client-imagebuilder/commands/ListComponentsCommand.ts b/clients/client-imagebuilder/src/commands/ListComponentsCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListComponentsCommand.ts rename to clients/client-imagebuilder/src/commands/ListComponentsCommand.ts diff --git a/clients/client-imagebuilder/commands/ListContainerRecipesCommand.ts b/clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListContainerRecipesCommand.ts rename to clients/client-imagebuilder/src/commands/ListContainerRecipesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListDistributionConfigurationsCommand.ts b/clients/client-imagebuilder/src/commands/ListDistributionConfigurationsCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListDistributionConfigurationsCommand.ts rename to clients/client-imagebuilder/src/commands/ListDistributionConfigurationsCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImageBuildVersionsCommand.ts b/clients/client-imagebuilder/src/commands/ListImageBuildVersionsCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImageBuildVersionsCommand.ts rename to clients/client-imagebuilder/src/commands/ListImageBuildVersionsCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImagePackagesCommand.ts b/clients/client-imagebuilder/src/commands/ListImagePackagesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImagePackagesCommand.ts rename to clients/client-imagebuilder/src/commands/ListImagePackagesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImagePipelineImagesCommand.ts b/clients/client-imagebuilder/src/commands/ListImagePipelineImagesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImagePipelineImagesCommand.ts rename to clients/client-imagebuilder/src/commands/ListImagePipelineImagesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImagePipelinesCommand.ts b/clients/client-imagebuilder/src/commands/ListImagePipelinesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImagePipelinesCommand.ts rename to clients/client-imagebuilder/src/commands/ListImagePipelinesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImageRecipesCommand.ts b/clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImageRecipesCommand.ts rename to clients/client-imagebuilder/src/commands/ListImageRecipesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListImagesCommand.ts b/clients/client-imagebuilder/src/commands/ListImagesCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListImagesCommand.ts rename to clients/client-imagebuilder/src/commands/ListImagesCommand.ts diff --git a/clients/client-imagebuilder/commands/ListInfrastructureConfigurationsCommand.ts b/clients/client-imagebuilder/src/commands/ListInfrastructureConfigurationsCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListInfrastructureConfigurationsCommand.ts rename to clients/client-imagebuilder/src/commands/ListInfrastructureConfigurationsCommand.ts diff --git a/clients/client-imagebuilder/commands/ListTagsForResourceCommand.ts b/clients/client-imagebuilder/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/ListTagsForResourceCommand.ts rename to clients/client-imagebuilder/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-imagebuilder/commands/PutComponentPolicyCommand.ts b/clients/client-imagebuilder/src/commands/PutComponentPolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/PutComponentPolicyCommand.ts rename to clients/client-imagebuilder/src/commands/PutComponentPolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/PutContainerRecipePolicyCommand.ts b/clients/client-imagebuilder/src/commands/PutContainerRecipePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/PutContainerRecipePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/PutContainerRecipePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/PutImagePolicyCommand.ts b/clients/client-imagebuilder/src/commands/PutImagePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/PutImagePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/PutImagePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/PutImageRecipePolicyCommand.ts b/clients/client-imagebuilder/src/commands/PutImageRecipePolicyCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/PutImageRecipePolicyCommand.ts rename to clients/client-imagebuilder/src/commands/PutImageRecipePolicyCommand.ts diff --git a/clients/client-imagebuilder/commands/StartImagePipelineExecutionCommand.ts b/clients/client-imagebuilder/src/commands/StartImagePipelineExecutionCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/StartImagePipelineExecutionCommand.ts rename to clients/client-imagebuilder/src/commands/StartImagePipelineExecutionCommand.ts diff --git a/clients/client-imagebuilder/commands/TagResourceCommand.ts b/clients/client-imagebuilder/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/TagResourceCommand.ts rename to clients/client-imagebuilder/src/commands/TagResourceCommand.ts diff --git a/clients/client-imagebuilder/commands/UntagResourceCommand.ts b/clients/client-imagebuilder/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/UntagResourceCommand.ts rename to clients/client-imagebuilder/src/commands/UntagResourceCommand.ts diff --git a/clients/client-imagebuilder/commands/UpdateDistributionConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/UpdateDistributionConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/UpdateDistributionConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/UpdateDistributionConfigurationCommand.ts diff --git a/clients/client-imagebuilder/commands/UpdateImagePipelineCommand.ts b/clients/client-imagebuilder/src/commands/UpdateImagePipelineCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/UpdateImagePipelineCommand.ts rename to clients/client-imagebuilder/src/commands/UpdateImagePipelineCommand.ts diff --git a/clients/client-imagebuilder/commands/UpdateInfrastructureConfigurationCommand.ts b/clients/client-imagebuilder/src/commands/UpdateInfrastructureConfigurationCommand.ts similarity index 100% rename from clients/client-imagebuilder/commands/UpdateInfrastructureConfigurationCommand.ts rename to clients/client-imagebuilder/src/commands/UpdateInfrastructureConfigurationCommand.ts diff --git a/clients/client-imagebuilder/endpoints.ts b/clients/client-imagebuilder/src/endpoints.ts similarity index 100% rename from clients/client-imagebuilder/endpoints.ts rename to clients/client-imagebuilder/src/endpoints.ts diff --git a/clients/client-imagebuilder/index.ts b/clients/client-imagebuilder/src/index.ts similarity index 100% rename from clients/client-imagebuilder/index.ts rename to clients/client-imagebuilder/src/index.ts diff --git a/clients/client-imagebuilder/models/index.ts b/clients/client-imagebuilder/src/models/index.ts similarity index 100% rename from clients/client-imagebuilder/models/index.ts rename to clients/client-imagebuilder/src/models/index.ts diff --git a/clients/client-imagebuilder/models/models_0.ts b/clients/client-imagebuilder/src/models/models_0.ts similarity index 100% rename from clients/client-imagebuilder/models/models_0.ts rename to clients/client-imagebuilder/src/models/models_0.ts diff --git a/clients/client-imagebuilder/pagination/Interfaces.ts b/clients/client-imagebuilder/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-imagebuilder/pagination/Interfaces.ts rename to clients/client-imagebuilder/src/pagination/Interfaces.ts diff --git a/clients/client-imagebuilder/pagination/ListComponentBuildVersionsPaginator.ts b/clients/client-imagebuilder/src/pagination/ListComponentBuildVersionsPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListComponentBuildVersionsPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListComponentBuildVersionsPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListComponentsPaginator.ts b/clients/client-imagebuilder/src/pagination/ListComponentsPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListComponentsPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListComponentsPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListContainerRecipesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListContainerRecipesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListContainerRecipesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListContainerRecipesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListDistributionConfigurationsPaginator.ts b/clients/client-imagebuilder/src/pagination/ListDistributionConfigurationsPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListDistributionConfigurationsPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListDistributionConfigurationsPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImageBuildVersionsPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImageBuildVersionsPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImageBuildVersionsPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImageBuildVersionsPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImagePackagesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImagePackagesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImagePackagesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImagePackagesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImagePipelineImagesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImagePipelineImagesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImagePipelineImagesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImagePipelineImagesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImagePipelinesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImagePipelinesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImagePipelinesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImagePipelinesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImageRecipesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImageRecipesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImageRecipesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImageRecipesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListImagesPaginator.ts b/clients/client-imagebuilder/src/pagination/ListImagesPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListImagesPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListImagesPaginator.ts diff --git a/clients/client-imagebuilder/pagination/ListInfrastructureConfigurationsPaginator.ts b/clients/client-imagebuilder/src/pagination/ListInfrastructureConfigurationsPaginator.ts similarity index 100% rename from clients/client-imagebuilder/pagination/ListInfrastructureConfigurationsPaginator.ts rename to clients/client-imagebuilder/src/pagination/ListInfrastructureConfigurationsPaginator.ts diff --git a/clients/client-imagebuilder/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-imagebuilder/protocols/Aws_restJson1.ts rename to clients/client-imagebuilder/src/protocols/Aws_restJson1.ts diff --git a/clients/client-imagebuilder/src/runtimeConfig.browser.ts b/clients/client-imagebuilder/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e5c248d9aff7 --- /dev/null +++ b/clients/client-imagebuilder/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ImagebuilderClientConfig } from "./ImagebuilderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-imagebuilder/runtimeConfig.native.ts b/clients/client-imagebuilder/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-imagebuilder/runtimeConfig.native.ts rename to clients/client-imagebuilder/src/runtimeConfig.native.ts diff --git a/clients/client-imagebuilder/runtimeConfig.shared.ts b/clients/client-imagebuilder/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-imagebuilder/runtimeConfig.shared.ts rename to clients/client-imagebuilder/src/runtimeConfig.shared.ts diff --git a/clients/client-imagebuilder/src/runtimeConfig.ts b/clients/client-imagebuilder/src/runtimeConfig.ts new file mode 100644 index 000000000000..4d5954086095 --- /dev/null +++ b/clients/client-imagebuilder/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ImagebuilderClientConfig } from "./ImagebuilderClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-imagebuilder/tsconfig.es.json b/clients/client-imagebuilder/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-imagebuilder/tsconfig.es.json +++ b/clients/client-imagebuilder/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-imagebuilder/tsconfig.json b/clients/client-imagebuilder/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-imagebuilder/tsconfig.json +++ b/clients/client-imagebuilder/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-imagebuilder/tsconfig.types.json b/clients/client-imagebuilder/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-imagebuilder/tsconfig.types.json +++ b/clients/client-imagebuilder/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-inspector/.gitignore b/clients/client-inspector/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-inspector/.gitignore +++ b/clients/client-inspector/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-inspector/package.json b/clients/client-inspector/package.json index d4f4c6e61dbc..3c0c84c42aee 100644 --- a/clients/client-inspector/package.json +++ b/clients/client-inspector/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-inspector", "repository": { "type": "git", diff --git a/clients/client-inspector/runtimeConfig.browser.ts b/clients/client-inspector/runtimeConfig.browser.ts deleted file mode 100644 index 91b5887981cd..000000000000 --- a/clients/client-inspector/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { InspectorClientConfig } from "./InspectorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: InspectorClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-inspector/runtimeConfig.ts b/clients/client-inspector/runtimeConfig.ts deleted file mode 100644 index 8498ddea3f21..000000000000 --- a/clients/client-inspector/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { InspectorClientConfig } from "./InspectorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: InspectorClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-inspector/Inspector.ts b/clients/client-inspector/src/Inspector.ts similarity index 100% rename from clients/client-inspector/Inspector.ts rename to clients/client-inspector/src/Inspector.ts diff --git a/clients/client-inspector/InspectorClient.ts b/clients/client-inspector/src/InspectorClient.ts similarity index 100% rename from clients/client-inspector/InspectorClient.ts rename to clients/client-inspector/src/InspectorClient.ts diff --git a/clients/client-inspector/commands/AddAttributesToFindingsCommand.ts b/clients/client-inspector/src/commands/AddAttributesToFindingsCommand.ts similarity index 100% rename from clients/client-inspector/commands/AddAttributesToFindingsCommand.ts rename to clients/client-inspector/src/commands/AddAttributesToFindingsCommand.ts diff --git a/clients/client-inspector/commands/CreateAssessmentTargetCommand.ts b/clients/client-inspector/src/commands/CreateAssessmentTargetCommand.ts similarity index 100% rename from clients/client-inspector/commands/CreateAssessmentTargetCommand.ts rename to clients/client-inspector/src/commands/CreateAssessmentTargetCommand.ts diff --git a/clients/client-inspector/commands/CreateAssessmentTemplateCommand.ts b/clients/client-inspector/src/commands/CreateAssessmentTemplateCommand.ts similarity index 100% rename from clients/client-inspector/commands/CreateAssessmentTemplateCommand.ts rename to clients/client-inspector/src/commands/CreateAssessmentTemplateCommand.ts diff --git a/clients/client-inspector/commands/CreateExclusionsPreviewCommand.ts b/clients/client-inspector/src/commands/CreateExclusionsPreviewCommand.ts similarity index 100% rename from clients/client-inspector/commands/CreateExclusionsPreviewCommand.ts rename to clients/client-inspector/src/commands/CreateExclusionsPreviewCommand.ts diff --git a/clients/client-inspector/commands/CreateResourceGroupCommand.ts b/clients/client-inspector/src/commands/CreateResourceGroupCommand.ts similarity index 100% rename from clients/client-inspector/commands/CreateResourceGroupCommand.ts rename to clients/client-inspector/src/commands/CreateResourceGroupCommand.ts diff --git a/clients/client-inspector/commands/DeleteAssessmentRunCommand.ts b/clients/client-inspector/src/commands/DeleteAssessmentRunCommand.ts similarity index 100% rename from clients/client-inspector/commands/DeleteAssessmentRunCommand.ts rename to clients/client-inspector/src/commands/DeleteAssessmentRunCommand.ts diff --git a/clients/client-inspector/commands/DeleteAssessmentTargetCommand.ts b/clients/client-inspector/src/commands/DeleteAssessmentTargetCommand.ts similarity index 100% rename from clients/client-inspector/commands/DeleteAssessmentTargetCommand.ts rename to clients/client-inspector/src/commands/DeleteAssessmentTargetCommand.ts diff --git a/clients/client-inspector/commands/DeleteAssessmentTemplateCommand.ts b/clients/client-inspector/src/commands/DeleteAssessmentTemplateCommand.ts similarity index 100% rename from clients/client-inspector/commands/DeleteAssessmentTemplateCommand.ts rename to clients/client-inspector/src/commands/DeleteAssessmentTemplateCommand.ts diff --git a/clients/client-inspector/commands/DescribeAssessmentRunsCommand.ts b/clients/client-inspector/src/commands/DescribeAssessmentRunsCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeAssessmentRunsCommand.ts rename to clients/client-inspector/src/commands/DescribeAssessmentRunsCommand.ts diff --git a/clients/client-inspector/commands/DescribeAssessmentTargetsCommand.ts b/clients/client-inspector/src/commands/DescribeAssessmentTargetsCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeAssessmentTargetsCommand.ts rename to clients/client-inspector/src/commands/DescribeAssessmentTargetsCommand.ts diff --git a/clients/client-inspector/commands/DescribeAssessmentTemplatesCommand.ts b/clients/client-inspector/src/commands/DescribeAssessmentTemplatesCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeAssessmentTemplatesCommand.ts rename to clients/client-inspector/src/commands/DescribeAssessmentTemplatesCommand.ts diff --git a/clients/client-inspector/commands/DescribeCrossAccountAccessRoleCommand.ts b/clients/client-inspector/src/commands/DescribeCrossAccountAccessRoleCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeCrossAccountAccessRoleCommand.ts rename to clients/client-inspector/src/commands/DescribeCrossAccountAccessRoleCommand.ts diff --git a/clients/client-inspector/commands/DescribeExclusionsCommand.ts b/clients/client-inspector/src/commands/DescribeExclusionsCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeExclusionsCommand.ts rename to clients/client-inspector/src/commands/DescribeExclusionsCommand.ts diff --git a/clients/client-inspector/commands/DescribeFindingsCommand.ts b/clients/client-inspector/src/commands/DescribeFindingsCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeFindingsCommand.ts rename to clients/client-inspector/src/commands/DescribeFindingsCommand.ts diff --git a/clients/client-inspector/commands/DescribeResourceGroupsCommand.ts b/clients/client-inspector/src/commands/DescribeResourceGroupsCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeResourceGroupsCommand.ts rename to clients/client-inspector/src/commands/DescribeResourceGroupsCommand.ts diff --git a/clients/client-inspector/commands/DescribeRulesPackagesCommand.ts b/clients/client-inspector/src/commands/DescribeRulesPackagesCommand.ts similarity index 100% rename from clients/client-inspector/commands/DescribeRulesPackagesCommand.ts rename to clients/client-inspector/src/commands/DescribeRulesPackagesCommand.ts diff --git a/clients/client-inspector/commands/GetAssessmentReportCommand.ts b/clients/client-inspector/src/commands/GetAssessmentReportCommand.ts similarity index 100% rename from clients/client-inspector/commands/GetAssessmentReportCommand.ts rename to clients/client-inspector/src/commands/GetAssessmentReportCommand.ts diff --git a/clients/client-inspector/commands/GetExclusionsPreviewCommand.ts b/clients/client-inspector/src/commands/GetExclusionsPreviewCommand.ts similarity index 100% rename from clients/client-inspector/commands/GetExclusionsPreviewCommand.ts rename to clients/client-inspector/src/commands/GetExclusionsPreviewCommand.ts diff --git a/clients/client-inspector/commands/GetTelemetryMetadataCommand.ts b/clients/client-inspector/src/commands/GetTelemetryMetadataCommand.ts similarity index 100% rename from clients/client-inspector/commands/GetTelemetryMetadataCommand.ts rename to clients/client-inspector/src/commands/GetTelemetryMetadataCommand.ts diff --git a/clients/client-inspector/commands/ListAssessmentRunAgentsCommand.ts b/clients/client-inspector/src/commands/ListAssessmentRunAgentsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListAssessmentRunAgentsCommand.ts rename to clients/client-inspector/src/commands/ListAssessmentRunAgentsCommand.ts diff --git a/clients/client-inspector/commands/ListAssessmentRunsCommand.ts b/clients/client-inspector/src/commands/ListAssessmentRunsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListAssessmentRunsCommand.ts rename to clients/client-inspector/src/commands/ListAssessmentRunsCommand.ts diff --git a/clients/client-inspector/commands/ListAssessmentTargetsCommand.ts b/clients/client-inspector/src/commands/ListAssessmentTargetsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListAssessmentTargetsCommand.ts rename to clients/client-inspector/src/commands/ListAssessmentTargetsCommand.ts diff --git a/clients/client-inspector/commands/ListAssessmentTemplatesCommand.ts b/clients/client-inspector/src/commands/ListAssessmentTemplatesCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListAssessmentTemplatesCommand.ts rename to clients/client-inspector/src/commands/ListAssessmentTemplatesCommand.ts diff --git a/clients/client-inspector/commands/ListEventSubscriptionsCommand.ts b/clients/client-inspector/src/commands/ListEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListEventSubscriptionsCommand.ts rename to clients/client-inspector/src/commands/ListEventSubscriptionsCommand.ts diff --git a/clients/client-inspector/commands/ListExclusionsCommand.ts b/clients/client-inspector/src/commands/ListExclusionsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListExclusionsCommand.ts rename to clients/client-inspector/src/commands/ListExclusionsCommand.ts diff --git a/clients/client-inspector/commands/ListFindingsCommand.ts b/clients/client-inspector/src/commands/ListFindingsCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListFindingsCommand.ts rename to clients/client-inspector/src/commands/ListFindingsCommand.ts diff --git a/clients/client-inspector/commands/ListRulesPackagesCommand.ts b/clients/client-inspector/src/commands/ListRulesPackagesCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListRulesPackagesCommand.ts rename to clients/client-inspector/src/commands/ListRulesPackagesCommand.ts diff --git a/clients/client-inspector/commands/ListTagsForResourceCommand.ts b/clients/client-inspector/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-inspector/commands/ListTagsForResourceCommand.ts rename to clients/client-inspector/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-inspector/commands/PreviewAgentsCommand.ts b/clients/client-inspector/src/commands/PreviewAgentsCommand.ts similarity index 100% rename from clients/client-inspector/commands/PreviewAgentsCommand.ts rename to clients/client-inspector/src/commands/PreviewAgentsCommand.ts diff --git a/clients/client-inspector/commands/RegisterCrossAccountAccessRoleCommand.ts b/clients/client-inspector/src/commands/RegisterCrossAccountAccessRoleCommand.ts similarity index 100% rename from clients/client-inspector/commands/RegisterCrossAccountAccessRoleCommand.ts rename to clients/client-inspector/src/commands/RegisterCrossAccountAccessRoleCommand.ts diff --git a/clients/client-inspector/commands/RemoveAttributesFromFindingsCommand.ts b/clients/client-inspector/src/commands/RemoveAttributesFromFindingsCommand.ts similarity index 100% rename from clients/client-inspector/commands/RemoveAttributesFromFindingsCommand.ts rename to clients/client-inspector/src/commands/RemoveAttributesFromFindingsCommand.ts diff --git a/clients/client-inspector/commands/SetTagsForResourceCommand.ts b/clients/client-inspector/src/commands/SetTagsForResourceCommand.ts similarity index 100% rename from clients/client-inspector/commands/SetTagsForResourceCommand.ts rename to clients/client-inspector/src/commands/SetTagsForResourceCommand.ts diff --git a/clients/client-inspector/commands/StartAssessmentRunCommand.ts b/clients/client-inspector/src/commands/StartAssessmentRunCommand.ts similarity index 100% rename from clients/client-inspector/commands/StartAssessmentRunCommand.ts rename to clients/client-inspector/src/commands/StartAssessmentRunCommand.ts diff --git a/clients/client-inspector/commands/StopAssessmentRunCommand.ts b/clients/client-inspector/src/commands/StopAssessmentRunCommand.ts similarity index 100% rename from clients/client-inspector/commands/StopAssessmentRunCommand.ts rename to clients/client-inspector/src/commands/StopAssessmentRunCommand.ts diff --git a/clients/client-inspector/commands/SubscribeToEventCommand.ts b/clients/client-inspector/src/commands/SubscribeToEventCommand.ts similarity index 100% rename from clients/client-inspector/commands/SubscribeToEventCommand.ts rename to clients/client-inspector/src/commands/SubscribeToEventCommand.ts diff --git a/clients/client-inspector/commands/UnsubscribeFromEventCommand.ts b/clients/client-inspector/src/commands/UnsubscribeFromEventCommand.ts similarity index 100% rename from clients/client-inspector/commands/UnsubscribeFromEventCommand.ts rename to clients/client-inspector/src/commands/UnsubscribeFromEventCommand.ts diff --git a/clients/client-inspector/commands/UpdateAssessmentTargetCommand.ts b/clients/client-inspector/src/commands/UpdateAssessmentTargetCommand.ts similarity index 100% rename from clients/client-inspector/commands/UpdateAssessmentTargetCommand.ts rename to clients/client-inspector/src/commands/UpdateAssessmentTargetCommand.ts diff --git a/clients/client-inspector/endpoints.ts b/clients/client-inspector/src/endpoints.ts similarity index 100% rename from clients/client-inspector/endpoints.ts rename to clients/client-inspector/src/endpoints.ts diff --git a/clients/client-inspector/index.ts b/clients/client-inspector/src/index.ts similarity index 100% rename from clients/client-inspector/index.ts rename to clients/client-inspector/src/index.ts diff --git a/clients/client-inspector/models/index.ts b/clients/client-inspector/src/models/index.ts similarity index 100% rename from clients/client-inspector/models/index.ts rename to clients/client-inspector/src/models/index.ts diff --git a/clients/client-inspector/models/models_0.ts b/clients/client-inspector/src/models/models_0.ts similarity index 100% rename from clients/client-inspector/models/models_0.ts rename to clients/client-inspector/src/models/models_0.ts diff --git a/clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts b/clients/client-inspector/src/pagination/GetExclusionsPreviewPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/GetExclusionsPreviewPaginator.ts rename to clients/client-inspector/src/pagination/GetExclusionsPreviewPaginator.ts diff --git a/clients/client-inspector/pagination/Interfaces.ts b/clients/client-inspector/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-inspector/pagination/Interfaces.ts rename to clients/client-inspector/src/pagination/Interfaces.ts diff --git a/clients/client-inspector/pagination/ListAssessmentRunAgentsPaginator.ts b/clients/client-inspector/src/pagination/ListAssessmentRunAgentsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListAssessmentRunAgentsPaginator.ts rename to clients/client-inspector/src/pagination/ListAssessmentRunAgentsPaginator.ts diff --git a/clients/client-inspector/pagination/ListAssessmentRunsPaginator.ts b/clients/client-inspector/src/pagination/ListAssessmentRunsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListAssessmentRunsPaginator.ts rename to clients/client-inspector/src/pagination/ListAssessmentRunsPaginator.ts diff --git a/clients/client-inspector/pagination/ListAssessmentTargetsPaginator.ts b/clients/client-inspector/src/pagination/ListAssessmentTargetsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListAssessmentTargetsPaginator.ts rename to clients/client-inspector/src/pagination/ListAssessmentTargetsPaginator.ts diff --git a/clients/client-inspector/pagination/ListAssessmentTemplatesPaginator.ts b/clients/client-inspector/src/pagination/ListAssessmentTemplatesPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListAssessmentTemplatesPaginator.ts rename to clients/client-inspector/src/pagination/ListAssessmentTemplatesPaginator.ts diff --git a/clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts b/clients/client-inspector/src/pagination/ListEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListEventSubscriptionsPaginator.ts rename to clients/client-inspector/src/pagination/ListEventSubscriptionsPaginator.ts diff --git a/clients/client-inspector/pagination/ListExclusionsPaginator.ts b/clients/client-inspector/src/pagination/ListExclusionsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListExclusionsPaginator.ts rename to clients/client-inspector/src/pagination/ListExclusionsPaginator.ts diff --git a/clients/client-inspector/pagination/ListFindingsPaginator.ts b/clients/client-inspector/src/pagination/ListFindingsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListFindingsPaginator.ts rename to clients/client-inspector/src/pagination/ListFindingsPaginator.ts diff --git a/clients/client-inspector/pagination/ListRulesPackagesPaginator.ts b/clients/client-inspector/src/pagination/ListRulesPackagesPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/ListRulesPackagesPaginator.ts rename to clients/client-inspector/src/pagination/ListRulesPackagesPaginator.ts diff --git a/clients/client-inspector/pagination/PreviewAgentsPaginator.ts b/clients/client-inspector/src/pagination/PreviewAgentsPaginator.ts similarity index 100% rename from clients/client-inspector/pagination/PreviewAgentsPaginator.ts rename to clients/client-inspector/src/pagination/PreviewAgentsPaginator.ts diff --git a/clients/client-inspector/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-inspector/protocols/Aws_json1_1.ts rename to clients/client-inspector/src/protocols/Aws_json1_1.ts diff --git a/clients/client-inspector/src/runtimeConfig.browser.ts b/clients/client-inspector/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0c39ac8f380f --- /dev/null +++ b/clients/client-inspector/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { InspectorClientConfig } from "./InspectorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InspectorClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-inspector/runtimeConfig.native.ts b/clients/client-inspector/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-inspector/runtimeConfig.native.ts rename to clients/client-inspector/src/runtimeConfig.native.ts diff --git a/clients/client-inspector/runtimeConfig.shared.ts b/clients/client-inspector/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-inspector/runtimeConfig.shared.ts rename to clients/client-inspector/src/runtimeConfig.shared.ts diff --git a/clients/client-inspector/src/runtimeConfig.ts b/clients/client-inspector/src/runtimeConfig.ts new file mode 100644 index 000000000000..95bd40d9987f --- /dev/null +++ b/clients/client-inspector/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { InspectorClientConfig } from "./InspectorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: InspectorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-inspector/tsconfig.es.json b/clients/client-inspector/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-inspector/tsconfig.es.json +++ b/clients/client-inspector/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-inspector/tsconfig.json b/clients/client-inspector/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-inspector/tsconfig.json +++ b/clients/client-inspector/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-inspector/tsconfig.types.json b/clients/client-inspector/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-inspector/tsconfig.types.json +++ b/clients/client-inspector/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-1click-devices-service/.gitignore b/clients/client-iot-1click-devices-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-1click-devices-service/.gitignore +++ b/clients/client-iot-1click-devices-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-1click-devices-service/package.json b/clients/client-iot-1click-devices-service/package.json index 34279644462b..ceca85ec5a0e 100644 --- a/clients/client-iot-1click-devices-service/package.json +++ b/clients/client-iot-1click-devices-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-1click-devices-service", "repository": { "type": "git", diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts b/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts deleted file mode 100644 index 278a759b7b5e..000000000000 --- a/clients/client-iot-1click-devices-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoT1ClickDevicesServiceClientConfig } from "./IoT1ClickDevicesServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.ts b/clients/client-iot-1click-devices-service/runtimeConfig.ts deleted file mode 100644 index ca4fbb055064..000000000000 --- a/clients/client-iot-1click-devices-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoT1ClickDevicesServiceClientConfig } from "./IoT1ClickDevicesServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-1click-devices-service/IoT1ClickDevicesService.ts b/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesService.ts similarity index 100% rename from clients/client-iot-1click-devices-service/IoT1ClickDevicesService.ts rename to clients/client-iot-1click-devices-service/src/IoT1ClickDevicesService.ts diff --git a/clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts b/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts similarity index 100% rename from clients/client-iot-1click-devices-service/IoT1ClickDevicesServiceClient.ts rename to clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts diff --git a/clients/client-iot-1click-devices-service/commands/ClaimDevicesByClaimCodeCommand.ts b/clients/client-iot-1click-devices-service/src/commands/ClaimDevicesByClaimCodeCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/ClaimDevicesByClaimCodeCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/ClaimDevicesByClaimCodeCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/DescribeDeviceCommand.ts b/clients/client-iot-1click-devices-service/src/commands/DescribeDeviceCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/DescribeDeviceCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/DescribeDeviceCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/FinalizeDeviceClaimCommand.ts b/clients/client-iot-1click-devices-service/src/commands/FinalizeDeviceClaimCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/FinalizeDeviceClaimCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/FinalizeDeviceClaimCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/GetDeviceMethodsCommand.ts b/clients/client-iot-1click-devices-service/src/commands/GetDeviceMethodsCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/GetDeviceMethodsCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/GetDeviceMethodsCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/InitiateDeviceClaimCommand.ts b/clients/client-iot-1click-devices-service/src/commands/InitiateDeviceClaimCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/InitiateDeviceClaimCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/InitiateDeviceClaimCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/InvokeDeviceMethodCommand.ts b/clients/client-iot-1click-devices-service/src/commands/InvokeDeviceMethodCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/InvokeDeviceMethodCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/InvokeDeviceMethodCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/ListDeviceEventsCommand.ts b/clients/client-iot-1click-devices-service/src/commands/ListDeviceEventsCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/ListDeviceEventsCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/ListDeviceEventsCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/ListDevicesCommand.ts b/clients/client-iot-1click-devices-service/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/ListDevicesCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/ListDevicesCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/ListTagsForResourceCommand.ts b/clients/client-iot-1click-devices-service/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/ListTagsForResourceCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/TagResourceCommand.ts b/clients/client-iot-1click-devices-service/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/TagResourceCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/TagResourceCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/UnclaimDeviceCommand.ts b/clients/client-iot-1click-devices-service/src/commands/UnclaimDeviceCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/UnclaimDeviceCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/UnclaimDeviceCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/UntagResourceCommand.ts b/clients/client-iot-1click-devices-service/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/UntagResourceCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iot-1click-devices-service/commands/UpdateDeviceStateCommand.ts b/clients/client-iot-1click-devices-service/src/commands/UpdateDeviceStateCommand.ts similarity index 100% rename from clients/client-iot-1click-devices-service/commands/UpdateDeviceStateCommand.ts rename to clients/client-iot-1click-devices-service/src/commands/UpdateDeviceStateCommand.ts diff --git a/clients/client-iot-1click-devices-service/endpoints.ts b/clients/client-iot-1click-devices-service/src/endpoints.ts similarity index 100% rename from clients/client-iot-1click-devices-service/endpoints.ts rename to clients/client-iot-1click-devices-service/src/endpoints.ts diff --git a/clients/client-iot-1click-devices-service/index.ts b/clients/client-iot-1click-devices-service/src/index.ts similarity index 100% rename from clients/client-iot-1click-devices-service/index.ts rename to clients/client-iot-1click-devices-service/src/index.ts diff --git a/clients/client-iot-1click-devices-service/models/index.ts b/clients/client-iot-1click-devices-service/src/models/index.ts similarity index 100% rename from clients/client-iot-1click-devices-service/models/index.ts rename to clients/client-iot-1click-devices-service/src/models/index.ts diff --git a/clients/client-iot-1click-devices-service/models/models_0.ts b/clients/client-iot-1click-devices-service/src/models/models_0.ts similarity index 100% rename from clients/client-iot-1click-devices-service/models/models_0.ts rename to clients/client-iot-1click-devices-service/src/models/models_0.ts diff --git a/clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-1click-devices-service/protocols/Aws_restJson1.ts rename to clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-1click-devices-service/src/runtimeConfig.browser.ts b/clients/client-iot-1click-devices-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d328912dbcbc --- /dev/null +++ b/clients/client-iot-1click-devices-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoT1ClickDevicesServiceClientConfig } from "./IoT1ClickDevicesServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.native.ts b/clients/client-iot-1click-devices-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-1click-devices-service/runtimeConfig.native.ts rename to clients/client-iot-1click-devices-service/src/runtimeConfig.native.ts diff --git a/clients/client-iot-1click-devices-service/runtimeConfig.shared.ts b/clients/client-iot-1click-devices-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-1click-devices-service/runtimeConfig.shared.ts rename to clients/client-iot-1click-devices-service/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-1click-devices-service/src/runtimeConfig.ts b/clients/client-iot-1click-devices-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..d84455376917 --- /dev/null +++ b/clients/client-iot-1click-devices-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoT1ClickDevicesServiceClientConfig } from "./IoT1ClickDevicesServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-1click-devices-service/tsconfig.es.json b/clients/client-iot-1click-devices-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-1click-devices-service/tsconfig.es.json +++ b/clients/client-iot-1click-devices-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-1click-devices-service/tsconfig.json b/clients/client-iot-1click-devices-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-1click-devices-service/tsconfig.json +++ b/clients/client-iot-1click-devices-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-1click-devices-service/tsconfig.types.json b/clients/client-iot-1click-devices-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-1click-devices-service/tsconfig.types.json +++ b/clients/client-iot-1click-devices-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-1click-projects/.gitignore b/clients/client-iot-1click-projects/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-1click-projects/.gitignore +++ b/clients/client-iot-1click-projects/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-1click-projects/package.json b/clients/client-iot-1click-projects/package.json index 09f456a68b41..57b3cd128b39 100644 --- a/clients/client-iot-1click-projects/package.json +++ b/clients/client-iot-1click-projects/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-1click-projects", "repository": { "type": "git", diff --git a/clients/client-iot-1click-projects/runtimeConfig.browser.ts b/clients/client-iot-1click-projects/runtimeConfig.browser.ts deleted file mode 100644 index 2a041eef7eb1..000000000000 --- a/clients/client-iot-1click-projects/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoT1ClickProjectsClientConfig } from "./IoT1ClickProjectsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-1click-projects/runtimeConfig.ts b/clients/client-iot-1click-projects/runtimeConfig.ts deleted file mode 100644 index f0668bc68d05..000000000000 --- a/clients/client-iot-1click-projects/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoT1ClickProjectsClientConfig } from "./IoT1ClickProjectsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-1click-projects/IoT1ClickProjects.ts b/clients/client-iot-1click-projects/src/IoT1ClickProjects.ts similarity index 100% rename from clients/client-iot-1click-projects/IoT1ClickProjects.ts rename to clients/client-iot-1click-projects/src/IoT1ClickProjects.ts diff --git a/clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts b/clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts similarity index 100% rename from clients/client-iot-1click-projects/IoT1ClickProjectsClient.ts rename to clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts diff --git a/clients/client-iot-1click-projects/commands/AssociateDeviceWithPlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/AssociateDeviceWithPlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/AssociateDeviceWithPlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/AssociateDeviceWithPlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/CreatePlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/CreatePlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/CreatePlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/CreatePlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/CreateProjectCommand.ts b/clients/client-iot-1click-projects/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/CreateProjectCommand.ts rename to clients/client-iot-1click-projects/src/commands/CreateProjectCommand.ts diff --git a/clients/client-iot-1click-projects/commands/DeletePlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/DeletePlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/DeletePlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/DeletePlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/DeleteProjectCommand.ts b/clients/client-iot-1click-projects/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/DeleteProjectCommand.ts rename to clients/client-iot-1click-projects/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-iot-1click-projects/commands/DescribePlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/DescribePlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/DescribePlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/DescribePlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/DescribeProjectCommand.ts b/clients/client-iot-1click-projects/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/DescribeProjectCommand.ts rename to clients/client-iot-1click-projects/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-iot-1click-projects/commands/DisassociateDeviceFromPlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/DisassociateDeviceFromPlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/DisassociateDeviceFromPlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/DisassociateDeviceFromPlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/GetDevicesInPlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/GetDevicesInPlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/GetDevicesInPlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/GetDevicesInPlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/ListPlacementsCommand.ts b/clients/client-iot-1click-projects/src/commands/ListPlacementsCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/ListPlacementsCommand.ts rename to clients/client-iot-1click-projects/src/commands/ListPlacementsCommand.ts diff --git a/clients/client-iot-1click-projects/commands/ListProjectsCommand.ts b/clients/client-iot-1click-projects/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/ListProjectsCommand.ts rename to clients/client-iot-1click-projects/src/commands/ListProjectsCommand.ts diff --git a/clients/client-iot-1click-projects/commands/ListTagsForResourceCommand.ts b/clients/client-iot-1click-projects/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/ListTagsForResourceCommand.ts rename to clients/client-iot-1click-projects/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iot-1click-projects/commands/TagResourceCommand.ts b/clients/client-iot-1click-projects/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/TagResourceCommand.ts rename to clients/client-iot-1click-projects/src/commands/TagResourceCommand.ts diff --git a/clients/client-iot-1click-projects/commands/UntagResourceCommand.ts b/clients/client-iot-1click-projects/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/UntagResourceCommand.ts rename to clients/client-iot-1click-projects/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iot-1click-projects/commands/UpdatePlacementCommand.ts b/clients/client-iot-1click-projects/src/commands/UpdatePlacementCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/UpdatePlacementCommand.ts rename to clients/client-iot-1click-projects/src/commands/UpdatePlacementCommand.ts diff --git a/clients/client-iot-1click-projects/commands/UpdateProjectCommand.ts b/clients/client-iot-1click-projects/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-iot-1click-projects/commands/UpdateProjectCommand.ts rename to clients/client-iot-1click-projects/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-iot-1click-projects/endpoints.ts b/clients/client-iot-1click-projects/src/endpoints.ts similarity index 100% rename from clients/client-iot-1click-projects/endpoints.ts rename to clients/client-iot-1click-projects/src/endpoints.ts diff --git a/clients/client-iot-1click-projects/index.ts b/clients/client-iot-1click-projects/src/index.ts similarity index 100% rename from clients/client-iot-1click-projects/index.ts rename to clients/client-iot-1click-projects/src/index.ts diff --git a/clients/client-iot-1click-projects/models/index.ts b/clients/client-iot-1click-projects/src/models/index.ts similarity index 100% rename from clients/client-iot-1click-projects/models/index.ts rename to clients/client-iot-1click-projects/src/models/index.ts diff --git a/clients/client-iot-1click-projects/models/models_0.ts b/clients/client-iot-1click-projects/src/models/models_0.ts similarity index 100% rename from clients/client-iot-1click-projects/models/models_0.ts rename to clients/client-iot-1click-projects/src/models/models_0.ts diff --git a/clients/client-iot-1click-projects/pagination/Interfaces.ts b/clients/client-iot-1click-projects/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iot-1click-projects/pagination/Interfaces.ts rename to clients/client-iot-1click-projects/src/pagination/Interfaces.ts diff --git a/clients/client-iot-1click-projects/pagination/ListPlacementsPaginator.ts b/clients/client-iot-1click-projects/src/pagination/ListPlacementsPaginator.ts similarity index 100% rename from clients/client-iot-1click-projects/pagination/ListPlacementsPaginator.ts rename to clients/client-iot-1click-projects/src/pagination/ListPlacementsPaginator.ts diff --git a/clients/client-iot-1click-projects/pagination/ListProjectsPaginator.ts b/clients/client-iot-1click-projects/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-iot-1click-projects/pagination/ListProjectsPaginator.ts rename to clients/client-iot-1click-projects/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-iot-1click-projects/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-1click-projects/protocols/Aws_restJson1.ts rename to clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-1click-projects/src/runtimeConfig.browser.ts b/clients/client-iot-1click-projects/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cbcc1012c5b2 --- /dev/null +++ b/clients/client-iot-1click-projects/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoT1ClickProjectsClientConfig } from "./IoT1ClickProjectsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-1click-projects/runtimeConfig.native.ts b/clients/client-iot-1click-projects/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-1click-projects/runtimeConfig.native.ts rename to clients/client-iot-1click-projects/src/runtimeConfig.native.ts diff --git a/clients/client-iot-1click-projects/runtimeConfig.shared.ts b/clients/client-iot-1click-projects/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-1click-projects/runtimeConfig.shared.ts rename to clients/client-iot-1click-projects/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-1click-projects/src/runtimeConfig.ts b/clients/client-iot-1click-projects/src/runtimeConfig.ts new file mode 100644 index 000000000000..846c9f6d27ca --- /dev/null +++ b/clients/client-iot-1click-projects/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoT1ClickProjectsClientConfig } from "./IoT1ClickProjectsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-1click-projects/tsconfig.es.json b/clients/client-iot-1click-projects/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-1click-projects/tsconfig.es.json +++ b/clients/client-iot-1click-projects/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-1click-projects/tsconfig.json b/clients/client-iot-1click-projects/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-1click-projects/tsconfig.json +++ b/clients/client-iot-1click-projects/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-1click-projects/tsconfig.types.json b/clients/client-iot-1click-projects/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-1click-projects/tsconfig.types.json +++ b/clients/client-iot-1click-projects/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-data-plane/.gitignore b/clients/client-iot-data-plane/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-data-plane/.gitignore +++ b/clients/client-iot-data-plane/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-data-plane/package.json b/clients/client-iot-data-plane/package.json index 875bd94ed40e..fb7a8e8de39d 100644 --- a/clients/client-iot-data-plane/package.json +++ b/clients/client-iot-data-plane/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-data-plane", "repository": { "type": "git", diff --git a/clients/client-iot-data-plane/runtimeConfig.browser.ts b/clients/client-iot-data-plane/runtimeConfig.browser.ts deleted file mode 100644 index 302007bbc283..000000000000 --- a/clients/client-iot-data-plane/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTDataPlaneClientConfig } from "./IoTDataPlaneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-data-plane/runtimeConfig.ts b/clients/client-iot-data-plane/runtimeConfig.ts deleted file mode 100644 index 591d7c6a23f9..000000000000 --- a/clients/client-iot-data-plane/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTDataPlaneClientConfig } from "./IoTDataPlaneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-data-plane/IoTDataPlane.ts b/clients/client-iot-data-plane/src/IoTDataPlane.ts similarity index 100% rename from clients/client-iot-data-plane/IoTDataPlane.ts rename to clients/client-iot-data-plane/src/IoTDataPlane.ts diff --git a/clients/client-iot-data-plane/IoTDataPlaneClient.ts b/clients/client-iot-data-plane/src/IoTDataPlaneClient.ts similarity index 100% rename from clients/client-iot-data-plane/IoTDataPlaneClient.ts rename to clients/client-iot-data-plane/src/IoTDataPlaneClient.ts diff --git a/clients/client-iot-data-plane/commands/DeleteThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/DeleteThingShadowCommand.ts rename to clients/client-iot-data-plane/src/commands/DeleteThingShadowCommand.ts diff --git a/clients/client-iot-data-plane/commands/GetRetainedMessageCommand.ts b/clients/client-iot-data-plane/src/commands/GetRetainedMessageCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/GetRetainedMessageCommand.ts rename to clients/client-iot-data-plane/src/commands/GetRetainedMessageCommand.ts diff --git a/clients/client-iot-data-plane/commands/GetThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/GetThingShadowCommand.ts rename to clients/client-iot-data-plane/src/commands/GetThingShadowCommand.ts diff --git a/clients/client-iot-data-plane/commands/ListNamedShadowsForThingCommand.ts b/clients/client-iot-data-plane/src/commands/ListNamedShadowsForThingCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/ListNamedShadowsForThingCommand.ts rename to clients/client-iot-data-plane/src/commands/ListNamedShadowsForThingCommand.ts diff --git a/clients/client-iot-data-plane/commands/ListRetainedMessagesCommand.ts b/clients/client-iot-data-plane/src/commands/ListRetainedMessagesCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/ListRetainedMessagesCommand.ts rename to clients/client-iot-data-plane/src/commands/ListRetainedMessagesCommand.ts diff --git a/clients/client-iot-data-plane/commands/PublishCommand.ts b/clients/client-iot-data-plane/src/commands/PublishCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/PublishCommand.ts rename to clients/client-iot-data-plane/src/commands/PublishCommand.ts diff --git a/clients/client-iot-data-plane/commands/UpdateThingShadowCommand.ts b/clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts similarity index 100% rename from clients/client-iot-data-plane/commands/UpdateThingShadowCommand.ts rename to clients/client-iot-data-plane/src/commands/UpdateThingShadowCommand.ts diff --git a/clients/client-iot-data-plane/endpoints.ts b/clients/client-iot-data-plane/src/endpoints.ts similarity index 100% rename from clients/client-iot-data-plane/endpoints.ts rename to clients/client-iot-data-plane/src/endpoints.ts diff --git a/clients/client-iot-data-plane/index.ts b/clients/client-iot-data-plane/src/index.ts similarity index 100% rename from clients/client-iot-data-plane/index.ts rename to clients/client-iot-data-plane/src/index.ts diff --git a/clients/client-iot-data-plane/models/index.ts b/clients/client-iot-data-plane/src/models/index.ts similarity index 100% rename from clients/client-iot-data-plane/models/index.ts rename to clients/client-iot-data-plane/src/models/index.ts diff --git a/clients/client-iot-data-plane/models/models_0.ts b/clients/client-iot-data-plane/src/models/models_0.ts similarity index 100% rename from clients/client-iot-data-plane/models/models_0.ts rename to clients/client-iot-data-plane/src/models/models_0.ts diff --git a/clients/client-iot-data-plane/pagination/Interfaces.ts b/clients/client-iot-data-plane/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iot-data-plane/pagination/Interfaces.ts rename to clients/client-iot-data-plane/src/pagination/Interfaces.ts diff --git a/clients/client-iot-data-plane/pagination/ListRetainedMessagesPaginator.ts b/clients/client-iot-data-plane/src/pagination/ListRetainedMessagesPaginator.ts similarity index 100% rename from clients/client-iot-data-plane/pagination/ListRetainedMessagesPaginator.ts rename to clients/client-iot-data-plane/src/pagination/ListRetainedMessagesPaginator.ts diff --git a/clients/client-iot-data-plane/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-data-plane/protocols/Aws_restJson1.ts rename to clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-data-plane/src/runtimeConfig.browser.ts b/clients/client-iot-data-plane/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..56b3ef280aca --- /dev/null +++ b/clients/client-iot-data-plane/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTDataPlaneClientConfig } from "./IoTDataPlaneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-data-plane/runtimeConfig.native.ts b/clients/client-iot-data-plane/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-data-plane/runtimeConfig.native.ts rename to clients/client-iot-data-plane/src/runtimeConfig.native.ts diff --git a/clients/client-iot-data-plane/runtimeConfig.shared.ts b/clients/client-iot-data-plane/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-data-plane/runtimeConfig.shared.ts rename to clients/client-iot-data-plane/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-data-plane/src/runtimeConfig.ts b/clients/client-iot-data-plane/src/runtimeConfig.ts new file mode 100644 index 000000000000..63753521bf3e --- /dev/null +++ b/clients/client-iot-data-plane/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTDataPlaneClientConfig } from "./IoTDataPlaneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-data-plane/tsconfig.es.json b/clients/client-iot-data-plane/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-data-plane/tsconfig.es.json +++ b/clients/client-iot-data-plane/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-data-plane/tsconfig.json b/clients/client-iot-data-plane/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-data-plane/tsconfig.json +++ b/clients/client-iot-data-plane/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-data-plane/tsconfig.types.json b/clients/client-iot-data-plane/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-data-plane/tsconfig.types.json +++ b/clients/client-iot-data-plane/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-events-data/.gitignore b/clients/client-iot-events-data/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-events-data/.gitignore +++ b/clients/client-iot-events-data/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-events-data/package.json b/clients/client-iot-events-data/package.json index ee43bf6c3aa2..c48c27ef91e1 100644 --- a/clients/client-iot-events-data/package.json +++ b/clients/client-iot-events-data/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-events-data", "repository": { "type": "git", diff --git a/clients/client-iot-events-data/runtimeConfig.browser.ts b/clients/client-iot-events-data/runtimeConfig.browser.ts deleted file mode 100644 index c323e572ed8d..000000000000 --- a/clients/client-iot-events-data/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTEventsDataClientConfig } from "./IoTEventsDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-events-data/runtimeConfig.ts b/clients/client-iot-events-data/runtimeConfig.ts deleted file mode 100644 index d77159ea8e6d..000000000000 --- a/clients/client-iot-events-data/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTEventsDataClientConfig } from "./IoTEventsDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-events-data/IoTEventsData.ts b/clients/client-iot-events-data/src/IoTEventsData.ts similarity index 100% rename from clients/client-iot-events-data/IoTEventsData.ts rename to clients/client-iot-events-data/src/IoTEventsData.ts diff --git a/clients/client-iot-events-data/IoTEventsDataClient.ts b/clients/client-iot-events-data/src/IoTEventsDataClient.ts similarity index 100% rename from clients/client-iot-events-data/IoTEventsDataClient.ts rename to clients/client-iot-events-data/src/IoTEventsDataClient.ts diff --git a/clients/client-iot-events-data/commands/BatchAcknowledgeAlarmCommand.ts b/clients/client-iot-events-data/src/commands/BatchAcknowledgeAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchAcknowledgeAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/BatchAcknowledgeAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchDisableAlarmCommand.ts b/clients/client-iot-events-data/src/commands/BatchDisableAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchDisableAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/BatchDisableAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchEnableAlarmCommand.ts b/clients/client-iot-events-data/src/commands/BatchEnableAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchEnableAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/BatchEnableAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchPutMessageCommand.ts b/clients/client-iot-events-data/src/commands/BatchPutMessageCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchPutMessageCommand.ts rename to clients/client-iot-events-data/src/commands/BatchPutMessageCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchResetAlarmCommand.ts b/clients/client-iot-events-data/src/commands/BatchResetAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchResetAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/BatchResetAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchSnoozeAlarmCommand.ts b/clients/client-iot-events-data/src/commands/BatchSnoozeAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchSnoozeAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/BatchSnoozeAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/BatchUpdateDetectorCommand.ts b/clients/client-iot-events-data/src/commands/BatchUpdateDetectorCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/BatchUpdateDetectorCommand.ts rename to clients/client-iot-events-data/src/commands/BatchUpdateDetectorCommand.ts diff --git a/clients/client-iot-events-data/commands/DescribeAlarmCommand.ts b/clients/client-iot-events-data/src/commands/DescribeAlarmCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/DescribeAlarmCommand.ts rename to clients/client-iot-events-data/src/commands/DescribeAlarmCommand.ts diff --git a/clients/client-iot-events-data/commands/DescribeDetectorCommand.ts b/clients/client-iot-events-data/src/commands/DescribeDetectorCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/DescribeDetectorCommand.ts rename to clients/client-iot-events-data/src/commands/DescribeDetectorCommand.ts diff --git a/clients/client-iot-events-data/commands/ListAlarmsCommand.ts b/clients/client-iot-events-data/src/commands/ListAlarmsCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/ListAlarmsCommand.ts rename to clients/client-iot-events-data/src/commands/ListAlarmsCommand.ts diff --git a/clients/client-iot-events-data/commands/ListDetectorsCommand.ts b/clients/client-iot-events-data/src/commands/ListDetectorsCommand.ts similarity index 100% rename from clients/client-iot-events-data/commands/ListDetectorsCommand.ts rename to clients/client-iot-events-data/src/commands/ListDetectorsCommand.ts diff --git a/clients/client-iot-events-data/endpoints.ts b/clients/client-iot-events-data/src/endpoints.ts similarity index 100% rename from clients/client-iot-events-data/endpoints.ts rename to clients/client-iot-events-data/src/endpoints.ts diff --git a/clients/client-iot-events-data/index.ts b/clients/client-iot-events-data/src/index.ts similarity index 100% rename from clients/client-iot-events-data/index.ts rename to clients/client-iot-events-data/src/index.ts diff --git a/clients/client-iot-events-data/models/index.ts b/clients/client-iot-events-data/src/models/index.ts similarity index 100% rename from clients/client-iot-events-data/models/index.ts rename to clients/client-iot-events-data/src/models/index.ts diff --git a/clients/client-iot-events-data/models/models_0.ts b/clients/client-iot-events-data/src/models/models_0.ts similarity index 100% rename from clients/client-iot-events-data/models/models_0.ts rename to clients/client-iot-events-data/src/models/models_0.ts diff --git a/clients/client-iot-events-data/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-events-data/protocols/Aws_restJson1.ts rename to clients/client-iot-events-data/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-events-data/src/runtimeConfig.browser.ts b/clients/client-iot-events-data/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..29cb5c93f1f2 --- /dev/null +++ b/clients/client-iot-events-data/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTEventsDataClientConfig } from "./IoTEventsDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-events-data/runtimeConfig.native.ts b/clients/client-iot-events-data/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-events-data/runtimeConfig.native.ts rename to clients/client-iot-events-data/src/runtimeConfig.native.ts diff --git a/clients/client-iot-events-data/runtimeConfig.shared.ts b/clients/client-iot-events-data/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-events-data/runtimeConfig.shared.ts rename to clients/client-iot-events-data/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-events-data/src/runtimeConfig.ts b/clients/client-iot-events-data/src/runtimeConfig.ts new file mode 100644 index 000000000000..e6d5dd431d07 --- /dev/null +++ b/clients/client-iot-events-data/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTEventsDataClientConfig } from "./IoTEventsDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-events-data/tsconfig.es.json b/clients/client-iot-events-data/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-events-data/tsconfig.es.json +++ b/clients/client-iot-events-data/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-events-data/tsconfig.json b/clients/client-iot-events-data/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-events-data/tsconfig.json +++ b/clients/client-iot-events-data/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-events-data/tsconfig.types.json b/clients/client-iot-events-data/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-events-data/tsconfig.types.json +++ b/clients/client-iot-events-data/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-events/.gitignore b/clients/client-iot-events/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-events/.gitignore +++ b/clients/client-iot-events/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-events/package.json b/clients/client-iot-events/package.json index 388cf49c3990..36855019a992 100644 --- a/clients/client-iot-events/package.json +++ b/clients/client-iot-events/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-events", "repository": { "type": "git", diff --git a/clients/client-iot-events/runtimeConfig.browser.ts b/clients/client-iot-events/runtimeConfig.browser.ts deleted file mode 100644 index 7773e597cff2..000000000000 --- a/clients/client-iot-events/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTEventsClientConfig } from "./IoTEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTEventsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-events/runtimeConfig.ts b/clients/client-iot-events/runtimeConfig.ts deleted file mode 100644 index f91718a6975d..000000000000 --- a/clients/client-iot-events/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTEventsClientConfig } from "./IoTEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTEventsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-events/IoTEvents.ts b/clients/client-iot-events/src/IoTEvents.ts similarity index 100% rename from clients/client-iot-events/IoTEvents.ts rename to clients/client-iot-events/src/IoTEvents.ts diff --git a/clients/client-iot-events/IoTEventsClient.ts b/clients/client-iot-events/src/IoTEventsClient.ts similarity index 100% rename from clients/client-iot-events/IoTEventsClient.ts rename to clients/client-iot-events/src/IoTEventsClient.ts diff --git a/clients/client-iot-events/commands/CreateAlarmModelCommand.ts b/clients/client-iot-events/src/commands/CreateAlarmModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/CreateAlarmModelCommand.ts rename to clients/client-iot-events/src/commands/CreateAlarmModelCommand.ts diff --git a/clients/client-iot-events/commands/CreateDetectorModelCommand.ts b/clients/client-iot-events/src/commands/CreateDetectorModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/CreateDetectorModelCommand.ts rename to clients/client-iot-events/src/commands/CreateDetectorModelCommand.ts diff --git a/clients/client-iot-events/commands/CreateInputCommand.ts b/clients/client-iot-events/src/commands/CreateInputCommand.ts similarity index 100% rename from clients/client-iot-events/commands/CreateInputCommand.ts rename to clients/client-iot-events/src/commands/CreateInputCommand.ts diff --git a/clients/client-iot-events/commands/DeleteAlarmModelCommand.ts b/clients/client-iot-events/src/commands/DeleteAlarmModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DeleteAlarmModelCommand.ts rename to clients/client-iot-events/src/commands/DeleteAlarmModelCommand.ts diff --git a/clients/client-iot-events/commands/DeleteDetectorModelCommand.ts b/clients/client-iot-events/src/commands/DeleteDetectorModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DeleteDetectorModelCommand.ts rename to clients/client-iot-events/src/commands/DeleteDetectorModelCommand.ts diff --git a/clients/client-iot-events/commands/DeleteInputCommand.ts b/clients/client-iot-events/src/commands/DeleteInputCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DeleteInputCommand.ts rename to clients/client-iot-events/src/commands/DeleteInputCommand.ts diff --git a/clients/client-iot-events/commands/DescribeAlarmModelCommand.ts b/clients/client-iot-events/src/commands/DescribeAlarmModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DescribeAlarmModelCommand.ts rename to clients/client-iot-events/src/commands/DescribeAlarmModelCommand.ts diff --git a/clients/client-iot-events/commands/DescribeDetectorModelAnalysisCommand.ts b/clients/client-iot-events/src/commands/DescribeDetectorModelAnalysisCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DescribeDetectorModelAnalysisCommand.ts rename to clients/client-iot-events/src/commands/DescribeDetectorModelAnalysisCommand.ts diff --git a/clients/client-iot-events/commands/DescribeDetectorModelCommand.ts b/clients/client-iot-events/src/commands/DescribeDetectorModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DescribeDetectorModelCommand.ts rename to clients/client-iot-events/src/commands/DescribeDetectorModelCommand.ts diff --git a/clients/client-iot-events/commands/DescribeInputCommand.ts b/clients/client-iot-events/src/commands/DescribeInputCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DescribeInputCommand.ts rename to clients/client-iot-events/src/commands/DescribeInputCommand.ts diff --git a/clients/client-iot-events/commands/DescribeLoggingOptionsCommand.ts b/clients/client-iot-events/src/commands/DescribeLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/DescribeLoggingOptionsCommand.ts rename to clients/client-iot-events/src/commands/DescribeLoggingOptionsCommand.ts diff --git a/clients/client-iot-events/commands/GetDetectorModelAnalysisResultsCommand.ts b/clients/client-iot-events/src/commands/GetDetectorModelAnalysisResultsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/GetDetectorModelAnalysisResultsCommand.ts rename to clients/client-iot-events/src/commands/GetDetectorModelAnalysisResultsCommand.ts diff --git a/clients/client-iot-events/commands/ListAlarmModelVersionsCommand.ts b/clients/client-iot-events/src/commands/ListAlarmModelVersionsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListAlarmModelVersionsCommand.ts rename to clients/client-iot-events/src/commands/ListAlarmModelVersionsCommand.ts diff --git a/clients/client-iot-events/commands/ListAlarmModelsCommand.ts b/clients/client-iot-events/src/commands/ListAlarmModelsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListAlarmModelsCommand.ts rename to clients/client-iot-events/src/commands/ListAlarmModelsCommand.ts diff --git a/clients/client-iot-events/commands/ListDetectorModelVersionsCommand.ts b/clients/client-iot-events/src/commands/ListDetectorModelVersionsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListDetectorModelVersionsCommand.ts rename to clients/client-iot-events/src/commands/ListDetectorModelVersionsCommand.ts diff --git a/clients/client-iot-events/commands/ListDetectorModelsCommand.ts b/clients/client-iot-events/src/commands/ListDetectorModelsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListDetectorModelsCommand.ts rename to clients/client-iot-events/src/commands/ListDetectorModelsCommand.ts diff --git a/clients/client-iot-events/commands/ListInputRoutingsCommand.ts b/clients/client-iot-events/src/commands/ListInputRoutingsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListInputRoutingsCommand.ts rename to clients/client-iot-events/src/commands/ListInputRoutingsCommand.ts diff --git a/clients/client-iot-events/commands/ListInputsCommand.ts b/clients/client-iot-events/src/commands/ListInputsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListInputsCommand.ts rename to clients/client-iot-events/src/commands/ListInputsCommand.ts diff --git a/clients/client-iot-events/commands/ListTagsForResourceCommand.ts b/clients/client-iot-events/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iot-events/commands/ListTagsForResourceCommand.ts rename to clients/client-iot-events/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iot-events/commands/PutLoggingOptionsCommand.ts b/clients/client-iot-events/src/commands/PutLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot-events/commands/PutLoggingOptionsCommand.ts rename to clients/client-iot-events/src/commands/PutLoggingOptionsCommand.ts diff --git a/clients/client-iot-events/commands/StartDetectorModelAnalysisCommand.ts b/clients/client-iot-events/src/commands/StartDetectorModelAnalysisCommand.ts similarity index 100% rename from clients/client-iot-events/commands/StartDetectorModelAnalysisCommand.ts rename to clients/client-iot-events/src/commands/StartDetectorModelAnalysisCommand.ts diff --git a/clients/client-iot-events/commands/TagResourceCommand.ts b/clients/client-iot-events/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iot-events/commands/TagResourceCommand.ts rename to clients/client-iot-events/src/commands/TagResourceCommand.ts diff --git a/clients/client-iot-events/commands/UntagResourceCommand.ts b/clients/client-iot-events/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iot-events/commands/UntagResourceCommand.ts rename to clients/client-iot-events/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iot-events/commands/UpdateAlarmModelCommand.ts b/clients/client-iot-events/src/commands/UpdateAlarmModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/UpdateAlarmModelCommand.ts rename to clients/client-iot-events/src/commands/UpdateAlarmModelCommand.ts diff --git a/clients/client-iot-events/commands/UpdateDetectorModelCommand.ts b/clients/client-iot-events/src/commands/UpdateDetectorModelCommand.ts similarity index 100% rename from clients/client-iot-events/commands/UpdateDetectorModelCommand.ts rename to clients/client-iot-events/src/commands/UpdateDetectorModelCommand.ts diff --git a/clients/client-iot-events/commands/UpdateInputCommand.ts b/clients/client-iot-events/src/commands/UpdateInputCommand.ts similarity index 100% rename from clients/client-iot-events/commands/UpdateInputCommand.ts rename to clients/client-iot-events/src/commands/UpdateInputCommand.ts diff --git a/clients/client-iot-events/endpoints.ts b/clients/client-iot-events/src/endpoints.ts similarity index 100% rename from clients/client-iot-events/endpoints.ts rename to clients/client-iot-events/src/endpoints.ts diff --git a/clients/client-iot-events/index.ts b/clients/client-iot-events/src/index.ts similarity index 100% rename from clients/client-iot-events/index.ts rename to clients/client-iot-events/src/index.ts diff --git a/clients/client-iot-events/models/index.ts b/clients/client-iot-events/src/models/index.ts similarity index 100% rename from clients/client-iot-events/models/index.ts rename to clients/client-iot-events/src/models/index.ts diff --git a/clients/client-iot-events/models/models_0.ts b/clients/client-iot-events/src/models/models_0.ts similarity index 100% rename from clients/client-iot-events/models/models_0.ts rename to clients/client-iot-events/src/models/models_0.ts diff --git a/clients/client-iot-events/protocols/Aws_restJson1.ts b/clients/client-iot-events/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-events/protocols/Aws_restJson1.ts rename to clients/client-iot-events/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-events/src/runtimeConfig.browser.ts b/clients/client-iot-events/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..571f49949adb --- /dev/null +++ b/clients/client-iot-events/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTEventsClientConfig } from "./IoTEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTEventsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-events/runtimeConfig.native.ts b/clients/client-iot-events/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-events/runtimeConfig.native.ts rename to clients/client-iot-events/src/runtimeConfig.native.ts diff --git a/clients/client-iot-events/runtimeConfig.shared.ts b/clients/client-iot-events/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-events/runtimeConfig.shared.ts rename to clients/client-iot-events/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-events/src/runtimeConfig.ts b/clients/client-iot-events/src/runtimeConfig.ts new file mode 100644 index 000000000000..80663880850a --- /dev/null +++ b/clients/client-iot-events/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTEventsClientConfig } from "./IoTEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTEventsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-events/tsconfig.es.json b/clients/client-iot-events/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-events/tsconfig.es.json +++ b/clients/client-iot-events/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-events/tsconfig.json b/clients/client-iot-events/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-events/tsconfig.json +++ b/clients/client-iot-events/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-events/tsconfig.types.json b/clients/client-iot-events/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-events/tsconfig.types.json +++ b/clients/client-iot-events/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-jobs-data-plane/.gitignore b/clients/client-iot-jobs-data-plane/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot-jobs-data-plane/.gitignore +++ b/clients/client-iot-jobs-data-plane/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-jobs-data-plane/package.json b/clients/client-iot-jobs-data-plane/package.json index aa914ebf67fc..3758836006f4 100644 --- a/clients/client-iot-jobs-data-plane/package.json +++ b/clients/client-iot-jobs-data-plane/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-jobs-data-plane", "repository": { "type": "git", diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts deleted file mode 100644 index 644c7acc8031..000000000000 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTJobsDataPlaneClientConfig } from "./IoTJobsDataPlaneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/runtimeConfig.ts deleted file mode 100644 index 8738cbeee92d..000000000000 --- a/clients/client-iot-jobs-data-plane/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTJobsDataPlaneClientConfig } from "./IoTJobsDataPlaneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-jobs-data-plane/IoTJobsDataPlane.ts b/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlane.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/IoTJobsDataPlane.ts rename to clients/client-iot-jobs-data-plane/src/IoTJobsDataPlane.ts diff --git a/clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts b/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/IoTJobsDataPlaneClient.ts rename to clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts diff --git a/clients/client-iot-jobs-data-plane/commands/DescribeJobExecutionCommand.ts b/clients/client-iot-jobs-data-plane/src/commands/DescribeJobExecutionCommand.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/commands/DescribeJobExecutionCommand.ts rename to clients/client-iot-jobs-data-plane/src/commands/DescribeJobExecutionCommand.ts diff --git a/clients/client-iot-jobs-data-plane/commands/GetPendingJobExecutionsCommand.ts b/clients/client-iot-jobs-data-plane/src/commands/GetPendingJobExecutionsCommand.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/commands/GetPendingJobExecutionsCommand.ts rename to clients/client-iot-jobs-data-plane/src/commands/GetPendingJobExecutionsCommand.ts diff --git a/clients/client-iot-jobs-data-plane/commands/StartNextPendingJobExecutionCommand.ts b/clients/client-iot-jobs-data-plane/src/commands/StartNextPendingJobExecutionCommand.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/commands/StartNextPendingJobExecutionCommand.ts rename to clients/client-iot-jobs-data-plane/src/commands/StartNextPendingJobExecutionCommand.ts diff --git a/clients/client-iot-jobs-data-plane/commands/UpdateJobExecutionCommand.ts b/clients/client-iot-jobs-data-plane/src/commands/UpdateJobExecutionCommand.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/commands/UpdateJobExecutionCommand.ts rename to clients/client-iot-jobs-data-plane/src/commands/UpdateJobExecutionCommand.ts diff --git a/clients/client-iot-jobs-data-plane/endpoints.ts b/clients/client-iot-jobs-data-plane/src/endpoints.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/endpoints.ts rename to clients/client-iot-jobs-data-plane/src/endpoints.ts diff --git a/clients/client-iot-jobs-data-plane/index.ts b/clients/client-iot-jobs-data-plane/src/index.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/index.ts rename to clients/client-iot-jobs-data-plane/src/index.ts diff --git a/clients/client-iot-jobs-data-plane/models/index.ts b/clients/client-iot-jobs-data-plane/src/models/index.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/models/index.ts rename to clients/client-iot-jobs-data-plane/src/models/index.ts diff --git a/clients/client-iot-jobs-data-plane/models/models_0.ts b/clients/client-iot-jobs-data-plane/src/models/models_0.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/models/models_0.ts rename to clients/client-iot-jobs-data-plane/src/models/models_0.ts diff --git a/clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/protocols/Aws_restJson1.ts rename to clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-jobs-data-plane/src/runtimeConfig.browser.ts b/clients/client-iot-jobs-data-plane/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..eea3255e548c --- /dev/null +++ b/clients/client-iot-jobs-data-plane/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTJobsDataPlaneClientConfig } from "./IoTJobsDataPlaneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.native.ts b/clients/client-iot-jobs-data-plane/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/runtimeConfig.native.ts rename to clients/client-iot-jobs-data-plane/src/runtimeConfig.native.ts diff --git a/clients/client-iot-jobs-data-plane/runtimeConfig.shared.ts b/clients/client-iot-jobs-data-plane/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-jobs-data-plane/runtimeConfig.shared.ts rename to clients/client-iot-jobs-data-plane/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts new file mode 100644 index 000000000000..f35b506b6b98 --- /dev/null +++ b/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTJobsDataPlaneClientConfig } from "./IoTJobsDataPlaneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-jobs-data-plane/tsconfig.es.json b/clients/client-iot-jobs-data-plane/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-jobs-data-plane/tsconfig.es.json +++ b/clients/client-iot-jobs-data-plane/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-jobs-data-plane/tsconfig.json b/clients/client-iot-jobs-data-plane/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-jobs-data-plane/tsconfig.json +++ b/clients/client-iot-jobs-data-plane/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-jobs-data-plane/tsconfig.types.json b/clients/client-iot-jobs-data-plane/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-jobs-data-plane/tsconfig.types.json +++ b/clients/client-iot-jobs-data-plane/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot-wireless/.gitignore b/clients/client-iot-wireless/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-iot-wireless/.gitignore +++ b/clients/client-iot-wireless/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot-wireless/package.json b/clients/client-iot-wireless/package.json index 03b011d1c1bc..d5b3bd2cb9c4 100644 --- a/clients/client-iot-wireless/package.json +++ b/clients/client-iot-wireless/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot-wireless", "repository": { "type": "git", diff --git a/clients/client-iot-wireless/runtimeConfig.browser.ts b/clients/client-iot-wireless/runtimeConfig.browser.ts deleted file mode 100644 index aba6cee6b1c7..000000000000 --- a/clients/client-iot-wireless/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTWirelessClientConfig } from "./IoTWirelessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-wireless/runtimeConfig.ts b/clients/client-iot-wireless/runtimeConfig.ts deleted file mode 100644 index 19451d6e5636..000000000000 --- a/clients/client-iot-wireless/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTWirelessClientConfig } from "./IoTWirelessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot-wireless/IoTWireless.ts b/clients/client-iot-wireless/src/IoTWireless.ts similarity index 100% rename from clients/client-iot-wireless/IoTWireless.ts rename to clients/client-iot-wireless/src/IoTWireless.ts diff --git a/clients/client-iot-wireless/IoTWirelessClient.ts b/clients/client-iot-wireless/src/IoTWirelessClient.ts similarity index 100% rename from clients/client-iot-wireless/IoTWirelessClient.ts rename to clients/client-iot-wireless/src/IoTWirelessClient.ts diff --git a/clients/client-iot-wireless/commands/AssociateAwsAccountWithPartnerAccountCommand.ts b/clients/client-iot-wireless/src/commands/AssociateAwsAccountWithPartnerAccountCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/AssociateAwsAccountWithPartnerAccountCommand.ts rename to clients/client-iot-wireless/src/commands/AssociateAwsAccountWithPartnerAccountCommand.ts diff --git a/clients/client-iot-wireless/commands/AssociateWirelessDeviceWithThingCommand.ts b/clients/client-iot-wireless/src/commands/AssociateWirelessDeviceWithThingCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/AssociateWirelessDeviceWithThingCommand.ts rename to clients/client-iot-wireless/src/commands/AssociateWirelessDeviceWithThingCommand.ts diff --git a/clients/client-iot-wireless/commands/AssociateWirelessGatewayWithCertificateCommand.ts b/clients/client-iot-wireless/src/commands/AssociateWirelessGatewayWithCertificateCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/AssociateWirelessGatewayWithCertificateCommand.ts rename to clients/client-iot-wireless/src/commands/AssociateWirelessGatewayWithCertificateCommand.ts diff --git a/clients/client-iot-wireless/commands/AssociateWirelessGatewayWithThingCommand.ts b/clients/client-iot-wireless/src/commands/AssociateWirelessGatewayWithThingCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/AssociateWirelessGatewayWithThingCommand.ts rename to clients/client-iot-wireless/src/commands/AssociateWirelessGatewayWithThingCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateDestinationCommand.ts b/clients/client-iot-wireless/src/commands/CreateDestinationCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateDestinationCommand.ts rename to clients/client-iot-wireless/src/commands/CreateDestinationCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateDeviceProfileCommand.ts b/clients/client-iot-wireless/src/commands/CreateDeviceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateDeviceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/CreateDeviceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateServiceProfileCommand.ts b/clients/client-iot-wireless/src/commands/CreateServiceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateServiceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/CreateServiceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/CreateWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/CreateWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateWirelessGatewayCommand.ts b/clients/client-iot-wireless/src/commands/CreateWirelessGatewayCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateWirelessGatewayCommand.ts rename to clients/client-iot-wireless/src/commands/CreateWirelessGatewayCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateWirelessGatewayTaskCommand.ts b/clients/client-iot-wireless/src/commands/CreateWirelessGatewayTaskCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateWirelessGatewayTaskCommand.ts rename to clients/client-iot-wireless/src/commands/CreateWirelessGatewayTaskCommand.ts diff --git a/clients/client-iot-wireless/commands/CreateWirelessGatewayTaskDefinitionCommand.ts b/clients/client-iot-wireless/src/commands/CreateWirelessGatewayTaskDefinitionCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/CreateWirelessGatewayTaskDefinitionCommand.ts rename to clients/client-iot-wireless/src/commands/CreateWirelessGatewayTaskDefinitionCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteDestinationCommand.ts b/clients/client-iot-wireless/src/commands/DeleteDestinationCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteDestinationCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteDestinationCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteDeviceProfileCommand.ts b/clients/client-iot-wireless/src/commands/DeleteDeviceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteDeviceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteDeviceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteServiceProfileCommand.ts b/clients/client-iot-wireless/src/commands/DeleteServiceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteServiceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteServiceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/DeleteWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteWirelessGatewayCommand.ts b/clients/client-iot-wireless/src/commands/DeleteWirelessGatewayCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteWirelessGatewayCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteWirelessGatewayCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteWirelessGatewayTaskCommand.ts b/clients/client-iot-wireless/src/commands/DeleteWirelessGatewayTaskCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteWirelessGatewayTaskCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteWirelessGatewayTaskCommand.ts diff --git a/clients/client-iot-wireless/commands/DeleteWirelessGatewayTaskDefinitionCommand.ts b/clients/client-iot-wireless/src/commands/DeleteWirelessGatewayTaskDefinitionCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DeleteWirelessGatewayTaskDefinitionCommand.ts rename to clients/client-iot-wireless/src/commands/DeleteWirelessGatewayTaskDefinitionCommand.ts diff --git a/clients/client-iot-wireless/commands/DisassociateAwsAccountFromPartnerAccountCommand.ts b/clients/client-iot-wireless/src/commands/DisassociateAwsAccountFromPartnerAccountCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DisassociateAwsAccountFromPartnerAccountCommand.ts rename to clients/client-iot-wireless/src/commands/DisassociateAwsAccountFromPartnerAccountCommand.ts diff --git a/clients/client-iot-wireless/commands/DisassociateWirelessDeviceFromThingCommand.ts b/clients/client-iot-wireless/src/commands/DisassociateWirelessDeviceFromThingCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DisassociateWirelessDeviceFromThingCommand.ts rename to clients/client-iot-wireless/src/commands/DisassociateWirelessDeviceFromThingCommand.ts diff --git a/clients/client-iot-wireless/commands/DisassociateWirelessGatewayFromCertificateCommand.ts b/clients/client-iot-wireless/src/commands/DisassociateWirelessGatewayFromCertificateCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DisassociateWirelessGatewayFromCertificateCommand.ts rename to clients/client-iot-wireless/src/commands/DisassociateWirelessGatewayFromCertificateCommand.ts diff --git a/clients/client-iot-wireless/commands/DisassociateWirelessGatewayFromThingCommand.ts b/clients/client-iot-wireless/src/commands/DisassociateWirelessGatewayFromThingCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/DisassociateWirelessGatewayFromThingCommand.ts rename to clients/client-iot-wireless/src/commands/DisassociateWirelessGatewayFromThingCommand.ts diff --git a/clients/client-iot-wireless/commands/GetDestinationCommand.ts b/clients/client-iot-wireless/src/commands/GetDestinationCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetDestinationCommand.ts rename to clients/client-iot-wireless/src/commands/GetDestinationCommand.ts diff --git a/clients/client-iot-wireless/commands/GetDeviceProfileCommand.ts b/clients/client-iot-wireless/src/commands/GetDeviceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetDeviceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/GetDeviceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/GetLogLevelsByResourceTypesCommand.ts b/clients/client-iot-wireless/src/commands/GetLogLevelsByResourceTypesCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetLogLevelsByResourceTypesCommand.ts rename to clients/client-iot-wireless/src/commands/GetLogLevelsByResourceTypesCommand.ts diff --git a/clients/client-iot-wireless/commands/GetPartnerAccountCommand.ts b/clients/client-iot-wireless/src/commands/GetPartnerAccountCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetPartnerAccountCommand.ts rename to clients/client-iot-wireless/src/commands/GetPartnerAccountCommand.ts diff --git a/clients/client-iot-wireless/commands/GetResourceLogLevelCommand.ts b/clients/client-iot-wireless/src/commands/GetResourceLogLevelCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetResourceLogLevelCommand.ts rename to clients/client-iot-wireless/src/commands/GetResourceLogLevelCommand.ts diff --git a/clients/client-iot-wireless/commands/GetServiceEndpointCommand.ts b/clients/client-iot-wireless/src/commands/GetServiceEndpointCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetServiceEndpointCommand.ts rename to clients/client-iot-wireless/src/commands/GetServiceEndpointCommand.ts diff --git a/clients/client-iot-wireless/commands/GetServiceProfileCommand.ts b/clients/client-iot-wireless/src/commands/GetServiceProfileCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetServiceProfileCommand.ts rename to clients/client-iot-wireless/src/commands/GetServiceProfileCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessDeviceStatisticsCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessDeviceStatisticsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessDeviceStatisticsCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessDeviceStatisticsCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayCertificateCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayCertificateCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayCertificateCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayCertificateCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayFirmwareInformationCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayFirmwareInformationCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayFirmwareInformationCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayFirmwareInformationCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayStatisticsCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayStatisticsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayStatisticsCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayStatisticsCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayTaskCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayTaskCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayTaskCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayTaskCommand.ts diff --git a/clients/client-iot-wireless/commands/GetWirelessGatewayTaskDefinitionCommand.ts b/clients/client-iot-wireless/src/commands/GetWirelessGatewayTaskDefinitionCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/GetWirelessGatewayTaskDefinitionCommand.ts rename to clients/client-iot-wireless/src/commands/GetWirelessGatewayTaskDefinitionCommand.ts diff --git a/clients/client-iot-wireless/commands/ListDestinationsCommand.ts b/clients/client-iot-wireless/src/commands/ListDestinationsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListDestinationsCommand.ts rename to clients/client-iot-wireless/src/commands/ListDestinationsCommand.ts diff --git a/clients/client-iot-wireless/commands/ListDeviceProfilesCommand.ts b/clients/client-iot-wireless/src/commands/ListDeviceProfilesCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListDeviceProfilesCommand.ts rename to clients/client-iot-wireless/src/commands/ListDeviceProfilesCommand.ts diff --git a/clients/client-iot-wireless/commands/ListPartnerAccountsCommand.ts b/clients/client-iot-wireless/src/commands/ListPartnerAccountsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListPartnerAccountsCommand.ts rename to clients/client-iot-wireless/src/commands/ListPartnerAccountsCommand.ts diff --git a/clients/client-iot-wireless/commands/ListServiceProfilesCommand.ts b/clients/client-iot-wireless/src/commands/ListServiceProfilesCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListServiceProfilesCommand.ts rename to clients/client-iot-wireless/src/commands/ListServiceProfilesCommand.ts diff --git a/clients/client-iot-wireless/commands/ListTagsForResourceCommand.ts b/clients/client-iot-wireless/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListTagsForResourceCommand.ts rename to clients/client-iot-wireless/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iot-wireless/commands/ListWirelessDevicesCommand.ts b/clients/client-iot-wireless/src/commands/ListWirelessDevicesCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListWirelessDevicesCommand.ts rename to clients/client-iot-wireless/src/commands/ListWirelessDevicesCommand.ts diff --git a/clients/client-iot-wireless/commands/ListWirelessGatewayTaskDefinitionsCommand.ts b/clients/client-iot-wireless/src/commands/ListWirelessGatewayTaskDefinitionsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListWirelessGatewayTaskDefinitionsCommand.ts rename to clients/client-iot-wireless/src/commands/ListWirelessGatewayTaskDefinitionsCommand.ts diff --git a/clients/client-iot-wireless/commands/ListWirelessGatewaysCommand.ts b/clients/client-iot-wireless/src/commands/ListWirelessGatewaysCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ListWirelessGatewaysCommand.ts rename to clients/client-iot-wireless/src/commands/ListWirelessGatewaysCommand.ts diff --git a/clients/client-iot-wireless/commands/PutResourceLogLevelCommand.ts b/clients/client-iot-wireless/src/commands/PutResourceLogLevelCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/PutResourceLogLevelCommand.ts rename to clients/client-iot-wireless/src/commands/PutResourceLogLevelCommand.ts diff --git a/clients/client-iot-wireless/commands/ResetAllResourceLogLevelsCommand.ts b/clients/client-iot-wireless/src/commands/ResetAllResourceLogLevelsCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ResetAllResourceLogLevelsCommand.ts rename to clients/client-iot-wireless/src/commands/ResetAllResourceLogLevelsCommand.ts diff --git a/clients/client-iot-wireless/commands/ResetResourceLogLevelCommand.ts b/clients/client-iot-wireless/src/commands/ResetResourceLogLevelCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/ResetResourceLogLevelCommand.ts rename to clients/client-iot-wireless/src/commands/ResetResourceLogLevelCommand.ts diff --git a/clients/client-iot-wireless/commands/SendDataToWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/SendDataToWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/SendDataToWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/SendDataToWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/TagResourceCommand.ts b/clients/client-iot-wireless/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/TagResourceCommand.ts rename to clients/client-iot-wireless/src/commands/TagResourceCommand.ts diff --git a/clients/client-iot-wireless/commands/TestWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/TestWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/TestWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/TestWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/UntagResourceCommand.ts b/clients/client-iot-wireless/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UntagResourceCommand.ts rename to clients/client-iot-wireless/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iot-wireless/commands/UpdateDestinationCommand.ts b/clients/client-iot-wireless/src/commands/UpdateDestinationCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UpdateDestinationCommand.ts rename to clients/client-iot-wireless/src/commands/UpdateDestinationCommand.ts diff --git a/clients/client-iot-wireless/commands/UpdateLogLevelsByResourceTypesCommand.ts b/clients/client-iot-wireless/src/commands/UpdateLogLevelsByResourceTypesCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UpdateLogLevelsByResourceTypesCommand.ts rename to clients/client-iot-wireless/src/commands/UpdateLogLevelsByResourceTypesCommand.ts diff --git a/clients/client-iot-wireless/commands/UpdatePartnerAccountCommand.ts b/clients/client-iot-wireless/src/commands/UpdatePartnerAccountCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UpdatePartnerAccountCommand.ts rename to clients/client-iot-wireless/src/commands/UpdatePartnerAccountCommand.ts diff --git a/clients/client-iot-wireless/commands/UpdateWirelessDeviceCommand.ts b/clients/client-iot-wireless/src/commands/UpdateWirelessDeviceCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UpdateWirelessDeviceCommand.ts rename to clients/client-iot-wireless/src/commands/UpdateWirelessDeviceCommand.ts diff --git a/clients/client-iot-wireless/commands/UpdateWirelessGatewayCommand.ts b/clients/client-iot-wireless/src/commands/UpdateWirelessGatewayCommand.ts similarity index 100% rename from clients/client-iot-wireless/commands/UpdateWirelessGatewayCommand.ts rename to clients/client-iot-wireless/src/commands/UpdateWirelessGatewayCommand.ts diff --git a/clients/client-iot-wireless/endpoints.ts b/clients/client-iot-wireless/src/endpoints.ts similarity index 100% rename from clients/client-iot-wireless/endpoints.ts rename to clients/client-iot-wireless/src/endpoints.ts diff --git a/clients/client-iot-wireless/index.ts b/clients/client-iot-wireless/src/index.ts similarity index 100% rename from clients/client-iot-wireless/index.ts rename to clients/client-iot-wireless/src/index.ts diff --git a/clients/client-iot-wireless/models/index.ts b/clients/client-iot-wireless/src/models/index.ts similarity index 100% rename from clients/client-iot-wireless/models/index.ts rename to clients/client-iot-wireless/src/models/index.ts diff --git a/clients/client-iot-wireless/models/models_0.ts b/clients/client-iot-wireless/src/models/models_0.ts similarity index 100% rename from clients/client-iot-wireless/models/models_0.ts rename to clients/client-iot-wireless/src/models/models_0.ts diff --git a/clients/client-iot-wireless/pagination/Interfaces.ts b/clients/client-iot-wireless/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iot-wireless/pagination/Interfaces.ts rename to clients/client-iot-wireless/src/pagination/Interfaces.ts diff --git a/clients/client-iot-wireless/pagination/ListDestinationsPaginator.ts b/clients/client-iot-wireless/src/pagination/ListDestinationsPaginator.ts similarity index 100% rename from clients/client-iot-wireless/pagination/ListDestinationsPaginator.ts rename to clients/client-iot-wireless/src/pagination/ListDestinationsPaginator.ts diff --git a/clients/client-iot-wireless/pagination/ListDeviceProfilesPaginator.ts b/clients/client-iot-wireless/src/pagination/ListDeviceProfilesPaginator.ts similarity index 100% rename from clients/client-iot-wireless/pagination/ListDeviceProfilesPaginator.ts rename to clients/client-iot-wireless/src/pagination/ListDeviceProfilesPaginator.ts diff --git a/clients/client-iot-wireless/pagination/ListServiceProfilesPaginator.ts b/clients/client-iot-wireless/src/pagination/ListServiceProfilesPaginator.ts similarity index 100% rename from clients/client-iot-wireless/pagination/ListServiceProfilesPaginator.ts rename to clients/client-iot-wireless/src/pagination/ListServiceProfilesPaginator.ts diff --git a/clients/client-iot-wireless/pagination/ListWirelessDevicesPaginator.ts b/clients/client-iot-wireless/src/pagination/ListWirelessDevicesPaginator.ts similarity index 100% rename from clients/client-iot-wireless/pagination/ListWirelessDevicesPaginator.ts rename to clients/client-iot-wireless/src/pagination/ListWirelessDevicesPaginator.ts diff --git a/clients/client-iot-wireless/pagination/ListWirelessGatewaysPaginator.ts b/clients/client-iot-wireless/src/pagination/ListWirelessGatewaysPaginator.ts similarity index 100% rename from clients/client-iot-wireless/pagination/ListWirelessGatewaysPaginator.ts rename to clients/client-iot-wireless/src/pagination/ListWirelessGatewaysPaginator.ts diff --git a/clients/client-iot-wireless/protocols/Aws_restJson1.ts b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot-wireless/protocols/Aws_restJson1.ts rename to clients/client-iot-wireless/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot-wireless/src/runtimeConfig.browser.ts b/clients/client-iot-wireless/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bf072fc9df72 --- /dev/null +++ b/clients/client-iot-wireless/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTWirelessClientConfig } from "./IoTWirelessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-wireless/runtimeConfig.native.ts b/clients/client-iot-wireless/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot-wireless/runtimeConfig.native.ts rename to clients/client-iot-wireless/src/runtimeConfig.native.ts diff --git a/clients/client-iot-wireless/runtimeConfig.shared.ts b/clients/client-iot-wireless/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot-wireless/runtimeConfig.shared.ts rename to clients/client-iot-wireless/src/runtimeConfig.shared.ts diff --git a/clients/client-iot-wireless/src/runtimeConfig.ts b/clients/client-iot-wireless/src/runtimeConfig.ts new file mode 100644 index 000000000000..1910694516ea --- /dev/null +++ b/clients/client-iot-wireless/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTWirelessClientConfig } from "./IoTWirelessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot-wireless/tsconfig.es.json b/clients/client-iot-wireless/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot-wireless/tsconfig.es.json +++ b/clients/client-iot-wireless/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot-wireless/tsconfig.json b/clients/client-iot-wireless/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot-wireless/tsconfig.json +++ b/clients/client-iot-wireless/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot-wireless/tsconfig.types.json b/clients/client-iot-wireless/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot-wireless/tsconfig.types.json +++ b/clients/client-iot-wireless/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iot/.gitignore b/clients/client-iot/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iot/.gitignore +++ b/clients/client-iot/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iot/package.json b/clients/client-iot/package.json index 13982b7a77ec..112eedfe3445 100644 --- a/clients/client-iot/package.json +++ b/clients/client-iot/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iot", "repository": { "type": "git", diff --git a/clients/client-iot/runtimeConfig.browser.ts b/clients/client-iot/runtimeConfig.browser.ts deleted file mode 100644 index afbe9e3f3cf5..000000000000 --- a/clients/client-iot/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTClientConfig } from "./IoTClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot/runtimeConfig.ts b/clients/client-iot/runtimeConfig.ts deleted file mode 100644 index 32f1e8db601c..000000000000 --- a/clients/client-iot/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTClientConfig } from "./IoTClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iot/IoT.ts b/clients/client-iot/src/IoT.ts similarity index 100% rename from clients/client-iot/IoT.ts rename to clients/client-iot/src/IoT.ts diff --git a/clients/client-iot/IoTClient.ts b/clients/client-iot/src/IoTClient.ts similarity index 100% rename from clients/client-iot/IoTClient.ts rename to clients/client-iot/src/IoTClient.ts diff --git a/clients/client-iot/commands/AcceptCertificateTransferCommand.ts b/clients/client-iot/src/commands/AcceptCertificateTransferCommand.ts similarity index 100% rename from clients/client-iot/commands/AcceptCertificateTransferCommand.ts rename to clients/client-iot/src/commands/AcceptCertificateTransferCommand.ts diff --git a/clients/client-iot/commands/AddThingToBillingGroupCommand.ts b/clients/client-iot/src/commands/AddThingToBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/AddThingToBillingGroupCommand.ts rename to clients/client-iot/src/commands/AddThingToBillingGroupCommand.ts diff --git a/clients/client-iot/commands/AddThingToThingGroupCommand.ts b/clients/client-iot/src/commands/AddThingToThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/AddThingToThingGroupCommand.ts rename to clients/client-iot/src/commands/AddThingToThingGroupCommand.ts diff --git a/clients/client-iot/commands/AssociateTargetsWithJobCommand.ts b/clients/client-iot/src/commands/AssociateTargetsWithJobCommand.ts similarity index 100% rename from clients/client-iot/commands/AssociateTargetsWithJobCommand.ts rename to clients/client-iot/src/commands/AssociateTargetsWithJobCommand.ts diff --git a/clients/client-iot/commands/AttachPolicyCommand.ts b/clients/client-iot/src/commands/AttachPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/AttachPolicyCommand.ts rename to clients/client-iot/src/commands/AttachPolicyCommand.ts diff --git a/clients/client-iot/commands/AttachPrincipalPolicyCommand.ts b/clients/client-iot/src/commands/AttachPrincipalPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/AttachPrincipalPolicyCommand.ts rename to clients/client-iot/src/commands/AttachPrincipalPolicyCommand.ts diff --git a/clients/client-iot/commands/AttachSecurityProfileCommand.ts b/clients/client-iot/src/commands/AttachSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/AttachSecurityProfileCommand.ts rename to clients/client-iot/src/commands/AttachSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/AttachThingPrincipalCommand.ts b/clients/client-iot/src/commands/AttachThingPrincipalCommand.ts similarity index 100% rename from clients/client-iot/commands/AttachThingPrincipalCommand.ts rename to clients/client-iot/src/commands/AttachThingPrincipalCommand.ts diff --git a/clients/client-iot/commands/CancelAuditMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/CancelAuditMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelAuditMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/CancelAuditMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/CancelAuditTaskCommand.ts b/clients/client-iot/src/commands/CancelAuditTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelAuditTaskCommand.ts rename to clients/client-iot/src/commands/CancelAuditTaskCommand.ts diff --git a/clients/client-iot/commands/CancelCertificateTransferCommand.ts b/clients/client-iot/src/commands/CancelCertificateTransferCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelCertificateTransferCommand.ts rename to clients/client-iot/src/commands/CancelCertificateTransferCommand.ts diff --git a/clients/client-iot/commands/CancelDetectMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/CancelDetectMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelDetectMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/CancelDetectMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/CancelJobCommand.ts b/clients/client-iot/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelJobCommand.ts rename to clients/client-iot/src/commands/CancelJobCommand.ts diff --git a/clients/client-iot/commands/CancelJobExecutionCommand.ts b/clients/client-iot/src/commands/CancelJobExecutionCommand.ts similarity index 100% rename from clients/client-iot/commands/CancelJobExecutionCommand.ts rename to clients/client-iot/src/commands/CancelJobExecutionCommand.ts diff --git a/clients/client-iot/commands/ClearDefaultAuthorizerCommand.ts b/clients/client-iot/src/commands/ClearDefaultAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/ClearDefaultAuthorizerCommand.ts rename to clients/client-iot/src/commands/ClearDefaultAuthorizerCommand.ts diff --git a/clients/client-iot/commands/ConfirmTopicRuleDestinationCommand.ts b/clients/client-iot/src/commands/ConfirmTopicRuleDestinationCommand.ts similarity index 100% rename from clients/client-iot/commands/ConfirmTopicRuleDestinationCommand.ts rename to clients/client-iot/src/commands/ConfirmTopicRuleDestinationCommand.ts diff --git a/clients/client-iot/commands/CreateAuditSuppressionCommand.ts b/clients/client-iot/src/commands/CreateAuditSuppressionCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateAuditSuppressionCommand.ts rename to clients/client-iot/src/commands/CreateAuditSuppressionCommand.ts diff --git a/clients/client-iot/commands/CreateAuthorizerCommand.ts b/clients/client-iot/src/commands/CreateAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateAuthorizerCommand.ts rename to clients/client-iot/src/commands/CreateAuthorizerCommand.ts diff --git a/clients/client-iot/commands/CreateBillingGroupCommand.ts b/clients/client-iot/src/commands/CreateBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateBillingGroupCommand.ts rename to clients/client-iot/src/commands/CreateBillingGroupCommand.ts diff --git a/clients/client-iot/commands/CreateCertificateFromCsrCommand.ts b/clients/client-iot/src/commands/CreateCertificateFromCsrCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateCertificateFromCsrCommand.ts rename to clients/client-iot/src/commands/CreateCertificateFromCsrCommand.ts diff --git a/clients/client-iot/commands/CreateCustomMetricCommand.ts b/clients/client-iot/src/commands/CreateCustomMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateCustomMetricCommand.ts rename to clients/client-iot/src/commands/CreateCustomMetricCommand.ts diff --git a/clients/client-iot/commands/CreateDimensionCommand.ts b/clients/client-iot/src/commands/CreateDimensionCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateDimensionCommand.ts rename to clients/client-iot/src/commands/CreateDimensionCommand.ts diff --git a/clients/client-iot/commands/CreateDomainConfigurationCommand.ts b/clients/client-iot/src/commands/CreateDomainConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateDomainConfigurationCommand.ts rename to clients/client-iot/src/commands/CreateDomainConfigurationCommand.ts diff --git a/clients/client-iot/commands/CreateDynamicThingGroupCommand.ts b/clients/client-iot/src/commands/CreateDynamicThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateDynamicThingGroupCommand.ts rename to clients/client-iot/src/commands/CreateDynamicThingGroupCommand.ts diff --git a/clients/client-iot/commands/CreateFleetMetricCommand.ts b/clients/client-iot/src/commands/CreateFleetMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateFleetMetricCommand.ts rename to clients/client-iot/src/commands/CreateFleetMetricCommand.ts diff --git a/clients/client-iot/commands/CreateJobCommand.ts b/clients/client-iot/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateJobCommand.ts rename to clients/client-iot/src/commands/CreateJobCommand.ts diff --git a/clients/client-iot/commands/CreateJobTemplateCommand.ts b/clients/client-iot/src/commands/CreateJobTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateJobTemplateCommand.ts rename to clients/client-iot/src/commands/CreateJobTemplateCommand.ts diff --git a/clients/client-iot/commands/CreateKeysAndCertificateCommand.ts b/clients/client-iot/src/commands/CreateKeysAndCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateKeysAndCertificateCommand.ts rename to clients/client-iot/src/commands/CreateKeysAndCertificateCommand.ts diff --git a/clients/client-iot/commands/CreateMitigationActionCommand.ts b/clients/client-iot/src/commands/CreateMitigationActionCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateMitigationActionCommand.ts rename to clients/client-iot/src/commands/CreateMitigationActionCommand.ts diff --git a/clients/client-iot/commands/CreateOTAUpdateCommand.ts b/clients/client-iot/src/commands/CreateOTAUpdateCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateOTAUpdateCommand.ts rename to clients/client-iot/src/commands/CreateOTAUpdateCommand.ts diff --git a/clients/client-iot/commands/CreatePolicyCommand.ts b/clients/client-iot/src/commands/CreatePolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/CreatePolicyCommand.ts rename to clients/client-iot/src/commands/CreatePolicyCommand.ts diff --git a/clients/client-iot/commands/CreatePolicyVersionCommand.ts b/clients/client-iot/src/commands/CreatePolicyVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/CreatePolicyVersionCommand.ts rename to clients/client-iot/src/commands/CreatePolicyVersionCommand.ts diff --git a/clients/client-iot/commands/CreateProvisioningClaimCommand.ts b/clients/client-iot/src/commands/CreateProvisioningClaimCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateProvisioningClaimCommand.ts rename to clients/client-iot/src/commands/CreateProvisioningClaimCommand.ts diff --git a/clients/client-iot/commands/CreateProvisioningTemplateCommand.ts b/clients/client-iot/src/commands/CreateProvisioningTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateProvisioningTemplateCommand.ts rename to clients/client-iot/src/commands/CreateProvisioningTemplateCommand.ts diff --git a/clients/client-iot/commands/CreateProvisioningTemplateVersionCommand.ts b/clients/client-iot/src/commands/CreateProvisioningTemplateVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateProvisioningTemplateVersionCommand.ts rename to clients/client-iot/src/commands/CreateProvisioningTemplateVersionCommand.ts diff --git a/clients/client-iot/commands/CreateRoleAliasCommand.ts b/clients/client-iot/src/commands/CreateRoleAliasCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateRoleAliasCommand.ts rename to clients/client-iot/src/commands/CreateRoleAliasCommand.ts diff --git a/clients/client-iot/commands/CreateScheduledAuditCommand.ts b/clients/client-iot/src/commands/CreateScheduledAuditCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateScheduledAuditCommand.ts rename to clients/client-iot/src/commands/CreateScheduledAuditCommand.ts diff --git a/clients/client-iot/commands/CreateSecurityProfileCommand.ts b/clients/client-iot/src/commands/CreateSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateSecurityProfileCommand.ts rename to clients/client-iot/src/commands/CreateSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/CreateStreamCommand.ts b/clients/client-iot/src/commands/CreateStreamCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateStreamCommand.ts rename to clients/client-iot/src/commands/CreateStreamCommand.ts diff --git a/clients/client-iot/commands/CreateThingCommand.ts b/clients/client-iot/src/commands/CreateThingCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateThingCommand.ts rename to clients/client-iot/src/commands/CreateThingCommand.ts diff --git a/clients/client-iot/commands/CreateThingGroupCommand.ts b/clients/client-iot/src/commands/CreateThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateThingGroupCommand.ts rename to clients/client-iot/src/commands/CreateThingGroupCommand.ts diff --git a/clients/client-iot/commands/CreateThingTypeCommand.ts b/clients/client-iot/src/commands/CreateThingTypeCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateThingTypeCommand.ts rename to clients/client-iot/src/commands/CreateThingTypeCommand.ts diff --git a/clients/client-iot/commands/CreateTopicRuleCommand.ts b/clients/client-iot/src/commands/CreateTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateTopicRuleCommand.ts rename to clients/client-iot/src/commands/CreateTopicRuleCommand.ts diff --git a/clients/client-iot/commands/CreateTopicRuleDestinationCommand.ts b/clients/client-iot/src/commands/CreateTopicRuleDestinationCommand.ts similarity index 100% rename from clients/client-iot/commands/CreateTopicRuleDestinationCommand.ts rename to clients/client-iot/src/commands/CreateTopicRuleDestinationCommand.ts diff --git a/clients/client-iot/commands/DeleteAccountAuditConfigurationCommand.ts b/clients/client-iot/src/commands/DeleteAccountAuditConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteAccountAuditConfigurationCommand.ts rename to clients/client-iot/src/commands/DeleteAccountAuditConfigurationCommand.ts diff --git a/clients/client-iot/commands/DeleteAuditSuppressionCommand.ts b/clients/client-iot/src/commands/DeleteAuditSuppressionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteAuditSuppressionCommand.ts rename to clients/client-iot/src/commands/DeleteAuditSuppressionCommand.ts diff --git a/clients/client-iot/commands/DeleteAuthorizerCommand.ts b/clients/client-iot/src/commands/DeleteAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteAuthorizerCommand.ts rename to clients/client-iot/src/commands/DeleteAuthorizerCommand.ts diff --git a/clients/client-iot/commands/DeleteBillingGroupCommand.ts b/clients/client-iot/src/commands/DeleteBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteBillingGroupCommand.ts rename to clients/client-iot/src/commands/DeleteBillingGroupCommand.ts diff --git a/clients/client-iot/commands/DeleteCACertificateCommand.ts b/clients/client-iot/src/commands/DeleteCACertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteCACertificateCommand.ts rename to clients/client-iot/src/commands/DeleteCACertificateCommand.ts diff --git a/clients/client-iot/commands/DeleteCertificateCommand.ts b/clients/client-iot/src/commands/DeleteCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteCertificateCommand.ts rename to clients/client-iot/src/commands/DeleteCertificateCommand.ts diff --git a/clients/client-iot/commands/DeleteCustomMetricCommand.ts b/clients/client-iot/src/commands/DeleteCustomMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteCustomMetricCommand.ts rename to clients/client-iot/src/commands/DeleteCustomMetricCommand.ts diff --git a/clients/client-iot/commands/DeleteDimensionCommand.ts b/clients/client-iot/src/commands/DeleteDimensionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteDimensionCommand.ts rename to clients/client-iot/src/commands/DeleteDimensionCommand.ts diff --git a/clients/client-iot/commands/DeleteDomainConfigurationCommand.ts b/clients/client-iot/src/commands/DeleteDomainConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteDomainConfigurationCommand.ts rename to clients/client-iot/src/commands/DeleteDomainConfigurationCommand.ts diff --git a/clients/client-iot/commands/DeleteDynamicThingGroupCommand.ts b/clients/client-iot/src/commands/DeleteDynamicThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteDynamicThingGroupCommand.ts rename to clients/client-iot/src/commands/DeleteDynamicThingGroupCommand.ts diff --git a/clients/client-iot/commands/DeleteFleetMetricCommand.ts b/clients/client-iot/src/commands/DeleteFleetMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteFleetMetricCommand.ts rename to clients/client-iot/src/commands/DeleteFleetMetricCommand.ts diff --git a/clients/client-iot/commands/DeleteJobCommand.ts b/clients/client-iot/src/commands/DeleteJobCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteJobCommand.ts rename to clients/client-iot/src/commands/DeleteJobCommand.ts diff --git a/clients/client-iot/commands/DeleteJobExecutionCommand.ts b/clients/client-iot/src/commands/DeleteJobExecutionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteJobExecutionCommand.ts rename to clients/client-iot/src/commands/DeleteJobExecutionCommand.ts diff --git a/clients/client-iot/commands/DeleteJobTemplateCommand.ts b/clients/client-iot/src/commands/DeleteJobTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteJobTemplateCommand.ts rename to clients/client-iot/src/commands/DeleteJobTemplateCommand.ts diff --git a/clients/client-iot/commands/DeleteMitigationActionCommand.ts b/clients/client-iot/src/commands/DeleteMitigationActionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteMitigationActionCommand.ts rename to clients/client-iot/src/commands/DeleteMitigationActionCommand.ts diff --git a/clients/client-iot/commands/DeleteOTAUpdateCommand.ts b/clients/client-iot/src/commands/DeleteOTAUpdateCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteOTAUpdateCommand.ts rename to clients/client-iot/src/commands/DeleteOTAUpdateCommand.ts diff --git a/clients/client-iot/commands/DeletePolicyCommand.ts b/clients/client-iot/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/DeletePolicyCommand.ts rename to clients/client-iot/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-iot/commands/DeletePolicyVersionCommand.ts b/clients/client-iot/src/commands/DeletePolicyVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeletePolicyVersionCommand.ts rename to clients/client-iot/src/commands/DeletePolicyVersionCommand.ts diff --git a/clients/client-iot/commands/DeleteProvisioningTemplateCommand.ts b/clients/client-iot/src/commands/DeleteProvisioningTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteProvisioningTemplateCommand.ts rename to clients/client-iot/src/commands/DeleteProvisioningTemplateCommand.ts diff --git a/clients/client-iot/commands/DeleteProvisioningTemplateVersionCommand.ts b/clients/client-iot/src/commands/DeleteProvisioningTemplateVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteProvisioningTemplateVersionCommand.ts rename to clients/client-iot/src/commands/DeleteProvisioningTemplateVersionCommand.ts diff --git a/clients/client-iot/commands/DeleteRegistrationCodeCommand.ts b/clients/client-iot/src/commands/DeleteRegistrationCodeCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteRegistrationCodeCommand.ts rename to clients/client-iot/src/commands/DeleteRegistrationCodeCommand.ts diff --git a/clients/client-iot/commands/DeleteRoleAliasCommand.ts b/clients/client-iot/src/commands/DeleteRoleAliasCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteRoleAliasCommand.ts rename to clients/client-iot/src/commands/DeleteRoleAliasCommand.ts diff --git a/clients/client-iot/commands/DeleteScheduledAuditCommand.ts b/clients/client-iot/src/commands/DeleteScheduledAuditCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteScheduledAuditCommand.ts rename to clients/client-iot/src/commands/DeleteScheduledAuditCommand.ts diff --git a/clients/client-iot/commands/DeleteSecurityProfileCommand.ts b/clients/client-iot/src/commands/DeleteSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteSecurityProfileCommand.ts rename to clients/client-iot/src/commands/DeleteSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/DeleteStreamCommand.ts b/clients/client-iot/src/commands/DeleteStreamCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteStreamCommand.ts rename to clients/client-iot/src/commands/DeleteStreamCommand.ts diff --git a/clients/client-iot/commands/DeleteThingCommand.ts b/clients/client-iot/src/commands/DeleteThingCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteThingCommand.ts rename to clients/client-iot/src/commands/DeleteThingCommand.ts diff --git a/clients/client-iot/commands/DeleteThingGroupCommand.ts b/clients/client-iot/src/commands/DeleteThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteThingGroupCommand.ts rename to clients/client-iot/src/commands/DeleteThingGroupCommand.ts diff --git a/clients/client-iot/commands/DeleteThingTypeCommand.ts b/clients/client-iot/src/commands/DeleteThingTypeCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteThingTypeCommand.ts rename to clients/client-iot/src/commands/DeleteThingTypeCommand.ts diff --git a/clients/client-iot/commands/DeleteTopicRuleCommand.ts b/clients/client-iot/src/commands/DeleteTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteTopicRuleCommand.ts rename to clients/client-iot/src/commands/DeleteTopicRuleCommand.ts diff --git a/clients/client-iot/commands/DeleteTopicRuleDestinationCommand.ts b/clients/client-iot/src/commands/DeleteTopicRuleDestinationCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteTopicRuleDestinationCommand.ts rename to clients/client-iot/src/commands/DeleteTopicRuleDestinationCommand.ts diff --git a/clients/client-iot/commands/DeleteV2LoggingLevelCommand.ts b/clients/client-iot/src/commands/DeleteV2LoggingLevelCommand.ts similarity index 100% rename from clients/client-iot/commands/DeleteV2LoggingLevelCommand.ts rename to clients/client-iot/src/commands/DeleteV2LoggingLevelCommand.ts diff --git a/clients/client-iot/commands/DeprecateThingTypeCommand.ts b/clients/client-iot/src/commands/DeprecateThingTypeCommand.ts similarity index 100% rename from clients/client-iot/commands/DeprecateThingTypeCommand.ts rename to clients/client-iot/src/commands/DeprecateThingTypeCommand.ts diff --git a/clients/client-iot/commands/DescribeAccountAuditConfigurationCommand.ts b/clients/client-iot/src/commands/DescribeAccountAuditConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAccountAuditConfigurationCommand.ts rename to clients/client-iot/src/commands/DescribeAccountAuditConfigurationCommand.ts diff --git a/clients/client-iot/commands/DescribeAuditFindingCommand.ts b/clients/client-iot/src/commands/DescribeAuditFindingCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAuditFindingCommand.ts rename to clients/client-iot/src/commands/DescribeAuditFindingCommand.ts diff --git a/clients/client-iot/commands/DescribeAuditMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/DescribeAuditMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAuditMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/DescribeAuditMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/DescribeAuditSuppressionCommand.ts b/clients/client-iot/src/commands/DescribeAuditSuppressionCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAuditSuppressionCommand.ts rename to clients/client-iot/src/commands/DescribeAuditSuppressionCommand.ts diff --git a/clients/client-iot/commands/DescribeAuditTaskCommand.ts b/clients/client-iot/src/commands/DescribeAuditTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAuditTaskCommand.ts rename to clients/client-iot/src/commands/DescribeAuditTaskCommand.ts diff --git a/clients/client-iot/commands/DescribeAuthorizerCommand.ts b/clients/client-iot/src/commands/DescribeAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeAuthorizerCommand.ts rename to clients/client-iot/src/commands/DescribeAuthorizerCommand.ts diff --git a/clients/client-iot/commands/DescribeBillingGroupCommand.ts b/clients/client-iot/src/commands/DescribeBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeBillingGroupCommand.ts rename to clients/client-iot/src/commands/DescribeBillingGroupCommand.ts diff --git a/clients/client-iot/commands/DescribeCACertificateCommand.ts b/clients/client-iot/src/commands/DescribeCACertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeCACertificateCommand.ts rename to clients/client-iot/src/commands/DescribeCACertificateCommand.ts diff --git a/clients/client-iot/commands/DescribeCertificateCommand.ts b/clients/client-iot/src/commands/DescribeCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeCertificateCommand.ts rename to clients/client-iot/src/commands/DescribeCertificateCommand.ts diff --git a/clients/client-iot/commands/DescribeCustomMetricCommand.ts b/clients/client-iot/src/commands/DescribeCustomMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeCustomMetricCommand.ts rename to clients/client-iot/src/commands/DescribeCustomMetricCommand.ts diff --git a/clients/client-iot/commands/DescribeDefaultAuthorizerCommand.ts b/clients/client-iot/src/commands/DescribeDefaultAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeDefaultAuthorizerCommand.ts rename to clients/client-iot/src/commands/DescribeDefaultAuthorizerCommand.ts diff --git a/clients/client-iot/commands/DescribeDetectMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/DescribeDetectMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeDetectMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/DescribeDetectMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/DescribeDimensionCommand.ts b/clients/client-iot/src/commands/DescribeDimensionCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeDimensionCommand.ts rename to clients/client-iot/src/commands/DescribeDimensionCommand.ts diff --git a/clients/client-iot/commands/DescribeDomainConfigurationCommand.ts b/clients/client-iot/src/commands/DescribeDomainConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeDomainConfigurationCommand.ts rename to clients/client-iot/src/commands/DescribeDomainConfigurationCommand.ts diff --git a/clients/client-iot/commands/DescribeEndpointCommand.ts b/clients/client-iot/src/commands/DescribeEndpointCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeEndpointCommand.ts rename to clients/client-iot/src/commands/DescribeEndpointCommand.ts diff --git a/clients/client-iot/commands/DescribeEventConfigurationsCommand.ts b/clients/client-iot/src/commands/DescribeEventConfigurationsCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeEventConfigurationsCommand.ts rename to clients/client-iot/src/commands/DescribeEventConfigurationsCommand.ts diff --git a/clients/client-iot/commands/DescribeFleetMetricCommand.ts b/clients/client-iot/src/commands/DescribeFleetMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeFleetMetricCommand.ts rename to clients/client-iot/src/commands/DescribeFleetMetricCommand.ts diff --git a/clients/client-iot/commands/DescribeIndexCommand.ts b/clients/client-iot/src/commands/DescribeIndexCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeIndexCommand.ts rename to clients/client-iot/src/commands/DescribeIndexCommand.ts diff --git a/clients/client-iot/commands/DescribeJobCommand.ts b/clients/client-iot/src/commands/DescribeJobCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeJobCommand.ts rename to clients/client-iot/src/commands/DescribeJobCommand.ts diff --git a/clients/client-iot/commands/DescribeJobExecutionCommand.ts b/clients/client-iot/src/commands/DescribeJobExecutionCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeJobExecutionCommand.ts rename to clients/client-iot/src/commands/DescribeJobExecutionCommand.ts diff --git a/clients/client-iot/commands/DescribeJobTemplateCommand.ts b/clients/client-iot/src/commands/DescribeJobTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeJobTemplateCommand.ts rename to clients/client-iot/src/commands/DescribeJobTemplateCommand.ts diff --git a/clients/client-iot/commands/DescribeMitigationActionCommand.ts b/clients/client-iot/src/commands/DescribeMitigationActionCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeMitigationActionCommand.ts rename to clients/client-iot/src/commands/DescribeMitigationActionCommand.ts diff --git a/clients/client-iot/commands/DescribeProvisioningTemplateCommand.ts b/clients/client-iot/src/commands/DescribeProvisioningTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeProvisioningTemplateCommand.ts rename to clients/client-iot/src/commands/DescribeProvisioningTemplateCommand.ts diff --git a/clients/client-iot/commands/DescribeProvisioningTemplateVersionCommand.ts b/clients/client-iot/src/commands/DescribeProvisioningTemplateVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeProvisioningTemplateVersionCommand.ts rename to clients/client-iot/src/commands/DescribeProvisioningTemplateVersionCommand.ts diff --git a/clients/client-iot/commands/DescribeRoleAliasCommand.ts b/clients/client-iot/src/commands/DescribeRoleAliasCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeRoleAliasCommand.ts rename to clients/client-iot/src/commands/DescribeRoleAliasCommand.ts diff --git a/clients/client-iot/commands/DescribeScheduledAuditCommand.ts b/clients/client-iot/src/commands/DescribeScheduledAuditCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeScheduledAuditCommand.ts rename to clients/client-iot/src/commands/DescribeScheduledAuditCommand.ts diff --git a/clients/client-iot/commands/DescribeSecurityProfileCommand.ts b/clients/client-iot/src/commands/DescribeSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeSecurityProfileCommand.ts rename to clients/client-iot/src/commands/DescribeSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/DescribeStreamCommand.ts b/clients/client-iot/src/commands/DescribeStreamCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeStreamCommand.ts rename to clients/client-iot/src/commands/DescribeStreamCommand.ts diff --git a/clients/client-iot/commands/DescribeThingCommand.ts b/clients/client-iot/src/commands/DescribeThingCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeThingCommand.ts rename to clients/client-iot/src/commands/DescribeThingCommand.ts diff --git a/clients/client-iot/commands/DescribeThingGroupCommand.ts b/clients/client-iot/src/commands/DescribeThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeThingGroupCommand.ts rename to clients/client-iot/src/commands/DescribeThingGroupCommand.ts diff --git a/clients/client-iot/commands/DescribeThingRegistrationTaskCommand.ts b/clients/client-iot/src/commands/DescribeThingRegistrationTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeThingRegistrationTaskCommand.ts rename to clients/client-iot/src/commands/DescribeThingRegistrationTaskCommand.ts diff --git a/clients/client-iot/commands/DescribeThingTypeCommand.ts b/clients/client-iot/src/commands/DescribeThingTypeCommand.ts similarity index 100% rename from clients/client-iot/commands/DescribeThingTypeCommand.ts rename to clients/client-iot/src/commands/DescribeThingTypeCommand.ts diff --git a/clients/client-iot/commands/DetachPolicyCommand.ts b/clients/client-iot/src/commands/DetachPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/DetachPolicyCommand.ts rename to clients/client-iot/src/commands/DetachPolicyCommand.ts diff --git a/clients/client-iot/commands/DetachPrincipalPolicyCommand.ts b/clients/client-iot/src/commands/DetachPrincipalPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/DetachPrincipalPolicyCommand.ts rename to clients/client-iot/src/commands/DetachPrincipalPolicyCommand.ts diff --git a/clients/client-iot/commands/DetachSecurityProfileCommand.ts b/clients/client-iot/src/commands/DetachSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/DetachSecurityProfileCommand.ts rename to clients/client-iot/src/commands/DetachSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/DetachThingPrincipalCommand.ts b/clients/client-iot/src/commands/DetachThingPrincipalCommand.ts similarity index 100% rename from clients/client-iot/commands/DetachThingPrincipalCommand.ts rename to clients/client-iot/src/commands/DetachThingPrincipalCommand.ts diff --git a/clients/client-iot/commands/DisableTopicRuleCommand.ts b/clients/client-iot/src/commands/DisableTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/DisableTopicRuleCommand.ts rename to clients/client-iot/src/commands/DisableTopicRuleCommand.ts diff --git a/clients/client-iot/commands/EnableTopicRuleCommand.ts b/clients/client-iot/src/commands/EnableTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/EnableTopicRuleCommand.ts rename to clients/client-iot/src/commands/EnableTopicRuleCommand.ts diff --git a/clients/client-iot/commands/GetBehaviorModelTrainingSummariesCommand.ts b/clients/client-iot/src/commands/GetBehaviorModelTrainingSummariesCommand.ts similarity index 100% rename from clients/client-iot/commands/GetBehaviorModelTrainingSummariesCommand.ts rename to clients/client-iot/src/commands/GetBehaviorModelTrainingSummariesCommand.ts diff --git a/clients/client-iot/commands/GetBucketsAggregationCommand.ts b/clients/client-iot/src/commands/GetBucketsAggregationCommand.ts similarity index 100% rename from clients/client-iot/commands/GetBucketsAggregationCommand.ts rename to clients/client-iot/src/commands/GetBucketsAggregationCommand.ts diff --git a/clients/client-iot/commands/GetCardinalityCommand.ts b/clients/client-iot/src/commands/GetCardinalityCommand.ts similarity index 100% rename from clients/client-iot/commands/GetCardinalityCommand.ts rename to clients/client-iot/src/commands/GetCardinalityCommand.ts diff --git a/clients/client-iot/commands/GetEffectivePoliciesCommand.ts b/clients/client-iot/src/commands/GetEffectivePoliciesCommand.ts similarity index 100% rename from clients/client-iot/commands/GetEffectivePoliciesCommand.ts rename to clients/client-iot/src/commands/GetEffectivePoliciesCommand.ts diff --git a/clients/client-iot/commands/GetIndexingConfigurationCommand.ts b/clients/client-iot/src/commands/GetIndexingConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/GetIndexingConfigurationCommand.ts rename to clients/client-iot/src/commands/GetIndexingConfigurationCommand.ts diff --git a/clients/client-iot/commands/GetJobDocumentCommand.ts b/clients/client-iot/src/commands/GetJobDocumentCommand.ts similarity index 100% rename from clients/client-iot/commands/GetJobDocumentCommand.ts rename to clients/client-iot/src/commands/GetJobDocumentCommand.ts diff --git a/clients/client-iot/commands/GetLoggingOptionsCommand.ts b/clients/client-iot/src/commands/GetLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot/commands/GetLoggingOptionsCommand.ts rename to clients/client-iot/src/commands/GetLoggingOptionsCommand.ts diff --git a/clients/client-iot/commands/GetOTAUpdateCommand.ts b/clients/client-iot/src/commands/GetOTAUpdateCommand.ts similarity index 100% rename from clients/client-iot/commands/GetOTAUpdateCommand.ts rename to clients/client-iot/src/commands/GetOTAUpdateCommand.ts diff --git a/clients/client-iot/commands/GetPercentilesCommand.ts b/clients/client-iot/src/commands/GetPercentilesCommand.ts similarity index 100% rename from clients/client-iot/commands/GetPercentilesCommand.ts rename to clients/client-iot/src/commands/GetPercentilesCommand.ts diff --git a/clients/client-iot/commands/GetPolicyCommand.ts b/clients/client-iot/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/GetPolicyCommand.ts rename to clients/client-iot/src/commands/GetPolicyCommand.ts diff --git a/clients/client-iot/commands/GetPolicyVersionCommand.ts b/clients/client-iot/src/commands/GetPolicyVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/GetPolicyVersionCommand.ts rename to clients/client-iot/src/commands/GetPolicyVersionCommand.ts diff --git a/clients/client-iot/commands/GetRegistrationCodeCommand.ts b/clients/client-iot/src/commands/GetRegistrationCodeCommand.ts similarity index 100% rename from clients/client-iot/commands/GetRegistrationCodeCommand.ts rename to clients/client-iot/src/commands/GetRegistrationCodeCommand.ts diff --git a/clients/client-iot/commands/GetStatisticsCommand.ts b/clients/client-iot/src/commands/GetStatisticsCommand.ts similarity index 100% rename from clients/client-iot/commands/GetStatisticsCommand.ts rename to clients/client-iot/src/commands/GetStatisticsCommand.ts diff --git a/clients/client-iot/commands/GetTopicRuleCommand.ts b/clients/client-iot/src/commands/GetTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/GetTopicRuleCommand.ts rename to clients/client-iot/src/commands/GetTopicRuleCommand.ts diff --git a/clients/client-iot/commands/GetTopicRuleDestinationCommand.ts b/clients/client-iot/src/commands/GetTopicRuleDestinationCommand.ts similarity index 100% rename from clients/client-iot/commands/GetTopicRuleDestinationCommand.ts rename to clients/client-iot/src/commands/GetTopicRuleDestinationCommand.ts diff --git a/clients/client-iot/commands/GetV2LoggingOptionsCommand.ts b/clients/client-iot/src/commands/GetV2LoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot/commands/GetV2LoggingOptionsCommand.ts rename to clients/client-iot/src/commands/GetV2LoggingOptionsCommand.ts diff --git a/clients/client-iot/commands/ListActiveViolationsCommand.ts b/clients/client-iot/src/commands/ListActiveViolationsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListActiveViolationsCommand.ts rename to clients/client-iot/src/commands/ListActiveViolationsCommand.ts diff --git a/clients/client-iot/commands/ListAttachedPoliciesCommand.ts b/clients/client-iot/src/commands/ListAttachedPoliciesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAttachedPoliciesCommand.ts rename to clients/client-iot/src/commands/ListAttachedPoliciesCommand.ts diff --git a/clients/client-iot/commands/ListAuditFindingsCommand.ts b/clients/client-iot/src/commands/ListAuditFindingsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuditFindingsCommand.ts rename to clients/client-iot/src/commands/ListAuditFindingsCommand.ts diff --git a/clients/client-iot/commands/ListAuditMitigationActionsExecutionsCommand.ts b/clients/client-iot/src/commands/ListAuditMitigationActionsExecutionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuditMitigationActionsExecutionsCommand.ts rename to clients/client-iot/src/commands/ListAuditMitigationActionsExecutionsCommand.ts diff --git a/clients/client-iot/commands/ListAuditMitigationActionsTasksCommand.ts b/clients/client-iot/src/commands/ListAuditMitigationActionsTasksCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuditMitigationActionsTasksCommand.ts rename to clients/client-iot/src/commands/ListAuditMitigationActionsTasksCommand.ts diff --git a/clients/client-iot/commands/ListAuditSuppressionsCommand.ts b/clients/client-iot/src/commands/ListAuditSuppressionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuditSuppressionsCommand.ts rename to clients/client-iot/src/commands/ListAuditSuppressionsCommand.ts diff --git a/clients/client-iot/commands/ListAuditTasksCommand.ts b/clients/client-iot/src/commands/ListAuditTasksCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuditTasksCommand.ts rename to clients/client-iot/src/commands/ListAuditTasksCommand.ts diff --git a/clients/client-iot/commands/ListAuthorizersCommand.ts b/clients/client-iot/src/commands/ListAuthorizersCommand.ts similarity index 100% rename from clients/client-iot/commands/ListAuthorizersCommand.ts rename to clients/client-iot/src/commands/ListAuthorizersCommand.ts diff --git a/clients/client-iot/commands/ListBillingGroupsCommand.ts b/clients/client-iot/src/commands/ListBillingGroupsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListBillingGroupsCommand.ts rename to clients/client-iot/src/commands/ListBillingGroupsCommand.ts diff --git a/clients/client-iot/commands/ListCACertificatesCommand.ts b/clients/client-iot/src/commands/ListCACertificatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListCACertificatesCommand.ts rename to clients/client-iot/src/commands/ListCACertificatesCommand.ts diff --git a/clients/client-iot/commands/ListCertificatesByCACommand.ts b/clients/client-iot/src/commands/ListCertificatesByCACommand.ts similarity index 100% rename from clients/client-iot/commands/ListCertificatesByCACommand.ts rename to clients/client-iot/src/commands/ListCertificatesByCACommand.ts diff --git a/clients/client-iot/commands/ListCertificatesCommand.ts b/clients/client-iot/src/commands/ListCertificatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListCertificatesCommand.ts rename to clients/client-iot/src/commands/ListCertificatesCommand.ts diff --git a/clients/client-iot/commands/ListCustomMetricsCommand.ts b/clients/client-iot/src/commands/ListCustomMetricsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListCustomMetricsCommand.ts rename to clients/client-iot/src/commands/ListCustomMetricsCommand.ts diff --git a/clients/client-iot/commands/ListDetectMitigationActionsExecutionsCommand.ts b/clients/client-iot/src/commands/ListDetectMitigationActionsExecutionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListDetectMitigationActionsExecutionsCommand.ts rename to clients/client-iot/src/commands/ListDetectMitigationActionsExecutionsCommand.ts diff --git a/clients/client-iot/commands/ListDetectMitigationActionsTasksCommand.ts b/clients/client-iot/src/commands/ListDetectMitigationActionsTasksCommand.ts similarity index 100% rename from clients/client-iot/commands/ListDetectMitigationActionsTasksCommand.ts rename to clients/client-iot/src/commands/ListDetectMitigationActionsTasksCommand.ts diff --git a/clients/client-iot/commands/ListDimensionsCommand.ts b/clients/client-iot/src/commands/ListDimensionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListDimensionsCommand.ts rename to clients/client-iot/src/commands/ListDimensionsCommand.ts diff --git a/clients/client-iot/commands/ListDomainConfigurationsCommand.ts b/clients/client-iot/src/commands/ListDomainConfigurationsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListDomainConfigurationsCommand.ts rename to clients/client-iot/src/commands/ListDomainConfigurationsCommand.ts diff --git a/clients/client-iot/commands/ListFleetMetricsCommand.ts b/clients/client-iot/src/commands/ListFleetMetricsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListFleetMetricsCommand.ts rename to clients/client-iot/src/commands/ListFleetMetricsCommand.ts diff --git a/clients/client-iot/commands/ListIndicesCommand.ts b/clients/client-iot/src/commands/ListIndicesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListIndicesCommand.ts rename to clients/client-iot/src/commands/ListIndicesCommand.ts diff --git a/clients/client-iot/commands/ListJobExecutionsForJobCommand.ts b/clients/client-iot/src/commands/ListJobExecutionsForJobCommand.ts similarity index 100% rename from clients/client-iot/commands/ListJobExecutionsForJobCommand.ts rename to clients/client-iot/src/commands/ListJobExecutionsForJobCommand.ts diff --git a/clients/client-iot/commands/ListJobExecutionsForThingCommand.ts b/clients/client-iot/src/commands/ListJobExecutionsForThingCommand.ts similarity index 100% rename from clients/client-iot/commands/ListJobExecutionsForThingCommand.ts rename to clients/client-iot/src/commands/ListJobExecutionsForThingCommand.ts diff --git a/clients/client-iot/commands/ListJobTemplatesCommand.ts b/clients/client-iot/src/commands/ListJobTemplatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListJobTemplatesCommand.ts rename to clients/client-iot/src/commands/ListJobTemplatesCommand.ts diff --git a/clients/client-iot/commands/ListJobsCommand.ts b/clients/client-iot/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListJobsCommand.ts rename to clients/client-iot/src/commands/ListJobsCommand.ts diff --git a/clients/client-iot/commands/ListMitigationActionsCommand.ts b/clients/client-iot/src/commands/ListMitigationActionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListMitigationActionsCommand.ts rename to clients/client-iot/src/commands/ListMitigationActionsCommand.ts diff --git a/clients/client-iot/commands/ListOTAUpdatesCommand.ts b/clients/client-iot/src/commands/ListOTAUpdatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListOTAUpdatesCommand.ts rename to clients/client-iot/src/commands/ListOTAUpdatesCommand.ts diff --git a/clients/client-iot/commands/ListOutgoingCertificatesCommand.ts b/clients/client-iot/src/commands/ListOutgoingCertificatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListOutgoingCertificatesCommand.ts rename to clients/client-iot/src/commands/ListOutgoingCertificatesCommand.ts diff --git a/clients/client-iot/commands/ListPoliciesCommand.ts b/clients/client-iot/src/commands/ListPoliciesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListPoliciesCommand.ts rename to clients/client-iot/src/commands/ListPoliciesCommand.ts diff --git a/clients/client-iot/commands/ListPolicyPrincipalsCommand.ts b/clients/client-iot/src/commands/ListPolicyPrincipalsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListPolicyPrincipalsCommand.ts rename to clients/client-iot/src/commands/ListPolicyPrincipalsCommand.ts diff --git a/clients/client-iot/commands/ListPolicyVersionsCommand.ts b/clients/client-iot/src/commands/ListPolicyVersionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListPolicyVersionsCommand.ts rename to clients/client-iot/src/commands/ListPolicyVersionsCommand.ts diff --git a/clients/client-iot/commands/ListPrincipalPoliciesCommand.ts b/clients/client-iot/src/commands/ListPrincipalPoliciesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListPrincipalPoliciesCommand.ts rename to clients/client-iot/src/commands/ListPrincipalPoliciesCommand.ts diff --git a/clients/client-iot/commands/ListPrincipalThingsCommand.ts b/clients/client-iot/src/commands/ListPrincipalThingsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListPrincipalThingsCommand.ts rename to clients/client-iot/src/commands/ListPrincipalThingsCommand.ts diff --git a/clients/client-iot/commands/ListProvisioningTemplateVersionsCommand.ts b/clients/client-iot/src/commands/ListProvisioningTemplateVersionsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListProvisioningTemplateVersionsCommand.ts rename to clients/client-iot/src/commands/ListProvisioningTemplateVersionsCommand.ts diff --git a/clients/client-iot/commands/ListProvisioningTemplatesCommand.ts b/clients/client-iot/src/commands/ListProvisioningTemplatesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListProvisioningTemplatesCommand.ts rename to clients/client-iot/src/commands/ListProvisioningTemplatesCommand.ts diff --git a/clients/client-iot/commands/ListRoleAliasesCommand.ts b/clients/client-iot/src/commands/ListRoleAliasesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListRoleAliasesCommand.ts rename to clients/client-iot/src/commands/ListRoleAliasesCommand.ts diff --git a/clients/client-iot/commands/ListScheduledAuditsCommand.ts b/clients/client-iot/src/commands/ListScheduledAuditsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListScheduledAuditsCommand.ts rename to clients/client-iot/src/commands/ListScheduledAuditsCommand.ts diff --git a/clients/client-iot/commands/ListSecurityProfilesCommand.ts b/clients/client-iot/src/commands/ListSecurityProfilesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListSecurityProfilesCommand.ts rename to clients/client-iot/src/commands/ListSecurityProfilesCommand.ts diff --git a/clients/client-iot/commands/ListSecurityProfilesForTargetCommand.ts b/clients/client-iot/src/commands/ListSecurityProfilesForTargetCommand.ts similarity index 100% rename from clients/client-iot/commands/ListSecurityProfilesForTargetCommand.ts rename to clients/client-iot/src/commands/ListSecurityProfilesForTargetCommand.ts diff --git a/clients/client-iot/commands/ListStreamsCommand.ts b/clients/client-iot/src/commands/ListStreamsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListStreamsCommand.ts rename to clients/client-iot/src/commands/ListStreamsCommand.ts diff --git a/clients/client-iot/commands/ListTagsForResourceCommand.ts b/clients/client-iot/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iot/commands/ListTagsForResourceCommand.ts rename to clients/client-iot/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iot/commands/ListTargetsForPolicyCommand.ts b/clients/client-iot/src/commands/ListTargetsForPolicyCommand.ts similarity index 100% rename from clients/client-iot/commands/ListTargetsForPolicyCommand.ts rename to clients/client-iot/src/commands/ListTargetsForPolicyCommand.ts diff --git a/clients/client-iot/commands/ListTargetsForSecurityProfileCommand.ts b/clients/client-iot/src/commands/ListTargetsForSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/ListTargetsForSecurityProfileCommand.ts rename to clients/client-iot/src/commands/ListTargetsForSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/ListThingGroupsCommand.ts b/clients/client-iot/src/commands/ListThingGroupsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingGroupsCommand.ts rename to clients/client-iot/src/commands/ListThingGroupsCommand.ts diff --git a/clients/client-iot/commands/ListThingGroupsForThingCommand.ts b/clients/client-iot/src/commands/ListThingGroupsForThingCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingGroupsForThingCommand.ts rename to clients/client-iot/src/commands/ListThingGroupsForThingCommand.ts diff --git a/clients/client-iot/commands/ListThingPrincipalsCommand.ts b/clients/client-iot/src/commands/ListThingPrincipalsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingPrincipalsCommand.ts rename to clients/client-iot/src/commands/ListThingPrincipalsCommand.ts diff --git a/clients/client-iot/commands/ListThingRegistrationTaskReportsCommand.ts b/clients/client-iot/src/commands/ListThingRegistrationTaskReportsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingRegistrationTaskReportsCommand.ts rename to clients/client-iot/src/commands/ListThingRegistrationTaskReportsCommand.ts diff --git a/clients/client-iot/commands/ListThingRegistrationTasksCommand.ts b/clients/client-iot/src/commands/ListThingRegistrationTasksCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingRegistrationTasksCommand.ts rename to clients/client-iot/src/commands/ListThingRegistrationTasksCommand.ts diff --git a/clients/client-iot/commands/ListThingTypesCommand.ts b/clients/client-iot/src/commands/ListThingTypesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingTypesCommand.ts rename to clients/client-iot/src/commands/ListThingTypesCommand.ts diff --git a/clients/client-iot/commands/ListThingsCommand.ts b/clients/client-iot/src/commands/ListThingsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingsCommand.ts rename to clients/client-iot/src/commands/ListThingsCommand.ts diff --git a/clients/client-iot/commands/ListThingsInBillingGroupCommand.ts b/clients/client-iot/src/commands/ListThingsInBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingsInBillingGroupCommand.ts rename to clients/client-iot/src/commands/ListThingsInBillingGroupCommand.ts diff --git a/clients/client-iot/commands/ListThingsInThingGroupCommand.ts b/clients/client-iot/src/commands/ListThingsInThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/ListThingsInThingGroupCommand.ts rename to clients/client-iot/src/commands/ListThingsInThingGroupCommand.ts diff --git a/clients/client-iot/commands/ListTopicRuleDestinationsCommand.ts b/clients/client-iot/src/commands/ListTopicRuleDestinationsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListTopicRuleDestinationsCommand.ts rename to clients/client-iot/src/commands/ListTopicRuleDestinationsCommand.ts diff --git a/clients/client-iot/commands/ListTopicRulesCommand.ts b/clients/client-iot/src/commands/ListTopicRulesCommand.ts similarity index 100% rename from clients/client-iot/commands/ListTopicRulesCommand.ts rename to clients/client-iot/src/commands/ListTopicRulesCommand.ts diff --git a/clients/client-iot/commands/ListV2LoggingLevelsCommand.ts b/clients/client-iot/src/commands/ListV2LoggingLevelsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListV2LoggingLevelsCommand.ts rename to clients/client-iot/src/commands/ListV2LoggingLevelsCommand.ts diff --git a/clients/client-iot/commands/ListViolationEventsCommand.ts b/clients/client-iot/src/commands/ListViolationEventsCommand.ts similarity index 100% rename from clients/client-iot/commands/ListViolationEventsCommand.ts rename to clients/client-iot/src/commands/ListViolationEventsCommand.ts diff --git a/clients/client-iot/commands/PutVerificationStateOnViolationCommand.ts b/clients/client-iot/src/commands/PutVerificationStateOnViolationCommand.ts similarity index 100% rename from clients/client-iot/commands/PutVerificationStateOnViolationCommand.ts rename to clients/client-iot/src/commands/PutVerificationStateOnViolationCommand.ts diff --git a/clients/client-iot/commands/RegisterCACertificateCommand.ts b/clients/client-iot/src/commands/RegisterCACertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/RegisterCACertificateCommand.ts rename to clients/client-iot/src/commands/RegisterCACertificateCommand.ts diff --git a/clients/client-iot/commands/RegisterCertificateCommand.ts b/clients/client-iot/src/commands/RegisterCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/RegisterCertificateCommand.ts rename to clients/client-iot/src/commands/RegisterCertificateCommand.ts diff --git a/clients/client-iot/commands/RegisterCertificateWithoutCACommand.ts b/clients/client-iot/src/commands/RegisterCertificateWithoutCACommand.ts similarity index 100% rename from clients/client-iot/commands/RegisterCertificateWithoutCACommand.ts rename to clients/client-iot/src/commands/RegisterCertificateWithoutCACommand.ts diff --git a/clients/client-iot/commands/RegisterThingCommand.ts b/clients/client-iot/src/commands/RegisterThingCommand.ts similarity index 100% rename from clients/client-iot/commands/RegisterThingCommand.ts rename to clients/client-iot/src/commands/RegisterThingCommand.ts diff --git a/clients/client-iot/commands/RejectCertificateTransferCommand.ts b/clients/client-iot/src/commands/RejectCertificateTransferCommand.ts similarity index 100% rename from clients/client-iot/commands/RejectCertificateTransferCommand.ts rename to clients/client-iot/src/commands/RejectCertificateTransferCommand.ts diff --git a/clients/client-iot/commands/RemoveThingFromBillingGroupCommand.ts b/clients/client-iot/src/commands/RemoveThingFromBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/RemoveThingFromBillingGroupCommand.ts rename to clients/client-iot/src/commands/RemoveThingFromBillingGroupCommand.ts diff --git a/clients/client-iot/commands/RemoveThingFromThingGroupCommand.ts b/clients/client-iot/src/commands/RemoveThingFromThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/RemoveThingFromThingGroupCommand.ts rename to clients/client-iot/src/commands/RemoveThingFromThingGroupCommand.ts diff --git a/clients/client-iot/commands/ReplaceTopicRuleCommand.ts b/clients/client-iot/src/commands/ReplaceTopicRuleCommand.ts similarity index 100% rename from clients/client-iot/commands/ReplaceTopicRuleCommand.ts rename to clients/client-iot/src/commands/ReplaceTopicRuleCommand.ts diff --git a/clients/client-iot/commands/SearchIndexCommand.ts b/clients/client-iot/src/commands/SearchIndexCommand.ts similarity index 100% rename from clients/client-iot/commands/SearchIndexCommand.ts rename to clients/client-iot/src/commands/SearchIndexCommand.ts diff --git a/clients/client-iot/commands/SetDefaultAuthorizerCommand.ts b/clients/client-iot/src/commands/SetDefaultAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/SetDefaultAuthorizerCommand.ts rename to clients/client-iot/src/commands/SetDefaultAuthorizerCommand.ts diff --git a/clients/client-iot/commands/SetDefaultPolicyVersionCommand.ts b/clients/client-iot/src/commands/SetDefaultPolicyVersionCommand.ts similarity index 100% rename from clients/client-iot/commands/SetDefaultPolicyVersionCommand.ts rename to clients/client-iot/src/commands/SetDefaultPolicyVersionCommand.ts diff --git a/clients/client-iot/commands/SetLoggingOptionsCommand.ts b/clients/client-iot/src/commands/SetLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot/commands/SetLoggingOptionsCommand.ts rename to clients/client-iot/src/commands/SetLoggingOptionsCommand.ts diff --git a/clients/client-iot/commands/SetV2LoggingLevelCommand.ts b/clients/client-iot/src/commands/SetV2LoggingLevelCommand.ts similarity index 100% rename from clients/client-iot/commands/SetV2LoggingLevelCommand.ts rename to clients/client-iot/src/commands/SetV2LoggingLevelCommand.ts diff --git a/clients/client-iot/commands/SetV2LoggingOptionsCommand.ts b/clients/client-iot/src/commands/SetV2LoggingOptionsCommand.ts similarity index 100% rename from clients/client-iot/commands/SetV2LoggingOptionsCommand.ts rename to clients/client-iot/src/commands/SetV2LoggingOptionsCommand.ts diff --git a/clients/client-iot/commands/StartAuditMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/StartAuditMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/StartAuditMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/StartAuditMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/StartDetectMitigationActionsTaskCommand.ts b/clients/client-iot/src/commands/StartDetectMitigationActionsTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/StartDetectMitigationActionsTaskCommand.ts rename to clients/client-iot/src/commands/StartDetectMitigationActionsTaskCommand.ts diff --git a/clients/client-iot/commands/StartOnDemandAuditTaskCommand.ts b/clients/client-iot/src/commands/StartOnDemandAuditTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/StartOnDemandAuditTaskCommand.ts rename to clients/client-iot/src/commands/StartOnDemandAuditTaskCommand.ts diff --git a/clients/client-iot/commands/StartThingRegistrationTaskCommand.ts b/clients/client-iot/src/commands/StartThingRegistrationTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/StartThingRegistrationTaskCommand.ts rename to clients/client-iot/src/commands/StartThingRegistrationTaskCommand.ts diff --git a/clients/client-iot/commands/StopThingRegistrationTaskCommand.ts b/clients/client-iot/src/commands/StopThingRegistrationTaskCommand.ts similarity index 100% rename from clients/client-iot/commands/StopThingRegistrationTaskCommand.ts rename to clients/client-iot/src/commands/StopThingRegistrationTaskCommand.ts diff --git a/clients/client-iot/commands/TagResourceCommand.ts b/clients/client-iot/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iot/commands/TagResourceCommand.ts rename to clients/client-iot/src/commands/TagResourceCommand.ts diff --git a/clients/client-iot/commands/TestAuthorizationCommand.ts b/clients/client-iot/src/commands/TestAuthorizationCommand.ts similarity index 100% rename from clients/client-iot/commands/TestAuthorizationCommand.ts rename to clients/client-iot/src/commands/TestAuthorizationCommand.ts diff --git a/clients/client-iot/commands/TestInvokeAuthorizerCommand.ts b/clients/client-iot/src/commands/TestInvokeAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/TestInvokeAuthorizerCommand.ts rename to clients/client-iot/src/commands/TestInvokeAuthorizerCommand.ts diff --git a/clients/client-iot/commands/TransferCertificateCommand.ts b/clients/client-iot/src/commands/TransferCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/TransferCertificateCommand.ts rename to clients/client-iot/src/commands/TransferCertificateCommand.ts diff --git a/clients/client-iot/commands/UntagResourceCommand.ts b/clients/client-iot/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iot/commands/UntagResourceCommand.ts rename to clients/client-iot/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iot/commands/UpdateAccountAuditConfigurationCommand.ts b/clients/client-iot/src/commands/UpdateAccountAuditConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateAccountAuditConfigurationCommand.ts rename to clients/client-iot/src/commands/UpdateAccountAuditConfigurationCommand.ts diff --git a/clients/client-iot/commands/UpdateAuditSuppressionCommand.ts b/clients/client-iot/src/commands/UpdateAuditSuppressionCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateAuditSuppressionCommand.ts rename to clients/client-iot/src/commands/UpdateAuditSuppressionCommand.ts diff --git a/clients/client-iot/commands/UpdateAuthorizerCommand.ts b/clients/client-iot/src/commands/UpdateAuthorizerCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateAuthorizerCommand.ts rename to clients/client-iot/src/commands/UpdateAuthorizerCommand.ts diff --git a/clients/client-iot/commands/UpdateBillingGroupCommand.ts b/clients/client-iot/src/commands/UpdateBillingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateBillingGroupCommand.ts rename to clients/client-iot/src/commands/UpdateBillingGroupCommand.ts diff --git a/clients/client-iot/commands/UpdateCACertificateCommand.ts b/clients/client-iot/src/commands/UpdateCACertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateCACertificateCommand.ts rename to clients/client-iot/src/commands/UpdateCACertificateCommand.ts diff --git a/clients/client-iot/commands/UpdateCertificateCommand.ts b/clients/client-iot/src/commands/UpdateCertificateCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateCertificateCommand.ts rename to clients/client-iot/src/commands/UpdateCertificateCommand.ts diff --git a/clients/client-iot/commands/UpdateCustomMetricCommand.ts b/clients/client-iot/src/commands/UpdateCustomMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateCustomMetricCommand.ts rename to clients/client-iot/src/commands/UpdateCustomMetricCommand.ts diff --git a/clients/client-iot/commands/UpdateDimensionCommand.ts b/clients/client-iot/src/commands/UpdateDimensionCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateDimensionCommand.ts rename to clients/client-iot/src/commands/UpdateDimensionCommand.ts diff --git a/clients/client-iot/commands/UpdateDomainConfigurationCommand.ts b/clients/client-iot/src/commands/UpdateDomainConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateDomainConfigurationCommand.ts rename to clients/client-iot/src/commands/UpdateDomainConfigurationCommand.ts diff --git a/clients/client-iot/commands/UpdateDynamicThingGroupCommand.ts b/clients/client-iot/src/commands/UpdateDynamicThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateDynamicThingGroupCommand.ts rename to clients/client-iot/src/commands/UpdateDynamicThingGroupCommand.ts diff --git a/clients/client-iot/commands/UpdateEventConfigurationsCommand.ts b/clients/client-iot/src/commands/UpdateEventConfigurationsCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateEventConfigurationsCommand.ts rename to clients/client-iot/src/commands/UpdateEventConfigurationsCommand.ts diff --git a/clients/client-iot/commands/UpdateFleetMetricCommand.ts b/clients/client-iot/src/commands/UpdateFleetMetricCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateFleetMetricCommand.ts rename to clients/client-iot/src/commands/UpdateFleetMetricCommand.ts diff --git a/clients/client-iot/commands/UpdateIndexingConfigurationCommand.ts b/clients/client-iot/src/commands/UpdateIndexingConfigurationCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateIndexingConfigurationCommand.ts rename to clients/client-iot/src/commands/UpdateIndexingConfigurationCommand.ts diff --git a/clients/client-iot/commands/UpdateJobCommand.ts b/clients/client-iot/src/commands/UpdateJobCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateJobCommand.ts rename to clients/client-iot/src/commands/UpdateJobCommand.ts diff --git a/clients/client-iot/commands/UpdateMitigationActionCommand.ts b/clients/client-iot/src/commands/UpdateMitigationActionCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateMitigationActionCommand.ts rename to clients/client-iot/src/commands/UpdateMitigationActionCommand.ts diff --git a/clients/client-iot/commands/UpdateProvisioningTemplateCommand.ts b/clients/client-iot/src/commands/UpdateProvisioningTemplateCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateProvisioningTemplateCommand.ts rename to clients/client-iot/src/commands/UpdateProvisioningTemplateCommand.ts diff --git a/clients/client-iot/commands/UpdateRoleAliasCommand.ts b/clients/client-iot/src/commands/UpdateRoleAliasCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateRoleAliasCommand.ts rename to clients/client-iot/src/commands/UpdateRoleAliasCommand.ts diff --git a/clients/client-iot/commands/UpdateScheduledAuditCommand.ts b/clients/client-iot/src/commands/UpdateScheduledAuditCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateScheduledAuditCommand.ts rename to clients/client-iot/src/commands/UpdateScheduledAuditCommand.ts diff --git a/clients/client-iot/commands/UpdateSecurityProfileCommand.ts b/clients/client-iot/src/commands/UpdateSecurityProfileCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateSecurityProfileCommand.ts rename to clients/client-iot/src/commands/UpdateSecurityProfileCommand.ts diff --git a/clients/client-iot/commands/UpdateStreamCommand.ts b/clients/client-iot/src/commands/UpdateStreamCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateStreamCommand.ts rename to clients/client-iot/src/commands/UpdateStreamCommand.ts diff --git a/clients/client-iot/commands/UpdateThingCommand.ts b/clients/client-iot/src/commands/UpdateThingCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateThingCommand.ts rename to clients/client-iot/src/commands/UpdateThingCommand.ts diff --git a/clients/client-iot/commands/UpdateThingGroupCommand.ts b/clients/client-iot/src/commands/UpdateThingGroupCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateThingGroupCommand.ts rename to clients/client-iot/src/commands/UpdateThingGroupCommand.ts diff --git a/clients/client-iot/commands/UpdateThingGroupsForThingCommand.ts b/clients/client-iot/src/commands/UpdateThingGroupsForThingCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateThingGroupsForThingCommand.ts rename to clients/client-iot/src/commands/UpdateThingGroupsForThingCommand.ts diff --git a/clients/client-iot/commands/UpdateTopicRuleDestinationCommand.ts b/clients/client-iot/src/commands/UpdateTopicRuleDestinationCommand.ts similarity index 100% rename from clients/client-iot/commands/UpdateTopicRuleDestinationCommand.ts rename to clients/client-iot/src/commands/UpdateTopicRuleDestinationCommand.ts diff --git a/clients/client-iot/commands/ValidateSecurityProfileBehaviorsCommand.ts b/clients/client-iot/src/commands/ValidateSecurityProfileBehaviorsCommand.ts similarity index 100% rename from clients/client-iot/commands/ValidateSecurityProfileBehaviorsCommand.ts rename to clients/client-iot/src/commands/ValidateSecurityProfileBehaviorsCommand.ts diff --git a/clients/client-iot/endpoints.ts b/clients/client-iot/src/endpoints.ts similarity index 100% rename from clients/client-iot/endpoints.ts rename to clients/client-iot/src/endpoints.ts diff --git a/clients/client-iot/index.ts b/clients/client-iot/src/index.ts similarity index 100% rename from clients/client-iot/index.ts rename to clients/client-iot/src/index.ts diff --git a/clients/client-iot/models/index.ts b/clients/client-iot/src/models/index.ts similarity index 100% rename from clients/client-iot/models/index.ts rename to clients/client-iot/src/models/index.ts diff --git a/clients/client-iot/models/models_0.ts b/clients/client-iot/src/models/models_0.ts similarity index 100% rename from clients/client-iot/models/models_0.ts rename to clients/client-iot/src/models/models_0.ts diff --git a/clients/client-iot/models/models_1.ts b/clients/client-iot/src/models/models_1.ts similarity index 100% rename from clients/client-iot/models/models_1.ts rename to clients/client-iot/src/models/models_1.ts diff --git a/clients/client-iot/models/models_2.ts b/clients/client-iot/src/models/models_2.ts similarity index 100% rename from clients/client-iot/models/models_2.ts rename to clients/client-iot/src/models/models_2.ts diff --git a/clients/client-iot/pagination/GetBehaviorModelTrainingSummariesPaginator.ts b/clients/client-iot/src/pagination/GetBehaviorModelTrainingSummariesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/GetBehaviorModelTrainingSummariesPaginator.ts rename to clients/client-iot/src/pagination/GetBehaviorModelTrainingSummariesPaginator.ts diff --git a/clients/client-iot/pagination/Interfaces.ts b/clients/client-iot/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iot/pagination/Interfaces.ts rename to clients/client-iot/src/pagination/Interfaces.ts diff --git a/clients/client-iot/pagination/ListActiveViolationsPaginator.ts b/clients/client-iot/src/pagination/ListActiveViolationsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListActiveViolationsPaginator.ts rename to clients/client-iot/src/pagination/ListActiveViolationsPaginator.ts diff --git a/clients/client-iot/pagination/ListAttachedPoliciesPaginator.ts b/clients/client-iot/src/pagination/ListAttachedPoliciesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAttachedPoliciesPaginator.ts rename to clients/client-iot/src/pagination/ListAttachedPoliciesPaginator.ts diff --git a/clients/client-iot/pagination/ListAuditFindingsPaginator.ts b/clients/client-iot/src/pagination/ListAuditFindingsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuditFindingsPaginator.ts rename to clients/client-iot/src/pagination/ListAuditFindingsPaginator.ts diff --git a/clients/client-iot/pagination/ListAuditMitigationActionsExecutionsPaginator.ts b/clients/client-iot/src/pagination/ListAuditMitigationActionsExecutionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuditMitigationActionsExecutionsPaginator.ts rename to clients/client-iot/src/pagination/ListAuditMitigationActionsExecutionsPaginator.ts diff --git a/clients/client-iot/pagination/ListAuditMitigationActionsTasksPaginator.ts b/clients/client-iot/src/pagination/ListAuditMitigationActionsTasksPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuditMitigationActionsTasksPaginator.ts rename to clients/client-iot/src/pagination/ListAuditMitigationActionsTasksPaginator.ts diff --git a/clients/client-iot/pagination/ListAuditSuppressionsPaginator.ts b/clients/client-iot/src/pagination/ListAuditSuppressionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuditSuppressionsPaginator.ts rename to clients/client-iot/src/pagination/ListAuditSuppressionsPaginator.ts diff --git a/clients/client-iot/pagination/ListAuditTasksPaginator.ts b/clients/client-iot/src/pagination/ListAuditTasksPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuditTasksPaginator.ts rename to clients/client-iot/src/pagination/ListAuditTasksPaginator.ts diff --git a/clients/client-iot/pagination/ListAuthorizersPaginator.ts b/clients/client-iot/src/pagination/ListAuthorizersPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListAuthorizersPaginator.ts rename to clients/client-iot/src/pagination/ListAuthorizersPaginator.ts diff --git a/clients/client-iot/pagination/ListBillingGroupsPaginator.ts b/clients/client-iot/src/pagination/ListBillingGroupsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListBillingGroupsPaginator.ts rename to clients/client-iot/src/pagination/ListBillingGroupsPaginator.ts diff --git a/clients/client-iot/pagination/ListCACertificatesPaginator.ts b/clients/client-iot/src/pagination/ListCACertificatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListCACertificatesPaginator.ts rename to clients/client-iot/src/pagination/ListCACertificatesPaginator.ts diff --git a/clients/client-iot/pagination/ListCertificatesByCAPaginator.ts b/clients/client-iot/src/pagination/ListCertificatesByCAPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListCertificatesByCAPaginator.ts rename to clients/client-iot/src/pagination/ListCertificatesByCAPaginator.ts diff --git a/clients/client-iot/pagination/ListCertificatesPaginator.ts b/clients/client-iot/src/pagination/ListCertificatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListCertificatesPaginator.ts rename to clients/client-iot/src/pagination/ListCertificatesPaginator.ts diff --git a/clients/client-iot/pagination/ListCustomMetricsPaginator.ts b/clients/client-iot/src/pagination/ListCustomMetricsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListCustomMetricsPaginator.ts rename to clients/client-iot/src/pagination/ListCustomMetricsPaginator.ts diff --git a/clients/client-iot/pagination/ListDetectMitigationActionsExecutionsPaginator.ts b/clients/client-iot/src/pagination/ListDetectMitigationActionsExecutionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListDetectMitigationActionsExecutionsPaginator.ts rename to clients/client-iot/src/pagination/ListDetectMitigationActionsExecutionsPaginator.ts diff --git a/clients/client-iot/pagination/ListDetectMitigationActionsTasksPaginator.ts b/clients/client-iot/src/pagination/ListDetectMitigationActionsTasksPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListDetectMitigationActionsTasksPaginator.ts rename to clients/client-iot/src/pagination/ListDetectMitigationActionsTasksPaginator.ts diff --git a/clients/client-iot/pagination/ListDimensionsPaginator.ts b/clients/client-iot/src/pagination/ListDimensionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListDimensionsPaginator.ts rename to clients/client-iot/src/pagination/ListDimensionsPaginator.ts diff --git a/clients/client-iot/pagination/ListDomainConfigurationsPaginator.ts b/clients/client-iot/src/pagination/ListDomainConfigurationsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListDomainConfigurationsPaginator.ts rename to clients/client-iot/src/pagination/ListDomainConfigurationsPaginator.ts diff --git a/clients/client-iot/pagination/ListFleetMetricsPaginator.ts b/clients/client-iot/src/pagination/ListFleetMetricsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListFleetMetricsPaginator.ts rename to clients/client-iot/src/pagination/ListFleetMetricsPaginator.ts diff --git a/clients/client-iot/pagination/ListIndicesPaginator.ts b/clients/client-iot/src/pagination/ListIndicesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListIndicesPaginator.ts rename to clients/client-iot/src/pagination/ListIndicesPaginator.ts diff --git a/clients/client-iot/pagination/ListJobExecutionsForJobPaginator.ts b/clients/client-iot/src/pagination/ListJobExecutionsForJobPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListJobExecutionsForJobPaginator.ts rename to clients/client-iot/src/pagination/ListJobExecutionsForJobPaginator.ts diff --git a/clients/client-iot/pagination/ListJobExecutionsForThingPaginator.ts b/clients/client-iot/src/pagination/ListJobExecutionsForThingPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListJobExecutionsForThingPaginator.ts rename to clients/client-iot/src/pagination/ListJobExecutionsForThingPaginator.ts diff --git a/clients/client-iot/pagination/ListJobTemplatesPaginator.ts b/clients/client-iot/src/pagination/ListJobTemplatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListJobTemplatesPaginator.ts rename to clients/client-iot/src/pagination/ListJobTemplatesPaginator.ts diff --git a/clients/client-iot/pagination/ListJobsPaginator.ts b/clients/client-iot/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListJobsPaginator.ts rename to clients/client-iot/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-iot/pagination/ListMitigationActionsPaginator.ts b/clients/client-iot/src/pagination/ListMitigationActionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListMitigationActionsPaginator.ts rename to clients/client-iot/src/pagination/ListMitigationActionsPaginator.ts diff --git a/clients/client-iot/pagination/ListOTAUpdatesPaginator.ts b/clients/client-iot/src/pagination/ListOTAUpdatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListOTAUpdatesPaginator.ts rename to clients/client-iot/src/pagination/ListOTAUpdatesPaginator.ts diff --git a/clients/client-iot/pagination/ListOutgoingCertificatesPaginator.ts b/clients/client-iot/src/pagination/ListOutgoingCertificatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListOutgoingCertificatesPaginator.ts rename to clients/client-iot/src/pagination/ListOutgoingCertificatesPaginator.ts diff --git a/clients/client-iot/pagination/ListPoliciesPaginator.ts b/clients/client-iot/src/pagination/ListPoliciesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListPoliciesPaginator.ts rename to clients/client-iot/src/pagination/ListPoliciesPaginator.ts diff --git a/clients/client-iot/pagination/ListPolicyPrincipalsPaginator.ts b/clients/client-iot/src/pagination/ListPolicyPrincipalsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListPolicyPrincipalsPaginator.ts rename to clients/client-iot/src/pagination/ListPolicyPrincipalsPaginator.ts diff --git a/clients/client-iot/pagination/ListPrincipalPoliciesPaginator.ts b/clients/client-iot/src/pagination/ListPrincipalPoliciesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListPrincipalPoliciesPaginator.ts rename to clients/client-iot/src/pagination/ListPrincipalPoliciesPaginator.ts diff --git a/clients/client-iot/pagination/ListPrincipalThingsPaginator.ts b/clients/client-iot/src/pagination/ListPrincipalThingsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListPrincipalThingsPaginator.ts rename to clients/client-iot/src/pagination/ListPrincipalThingsPaginator.ts diff --git a/clients/client-iot/pagination/ListProvisioningTemplateVersionsPaginator.ts b/clients/client-iot/src/pagination/ListProvisioningTemplateVersionsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListProvisioningTemplateVersionsPaginator.ts rename to clients/client-iot/src/pagination/ListProvisioningTemplateVersionsPaginator.ts diff --git a/clients/client-iot/pagination/ListProvisioningTemplatesPaginator.ts b/clients/client-iot/src/pagination/ListProvisioningTemplatesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListProvisioningTemplatesPaginator.ts rename to clients/client-iot/src/pagination/ListProvisioningTemplatesPaginator.ts diff --git a/clients/client-iot/pagination/ListRoleAliasesPaginator.ts b/clients/client-iot/src/pagination/ListRoleAliasesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListRoleAliasesPaginator.ts rename to clients/client-iot/src/pagination/ListRoleAliasesPaginator.ts diff --git a/clients/client-iot/pagination/ListScheduledAuditsPaginator.ts b/clients/client-iot/src/pagination/ListScheduledAuditsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListScheduledAuditsPaginator.ts rename to clients/client-iot/src/pagination/ListScheduledAuditsPaginator.ts diff --git a/clients/client-iot/pagination/ListSecurityProfilesForTargetPaginator.ts b/clients/client-iot/src/pagination/ListSecurityProfilesForTargetPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListSecurityProfilesForTargetPaginator.ts rename to clients/client-iot/src/pagination/ListSecurityProfilesForTargetPaginator.ts diff --git a/clients/client-iot/pagination/ListSecurityProfilesPaginator.ts b/clients/client-iot/src/pagination/ListSecurityProfilesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListSecurityProfilesPaginator.ts rename to clients/client-iot/src/pagination/ListSecurityProfilesPaginator.ts diff --git a/clients/client-iot/pagination/ListStreamsPaginator.ts b/clients/client-iot/src/pagination/ListStreamsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListStreamsPaginator.ts rename to clients/client-iot/src/pagination/ListStreamsPaginator.ts diff --git a/clients/client-iot/pagination/ListTagsForResourcePaginator.ts b/clients/client-iot/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListTagsForResourcePaginator.ts rename to clients/client-iot/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-iot/pagination/ListTargetsForPolicyPaginator.ts b/clients/client-iot/src/pagination/ListTargetsForPolicyPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListTargetsForPolicyPaginator.ts rename to clients/client-iot/src/pagination/ListTargetsForPolicyPaginator.ts diff --git a/clients/client-iot/pagination/ListTargetsForSecurityProfilePaginator.ts b/clients/client-iot/src/pagination/ListTargetsForSecurityProfilePaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListTargetsForSecurityProfilePaginator.ts rename to clients/client-iot/src/pagination/ListTargetsForSecurityProfilePaginator.ts diff --git a/clients/client-iot/pagination/ListThingGroupsForThingPaginator.ts b/clients/client-iot/src/pagination/ListThingGroupsForThingPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingGroupsForThingPaginator.ts rename to clients/client-iot/src/pagination/ListThingGroupsForThingPaginator.ts diff --git a/clients/client-iot/pagination/ListThingGroupsPaginator.ts b/clients/client-iot/src/pagination/ListThingGroupsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingGroupsPaginator.ts rename to clients/client-iot/src/pagination/ListThingGroupsPaginator.ts diff --git a/clients/client-iot/pagination/ListThingPrincipalsPaginator.ts b/clients/client-iot/src/pagination/ListThingPrincipalsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingPrincipalsPaginator.ts rename to clients/client-iot/src/pagination/ListThingPrincipalsPaginator.ts diff --git a/clients/client-iot/pagination/ListThingRegistrationTaskReportsPaginator.ts b/clients/client-iot/src/pagination/ListThingRegistrationTaskReportsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingRegistrationTaskReportsPaginator.ts rename to clients/client-iot/src/pagination/ListThingRegistrationTaskReportsPaginator.ts diff --git a/clients/client-iot/pagination/ListThingRegistrationTasksPaginator.ts b/clients/client-iot/src/pagination/ListThingRegistrationTasksPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingRegistrationTasksPaginator.ts rename to clients/client-iot/src/pagination/ListThingRegistrationTasksPaginator.ts diff --git a/clients/client-iot/pagination/ListThingTypesPaginator.ts b/clients/client-iot/src/pagination/ListThingTypesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingTypesPaginator.ts rename to clients/client-iot/src/pagination/ListThingTypesPaginator.ts diff --git a/clients/client-iot/pagination/ListThingsInBillingGroupPaginator.ts b/clients/client-iot/src/pagination/ListThingsInBillingGroupPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingsInBillingGroupPaginator.ts rename to clients/client-iot/src/pagination/ListThingsInBillingGroupPaginator.ts diff --git a/clients/client-iot/pagination/ListThingsInThingGroupPaginator.ts b/clients/client-iot/src/pagination/ListThingsInThingGroupPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingsInThingGroupPaginator.ts rename to clients/client-iot/src/pagination/ListThingsInThingGroupPaginator.ts diff --git a/clients/client-iot/pagination/ListThingsPaginator.ts b/clients/client-iot/src/pagination/ListThingsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListThingsPaginator.ts rename to clients/client-iot/src/pagination/ListThingsPaginator.ts diff --git a/clients/client-iot/pagination/ListTopicRuleDestinationsPaginator.ts b/clients/client-iot/src/pagination/ListTopicRuleDestinationsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListTopicRuleDestinationsPaginator.ts rename to clients/client-iot/src/pagination/ListTopicRuleDestinationsPaginator.ts diff --git a/clients/client-iot/pagination/ListTopicRulesPaginator.ts b/clients/client-iot/src/pagination/ListTopicRulesPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListTopicRulesPaginator.ts rename to clients/client-iot/src/pagination/ListTopicRulesPaginator.ts diff --git a/clients/client-iot/pagination/ListV2LoggingLevelsPaginator.ts b/clients/client-iot/src/pagination/ListV2LoggingLevelsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListV2LoggingLevelsPaginator.ts rename to clients/client-iot/src/pagination/ListV2LoggingLevelsPaginator.ts diff --git a/clients/client-iot/pagination/ListViolationEventsPaginator.ts b/clients/client-iot/src/pagination/ListViolationEventsPaginator.ts similarity index 100% rename from clients/client-iot/pagination/ListViolationEventsPaginator.ts rename to clients/client-iot/src/pagination/ListViolationEventsPaginator.ts diff --git a/clients/client-iot/protocols/Aws_restJson1.ts b/clients/client-iot/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iot/protocols/Aws_restJson1.ts rename to clients/client-iot/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iot/src/runtimeConfig.browser.ts b/clients/client-iot/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..36848b59be7c --- /dev/null +++ b/clients/client-iot/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTClientConfig } from "./IoTClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot/runtimeConfig.native.ts b/clients/client-iot/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iot/runtimeConfig.native.ts rename to clients/client-iot/src/runtimeConfig.native.ts diff --git a/clients/client-iot/runtimeConfig.shared.ts b/clients/client-iot/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iot/runtimeConfig.shared.ts rename to clients/client-iot/src/runtimeConfig.shared.ts diff --git a/clients/client-iot/src/runtimeConfig.ts b/clients/client-iot/src/runtimeConfig.ts new file mode 100644 index 000000000000..61ce4aabae4c --- /dev/null +++ b/clients/client-iot/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTClientConfig } from "./IoTClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iot/tsconfig.es.json b/clients/client-iot/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iot/tsconfig.es.json +++ b/clients/client-iot/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iot/tsconfig.json b/clients/client-iot/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iot/tsconfig.json +++ b/clients/client-iot/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iot/tsconfig.types.json b/clients/client-iot/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iot/tsconfig.types.json +++ b/clients/client-iot/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotanalytics/.gitignore b/clients/client-iotanalytics/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iotanalytics/.gitignore +++ b/clients/client-iotanalytics/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotanalytics/package.json b/clients/client-iotanalytics/package.json index af30e5351c3d..7af151940f33 100644 --- a/clients/client-iotanalytics/package.json +++ b/clients/client-iotanalytics/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotanalytics", "repository": { "type": "git", diff --git a/clients/client-iotanalytics/runtimeConfig.browser.ts b/clients/client-iotanalytics/runtimeConfig.browser.ts deleted file mode 100644 index 7af9ec715ff7..000000000000 --- a/clients/client-iotanalytics/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTAnalyticsClientConfig } from "./IoTAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotanalytics/runtimeConfig.ts b/clients/client-iotanalytics/runtimeConfig.ts deleted file mode 100644 index 6e02c6a0cb03..000000000000 --- a/clients/client-iotanalytics/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTAnalyticsClientConfig } from "./IoTAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotanalytics/IoTAnalytics.ts b/clients/client-iotanalytics/src/IoTAnalytics.ts similarity index 100% rename from clients/client-iotanalytics/IoTAnalytics.ts rename to clients/client-iotanalytics/src/IoTAnalytics.ts diff --git a/clients/client-iotanalytics/IoTAnalyticsClient.ts b/clients/client-iotanalytics/src/IoTAnalyticsClient.ts similarity index 100% rename from clients/client-iotanalytics/IoTAnalyticsClient.ts rename to clients/client-iotanalytics/src/IoTAnalyticsClient.ts diff --git a/clients/client-iotanalytics/commands/BatchPutMessageCommand.ts b/clients/client-iotanalytics/src/commands/BatchPutMessageCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/BatchPutMessageCommand.ts rename to clients/client-iotanalytics/src/commands/BatchPutMessageCommand.ts diff --git a/clients/client-iotanalytics/commands/CancelPipelineReprocessingCommand.ts b/clients/client-iotanalytics/src/commands/CancelPipelineReprocessingCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CancelPipelineReprocessingCommand.ts rename to clients/client-iotanalytics/src/commands/CancelPipelineReprocessingCommand.ts diff --git a/clients/client-iotanalytics/commands/CreateChannelCommand.ts b/clients/client-iotanalytics/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CreateChannelCommand.ts rename to clients/client-iotanalytics/src/commands/CreateChannelCommand.ts diff --git a/clients/client-iotanalytics/commands/CreateDatasetCommand.ts b/clients/client-iotanalytics/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CreateDatasetCommand.ts rename to clients/client-iotanalytics/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-iotanalytics/commands/CreateDatasetContentCommand.ts b/clients/client-iotanalytics/src/commands/CreateDatasetContentCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CreateDatasetContentCommand.ts rename to clients/client-iotanalytics/src/commands/CreateDatasetContentCommand.ts diff --git a/clients/client-iotanalytics/commands/CreateDatastoreCommand.ts b/clients/client-iotanalytics/src/commands/CreateDatastoreCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CreateDatastoreCommand.ts rename to clients/client-iotanalytics/src/commands/CreateDatastoreCommand.ts diff --git a/clients/client-iotanalytics/commands/CreatePipelineCommand.ts b/clients/client-iotanalytics/src/commands/CreatePipelineCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/CreatePipelineCommand.ts rename to clients/client-iotanalytics/src/commands/CreatePipelineCommand.ts diff --git a/clients/client-iotanalytics/commands/DeleteChannelCommand.ts b/clients/client-iotanalytics/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DeleteChannelCommand.ts rename to clients/client-iotanalytics/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-iotanalytics/commands/DeleteDatasetCommand.ts b/clients/client-iotanalytics/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DeleteDatasetCommand.ts rename to clients/client-iotanalytics/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-iotanalytics/commands/DeleteDatasetContentCommand.ts b/clients/client-iotanalytics/src/commands/DeleteDatasetContentCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DeleteDatasetContentCommand.ts rename to clients/client-iotanalytics/src/commands/DeleteDatasetContentCommand.ts diff --git a/clients/client-iotanalytics/commands/DeleteDatastoreCommand.ts b/clients/client-iotanalytics/src/commands/DeleteDatastoreCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DeleteDatastoreCommand.ts rename to clients/client-iotanalytics/src/commands/DeleteDatastoreCommand.ts diff --git a/clients/client-iotanalytics/commands/DeletePipelineCommand.ts b/clients/client-iotanalytics/src/commands/DeletePipelineCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DeletePipelineCommand.ts rename to clients/client-iotanalytics/src/commands/DeletePipelineCommand.ts diff --git a/clients/client-iotanalytics/commands/DescribeChannelCommand.ts b/clients/client-iotanalytics/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DescribeChannelCommand.ts rename to clients/client-iotanalytics/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-iotanalytics/commands/DescribeDatasetCommand.ts b/clients/client-iotanalytics/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DescribeDatasetCommand.ts rename to clients/client-iotanalytics/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-iotanalytics/commands/DescribeDatastoreCommand.ts b/clients/client-iotanalytics/src/commands/DescribeDatastoreCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DescribeDatastoreCommand.ts rename to clients/client-iotanalytics/src/commands/DescribeDatastoreCommand.ts diff --git a/clients/client-iotanalytics/commands/DescribeLoggingOptionsCommand.ts b/clients/client-iotanalytics/src/commands/DescribeLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DescribeLoggingOptionsCommand.ts rename to clients/client-iotanalytics/src/commands/DescribeLoggingOptionsCommand.ts diff --git a/clients/client-iotanalytics/commands/DescribePipelineCommand.ts b/clients/client-iotanalytics/src/commands/DescribePipelineCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/DescribePipelineCommand.ts rename to clients/client-iotanalytics/src/commands/DescribePipelineCommand.ts diff --git a/clients/client-iotanalytics/commands/GetDatasetContentCommand.ts b/clients/client-iotanalytics/src/commands/GetDatasetContentCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/GetDatasetContentCommand.ts rename to clients/client-iotanalytics/src/commands/GetDatasetContentCommand.ts diff --git a/clients/client-iotanalytics/commands/ListChannelsCommand.ts b/clients/client-iotanalytics/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListChannelsCommand.ts rename to clients/client-iotanalytics/src/commands/ListChannelsCommand.ts diff --git a/clients/client-iotanalytics/commands/ListDatasetContentsCommand.ts b/clients/client-iotanalytics/src/commands/ListDatasetContentsCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListDatasetContentsCommand.ts rename to clients/client-iotanalytics/src/commands/ListDatasetContentsCommand.ts diff --git a/clients/client-iotanalytics/commands/ListDatasetsCommand.ts b/clients/client-iotanalytics/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListDatasetsCommand.ts rename to clients/client-iotanalytics/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-iotanalytics/commands/ListDatastoresCommand.ts b/clients/client-iotanalytics/src/commands/ListDatastoresCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListDatastoresCommand.ts rename to clients/client-iotanalytics/src/commands/ListDatastoresCommand.ts diff --git a/clients/client-iotanalytics/commands/ListPipelinesCommand.ts b/clients/client-iotanalytics/src/commands/ListPipelinesCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListPipelinesCommand.ts rename to clients/client-iotanalytics/src/commands/ListPipelinesCommand.ts diff --git a/clients/client-iotanalytics/commands/ListTagsForResourceCommand.ts b/clients/client-iotanalytics/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/ListTagsForResourceCommand.ts rename to clients/client-iotanalytics/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotanalytics/commands/PutLoggingOptionsCommand.ts b/clients/client-iotanalytics/src/commands/PutLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/PutLoggingOptionsCommand.ts rename to clients/client-iotanalytics/src/commands/PutLoggingOptionsCommand.ts diff --git a/clients/client-iotanalytics/commands/RunPipelineActivityCommand.ts b/clients/client-iotanalytics/src/commands/RunPipelineActivityCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/RunPipelineActivityCommand.ts rename to clients/client-iotanalytics/src/commands/RunPipelineActivityCommand.ts diff --git a/clients/client-iotanalytics/commands/SampleChannelDataCommand.ts b/clients/client-iotanalytics/src/commands/SampleChannelDataCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/SampleChannelDataCommand.ts rename to clients/client-iotanalytics/src/commands/SampleChannelDataCommand.ts diff --git a/clients/client-iotanalytics/commands/StartPipelineReprocessingCommand.ts b/clients/client-iotanalytics/src/commands/StartPipelineReprocessingCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/StartPipelineReprocessingCommand.ts rename to clients/client-iotanalytics/src/commands/StartPipelineReprocessingCommand.ts diff --git a/clients/client-iotanalytics/commands/TagResourceCommand.ts b/clients/client-iotanalytics/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/TagResourceCommand.ts rename to clients/client-iotanalytics/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotanalytics/commands/UntagResourceCommand.ts b/clients/client-iotanalytics/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/UntagResourceCommand.ts rename to clients/client-iotanalytics/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotanalytics/commands/UpdateChannelCommand.ts b/clients/client-iotanalytics/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/UpdateChannelCommand.ts rename to clients/client-iotanalytics/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-iotanalytics/commands/UpdateDatasetCommand.ts b/clients/client-iotanalytics/src/commands/UpdateDatasetCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/UpdateDatasetCommand.ts rename to clients/client-iotanalytics/src/commands/UpdateDatasetCommand.ts diff --git a/clients/client-iotanalytics/commands/UpdateDatastoreCommand.ts b/clients/client-iotanalytics/src/commands/UpdateDatastoreCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/UpdateDatastoreCommand.ts rename to clients/client-iotanalytics/src/commands/UpdateDatastoreCommand.ts diff --git a/clients/client-iotanalytics/commands/UpdatePipelineCommand.ts b/clients/client-iotanalytics/src/commands/UpdatePipelineCommand.ts similarity index 100% rename from clients/client-iotanalytics/commands/UpdatePipelineCommand.ts rename to clients/client-iotanalytics/src/commands/UpdatePipelineCommand.ts diff --git a/clients/client-iotanalytics/endpoints.ts b/clients/client-iotanalytics/src/endpoints.ts similarity index 100% rename from clients/client-iotanalytics/endpoints.ts rename to clients/client-iotanalytics/src/endpoints.ts diff --git a/clients/client-iotanalytics/index.ts b/clients/client-iotanalytics/src/index.ts similarity index 100% rename from clients/client-iotanalytics/index.ts rename to clients/client-iotanalytics/src/index.ts diff --git a/clients/client-iotanalytics/models/index.ts b/clients/client-iotanalytics/src/models/index.ts similarity index 100% rename from clients/client-iotanalytics/models/index.ts rename to clients/client-iotanalytics/src/models/index.ts diff --git a/clients/client-iotanalytics/models/models_0.ts b/clients/client-iotanalytics/src/models/models_0.ts similarity index 100% rename from clients/client-iotanalytics/models/models_0.ts rename to clients/client-iotanalytics/src/models/models_0.ts diff --git a/clients/client-iotanalytics/pagination/Interfaces.ts b/clients/client-iotanalytics/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotanalytics/pagination/Interfaces.ts rename to clients/client-iotanalytics/src/pagination/Interfaces.ts diff --git a/clients/client-iotanalytics/pagination/ListChannelsPaginator.ts b/clients/client-iotanalytics/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-iotanalytics/pagination/ListChannelsPaginator.ts rename to clients/client-iotanalytics/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-iotanalytics/pagination/ListDatasetContentsPaginator.ts b/clients/client-iotanalytics/src/pagination/ListDatasetContentsPaginator.ts similarity index 100% rename from clients/client-iotanalytics/pagination/ListDatasetContentsPaginator.ts rename to clients/client-iotanalytics/src/pagination/ListDatasetContentsPaginator.ts diff --git a/clients/client-iotanalytics/pagination/ListDatasetsPaginator.ts b/clients/client-iotanalytics/src/pagination/ListDatasetsPaginator.ts similarity index 100% rename from clients/client-iotanalytics/pagination/ListDatasetsPaginator.ts rename to clients/client-iotanalytics/src/pagination/ListDatasetsPaginator.ts diff --git a/clients/client-iotanalytics/pagination/ListDatastoresPaginator.ts b/clients/client-iotanalytics/src/pagination/ListDatastoresPaginator.ts similarity index 100% rename from clients/client-iotanalytics/pagination/ListDatastoresPaginator.ts rename to clients/client-iotanalytics/src/pagination/ListDatastoresPaginator.ts diff --git a/clients/client-iotanalytics/pagination/ListPipelinesPaginator.ts b/clients/client-iotanalytics/src/pagination/ListPipelinesPaginator.ts similarity index 100% rename from clients/client-iotanalytics/pagination/ListPipelinesPaginator.ts rename to clients/client-iotanalytics/src/pagination/ListPipelinesPaginator.ts diff --git a/clients/client-iotanalytics/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iotanalytics/protocols/Aws_restJson1.ts rename to clients/client-iotanalytics/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iotanalytics/src/runtimeConfig.browser.ts b/clients/client-iotanalytics/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a753f4e9df54 --- /dev/null +++ b/clients/client-iotanalytics/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTAnalyticsClientConfig } from "./IoTAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotanalytics/runtimeConfig.native.ts b/clients/client-iotanalytics/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotanalytics/runtimeConfig.native.ts rename to clients/client-iotanalytics/src/runtimeConfig.native.ts diff --git a/clients/client-iotanalytics/runtimeConfig.shared.ts b/clients/client-iotanalytics/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotanalytics/runtimeConfig.shared.ts rename to clients/client-iotanalytics/src/runtimeConfig.shared.ts diff --git a/clients/client-iotanalytics/src/runtimeConfig.ts b/clients/client-iotanalytics/src/runtimeConfig.ts new file mode 100644 index 000000000000..fae9d5e61638 --- /dev/null +++ b/clients/client-iotanalytics/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTAnalyticsClientConfig } from "./IoTAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotanalytics/tsconfig.es.json b/clients/client-iotanalytics/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotanalytics/tsconfig.es.json +++ b/clients/client-iotanalytics/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotanalytics/tsconfig.json b/clients/client-iotanalytics/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotanalytics/tsconfig.json +++ b/clients/client-iotanalytics/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotanalytics/tsconfig.types.json b/clients/client-iotanalytics/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotanalytics/tsconfig.types.json +++ b/clients/client-iotanalytics/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotdeviceadvisor/.gitignore b/clients/client-iotdeviceadvisor/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-iotdeviceadvisor/.gitignore +++ b/clients/client-iotdeviceadvisor/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotdeviceadvisor/package.json b/clients/client-iotdeviceadvisor/package.json index fc434041fb67..d09e2b177198 100644 --- a/clients/client-iotdeviceadvisor/package.json +++ b/clients/client-iotdeviceadvisor/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotdeviceadvisor", "repository": { "type": "git", diff --git a/clients/client-iotdeviceadvisor/runtimeConfig.browser.ts b/clients/client-iotdeviceadvisor/runtimeConfig.browser.ts deleted file mode 100644 index 3312679b95f7..000000000000 --- a/clients/client-iotdeviceadvisor/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IotDeviceAdvisorClientConfig } from "./IotDeviceAdvisorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotdeviceadvisor/runtimeConfig.ts b/clients/client-iotdeviceadvisor/runtimeConfig.ts deleted file mode 100644 index d6e4bc1a11d0..000000000000 --- a/clients/client-iotdeviceadvisor/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IotDeviceAdvisorClientConfig } from "./IotDeviceAdvisorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotdeviceadvisor/IotDeviceAdvisor.ts b/clients/client-iotdeviceadvisor/src/IotDeviceAdvisor.ts similarity index 100% rename from clients/client-iotdeviceadvisor/IotDeviceAdvisor.ts rename to clients/client-iotdeviceadvisor/src/IotDeviceAdvisor.ts diff --git a/clients/client-iotdeviceadvisor/IotDeviceAdvisorClient.ts b/clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts similarity index 100% rename from clients/client-iotdeviceadvisor/IotDeviceAdvisorClient.ts rename to clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts diff --git a/clients/client-iotdeviceadvisor/commands/CreateSuiteDefinitionCommand.ts b/clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/CreateSuiteDefinitionCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/CreateSuiteDefinitionCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/DeleteSuiteDefinitionCommand.ts b/clients/client-iotdeviceadvisor/src/commands/DeleteSuiteDefinitionCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/DeleteSuiteDefinitionCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/DeleteSuiteDefinitionCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/GetSuiteDefinitionCommand.ts b/clients/client-iotdeviceadvisor/src/commands/GetSuiteDefinitionCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/GetSuiteDefinitionCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/GetSuiteDefinitionCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/GetSuiteRunCommand.ts b/clients/client-iotdeviceadvisor/src/commands/GetSuiteRunCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/GetSuiteRunCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/GetSuiteRunCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/GetSuiteRunReportCommand.ts b/clients/client-iotdeviceadvisor/src/commands/GetSuiteRunReportCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/GetSuiteRunReportCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/GetSuiteRunReportCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/ListSuiteDefinitionsCommand.ts b/clients/client-iotdeviceadvisor/src/commands/ListSuiteDefinitionsCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/ListSuiteDefinitionsCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/ListSuiteDefinitionsCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/ListSuiteRunsCommand.ts b/clients/client-iotdeviceadvisor/src/commands/ListSuiteRunsCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/ListSuiteRunsCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/ListSuiteRunsCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/ListTagsForResourceCommand.ts b/clients/client-iotdeviceadvisor/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/ListTagsForResourceCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/StartSuiteRunCommand.ts b/clients/client-iotdeviceadvisor/src/commands/StartSuiteRunCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/StartSuiteRunCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/StartSuiteRunCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/StopSuiteRunCommand.ts b/clients/client-iotdeviceadvisor/src/commands/StopSuiteRunCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/StopSuiteRunCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/StopSuiteRunCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/TagResourceCommand.ts b/clients/client-iotdeviceadvisor/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/TagResourceCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/UntagResourceCommand.ts b/clients/client-iotdeviceadvisor/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/UntagResourceCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotdeviceadvisor/commands/UpdateSuiteDefinitionCommand.ts b/clients/client-iotdeviceadvisor/src/commands/UpdateSuiteDefinitionCommand.ts similarity index 100% rename from clients/client-iotdeviceadvisor/commands/UpdateSuiteDefinitionCommand.ts rename to clients/client-iotdeviceadvisor/src/commands/UpdateSuiteDefinitionCommand.ts diff --git a/clients/client-iotdeviceadvisor/endpoints.ts b/clients/client-iotdeviceadvisor/src/endpoints.ts similarity index 100% rename from clients/client-iotdeviceadvisor/endpoints.ts rename to clients/client-iotdeviceadvisor/src/endpoints.ts diff --git a/clients/client-iotdeviceadvisor/index.ts b/clients/client-iotdeviceadvisor/src/index.ts similarity index 100% rename from clients/client-iotdeviceadvisor/index.ts rename to clients/client-iotdeviceadvisor/src/index.ts diff --git a/clients/client-iotdeviceadvisor/models/index.ts b/clients/client-iotdeviceadvisor/src/models/index.ts similarity index 100% rename from clients/client-iotdeviceadvisor/models/index.ts rename to clients/client-iotdeviceadvisor/src/models/index.ts diff --git a/clients/client-iotdeviceadvisor/models/models_0.ts b/clients/client-iotdeviceadvisor/src/models/models_0.ts similarity index 100% rename from clients/client-iotdeviceadvisor/models/models_0.ts rename to clients/client-iotdeviceadvisor/src/models/models_0.ts diff --git a/clients/client-iotdeviceadvisor/pagination/Interfaces.ts b/clients/client-iotdeviceadvisor/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotdeviceadvisor/pagination/Interfaces.ts rename to clients/client-iotdeviceadvisor/src/pagination/Interfaces.ts diff --git a/clients/client-iotdeviceadvisor/pagination/ListSuiteDefinitionsPaginator.ts b/clients/client-iotdeviceadvisor/src/pagination/ListSuiteDefinitionsPaginator.ts similarity index 100% rename from clients/client-iotdeviceadvisor/pagination/ListSuiteDefinitionsPaginator.ts rename to clients/client-iotdeviceadvisor/src/pagination/ListSuiteDefinitionsPaginator.ts diff --git a/clients/client-iotdeviceadvisor/pagination/ListSuiteRunsPaginator.ts b/clients/client-iotdeviceadvisor/src/pagination/ListSuiteRunsPaginator.ts similarity index 100% rename from clients/client-iotdeviceadvisor/pagination/ListSuiteRunsPaginator.ts rename to clients/client-iotdeviceadvisor/src/pagination/ListSuiteRunsPaginator.ts diff --git a/clients/client-iotdeviceadvisor/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iotdeviceadvisor/protocols/Aws_restJson1.ts rename to clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iotdeviceadvisor/src/runtimeConfig.browser.ts b/clients/client-iotdeviceadvisor/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fd279842612b --- /dev/null +++ b/clients/client-iotdeviceadvisor/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IotDeviceAdvisorClientConfig } from "./IotDeviceAdvisorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotdeviceadvisor/runtimeConfig.native.ts b/clients/client-iotdeviceadvisor/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotdeviceadvisor/runtimeConfig.native.ts rename to clients/client-iotdeviceadvisor/src/runtimeConfig.native.ts diff --git a/clients/client-iotdeviceadvisor/runtimeConfig.shared.ts b/clients/client-iotdeviceadvisor/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotdeviceadvisor/runtimeConfig.shared.ts rename to clients/client-iotdeviceadvisor/src/runtimeConfig.shared.ts diff --git a/clients/client-iotdeviceadvisor/src/runtimeConfig.ts b/clients/client-iotdeviceadvisor/src/runtimeConfig.ts new file mode 100644 index 000000000000..740446f529c4 --- /dev/null +++ b/clients/client-iotdeviceadvisor/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IotDeviceAdvisorClientConfig } from "./IotDeviceAdvisorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotdeviceadvisor/tsconfig.es.json b/clients/client-iotdeviceadvisor/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotdeviceadvisor/tsconfig.es.json +++ b/clients/client-iotdeviceadvisor/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotdeviceadvisor/tsconfig.json b/clients/client-iotdeviceadvisor/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotdeviceadvisor/tsconfig.json +++ b/clients/client-iotdeviceadvisor/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotdeviceadvisor/tsconfig.types.json b/clients/client-iotdeviceadvisor/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotdeviceadvisor/tsconfig.types.json +++ b/clients/client-iotdeviceadvisor/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotfleethub/.gitignore b/clients/client-iotfleethub/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-iotfleethub/.gitignore +++ b/clients/client-iotfleethub/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotfleethub/package.json b/clients/client-iotfleethub/package.json index 89de1176dd9e..a113f195ee15 100644 --- a/clients/client-iotfleethub/package.json +++ b/clients/client-iotfleethub/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotfleethub", "repository": { "type": "git", diff --git a/clients/client-iotfleethub/runtimeConfig.browser.ts b/clients/client-iotfleethub/runtimeConfig.browser.ts deleted file mode 100644 index dfcb3bdec8dc..000000000000 --- a/clients/client-iotfleethub/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTFleetHubClientConfig } from "./IoTFleetHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotfleethub/runtimeConfig.ts b/clients/client-iotfleethub/runtimeConfig.ts deleted file mode 100644 index a3d7d58f1746..000000000000 --- a/clients/client-iotfleethub/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTFleetHubClientConfig } from "./IoTFleetHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotfleethub/IoTFleetHub.ts b/clients/client-iotfleethub/src/IoTFleetHub.ts similarity index 100% rename from clients/client-iotfleethub/IoTFleetHub.ts rename to clients/client-iotfleethub/src/IoTFleetHub.ts diff --git a/clients/client-iotfleethub/IoTFleetHubClient.ts b/clients/client-iotfleethub/src/IoTFleetHubClient.ts similarity index 100% rename from clients/client-iotfleethub/IoTFleetHubClient.ts rename to clients/client-iotfleethub/src/IoTFleetHubClient.ts diff --git a/clients/client-iotfleethub/commands/CreateApplicationCommand.ts b/clients/client-iotfleethub/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/CreateApplicationCommand.ts rename to clients/client-iotfleethub/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-iotfleethub/commands/DeleteApplicationCommand.ts b/clients/client-iotfleethub/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/DeleteApplicationCommand.ts rename to clients/client-iotfleethub/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-iotfleethub/commands/DescribeApplicationCommand.ts b/clients/client-iotfleethub/src/commands/DescribeApplicationCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/DescribeApplicationCommand.ts rename to clients/client-iotfleethub/src/commands/DescribeApplicationCommand.ts diff --git a/clients/client-iotfleethub/commands/ListApplicationsCommand.ts b/clients/client-iotfleethub/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/ListApplicationsCommand.ts rename to clients/client-iotfleethub/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-iotfleethub/commands/ListTagsForResourceCommand.ts b/clients/client-iotfleethub/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/ListTagsForResourceCommand.ts rename to clients/client-iotfleethub/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotfleethub/commands/TagResourceCommand.ts b/clients/client-iotfleethub/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/TagResourceCommand.ts rename to clients/client-iotfleethub/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotfleethub/commands/UntagResourceCommand.ts b/clients/client-iotfleethub/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/UntagResourceCommand.ts rename to clients/client-iotfleethub/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotfleethub/commands/UpdateApplicationCommand.ts b/clients/client-iotfleethub/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-iotfleethub/commands/UpdateApplicationCommand.ts rename to clients/client-iotfleethub/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-iotfleethub/endpoints.ts b/clients/client-iotfleethub/src/endpoints.ts similarity index 100% rename from clients/client-iotfleethub/endpoints.ts rename to clients/client-iotfleethub/src/endpoints.ts diff --git a/clients/client-iotfleethub/index.ts b/clients/client-iotfleethub/src/index.ts similarity index 100% rename from clients/client-iotfleethub/index.ts rename to clients/client-iotfleethub/src/index.ts diff --git a/clients/client-iotfleethub/models/index.ts b/clients/client-iotfleethub/src/models/index.ts similarity index 100% rename from clients/client-iotfleethub/models/index.ts rename to clients/client-iotfleethub/src/models/index.ts diff --git a/clients/client-iotfleethub/models/models_0.ts b/clients/client-iotfleethub/src/models/models_0.ts similarity index 100% rename from clients/client-iotfleethub/models/models_0.ts rename to clients/client-iotfleethub/src/models/models_0.ts diff --git a/clients/client-iotfleethub/pagination/Interfaces.ts b/clients/client-iotfleethub/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotfleethub/pagination/Interfaces.ts rename to clients/client-iotfleethub/src/pagination/Interfaces.ts diff --git a/clients/client-iotfleethub/pagination/ListApplicationsPaginator.ts b/clients/client-iotfleethub/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-iotfleethub/pagination/ListApplicationsPaginator.ts rename to clients/client-iotfleethub/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-iotfleethub/protocols/Aws_restJson1.ts b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iotfleethub/protocols/Aws_restJson1.ts rename to clients/client-iotfleethub/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iotfleethub/src/runtimeConfig.browser.ts b/clients/client-iotfleethub/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1a179b8a1d09 --- /dev/null +++ b/clients/client-iotfleethub/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTFleetHubClientConfig } from "./IoTFleetHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotfleethub/runtimeConfig.native.ts b/clients/client-iotfleethub/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotfleethub/runtimeConfig.native.ts rename to clients/client-iotfleethub/src/runtimeConfig.native.ts diff --git a/clients/client-iotfleethub/runtimeConfig.shared.ts b/clients/client-iotfleethub/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotfleethub/runtimeConfig.shared.ts rename to clients/client-iotfleethub/src/runtimeConfig.shared.ts diff --git a/clients/client-iotfleethub/src/runtimeConfig.ts b/clients/client-iotfleethub/src/runtimeConfig.ts new file mode 100644 index 000000000000..e1da324b1e1b --- /dev/null +++ b/clients/client-iotfleethub/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTFleetHubClientConfig } from "./IoTFleetHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotfleethub/tsconfig.es.json b/clients/client-iotfleethub/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotfleethub/tsconfig.es.json +++ b/clients/client-iotfleethub/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotfleethub/tsconfig.json b/clients/client-iotfleethub/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotfleethub/tsconfig.json +++ b/clients/client-iotfleethub/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotfleethub/tsconfig.types.json b/clients/client-iotfleethub/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotfleethub/tsconfig.types.json +++ b/clients/client-iotfleethub/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotsecuretunneling/.gitignore b/clients/client-iotsecuretunneling/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iotsecuretunneling/.gitignore +++ b/clients/client-iotsecuretunneling/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotsecuretunneling/package.json b/clients/client-iotsecuretunneling/package.json index f8bcf39c63db..459ea9ca2d86 100644 --- a/clients/client-iotsecuretunneling/package.json +++ b/clients/client-iotsecuretunneling/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotsecuretunneling", "repository": { "type": "git", diff --git a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts b/clients/client-iotsecuretunneling/runtimeConfig.browser.ts deleted file mode 100644 index 11172ef050a0..000000000000 --- a/clients/client-iotsecuretunneling/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTSecureTunnelingClientConfig } from "./IoTSecureTunnelingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotsecuretunneling/runtimeConfig.ts b/clients/client-iotsecuretunneling/runtimeConfig.ts deleted file mode 100644 index 2bacf90dbe27..000000000000 --- a/clients/client-iotsecuretunneling/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTSecureTunnelingClientConfig } from "./IoTSecureTunnelingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotsecuretunneling/IoTSecureTunneling.ts b/clients/client-iotsecuretunneling/src/IoTSecureTunneling.ts similarity index 100% rename from clients/client-iotsecuretunneling/IoTSecureTunneling.ts rename to clients/client-iotsecuretunneling/src/IoTSecureTunneling.ts diff --git a/clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts b/clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts similarity index 100% rename from clients/client-iotsecuretunneling/IoTSecureTunnelingClient.ts rename to clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts diff --git a/clients/client-iotsecuretunneling/commands/CloseTunnelCommand.ts b/clients/client-iotsecuretunneling/src/commands/CloseTunnelCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/CloseTunnelCommand.ts rename to clients/client-iotsecuretunneling/src/commands/CloseTunnelCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/DescribeTunnelCommand.ts b/clients/client-iotsecuretunneling/src/commands/DescribeTunnelCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/DescribeTunnelCommand.ts rename to clients/client-iotsecuretunneling/src/commands/DescribeTunnelCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/ListTagsForResourceCommand.ts b/clients/client-iotsecuretunneling/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/ListTagsForResourceCommand.ts rename to clients/client-iotsecuretunneling/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/ListTunnelsCommand.ts b/clients/client-iotsecuretunneling/src/commands/ListTunnelsCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/ListTunnelsCommand.ts rename to clients/client-iotsecuretunneling/src/commands/ListTunnelsCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/OpenTunnelCommand.ts b/clients/client-iotsecuretunneling/src/commands/OpenTunnelCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/OpenTunnelCommand.ts rename to clients/client-iotsecuretunneling/src/commands/OpenTunnelCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/TagResourceCommand.ts b/clients/client-iotsecuretunneling/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/TagResourceCommand.ts rename to clients/client-iotsecuretunneling/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotsecuretunneling/commands/UntagResourceCommand.ts b/clients/client-iotsecuretunneling/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotsecuretunneling/commands/UntagResourceCommand.ts rename to clients/client-iotsecuretunneling/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotsecuretunneling/endpoints.ts b/clients/client-iotsecuretunneling/src/endpoints.ts similarity index 100% rename from clients/client-iotsecuretunneling/endpoints.ts rename to clients/client-iotsecuretunneling/src/endpoints.ts diff --git a/clients/client-iotsecuretunneling/index.ts b/clients/client-iotsecuretunneling/src/index.ts similarity index 100% rename from clients/client-iotsecuretunneling/index.ts rename to clients/client-iotsecuretunneling/src/index.ts diff --git a/clients/client-iotsecuretunneling/models/index.ts b/clients/client-iotsecuretunneling/src/models/index.ts similarity index 100% rename from clients/client-iotsecuretunneling/models/index.ts rename to clients/client-iotsecuretunneling/src/models/index.ts diff --git a/clients/client-iotsecuretunneling/models/models_0.ts b/clients/client-iotsecuretunneling/src/models/models_0.ts similarity index 100% rename from clients/client-iotsecuretunneling/models/models_0.ts rename to clients/client-iotsecuretunneling/src/models/models_0.ts diff --git a/clients/client-iotsecuretunneling/pagination/Interfaces.ts b/clients/client-iotsecuretunneling/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotsecuretunneling/pagination/Interfaces.ts rename to clients/client-iotsecuretunneling/src/pagination/Interfaces.ts diff --git a/clients/client-iotsecuretunneling/pagination/ListTunnelsPaginator.ts b/clients/client-iotsecuretunneling/src/pagination/ListTunnelsPaginator.ts similarity index 100% rename from clients/client-iotsecuretunneling/pagination/ListTunnelsPaginator.ts rename to clients/client-iotsecuretunneling/src/pagination/ListTunnelsPaginator.ts diff --git a/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts rename to clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts diff --git a/clients/client-iotsecuretunneling/src/runtimeConfig.browser.ts b/clients/client-iotsecuretunneling/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9be1b59c8bc8 --- /dev/null +++ b/clients/client-iotsecuretunneling/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTSecureTunnelingClientConfig } from "./IoTSecureTunnelingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotsecuretunneling/runtimeConfig.native.ts b/clients/client-iotsecuretunneling/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotsecuretunneling/runtimeConfig.native.ts rename to clients/client-iotsecuretunneling/src/runtimeConfig.native.ts diff --git a/clients/client-iotsecuretunneling/runtimeConfig.shared.ts b/clients/client-iotsecuretunneling/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotsecuretunneling/runtimeConfig.shared.ts rename to clients/client-iotsecuretunneling/src/runtimeConfig.shared.ts diff --git a/clients/client-iotsecuretunneling/src/runtimeConfig.ts b/clients/client-iotsecuretunneling/src/runtimeConfig.ts new file mode 100644 index 000000000000..964e284cf892 --- /dev/null +++ b/clients/client-iotsecuretunneling/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTSecureTunnelingClientConfig } from "./IoTSecureTunnelingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotsecuretunneling/tsconfig.es.json b/clients/client-iotsecuretunneling/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotsecuretunneling/tsconfig.es.json +++ b/clients/client-iotsecuretunneling/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotsecuretunneling/tsconfig.json b/clients/client-iotsecuretunneling/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotsecuretunneling/tsconfig.json +++ b/clients/client-iotsecuretunneling/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotsecuretunneling/tsconfig.types.json b/clients/client-iotsecuretunneling/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotsecuretunneling/tsconfig.types.json +++ b/clients/client-iotsecuretunneling/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotsitewise/.gitignore b/clients/client-iotsitewise/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iotsitewise/.gitignore +++ b/clients/client-iotsitewise/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotsitewise/package.json b/clients/client-iotsitewise/package.json index cf07d064a0cd..8b2d1a8942de 100644 --- a/clients/client-iotsitewise/package.json +++ b/clients/client-iotsitewise/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotsitewise", "repository": { "type": "git", diff --git a/clients/client-iotsitewise/runtimeConfig.browser.ts b/clients/client-iotsitewise/runtimeConfig.browser.ts deleted file mode 100644 index 32c075087b89..000000000000 --- a/clients/client-iotsitewise/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTSiteWiseClientConfig } from "./IoTSiteWiseClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotsitewise/runtimeConfig.ts b/clients/client-iotsitewise/runtimeConfig.ts deleted file mode 100644 index 80a754bc156f..000000000000 --- a/clients/client-iotsitewise/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTSiteWiseClientConfig } from "./IoTSiteWiseClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotsitewise/IoTSiteWise.ts b/clients/client-iotsitewise/src/IoTSiteWise.ts similarity index 100% rename from clients/client-iotsitewise/IoTSiteWise.ts rename to clients/client-iotsitewise/src/IoTSiteWise.ts diff --git a/clients/client-iotsitewise/IoTSiteWiseClient.ts b/clients/client-iotsitewise/src/IoTSiteWiseClient.ts similarity index 100% rename from clients/client-iotsitewise/IoTSiteWiseClient.ts rename to clients/client-iotsitewise/src/IoTSiteWiseClient.ts diff --git a/clients/client-iotsitewise/commands/AssociateAssetsCommand.ts b/clients/client-iotsitewise/src/commands/AssociateAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/AssociateAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/AssociateAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/BatchAssociateProjectAssetsCommand.ts b/clients/client-iotsitewise/src/commands/BatchAssociateProjectAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/BatchAssociateProjectAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/BatchAssociateProjectAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/BatchDisassociateProjectAssetsCommand.ts b/clients/client-iotsitewise/src/commands/BatchDisassociateProjectAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/BatchDisassociateProjectAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/BatchDisassociateProjectAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/BatchPutAssetPropertyValueCommand.ts b/clients/client-iotsitewise/src/commands/BatchPutAssetPropertyValueCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/BatchPutAssetPropertyValueCommand.ts rename to clients/client-iotsitewise/src/commands/BatchPutAssetPropertyValueCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateAccessPolicyCommand.ts b/clients/client-iotsitewise/src/commands/CreateAccessPolicyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateAccessPolicyCommand.ts rename to clients/client-iotsitewise/src/commands/CreateAccessPolicyCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateAssetCommand.ts b/clients/client-iotsitewise/src/commands/CreateAssetCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateAssetCommand.ts rename to clients/client-iotsitewise/src/commands/CreateAssetCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateAssetModelCommand.ts b/clients/client-iotsitewise/src/commands/CreateAssetModelCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateAssetModelCommand.ts rename to clients/client-iotsitewise/src/commands/CreateAssetModelCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateDashboardCommand.ts b/clients/client-iotsitewise/src/commands/CreateDashboardCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateDashboardCommand.ts rename to clients/client-iotsitewise/src/commands/CreateDashboardCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateGatewayCommand.ts b/clients/client-iotsitewise/src/commands/CreateGatewayCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateGatewayCommand.ts rename to clients/client-iotsitewise/src/commands/CreateGatewayCommand.ts diff --git a/clients/client-iotsitewise/commands/CreatePortalCommand.ts b/clients/client-iotsitewise/src/commands/CreatePortalCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreatePortalCommand.ts rename to clients/client-iotsitewise/src/commands/CreatePortalCommand.ts diff --git a/clients/client-iotsitewise/commands/CreateProjectCommand.ts b/clients/client-iotsitewise/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/CreateProjectCommand.ts rename to clients/client-iotsitewise/src/commands/CreateProjectCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteAccessPolicyCommand.ts b/clients/client-iotsitewise/src/commands/DeleteAccessPolicyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteAccessPolicyCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteAccessPolicyCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteAssetCommand.ts b/clients/client-iotsitewise/src/commands/DeleteAssetCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteAssetCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteAssetCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteAssetModelCommand.ts b/clients/client-iotsitewise/src/commands/DeleteAssetModelCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteAssetModelCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteAssetModelCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteDashboardCommand.ts b/clients/client-iotsitewise/src/commands/DeleteDashboardCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteDashboardCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteDashboardCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteGatewayCommand.ts b/clients/client-iotsitewise/src/commands/DeleteGatewayCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteGatewayCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteGatewayCommand.ts diff --git a/clients/client-iotsitewise/commands/DeletePortalCommand.ts b/clients/client-iotsitewise/src/commands/DeletePortalCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeletePortalCommand.ts rename to clients/client-iotsitewise/src/commands/DeletePortalCommand.ts diff --git a/clients/client-iotsitewise/commands/DeleteProjectCommand.ts b/clients/client-iotsitewise/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DeleteProjectCommand.ts rename to clients/client-iotsitewise/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeAccessPolicyCommand.ts b/clients/client-iotsitewise/src/commands/DescribeAccessPolicyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeAccessPolicyCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeAccessPolicyCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeAssetCommand.ts b/clients/client-iotsitewise/src/commands/DescribeAssetCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeAssetCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeAssetCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeAssetModelCommand.ts b/clients/client-iotsitewise/src/commands/DescribeAssetModelCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeAssetModelCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeAssetModelCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeAssetPropertyCommand.ts b/clients/client-iotsitewise/src/commands/DescribeAssetPropertyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeAssetPropertyCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeAssetPropertyCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeDashboardCommand.ts b/clients/client-iotsitewise/src/commands/DescribeDashboardCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeDashboardCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeDashboardCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeDefaultEncryptionConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/DescribeDefaultEncryptionConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeDefaultEncryptionConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeDefaultEncryptionConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeGatewayCapabilityConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/DescribeGatewayCapabilityConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeGatewayCapabilityConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeGatewayCapabilityConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeGatewayCommand.ts b/clients/client-iotsitewise/src/commands/DescribeGatewayCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeGatewayCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeGatewayCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeLoggingOptionsCommand.ts b/clients/client-iotsitewise/src/commands/DescribeLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeLoggingOptionsCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeLoggingOptionsCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribePortalCommand.ts b/clients/client-iotsitewise/src/commands/DescribePortalCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribePortalCommand.ts rename to clients/client-iotsitewise/src/commands/DescribePortalCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeProjectCommand.ts b/clients/client-iotsitewise/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeProjectCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-iotsitewise/commands/DescribeStorageConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/DescribeStorageConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DescribeStorageConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/DescribeStorageConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/DisassociateAssetsCommand.ts b/clients/client-iotsitewise/src/commands/DisassociateAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/DisassociateAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/DisassociateAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/GetAssetPropertyAggregatesCommand.ts b/clients/client-iotsitewise/src/commands/GetAssetPropertyAggregatesCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/GetAssetPropertyAggregatesCommand.ts rename to clients/client-iotsitewise/src/commands/GetAssetPropertyAggregatesCommand.ts diff --git a/clients/client-iotsitewise/commands/GetAssetPropertyValueCommand.ts b/clients/client-iotsitewise/src/commands/GetAssetPropertyValueCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/GetAssetPropertyValueCommand.ts rename to clients/client-iotsitewise/src/commands/GetAssetPropertyValueCommand.ts diff --git a/clients/client-iotsitewise/commands/GetAssetPropertyValueHistoryCommand.ts b/clients/client-iotsitewise/src/commands/GetAssetPropertyValueHistoryCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/GetAssetPropertyValueHistoryCommand.ts rename to clients/client-iotsitewise/src/commands/GetAssetPropertyValueHistoryCommand.ts diff --git a/clients/client-iotsitewise/commands/GetInterpolatedAssetPropertyValuesCommand.ts b/clients/client-iotsitewise/src/commands/GetInterpolatedAssetPropertyValuesCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/GetInterpolatedAssetPropertyValuesCommand.ts rename to clients/client-iotsitewise/src/commands/GetInterpolatedAssetPropertyValuesCommand.ts diff --git a/clients/client-iotsitewise/commands/ListAccessPoliciesCommand.ts b/clients/client-iotsitewise/src/commands/ListAccessPoliciesCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListAccessPoliciesCommand.ts rename to clients/client-iotsitewise/src/commands/ListAccessPoliciesCommand.ts diff --git a/clients/client-iotsitewise/commands/ListAssetModelsCommand.ts b/clients/client-iotsitewise/src/commands/ListAssetModelsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListAssetModelsCommand.ts rename to clients/client-iotsitewise/src/commands/ListAssetModelsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListAssetRelationshipsCommand.ts b/clients/client-iotsitewise/src/commands/ListAssetRelationshipsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListAssetRelationshipsCommand.ts rename to clients/client-iotsitewise/src/commands/ListAssetRelationshipsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListAssetsCommand.ts b/clients/client-iotsitewise/src/commands/ListAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/ListAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListAssociatedAssetsCommand.ts b/clients/client-iotsitewise/src/commands/ListAssociatedAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListAssociatedAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/ListAssociatedAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListDashboardsCommand.ts b/clients/client-iotsitewise/src/commands/ListDashboardsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListDashboardsCommand.ts rename to clients/client-iotsitewise/src/commands/ListDashboardsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListGatewaysCommand.ts b/clients/client-iotsitewise/src/commands/ListGatewaysCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListGatewaysCommand.ts rename to clients/client-iotsitewise/src/commands/ListGatewaysCommand.ts diff --git a/clients/client-iotsitewise/commands/ListPortalsCommand.ts b/clients/client-iotsitewise/src/commands/ListPortalsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListPortalsCommand.ts rename to clients/client-iotsitewise/src/commands/ListPortalsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListProjectAssetsCommand.ts b/clients/client-iotsitewise/src/commands/ListProjectAssetsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListProjectAssetsCommand.ts rename to clients/client-iotsitewise/src/commands/ListProjectAssetsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListProjectsCommand.ts b/clients/client-iotsitewise/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListProjectsCommand.ts rename to clients/client-iotsitewise/src/commands/ListProjectsCommand.ts diff --git a/clients/client-iotsitewise/commands/ListTagsForResourceCommand.ts b/clients/client-iotsitewise/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/ListTagsForResourceCommand.ts rename to clients/client-iotsitewise/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotsitewise/commands/PutDefaultEncryptionConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/PutDefaultEncryptionConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/PutDefaultEncryptionConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/PutDefaultEncryptionConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/PutLoggingOptionsCommand.ts b/clients/client-iotsitewise/src/commands/PutLoggingOptionsCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/PutLoggingOptionsCommand.ts rename to clients/client-iotsitewise/src/commands/PutLoggingOptionsCommand.ts diff --git a/clients/client-iotsitewise/commands/PutStorageConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/PutStorageConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/PutStorageConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/PutStorageConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/TagResourceCommand.ts b/clients/client-iotsitewise/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/TagResourceCommand.ts rename to clients/client-iotsitewise/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotsitewise/commands/UntagResourceCommand.ts b/clients/client-iotsitewise/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UntagResourceCommand.ts rename to clients/client-iotsitewise/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateAccessPolicyCommand.ts b/clients/client-iotsitewise/src/commands/UpdateAccessPolicyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateAccessPolicyCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateAccessPolicyCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateAssetCommand.ts b/clients/client-iotsitewise/src/commands/UpdateAssetCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateAssetCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateAssetCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateAssetModelCommand.ts b/clients/client-iotsitewise/src/commands/UpdateAssetModelCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateAssetModelCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateAssetModelCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateAssetPropertyCommand.ts b/clients/client-iotsitewise/src/commands/UpdateAssetPropertyCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateAssetPropertyCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateAssetPropertyCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateDashboardCommand.ts b/clients/client-iotsitewise/src/commands/UpdateDashboardCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateDashboardCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateDashboardCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateGatewayCapabilityConfigurationCommand.ts b/clients/client-iotsitewise/src/commands/UpdateGatewayCapabilityConfigurationCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateGatewayCapabilityConfigurationCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateGatewayCapabilityConfigurationCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateGatewayCommand.ts b/clients/client-iotsitewise/src/commands/UpdateGatewayCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateGatewayCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateGatewayCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdatePortalCommand.ts b/clients/client-iotsitewise/src/commands/UpdatePortalCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdatePortalCommand.ts rename to clients/client-iotsitewise/src/commands/UpdatePortalCommand.ts diff --git a/clients/client-iotsitewise/commands/UpdateProjectCommand.ts b/clients/client-iotsitewise/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-iotsitewise/commands/UpdateProjectCommand.ts rename to clients/client-iotsitewise/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-iotsitewise/endpoints.ts b/clients/client-iotsitewise/src/endpoints.ts similarity index 100% rename from clients/client-iotsitewise/endpoints.ts rename to clients/client-iotsitewise/src/endpoints.ts diff --git a/clients/client-iotsitewise/index.ts b/clients/client-iotsitewise/src/index.ts similarity index 100% rename from clients/client-iotsitewise/index.ts rename to clients/client-iotsitewise/src/index.ts diff --git a/clients/client-iotsitewise/models/index.ts b/clients/client-iotsitewise/src/models/index.ts similarity index 100% rename from clients/client-iotsitewise/models/index.ts rename to clients/client-iotsitewise/src/models/index.ts diff --git a/clients/client-iotsitewise/models/models_0.ts b/clients/client-iotsitewise/src/models/models_0.ts similarity index 100% rename from clients/client-iotsitewise/models/models_0.ts rename to clients/client-iotsitewise/src/models/models_0.ts diff --git a/clients/client-iotsitewise/pagination/GetAssetPropertyAggregatesPaginator.ts b/clients/client-iotsitewise/src/pagination/GetAssetPropertyAggregatesPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/GetAssetPropertyAggregatesPaginator.ts rename to clients/client-iotsitewise/src/pagination/GetAssetPropertyAggregatesPaginator.ts diff --git a/clients/client-iotsitewise/pagination/GetAssetPropertyValueHistoryPaginator.ts b/clients/client-iotsitewise/src/pagination/GetAssetPropertyValueHistoryPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/GetAssetPropertyValueHistoryPaginator.ts rename to clients/client-iotsitewise/src/pagination/GetAssetPropertyValueHistoryPaginator.ts diff --git a/clients/client-iotsitewise/pagination/GetInterpolatedAssetPropertyValuesPaginator.ts b/clients/client-iotsitewise/src/pagination/GetInterpolatedAssetPropertyValuesPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/GetInterpolatedAssetPropertyValuesPaginator.ts rename to clients/client-iotsitewise/src/pagination/GetInterpolatedAssetPropertyValuesPaginator.ts diff --git a/clients/client-iotsitewise/pagination/Interfaces.ts b/clients/client-iotsitewise/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotsitewise/pagination/Interfaces.ts rename to clients/client-iotsitewise/src/pagination/Interfaces.ts diff --git a/clients/client-iotsitewise/pagination/ListAccessPoliciesPaginator.ts b/clients/client-iotsitewise/src/pagination/ListAccessPoliciesPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListAccessPoliciesPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListAccessPoliciesPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListAssetModelsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListAssetModelsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListAssetModelsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListAssetModelsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListAssetRelationshipsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListAssetRelationshipsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListAssetRelationshipsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListAssetRelationshipsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListAssetsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListAssetsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListAssetsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListAssetsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListAssociatedAssetsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListAssociatedAssetsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListAssociatedAssetsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListAssociatedAssetsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListDashboardsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListDashboardsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListDashboardsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListDashboardsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListGatewaysPaginator.ts b/clients/client-iotsitewise/src/pagination/ListGatewaysPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListGatewaysPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListGatewaysPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListPortalsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListPortalsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListPortalsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListPortalsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListProjectAssetsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListProjectAssetsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListProjectAssetsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListProjectAssetsPaginator.ts diff --git a/clients/client-iotsitewise/pagination/ListProjectsPaginator.ts b/clients/client-iotsitewise/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-iotsitewise/pagination/ListProjectsPaginator.ts rename to clients/client-iotsitewise/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-iotsitewise/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-iotsitewise/protocols/Aws_restJson1.ts rename to clients/client-iotsitewise/src/protocols/Aws_restJson1.ts diff --git a/clients/client-iotsitewise/src/runtimeConfig.browser.ts b/clients/client-iotsitewise/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3464d99f5184 --- /dev/null +++ b/clients/client-iotsitewise/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTSiteWiseClientConfig } from "./IoTSiteWiseClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotsitewise/runtimeConfig.native.ts b/clients/client-iotsitewise/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotsitewise/runtimeConfig.native.ts rename to clients/client-iotsitewise/src/runtimeConfig.native.ts diff --git a/clients/client-iotsitewise/runtimeConfig.shared.ts b/clients/client-iotsitewise/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotsitewise/runtimeConfig.shared.ts rename to clients/client-iotsitewise/src/runtimeConfig.shared.ts diff --git a/clients/client-iotsitewise/src/runtimeConfig.ts b/clients/client-iotsitewise/src/runtimeConfig.ts new file mode 100644 index 000000000000..f70de4d9507f --- /dev/null +++ b/clients/client-iotsitewise/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTSiteWiseClientConfig } from "./IoTSiteWiseClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotsitewise/waiters/waitForAssetActive.ts b/clients/client-iotsitewise/src/waiters/waitForAssetActive.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForAssetActive.ts rename to clients/client-iotsitewise/src/waiters/waitForAssetActive.ts diff --git a/clients/client-iotsitewise/waiters/waitForAssetModelActive.ts b/clients/client-iotsitewise/src/waiters/waitForAssetModelActive.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForAssetModelActive.ts rename to clients/client-iotsitewise/src/waiters/waitForAssetModelActive.ts diff --git a/clients/client-iotsitewise/waiters/waitForAssetModelNotExists.ts b/clients/client-iotsitewise/src/waiters/waitForAssetModelNotExists.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForAssetModelNotExists.ts rename to clients/client-iotsitewise/src/waiters/waitForAssetModelNotExists.ts diff --git a/clients/client-iotsitewise/waiters/waitForAssetNotExists.ts b/clients/client-iotsitewise/src/waiters/waitForAssetNotExists.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForAssetNotExists.ts rename to clients/client-iotsitewise/src/waiters/waitForAssetNotExists.ts diff --git a/clients/client-iotsitewise/waiters/waitForPortalActive.ts b/clients/client-iotsitewise/src/waiters/waitForPortalActive.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForPortalActive.ts rename to clients/client-iotsitewise/src/waiters/waitForPortalActive.ts diff --git a/clients/client-iotsitewise/waiters/waitForPortalNotExists.ts b/clients/client-iotsitewise/src/waiters/waitForPortalNotExists.ts similarity index 100% rename from clients/client-iotsitewise/waiters/waitForPortalNotExists.ts rename to clients/client-iotsitewise/src/waiters/waitForPortalNotExists.ts diff --git a/clients/client-iotsitewise/tsconfig.es.json b/clients/client-iotsitewise/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotsitewise/tsconfig.es.json +++ b/clients/client-iotsitewise/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotsitewise/tsconfig.json b/clients/client-iotsitewise/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotsitewise/tsconfig.json +++ b/clients/client-iotsitewise/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotsitewise/tsconfig.types.json b/clients/client-iotsitewise/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotsitewise/tsconfig.types.json +++ b/clients/client-iotsitewise/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-iotthingsgraph/.gitignore b/clients/client-iotthingsgraph/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-iotthingsgraph/.gitignore +++ b/clients/client-iotthingsgraph/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-iotthingsgraph/package.json b/clients/client-iotthingsgraph/package.json index fad692486256..2d701ba8b9d7 100644 --- a/clients/client-iotthingsgraph/package.json +++ b/clients/client-iotthingsgraph/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-iotthingsgraph", "repository": { "type": "git", diff --git a/clients/client-iotthingsgraph/runtimeConfig.browser.ts b/clients/client-iotthingsgraph/runtimeConfig.browser.ts deleted file mode 100644 index e736c5ad9b89..000000000000 --- a/clients/client-iotthingsgraph/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IoTThingsGraphClientConfig } from "./IoTThingsGraphClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotthingsgraph/runtimeConfig.ts b/clients/client-iotthingsgraph/runtimeConfig.ts deleted file mode 100644 index c24ed826c406..000000000000 --- a/clients/client-iotthingsgraph/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IoTThingsGraphClientConfig } from "./IoTThingsGraphClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-iotthingsgraph/IoTThingsGraph.ts b/clients/client-iotthingsgraph/src/IoTThingsGraph.ts similarity index 100% rename from clients/client-iotthingsgraph/IoTThingsGraph.ts rename to clients/client-iotthingsgraph/src/IoTThingsGraph.ts diff --git a/clients/client-iotthingsgraph/IoTThingsGraphClient.ts b/clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts similarity index 100% rename from clients/client-iotthingsgraph/IoTThingsGraphClient.ts rename to clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts diff --git a/clients/client-iotthingsgraph/commands/AssociateEntityToThingCommand.ts b/clients/client-iotthingsgraph/src/commands/AssociateEntityToThingCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/AssociateEntityToThingCommand.ts rename to clients/client-iotthingsgraph/src/commands/AssociateEntityToThingCommand.ts diff --git a/clients/client-iotthingsgraph/commands/CreateFlowTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/CreateFlowTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/CreateFlowTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/CreateFlowTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/CreateSystemInstanceCommand.ts b/clients/client-iotthingsgraph/src/commands/CreateSystemInstanceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/CreateSystemInstanceCommand.ts rename to clients/client-iotthingsgraph/src/commands/CreateSystemInstanceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/CreateSystemTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/CreateSystemTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/CreateSystemTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/CreateSystemTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeleteFlowTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/DeleteFlowTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeleteFlowTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeleteFlowTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeleteNamespaceCommand.ts b/clients/client-iotthingsgraph/src/commands/DeleteNamespaceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeleteNamespaceCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeleteNamespaceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeleteSystemInstanceCommand.ts b/clients/client-iotthingsgraph/src/commands/DeleteSystemInstanceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeleteSystemInstanceCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeleteSystemInstanceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeleteSystemTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/DeleteSystemTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeleteSystemTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeleteSystemTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeploySystemInstanceCommand.ts b/clients/client-iotthingsgraph/src/commands/DeploySystemInstanceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeploySystemInstanceCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeploySystemInstanceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeprecateFlowTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/DeprecateFlowTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeprecateFlowTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeprecateFlowTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DeprecateSystemTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/DeprecateSystemTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DeprecateSystemTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/DeprecateSystemTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DescribeNamespaceCommand.ts b/clients/client-iotthingsgraph/src/commands/DescribeNamespaceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DescribeNamespaceCommand.ts rename to clients/client-iotthingsgraph/src/commands/DescribeNamespaceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/DissociateEntityFromThingCommand.ts b/clients/client-iotthingsgraph/src/commands/DissociateEntityFromThingCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/DissociateEntityFromThingCommand.ts rename to clients/client-iotthingsgraph/src/commands/DissociateEntityFromThingCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetEntitiesCommand.ts b/clients/client-iotthingsgraph/src/commands/GetEntitiesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetEntitiesCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetEntitiesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetFlowTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/GetFlowTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetFlowTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetFlowTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetFlowTemplateRevisionsCommand.ts b/clients/client-iotthingsgraph/src/commands/GetFlowTemplateRevisionsCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetFlowTemplateRevisionsCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetFlowTemplateRevisionsCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetNamespaceDeletionStatusCommand.ts b/clients/client-iotthingsgraph/src/commands/GetNamespaceDeletionStatusCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetNamespaceDeletionStatusCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetNamespaceDeletionStatusCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetSystemInstanceCommand.ts b/clients/client-iotthingsgraph/src/commands/GetSystemInstanceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetSystemInstanceCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetSystemInstanceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetSystemTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/GetSystemTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetSystemTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetSystemTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetSystemTemplateRevisionsCommand.ts b/clients/client-iotthingsgraph/src/commands/GetSystemTemplateRevisionsCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetSystemTemplateRevisionsCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetSystemTemplateRevisionsCommand.ts diff --git a/clients/client-iotthingsgraph/commands/GetUploadStatusCommand.ts b/clients/client-iotthingsgraph/src/commands/GetUploadStatusCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/GetUploadStatusCommand.ts rename to clients/client-iotthingsgraph/src/commands/GetUploadStatusCommand.ts diff --git a/clients/client-iotthingsgraph/commands/ListFlowExecutionMessagesCommand.ts b/clients/client-iotthingsgraph/src/commands/ListFlowExecutionMessagesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/ListFlowExecutionMessagesCommand.ts rename to clients/client-iotthingsgraph/src/commands/ListFlowExecutionMessagesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/ListTagsForResourceCommand.ts b/clients/client-iotthingsgraph/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/ListTagsForResourceCommand.ts rename to clients/client-iotthingsgraph/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchEntitiesCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchEntitiesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchEntitiesCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchEntitiesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchFlowExecutionsCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchFlowExecutionsCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchFlowExecutionsCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchFlowExecutionsCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchFlowTemplatesCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchFlowTemplatesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchFlowTemplatesCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchFlowTemplatesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchSystemInstancesCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchSystemInstancesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchSystemInstancesCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchSystemInstancesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchSystemTemplatesCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchSystemTemplatesCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchSystemTemplatesCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchSystemTemplatesCommand.ts diff --git a/clients/client-iotthingsgraph/commands/SearchThingsCommand.ts b/clients/client-iotthingsgraph/src/commands/SearchThingsCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/SearchThingsCommand.ts rename to clients/client-iotthingsgraph/src/commands/SearchThingsCommand.ts diff --git a/clients/client-iotthingsgraph/commands/TagResourceCommand.ts b/clients/client-iotthingsgraph/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/TagResourceCommand.ts rename to clients/client-iotthingsgraph/src/commands/TagResourceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/UndeploySystemInstanceCommand.ts b/clients/client-iotthingsgraph/src/commands/UndeploySystemInstanceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/UndeploySystemInstanceCommand.ts rename to clients/client-iotthingsgraph/src/commands/UndeploySystemInstanceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/UntagResourceCommand.ts b/clients/client-iotthingsgraph/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/UntagResourceCommand.ts rename to clients/client-iotthingsgraph/src/commands/UntagResourceCommand.ts diff --git a/clients/client-iotthingsgraph/commands/UpdateFlowTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/UpdateFlowTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/UpdateFlowTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/UpdateFlowTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/UpdateSystemTemplateCommand.ts b/clients/client-iotthingsgraph/src/commands/UpdateSystemTemplateCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/UpdateSystemTemplateCommand.ts rename to clients/client-iotthingsgraph/src/commands/UpdateSystemTemplateCommand.ts diff --git a/clients/client-iotthingsgraph/commands/UploadEntityDefinitionsCommand.ts b/clients/client-iotthingsgraph/src/commands/UploadEntityDefinitionsCommand.ts similarity index 100% rename from clients/client-iotthingsgraph/commands/UploadEntityDefinitionsCommand.ts rename to clients/client-iotthingsgraph/src/commands/UploadEntityDefinitionsCommand.ts diff --git a/clients/client-iotthingsgraph/endpoints.ts b/clients/client-iotthingsgraph/src/endpoints.ts similarity index 100% rename from clients/client-iotthingsgraph/endpoints.ts rename to clients/client-iotthingsgraph/src/endpoints.ts diff --git a/clients/client-iotthingsgraph/index.ts b/clients/client-iotthingsgraph/src/index.ts similarity index 100% rename from clients/client-iotthingsgraph/index.ts rename to clients/client-iotthingsgraph/src/index.ts diff --git a/clients/client-iotthingsgraph/models/index.ts b/clients/client-iotthingsgraph/src/models/index.ts similarity index 100% rename from clients/client-iotthingsgraph/models/index.ts rename to clients/client-iotthingsgraph/src/models/index.ts diff --git a/clients/client-iotthingsgraph/models/models_0.ts b/clients/client-iotthingsgraph/src/models/models_0.ts similarity index 100% rename from clients/client-iotthingsgraph/models/models_0.ts rename to clients/client-iotthingsgraph/src/models/models_0.ts diff --git a/clients/client-iotthingsgraph/pagination/GetFlowTemplateRevisionsPaginator.ts b/clients/client-iotthingsgraph/src/pagination/GetFlowTemplateRevisionsPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/GetFlowTemplateRevisionsPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/GetFlowTemplateRevisionsPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/GetSystemTemplateRevisionsPaginator.ts b/clients/client-iotthingsgraph/src/pagination/GetSystemTemplateRevisionsPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/GetSystemTemplateRevisionsPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/GetSystemTemplateRevisionsPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/Interfaces.ts b/clients/client-iotthingsgraph/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/Interfaces.ts rename to clients/client-iotthingsgraph/src/pagination/Interfaces.ts diff --git a/clients/client-iotthingsgraph/pagination/ListFlowExecutionMessagesPaginator.ts b/clients/client-iotthingsgraph/src/pagination/ListFlowExecutionMessagesPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/ListFlowExecutionMessagesPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/ListFlowExecutionMessagesPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/ListTagsForResourcePaginator.ts b/clients/client-iotthingsgraph/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/ListTagsForResourcePaginator.ts rename to clients/client-iotthingsgraph/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchEntitiesPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchEntitiesPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchEntitiesPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchEntitiesPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchFlowExecutionsPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchFlowExecutionsPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchFlowExecutionsPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchFlowExecutionsPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchFlowTemplatesPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchFlowTemplatesPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchFlowTemplatesPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchFlowTemplatesPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchSystemInstancesPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchSystemInstancesPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchSystemInstancesPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchSystemInstancesPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchSystemTemplatesPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchSystemTemplatesPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchSystemTemplatesPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchSystemTemplatesPaginator.ts diff --git a/clients/client-iotthingsgraph/pagination/SearchThingsPaginator.ts b/clients/client-iotthingsgraph/src/pagination/SearchThingsPaginator.ts similarity index 100% rename from clients/client-iotthingsgraph/pagination/SearchThingsPaginator.ts rename to clients/client-iotthingsgraph/src/pagination/SearchThingsPaginator.ts diff --git a/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-iotthingsgraph/protocols/Aws_json1_1.ts rename to clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts diff --git a/clients/client-iotthingsgraph/src/runtimeConfig.browser.ts b/clients/client-iotthingsgraph/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..68c8572905f7 --- /dev/null +++ b/clients/client-iotthingsgraph/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IoTThingsGraphClientConfig } from "./IoTThingsGraphClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotthingsgraph/runtimeConfig.native.ts b/clients/client-iotthingsgraph/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-iotthingsgraph/runtimeConfig.native.ts rename to clients/client-iotthingsgraph/src/runtimeConfig.native.ts diff --git a/clients/client-iotthingsgraph/runtimeConfig.shared.ts b/clients/client-iotthingsgraph/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-iotthingsgraph/runtimeConfig.shared.ts rename to clients/client-iotthingsgraph/src/runtimeConfig.shared.ts diff --git a/clients/client-iotthingsgraph/src/runtimeConfig.ts b/clients/client-iotthingsgraph/src/runtimeConfig.ts new file mode 100644 index 000000000000..f9230f543dd7 --- /dev/null +++ b/clients/client-iotthingsgraph/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IoTThingsGraphClientConfig } from "./IoTThingsGraphClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-iotthingsgraph/tsconfig.es.json b/clients/client-iotthingsgraph/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-iotthingsgraph/tsconfig.es.json +++ b/clients/client-iotthingsgraph/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-iotthingsgraph/tsconfig.json b/clients/client-iotthingsgraph/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-iotthingsgraph/tsconfig.json +++ b/clients/client-iotthingsgraph/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-iotthingsgraph/tsconfig.types.json b/clients/client-iotthingsgraph/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-iotthingsgraph/tsconfig.types.json +++ b/clients/client-iotthingsgraph/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ivs/.gitignore b/clients/client-ivs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ivs/.gitignore +++ b/clients/client-ivs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ivs/package.json b/clients/client-ivs/package.json index 74e2167f5520..d7c40c1d1f76 100644 --- a/clients/client-ivs/package.json +++ b/clients/client-ivs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ivs", "repository": { "type": "git", diff --git a/clients/client-ivs/runtimeConfig.browser.ts b/clients/client-ivs/runtimeConfig.browser.ts deleted file mode 100644 index 1803d9364662..000000000000 --- a/clients/client-ivs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { IvsClientConfig } from "./IvsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IvsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ivs/runtimeConfig.ts b/clients/client-ivs/runtimeConfig.ts deleted file mode 100644 index 6c33c731aed8..000000000000 --- a/clients/client-ivs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { IvsClientConfig } from "./IvsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: IvsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ivs/Ivs.ts b/clients/client-ivs/src/Ivs.ts similarity index 100% rename from clients/client-ivs/Ivs.ts rename to clients/client-ivs/src/Ivs.ts diff --git a/clients/client-ivs/IvsClient.ts b/clients/client-ivs/src/IvsClient.ts similarity index 100% rename from clients/client-ivs/IvsClient.ts rename to clients/client-ivs/src/IvsClient.ts diff --git a/clients/client-ivs/commands/BatchGetChannelCommand.ts b/clients/client-ivs/src/commands/BatchGetChannelCommand.ts similarity index 100% rename from clients/client-ivs/commands/BatchGetChannelCommand.ts rename to clients/client-ivs/src/commands/BatchGetChannelCommand.ts diff --git a/clients/client-ivs/commands/BatchGetStreamKeyCommand.ts b/clients/client-ivs/src/commands/BatchGetStreamKeyCommand.ts similarity index 100% rename from clients/client-ivs/commands/BatchGetStreamKeyCommand.ts rename to clients/client-ivs/src/commands/BatchGetStreamKeyCommand.ts diff --git a/clients/client-ivs/commands/CreateChannelCommand.ts b/clients/client-ivs/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-ivs/commands/CreateChannelCommand.ts rename to clients/client-ivs/src/commands/CreateChannelCommand.ts diff --git a/clients/client-ivs/commands/CreateRecordingConfigurationCommand.ts b/clients/client-ivs/src/commands/CreateRecordingConfigurationCommand.ts similarity index 100% rename from clients/client-ivs/commands/CreateRecordingConfigurationCommand.ts rename to clients/client-ivs/src/commands/CreateRecordingConfigurationCommand.ts diff --git a/clients/client-ivs/commands/CreateStreamKeyCommand.ts b/clients/client-ivs/src/commands/CreateStreamKeyCommand.ts similarity index 100% rename from clients/client-ivs/commands/CreateStreamKeyCommand.ts rename to clients/client-ivs/src/commands/CreateStreamKeyCommand.ts diff --git a/clients/client-ivs/commands/DeleteChannelCommand.ts b/clients/client-ivs/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-ivs/commands/DeleteChannelCommand.ts rename to clients/client-ivs/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-ivs/commands/DeletePlaybackKeyPairCommand.ts b/clients/client-ivs/src/commands/DeletePlaybackKeyPairCommand.ts similarity index 100% rename from clients/client-ivs/commands/DeletePlaybackKeyPairCommand.ts rename to clients/client-ivs/src/commands/DeletePlaybackKeyPairCommand.ts diff --git a/clients/client-ivs/commands/DeleteRecordingConfigurationCommand.ts b/clients/client-ivs/src/commands/DeleteRecordingConfigurationCommand.ts similarity index 100% rename from clients/client-ivs/commands/DeleteRecordingConfigurationCommand.ts rename to clients/client-ivs/src/commands/DeleteRecordingConfigurationCommand.ts diff --git a/clients/client-ivs/commands/DeleteStreamKeyCommand.ts b/clients/client-ivs/src/commands/DeleteStreamKeyCommand.ts similarity index 100% rename from clients/client-ivs/commands/DeleteStreamKeyCommand.ts rename to clients/client-ivs/src/commands/DeleteStreamKeyCommand.ts diff --git a/clients/client-ivs/commands/GetChannelCommand.ts b/clients/client-ivs/src/commands/GetChannelCommand.ts similarity index 100% rename from clients/client-ivs/commands/GetChannelCommand.ts rename to clients/client-ivs/src/commands/GetChannelCommand.ts diff --git a/clients/client-ivs/commands/GetPlaybackKeyPairCommand.ts b/clients/client-ivs/src/commands/GetPlaybackKeyPairCommand.ts similarity index 100% rename from clients/client-ivs/commands/GetPlaybackKeyPairCommand.ts rename to clients/client-ivs/src/commands/GetPlaybackKeyPairCommand.ts diff --git a/clients/client-ivs/commands/GetRecordingConfigurationCommand.ts b/clients/client-ivs/src/commands/GetRecordingConfigurationCommand.ts similarity index 100% rename from clients/client-ivs/commands/GetRecordingConfigurationCommand.ts rename to clients/client-ivs/src/commands/GetRecordingConfigurationCommand.ts diff --git a/clients/client-ivs/commands/GetStreamCommand.ts b/clients/client-ivs/src/commands/GetStreamCommand.ts similarity index 100% rename from clients/client-ivs/commands/GetStreamCommand.ts rename to clients/client-ivs/src/commands/GetStreamCommand.ts diff --git a/clients/client-ivs/commands/GetStreamKeyCommand.ts b/clients/client-ivs/src/commands/GetStreamKeyCommand.ts similarity index 100% rename from clients/client-ivs/commands/GetStreamKeyCommand.ts rename to clients/client-ivs/src/commands/GetStreamKeyCommand.ts diff --git a/clients/client-ivs/commands/ImportPlaybackKeyPairCommand.ts b/clients/client-ivs/src/commands/ImportPlaybackKeyPairCommand.ts similarity index 100% rename from clients/client-ivs/commands/ImportPlaybackKeyPairCommand.ts rename to clients/client-ivs/src/commands/ImportPlaybackKeyPairCommand.ts diff --git a/clients/client-ivs/commands/ListChannelsCommand.ts b/clients/client-ivs/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListChannelsCommand.ts rename to clients/client-ivs/src/commands/ListChannelsCommand.ts diff --git a/clients/client-ivs/commands/ListPlaybackKeyPairsCommand.ts b/clients/client-ivs/src/commands/ListPlaybackKeyPairsCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListPlaybackKeyPairsCommand.ts rename to clients/client-ivs/src/commands/ListPlaybackKeyPairsCommand.ts diff --git a/clients/client-ivs/commands/ListRecordingConfigurationsCommand.ts b/clients/client-ivs/src/commands/ListRecordingConfigurationsCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListRecordingConfigurationsCommand.ts rename to clients/client-ivs/src/commands/ListRecordingConfigurationsCommand.ts diff --git a/clients/client-ivs/commands/ListStreamKeysCommand.ts b/clients/client-ivs/src/commands/ListStreamKeysCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListStreamKeysCommand.ts rename to clients/client-ivs/src/commands/ListStreamKeysCommand.ts diff --git a/clients/client-ivs/commands/ListStreamsCommand.ts b/clients/client-ivs/src/commands/ListStreamsCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListStreamsCommand.ts rename to clients/client-ivs/src/commands/ListStreamsCommand.ts diff --git a/clients/client-ivs/commands/ListTagsForResourceCommand.ts b/clients/client-ivs/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ivs/commands/ListTagsForResourceCommand.ts rename to clients/client-ivs/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ivs/commands/PutMetadataCommand.ts b/clients/client-ivs/src/commands/PutMetadataCommand.ts similarity index 100% rename from clients/client-ivs/commands/PutMetadataCommand.ts rename to clients/client-ivs/src/commands/PutMetadataCommand.ts diff --git a/clients/client-ivs/commands/StopStreamCommand.ts b/clients/client-ivs/src/commands/StopStreamCommand.ts similarity index 100% rename from clients/client-ivs/commands/StopStreamCommand.ts rename to clients/client-ivs/src/commands/StopStreamCommand.ts diff --git a/clients/client-ivs/commands/TagResourceCommand.ts b/clients/client-ivs/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ivs/commands/TagResourceCommand.ts rename to clients/client-ivs/src/commands/TagResourceCommand.ts diff --git a/clients/client-ivs/commands/UntagResourceCommand.ts b/clients/client-ivs/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ivs/commands/UntagResourceCommand.ts rename to clients/client-ivs/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ivs/commands/UpdateChannelCommand.ts b/clients/client-ivs/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-ivs/commands/UpdateChannelCommand.ts rename to clients/client-ivs/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-ivs/endpoints.ts b/clients/client-ivs/src/endpoints.ts similarity index 100% rename from clients/client-ivs/endpoints.ts rename to clients/client-ivs/src/endpoints.ts diff --git a/clients/client-ivs/index.ts b/clients/client-ivs/src/index.ts similarity index 100% rename from clients/client-ivs/index.ts rename to clients/client-ivs/src/index.ts diff --git a/clients/client-ivs/models/index.ts b/clients/client-ivs/src/models/index.ts similarity index 100% rename from clients/client-ivs/models/index.ts rename to clients/client-ivs/src/models/index.ts diff --git a/clients/client-ivs/models/models_0.ts b/clients/client-ivs/src/models/models_0.ts similarity index 100% rename from clients/client-ivs/models/models_0.ts rename to clients/client-ivs/src/models/models_0.ts diff --git a/clients/client-ivs/pagination/Interfaces.ts b/clients/client-ivs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ivs/pagination/Interfaces.ts rename to clients/client-ivs/src/pagination/Interfaces.ts diff --git a/clients/client-ivs/pagination/ListChannelsPaginator.ts b/clients/client-ivs/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListChannelsPaginator.ts rename to clients/client-ivs/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-ivs/pagination/ListPlaybackKeyPairsPaginator.ts b/clients/client-ivs/src/pagination/ListPlaybackKeyPairsPaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListPlaybackKeyPairsPaginator.ts rename to clients/client-ivs/src/pagination/ListPlaybackKeyPairsPaginator.ts diff --git a/clients/client-ivs/pagination/ListRecordingConfigurationsPaginator.ts b/clients/client-ivs/src/pagination/ListRecordingConfigurationsPaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListRecordingConfigurationsPaginator.ts rename to clients/client-ivs/src/pagination/ListRecordingConfigurationsPaginator.ts diff --git a/clients/client-ivs/pagination/ListStreamKeysPaginator.ts b/clients/client-ivs/src/pagination/ListStreamKeysPaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListStreamKeysPaginator.ts rename to clients/client-ivs/src/pagination/ListStreamKeysPaginator.ts diff --git a/clients/client-ivs/pagination/ListStreamsPaginator.ts b/clients/client-ivs/src/pagination/ListStreamsPaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListStreamsPaginator.ts rename to clients/client-ivs/src/pagination/ListStreamsPaginator.ts diff --git a/clients/client-ivs/pagination/ListTagsForResourcePaginator.ts b/clients/client-ivs/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-ivs/pagination/ListTagsForResourcePaginator.ts rename to clients/client-ivs/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-ivs/protocols/Aws_restJson1.ts b/clients/client-ivs/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-ivs/protocols/Aws_restJson1.ts rename to clients/client-ivs/src/protocols/Aws_restJson1.ts diff --git a/clients/client-ivs/src/runtimeConfig.browser.ts b/clients/client-ivs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f7858418580e --- /dev/null +++ b/clients/client-ivs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { IvsClientConfig } from "./IvsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IvsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ivs/runtimeConfig.native.ts b/clients/client-ivs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ivs/runtimeConfig.native.ts rename to clients/client-ivs/src/runtimeConfig.native.ts diff --git a/clients/client-ivs/runtimeConfig.shared.ts b/clients/client-ivs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ivs/runtimeConfig.shared.ts rename to clients/client-ivs/src/runtimeConfig.shared.ts diff --git a/clients/client-ivs/src/runtimeConfig.ts b/clients/client-ivs/src/runtimeConfig.ts new file mode 100644 index 000000000000..1092a1e09178 --- /dev/null +++ b/clients/client-ivs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { IvsClientConfig } from "./IvsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: IvsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ivs/tsconfig.es.json b/clients/client-ivs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ivs/tsconfig.es.json +++ b/clients/client-ivs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ivs/tsconfig.json b/clients/client-ivs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ivs/tsconfig.json +++ b/clients/client-ivs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ivs/tsconfig.types.json b/clients/client-ivs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ivs/tsconfig.types.json +++ b/clients/client-ivs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kafka/.gitignore b/clients/client-kafka/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kafka/.gitignore +++ b/clients/client-kafka/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kafka/package.json b/clients/client-kafka/package.json index f8fac22386bf..d1318e24c852 100644 --- a/clients/client-kafka/package.json +++ b/clients/client-kafka/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kafka", "repository": { "type": "git", diff --git a/clients/client-kafka/runtimeConfig.browser.ts b/clients/client-kafka/runtimeConfig.browser.ts deleted file mode 100644 index 22982fc729a5..000000000000 --- a/clients/client-kafka/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KafkaClientConfig } from "./KafkaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KafkaClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kafka/runtimeConfig.ts b/clients/client-kafka/runtimeConfig.ts deleted file mode 100644 index 26df30cade9f..000000000000 --- a/clients/client-kafka/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KafkaClientConfig } from "./KafkaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KafkaClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kafka/Kafka.ts b/clients/client-kafka/src/Kafka.ts similarity index 100% rename from clients/client-kafka/Kafka.ts rename to clients/client-kafka/src/Kafka.ts diff --git a/clients/client-kafka/KafkaClient.ts b/clients/client-kafka/src/KafkaClient.ts similarity index 100% rename from clients/client-kafka/KafkaClient.ts rename to clients/client-kafka/src/KafkaClient.ts diff --git a/clients/client-kafka/commands/BatchAssociateScramSecretCommand.ts b/clients/client-kafka/src/commands/BatchAssociateScramSecretCommand.ts similarity index 100% rename from clients/client-kafka/commands/BatchAssociateScramSecretCommand.ts rename to clients/client-kafka/src/commands/BatchAssociateScramSecretCommand.ts diff --git a/clients/client-kafka/commands/BatchDisassociateScramSecretCommand.ts b/clients/client-kafka/src/commands/BatchDisassociateScramSecretCommand.ts similarity index 100% rename from clients/client-kafka/commands/BatchDisassociateScramSecretCommand.ts rename to clients/client-kafka/src/commands/BatchDisassociateScramSecretCommand.ts diff --git a/clients/client-kafka/commands/CreateClusterCommand.ts b/clients/client-kafka/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-kafka/commands/CreateClusterCommand.ts rename to clients/client-kafka/src/commands/CreateClusterCommand.ts diff --git a/clients/client-kafka/commands/CreateConfigurationCommand.ts b/clients/client-kafka/src/commands/CreateConfigurationCommand.ts similarity index 100% rename from clients/client-kafka/commands/CreateConfigurationCommand.ts rename to clients/client-kafka/src/commands/CreateConfigurationCommand.ts diff --git a/clients/client-kafka/commands/DeleteClusterCommand.ts b/clients/client-kafka/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-kafka/commands/DeleteClusterCommand.ts rename to clients/client-kafka/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-kafka/commands/DeleteConfigurationCommand.ts b/clients/client-kafka/src/commands/DeleteConfigurationCommand.ts similarity index 100% rename from clients/client-kafka/commands/DeleteConfigurationCommand.ts rename to clients/client-kafka/src/commands/DeleteConfigurationCommand.ts diff --git a/clients/client-kafka/commands/DescribeClusterCommand.ts b/clients/client-kafka/src/commands/DescribeClusterCommand.ts similarity index 100% rename from clients/client-kafka/commands/DescribeClusterCommand.ts rename to clients/client-kafka/src/commands/DescribeClusterCommand.ts diff --git a/clients/client-kafka/commands/DescribeClusterOperationCommand.ts b/clients/client-kafka/src/commands/DescribeClusterOperationCommand.ts similarity index 100% rename from clients/client-kafka/commands/DescribeClusterOperationCommand.ts rename to clients/client-kafka/src/commands/DescribeClusterOperationCommand.ts diff --git a/clients/client-kafka/commands/DescribeConfigurationCommand.ts b/clients/client-kafka/src/commands/DescribeConfigurationCommand.ts similarity index 100% rename from clients/client-kafka/commands/DescribeConfigurationCommand.ts rename to clients/client-kafka/src/commands/DescribeConfigurationCommand.ts diff --git a/clients/client-kafka/commands/DescribeConfigurationRevisionCommand.ts b/clients/client-kafka/src/commands/DescribeConfigurationRevisionCommand.ts similarity index 100% rename from clients/client-kafka/commands/DescribeConfigurationRevisionCommand.ts rename to clients/client-kafka/src/commands/DescribeConfigurationRevisionCommand.ts diff --git a/clients/client-kafka/commands/GetBootstrapBrokersCommand.ts b/clients/client-kafka/src/commands/GetBootstrapBrokersCommand.ts similarity index 100% rename from clients/client-kafka/commands/GetBootstrapBrokersCommand.ts rename to clients/client-kafka/src/commands/GetBootstrapBrokersCommand.ts diff --git a/clients/client-kafka/commands/GetCompatibleKafkaVersionsCommand.ts b/clients/client-kafka/src/commands/GetCompatibleKafkaVersionsCommand.ts similarity index 100% rename from clients/client-kafka/commands/GetCompatibleKafkaVersionsCommand.ts rename to clients/client-kafka/src/commands/GetCompatibleKafkaVersionsCommand.ts diff --git a/clients/client-kafka/commands/ListClusterOperationsCommand.ts b/clients/client-kafka/src/commands/ListClusterOperationsCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListClusterOperationsCommand.ts rename to clients/client-kafka/src/commands/ListClusterOperationsCommand.ts diff --git a/clients/client-kafka/commands/ListClustersCommand.ts b/clients/client-kafka/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListClustersCommand.ts rename to clients/client-kafka/src/commands/ListClustersCommand.ts diff --git a/clients/client-kafka/commands/ListConfigurationRevisionsCommand.ts b/clients/client-kafka/src/commands/ListConfigurationRevisionsCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListConfigurationRevisionsCommand.ts rename to clients/client-kafka/src/commands/ListConfigurationRevisionsCommand.ts diff --git a/clients/client-kafka/commands/ListConfigurationsCommand.ts b/clients/client-kafka/src/commands/ListConfigurationsCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListConfigurationsCommand.ts rename to clients/client-kafka/src/commands/ListConfigurationsCommand.ts diff --git a/clients/client-kafka/commands/ListKafkaVersionsCommand.ts b/clients/client-kafka/src/commands/ListKafkaVersionsCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListKafkaVersionsCommand.ts rename to clients/client-kafka/src/commands/ListKafkaVersionsCommand.ts diff --git a/clients/client-kafka/commands/ListNodesCommand.ts b/clients/client-kafka/src/commands/ListNodesCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListNodesCommand.ts rename to clients/client-kafka/src/commands/ListNodesCommand.ts diff --git a/clients/client-kafka/commands/ListScramSecretsCommand.ts b/clients/client-kafka/src/commands/ListScramSecretsCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListScramSecretsCommand.ts rename to clients/client-kafka/src/commands/ListScramSecretsCommand.ts diff --git a/clients/client-kafka/commands/ListTagsForResourceCommand.ts b/clients/client-kafka/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-kafka/commands/ListTagsForResourceCommand.ts rename to clients/client-kafka/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-kafka/commands/RebootBrokerCommand.ts b/clients/client-kafka/src/commands/RebootBrokerCommand.ts similarity index 100% rename from clients/client-kafka/commands/RebootBrokerCommand.ts rename to clients/client-kafka/src/commands/RebootBrokerCommand.ts diff --git a/clients/client-kafka/commands/TagResourceCommand.ts b/clients/client-kafka/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kafka/commands/TagResourceCommand.ts rename to clients/client-kafka/src/commands/TagResourceCommand.ts diff --git a/clients/client-kafka/commands/UntagResourceCommand.ts b/clients/client-kafka/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kafka/commands/UntagResourceCommand.ts rename to clients/client-kafka/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kafka/commands/UpdateBrokerCountCommand.ts b/clients/client-kafka/src/commands/UpdateBrokerCountCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateBrokerCountCommand.ts rename to clients/client-kafka/src/commands/UpdateBrokerCountCommand.ts diff --git a/clients/client-kafka/commands/UpdateBrokerStorageCommand.ts b/clients/client-kafka/src/commands/UpdateBrokerStorageCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateBrokerStorageCommand.ts rename to clients/client-kafka/src/commands/UpdateBrokerStorageCommand.ts diff --git a/clients/client-kafka/commands/UpdateBrokerTypeCommand.ts b/clients/client-kafka/src/commands/UpdateBrokerTypeCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateBrokerTypeCommand.ts rename to clients/client-kafka/src/commands/UpdateBrokerTypeCommand.ts diff --git a/clients/client-kafka/commands/UpdateClusterConfigurationCommand.ts b/clients/client-kafka/src/commands/UpdateClusterConfigurationCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateClusterConfigurationCommand.ts rename to clients/client-kafka/src/commands/UpdateClusterConfigurationCommand.ts diff --git a/clients/client-kafka/commands/UpdateClusterKafkaVersionCommand.ts b/clients/client-kafka/src/commands/UpdateClusterKafkaVersionCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateClusterKafkaVersionCommand.ts rename to clients/client-kafka/src/commands/UpdateClusterKafkaVersionCommand.ts diff --git a/clients/client-kafka/commands/UpdateConfigurationCommand.ts b/clients/client-kafka/src/commands/UpdateConfigurationCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateConfigurationCommand.ts rename to clients/client-kafka/src/commands/UpdateConfigurationCommand.ts diff --git a/clients/client-kafka/commands/UpdateMonitoringCommand.ts b/clients/client-kafka/src/commands/UpdateMonitoringCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateMonitoringCommand.ts rename to clients/client-kafka/src/commands/UpdateMonitoringCommand.ts diff --git a/clients/client-kafka/commands/UpdateSecurityCommand.ts b/clients/client-kafka/src/commands/UpdateSecurityCommand.ts similarity index 100% rename from clients/client-kafka/commands/UpdateSecurityCommand.ts rename to clients/client-kafka/src/commands/UpdateSecurityCommand.ts diff --git a/clients/client-kafka/endpoints.ts b/clients/client-kafka/src/endpoints.ts similarity index 100% rename from clients/client-kafka/endpoints.ts rename to clients/client-kafka/src/endpoints.ts diff --git a/clients/client-kafka/index.ts b/clients/client-kafka/src/index.ts similarity index 100% rename from clients/client-kafka/index.ts rename to clients/client-kafka/src/index.ts diff --git a/clients/client-kafka/models/index.ts b/clients/client-kafka/src/models/index.ts similarity index 100% rename from clients/client-kafka/models/index.ts rename to clients/client-kafka/src/models/index.ts diff --git a/clients/client-kafka/models/models_0.ts b/clients/client-kafka/src/models/models_0.ts similarity index 100% rename from clients/client-kafka/models/models_0.ts rename to clients/client-kafka/src/models/models_0.ts diff --git a/clients/client-kafka/pagination/Interfaces.ts b/clients/client-kafka/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kafka/pagination/Interfaces.ts rename to clients/client-kafka/src/pagination/Interfaces.ts diff --git a/clients/client-kafka/pagination/ListClusterOperationsPaginator.ts b/clients/client-kafka/src/pagination/ListClusterOperationsPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListClusterOperationsPaginator.ts rename to clients/client-kafka/src/pagination/ListClusterOperationsPaginator.ts diff --git a/clients/client-kafka/pagination/ListClustersPaginator.ts b/clients/client-kafka/src/pagination/ListClustersPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListClustersPaginator.ts rename to clients/client-kafka/src/pagination/ListClustersPaginator.ts diff --git a/clients/client-kafka/pagination/ListConfigurationRevisionsPaginator.ts b/clients/client-kafka/src/pagination/ListConfigurationRevisionsPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListConfigurationRevisionsPaginator.ts rename to clients/client-kafka/src/pagination/ListConfigurationRevisionsPaginator.ts diff --git a/clients/client-kafka/pagination/ListConfigurationsPaginator.ts b/clients/client-kafka/src/pagination/ListConfigurationsPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListConfigurationsPaginator.ts rename to clients/client-kafka/src/pagination/ListConfigurationsPaginator.ts diff --git a/clients/client-kafka/pagination/ListKafkaVersionsPaginator.ts b/clients/client-kafka/src/pagination/ListKafkaVersionsPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListKafkaVersionsPaginator.ts rename to clients/client-kafka/src/pagination/ListKafkaVersionsPaginator.ts diff --git a/clients/client-kafka/pagination/ListNodesPaginator.ts b/clients/client-kafka/src/pagination/ListNodesPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListNodesPaginator.ts rename to clients/client-kafka/src/pagination/ListNodesPaginator.ts diff --git a/clients/client-kafka/pagination/ListScramSecretsPaginator.ts b/clients/client-kafka/src/pagination/ListScramSecretsPaginator.ts similarity index 100% rename from clients/client-kafka/pagination/ListScramSecretsPaginator.ts rename to clients/client-kafka/src/pagination/ListScramSecretsPaginator.ts diff --git a/clients/client-kafka/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kafka/protocols/Aws_restJson1.ts rename to clients/client-kafka/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kafka/src/runtimeConfig.browser.ts b/clients/client-kafka/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..50f7f822c77d --- /dev/null +++ b/clients/client-kafka/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KafkaClientConfig } from "./KafkaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KafkaClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kafka/runtimeConfig.native.ts b/clients/client-kafka/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kafka/runtimeConfig.native.ts rename to clients/client-kafka/src/runtimeConfig.native.ts diff --git a/clients/client-kafka/runtimeConfig.shared.ts b/clients/client-kafka/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kafka/runtimeConfig.shared.ts rename to clients/client-kafka/src/runtimeConfig.shared.ts diff --git a/clients/client-kafka/src/runtimeConfig.ts b/clients/client-kafka/src/runtimeConfig.ts new file mode 100644 index 000000000000..909c55fca9ee --- /dev/null +++ b/clients/client-kafka/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KafkaClientConfig } from "./KafkaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KafkaClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kafka/tsconfig.es.json b/clients/client-kafka/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kafka/tsconfig.es.json +++ b/clients/client-kafka/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kafka/tsconfig.json b/clients/client-kafka/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kafka/tsconfig.json +++ b/clients/client-kafka/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kafka/tsconfig.types.json b/clients/client-kafka/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kafka/tsconfig.types.json +++ b/clients/client-kafka/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kafkaconnect/.gitignore b/clients/client-kafkaconnect/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-kafkaconnect/.gitignore +++ b/clients/client-kafkaconnect/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kafkaconnect/package.json b/clients/client-kafkaconnect/package.json index 65d0ee95394b..bad49e49e484 100644 --- a/clients/client-kafkaconnect/package.json +++ b/clients/client-kafkaconnect/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kafkaconnect", "repository": { "type": "git", diff --git a/clients/client-kafkaconnect/runtimeConfig.browser.ts b/clients/client-kafkaconnect/runtimeConfig.browser.ts deleted file mode 100644 index e6a0ba806ac1..000000000000 --- a/clients/client-kafkaconnect/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KafkaConnectClientConfig } from "./KafkaConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kafkaconnect/runtimeConfig.ts b/clients/client-kafkaconnect/runtimeConfig.ts deleted file mode 100644 index a5d3a0419fd0..000000000000 --- a/clients/client-kafkaconnect/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KafkaConnectClientConfig } from "./KafkaConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kafkaconnect/KafkaConnect.ts b/clients/client-kafkaconnect/src/KafkaConnect.ts similarity index 100% rename from clients/client-kafkaconnect/KafkaConnect.ts rename to clients/client-kafkaconnect/src/KafkaConnect.ts diff --git a/clients/client-kafkaconnect/KafkaConnectClient.ts b/clients/client-kafkaconnect/src/KafkaConnectClient.ts similarity index 100% rename from clients/client-kafkaconnect/KafkaConnectClient.ts rename to clients/client-kafkaconnect/src/KafkaConnectClient.ts diff --git a/clients/client-kafkaconnect/commands/CreateConnectorCommand.ts b/clients/client-kafkaconnect/src/commands/CreateConnectorCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/CreateConnectorCommand.ts rename to clients/client-kafkaconnect/src/commands/CreateConnectorCommand.ts diff --git a/clients/client-kafkaconnect/commands/CreateCustomPluginCommand.ts b/clients/client-kafkaconnect/src/commands/CreateCustomPluginCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/CreateCustomPluginCommand.ts rename to clients/client-kafkaconnect/src/commands/CreateCustomPluginCommand.ts diff --git a/clients/client-kafkaconnect/commands/CreateWorkerConfigurationCommand.ts b/clients/client-kafkaconnect/src/commands/CreateWorkerConfigurationCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/CreateWorkerConfigurationCommand.ts rename to clients/client-kafkaconnect/src/commands/CreateWorkerConfigurationCommand.ts diff --git a/clients/client-kafkaconnect/commands/DeleteConnectorCommand.ts b/clients/client-kafkaconnect/src/commands/DeleteConnectorCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/DeleteConnectorCommand.ts rename to clients/client-kafkaconnect/src/commands/DeleteConnectorCommand.ts diff --git a/clients/client-kafkaconnect/commands/DescribeConnectorCommand.ts b/clients/client-kafkaconnect/src/commands/DescribeConnectorCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/DescribeConnectorCommand.ts rename to clients/client-kafkaconnect/src/commands/DescribeConnectorCommand.ts diff --git a/clients/client-kafkaconnect/commands/DescribeCustomPluginCommand.ts b/clients/client-kafkaconnect/src/commands/DescribeCustomPluginCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/DescribeCustomPluginCommand.ts rename to clients/client-kafkaconnect/src/commands/DescribeCustomPluginCommand.ts diff --git a/clients/client-kafkaconnect/commands/DescribeWorkerConfigurationCommand.ts b/clients/client-kafkaconnect/src/commands/DescribeWorkerConfigurationCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/DescribeWorkerConfigurationCommand.ts rename to clients/client-kafkaconnect/src/commands/DescribeWorkerConfigurationCommand.ts diff --git a/clients/client-kafkaconnect/commands/ListConnectorsCommand.ts b/clients/client-kafkaconnect/src/commands/ListConnectorsCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/ListConnectorsCommand.ts rename to clients/client-kafkaconnect/src/commands/ListConnectorsCommand.ts diff --git a/clients/client-kafkaconnect/commands/ListCustomPluginsCommand.ts b/clients/client-kafkaconnect/src/commands/ListCustomPluginsCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/ListCustomPluginsCommand.ts rename to clients/client-kafkaconnect/src/commands/ListCustomPluginsCommand.ts diff --git a/clients/client-kafkaconnect/commands/ListWorkerConfigurationsCommand.ts b/clients/client-kafkaconnect/src/commands/ListWorkerConfigurationsCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/ListWorkerConfigurationsCommand.ts rename to clients/client-kafkaconnect/src/commands/ListWorkerConfigurationsCommand.ts diff --git a/clients/client-kafkaconnect/commands/UpdateConnectorCommand.ts b/clients/client-kafkaconnect/src/commands/UpdateConnectorCommand.ts similarity index 100% rename from clients/client-kafkaconnect/commands/UpdateConnectorCommand.ts rename to clients/client-kafkaconnect/src/commands/UpdateConnectorCommand.ts diff --git a/clients/client-kafkaconnect/endpoints.ts b/clients/client-kafkaconnect/src/endpoints.ts similarity index 100% rename from clients/client-kafkaconnect/endpoints.ts rename to clients/client-kafkaconnect/src/endpoints.ts diff --git a/clients/client-kafkaconnect/index.ts b/clients/client-kafkaconnect/src/index.ts similarity index 100% rename from clients/client-kafkaconnect/index.ts rename to clients/client-kafkaconnect/src/index.ts diff --git a/clients/client-kafkaconnect/models/index.ts b/clients/client-kafkaconnect/src/models/index.ts similarity index 100% rename from clients/client-kafkaconnect/models/index.ts rename to clients/client-kafkaconnect/src/models/index.ts diff --git a/clients/client-kafkaconnect/models/models_0.ts b/clients/client-kafkaconnect/src/models/models_0.ts similarity index 100% rename from clients/client-kafkaconnect/models/models_0.ts rename to clients/client-kafkaconnect/src/models/models_0.ts diff --git a/clients/client-kafkaconnect/pagination/Interfaces.ts b/clients/client-kafkaconnect/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kafkaconnect/pagination/Interfaces.ts rename to clients/client-kafkaconnect/src/pagination/Interfaces.ts diff --git a/clients/client-kafkaconnect/pagination/ListConnectorsPaginator.ts b/clients/client-kafkaconnect/src/pagination/ListConnectorsPaginator.ts similarity index 100% rename from clients/client-kafkaconnect/pagination/ListConnectorsPaginator.ts rename to clients/client-kafkaconnect/src/pagination/ListConnectorsPaginator.ts diff --git a/clients/client-kafkaconnect/pagination/ListCustomPluginsPaginator.ts b/clients/client-kafkaconnect/src/pagination/ListCustomPluginsPaginator.ts similarity index 100% rename from clients/client-kafkaconnect/pagination/ListCustomPluginsPaginator.ts rename to clients/client-kafkaconnect/src/pagination/ListCustomPluginsPaginator.ts diff --git a/clients/client-kafkaconnect/pagination/ListWorkerConfigurationsPaginator.ts b/clients/client-kafkaconnect/src/pagination/ListWorkerConfigurationsPaginator.ts similarity index 100% rename from clients/client-kafkaconnect/pagination/ListWorkerConfigurationsPaginator.ts rename to clients/client-kafkaconnect/src/pagination/ListWorkerConfigurationsPaginator.ts diff --git a/clients/client-kafkaconnect/protocols/Aws_restJson1.ts b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kafkaconnect/protocols/Aws_restJson1.ts rename to clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kafkaconnect/src/runtimeConfig.browser.ts b/clients/client-kafkaconnect/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..daddfe520304 --- /dev/null +++ b/clients/client-kafkaconnect/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KafkaConnectClientConfig } from "./KafkaConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kafkaconnect/runtimeConfig.native.ts b/clients/client-kafkaconnect/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kafkaconnect/runtimeConfig.native.ts rename to clients/client-kafkaconnect/src/runtimeConfig.native.ts diff --git a/clients/client-kafkaconnect/runtimeConfig.shared.ts b/clients/client-kafkaconnect/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kafkaconnect/runtimeConfig.shared.ts rename to clients/client-kafkaconnect/src/runtimeConfig.shared.ts diff --git a/clients/client-kafkaconnect/src/runtimeConfig.ts b/clients/client-kafkaconnect/src/runtimeConfig.ts new file mode 100644 index 000000000000..dcd26760b2c9 --- /dev/null +++ b/clients/client-kafkaconnect/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KafkaConnectClientConfig } from "./KafkaConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kafkaconnect/tsconfig.es.json b/clients/client-kafkaconnect/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kafkaconnect/tsconfig.es.json +++ b/clients/client-kafkaconnect/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kafkaconnect/tsconfig.json b/clients/client-kafkaconnect/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kafkaconnect/tsconfig.json +++ b/clients/client-kafkaconnect/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kafkaconnect/tsconfig.types.json b/clients/client-kafkaconnect/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kafkaconnect/tsconfig.types.json +++ b/clients/client-kafkaconnect/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kendra/.gitignore b/clients/client-kendra/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kendra/.gitignore +++ b/clients/client-kendra/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kendra/package.json b/clients/client-kendra/package.json index 0a73780955b0..ecd6444d4975 100644 --- a/clients/client-kendra/package.json +++ b/clients/client-kendra/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kendra", "repository": { "type": "git", diff --git a/clients/client-kendra/runtimeConfig.browser.ts b/clients/client-kendra/runtimeConfig.browser.ts deleted file mode 100644 index f5ad7736ef90..000000000000 --- a/clients/client-kendra/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KendraClientConfig } from "./KendraClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KendraClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kendra/runtimeConfig.ts b/clients/client-kendra/runtimeConfig.ts deleted file mode 100644 index 287aac20bdd4..000000000000 --- a/clients/client-kendra/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KendraClientConfig } from "./KendraClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KendraClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kendra/Kendra.ts b/clients/client-kendra/src/Kendra.ts similarity index 100% rename from clients/client-kendra/Kendra.ts rename to clients/client-kendra/src/Kendra.ts diff --git a/clients/client-kendra/KendraClient.ts b/clients/client-kendra/src/KendraClient.ts similarity index 100% rename from clients/client-kendra/KendraClient.ts rename to clients/client-kendra/src/KendraClient.ts diff --git a/clients/client-kendra/commands/BatchDeleteDocumentCommand.ts b/clients/client-kendra/src/commands/BatchDeleteDocumentCommand.ts similarity index 100% rename from clients/client-kendra/commands/BatchDeleteDocumentCommand.ts rename to clients/client-kendra/src/commands/BatchDeleteDocumentCommand.ts diff --git a/clients/client-kendra/commands/BatchGetDocumentStatusCommand.ts b/clients/client-kendra/src/commands/BatchGetDocumentStatusCommand.ts similarity index 100% rename from clients/client-kendra/commands/BatchGetDocumentStatusCommand.ts rename to clients/client-kendra/src/commands/BatchGetDocumentStatusCommand.ts diff --git a/clients/client-kendra/commands/BatchPutDocumentCommand.ts b/clients/client-kendra/src/commands/BatchPutDocumentCommand.ts similarity index 100% rename from clients/client-kendra/commands/BatchPutDocumentCommand.ts rename to clients/client-kendra/src/commands/BatchPutDocumentCommand.ts diff --git a/clients/client-kendra/commands/ClearQuerySuggestionsCommand.ts b/clients/client-kendra/src/commands/ClearQuerySuggestionsCommand.ts similarity index 100% rename from clients/client-kendra/commands/ClearQuerySuggestionsCommand.ts rename to clients/client-kendra/src/commands/ClearQuerySuggestionsCommand.ts diff --git a/clients/client-kendra/commands/CreateDataSourceCommand.ts b/clients/client-kendra/src/commands/CreateDataSourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/CreateDataSourceCommand.ts rename to clients/client-kendra/src/commands/CreateDataSourceCommand.ts diff --git a/clients/client-kendra/commands/CreateFaqCommand.ts b/clients/client-kendra/src/commands/CreateFaqCommand.ts similarity index 100% rename from clients/client-kendra/commands/CreateFaqCommand.ts rename to clients/client-kendra/src/commands/CreateFaqCommand.ts diff --git a/clients/client-kendra/commands/CreateIndexCommand.ts b/clients/client-kendra/src/commands/CreateIndexCommand.ts similarity index 100% rename from clients/client-kendra/commands/CreateIndexCommand.ts rename to clients/client-kendra/src/commands/CreateIndexCommand.ts diff --git a/clients/client-kendra/commands/CreateQuerySuggestionsBlockListCommand.ts b/clients/client-kendra/src/commands/CreateQuerySuggestionsBlockListCommand.ts similarity index 100% rename from clients/client-kendra/commands/CreateQuerySuggestionsBlockListCommand.ts rename to clients/client-kendra/src/commands/CreateQuerySuggestionsBlockListCommand.ts diff --git a/clients/client-kendra/commands/CreateThesaurusCommand.ts b/clients/client-kendra/src/commands/CreateThesaurusCommand.ts similarity index 100% rename from clients/client-kendra/commands/CreateThesaurusCommand.ts rename to clients/client-kendra/src/commands/CreateThesaurusCommand.ts diff --git a/clients/client-kendra/commands/DeleteDataSourceCommand.ts b/clients/client-kendra/src/commands/DeleteDataSourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeleteDataSourceCommand.ts rename to clients/client-kendra/src/commands/DeleteDataSourceCommand.ts diff --git a/clients/client-kendra/commands/DeleteFaqCommand.ts b/clients/client-kendra/src/commands/DeleteFaqCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeleteFaqCommand.ts rename to clients/client-kendra/src/commands/DeleteFaqCommand.ts diff --git a/clients/client-kendra/commands/DeleteIndexCommand.ts b/clients/client-kendra/src/commands/DeleteIndexCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeleteIndexCommand.ts rename to clients/client-kendra/src/commands/DeleteIndexCommand.ts diff --git a/clients/client-kendra/commands/DeletePrincipalMappingCommand.ts b/clients/client-kendra/src/commands/DeletePrincipalMappingCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeletePrincipalMappingCommand.ts rename to clients/client-kendra/src/commands/DeletePrincipalMappingCommand.ts diff --git a/clients/client-kendra/commands/DeleteQuerySuggestionsBlockListCommand.ts b/clients/client-kendra/src/commands/DeleteQuerySuggestionsBlockListCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeleteQuerySuggestionsBlockListCommand.ts rename to clients/client-kendra/src/commands/DeleteQuerySuggestionsBlockListCommand.ts diff --git a/clients/client-kendra/commands/DeleteThesaurusCommand.ts b/clients/client-kendra/src/commands/DeleteThesaurusCommand.ts similarity index 100% rename from clients/client-kendra/commands/DeleteThesaurusCommand.ts rename to clients/client-kendra/src/commands/DeleteThesaurusCommand.ts diff --git a/clients/client-kendra/commands/DescribeDataSourceCommand.ts b/clients/client-kendra/src/commands/DescribeDataSourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeDataSourceCommand.ts rename to clients/client-kendra/src/commands/DescribeDataSourceCommand.ts diff --git a/clients/client-kendra/commands/DescribeFaqCommand.ts b/clients/client-kendra/src/commands/DescribeFaqCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeFaqCommand.ts rename to clients/client-kendra/src/commands/DescribeFaqCommand.ts diff --git a/clients/client-kendra/commands/DescribeIndexCommand.ts b/clients/client-kendra/src/commands/DescribeIndexCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeIndexCommand.ts rename to clients/client-kendra/src/commands/DescribeIndexCommand.ts diff --git a/clients/client-kendra/commands/DescribePrincipalMappingCommand.ts b/clients/client-kendra/src/commands/DescribePrincipalMappingCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribePrincipalMappingCommand.ts rename to clients/client-kendra/src/commands/DescribePrincipalMappingCommand.ts diff --git a/clients/client-kendra/commands/DescribeQuerySuggestionsBlockListCommand.ts b/clients/client-kendra/src/commands/DescribeQuerySuggestionsBlockListCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeQuerySuggestionsBlockListCommand.ts rename to clients/client-kendra/src/commands/DescribeQuerySuggestionsBlockListCommand.ts diff --git a/clients/client-kendra/commands/DescribeQuerySuggestionsConfigCommand.ts b/clients/client-kendra/src/commands/DescribeQuerySuggestionsConfigCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeQuerySuggestionsConfigCommand.ts rename to clients/client-kendra/src/commands/DescribeQuerySuggestionsConfigCommand.ts diff --git a/clients/client-kendra/commands/DescribeThesaurusCommand.ts b/clients/client-kendra/src/commands/DescribeThesaurusCommand.ts similarity index 100% rename from clients/client-kendra/commands/DescribeThesaurusCommand.ts rename to clients/client-kendra/src/commands/DescribeThesaurusCommand.ts diff --git a/clients/client-kendra/commands/GetQuerySuggestionsCommand.ts b/clients/client-kendra/src/commands/GetQuerySuggestionsCommand.ts similarity index 100% rename from clients/client-kendra/commands/GetQuerySuggestionsCommand.ts rename to clients/client-kendra/src/commands/GetQuerySuggestionsCommand.ts diff --git a/clients/client-kendra/commands/ListDataSourceSyncJobsCommand.ts b/clients/client-kendra/src/commands/ListDataSourceSyncJobsCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListDataSourceSyncJobsCommand.ts rename to clients/client-kendra/src/commands/ListDataSourceSyncJobsCommand.ts diff --git a/clients/client-kendra/commands/ListDataSourcesCommand.ts b/clients/client-kendra/src/commands/ListDataSourcesCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListDataSourcesCommand.ts rename to clients/client-kendra/src/commands/ListDataSourcesCommand.ts diff --git a/clients/client-kendra/commands/ListFaqsCommand.ts b/clients/client-kendra/src/commands/ListFaqsCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListFaqsCommand.ts rename to clients/client-kendra/src/commands/ListFaqsCommand.ts diff --git a/clients/client-kendra/commands/ListGroupsOlderThanOrderingIdCommand.ts b/clients/client-kendra/src/commands/ListGroupsOlderThanOrderingIdCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListGroupsOlderThanOrderingIdCommand.ts rename to clients/client-kendra/src/commands/ListGroupsOlderThanOrderingIdCommand.ts diff --git a/clients/client-kendra/commands/ListIndicesCommand.ts b/clients/client-kendra/src/commands/ListIndicesCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListIndicesCommand.ts rename to clients/client-kendra/src/commands/ListIndicesCommand.ts diff --git a/clients/client-kendra/commands/ListQuerySuggestionsBlockListsCommand.ts b/clients/client-kendra/src/commands/ListQuerySuggestionsBlockListsCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListQuerySuggestionsBlockListsCommand.ts rename to clients/client-kendra/src/commands/ListQuerySuggestionsBlockListsCommand.ts diff --git a/clients/client-kendra/commands/ListTagsForResourceCommand.ts b/clients/client-kendra/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListTagsForResourceCommand.ts rename to clients/client-kendra/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-kendra/commands/ListThesauriCommand.ts b/clients/client-kendra/src/commands/ListThesauriCommand.ts similarity index 100% rename from clients/client-kendra/commands/ListThesauriCommand.ts rename to clients/client-kendra/src/commands/ListThesauriCommand.ts diff --git a/clients/client-kendra/commands/PutPrincipalMappingCommand.ts b/clients/client-kendra/src/commands/PutPrincipalMappingCommand.ts similarity index 100% rename from clients/client-kendra/commands/PutPrincipalMappingCommand.ts rename to clients/client-kendra/src/commands/PutPrincipalMappingCommand.ts diff --git a/clients/client-kendra/commands/QueryCommand.ts b/clients/client-kendra/src/commands/QueryCommand.ts similarity index 100% rename from clients/client-kendra/commands/QueryCommand.ts rename to clients/client-kendra/src/commands/QueryCommand.ts diff --git a/clients/client-kendra/commands/StartDataSourceSyncJobCommand.ts b/clients/client-kendra/src/commands/StartDataSourceSyncJobCommand.ts similarity index 100% rename from clients/client-kendra/commands/StartDataSourceSyncJobCommand.ts rename to clients/client-kendra/src/commands/StartDataSourceSyncJobCommand.ts diff --git a/clients/client-kendra/commands/StopDataSourceSyncJobCommand.ts b/clients/client-kendra/src/commands/StopDataSourceSyncJobCommand.ts similarity index 100% rename from clients/client-kendra/commands/StopDataSourceSyncJobCommand.ts rename to clients/client-kendra/src/commands/StopDataSourceSyncJobCommand.ts diff --git a/clients/client-kendra/commands/SubmitFeedbackCommand.ts b/clients/client-kendra/src/commands/SubmitFeedbackCommand.ts similarity index 100% rename from clients/client-kendra/commands/SubmitFeedbackCommand.ts rename to clients/client-kendra/src/commands/SubmitFeedbackCommand.ts diff --git a/clients/client-kendra/commands/TagResourceCommand.ts b/clients/client-kendra/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/TagResourceCommand.ts rename to clients/client-kendra/src/commands/TagResourceCommand.ts diff --git a/clients/client-kendra/commands/UntagResourceCommand.ts b/clients/client-kendra/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/UntagResourceCommand.ts rename to clients/client-kendra/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kendra/commands/UpdateDataSourceCommand.ts b/clients/client-kendra/src/commands/UpdateDataSourceCommand.ts similarity index 100% rename from clients/client-kendra/commands/UpdateDataSourceCommand.ts rename to clients/client-kendra/src/commands/UpdateDataSourceCommand.ts diff --git a/clients/client-kendra/commands/UpdateIndexCommand.ts b/clients/client-kendra/src/commands/UpdateIndexCommand.ts similarity index 100% rename from clients/client-kendra/commands/UpdateIndexCommand.ts rename to clients/client-kendra/src/commands/UpdateIndexCommand.ts diff --git a/clients/client-kendra/commands/UpdateQuerySuggestionsBlockListCommand.ts b/clients/client-kendra/src/commands/UpdateQuerySuggestionsBlockListCommand.ts similarity index 100% rename from clients/client-kendra/commands/UpdateQuerySuggestionsBlockListCommand.ts rename to clients/client-kendra/src/commands/UpdateQuerySuggestionsBlockListCommand.ts diff --git a/clients/client-kendra/commands/UpdateQuerySuggestionsConfigCommand.ts b/clients/client-kendra/src/commands/UpdateQuerySuggestionsConfigCommand.ts similarity index 100% rename from clients/client-kendra/commands/UpdateQuerySuggestionsConfigCommand.ts rename to clients/client-kendra/src/commands/UpdateQuerySuggestionsConfigCommand.ts diff --git a/clients/client-kendra/commands/UpdateThesaurusCommand.ts b/clients/client-kendra/src/commands/UpdateThesaurusCommand.ts similarity index 100% rename from clients/client-kendra/commands/UpdateThesaurusCommand.ts rename to clients/client-kendra/src/commands/UpdateThesaurusCommand.ts diff --git a/clients/client-kendra/endpoints.ts b/clients/client-kendra/src/endpoints.ts similarity index 100% rename from clients/client-kendra/endpoints.ts rename to clients/client-kendra/src/endpoints.ts diff --git a/clients/client-kendra/index.ts b/clients/client-kendra/src/index.ts similarity index 100% rename from clients/client-kendra/index.ts rename to clients/client-kendra/src/index.ts diff --git a/clients/client-kendra/models/index.ts b/clients/client-kendra/src/models/index.ts similarity index 100% rename from clients/client-kendra/models/index.ts rename to clients/client-kendra/src/models/index.ts diff --git a/clients/client-kendra/models/models_0.ts b/clients/client-kendra/src/models/models_0.ts similarity index 100% rename from clients/client-kendra/models/models_0.ts rename to clients/client-kendra/src/models/models_0.ts diff --git a/clients/client-kendra/pagination/Interfaces.ts b/clients/client-kendra/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kendra/pagination/Interfaces.ts rename to clients/client-kendra/src/pagination/Interfaces.ts diff --git a/clients/client-kendra/pagination/ListDataSourceSyncJobsPaginator.ts b/clients/client-kendra/src/pagination/ListDataSourceSyncJobsPaginator.ts similarity index 100% rename from clients/client-kendra/pagination/ListDataSourceSyncJobsPaginator.ts rename to clients/client-kendra/src/pagination/ListDataSourceSyncJobsPaginator.ts diff --git a/clients/client-kendra/pagination/ListDataSourcesPaginator.ts b/clients/client-kendra/src/pagination/ListDataSourcesPaginator.ts similarity index 100% rename from clients/client-kendra/pagination/ListDataSourcesPaginator.ts rename to clients/client-kendra/src/pagination/ListDataSourcesPaginator.ts diff --git a/clients/client-kendra/pagination/ListIndicesPaginator.ts b/clients/client-kendra/src/pagination/ListIndicesPaginator.ts similarity index 100% rename from clients/client-kendra/pagination/ListIndicesPaginator.ts rename to clients/client-kendra/src/pagination/ListIndicesPaginator.ts diff --git a/clients/client-kendra/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-kendra/protocols/Aws_json1_1.ts rename to clients/client-kendra/src/protocols/Aws_json1_1.ts diff --git a/clients/client-kendra/src/runtimeConfig.browser.ts b/clients/client-kendra/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d353f28ad218 --- /dev/null +++ b/clients/client-kendra/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KendraClientConfig } from "./KendraClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KendraClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kendra/runtimeConfig.native.ts b/clients/client-kendra/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kendra/runtimeConfig.native.ts rename to clients/client-kendra/src/runtimeConfig.native.ts diff --git a/clients/client-kendra/runtimeConfig.shared.ts b/clients/client-kendra/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kendra/runtimeConfig.shared.ts rename to clients/client-kendra/src/runtimeConfig.shared.ts diff --git a/clients/client-kendra/src/runtimeConfig.ts b/clients/client-kendra/src/runtimeConfig.ts new file mode 100644 index 000000000000..bf2639fffba8 --- /dev/null +++ b/clients/client-kendra/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KendraClientConfig } from "./KendraClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KendraClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kendra/tsconfig.es.json b/clients/client-kendra/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kendra/tsconfig.es.json +++ b/clients/client-kendra/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kendra/tsconfig.json b/clients/client-kendra/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kendra/tsconfig.json +++ b/clients/client-kendra/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kendra/tsconfig.types.json b/clients/client-kendra/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kendra/tsconfig.types.json +++ b/clients/client-kendra/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-analytics-v2/.gitignore b/clients/client-kinesis-analytics-v2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-analytics-v2/.gitignore +++ b/clients/client-kinesis-analytics-v2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-analytics-v2/package.json b/clients/client-kinesis-analytics-v2/package.json index 2487b3c4479e..74a6b455f8da 100644 --- a/clients/client-kinesis-analytics-v2/package.json +++ b/clients/client-kinesis-analytics-v2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-analytics-v2", "repository": { "type": "git", diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts deleted file mode 100644 index 95a90650b7f6..000000000000 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisAnalyticsV2ClientConfig } from "./KinesisAnalyticsV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/runtimeConfig.ts deleted file mode 100644 index 4c8638bf8cce..000000000000 --- a/clients/client-kinesis-analytics-v2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisAnalyticsV2ClientConfig } from "./KinesisAnalyticsV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2.ts b/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/KinesisAnalyticsV2.ts rename to clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2.ts diff --git a/clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts b/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/KinesisAnalyticsV2Client.ts rename to clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationCloudWatchLoggingOptionCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationCloudWatchLoggingOptionCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationCloudWatchLoggingOptionCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationCloudWatchLoggingOptionCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationInputCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationInputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationInputCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationInputCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationInputProcessingConfigurationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationInputProcessingConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationInputProcessingConfigurationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationInputProcessingConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationOutputCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationOutputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationOutputCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationOutputCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationReferenceDataSourceCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationReferenceDataSourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationReferenceDataSourceCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationReferenceDataSourceCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/AddApplicationVpcConfigurationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/AddApplicationVpcConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/AddApplicationVpcConfigurationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/AddApplicationVpcConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/CreateApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/CreateApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/CreateApplicationPresignedUrlCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/CreateApplicationPresignedUrlCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/CreateApplicationPresignedUrlCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/CreateApplicationPresignedUrlCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/CreateApplicationSnapshotCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/CreateApplicationSnapshotCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/CreateApplicationSnapshotCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/CreateApplicationSnapshotCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationInputProcessingConfigurationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationInputProcessingConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationInputProcessingConfigurationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationInputProcessingConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationOutputCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationOutputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationOutputCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationOutputCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationReferenceDataSourceCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationReferenceDataSourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationReferenceDataSourceCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationReferenceDataSourceCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationSnapshotCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationSnapshotCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationSnapshotCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationSnapshotCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DeleteApplicationVpcConfigurationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationVpcConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DeleteApplicationVpcConfigurationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DeleteApplicationVpcConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DescribeApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DescribeApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DescribeApplicationSnapshotCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationSnapshotCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DescribeApplicationSnapshotCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationSnapshotCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DescribeApplicationVersionCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationVersionCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DescribeApplicationVersionCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DescribeApplicationVersionCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/DiscoverInputSchemaCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/DiscoverInputSchemaCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/DiscoverInputSchemaCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/DiscoverInputSchemaCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/ListApplicationSnapshotsCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/ListApplicationSnapshotsCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/ListApplicationSnapshotsCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/ListApplicationSnapshotsCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/ListApplicationVersionsCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/ListApplicationVersionsCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/ListApplicationVersionsCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/ListApplicationVersionsCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/ListApplicationsCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/ListApplicationsCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/ListTagsForResourceCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/ListTagsForResourceCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/RollbackApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/RollbackApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/RollbackApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/RollbackApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/StartApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/StartApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/StartApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/StartApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/StopApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/StopApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/StopApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/StopApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/TagResourceCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/TagResourceCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/TagResourceCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/UntagResourceCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/UntagResourceCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/UpdateApplicationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/UpdateApplicationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/commands/UpdateApplicationMaintenanceConfigurationCommand.ts b/clients/client-kinesis-analytics-v2/src/commands/UpdateApplicationMaintenanceConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/commands/UpdateApplicationMaintenanceConfigurationCommand.ts rename to clients/client-kinesis-analytics-v2/src/commands/UpdateApplicationMaintenanceConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics-v2/endpoints.ts b/clients/client-kinesis-analytics-v2/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/endpoints.ts rename to clients/client-kinesis-analytics-v2/src/endpoints.ts diff --git a/clients/client-kinesis-analytics-v2/index.ts b/clients/client-kinesis-analytics-v2/src/index.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/index.ts rename to clients/client-kinesis-analytics-v2/src/index.ts diff --git a/clients/client-kinesis-analytics-v2/models/index.ts b/clients/client-kinesis-analytics-v2/src/models/index.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/models/index.ts rename to clients/client-kinesis-analytics-v2/src/models/index.ts diff --git a/clients/client-kinesis-analytics-v2/models/models_0.ts b/clients/client-kinesis-analytics-v2/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/models/models_0.ts rename to clients/client-kinesis-analytics-v2/src/models/models_0.ts diff --git a/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts rename to clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts diff --git a/clients/client-kinesis-analytics-v2/src/runtimeConfig.browser.ts b/clients/client-kinesis-analytics-v2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e1e07885bd63 --- /dev/null +++ b/clients/client-kinesis-analytics-v2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisAnalyticsV2ClientConfig } from "./KinesisAnalyticsV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.native.ts b/clients/client-kinesis-analytics-v2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/runtimeConfig.native.ts rename to clients/client-kinesis-analytics-v2/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-analytics-v2/runtimeConfig.shared.ts b/clients/client-kinesis-analytics-v2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-analytics-v2/runtimeConfig.shared.ts rename to clients/client-kinesis-analytics-v2/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts new file mode 100644 index 000000000000..58c27566587b --- /dev/null +++ b/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisAnalyticsV2ClientConfig } from "./KinesisAnalyticsV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-analytics-v2/tsconfig.es.json b/clients/client-kinesis-analytics-v2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-analytics-v2/tsconfig.es.json +++ b/clients/client-kinesis-analytics-v2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-analytics-v2/tsconfig.json b/clients/client-kinesis-analytics-v2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-analytics-v2/tsconfig.json +++ b/clients/client-kinesis-analytics-v2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-analytics-v2/tsconfig.types.json b/clients/client-kinesis-analytics-v2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-analytics-v2/tsconfig.types.json +++ b/clients/client-kinesis-analytics-v2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-analytics/.gitignore b/clients/client-kinesis-analytics/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-analytics/.gitignore +++ b/clients/client-kinesis-analytics/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-analytics/package.json b/clients/client-kinesis-analytics/package.json index 6a8bdf70a3bd..2f9131d981c0 100644 --- a/clients/client-kinesis-analytics/package.json +++ b/clients/client-kinesis-analytics/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-analytics", "repository": { "type": "git", diff --git a/clients/client-kinesis-analytics/runtimeConfig.browser.ts b/clients/client-kinesis-analytics/runtimeConfig.browser.ts deleted file mode 100644 index eaacf20280b1..000000000000 --- a/clients/client-kinesis-analytics/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisAnalyticsClientConfig } from "./KinesisAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-analytics/runtimeConfig.ts b/clients/client-kinesis-analytics/runtimeConfig.ts deleted file mode 100644 index 8a5750beed49..000000000000 --- a/clients/client-kinesis-analytics/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisAnalyticsClientConfig } from "./KinesisAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-analytics/KinesisAnalytics.ts b/clients/client-kinesis-analytics/src/KinesisAnalytics.ts similarity index 100% rename from clients/client-kinesis-analytics/KinesisAnalytics.ts rename to clients/client-kinesis-analytics/src/KinesisAnalytics.ts diff --git a/clients/client-kinesis-analytics/KinesisAnalyticsClient.ts b/clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts similarity index 100% rename from clients/client-kinesis-analytics/KinesisAnalyticsClient.ts rename to clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts diff --git a/clients/client-kinesis-analytics/commands/AddApplicationCloudWatchLoggingOptionCommand.ts b/clients/client-kinesis-analytics/src/commands/AddApplicationCloudWatchLoggingOptionCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/AddApplicationCloudWatchLoggingOptionCommand.ts rename to clients/client-kinesis-analytics/src/commands/AddApplicationCloudWatchLoggingOptionCommand.ts diff --git a/clients/client-kinesis-analytics/commands/AddApplicationInputCommand.ts b/clients/client-kinesis-analytics/src/commands/AddApplicationInputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/AddApplicationInputCommand.ts rename to clients/client-kinesis-analytics/src/commands/AddApplicationInputCommand.ts diff --git a/clients/client-kinesis-analytics/commands/AddApplicationInputProcessingConfigurationCommand.ts b/clients/client-kinesis-analytics/src/commands/AddApplicationInputProcessingConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/AddApplicationInputProcessingConfigurationCommand.ts rename to clients/client-kinesis-analytics/src/commands/AddApplicationInputProcessingConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/AddApplicationOutputCommand.ts b/clients/client-kinesis-analytics/src/commands/AddApplicationOutputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/AddApplicationOutputCommand.ts rename to clients/client-kinesis-analytics/src/commands/AddApplicationOutputCommand.ts diff --git a/clients/client-kinesis-analytics/commands/AddApplicationReferenceDataSourceCommand.ts b/clients/client-kinesis-analytics/src/commands/AddApplicationReferenceDataSourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/AddApplicationReferenceDataSourceCommand.ts rename to clients/client-kinesis-analytics/src/commands/AddApplicationReferenceDataSourceCommand.ts diff --git a/clients/client-kinesis-analytics/commands/CreateApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/CreateApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts b/clients/client-kinesis-analytics/src/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts rename to clients/client-kinesis-analytics/src/commands/DeleteApplicationCloudWatchLoggingOptionCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DeleteApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DeleteApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DeleteApplicationInputProcessingConfigurationCommand.ts b/clients/client-kinesis-analytics/src/commands/DeleteApplicationInputProcessingConfigurationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DeleteApplicationInputProcessingConfigurationCommand.ts rename to clients/client-kinesis-analytics/src/commands/DeleteApplicationInputProcessingConfigurationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DeleteApplicationOutputCommand.ts b/clients/client-kinesis-analytics/src/commands/DeleteApplicationOutputCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DeleteApplicationOutputCommand.ts rename to clients/client-kinesis-analytics/src/commands/DeleteApplicationOutputCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DeleteApplicationReferenceDataSourceCommand.ts b/clients/client-kinesis-analytics/src/commands/DeleteApplicationReferenceDataSourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DeleteApplicationReferenceDataSourceCommand.ts rename to clients/client-kinesis-analytics/src/commands/DeleteApplicationReferenceDataSourceCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DescribeApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/DescribeApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DescribeApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/DescribeApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/DiscoverInputSchemaCommand.ts b/clients/client-kinesis-analytics/src/commands/DiscoverInputSchemaCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/DiscoverInputSchemaCommand.ts rename to clients/client-kinesis-analytics/src/commands/DiscoverInputSchemaCommand.ts diff --git a/clients/client-kinesis-analytics/commands/ListApplicationsCommand.ts b/clients/client-kinesis-analytics/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/ListApplicationsCommand.ts rename to clients/client-kinesis-analytics/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-kinesis-analytics/commands/ListTagsForResourceCommand.ts b/clients/client-kinesis-analytics/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/ListTagsForResourceCommand.ts rename to clients/client-kinesis-analytics/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-kinesis-analytics/commands/StartApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/StartApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/StartApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/StartApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/StopApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/StopApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/StopApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/StopApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/commands/TagResourceCommand.ts b/clients/client-kinesis-analytics/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/TagResourceCommand.ts rename to clients/client-kinesis-analytics/src/commands/TagResourceCommand.ts diff --git a/clients/client-kinesis-analytics/commands/UntagResourceCommand.ts b/clients/client-kinesis-analytics/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/UntagResourceCommand.ts rename to clients/client-kinesis-analytics/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kinesis-analytics/commands/UpdateApplicationCommand.ts b/clients/client-kinesis-analytics/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-kinesis-analytics/commands/UpdateApplicationCommand.ts rename to clients/client-kinesis-analytics/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-kinesis-analytics/endpoints.ts b/clients/client-kinesis-analytics/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-analytics/endpoints.ts rename to clients/client-kinesis-analytics/src/endpoints.ts diff --git a/clients/client-kinesis-analytics/index.ts b/clients/client-kinesis-analytics/src/index.ts similarity index 100% rename from clients/client-kinesis-analytics/index.ts rename to clients/client-kinesis-analytics/src/index.ts diff --git a/clients/client-kinesis-analytics/models/index.ts b/clients/client-kinesis-analytics/src/models/index.ts similarity index 100% rename from clients/client-kinesis-analytics/models/index.ts rename to clients/client-kinesis-analytics/src/models/index.ts diff --git a/clients/client-kinesis-analytics/models/models_0.ts b/clients/client-kinesis-analytics/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-analytics/models/models_0.ts rename to clients/client-kinesis-analytics/src/models/models_0.ts diff --git a/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-kinesis-analytics/protocols/Aws_json1_1.ts rename to clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts diff --git a/clients/client-kinesis-analytics/src/runtimeConfig.browser.ts b/clients/client-kinesis-analytics/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..03ef4ba03c60 --- /dev/null +++ b/clients/client-kinesis-analytics/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisAnalyticsClientConfig } from "./KinesisAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-analytics/runtimeConfig.native.ts b/clients/client-kinesis-analytics/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-analytics/runtimeConfig.native.ts rename to clients/client-kinesis-analytics/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-analytics/runtimeConfig.shared.ts b/clients/client-kinesis-analytics/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-analytics/runtimeConfig.shared.ts rename to clients/client-kinesis-analytics/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-analytics/src/runtimeConfig.ts b/clients/client-kinesis-analytics/src/runtimeConfig.ts new file mode 100644 index 000000000000..c6a3f8ff4f63 --- /dev/null +++ b/clients/client-kinesis-analytics/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisAnalyticsClientConfig } from "./KinesisAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-analytics/tsconfig.es.json b/clients/client-kinesis-analytics/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-analytics/tsconfig.es.json +++ b/clients/client-kinesis-analytics/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-analytics/tsconfig.json b/clients/client-kinesis-analytics/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-analytics/tsconfig.json +++ b/clients/client-kinesis-analytics/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-analytics/tsconfig.types.json b/clients/client-kinesis-analytics/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-analytics/tsconfig.types.json +++ b/clients/client-kinesis-analytics/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-video-archived-media/.gitignore b/clients/client-kinesis-video-archived-media/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-video-archived-media/.gitignore +++ b/clients/client-kinesis-video-archived-media/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-video-archived-media/package.json b/clients/client-kinesis-video-archived-media/package.json index 2d21abddb1a2..58df55bf141e 100644 --- a/clients/client-kinesis-video-archived-media/package.json +++ b/clients/client-kinesis-video-archived-media/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-video-archived-media", "repository": { "type": "git", diff --git a/clients/client-kinesis-video-archived-media/pagination/Interfaces.ts b/clients/client-kinesis-video-archived-media/pagination/Interfaces.ts deleted file mode 100644 index 8e6ff07c5976..000000000000 --- a/clients/client-kinesis-video-archived-media/pagination/Interfaces.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { KinesisVideoArchivedMedia } from "../KinesisVideoArchivedMedia"; -import { KinesisVideoArchivedMediaClient } from "../KinesisVideoArchivedMediaClient"; -import { PaginationConfiguration } from "@aws-sdk/types"; - -export interface KinesisVideoArchivedMediaPaginationConfiguration extends PaginationConfiguration { - client: KinesisVideoArchivedMedia | KinesisVideoArchivedMediaClient; -} diff --git a/clients/client-kinesis-video-archived-media/pagination/ListFragmentsPaginator.ts b/clients/client-kinesis-video-archived-media/pagination/ListFragmentsPaginator.ts deleted file mode 100644 index d67b75b7be47..000000000000 --- a/clients/client-kinesis-video-archived-media/pagination/ListFragmentsPaginator.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { KinesisVideoArchivedMedia } from "../KinesisVideoArchivedMedia"; -import { KinesisVideoArchivedMediaClient } from "../KinesisVideoArchivedMediaClient"; -import { - ListFragmentsCommand, - ListFragmentsCommandInput, - ListFragmentsCommandOutput, -} from "../commands/ListFragmentsCommand"; -import { KinesisVideoArchivedMediaPaginationConfiguration } from "./Interfaces"; -import { Paginator } from "@aws-sdk/types"; - -/** - * @private - */ -const makePagedClientRequest = async ( - client: KinesisVideoArchivedMediaClient, - input: ListFragmentsCommandInput, - ...args: any -): Promise => { - // @ts-ignore - return await client.send(new ListFragmentsCommand(input), ...args); -}; -/** - * @private - */ -const makePagedRequest = async ( - client: KinesisVideoArchivedMedia, - input: ListFragmentsCommandInput, - ...args: any -): Promise => { - // @ts-ignore - return await client.listFragments(input, ...args); -}; -export async function* paginateListFragments( - config: KinesisVideoArchivedMediaPaginationConfiguration, - input: ListFragmentsCommandInput, - ...additionalArguments: any -): Paginator { - // ToDo: replace with actual type instead of typeof input.NextToken - let token: typeof input.NextToken | undefined = config.startingToken || undefined; - let hasNext = true; - let page: ListFragmentsCommandOutput; - while (hasNext) { - input.NextToken = token; - input["MaxResults"] = config.pageSize; - if (config.client instanceof KinesisVideoArchivedMedia) { - page = await makePagedRequest(config.client, input, ...additionalArguments); - } else if (config.client instanceof KinesisVideoArchivedMediaClient) { - page = await makePagedClientRequest(config.client, input, ...additionalArguments); - } else { - throw new Error("Invalid client, expected KinesisVideoArchivedMedia | KinesisVideoArchivedMediaClient"); - } - yield page; - token = page.NextToken; - hasNext = !!token; - } - // @ts-ignore - return undefined; -} diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts deleted file mode 100644 index db6fb6704099..000000000000 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisVideoArchivedMediaClientConfig } from "./KinesisVideoArchivedMediaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/runtimeConfig.ts deleted file mode 100644 index 5d59472b949e..000000000000 --- a/clients/client-kinesis-video-archived-media/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisVideoArchivedMediaClientConfig } from "./KinesisVideoArchivedMediaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMedia.ts b/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMedia.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/KinesisVideoArchivedMedia.ts rename to clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMedia.ts diff --git a/clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts b/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/KinesisVideoArchivedMediaClient.ts rename to clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts diff --git a/clients/client-kinesis-video-archived-media/commands/GetClipCommand.ts b/clients/client-kinesis-video-archived-media/src/commands/GetClipCommand.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/commands/GetClipCommand.ts rename to clients/client-kinesis-video-archived-media/src/commands/GetClipCommand.ts diff --git a/clients/client-kinesis-video-archived-media/commands/GetDASHStreamingSessionURLCommand.ts b/clients/client-kinesis-video-archived-media/src/commands/GetDASHStreamingSessionURLCommand.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/commands/GetDASHStreamingSessionURLCommand.ts rename to clients/client-kinesis-video-archived-media/src/commands/GetDASHStreamingSessionURLCommand.ts diff --git a/clients/client-kinesis-video-archived-media/commands/GetHLSStreamingSessionURLCommand.ts b/clients/client-kinesis-video-archived-media/src/commands/GetHLSStreamingSessionURLCommand.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/commands/GetHLSStreamingSessionURLCommand.ts rename to clients/client-kinesis-video-archived-media/src/commands/GetHLSStreamingSessionURLCommand.ts diff --git a/clients/client-kinesis-video-archived-media/commands/GetMediaForFragmentListCommand.ts b/clients/client-kinesis-video-archived-media/src/commands/GetMediaForFragmentListCommand.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/commands/GetMediaForFragmentListCommand.ts rename to clients/client-kinesis-video-archived-media/src/commands/GetMediaForFragmentListCommand.ts diff --git a/clients/client-kinesis-video-archived-media/commands/ListFragmentsCommand.ts b/clients/client-kinesis-video-archived-media/src/commands/ListFragmentsCommand.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/commands/ListFragmentsCommand.ts rename to clients/client-kinesis-video-archived-media/src/commands/ListFragmentsCommand.ts diff --git a/clients/client-kinesis-video-archived-media/endpoints.ts b/clients/client-kinesis-video-archived-media/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/endpoints.ts rename to clients/client-kinesis-video-archived-media/src/endpoints.ts diff --git a/clients/client-kinesis-video-archived-media/index.ts b/clients/client-kinesis-video-archived-media/src/index.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/index.ts rename to clients/client-kinesis-video-archived-media/src/index.ts diff --git a/clients/client-kinesis-video-archived-media/models/index.ts b/clients/client-kinesis-video-archived-media/src/models/index.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/models/index.ts rename to clients/client-kinesis-video-archived-media/src/models/index.ts diff --git a/clients/client-kinesis-video-archived-media/models/models_0.ts b/clients/client-kinesis-video-archived-media/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/models/models_0.ts rename to clients/client-kinesis-video-archived-media/src/models/models_0.ts diff --git a/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/protocols/Aws_restJson1.ts rename to clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kinesis-video-archived-media/src/runtimeConfig.browser.ts b/clients/client-kinesis-video-archived-media/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5a2baca57dde --- /dev/null +++ b/clients/client-kinesis-video-archived-media/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisVideoArchivedMediaClientConfig } from "./KinesisVideoArchivedMediaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.native.ts b/clients/client-kinesis-video-archived-media/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/runtimeConfig.native.ts rename to clients/client-kinesis-video-archived-media/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-video-archived-media/runtimeConfig.shared.ts b/clients/client-kinesis-video-archived-media/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-video-archived-media/runtimeConfig.shared.ts rename to clients/client-kinesis-video-archived-media/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts new file mode 100644 index 000000000000..7c2b69822013 --- /dev/null +++ b/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisVideoArchivedMediaClientConfig } from "./KinesisVideoArchivedMediaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-archived-media/tsconfig.es.json b/clients/client-kinesis-video-archived-media/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-video-archived-media/tsconfig.es.json +++ b/clients/client-kinesis-video-archived-media/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-video-archived-media/tsconfig.json b/clients/client-kinesis-video-archived-media/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-video-archived-media/tsconfig.json +++ b/clients/client-kinesis-video-archived-media/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-video-archived-media/tsconfig.types.json b/clients/client-kinesis-video-archived-media/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-video-archived-media/tsconfig.types.json +++ b/clients/client-kinesis-video-archived-media/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-video-media/.gitignore b/clients/client-kinesis-video-media/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-video-media/.gitignore +++ b/clients/client-kinesis-video-media/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-video-media/package.json b/clients/client-kinesis-video-media/package.json index bd8434d51a58..7bbce8592ff0 100644 --- a/clients/client-kinesis-video-media/package.json +++ b/clients/client-kinesis-video-media/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-video-media", "repository": { "type": "git", diff --git a/clients/client-kinesis-video-media/runtimeConfig.browser.ts b/clients/client-kinesis-video-media/runtimeConfig.browser.ts deleted file mode 100644 index e54d418783cb..000000000000 --- a/clients/client-kinesis-video-media/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisVideoMediaClientConfig } from "./KinesisVideoMediaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-media/runtimeConfig.ts b/clients/client-kinesis-video-media/runtimeConfig.ts deleted file mode 100644 index 9955fb250b63..000000000000 --- a/clients/client-kinesis-video-media/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisVideoMediaClientConfig } from "./KinesisVideoMediaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-media/KinesisVideoMedia.ts b/clients/client-kinesis-video-media/src/KinesisVideoMedia.ts similarity index 100% rename from clients/client-kinesis-video-media/KinesisVideoMedia.ts rename to clients/client-kinesis-video-media/src/KinesisVideoMedia.ts diff --git a/clients/client-kinesis-video-media/KinesisVideoMediaClient.ts b/clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts similarity index 100% rename from clients/client-kinesis-video-media/KinesisVideoMediaClient.ts rename to clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts diff --git a/clients/client-kinesis-video-media/commands/GetMediaCommand.ts b/clients/client-kinesis-video-media/src/commands/GetMediaCommand.ts similarity index 100% rename from clients/client-kinesis-video-media/commands/GetMediaCommand.ts rename to clients/client-kinesis-video-media/src/commands/GetMediaCommand.ts diff --git a/clients/client-kinesis-video-media/endpoints.ts b/clients/client-kinesis-video-media/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-video-media/endpoints.ts rename to clients/client-kinesis-video-media/src/endpoints.ts diff --git a/clients/client-kinesis-video-media/index.ts b/clients/client-kinesis-video-media/src/index.ts similarity index 100% rename from clients/client-kinesis-video-media/index.ts rename to clients/client-kinesis-video-media/src/index.ts diff --git a/clients/client-kinesis-video-media/models/index.ts b/clients/client-kinesis-video-media/src/models/index.ts similarity index 100% rename from clients/client-kinesis-video-media/models/index.ts rename to clients/client-kinesis-video-media/src/models/index.ts diff --git a/clients/client-kinesis-video-media/models/models_0.ts b/clients/client-kinesis-video-media/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-video-media/models/models_0.ts rename to clients/client-kinesis-video-media/src/models/models_0.ts diff --git a/clients/client-kinesis-video-media/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kinesis-video-media/protocols/Aws_restJson1.ts rename to clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kinesis-video-media/src/runtimeConfig.browser.ts b/clients/client-kinesis-video-media/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6dece88546ea --- /dev/null +++ b/clients/client-kinesis-video-media/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisVideoMediaClientConfig } from "./KinesisVideoMediaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-media/runtimeConfig.native.ts b/clients/client-kinesis-video-media/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-video-media/runtimeConfig.native.ts rename to clients/client-kinesis-video-media/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-video-media/runtimeConfig.shared.ts b/clients/client-kinesis-video-media/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-video-media/runtimeConfig.shared.ts rename to clients/client-kinesis-video-media/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-video-media/src/runtimeConfig.ts b/clients/client-kinesis-video-media/src/runtimeConfig.ts new file mode 100644 index 000000000000..53c17ea1d89d --- /dev/null +++ b/clients/client-kinesis-video-media/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisVideoMediaClientConfig } from "./KinesisVideoMediaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-media/tsconfig.es.json b/clients/client-kinesis-video-media/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-video-media/tsconfig.es.json +++ b/clients/client-kinesis-video-media/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-video-media/tsconfig.json b/clients/client-kinesis-video-media/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-video-media/tsconfig.json +++ b/clients/client-kinesis-video-media/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-video-media/tsconfig.types.json b/clients/client-kinesis-video-media/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-video-media/tsconfig.types.json +++ b/clients/client-kinesis-video-media/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-video-signaling/.gitignore b/clients/client-kinesis-video-signaling/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-video-signaling/.gitignore +++ b/clients/client-kinesis-video-signaling/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-video-signaling/package.json b/clients/client-kinesis-video-signaling/package.json index 5a50f43c08bf..5c8deff30a9e 100644 --- a/clients/client-kinesis-video-signaling/package.json +++ b/clients/client-kinesis-video-signaling/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-video-signaling", "repository": { "type": "git", diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts b/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts deleted file mode 100644 index 5a79b457e093..000000000000 --- a/clients/client-kinesis-video-signaling/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisVideoSignalingClientConfig } from "./KinesisVideoSignalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.ts b/clients/client-kinesis-video-signaling/runtimeConfig.ts deleted file mode 100644 index 97084431e56e..000000000000 --- a/clients/client-kinesis-video-signaling/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisVideoSignalingClientConfig } from "./KinesisVideoSignalingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video-signaling/KinesisVideoSignaling.ts b/clients/client-kinesis-video-signaling/src/KinesisVideoSignaling.ts similarity index 100% rename from clients/client-kinesis-video-signaling/KinesisVideoSignaling.ts rename to clients/client-kinesis-video-signaling/src/KinesisVideoSignaling.ts diff --git a/clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts b/clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts similarity index 100% rename from clients/client-kinesis-video-signaling/KinesisVideoSignalingClient.ts rename to clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts diff --git a/clients/client-kinesis-video-signaling/commands/GetIceServerConfigCommand.ts b/clients/client-kinesis-video-signaling/src/commands/GetIceServerConfigCommand.ts similarity index 100% rename from clients/client-kinesis-video-signaling/commands/GetIceServerConfigCommand.ts rename to clients/client-kinesis-video-signaling/src/commands/GetIceServerConfigCommand.ts diff --git a/clients/client-kinesis-video-signaling/commands/SendAlexaOfferToMasterCommand.ts b/clients/client-kinesis-video-signaling/src/commands/SendAlexaOfferToMasterCommand.ts similarity index 100% rename from clients/client-kinesis-video-signaling/commands/SendAlexaOfferToMasterCommand.ts rename to clients/client-kinesis-video-signaling/src/commands/SendAlexaOfferToMasterCommand.ts diff --git a/clients/client-kinesis-video-signaling/endpoints.ts b/clients/client-kinesis-video-signaling/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-video-signaling/endpoints.ts rename to clients/client-kinesis-video-signaling/src/endpoints.ts diff --git a/clients/client-kinesis-video-signaling/index.ts b/clients/client-kinesis-video-signaling/src/index.ts similarity index 100% rename from clients/client-kinesis-video-signaling/index.ts rename to clients/client-kinesis-video-signaling/src/index.ts diff --git a/clients/client-kinesis-video-signaling/models/index.ts b/clients/client-kinesis-video-signaling/src/models/index.ts similarity index 100% rename from clients/client-kinesis-video-signaling/models/index.ts rename to clients/client-kinesis-video-signaling/src/models/index.ts diff --git a/clients/client-kinesis-video-signaling/models/models_0.ts b/clients/client-kinesis-video-signaling/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-video-signaling/models/models_0.ts rename to clients/client-kinesis-video-signaling/src/models/models_0.ts diff --git a/clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kinesis-video-signaling/protocols/Aws_restJson1.ts rename to clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kinesis-video-signaling/src/runtimeConfig.browser.ts b/clients/client-kinesis-video-signaling/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d41bf1bd5fe6 --- /dev/null +++ b/clients/client-kinesis-video-signaling/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisVideoSignalingClientConfig } from "./KinesisVideoSignalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.native.ts b/clients/client-kinesis-video-signaling/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-video-signaling/runtimeConfig.native.ts rename to clients/client-kinesis-video-signaling/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-video-signaling/runtimeConfig.shared.ts b/clients/client-kinesis-video-signaling/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-video-signaling/runtimeConfig.shared.ts rename to clients/client-kinesis-video-signaling/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-video-signaling/src/runtimeConfig.ts b/clients/client-kinesis-video-signaling/src/runtimeConfig.ts new file mode 100644 index 000000000000..74ba10dbff37 --- /dev/null +++ b/clients/client-kinesis-video-signaling/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisVideoSignalingClientConfig } from "./KinesisVideoSignalingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video-signaling/tsconfig.es.json b/clients/client-kinesis-video-signaling/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-video-signaling/tsconfig.es.json +++ b/clients/client-kinesis-video-signaling/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-video-signaling/tsconfig.json b/clients/client-kinesis-video-signaling/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-video-signaling/tsconfig.json +++ b/clients/client-kinesis-video-signaling/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-video-signaling/tsconfig.types.json b/clients/client-kinesis-video-signaling/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-video-signaling/tsconfig.types.json +++ b/clients/client-kinesis-video-signaling/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis-video/.gitignore b/clients/client-kinesis-video/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis-video/.gitignore +++ b/clients/client-kinesis-video/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis-video/package.json b/clients/client-kinesis-video/package.json index 6c0571f69e57..656d0a71d145 100644 --- a/clients/client-kinesis-video/package.json +++ b/clients/client-kinesis-video/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis-video", "repository": { "type": "git", diff --git a/clients/client-kinesis-video/runtimeConfig.browser.ts b/clients/client-kinesis-video/runtimeConfig.browser.ts deleted file mode 100644 index 9b5ad60c2582..000000000000 --- a/clients/client-kinesis-video/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisVideoClientConfig } from "./KinesisVideoClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video/runtimeConfig.ts b/clients/client-kinesis-video/runtimeConfig.ts deleted file mode 100644 index c6bb5d8c9414..000000000000 --- a/clients/client-kinesis-video/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisVideoClientConfig } from "./KinesisVideoClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis-video/KinesisVideo.ts b/clients/client-kinesis-video/src/KinesisVideo.ts similarity index 100% rename from clients/client-kinesis-video/KinesisVideo.ts rename to clients/client-kinesis-video/src/KinesisVideo.ts diff --git a/clients/client-kinesis-video/KinesisVideoClient.ts b/clients/client-kinesis-video/src/KinesisVideoClient.ts similarity index 100% rename from clients/client-kinesis-video/KinesisVideoClient.ts rename to clients/client-kinesis-video/src/KinesisVideoClient.ts diff --git a/clients/client-kinesis-video/commands/CreateSignalingChannelCommand.ts b/clients/client-kinesis-video/src/commands/CreateSignalingChannelCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/CreateSignalingChannelCommand.ts rename to clients/client-kinesis-video/src/commands/CreateSignalingChannelCommand.ts diff --git a/clients/client-kinesis-video/commands/CreateStreamCommand.ts b/clients/client-kinesis-video/src/commands/CreateStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/CreateStreamCommand.ts rename to clients/client-kinesis-video/src/commands/CreateStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/DeleteSignalingChannelCommand.ts b/clients/client-kinesis-video/src/commands/DeleteSignalingChannelCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/DeleteSignalingChannelCommand.ts rename to clients/client-kinesis-video/src/commands/DeleteSignalingChannelCommand.ts diff --git a/clients/client-kinesis-video/commands/DeleteStreamCommand.ts b/clients/client-kinesis-video/src/commands/DeleteStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/DeleteStreamCommand.ts rename to clients/client-kinesis-video/src/commands/DeleteStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/DescribeSignalingChannelCommand.ts b/clients/client-kinesis-video/src/commands/DescribeSignalingChannelCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/DescribeSignalingChannelCommand.ts rename to clients/client-kinesis-video/src/commands/DescribeSignalingChannelCommand.ts diff --git a/clients/client-kinesis-video/commands/DescribeStreamCommand.ts b/clients/client-kinesis-video/src/commands/DescribeStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/DescribeStreamCommand.ts rename to clients/client-kinesis-video/src/commands/DescribeStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/GetDataEndpointCommand.ts b/clients/client-kinesis-video/src/commands/GetDataEndpointCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/GetDataEndpointCommand.ts rename to clients/client-kinesis-video/src/commands/GetDataEndpointCommand.ts diff --git a/clients/client-kinesis-video/commands/GetSignalingChannelEndpointCommand.ts b/clients/client-kinesis-video/src/commands/GetSignalingChannelEndpointCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/GetSignalingChannelEndpointCommand.ts rename to clients/client-kinesis-video/src/commands/GetSignalingChannelEndpointCommand.ts diff --git a/clients/client-kinesis-video/commands/ListSignalingChannelsCommand.ts b/clients/client-kinesis-video/src/commands/ListSignalingChannelsCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/ListSignalingChannelsCommand.ts rename to clients/client-kinesis-video/src/commands/ListSignalingChannelsCommand.ts diff --git a/clients/client-kinesis-video/commands/ListStreamsCommand.ts b/clients/client-kinesis-video/src/commands/ListStreamsCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/ListStreamsCommand.ts rename to clients/client-kinesis-video/src/commands/ListStreamsCommand.ts diff --git a/clients/client-kinesis-video/commands/ListTagsForResourceCommand.ts b/clients/client-kinesis-video/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/ListTagsForResourceCommand.ts rename to clients/client-kinesis-video/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-kinesis-video/commands/ListTagsForStreamCommand.ts b/clients/client-kinesis-video/src/commands/ListTagsForStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/ListTagsForStreamCommand.ts rename to clients/client-kinesis-video/src/commands/ListTagsForStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/TagResourceCommand.ts b/clients/client-kinesis-video/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/TagResourceCommand.ts rename to clients/client-kinesis-video/src/commands/TagResourceCommand.ts diff --git a/clients/client-kinesis-video/commands/TagStreamCommand.ts b/clients/client-kinesis-video/src/commands/TagStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/TagStreamCommand.ts rename to clients/client-kinesis-video/src/commands/TagStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/UntagResourceCommand.ts b/clients/client-kinesis-video/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/UntagResourceCommand.ts rename to clients/client-kinesis-video/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kinesis-video/commands/UntagStreamCommand.ts b/clients/client-kinesis-video/src/commands/UntagStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/UntagStreamCommand.ts rename to clients/client-kinesis-video/src/commands/UntagStreamCommand.ts diff --git a/clients/client-kinesis-video/commands/UpdateDataRetentionCommand.ts b/clients/client-kinesis-video/src/commands/UpdateDataRetentionCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/UpdateDataRetentionCommand.ts rename to clients/client-kinesis-video/src/commands/UpdateDataRetentionCommand.ts diff --git a/clients/client-kinesis-video/commands/UpdateSignalingChannelCommand.ts b/clients/client-kinesis-video/src/commands/UpdateSignalingChannelCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/UpdateSignalingChannelCommand.ts rename to clients/client-kinesis-video/src/commands/UpdateSignalingChannelCommand.ts diff --git a/clients/client-kinesis-video/commands/UpdateStreamCommand.ts b/clients/client-kinesis-video/src/commands/UpdateStreamCommand.ts similarity index 100% rename from clients/client-kinesis-video/commands/UpdateStreamCommand.ts rename to clients/client-kinesis-video/src/commands/UpdateStreamCommand.ts diff --git a/clients/client-kinesis-video/endpoints.ts b/clients/client-kinesis-video/src/endpoints.ts similarity index 100% rename from clients/client-kinesis-video/endpoints.ts rename to clients/client-kinesis-video/src/endpoints.ts diff --git a/clients/client-kinesis-video/index.ts b/clients/client-kinesis-video/src/index.ts similarity index 100% rename from clients/client-kinesis-video/index.ts rename to clients/client-kinesis-video/src/index.ts diff --git a/clients/client-kinesis-video/models/index.ts b/clients/client-kinesis-video/src/models/index.ts similarity index 100% rename from clients/client-kinesis-video/models/index.ts rename to clients/client-kinesis-video/src/models/index.ts diff --git a/clients/client-kinesis-video/models/models_0.ts b/clients/client-kinesis-video/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis-video/models/models_0.ts rename to clients/client-kinesis-video/src/models/models_0.ts diff --git a/clients/client-kinesis-video/pagination/Interfaces.ts b/clients/client-kinesis-video/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kinesis-video/pagination/Interfaces.ts rename to clients/client-kinesis-video/src/pagination/Interfaces.ts diff --git a/clients/client-kinesis-video/pagination/ListSignalingChannelsPaginator.ts b/clients/client-kinesis-video/src/pagination/ListSignalingChannelsPaginator.ts similarity index 100% rename from clients/client-kinesis-video/pagination/ListSignalingChannelsPaginator.ts rename to clients/client-kinesis-video/src/pagination/ListSignalingChannelsPaginator.ts diff --git a/clients/client-kinesis-video/pagination/ListStreamsPaginator.ts b/clients/client-kinesis-video/src/pagination/ListStreamsPaginator.ts similarity index 100% rename from clients/client-kinesis-video/pagination/ListStreamsPaginator.ts rename to clients/client-kinesis-video/src/pagination/ListStreamsPaginator.ts diff --git a/clients/client-kinesis-video/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-kinesis-video/protocols/Aws_restJson1.ts rename to clients/client-kinesis-video/src/protocols/Aws_restJson1.ts diff --git a/clients/client-kinesis-video/src/runtimeConfig.browser.ts b/clients/client-kinesis-video/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..59d35a240dd8 --- /dev/null +++ b/clients/client-kinesis-video/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisVideoClientConfig } from "./KinesisVideoClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video/runtimeConfig.native.ts b/clients/client-kinesis-video/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis-video/runtimeConfig.native.ts rename to clients/client-kinesis-video/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis-video/runtimeConfig.shared.ts b/clients/client-kinesis-video/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis-video/runtimeConfig.shared.ts rename to clients/client-kinesis-video/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis-video/src/runtimeConfig.ts b/clients/client-kinesis-video/src/runtimeConfig.ts new file mode 100644 index 000000000000..c7bd9d80652d --- /dev/null +++ b/clients/client-kinesis-video/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisVideoClientConfig } from "./KinesisVideoClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis-video/tsconfig.es.json b/clients/client-kinesis-video/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis-video/tsconfig.es.json +++ b/clients/client-kinesis-video/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis-video/tsconfig.json b/clients/client-kinesis-video/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis-video/tsconfig.json +++ b/clients/client-kinesis-video/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis-video/tsconfig.types.json b/clients/client-kinesis-video/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis-video/tsconfig.types.json +++ b/clients/client-kinesis-video/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kinesis/.gitignore b/clients/client-kinesis/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kinesis/.gitignore +++ b/clients/client-kinesis/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kinesis/package.json b/clients/client-kinesis/package.json index 5239aafef075..aeb47cf9dad4 100644 --- a/clients/client-kinesis/package.json +++ b/clients/client-kinesis/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis", "repository": { "type": "git", diff --git a/clients/client-kinesis/runtimeConfig.browser.ts b/clients/client-kinesis/runtimeConfig.browser.ts deleted file mode 100644 index 9a8cb778cade..000000000000 --- a/clients/client-kinesis/runtimeConfig.browser.ts +++ /dev/null @@ -1,42 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KinesisClientConfig } from "./KinesisClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis/runtimeConfig.ts b/clients/client-kinesis/runtimeConfig.ts deleted file mode 100644 index 9e60651d92e3..000000000000 --- a/clients/client-kinesis/runtimeConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KinesisClientConfig } from "./KinesisClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KinesisClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kinesis/Kinesis.ts b/clients/client-kinesis/src/Kinesis.ts similarity index 100% rename from clients/client-kinesis/Kinesis.ts rename to clients/client-kinesis/src/Kinesis.ts diff --git a/clients/client-kinesis/KinesisClient.ts b/clients/client-kinesis/src/KinesisClient.ts similarity index 100% rename from clients/client-kinesis/KinesisClient.ts rename to clients/client-kinesis/src/KinesisClient.ts diff --git a/clients/client-kinesis/commands/AddTagsToStreamCommand.ts b/clients/client-kinesis/src/commands/AddTagsToStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/AddTagsToStreamCommand.ts rename to clients/client-kinesis/src/commands/AddTagsToStreamCommand.ts diff --git a/clients/client-kinesis/commands/CreateStreamCommand.ts b/clients/client-kinesis/src/commands/CreateStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/CreateStreamCommand.ts rename to clients/client-kinesis/src/commands/CreateStreamCommand.ts diff --git a/clients/client-kinesis/commands/DecreaseStreamRetentionPeriodCommand.ts b/clients/client-kinesis/src/commands/DecreaseStreamRetentionPeriodCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DecreaseStreamRetentionPeriodCommand.ts rename to clients/client-kinesis/src/commands/DecreaseStreamRetentionPeriodCommand.ts diff --git a/clients/client-kinesis/commands/DeleteStreamCommand.ts b/clients/client-kinesis/src/commands/DeleteStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DeleteStreamCommand.ts rename to clients/client-kinesis/src/commands/DeleteStreamCommand.ts diff --git a/clients/client-kinesis/commands/DeregisterStreamConsumerCommand.ts b/clients/client-kinesis/src/commands/DeregisterStreamConsumerCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DeregisterStreamConsumerCommand.ts rename to clients/client-kinesis/src/commands/DeregisterStreamConsumerCommand.ts diff --git a/clients/client-kinesis/commands/DescribeLimitsCommand.ts b/clients/client-kinesis/src/commands/DescribeLimitsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DescribeLimitsCommand.ts rename to clients/client-kinesis/src/commands/DescribeLimitsCommand.ts diff --git a/clients/client-kinesis/commands/DescribeStreamCommand.ts b/clients/client-kinesis/src/commands/DescribeStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DescribeStreamCommand.ts rename to clients/client-kinesis/src/commands/DescribeStreamCommand.ts diff --git a/clients/client-kinesis/commands/DescribeStreamConsumerCommand.ts b/clients/client-kinesis/src/commands/DescribeStreamConsumerCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DescribeStreamConsumerCommand.ts rename to clients/client-kinesis/src/commands/DescribeStreamConsumerCommand.ts diff --git a/clients/client-kinesis/commands/DescribeStreamSummaryCommand.ts b/clients/client-kinesis/src/commands/DescribeStreamSummaryCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DescribeStreamSummaryCommand.ts rename to clients/client-kinesis/src/commands/DescribeStreamSummaryCommand.ts diff --git a/clients/client-kinesis/commands/DisableEnhancedMonitoringCommand.ts b/clients/client-kinesis/src/commands/DisableEnhancedMonitoringCommand.ts similarity index 100% rename from clients/client-kinesis/commands/DisableEnhancedMonitoringCommand.ts rename to clients/client-kinesis/src/commands/DisableEnhancedMonitoringCommand.ts diff --git a/clients/client-kinesis/commands/EnableEnhancedMonitoringCommand.ts b/clients/client-kinesis/src/commands/EnableEnhancedMonitoringCommand.ts similarity index 100% rename from clients/client-kinesis/commands/EnableEnhancedMonitoringCommand.ts rename to clients/client-kinesis/src/commands/EnableEnhancedMonitoringCommand.ts diff --git a/clients/client-kinesis/commands/GetRecordsCommand.ts b/clients/client-kinesis/src/commands/GetRecordsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/GetRecordsCommand.ts rename to clients/client-kinesis/src/commands/GetRecordsCommand.ts diff --git a/clients/client-kinesis/commands/GetShardIteratorCommand.ts b/clients/client-kinesis/src/commands/GetShardIteratorCommand.ts similarity index 100% rename from clients/client-kinesis/commands/GetShardIteratorCommand.ts rename to clients/client-kinesis/src/commands/GetShardIteratorCommand.ts diff --git a/clients/client-kinesis/commands/IncreaseStreamRetentionPeriodCommand.ts b/clients/client-kinesis/src/commands/IncreaseStreamRetentionPeriodCommand.ts similarity index 100% rename from clients/client-kinesis/commands/IncreaseStreamRetentionPeriodCommand.ts rename to clients/client-kinesis/src/commands/IncreaseStreamRetentionPeriodCommand.ts diff --git a/clients/client-kinesis/commands/ListShardsCommand.ts b/clients/client-kinesis/src/commands/ListShardsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/ListShardsCommand.ts rename to clients/client-kinesis/src/commands/ListShardsCommand.ts diff --git a/clients/client-kinesis/commands/ListStreamConsumersCommand.ts b/clients/client-kinesis/src/commands/ListStreamConsumersCommand.ts similarity index 100% rename from clients/client-kinesis/commands/ListStreamConsumersCommand.ts rename to clients/client-kinesis/src/commands/ListStreamConsumersCommand.ts diff --git a/clients/client-kinesis/commands/ListStreamsCommand.ts b/clients/client-kinesis/src/commands/ListStreamsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/ListStreamsCommand.ts rename to clients/client-kinesis/src/commands/ListStreamsCommand.ts diff --git a/clients/client-kinesis/commands/ListTagsForStreamCommand.ts b/clients/client-kinesis/src/commands/ListTagsForStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/ListTagsForStreamCommand.ts rename to clients/client-kinesis/src/commands/ListTagsForStreamCommand.ts diff --git a/clients/client-kinesis/commands/MergeShardsCommand.ts b/clients/client-kinesis/src/commands/MergeShardsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/MergeShardsCommand.ts rename to clients/client-kinesis/src/commands/MergeShardsCommand.ts diff --git a/clients/client-kinesis/commands/PutRecordCommand.ts b/clients/client-kinesis/src/commands/PutRecordCommand.ts similarity index 100% rename from clients/client-kinesis/commands/PutRecordCommand.ts rename to clients/client-kinesis/src/commands/PutRecordCommand.ts diff --git a/clients/client-kinesis/commands/PutRecordsCommand.ts b/clients/client-kinesis/src/commands/PutRecordsCommand.ts similarity index 100% rename from clients/client-kinesis/commands/PutRecordsCommand.ts rename to clients/client-kinesis/src/commands/PutRecordsCommand.ts diff --git a/clients/client-kinesis/commands/RegisterStreamConsumerCommand.ts b/clients/client-kinesis/src/commands/RegisterStreamConsumerCommand.ts similarity index 100% rename from clients/client-kinesis/commands/RegisterStreamConsumerCommand.ts rename to clients/client-kinesis/src/commands/RegisterStreamConsumerCommand.ts diff --git a/clients/client-kinesis/commands/RemoveTagsFromStreamCommand.ts b/clients/client-kinesis/src/commands/RemoveTagsFromStreamCommand.ts similarity index 100% rename from clients/client-kinesis/commands/RemoveTagsFromStreamCommand.ts rename to clients/client-kinesis/src/commands/RemoveTagsFromStreamCommand.ts diff --git a/clients/client-kinesis/commands/SplitShardCommand.ts b/clients/client-kinesis/src/commands/SplitShardCommand.ts similarity index 100% rename from clients/client-kinesis/commands/SplitShardCommand.ts rename to clients/client-kinesis/src/commands/SplitShardCommand.ts diff --git a/clients/client-kinesis/commands/StartStreamEncryptionCommand.ts b/clients/client-kinesis/src/commands/StartStreamEncryptionCommand.ts similarity index 100% rename from clients/client-kinesis/commands/StartStreamEncryptionCommand.ts rename to clients/client-kinesis/src/commands/StartStreamEncryptionCommand.ts diff --git a/clients/client-kinesis/commands/StopStreamEncryptionCommand.ts b/clients/client-kinesis/src/commands/StopStreamEncryptionCommand.ts similarity index 100% rename from clients/client-kinesis/commands/StopStreamEncryptionCommand.ts rename to clients/client-kinesis/src/commands/StopStreamEncryptionCommand.ts diff --git a/clients/client-kinesis/commands/SubscribeToShardCommand.ts b/clients/client-kinesis/src/commands/SubscribeToShardCommand.ts similarity index 100% rename from clients/client-kinesis/commands/SubscribeToShardCommand.ts rename to clients/client-kinesis/src/commands/SubscribeToShardCommand.ts diff --git a/clients/client-kinesis/commands/UpdateShardCountCommand.ts b/clients/client-kinesis/src/commands/UpdateShardCountCommand.ts similarity index 100% rename from clients/client-kinesis/commands/UpdateShardCountCommand.ts rename to clients/client-kinesis/src/commands/UpdateShardCountCommand.ts diff --git a/clients/client-kinesis/endpoints.ts b/clients/client-kinesis/src/endpoints.ts similarity index 100% rename from clients/client-kinesis/endpoints.ts rename to clients/client-kinesis/src/endpoints.ts diff --git a/clients/client-kinesis/index.ts b/clients/client-kinesis/src/index.ts similarity index 100% rename from clients/client-kinesis/index.ts rename to clients/client-kinesis/src/index.ts diff --git a/clients/client-kinesis/models/index.ts b/clients/client-kinesis/src/models/index.ts similarity index 100% rename from clients/client-kinesis/models/index.ts rename to clients/client-kinesis/src/models/index.ts diff --git a/clients/client-kinesis/models/models_0.ts b/clients/client-kinesis/src/models/models_0.ts similarity index 100% rename from clients/client-kinesis/models/models_0.ts rename to clients/client-kinesis/src/models/models_0.ts diff --git a/clients/client-kinesis/pagination/Interfaces.ts b/clients/client-kinesis/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kinesis/pagination/Interfaces.ts rename to clients/client-kinesis/src/pagination/Interfaces.ts diff --git a/clients/client-kinesis/pagination/ListStreamConsumersPaginator.ts b/clients/client-kinesis/src/pagination/ListStreamConsumersPaginator.ts similarity index 100% rename from clients/client-kinesis/pagination/ListStreamConsumersPaginator.ts rename to clients/client-kinesis/src/pagination/ListStreamConsumersPaginator.ts diff --git a/clients/client-kinesis/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-kinesis/protocols/Aws_json1_1.ts rename to clients/client-kinesis/src/protocols/Aws_json1_1.ts diff --git a/clients/client-kinesis/src/runtimeConfig.browser.ts b/clients/client-kinesis/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..8b30d35a501d --- /dev/null +++ b/clients/client-kinesis/src/runtimeConfig.browser.ts @@ -0,0 +1,43 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KinesisClientConfig } from "./KinesisClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis/runtimeConfig.native.ts b/clients/client-kinesis/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kinesis/runtimeConfig.native.ts rename to clients/client-kinesis/src/runtimeConfig.native.ts diff --git a/clients/client-kinesis/runtimeConfig.shared.ts b/clients/client-kinesis/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kinesis/runtimeConfig.shared.ts rename to clients/client-kinesis/src/runtimeConfig.shared.ts diff --git a/clients/client-kinesis/src/runtimeConfig.ts b/clients/client-kinesis/src/runtimeConfig.ts new file mode 100644 index 000000000000..1e4db5ebd3a2 --- /dev/null +++ b/clients/client-kinesis/src/runtimeConfig.ts @@ -0,0 +1,48 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KinesisClientConfig } from "./KinesisClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KinesisClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kinesis/waiters/waitForStreamExists.ts b/clients/client-kinesis/src/waiters/waitForStreamExists.ts similarity index 100% rename from clients/client-kinesis/waiters/waitForStreamExists.ts rename to clients/client-kinesis/src/waiters/waitForStreamExists.ts diff --git a/clients/client-kinesis/waiters/waitForStreamNotExists.ts b/clients/client-kinesis/src/waiters/waitForStreamNotExists.ts similarity index 100% rename from clients/client-kinesis/waiters/waitForStreamNotExists.ts rename to clients/client-kinesis/src/waiters/waitForStreamNotExists.ts diff --git a/clients/client-kinesis/tsconfig.es.json b/clients/client-kinesis/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kinesis/tsconfig.es.json +++ b/clients/client-kinesis/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kinesis/tsconfig.json b/clients/client-kinesis/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kinesis/tsconfig.json +++ b/clients/client-kinesis/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kinesis/tsconfig.types.json b/clients/client-kinesis/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kinesis/tsconfig.types.json +++ b/clients/client-kinesis/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-kms/.gitignore b/clients/client-kms/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-kms/.gitignore +++ b/clients/client-kms/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-kms/package.json b/clients/client-kms/package.json index 2405b73a96cf..0ad9cd02561b 100644 --- a/clients/client-kms/package.json +++ b/clients/client-kms/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kms", "repository": { "type": "git", diff --git a/clients/client-kms/runtimeConfig.browser.ts b/clients/client-kms/runtimeConfig.browser.ts deleted file mode 100644 index 55e8910a2601..000000000000 --- a/clients/client-kms/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { KMSClientConfig } from "./KMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KMSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kms/runtimeConfig.ts b/clients/client-kms/runtimeConfig.ts deleted file mode 100644 index fe59d997c2d0..000000000000 --- a/clients/client-kms/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { KMSClientConfig } from "./KMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: KMSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-kms/KMS.ts b/clients/client-kms/src/KMS.ts similarity index 100% rename from clients/client-kms/KMS.ts rename to clients/client-kms/src/KMS.ts diff --git a/clients/client-kms/KMSClient.ts b/clients/client-kms/src/KMSClient.ts similarity index 100% rename from clients/client-kms/KMSClient.ts rename to clients/client-kms/src/KMSClient.ts diff --git a/clients/client-kms/commands/CancelKeyDeletionCommand.ts b/clients/client-kms/src/commands/CancelKeyDeletionCommand.ts similarity index 100% rename from clients/client-kms/commands/CancelKeyDeletionCommand.ts rename to clients/client-kms/src/commands/CancelKeyDeletionCommand.ts diff --git a/clients/client-kms/commands/ConnectCustomKeyStoreCommand.ts b/clients/client-kms/src/commands/ConnectCustomKeyStoreCommand.ts similarity index 100% rename from clients/client-kms/commands/ConnectCustomKeyStoreCommand.ts rename to clients/client-kms/src/commands/ConnectCustomKeyStoreCommand.ts diff --git a/clients/client-kms/commands/CreateAliasCommand.ts b/clients/client-kms/src/commands/CreateAliasCommand.ts similarity index 100% rename from clients/client-kms/commands/CreateAliasCommand.ts rename to clients/client-kms/src/commands/CreateAliasCommand.ts diff --git a/clients/client-kms/commands/CreateCustomKeyStoreCommand.ts b/clients/client-kms/src/commands/CreateCustomKeyStoreCommand.ts similarity index 100% rename from clients/client-kms/commands/CreateCustomKeyStoreCommand.ts rename to clients/client-kms/src/commands/CreateCustomKeyStoreCommand.ts diff --git a/clients/client-kms/commands/CreateGrantCommand.ts b/clients/client-kms/src/commands/CreateGrantCommand.ts similarity index 100% rename from clients/client-kms/commands/CreateGrantCommand.ts rename to clients/client-kms/src/commands/CreateGrantCommand.ts diff --git a/clients/client-kms/commands/CreateKeyCommand.ts b/clients/client-kms/src/commands/CreateKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/CreateKeyCommand.ts rename to clients/client-kms/src/commands/CreateKeyCommand.ts diff --git a/clients/client-kms/commands/DecryptCommand.ts b/clients/client-kms/src/commands/DecryptCommand.ts similarity index 100% rename from clients/client-kms/commands/DecryptCommand.ts rename to clients/client-kms/src/commands/DecryptCommand.ts diff --git a/clients/client-kms/commands/DeleteAliasCommand.ts b/clients/client-kms/src/commands/DeleteAliasCommand.ts similarity index 100% rename from clients/client-kms/commands/DeleteAliasCommand.ts rename to clients/client-kms/src/commands/DeleteAliasCommand.ts diff --git a/clients/client-kms/commands/DeleteCustomKeyStoreCommand.ts b/clients/client-kms/src/commands/DeleteCustomKeyStoreCommand.ts similarity index 100% rename from clients/client-kms/commands/DeleteCustomKeyStoreCommand.ts rename to clients/client-kms/src/commands/DeleteCustomKeyStoreCommand.ts diff --git a/clients/client-kms/commands/DeleteImportedKeyMaterialCommand.ts b/clients/client-kms/src/commands/DeleteImportedKeyMaterialCommand.ts similarity index 100% rename from clients/client-kms/commands/DeleteImportedKeyMaterialCommand.ts rename to clients/client-kms/src/commands/DeleteImportedKeyMaterialCommand.ts diff --git a/clients/client-kms/commands/DescribeCustomKeyStoresCommand.ts b/clients/client-kms/src/commands/DescribeCustomKeyStoresCommand.ts similarity index 100% rename from clients/client-kms/commands/DescribeCustomKeyStoresCommand.ts rename to clients/client-kms/src/commands/DescribeCustomKeyStoresCommand.ts diff --git a/clients/client-kms/commands/DescribeKeyCommand.ts b/clients/client-kms/src/commands/DescribeKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/DescribeKeyCommand.ts rename to clients/client-kms/src/commands/DescribeKeyCommand.ts diff --git a/clients/client-kms/commands/DisableKeyCommand.ts b/clients/client-kms/src/commands/DisableKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/DisableKeyCommand.ts rename to clients/client-kms/src/commands/DisableKeyCommand.ts diff --git a/clients/client-kms/commands/DisableKeyRotationCommand.ts b/clients/client-kms/src/commands/DisableKeyRotationCommand.ts similarity index 100% rename from clients/client-kms/commands/DisableKeyRotationCommand.ts rename to clients/client-kms/src/commands/DisableKeyRotationCommand.ts diff --git a/clients/client-kms/commands/DisconnectCustomKeyStoreCommand.ts b/clients/client-kms/src/commands/DisconnectCustomKeyStoreCommand.ts similarity index 100% rename from clients/client-kms/commands/DisconnectCustomKeyStoreCommand.ts rename to clients/client-kms/src/commands/DisconnectCustomKeyStoreCommand.ts diff --git a/clients/client-kms/commands/EnableKeyCommand.ts b/clients/client-kms/src/commands/EnableKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/EnableKeyCommand.ts rename to clients/client-kms/src/commands/EnableKeyCommand.ts diff --git a/clients/client-kms/commands/EnableKeyRotationCommand.ts b/clients/client-kms/src/commands/EnableKeyRotationCommand.ts similarity index 100% rename from clients/client-kms/commands/EnableKeyRotationCommand.ts rename to clients/client-kms/src/commands/EnableKeyRotationCommand.ts diff --git a/clients/client-kms/commands/EncryptCommand.ts b/clients/client-kms/src/commands/EncryptCommand.ts similarity index 100% rename from clients/client-kms/commands/EncryptCommand.ts rename to clients/client-kms/src/commands/EncryptCommand.ts diff --git a/clients/client-kms/commands/GenerateDataKeyCommand.ts b/clients/client-kms/src/commands/GenerateDataKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/GenerateDataKeyCommand.ts rename to clients/client-kms/src/commands/GenerateDataKeyCommand.ts diff --git a/clients/client-kms/commands/GenerateDataKeyPairCommand.ts b/clients/client-kms/src/commands/GenerateDataKeyPairCommand.ts similarity index 100% rename from clients/client-kms/commands/GenerateDataKeyPairCommand.ts rename to clients/client-kms/src/commands/GenerateDataKeyPairCommand.ts diff --git a/clients/client-kms/commands/GenerateDataKeyPairWithoutPlaintextCommand.ts b/clients/client-kms/src/commands/GenerateDataKeyPairWithoutPlaintextCommand.ts similarity index 100% rename from clients/client-kms/commands/GenerateDataKeyPairWithoutPlaintextCommand.ts rename to clients/client-kms/src/commands/GenerateDataKeyPairWithoutPlaintextCommand.ts diff --git a/clients/client-kms/commands/GenerateDataKeyWithoutPlaintextCommand.ts b/clients/client-kms/src/commands/GenerateDataKeyWithoutPlaintextCommand.ts similarity index 100% rename from clients/client-kms/commands/GenerateDataKeyWithoutPlaintextCommand.ts rename to clients/client-kms/src/commands/GenerateDataKeyWithoutPlaintextCommand.ts diff --git a/clients/client-kms/commands/GenerateRandomCommand.ts b/clients/client-kms/src/commands/GenerateRandomCommand.ts similarity index 100% rename from clients/client-kms/commands/GenerateRandomCommand.ts rename to clients/client-kms/src/commands/GenerateRandomCommand.ts diff --git a/clients/client-kms/commands/GetKeyPolicyCommand.ts b/clients/client-kms/src/commands/GetKeyPolicyCommand.ts similarity index 100% rename from clients/client-kms/commands/GetKeyPolicyCommand.ts rename to clients/client-kms/src/commands/GetKeyPolicyCommand.ts diff --git a/clients/client-kms/commands/GetKeyRotationStatusCommand.ts b/clients/client-kms/src/commands/GetKeyRotationStatusCommand.ts similarity index 100% rename from clients/client-kms/commands/GetKeyRotationStatusCommand.ts rename to clients/client-kms/src/commands/GetKeyRotationStatusCommand.ts diff --git a/clients/client-kms/commands/GetParametersForImportCommand.ts b/clients/client-kms/src/commands/GetParametersForImportCommand.ts similarity index 100% rename from clients/client-kms/commands/GetParametersForImportCommand.ts rename to clients/client-kms/src/commands/GetParametersForImportCommand.ts diff --git a/clients/client-kms/commands/GetPublicKeyCommand.ts b/clients/client-kms/src/commands/GetPublicKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/GetPublicKeyCommand.ts rename to clients/client-kms/src/commands/GetPublicKeyCommand.ts diff --git a/clients/client-kms/commands/ImportKeyMaterialCommand.ts b/clients/client-kms/src/commands/ImportKeyMaterialCommand.ts similarity index 100% rename from clients/client-kms/commands/ImportKeyMaterialCommand.ts rename to clients/client-kms/src/commands/ImportKeyMaterialCommand.ts diff --git a/clients/client-kms/commands/ListAliasesCommand.ts b/clients/client-kms/src/commands/ListAliasesCommand.ts similarity index 100% rename from clients/client-kms/commands/ListAliasesCommand.ts rename to clients/client-kms/src/commands/ListAliasesCommand.ts diff --git a/clients/client-kms/commands/ListGrantsCommand.ts b/clients/client-kms/src/commands/ListGrantsCommand.ts similarity index 100% rename from clients/client-kms/commands/ListGrantsCommand.ts rename to clients/client-kms/src/commands/ListGrantsCommand.ts diff --git a/clients/client-kms/commands/ListKeyPoliciesCommand.ts b/clients/client-kms/src/commands/ListKeyPoliciesCommand.ts similarity index 100% rename from clients/client-kms/commands/ListKeyPoliciesCommand.ts rename to clients/client-kms/src/commands/ListKeyPoliciesCommand.ts diff --git a/clients/client-kms/commands/ListKeysCommand.ts b/clients/client-kms/src/commands/ListKeysCommand.ts similarity index 100% rename from clients/client-kms/commands/ListKeysCommand.ts rename to clients/client-kms/src/commands/ListKeysCommand.ts diff --git a/clients/client-kms/commands/ListResourceTagsCommand.ts b/clients/client-kms/src/commands/ListResourceTagsCommand.ts similarity index 100% rename from clients/client-kms/commands/ListResourceTagsCommand.ts rename to clients/client-kms/src/commands/ListResourceTagsCommand.ts diff --git a/clients/client-kms/commands/ListRetirableGrantsCommand.ts b/clients/client-kms/src/commands/ListRetirableGrantsCommand.ts similarity index 100% rename from clients/client-kms/commands/ListRetirableGrantsCommand.ts rename to clients/client-kms/src/commands/ListRetirableGrantsCommand.ts diff --git a/clients/client-kms/commands/PutKeyPolicyCommand.ts b/clients/client-kms/src/commands/PutKeyPolicyCommand.ts similarity index 100% rename from clients/client-kms/commands/PutKeyPolicyCommand.ts rename to clients/client-kms/src/commands/PutKeyPolicyCommand.ts diff --git a/clients/client-kms/commands/ReEncryptCommand.ts b/clients/client-kms/src/commands/ReEncryptCommand.ts similarity index 100% rename from clients/client-kms/commands/ReEncryptCommand.ts rename to clients/client-kms/src/commands/ReEncryptCommand.ts diff --git a/clients/client-kms/commands/ReplicateKeyCommand.ts b/clients/client-kms/src/commands/ReplicateKeyCommand.ts similarity index 100% rename from clients/client-kms/commands/ReplicateKeyCommand.ts rename to clients/client-kms/src/commands/ReplicateKeyCommand.ts diff --git a/clients/client-kms/commands/RetireGrantCommand.ts b/clients/client-kms/src/commands/RetireGrantCommand.ts similarity index 100% rename from clients/client-kms/commands/RetireGrantCommand.ts rename to clients/client-kms/src/commands/RetireGrantCommand.ts diff --git a/clients/client-kms/commands/RevokeGrantCommand.ts b/clients/client-kms/src/commands/RevokeGrantCommand.ts similarity index 100% rename from clients/client-kms/commands/RevokeGrantCommand.ts rename to clients/client-kms/src/commands/RevokeGrantCommand.ts diff --git a/clients/client-kms/commands/ScheduleKeyDeletionCommand.ts b/clients/client-kms/src/commands/ScheduleKeyDeletionCommand.ts similarity index 100% rename from clients/client-kms/commands/ScheduleKeyDeletionCommand.ts rename to clients/client-kms/src/commands/ScheduleKeyDeletionCommand.ts diff --git a/clients/client-kms/commands/SignCommand.ts b/clients/client-kms/src/commands/SignCommand.ts similarity index 100% rename from clients/client-kms/commands/SignCommand.ts rename to clients/client-kms/src/commands/SignCommand.ts diff --git a/clients/client-kms/commands/TagResourceCommand.ts b/clients/client-kms/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-kms/commands/TagResourceCommand.ts rename to clients/client-kms/src/commands/TagResourceCommand.ts diff --git a/clients/client-kms/commands/UntagResourceCommand.ts b/clients/client-kms/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-kms/commands/UntagResourceCommand.ts rename to clients/client-kms/src/commands/UntagResourceCommand.ts diff --git a/clients/client-kms/commands/UpdateAliasCommand.ts b/clients/client-kms/src/commands/UpdateAliasCommand.ts similarity index 100% rename from clients/client-kms/commands/UpdateAliasCommand.ts rename to clients/client-kms/src/commands/UpdateAliasCommand.ts diff --git a/clients/client-kms/commands/UpdateCustomKeyStoreCommand.ts b/clients/client-kms/src/commands/UpdateCustomKeyStoreCommand.ts similarity index 100% rename from clients/client-kms/commands/UpdateCustomKeyStoreCommand.ts rename to clients/client-kms/src/commands/UpdateCustomKeyStoreCommand.ts diff --git a/clients/client-kms/commands/UpdateKeyDescriptionCommand.ts b/clients/client-kms/src/commands/UpdateKeyDescriptionCommand.ts similarity index 100% rename from clients/client-kms/commands/UpdateKeyDescriptionCommand.ts rename to clients/client-kms/src/commands/UpdateKeyDescriptionCommand.ts diff --git a/clients/client-kms/commands/UpdatePrimaryRegionCommand.ts b/clients/client-kms/src/commands/UpdatePrimaryRegionCommand.ts similarity index 100% rename from clients/client-kms/commands/UpdatePrimaryRegionCommand.ts rename to clients/client-kms/src/commands/UpdatePrimaryRegionCommand.ts diff --git a/clients/client-kms/commands/VerifyCommand.ts b/clients/client-kms/src/commands/VerifyCommand.ts similarity index 100% rename from clients/client-kms/commands/VerifyCommand.ts rename to clients/client-kms/src/commands/VerifyCommand.ts diff --git a/clients/client-kms/endpoints.ts b/clients/client-kms/src/endpoints.ts similarity index 100% rename from clients/client-kms/endpoints.ts rename to clients/client-kms/src/endpoints.ts diff --git a/clients/client-kms/index.ts b/clients/client-kms/src/index.ts similarity index 100% rename from clients/client-kms/index.ts rename to clients/client-kms/src/index.ts diff --git a/clients/client-kms/models/index.ts b/clients/client-kms/src/models/index.ts similarity index 100% rename from clients/client-kms/models/index.ts rename to clients/client-kms/src/models/index.ts diff --git a/clients/client-kms/models/models_0.ts b/clients/client-kms/src/models/models_0.ts similarity index 100% rename from clients/client-kms/models/models_0.ts rename to clients/client-kms/src/models/models_0.ts diff --git a/clients/client-kms/pagination/Interfaces.ts b/clients/client-kms/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-kms/pagination/Interfaces.ts rename to clients/client-kms/src/pagination/Interfaces.ts diff --git a/clients/client-kms/pagination/ListAliasesPaginator.ts b/clients/client-kms/src/pagination/ListAliasesPaginator.ts similarity index 100% rename from clients/client-kms/pagination/ListAliasesPaginator.ts rename to clients/client-kms/src/pagination/ListAliasesPaginator.ts diff --git a/clients/client-kms/pagination/ListGrantsPaginator.ts b/clients/client-kms/src/pagination/ListGrantsPaginator.ts similarity index 100% rename from clients/client-kms/pagination/ListGrantsPaginator.ts rename to clients/client-kms/src/pagination/ListGrantsPaginator.ts diff --git a/clients/client-kms/pagination/ListKeyPoliciesPaginator.ts b/clients/client-kms/src/pagination/ListKeyPoliciesPaginator.ts similarity index 100% rename from clients/client-kms/pagination/ListKeyPoliciesPaginator.ts rename to clients/client-kms/src/pagination/ListKeyPoliciesPaginator.ts diff --git a/clients/client-kms/pagination/ListKeysPaginator.ts b/clients/client-kms/src/pagination/ListKeysPaginator.ts similarity index 100% rename from clients/client-kms/pagination/ListKeysPaginator.ts rename to clients/client-kms/src/pagination/ListKeysPaginator.ts diff --git a/clients/client-kms/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-kms/protocols/Aws_json1_1.ts rename to clients/client-kms/src/protocols/Aws_json1_1.ts diff --git a/clients/client-kms/src/runtimeConfig.browser.ts b/clients/client-kms/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f30cff617644 --- /dev/null +++ b/clients/client-kms/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { KMSClientConfig } from "./KMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KMSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kms/runtimeConfig.native.ts b/clients/client-kms/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-kms/runtimeConfig.native.ts rename to clients/client-kms/src/runtimeConfig.native.ts diff --git a/clients/client-kms/runtimeConfig.shared.ts b/clients/client-kms/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-kms/runtimeConfig.shared.ts rename to clients/client-kms/src/runtimeConfig.shared.ts diff --git a/clients/client-kms/src/runtimeConfig.ts b/clients/client-kms/src/runtimeConfig.ts new file mode 100644 index 000000000000..371a6af8d3aa --- /dev/null +++ b/clients/client-kms/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { KMSClientConfig } from "./KMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: KMSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-kms/tsconfig.es.json b/clients/client-kms/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-kms/tsconfig.es.json +++ b/clients/client-kms/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-kms/tsconfig.json b/clients/client-kms/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-kms/tsconfig.json +++ b/clients/client-kms/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-kms/tsconfig.types.json b/clients/client-kms/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-kms/tsconfig.types.json +++ b/clients/client-kms/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lakeformation/.gitignore b/clients/client-lakeformation/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lakeformation/.gitignore +++ b/clients/client-lakeformation/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lakeformation/package.json b/clients/client-lakeformation/package.json index 382b9c91b044..fb3e9f886c5f 100644 --- a/clients/client-lakeformation/package.json +++ b/clients/client-lakeformation/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lakeformation", "repository": { "type": "git", diff --git a/clients/client-lakeformation/runtimeConfig.browser.ts b/clients/client-lakeformation/runtimeConfig.browser.ts deleted file mode 100644 index 76281b5f2539..000000000000 --- a/clients/client-lakeformation/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LakeFormationClientConfig } from "./LakeFormationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LakeFormationClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lakeformation/runtimeConfig.ts b/clients/client-lakeformation/runtimeConfig.ts deleted file mode 100644 index c9584fde6f2c..000000000000 --- a/clients/client-lakeformation/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LakeFormationClientConfig } from "./LakeFormationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LakeFormationClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lakeformation/LakeFormation.ts b/clients/client-lakeformation/src/LakeFormation.ts similarity index 100% rename from clients/client-lakeformation/LakeFormation.ts rename to clients/client-lakeformation/src/LakeFormation.ts diff --git a/clients/client-lakeformation/LakeFormationClient.ts b/clients/client-lakeformation/src/LakeFormationClient.ts similarity index 100% rename from clients/client-lakeformation/LakeFormationClient.ts rename to clients/client-lakeformation/src/LakeFormationClient.ts diff --git a/clients/client-lakeformation/commands/AddLFTagsToResourceCommand.ts b/clients/client-lakeformation/src/commands/AddLFTagsToResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/AddLFTagsToResourceCommand.ts rename to clients/client-lakeformation/src/commands/AddLFTagsToResourceCommand.ts diff --git a/clients/client-lakeformation/commands/BatchGrantPermissionsCommand.ts b/clients/client-lakeformation/src/commands/BatchGrantPermissionsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/BatchGrantPermissionsCommand.ts rename to clients/client-lakeformation/src/commands/BatchGrantPermissionsCommand.ts diff --git a/clients/client-lakeformation/commands/BatchRevokePermissionsCommand.ts b/clients/client-lakeformation/src/commands/BatchRevokePermissionsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/BatchRevokePermissionsCommand.ts rename to clients/client-lakeformation/src/commands/BatchRevokePermissionsCommand.ts diff --git a/clients/client-lakeformation/commands/CreateLFTagCommand.ts b/clients/client-lakeformation/src/commands/CreateLFTagCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/CreateLFTagCommand.ts rename to clients/client-lakeformation/src/commands/CreateLFTagCommand.ts diff --git a/clients/client-lakeformation/commands/DeleteLFTagCommand.ts b/clients/client-lakeformation/src/commands/DeleteLFTagCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/DeleteLFTagCommand.ts rename to clients/client-lakeformation/src/commands/DeleteLFTagCommand.ts diff --git a/clients/client-lakeformation/commands/DeregisterResourceCommand.ts b/clients/client-lakeformation/src/commands/DeregisterResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/DeregisterResourceCommand.ts rename to clients/client-lakeformation/src/commands/DeregisterResourceCommand.ts diff --git a/clients/client-lakeformation/commands/DescribeResourceCommand.ts b/clients/client-lakeformation/src/commands/DescribeResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/DescribeResourceCommand.ts rename to clients/client-lakeformation/src/commands/DescribeResourceCommand.ts diff --git a/clients/client-lakeformation/commands/GetDataLakeSettingsCommand.ts b/clients/client-lakeformation/src/commands/GetDataLakeSettingsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/GetDataLakeSettingsCommand.ts rename to clients/client-lakeformation/src/commands/GetDataLakeSettingsCommand.ts diff --git a/clients/client-lakeformation/commands/GetEffectivePermissionsForPathCommand.ts b/clients/client-lakeformation/src/commands/GetEffectivePermissionsForPathCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/GetEffectivePermissionsForPathCommand.ts rename to clients/client-lakeformation/src/commands/GetEffectivePermissionsForPathCommand.ts diff --git a/clients/client-lakeformation/commands/GetLFTagCommand.ts b/clients/client-lakeformation/src/commands/GetLFTagCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/GetLFTagCommand.ts rename to clients/client-lakeformation/src/commands/GetLFTagCommand.ts diff --git a/clients/client-lakeformation/commands/GetResourceLFTagsCommand.ts b/clients/client-lakeformation/src/commands/GetResourceLFTagsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/GetResourceLFTagsCommand.ts rename to clients/client-lakeformation/src/commands/GetResourceLFTagsCommand.ts diff --git a/clients/client-lakeformation/commands/GrantPermissionsCommand.ts b/clients/client-lakeformation/src/commands/GrantPermissionsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/GrantPermissionsCommand.ts rename to clients/client-lakeformation/src/commands/GrantPermissionsCommand.ts diff --git a/clients/client-lakeformation/commands/ListLFTagsCommand.ts b/clients/client-lakeformation/src/commands/ListLFTagsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/ListLFTagsCommand.ts rename to clients/client-lakeformation/src/commands/ListLFTagsCommand.ts diff --git a/clients/client-lakeformation/commands/ListPermissionsCommand.ts b/clients/client-lakeformation/src/commands/ListPermissionsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/ListPermissionsCommand.ts rename to clients/client-lakeformation/src/commands/ListPermissionsCommand.ts diff --git a/clients/client-lakeformation/commands/ListResourcesCommand.ts b/clients/client-lakeformation/src/commands/ListResourcesCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/ListResourcesCommand.ts rename to clients/client-lakeformation/src/commands/ListResourcesCommand.ts diff --git a/clients/client-lakeformation/commands/PutDataLakeSettingsCommand.ts b/clients/client-lakeformation/src/commands/PutDataLakeSettingsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/PutDataLakeSettingsCommand.ts rename to clients/client-lakeformation/src/commands/PutDataLakeSettingsCommand.ts diff --git a/clients/client-lakeformation/commands/RegisterResourceCommand.ts b/clients/client-lakeformation/src/commands/RegisterResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/RegisterResourceCommand.ts rename to clients/client-lakeformation/src/commands/RegisterResourceCommand.ts diff --git a/clients/client-lakeformation/commands/RemoveLFTagsFromResourceCommand.ts b/clients/client-lakeformation/src/commands/RemoveLFTagsFromResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/RemoveLFTagsFromResourceCommand.ts rename to clients/client-lakeformation/src/commands/RemoveLFTagsFromResourceCommand.ts diff --git a/clients/client-lakeformation/commands/RevokePermissionsCommand.ts b/clients/client-lakeformation/src/commands/RevokePermissionsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/RevokePermissionsCommand.ts rename to clients/client-lakeformation/src/commands/RevokePermissionsCommand.ts diff --git a/clients/client-lakeformation/commands/SearchDatabasesByLFTagsCommand.ts b/clients/client-lakeformation/src/commands/SearchDatabasesByLFTagsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/SearchDatabasesByLFTagsCommand.ts rename to clients/client-lakeformation/src/commands/SearchDatabasesByLFTagsCommand.ts diff --git a/clients/client-lakeformation/commands/SearchTablesByLFTagsCommand.ts b/clients/client-lakeformation/src/commands/SearchTablesByLFTagsCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/SearchTablesByLFTagsCommand.ts rename to clients/client-lakeformation/src/commands/SearchTablesByLFTagsCommand.ts diff --git a/clients/client-lakeformation/commands/UpdateLFTagCommand.ts b/clients/client-lakeformation/src/commands/UpdateLFTagCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/UpdateLFTagCommand.ts rename to clients/client-lakeformation/src/commands/UpdateLFTagCommand.ts diff --git a/clients/client-lakeformation/commands/UpdateResourceCommand.ts b/clients/client-lakeformation/src/commands/UpdateResourceCommand.ts similarity index 100% rename from clients/client-lakeformation/commands/UpdateResourceCommand.ts rename to clients/client-lakeformation/src/commands/UpdateResourceCommand.ts diff --git a/clients/client-lakeformation/endpoints.ts b/clients/client-lakeformation/src/endpoints.ts similarity index 100% rename from clients/client-lakeformation/endpoints.ts rename to clients/client-lakeformation/src/endpoints.ts diff --git a/clients/client-lakeformation/index.ts b/clients/client-lakeformation/src/index.ts similarity index 100% rename from clients/client-lakeformation/index.ts rename to clients/client-lakeformation/src/index.ts diff --git a/clients/client-lakeformation/models/index.ts b/clients/client-lakeformation/src/models/index.ts similarity index 100% rename from clients/client-lakeformation/models/index.ts rename to clients/client-lakeformation/src/models/index.ts diff --git a/clients/client-lakeformation/models/models_0.ts b/clients/client-lakeformation/src/models/models_0.ts similarity index 100% rename from clients/client-lakeformation/models/models_0.ts rename to clients/client-lakeformation/src/models/models_0.ts diff --git a/clients/client-lakeformation/pagination/GetEffectivePermissionsForPathPaginator.ts b/clients/client-lakeformation/src/pagination/GetEffectivePermissionsForPathPaginator.ts similarity index 100% rename from clients/client-lakeformation/pagination/GetEffectivePermissionsForPathPaginator.ts rename to clients/client-lakeformation/src/pagination/GetEffectivePermissionsForPathPaginator.ts diff --git a/clients/client-lakeformation/pagination/Interfaces.ts b/clients/client-lakeformation/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lakeformation/pagination/Interfaces.ts rename to clients/client-lakeformation/src/pagination/Interfaces.ts diff --git a/clients/client-lakeformation/pagination/ListPermissionsPaginator.ts b/clients/client-lakeformation/src/pagination/ListPermissionsPaginator.ts similarity index 100% rename from clients/client-lakeformation/pagination/ListPermissionsPaginator.ts rename to clients/client-lakeformation/src/pagination/ListPermissionsPaginator.ts diff --git a/clients/client-lakeformation/pagination/ListResourcesPaginator.ts b/clients/client-lakeformation/src/pagination/ListResourcesPaginator.ts similarity index 100% rename from clients/client-lakeformation/pagination/ListResourcesPaginator.ts rename to clients/client-lakeformation/src/pagination/ListResourcesPaginator.ts diff --git a/clients/client-lakeformation/protocols/Aws_json1_1.ts b/clients/client-lakeformation/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-lakeformation/protocols/Aws_json1_1.ts rename to clients/client-lakeformation/src/protocols/Aws_json1_1.ts diff --git a/clients/client-lakeformation/src/runtimeConfig.browser.ts b/clients/client-lakeformation/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..179a32fd4e56 --- /dev/null +++ b/clients/client-lakeformation/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LakeFormationClientConfig } from "./LakeFormationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LakeFormationClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lakeformation/runtimeConfig.native.ts b/clients/client-lakeformation/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lakeformation/runtimeConfig.native.ts rename to clients/client-lakeformation/src/runtimeConfig.native.ts diff --git a/clients/client-lakeformation/runtimeConfig.shared.ts b/clients/client-lakeformation/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lakeformation/runtimeConfig.shared.ts rename to clients/client-lakeformation/src/runtimeConfig.shared.ts diff --git a/clients/client-lakeformation/src/runtimeConfig.ts b/clients/client-lakeformation/src/runtimeConfig.ts new file mode 100644 index 000000000000..b7fb109dd639 --- /dev/null +++ b/clients/client-lakeformation/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LakeFormationClientConfig } from "./LakeFormationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LakeFormationClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lakeformation/tsconfig.es.json b/clients/client-lakeformation/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lakeformation/tsconfig.es.json +++ b/clients/client-lakeformation/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lakeformation/tsconfig.json b/clients/client-lakeformation/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lakeformation/tsconfig.json +++ b/clients/client-lakeformation/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lakeformation/tsconfig.types.json b/clients/client-lakeformation/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lakeformation/tsconfig.types.json +++ b/clients/client-lakeformation/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lambda/.gitignore b/clients/client-lambda/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lambda/.gitignore +++ b/clients/client-lambda/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lambda/package.json b/clients/client-lambda/package.json index bd63dd8e547b..54748df90dc4 100644 --- a/clients/client-lambda/package.json +++ b/clients/client-lambda/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lambda", "repository": { "type": "git", diff --git a/clients/client-lambda/runtimeConfig.browser.ts b/clients/client-lambda/runtimeConfig.browser.ts deleted file mode 100644 index f62fcd8849ef..000000000000 --- a/clients/client-lambda/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LambdaClientConfig } from "./LambdaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LambdaClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lambda/runtimeConfig.ts b/clients/client-lambda/runtimeConfig.ts deleted file mode 100644 index 55f9773d7127..000000000000 --- a/clients/client-lambda/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LambdaClientConfig } from "./LambdaClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LambdaClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lambda/Lambda.ts b/clients/client-lambda/src/Lambda.ts similarity index 100% rename from clients/client-lambda/Lambda.ts rename to clients/client-lambda/src/Lambda.ts diff --git a/clients/client-lambda/LambdaClient.ts b/clients/client-lambda/src/LambdaClient.ts similarity index 100% rename from clients/client-lambda/LambdaClient.ts rename to clients/client-lambda/src/LambdaClient.ts diff --git a/clients/client-lambda/commands/AddLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts similarity index 100% rename from clients/client-lambda/commands/AddLayerVersionPermissionCommand.ts rename to clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts diff --git a/clients/client-lambda/commands/AddPermissionCommand.ts b/clients/client-lambda/src/commands/AddPermissionCommand.ts similarity index 100% rename from clients/client-lambda/commands/AddPermissionCommand.ts rename to clients/client-lambda/src/commands/AddPermissionCommand.ts diff --git a/clients/client-lambda/commands/CreateAliasCommand.ts b/clients/client-lambda/src/commands/CreateAliasCommand.ts similarity index 100% rename from clients/client-lambda/commands/CreateAliasCommand.ts rename to clients/client-lambda/src/commands/CreateAliasCommand.ts diff --git a/clients/client-lambda/commands/CreateCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/CreateCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/CreateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts similarity index 100% rename from clients/client-lambda/commands/CreateEventSourceMappingCommand.ts rename to clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts diff --git a/clients/client-lambda/commands/CreateFunctionCommand.ts b/clients/client-lambda/src/commands/CreateFunctionCommand.ts similarity index 100% rename from clients/client-lambda/commands/CreateFunctionCommand.ts rename to clients/client-lambda/src/commands/CreateFunctionCommand.ts diff --git a/clients/client-lambda/commands/DeleteAliasCommand.ts b/clients/client-lambda/src/commands/DeleteAliasCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteAliasCommand.ts rename to clients/client-lambda/src/commands/DeleteAliasCommand.ts diff --git a/clients/client-lambda/commands/DeleteCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/DeleteCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/DeleteCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/DeleteEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteEventSourceMappingCommand.ts rename to clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts diff --git a/clients/client-lambda/commands/DeleteFunctionCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteFunctionCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/DeleteFunctionCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/DeleteFunctionCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteFunctionCommand.ts rename to clients/client-lambda/src/commands/DeleteFunctionCommand.ts diff --git a/clients/client-lambda/commands/DeleteFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteFunctionConcurrencyCommand.ts rename to clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts diff --git a/clients/client-lambda/commands/DeleteFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteFunctionEventInvokeConfigCommand.ts rename to clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts diff --git a/clients/client-lambda/commands/DeleteLayerVersionCommand.ts b/clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteLayerVersionCommand.ts rename to clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts diff --git a/clients/client-lambda/commands/DeleteProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/DeleteProvisionedConcurrencyConfigCommand.ts rename to clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts diff --git a/clients/client-lambda/commands/GetAccountSettingsCommand.ts b/clients/client-lambda/src/commands/GetAccountSettingsCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetAccountSettingsCommand.ts rename to clients/client-lambda/src/commands/GetAccountSettingsCommand.ts diff --git a/clients/client-lambda/commands/GetAliasCommand.ts b/clients/client-lambda/src/commands/GetAliasCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetAliasCommand.ts rename to clients/client-lambda/src/commands/GetAliasCommand.ts diff --git a/clients/client-lambda/commands/GetCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/GetCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/GetCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/GetEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetEventSourceMappingCommand.ts rename to clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts diff --git a/clients/client-lambda/commands/GetFunctionCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/GetFunctionCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetFunctionCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/GetFunctionCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/GetFunctionCommand.ts b/clients/client-lambda/src/commands/GetFunctionCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetFunctionCommand.ts rename to clients/client-lambda/src/commands/GetFunctionCommand.ts diff --git a/clients/client-lambda/commands/GetFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetFunctionConcurrencyCommand.ts rename to clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts diff --git a/clients/client-lambda/commands/GetFunctionConfigurationCommand.ts b/clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetFunctionConfigurationCommand.ts rename to clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts diff --git a/clients/client-lambda/commands/GetFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetFunctionEventInvokeConfigCommand.ts rename to clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts diff --git a/clients/client-lambda/commands/GetLayerVersionByArnCommand.ts b/clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetLayerVersionByArnCommand.ts rename to clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts diff --git a/clients/client-lambda/commands/GetLayerVersionCommand.ts b/clients/client-lambda/src/commands/GetLayerVersionCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetLayerVersionCommand.ts rename to clients/client-lambda/src/commands/GetLayerVersionCommand.ts diff --git a/clients/client-lambda/commands/GetLayerVersionPolicyCommand.ts b/clients/client-lambda/src/commands/GetLayerVersionPolicyCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetLayerVersionPolicyCommand.ts rename to clients/client-lambda/src/commands/GetLayerVersionPolicyCommand.ts diff --git a/clients/client-lambda/commands/GetPolicyCommand.ts b/clients/client-lambda/src/commands/GetPolicyCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetPolicyCommand.ts rename to clients/client-lambda/src/commands/GetPolicyCommand.ts diff --git a/clients/client-lambda/commands/GetProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/GetProvisionedConcurrencyConfigCommand.ts rename to clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts diff --git a/clients/client-lambda/commands/InvokeAsyncCommand.ts b/clients/client-lambda/src/commands/InvokeAsyncCommand.ts similarity index 100% rename from clients/client-lambda/commands/InvokeAsyncCommand.ts rename to clients/client-lambda/src/commands/InvokeAsyncCommand.ts diff --git a/clients/client-lambda/commands/InvokeCommand.ts b/clients/client-lambda/src/commands/InvokeCommand.ts similarity index 100% rename from clients/client-lambda/commands/InvokeCommand.ts rename to clients/client-lambda/src/commands/InvokeCommand.ts diff --git a/clients/client-lambda/commands/ListAliasesCommand.ts b/clients/client-lambda/src/commands/ListAliasesCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListAliasesCommand.ts rename to clients/client-lambda/src/commands/ListAliasesCommand.ts diff --git a/clients/client-lambda/commands/ListCodeSigningConfigsCommand.ts b/clients/client-lambda/src/commands/ListCodeSigningConfigsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListCodeSigningConfigsCommand.ts rename to clients/client-lambda/src/commands/ListCodeSigningConfigsCommand.ts diff --git a/clients/client-lambda/commands/ListEventSourceMappingsCommand.ts b/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListEventSourceMappingsCommand.ts rename to clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts diff --git a/clients/client-lambda/commands/ListFunctionEventInvokeConfigsCommand.ts b/clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListFunctionEventInvokeConfigsCommand.ts rename to clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts diff --git a/clients/client-lambda/commands/ListFunctionsByCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/ListFunctionsByCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListFunctionsByCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/ListFunctionsByCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/ListFunctionsCommand.ts b/clients/client-lambda/src/commands/ListFunctionsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListFunctionsCommand.ts rename to clients/client-lambda/src/commands/ListFunctionsCommand.ts diff --git a/clients/client-lambda/commands/ListLayerVersionsCommand.ts b/clients/client-lambda/src/commands/ListLayerVersionsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListLayerVersionsCommand.ts rename to clients/client-lambda/src/commands/ListLayerVersionsCommand.ts diff --git a/clients/client-lambda/commands/ListLayersCommand.ts b/clients/client-lambda/src/commands/ListLayersCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListLayersCommand.ts rename to clients/client-lambda/src/commands/ListLayersCommand.ts diff --git a/clients/client-lambda/commands/ListProvisionedConcurrencyConfigsCommand.ts b/clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListProvisionedConcurrencyConfigsCommand.ts rename to clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts diff --git a/clients/client-lambda/commands/ListTagsCommand.ts b/clients/client-lambda/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListTagsCommand.ts rename to clients/client-lambda/src/commands/ListTagsCommand.ts diff --git a/clients/client-lambda/commands/ListVersionsByFunctionCommand.ts b/clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts similarity index 100% rename from clients/client-lambda/commands/ListVersionsByFunctionCommand.ts rename to clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts diff --git a/clients/client-lambda/commands/PublishLayerVersionCommand.ts b/clients/client-lambda/src/commands/PublishLayerVersionCommand.ts similarity index 100% rename from clients/client-lambda/commands/PublishLayerVersionCommand.ts rename to clients/client-lambda/src/commands/PublishLayerVersionCommand.ts diff --git a/clients/client-lambda/commands/PublishVersionCommand.ts b/clients/client-lambda/src/commands/PublishVersionCommand.ts similarity index 100% rename from clients/client-lambda/commands/PublishVersionCommand.ts rename to clients/client-lambda/src/commands/PublishVersionCommand.ts diff --git a/clients/client-lambda/commands/PutFunctionCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/PutFunctionCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/PutFunctionCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/PutFunctionCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/PutFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts similarity index 100% rename from clients/client-lambda/commands/PutFunctionConcurrencyCommand.ts rename to clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts diff --git a/clients/client-lambda/commands/PutFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/PutFunctionEventInvokeConfigCommand.ts rename to clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts diff --git a/clients/client-lambda/commands/PutProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/PutProvisionedConcurrencyConfigCommand.ts rename to clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts diff --git a/clients/client-lambda/commands/RemoveLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts similarity index 100% rename from clients/client-lambda/commands/RemoveLayerVersionPermissionCommand.ts rename to clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts diff --git a/clients/client-lambda/commands/RemovePermissionCommand.ts b/clients/client-lambda/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-lambda/commands/RemovePermissionCommand.ts rename to clients/client-lambda/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-lambda/commands/TagResourceCommand.ts b/clients/client-lambda/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lambda/commands/TagResourceCommand.ts rename to clients/client-lambda/src/commands/TagResourceCommand.ts diff --git a/clients/client-lambda/commands/UntagResourceCommand.ts b/clients/client-lambda/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lambda/commands/UntagResourceCommand.ts rename to clients/client-lambda/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lambda/commands/UpdateAliasCommand.ts b/clients/client-lambda/src/commands/UpdateAliasCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateAliasCommand.ts rename to clients/client-lambda/src/commands/UpdateAliasCommand.ts diff --git a/clients/client-lambda/commands/UpdateCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/UpdateCodeSigningConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateCodeSigningConfigCommand.ts rename to clients/client-lambda/src/commands/UpdateCodeSigningConfigCommand.ts diff --git a/clients/client-lambda/commands/UpdateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateEventSourceMappingCommand.ts rename to clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts diff --git a/clients/client-lambda/commands/UpdateFunctionCodeCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateFunctionCodeCommand.ts rename to clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts diff --git a/clients/client-lambda/commands/UpdateFunctionConfigurationCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateFunctionConfigurationCommand.ts rename to clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts diff --git a/clients/client-lambda/commands/UpdateFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts similarity index 100% rename from clients/client-lambda/commands/UpdateFunctionEventInvokeConfigCommand.ts rename to clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts diff --git a/clients/client-lambda/endpoints.ts b/clients/client-lambda/src/endpoints.ts similarity index 100% rename from clients/client-lambda/endpoints.ts rename to clients/client-lambda/src/endpoints.ts diff --git a/clients/client-lambda/index.ts b/clients/client-lambda/src/index.ts similarity index 100% rename from clients/client-lambda/index.ts rename to clients/client-lambda/src/index.ts diff --git a/clients/client-lambda/models/index.ts b/clients/client-lambda/src/models/index.ts similarity index 100% rename from clients/client-lambda/models/index.ts rename to clients/client-lambda/src/models/index.ts diff --git a/clients/client-lambda/models/models_0.ts b/clients/client-lambda/src/models/models_0.ts similarity index 100% rename from clients/client-lambda/models/models_0.ts rename to clients/client-lambda/src/models/models_0.ts diff --git a/clients/client-lambda/pagination/Interfaces.ts b/clients/client-lambda/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lambda/pagination/Interfaces.ts rename to clients/client-lambda/src/pagination/Interfaces.ts diff --git a/clients/client-lambda/pagination/ListAliasesPaginator.ts b/clients/client-lambda/src/pagination/ListAliasesPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListAliasesPaginator.ts rename to clients/client-lambda/src/pagination/ListAliasesPaginator.ts diff --git a/clients/client-lambda/pagination/ListCodeSigningConfigsPaginator.ts b/clients/client-lambda/src/pagination/ListCodeSigningConfigsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListCodeSigningConfigsPaginator.ts rename to clients/client-lambda/src/pagination/ListCodeSigningConfigsPaginator.ts diff --git a/clients/client-lambda/pagination/ListEventSourceMappingsPaginator.ts b/clients/client-lambda/src/pagination/ListEventSourceMappingsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListEventSourceMappingsPaginator.ts rename to clients/client-lambda/src/pagination/ListEventSourceMappingsPaginator.ts diff --git a/clients/client-lambda/pagination/ListFunctionEventInvokeConfigsPaginator.ts b/clients/client-lambda/src/pagination/ListFunctionEventInvokeConfigsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListFunctionEventInvokeConfigsPaginator.ts rename to clients/client-lambda/src/pagination/ListFunctionEventInvokeConfigsPaginator.ts diff --git a/clients/client-lambda/pagination/ListFunctionsByCodeSigningConfigPaginator.ts b/clients/client-lambda/src/pagination/ListFunctionsByCodeSigningConfigPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListFunctionsByCodeSigningConfigPaginator.ts rename to clients/client-lambda/src/pagination/ListFunctionsByCodeSigningConfigPaginator.ts diff --git a/clients/client-lambda/pagination/ListFunctionsPaginator.ts b/clients/client-lambda/src/pagination/ListFunctionsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListFunctionsPaginator.ts rename to clients/client-lambda/src/pagination/ListFunctionsPaginator.ts diff --git a/clients/client-lambda/pagination/ListLayerVersionsPaginator.ts b/clients/client-lambda/src/pagination/ListLayerVersionsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListLayerVersionsPaginator.ts rename to clients/client-lambda/src/pagination/ListLayerVersionsPaginator.ts diff --git a/clients/client-lambda/pagination/ListLayersPaginator.ts b/clients/client-lambda/src/pagination/ListLayersPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListLayersPaginator.ts rename to clients/client-lambda/src/pagination/ListLayersPaginator.ts diff --git a/clients/client-lambda/pagination/ListProvisionedConcurrencyConfigsPaginator.ts b/clients/client-lambda/src/pagination/ListProvisionedConcurrencyConfigsPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListProvisionedConcurrencyConfigsPaginator.ts rename to clients/client-lambda/src/pagination/ListProvisionedConcurrencyConfigsPaginator.ts diff --git a/clients/client-lambda/pagination/ListVersionsByFunctionPaginator.ts b/clients/client-lambda/src/pagination/ListVersionsByFunctionPaginator.ts similarity index 100% rename from clients/client-lambda/pagination/ListVersionsByFunctionPaginator.ts rename to clients/client-lambda/src/pagination/ListVersionsByFunctionPaginator.ts diff --git a/clients/client-lambda/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lambda/protocols/Aws_restJson1.ts rename to clients/client-lambda/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lambda/src/runtimeConfig.browser.ts b/clients/client-lambda/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..dbe5ab3fd961 --- /dev/null +++ b/clients/client-lambda/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LambdaClientConfig } from "./LambdaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LambdaClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lambda/runtimeConfig.native.ts b/clients/client-lambda/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lambda/runtimeConfig.native.ts rename to clients/client-lambda/src/runtimeConfig.native.ts diff --git a/clients/client-lambda/runtimeConfig.shared.ts b/clients/client-lambda/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lambda/runtimeConfig.shared.ts rename to clients/client-lambda/src/runtimeConfig.shared.ts diff --git a/clients/client-lambda/src/runtimeConfig.ts b/clients/client-lambda/src/runtimeConfig.ts new file mode 100644 index 000000000000..cf4ad50456e5 --- /dev/null +++ b/clients/client-lambda/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LambdaClientConfig } from "./LambdaClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LambdaClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lambda/waiters/waitForFunctionActive.ts b/clients/client-lambda/src/waiters/waitForFunctionActive.ts similarity index 100% rename from clients/client-lambda/waiters/waitForFunctionActive.ts rename to clients/client-lambda/src/waiters/waitForFunctionActive.ts diff --git a/clients/client-lambda/waiters/waitForFunctionExists.ts b/clients/client-lambda/src/waiters/waitForFunctionExists.ts similarity index 100% rename from clients/client-lambda/waiters/waitForFunctionExists.ts rename to clients/client-lambda/src/waiters/waitForFunctionExists.ts diff --git a/clients/client-lambda/waiters/waitForFunctionUpdated.ts b/clients/client-lambda/src/waiters/waitForFunctionUpdated.ts similarity index 100% rename from clients/client-lambda/waiters/waitForFunctionUpdated.ts rename to clients/client-lambda/src/waiters/waitForFunctionUpdated.ts diff --git a/clients/client-lambda/tsconfig.es.json b/clients/client-lambda/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lambda/tsconfig.es.json +++ b/clients/client-lambda/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lambda/tsconfig.json b/clients/client-lambda/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lambda/tsconfig.json +++ b/clients/client-lambda/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lambda/tsconfig.types.json b/clients/client-lambda/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lambda/tsconfig.types.json +++ b/clients/client-lambda/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lex-model-building-service/.gitignore b/clients/client-lex-model-building-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lex-model-building-service/.gitignore +++ b/clients/client-lex-model-building-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lex-model-building-service/package.json b/clients/client-lex-model-building-service/package.json index 51e97add819e..0a4918961b43 100644 --- a/clients/client-lex-model-building-service/package.json +++ b/clients/client-lex-model-building-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-model-building-service", "repository": { "type": "git", diff --git a/clients/client-lex-model-building-service/runtimeConfig.browser.ts b/clients/client-lex-model-building-service/runtimeConfig.browser.ts deleted file mode 100644 index 963e84d564fb..000000000000 --- a/clients/client-lex-model-building-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LexModelBuildingServiceClientConfig } from "./LexModelBuildingServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-model-building-service/runtimeConfig.ts b/clients/client-lex-model-building-service/runtimeConfig.ts deleted file mode 100644 index a002e0592643..000000000000 --- a/clients/client-lex-model-building-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LexModelBuildingServiceClientConfig } from "./LexModelBuildingServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-model-building-service/LexModelBuildingService.ts b/clients/client-lex-model-building-service/src/LexModelBuildingService.ts similarity index 100% rename from clients/client-lex-model-building-service/LexModelBuildingService.ts rename to clients/client-lex-model-building-service/src/LexModelBuildingService.ts diff --git a/clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts b/clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts similarity index 100% rename from clients/client-lex-model-building-service/LexModelBuildingServiceClient.ts rename to clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts diff --git a/clients/client-lex-model-building-service/commands/CreateBotVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/CreateBotVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/CreateBotVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/CreateBotVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/CreateIntentVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/CreateIntentVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/CreateIntentVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/CreateIntentVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/CreateSlotTypeVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/CreateSlotTypeVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/CreateSlotTypeVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/CreateSlotTypeVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteBotAliasCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteBotAliasCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteBotAliasCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteBotAliasCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteBotChannelAssociationCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteBotChannelAssociationCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteBotChannelAssociationCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteBotChannelAssociationCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteBotCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteBotCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteBotCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteBotCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteBotVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteBotVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteBotVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteBotVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteIntentCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteIntentCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteIntentCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteIntentCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteIntentVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteIntentVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteIntentVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteIntentVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteSlotTypeCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteSlotTypeCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteSlotTypeCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteSlotTypeVersionCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteSlotTypeVersionCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteSlotTypeVersionCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteSlotTypeVersionCommand.ts diff --git a/clients/client-lex-model-building-service/commands/DeleteUtterancesCommand.ts b/clients/client-lex-model-building-service/src/commands/DeleteUtterancesCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/DeleteUtterancesCommand.ts rename to clients/client-lex-model-building-service/src/commands/DeleteUtterancesCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotAliasCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotAliasCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotAliasCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotAliasCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotAliasesCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotAliasesCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotAliasesCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotAliasesCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotChannelAssociationCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotChannelAssociationCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotChannelAssociationCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotChannelAssociationCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotChannelAssociationsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotChannelAssociationsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotChannelAssociationsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotChannelAssociationsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotVersionsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotVersionsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotVersionsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotVersionsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBotsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBotsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBotsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBotsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBuiltinIntentCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBuiltinIntentCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBuiltinIntentCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBuiltinIntentCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBuiltinIntentsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBuiltinIntentsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBuiltinIntentsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBuiltinIntentsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetBuiltinSlotTypesCommand.ts b/clients/client-lex-model-building-service/src/commands/GetBuiltinSlotTypesCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetBuiltinSlotTypesCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetBuiltinSlotTypesCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetExportCommand.ts b/clients/client-lex-model-building-service/src/commands/GetExportCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetExportCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetExportCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetImportCommand.ts b/clients/client-lex-model-building-service/src/commands/GetImportCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetImportCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetImportCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetIntentCommand.ts b/clients/client-lex-model-building-service/src/commands/GetIntentCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetIntentCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetIntentCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetIntentVersionsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetIntentVersionsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetIntentVersionsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetIntentVersionsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetIntentsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetIntentsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetIntentsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetIntentsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetMigrationCommand.ts b/clients/client-lex-model-building-service/src/commands/GetMigrationCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetMigrationCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetMigrationCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetMigrationsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetMigrationsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetMigrationsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetMigrationsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetSlotTypeCommand.ts b/clients/client-lex-model-building-service/src/commands/GetSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetSlotTypeCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetSlotTypeCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetSlotTypeVersionsCommand.ts b/clients/client-lex-model-building-service/src/commands/GetSlotTypeVersionsCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetSlotTypeVersionsCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetSlotTypeVersionsCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetSlotTypesCommand.ts b/clients/client-lex-model-building-service/src/commands/GetSlotTypesCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetSlotTypesCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetSlotTypesCommand.ts diff --git a/clients/client-lex-model-building-service/commands/GetUtterancesViewCommand.ts b/clients/client-lex-model-building-service/src/commands/GetUtterancesViewCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/GetUtterancesViewCommand.ts rename to clients/client-lex-model-building-service/src/commands/GetUtterancesViewCommand.ts diff --git a/clients/client-lex-model-building-service/commands/ListTagsForResourceCommand.ts b/clients/client-lex-model-building-service/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/ListTagsForResourceCommand.ts rename to clients/client-lex-model-building-service/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-lex-model-building-service/commands/PutBotAliasCommand.ts b/clients/client-lex-model-building-service/src/commands/PutBotAliasCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/PutBotAliasCommand.ts rename to clients/client-lex-model-building-service/src/commands/PutBotAliasCommand.ts diff --git a/clients/client-lex-model-building-service/commands/PutBotCommand.ts b/clients/client-lex-model-building-service/src/commands/PutBotCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/PutBotCommand.ts rename to clients/client-lex-model-building-service/src/commands/PutBotCommand.ts diff --git a/clients/client-lex-model-building-service/commands/PutIntentCommand.ts b/clients/client-lex-model-building-service/src/commands/PutIntentCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/PutIntentCommand.ts rename to clients/client-lex-model-building-service/src/commands/PutIntentCommand.ts diff --git a/clients/client-lex-model-building-service/commands/PutSlotTypeCommand.ts b/clients/client-lex-model-building-service/src/commands/PutSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/PutSlotTypeCommand.ts rename to clients/client-lex-model-building-service/src/commands/PutSlotTypeCommand.ts diff --git a/clients/client-lex-model-building-service/commands/StartImportCommand.ts b/clients/client-lex-model-building-service/src/commands/StartImportCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/StartImportCommand.ts rename to clients/client-lex-model-building-service/src/commands/StartImportCommand.ts diff --git a/clients/client-lex-model-building-service/commands/StartMigrationCommand.ts b/clients/client-lex-model-building-service/src/commands/StartMigrationCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/StartMigrationCommand.ts rename to clients/client-lex-model-building-service/src/commands/StartMigrationCommand.ts diff --git a/clients/client-lex-model-building-service/commands/TagResourceCommand.ts b/clients/client-lex-model-building-service/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/TagResourceCommand.ts rename to clients/client-lex-model-building-service/src/commands/TagResourceCommand.ts diff --git a/clients/client-lex-model-building-service/commands/UntagResourceCommand.ts b/clients/client-lex-model-building-service/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lex-model-building-service/commands/UntagResourceCommand.ts rename to clients/client-lex-model-building-service/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lex-model-building-service/endpoints.ts b/clients/client-lex-model-building-service/src/endpoints.ts similarity index 100% rename from clients/client-lex-model-building-service/endpoints.ts rename to clients/client-lex-model-building-service/src/endpoints.ts diff --git a/clients/client-lex-model-building-service/index.ts b/clients/client-lex-model-building-service/src/index.ts similarity index 100% rename from clients/client-lex-model-building-service/index.ts rename to clients/client-lex-model-building-service/src/index.ts diff --git a/clients/client-lex-model-building-service/models/index.ts b/clients/client-lex-model-building-service/src/models/index.ts similarity index 100% rename from clients/client-lex-model-building-service/models/index.ts rename to clients/client-lex-model-building-service/src/models/index.ts diff --git a/clients/client-lex-model-building-service/models/models_0.ts b/clients/client-lex-model-building-service/src/models/models_0.ts similarity index 100% rename from clients/client-lex-model-building-service/models/models_0.ts rename to clients/client-lex-model-building-service/src/models/models_0.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBotAliasesPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBotAliasesPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBotAliasesPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBotAliasesPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBotChannelAssociationsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBotChannelAssociationsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBotChannelAssociationsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBotChannelAssociationsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBotVersionsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBotVersionsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBotVersionsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBotVersionsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBotsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBotsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBotsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBotsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBuiltinIntentsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBuiltinIntentsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBuiltinIntentsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBuiltinIntentsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetBuiltinSlotTypesPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetBuiltinSlotTypesPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetBuiltinSlotTypesPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetBuiltinSlotTypesPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetIntentVersionsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetIntentVersionsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetIntentVersionsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetIntentVersionsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetIntentsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetIntentsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetIntentsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetIntentsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetMigrationsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetMigrationsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetMigrationsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetMigrationsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetSlotTypeVersionsPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetSlotTypeVersionsPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetSlotTypeVersionsPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetSlotTypeVersionsPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/GetSlotTypesPaginator.ts b/clients/client-lex-model-building-service/src/pagination/GetSlotTypesPaginator.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/GetSlotTypesPaginator.ts rename to clients/client-lex-model-building-service/src/pagination/GetSlotTypesPaginator.ts diff --git a/clients/client-lex-model-building-service/pagination/Interfaces.ts b/clients/client-lex-model-building-service/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lex-model-building-service/pagination/Interfaces.ts rename to clients/client-lex-model-building-service/src/pagination/Interfaces.ts diff --git a/clients/client-lex-model-building-service/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lex-model-building-service/protocols/Aws_restJson1.ts rename to clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lex-model-building-service/src/runtimeConfig.browser.ts b/clients/client-lex-model-building-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..44b5d549e3e2 --- /dev/null +++ b/clients/client-lex-model-building-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LexModelBuildingServiceClientConfig } from "./LexModelBuildingServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-model-building-service/runtimeConfig.native.ts b/clients/client-lex-model-building-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lex-model-building-service/runtimeConfig.native.ts rename to clients/client-lex-model-building-service/src/runtimeConfig.native.ts diff --git a/clients/client-lex-model-building-service/runtimeConfig.shared.ts b/clients/client-lex-model-building-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lex-model-building-service/runtimeConfig.shared.ts rename to clients/client-lex-model-building-service/src/runtimeConfig.shared.ts diff --git a/clients/client-lex-model-building-service/src/runtimeConfig.ts b/clients/client-lex-model-building-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..65877e216335 --- /dev/null +++ b/clients/client-lex-model-building-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LexModelBuildingServiceClientConfig } from "./LexModelBuildingServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-model-building-service/tsconfig.es.json b/clients/client-lex-model-building-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lex-model-building-service/tsconfig.es.json +++ b/clients/client-lex-model-building-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lex-model-building-service/tsconfig.json b/clients/client-lex-model-building-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lex-model-building-service/tsconfig.json +++ b/clients/client-lex-model-building-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lex-model-building-service/tsconfig.types.json b/clients/client-lex-model-building-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lex-model-building-service/tsconfig.types.json +++ b/clients/client-lex-model-building-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lex-models-v2/.gitignore b/clients/client-lex-models-v2/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-lex-models-v2/.gitignore +++ b/clients/client-lex-models-v2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lex-models-v2/package.json b/clients/client-lex-models-v2/package.json index f90c10cd9c9c..9cf31c03baf7 100644 --- a/clients/client-lex-models-v2/package.json +++ b/clients/client-lex-models-v2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-models-v2", "repository": { "type": "git", diff --git a/clients/client-lex-models-v2/runtimeConfig.browser.ts b/clients/client-lex-models-v2/runtimeConfig.browser.ts deleted file mode 100644 index 154aa19f9fbc..000000000000 --- a/clients/client-lex-models-v2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LexModelsV2ClientConfig } from "./LexModelsV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-models-v2/runtimeConfig.ts b/clients/client-lex-models-v2/runtimeConfig.ts deleted file mode 100644 index cbf88bb70f16..000000000000 --- a/clients/client-lex-models-v2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LexModelsV2ClientConfig } from "./LexModelsV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-models-v2/LexModelsV2.ts b/clients/client-lex-models-v2/src/LexModelsV2.ts similarity index 100% rename from clients/client-lex-models-v2/LexModelsV2.ts rename to clients/client-lex-models-v2/src/LexModelsV2.ts diff --git a/clients/client-lex-models-v2/LexModelsV2Client.ts b/clients/client-lex-models-v2/src/LexModelsV2Client.ts similarity index 100% rename from clients/client-lex-models-v2/LexModelsV2Client.ts rename to clients/client-lex-models-v2/src/LexModelsV2Client.ts diff --git a/clients/client-lex-models-v2/commands/BuildBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/BuildBotLocaleCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/BuildBotLocaleCommand.ts rename to clients/client-lex-models-v2/src/commands/BuildBotLocaleCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateBotAliasCommand.ts b/clients/client-lex-models-v2/src/commands/CreateBotAliasCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateBotAliasCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateBotAliasCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateBotCommand.ts b/clients/client-lex-models-v2/src/commands/CreateBotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateBotCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateBotCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateBotLocaleCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateBotLocaleCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateBotVersionCommand.ts b/clients/client-lex-models-v2/src/commands/CreateBotVersionCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateBotVersionCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateBotVersionCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateExportCommand.ts b/clients/client-lex-models-v2/src/commands/CreateExportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateExportCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateExportCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateIntentCommand.ts b/clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateIntentCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateIntentCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateResourcePolicyCommand.ts b/clients/client-lex-models-v2/src/commands/CreateResourcePolicyCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateResourcePolicyCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateResourcePolicyCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateResourcePolicyStatementCommand.ts b/clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateResourcePolicyStatementCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateResourcePolicyStatementCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateSlotCommand.ts b/clients/client-lex-models-v2/src/commands/CreateSlotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateSlotCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateSlotCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateSlotTypeCommand.ts b/clients/client-lex-models-v2/src/commands/CreateSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateSlotTypeCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateSlotTypeCommand.ts diff --git a/clients/client-lex-models-v2/commands/CreateUploadUrlCommand.ts b/clients/client-lex-models-v2/src/commands/CreateUploadUrlCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/CreateUploadUrlCommand.ts rename to clients/client-lex-models-v2/src/commands/CreateUploadUrlCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteBotAliasCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteBotAliasCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteBotAliasCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteBotAliasCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteBotCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteBotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteBotCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteBotCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteBotLocaleCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteBotLocaleCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteBotLocaleCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteBotVersionCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteBotVersionCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteBotVersionCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteBotVersionCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteExportCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteExportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteExportCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteExportCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteImportCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteImportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteImportCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteImportCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteIntentCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteIntentCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteIntentCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteIntentCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteResourcePolicyCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteResourcePolicyCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteResourcePolicyStatementCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteResourcePolicyStatementCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteResourcePolicyStatementCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteSlotCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteSlotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteSlotCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteSlotCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteSlotTypeCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteSlotTypeCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteSlotTypeCommand.ts diff --git a/clients/client-lex-models-v2/commands/DeleteUtterancesCommand.ts b/clients/client-lex-models-v2/src/commands/DeleteUtterancesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DeleteUtterancesCommand.ts rename to clients/client-lex-models-v2/src/commands/DeleteUtterancesCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeBotAliasCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotAliasCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeBotAliasCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeBotAliasCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeBotCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeBotCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeBotCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeBotLocaleCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeBotLocaleCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeBotVersionCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeBotVersionCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeBotVersionCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeBotVersionCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeExportCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeExportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeExportCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeExportCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeImportCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeImportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeImportCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeImportCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeIntentCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeIntentCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeIntentCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeResourcePolicyCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeResourcePolicyCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeResourcePolicyCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeResourcePolicyCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeSlotCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeSlotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeSlotCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeSlotCommand.ts diff --git a/clients/client-lex-models-v2/commands/DescribeSlotTypeCommand.ts b/clients/client-lex-models-v2/src/commands/DescribeSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/DescribeSlotTypeCommand.ts rename to clients/client-lex-models-v2/src/commands/DescribeSlotTypeCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListAggregatedUtterancesCommand.ts b/clients/client-lex-models-v2/src/commands/ListAggregatedUtterancesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListAggregatedUtterancesCommand.ts rename to clients/client-lex-models-v2/src/commands/ListAggregatedUtterancesCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBotAliasesCommand.ts b/clients/client-lex-models-v2/src/commands/ListBotAliasesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBotAliasesCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBotAliasesCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBotLocalesCommand.ts b/clients/client-lex-models-v2/src/commands/ListBotLocalesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBotLocalesCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBotLocalesCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBotVersionsCommand.ts b/clients/client-lex-models-v2/src/commands/ListBotVersionsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBotVersionsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBotVersionsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBotsCommand.ts b/clients/client-lex-models-v2/src/commands/ListBotsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBotsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBotsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBuiltInIntentsCommand.ts b/clients/client-lex-models-v2/src/commands/ListBuiltInIntentsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBuiltInIntentsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBuiltInIntentsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListBuiltInSlotTypesCommand.ts b/clients/client-lex-models-v2/src/commands/ListBuiltInSlotTypesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListBuiltInSlotTypesCommand.ts rename to clients/client-lex-models-v2/src/commands/ListBuiltInSlotTypesCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListExportsCommand.ts b/clients/client-lex-models-v2/src/commands/ListExportsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListExportsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListExportsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListImportsCommand.ts b/clients/client-lex-models-v2/src/commands/ListImportsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListImportsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListImportsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListIntentsCommand.ts b/clients/client-lex-models-v2/src/commands/ListIntentsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListIntentsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListIntentsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListSlotTypesCommand.ts b/clients/client-lex-models-v2/src/commands/ListSlotTypesCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListSlotTypesCommand.ts rename to clients/client-lex-models-v2/src/commands/ListSlotTypesCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListSlotsCommand.ts b/clients/client-lex-models-v2/src/commands/ListSlotsCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListSlotsCommand.ts rename to clients/client-lex-models-v2/src/commands/ListSlotsCommand.ts diff --git a/clients/client-lex-models-v2/commands/ListTagsForResourceCommand.ts b/clients/client-lex-models-v2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/ListTagsForResourceCommand.ts rename to clients/client-lex-models-v2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-lex-models-v2/commands/StartImportCommand.ts b/clients/client-lex-models-v2/src/commands/StartImportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/StartImportCommand.ts rename to clients/client-lex-models-v2/src/commands/StartImportCommand.ts diff --git a/clients/client-lex-models-v2/commands/TagResourceCommand.ts b/clients/client-lex-models-v2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/TagResourceCommand.ts rename to clients/client-lex-models-v2/src/commands/TagResourceCommand.ts diff --git a/clients/client-lex-models-v2/commands/UntagResourceCommand.ts b/clients/client-lex-models-v2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UntagResourceCommand.ts rename to clients/client-lex-models-v2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateBotAliasCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateBotAliasCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateBotAliasCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateBotAliasCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateBotCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateBotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateBotCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateBotCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateBotLocaleCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateBotLocaleCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateBotLocaleCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateExportCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateExportCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateExportCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateExportCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateIntentCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateIntentCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateIntentCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateResourcePolicyCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateResourcePolicyCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateResourcePolicyCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateResourcePolicyCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateSlotCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateSlotCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateSlotCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateSlotCommand.ts diff --git a/clients/client-lex-models-v2/commands/UpdateSlotTypeCommand.ts b/clients/client-lex-models-v2/src/commands/UpdateSlotTypeCommand.ts similarity index 100% rename from clients/client-lex-models-v2/commands/UpdateSlotTypeCommand.ts rename to clients/client-lex-models-v2/src/commands/UpdateSlotTypeCommand.ts diff --git a/clients/client-lex-models-v2/endpoints.ts b/clients/client-lex-models-v2/src/endpoints.ts similarity index 100% rename from clients/client-lex-models-v2/endpoints.ts rename to clients/client-lex-models-v2/src/endpoints.ts diff --git a/clients/client-lex-models-v2/index.ts b/clients/client-lex-models-v2/src/index.ts similarity index 100% rename from clients/client-lex-models-v2/index.ts rename to clients/client-lex-models-v2/src/index.ts diff --git a/clients/client-lex-models-v2/models/index.ts b/clients/client-lex-models-v2/src/models/index.ts similarity index 100% rename from clients/client-lex-models-v2/models/index.ts rename to clients/client-lex-models-v2/src/models/index.ts diff --git a/clients/client-lex-models-v2/models/models_0.ts b/clients/client-lex-models-v2/src/models/models_0.ts similarity index 100% rename from clients/client-lex-models-v2/models/models_0.ts rename to clients/client-lex-models-v2/src/models/models_0.ts diff --git a/clients/client-lex-models-v2/pagination/Interfaces.ts b/clients/client-lex-models-v2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/Interfaces.ts rename to clients/client-lex-models-v2/src/pagination/Interfaces.ts diff --git a/clients/client-lex-models-v2/pagination/ListAggregatedUtterancesPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListAggregatedUtterancesPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListAggregatedUtterancesPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListAggregatedUtterancesPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBotAliasesPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBotAliasesPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBotAliasesPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBotAliasesPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBotLocalesPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBotLocalesPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBotLocalesPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBotLocalesPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBotVersionsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBotVersionsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBotVersionsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBotVersionsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBotsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBotsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBotsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBotsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBuiltInIntentsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBuiltInIntentsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBuiltInIntentsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBuiltInIntentsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListBuiltInSlotTypesPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListBuiltInSlotTypesPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListBuiltInSlotTypesPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListBuiltInSlotTypesPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListExportsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListExportsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListExportsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListExportsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListImportsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListImportsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListImportsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListImportsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListIntentsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListIntentsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListIntentsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListIntentsPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListSlotTypesPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListSlotTypesPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListSlotTypesPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListSlotTypesPaginator.ts diff --git a/clients/client-lex-models-v2/pagination/ListSlotsPaginator.ts b/clients/client-lex-models-v2/src/pagination/ListSlotsPaginator.ts similarity index 100% rename from clients/client-lex-models-v2/pagination/ListSlotsPaginator.ts rename to clients/client-lex-models-v2/src/pagination/ListSlotsPaginator.ts diff --git a/clients/client-lex-models-v2/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lex-models-v2/protocols/Aws_restJson1.ts rename to clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lex-models-v2/src/runtimeConfig.browser.ts b/clients/client-lex-models-v2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..adda7e1ff19a --- /dev/null +++ b/clients/client-lex-models-v2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LexModelsV2ClientConfig } from "./LexModelsV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-models-v2/runtimeConfig.native.ts b/clients/client-lex-models-v2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lex-models-v2/runtimeConfig.native.ts rename to clients/client-lex-models-v2/src/runtimeConfig.native.ts diff --git a/clients/client-lex-models-v2/runtimeConfig.shared.ts b/clients/client-lex-models-v2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lex-models-v2/runtimeConfig.shared.ts rename to clients/client-lex-models-v2/src/runtimeConfig.shared.ts diff --git a/clients/client-lex-models-v2/src/runtimeConfig.ts b/clients/client-lex-models-v2/src/runtimeConfig.ts new file mode 100644 index 000000000000..1309eb217a9b --- /dev/null +++ b/clients/client-lex-models-v2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LexModelsV2ClientConfig } from "./LexModelsV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-models-v2/waiters/waitForBotAliasAvailable.ts b/clients/client-lex-models-v2/src/waiters/waitForBotAliasAvailable.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotAliasAvailable.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotAliasAvailable.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotAvailable.ts b/clients/client-lex-models-v2/src/waiters/waitForBotAvailable.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotAvailable.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotAvailable.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotExportCompleted.ts b/clients/client-lex-models-v2/src/waiters/waitForBotExportCompleted.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotExportCompleted.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotExportCompleted.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotImportCompleted.ts b/clients/client-lex-models-v2/src/waiters/waitForBotImportCompleted.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotImportCompleted.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotImportCompleted.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotLocaleBuilt.ts b/clients/client-lex-models-v2/src/waiters/waitForBotLocaleBuilt.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotLocaleBuilt.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotLocaleBuilt.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotLocaleCreated.ts b/clients/client-lex-models-v2/src/waiters/waitForBotLocaleCreated.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotLocaleCreated.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotLocaleCreated.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotLocaleExpressTestingAvailable.ts b/clients/client-lex-models-v2/src/waiters/waitForBotLocaleExpressTestingAvailable.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotLocaleExpressTestingAvailable.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotLocaleExpressTestingAvailable.ts diff --git a/clients/client-lex-models-v2/waiters/waitForBotVersionAvailable.ts b/clients/client-lex-models-v2/src/waiters/waitForBotVersionAvailable.ts similarity index 100% rename from clients/client-lex-models-v2/waiters/waitForBotVersionAvailable.ts rename to clients/client-lex-models-v2/src/waiters/waitForBotVersionAvailable.ts diff --git a/clients/client-lex-models-v2/tsconfig.es.json b/clients/client-lex-models-v2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lex-models-v2/tsconfig.es.json +++ b/clients/client-lex-models-v2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lex-models-v2/tsconfig.json b/clients/client-lex-models-v2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lex-models-v2/tsconfig.json +++ b/clients/client-lex-models-v2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lex-models-v2/tsconfig.types.json b/clients/client-lex-models-v2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lex-models-v2/tsconfig.types.json +++ b/clients/client-lex-models-v2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lex-runtime-service/.gitignore b/clients/client-lex-runtime-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lex-runtime-service/.gitignore +++ b/clients/client-lex-runtime-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lex-runtime-service/package.json b/clients/client-lex-runtime-service/package.json index e61af4d000a1..71650c14947b 100644 --- a/clients/client-lex-runtime-service/package.json +++ b/clients/client-lex-runtime-service/package.json @@ -11,19 +11,13 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "yarn test:unit", - "test:unit": "mocha **/cjs/**/*.spec.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" + "test:unit": "ts-mocha test/**/*.spec.ts" }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-runtime-service", "repository": { "type": "git", diff --git a/clients/client-lex-runtime-service/runtimeConfig.browser.ts b/clients/client-lex-runtime-service/runtimeConfig.browser.ts deleted file mode 100644 index 2ce8ebd753e5..000000000000 --- a/clients/client-lex-runtime-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LexRuntimeServiceClientConfig } from "./LexRuntimeServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-runtime-service/runtimeConfig.ts b/clients/client-lex-runtime-service/runtimeConfig.ts deleted file mode 100644 index 165e95862e0a..000000000000 --- a/clients/client-lex-runtime-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LexRuntimeServiceClientConfig } from "./LexRuntimeServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-runtime-service/LexRuntimeService.ts b/clients/client-lex-runtime-service/src/LexRuntimeService.ts similarity index 100% rename from clients/client-lex-runtime-service/LexRuntimeService.ts rename to clients/client-lex-runtime-service/src/LexRuntimeService.ts diff --git a/clients/client-lex-runtime-service/LexRuntimeServiceClient.ts b/clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts similarity index 100% rename from clients/client-lex-runtime-service/LexRuntimeServiceClient.ts rename to clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts diff --git a/clients/client-lex-runtime-service/commands/DeleteSessionCommand.ts b/clients/client-lex-runtime-service/src/commands/DeleteSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-service/commands/DeleteSessionCommand.ts rename to clients/client-lex-runtime-service/src/commands/DeleteSessionCommand.ts diff --git a/clients/client-lex-runtime-service/commands/GetSessionCommand.ts b/clients/client-lex-runtime-service/src/commands/GetSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-service/commands/GetSessionCommand.ts rename to clients/client-lex-runtime-service/src/commands/GetSessionCommand.ts diff --git a/clients/client-lex-runtime-service/commands/PostContentCommand.ts b/clients/client-lex-runtime-service/src/commands/PostContentCommand.ts similarity index 100% rename from clients/client-lex-runtime-service/commands/PostContentCommand.ts rename to clients/client-lex-runtime-service/src/commands/PostContentCommand.ts diff --git a/clients/client-lex-runtime-service/commands/PostTextCommand.ts b/clients/client-lex-runtime-service/src/commands/PostTextCommand.ts similarity index 100% rename from clients/client-lex-runtime-service/commands/PostTextCommand.ts rename to clients/client-lex-runtime-service/src/commands/PostTextCommand.ts diff --git a/clients/client-lex-runtime-service/commands/PutSessionCommand.ts b/clients/client-lex-runtime-service/src/commands/PutSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-service/commands/PutSessionCommand.ts rename to clients/client-lex-runtime-service/src/commands/PutSessionCommand.ts diff --git a/clients/client-lex-runtime-service/endpoints.ts b/clients/client-lex-runtime-service/src/endpoints.ts similarity index 100% rename from clients/client-lex-runtime-service/endpoints.ts rename to clients/client-lex-runtime-service/src/endpoints.ts diff --git a/clients/client-lex-runtime-service/index.ts b/clients/client-lex-runtime-service/src/index.ts similarity index 100% rename from clients/client-lex-runtime-service/index.ts rename to clients/client-lex-runtime-service/src/index.ts diff --git a/clients/client-lex-runtime-service/models/index.ts b/clients/client-lex-runtime-service/src/models/index.ts similarity index 100% rename from clients/client-lex-runtime-service/models/index.ts rename to clients/client-lex-runtime-service/src/models/index.ts diff --git a/clients/client-lex-runtime-service/models/models_0.ts b/clients/client-lex-runtime-service/src/models/models_0.ts similarity index 100% rename from clients/client-lex-runtime-service/models/models_0.ts rename to clients/client-lex-runtime-service/src/models/models_0.ts diff --git a/clients/client-lex-runtime-service/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lex-runtime-service/protocols/Aws_restJson1.ts rename to clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lex-runtime-service/src/runtimeConfig.browser.ts b/clients/client-lex-runtime-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..26a8d0b4e25d --- /dev/null +++ b/clients/client-lex-runtime-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LexRuntimeServiceClientConfig } from "./LexRuntimeServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-runtime-service/runtimeConfig.native.ts b/clients/client-lex-runtime-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lex-runtime-service/runtimeConfig.native.ts rename to clients/client-lex-runtime-service/src/runtimeConfig.native.ts diff --git a/clients/client-lex-runtime-service/runtimeConfig.shared.ts b/clients/client-lex-runtime-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lex-runtime-service/runtimeConfig.shared.ts rename to clients/client-lex-runtime-service/src/runtimeConfig.shared.ts diff --git a/clients/client-lex-runtime-service/src/runtimeConfig.ts b/clients/client-lex-runtime-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..ab81b41fbebf --- /dev/null +++ b/clients/client-lex-runtime-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LexRuntimeServiceClientConfig } from "./LexRuntimeServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-runtime-service/LexRuntimeService.spec.ts b/clients/client-lex-runtime-service/test/LexRuntimeService.spec.ts similarity index 94% rename from clients/client-lex-runtime-service/LexRuntimeService.spec.ts rename to clients/client-lex-runtime-service/test/LexRuntimeService.spec.ts index fc5f6ab1b8f5..29b3d1359fd4 100644 --- a/clients/client-lex-runtime-service/LexRuntimeService.spec.ts +++ b/clients/client-lex-runtime-service/test/LexRuntimeService.spec.ts @@ -1,8 +1,9 @@ /// -import { expect } from "chai"; -import { LexRuntimeService } from "./LexRuntimeService"; -import { SerializeMiddleware } from "@aws-sdk/types"; import { HttpRequest } from "@aws-sdk/protocol-http"; +import { SerializeMiddleware } from "@aws-sdk/types"; +import { expect } from "chai"; + +import { LexRuntimeService } from "../src/LexRuntimeService"; describe("@aws-sdk/client-lex-runtime-service", () => { describe("PostContent", () => { diff --git a/clients/client-lex-runtime-service/tsconfig.es.json b/clients/client-lex-runtime-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lex-runtime-service/tsconfig.es.json +++ b/clients/client-lex-runtime-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lex-runtime-service/tsconfig.json b/clients/client-lex-runtime-service/tsconfig.json index 846d726e4644..cbb7e0dec925 100644 --- a/clients/client-lex-runtime-service/tsconfig.json +++ b/clients/client-lex-runtime-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true, "types": ["mocha", "node"] }, @@ -28,5 +29,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lex-runtime-service/tsconfig.types.json b/clients/client-lex-runtime-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lex-runtime-service/tsconfig.types.json +++ b/clients/client-lex-runtime-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lex-runtime-v2/.gitignore b/clients/client-lex-runtime-v2/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-lex-runtime-v2/.gitignore +++ b/clients/client-lex-runtime-v2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lex-runtime-v2/package.json b/clients/client-lex-runtime-v2/package.json index c9c784bb04db..fc88d901f0b5 100644 --- a/clients/client-lex-runtime-v2/package.json +++ b/clients/client-lex-runtime-v2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -77,8 +71,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -87,6 +81,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lex-runtime-v2", "repository": { "type": "git", diff --git a/clients/client-lex-runtime-v2/runtimeConfig.browser.ts b/clients/client-lex-runtime-v2/runtimeConfig.browser.ts deleted file mode 100644 index 90f9d03e1c6e..000000000000 --- a/clients/client-lex-runtime-v2/runtimeConfig.browser.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidFunction, invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LexRuntimeV2ClientConfig } from "./LexRuntimeV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamPayloadHandlerProvider: - config?.eventStreamPayloadHandlerProvider ?? - (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-runtime-v2/runtimeConfig.ts b/clients/client-lex-runtime-v2/runtimeConfig.ts deleted file mode 100644 index ea8ba888f922..000000000000 --- a/clients/client-lex-runtime-v2/runtimeConfig.ts +++ /dev/null @@ -1,49 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LexRuntimeV2ClientConfig } from "./LexRuntimeV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttp2Handler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lex-runtime-v2/LexRuntimeV2.ts b/clients/client-lex-runtime-v2/src/LexRuntimeV2.ts similarity index 100% rename from clients/client-lex-runtime-v2/LexRuntimeV2.ts rename to clients/client-lex-runtime-v2/src/LexRuntimeV2.ts diff --git a/clients/client-lex-runtime-v2/LexRuntimeV2Client.ts b/clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts similarity index 100% rename from clients/client-lex-runtime-v2/LexRuntimeV2Client.ts rename to clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts diff --git a/clients/client-lex-runtime-v2/commands/DeleteSessionCommand.ts b/clients/client-lex-runtime-v2/src/commands/DeleteSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/DeleteSessionCommand.ts rename to clients/client-lex-runtime-v2/src/commands/DeleteSessionCommand.ts diff --git a/clients/client-lex-runtime-v2/commands/GetSessionCommand.ts b/clients/client-lex-runtime-v2/src/commands/GetSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/GetSessionCommand.ts rename to clients/client-lex-runtime-v2/src/commands/GetSessionCommand.ts diff --git a/clients/client-lex-runtime-v2/commands/PutSessionCommand.ts b/clients/client-lex-runtime-v2/src/commands/PutSessionCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/PutSessionCommand.ts rename to clients/client-lex-runtime-v2/src/commands/PutSessionCommand.ts diff --git a/clients/client-lex-runtime-v2/commands/RecognizeTextCommand.ts b/clients/client-lex-runtime-v2/src/commands/RecognizeTextCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/RecognizeTextCommand.ts rename to clients/client-lex-runtime-v2/src/commands/RecognizeTextCommand.ts diff --git a/clients/client-lex-runtime-v2/commands/RecognizeUtteranceCommand.ts b/clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/RecognizeUtteranceCommand.ts rename to clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts diff --git a/clients/client-lex-runtime-v2/commands/StartConversationCommand.ts b/clients/client-lex-runtime-v2/src/commands/StartConversationCommand.ts similarity index 100% rename from clients/client-lex-runtime-v2/commands/StartConversationCommand.ts rename to clients/client-lex-runtime-v2/src/commands/StartConversationCommand.ts diff --git a/clients/client-lex-runtime-v2/endpoints.ts b/clients/client-lex-runtime-v2/src/endpoints.ts similarity index 100% rename from clients/client-lex-runtime-v2/endpoints.ts rename to clients/client-lex-runtime-v2/src/endpoints.ts diff --git a/clients/client-lex-runtime-v2/index.ts b/clients/client-lex-runtime-v2/src/index.ts similarity index 100% rename from clients/client-lex-runtime-v2/index.ts rename to clients/client-lex-runtime-v2/src/index.ts diff --git a/clients/client-lex-runtime-v2/models/index.ts b/clients/client-lex-runtime-v2/src/models/index.ts similarity index 100% rename from clients/client-lex-runtime-v2/models/index.ts rename to clients/client-lex-runtime-v2/src/models/index.ts diff --git a/clients/client-lex-runtime-v2/models/models_0.ts b/clients/client-lex-runtime-v2/src/models/models_0.ts similarity index 100% rename from clients/client-lex-runtime-v2/models/models_0.ts rename to clients/client-lex-runtime-v2/src/models/models_0.ts diff --git a/clients/client-lex-runtime-v2/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lex-runtime-v2/protocols/Aws_restJson1.ts rename to clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lex-runtime-v2/src/runtimeConfig.browser.ts b/clients/client-lex-runtime-v2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..45bbc4f7cb0a --- /dev/null +++ b/clients/client-lex-runtime-v2/src/runtimeConfig.browser.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidFunction, invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LexRuntimeV2ClientConfig } from "./LexRuntimeV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamPayloadHandlerProvider: + config?.eventStreamPayloadHandlerProvider ?? + (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-runtime-v2/runtimeConfig.native.ts b/clients/client-lex-runtime-v2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lex-runtime-v2/runtimeConfig.native.ts rename to clients/client-lex-runtime-v2/src/runtimeConfig.native.ts diff --git a/clients/client-lex-runtime-v2/runtimeConfig.shared.ts b/clients/client-lex-runtime-v2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lex-runtime-v2/runtimeConfig.shared.ts rename to clients/client-lex-runtime-v2/src/runtimeConfig.shared.ts diff --git a/clients/client-lex-runtime-v2/src/runtimeConfig.ts b/clients/client-lex-runtime-v2/src/runtimeConfig.ts new file mode 100644 index 000000000000..0710b5ded862 --- /dev/null +++ b/clients/client-lex-runtime-v2/src/runtimeConfig.ts @@ -0,0 +1,50 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LexRuntimeV2ClientConfig } from "./LexRuntimeV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttp2Handler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lex-runtime-v2/tsconfig.es.json b/clients/client-lex-runtime-v2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lex-runtime-v2/tsconfig.es.json +++ b/clients/client-lex-runtime-v2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lex-runtime-v2/tsconfig.json b/clients/client-lex-runtime-v2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lex-runtime-v2/tsconfig.json +++ b/clients/client-lex-runtime-v2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lex-runtime-v2/tsconfig.types.json b/clients/client-lex-runtime-v2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lex-runtime-v2/tsconfig.types.json +++ b/clients/client-lex-runtime-v2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-license-manager/.gitignore b/clients/client-license-manager/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-license-manager/.gitignore +++ b/clients/client-license-manager/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-license-manager/package.json b/clients/client-license-manager/package.json index baac08aa3f43..a6b3c3d03895 100644 --- a/clients/client-license-manager/package.json +++ b/clients/client-license-manager/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-license-manager", "repository": { "type": "git", diff --git a/clients/client-license-manager/runtimeConfig.browser.ts b/clients/client-license-manager/runtimeConfig.browser.ts deleted file mode 100644 index 188beaf2070e..000000000000 --- a/clients/client-license-manager/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LicenseManagerClientConfig } from "./LicenseManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-license-manager/runtimeConfig.ts b/clients/client-license-manager/runtimeConfig.ts deleted file mode 100644 index 516fc4290b6d..000000000000 --- a/clients/client-license-manager/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LicenseManagerClientConfig } from "./LicenseManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-license-manager/LicenseManager.ts b/clients/client-license-manager/src/LicenseManager.ts similarity index 100% rename from clients/client-license-manager/LicenseManager.ts rename to clients/client-license-manager/src/LicenseManager.ts diff --git a/clients/client-license-manager/LicenseManagerClient.ts b/clients/client-license-manager/src/LicenseManagerClient.ts similarity index 100% rename from clients/client-license-manager/LicenseManagerClient.ts rename to clients/client-license-manager/src/LicenseManagerClient.ts diff --git a/clients/client-license-manager/commands/AcceptGrantCommand.ts b/clients/client-license-manager/src/commands/AcceptGrantCommand.ts similarity index 100% rename from clients/client-license-manager/commands/AcceptGrantCommand.ts rename to clients/client-license-manager/src/commands/AcceptGrantCommand.ts diff --git a/clients/client-license-manager/commands/CheckInLicenseCommand.ts b/clients/client-license-manager/src/commands/CheckInLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CheckInLicenseCommand.ts rename to clients/client-license-manager/src/commands/CheckInLicenseCommand.ts diff --git a/clients/client-license-manager/commands/CheckoutBorrowLicenseCommand.ts b/clients/client-license-manager/src/commands/CheckoutBorrowLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CheckoutBorrowLicenseCommand.ts rename to clients/client-license-manager/src/commands/CheckoutBorrowLicenseCommand.ts diff --git a/clients/client-license-manager/commands/CheckoutLicenseCommand.ts b/clients/client-license-manager/src/commands/CheckoutLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CheckoutLicenseCommand.ts rename to clients/client-license-manager/src/commands/CheckoutLicenseCommand.ts diff --git a/clients/client-license-manager/commands/CreateGrantCommand.ts b/clients/client-license-manager/src/commands/CreateGrantCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateGrantCommand.ts rename to clients/client-license-manager/src/commands/CreateGrantCommand.ts diff --git a/clients/client-license-manager/commands/CreateGrantVersionCommand.ts b/clients/client-license-manager/src/commands/CreateGrantVersionCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateGrantVersionCommand.ts rename to clients/client-license-manager/src/commands/CreateGrantVersionCommand.ts diff --git a/clients/client-license-manager/commands/CreateLicenseCommand.ts b/clients/client-license-manager/src/commands/CreateLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateLicenseCommand.ts rename to clients/client-license-manager/src/commands/CreateLicenseCommand.ts diff --git a/clients/client-license-manager/commands/CreateLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/CreateLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/CreateLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/CreateLicenseConversionTaskForResourceCommand.ts b/clients/client-license-manager/src/commands/CreateLicenseConversionTaskForResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateLicenseConversionTaskForResourceCommand.ts rename to clients/client-license-manager/src/commands/CreateLicenseConversionTaskForResourceCommand.ts diff --git a/clients/client-license-manager/commands/CreateLicenseManagerReportGeneratorCommand.ts b/clients/client-license-manager/src/commands/CreateLicenseManagerReportGeneratorCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateLicenseManagerReportGeneratorCommand.ts rename to clients/client-license-manager/src/commands/CreateLicenseManagerReportGeneratorCommand.ts diff --git a/clients/client-license-manager/commands/CreateLicenseVersionCommand.ts b/clients/client-license-manager/src/commands/CreateLicenseVersionCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateLicenseVersionCommand.ts rename to clients/client-license-manager/src/commands/CreateLicenseVersionCommand.ts diff --git a/clients/client-license-manager/commands/CreateTokenCommand.ts b/clients/client-license-manager/src/commands/CreateTokenCommand.ts similarity index 100% rename from clients/client-license-manager/commands/CreateTokenCommand.ts rename to clients/client-license-manager/src/commands/CreateTokenCommand.ts diff --git a/clients/client-license-manager/commands/DeleteGrantCommand.ts b/clients/client-license-manager/src/commands/DeleteGrantCommand.ts similarity index 100% rename from clients/client-license-manager/commands/DeleteGrantCommand.ts rename to clients/client-license-manager/src/commands/DeleteGrantCommand.ts diff --git a/clients/client-license-manager/commands/DeleteLicenseCommand.ts b/clients/client-license-manager/src/commands/DeleteLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/DeleteLicenseCommand.ts rename to clients/client-license-manager/src/commands/DeleteLicenseCommand.ts diff --git a/clients/client-license-manager/commands/DeleteLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/DeleteLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/DeleteLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/DeleteLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/DeleteLicenseManagerReportGeneratorCommand.ts b/clients/client-license-manager/src/commands/DeleteLicenseManagerReportGeneratorCommand.ts similarity index 100% rename from clients/client-license-manager/commands/DeleteLicenseManagerReportGeneratorCommand.ts rename to clients/client-license-manager/src/commands/DeleteLicenseManagerReportGeneratorCommand.ts diff --git a/clients/client-license-manager/commands/DeleteTokenCommand.ts b/clients/client-license-manager/src/commands/DeleteTokenCommand.ts similarity index 100% rename from clients/client-license-manager/commands/DeleteTokenCommand.ts rename to clients/client-license-manager/src/commands/DeleteTokenCommand.ts diff --git a/clients/client-license-manager/commands/ExtendLicenseConsumptionCommand.ts b/clients/client-license-manager/src/commands/ExtendLicenseConsumptionCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ExtendLicenseConsumptionCommand.ts rename to clients/client-license-manager/src/commands/ExtendLicenseConsumptionCommand.ts diff --git a/clients/client-license-manager/commands/GetAccessTokenCommand.ts b/clients/client-license-manager/src/commands/GetAccessTokenCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetAccessTokenCommand.ts rename to clients/client-license-manager/src/commands/GetAccessTokenCommand.ts diff --git a/clients/client-license-manager/commands/GetGrantCommand.ts b/clients/client-license-manager/src/commands/GetGrantCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetGrantCommand.ts rename to clients/client-license-manager/src/commands/GetGrantCommand.ts diff --git a/clients/client-license-manager/commands/GetLicenseCommand.ts b/clients/client-license-manager/src/commands/GetLicenseCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetLicenseCommand.ts rename to clients/client-license-manager/src/commands/GetLicenseCommand.ts diff --git a/clients/client-license-manager/commands/GetLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/GetLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/GetLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/GetLicenseConversionTaskCommand.ts b/clients/client-license-manager/src/commands/GetLicenseConversionTaskCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetLicenseConversionTaskCommand.ts rename to clients/client-license-manager/src/commands/GetLicenseConversionTaskCommand.ts diff --git a/clients/client-license-manager/commands/GetLicenseManagerReportGeneratorCommand.ts b/clients/client-license-manager/src/commands/GetLicenseManagerReportGeneratorCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetLicenseManagerReportGeneratorCommand.ts rename to clients/client-license-manager/src/commands/GetLicenseManagerReportGeneratorCommand.ts diff --git a/clients/client-license-manager/commands/GetLicenseUsageCommand.ts b/clients/client-license-manager/src/commands/GetLicenseUsageCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetLicenseUsageCommand.ts rename to clients/client-license-manager/src/commands/GetLicenseUsageCommand.ts diff --git a/clients/client-license-manager/commands/GetServiceSettingsCommand.ts b/clients/client-license-manager/src/commands/GetServiceSettingsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/GetServiceSettingsCommand.ts rename to clients/client-license-manager/src/commands/GetServiceSettingsCommand.ts diff --git a/clients/client-license-manager/commands/ListAssociationsForLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/ListAssociationsForLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListAssociationsForLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/ListAssociationsForLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/ListDistributedGrantsCommand.ts b/clients/client-license-manager/src/commands/ListDistributedGrantsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListDistributedGrantsCommand.ts rename to clients/client-license-manager/src/commands/ListDistributedGrantsCommand.ts diff --git a/clients/client-license-manager/commands/ListFailuresForLicenseConfigurationOperationsCommand.ts b/clients/client-license-manager/src/commands/ListFailuresForLicenseConfigurationOperationsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListFailuresForLicenseConfigurationOperationsCommand.ts rename to clients/client-license-manager/src/commands/ListFailuresForLicenseConfigurationOperationsCommand.ts diff --git a/clients/client-license-manager/commands/ListLicenseConfigurationsCommand.ts b/clients/client-license-manager/src/commands/ListLicenseConfigurationsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicenseConfigurationsCommand.ts rename to clients/client-license-manager/src/commands/ListLicenseConfigurationsCommand.ts diff --git a/clients/client-license-manager/commands/ListLicenseConversionTasksCommand.ts b/clients/client-license-manager/src/commands/ListLicenseConversionTasksCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicenseConversionTasksCommand.ts rename to clients/client-license-manager/src/commands/ListLicenseConversionTasksCommand.ts diff --git a/clients/client-license-manager/commands/ListLicenseManagerReportGeneratorsCommand.ts b/clients/client-license-manager/src/commands/ListLicenseManagerReportGeneratorsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicenseManagerReportGeneratorsCommand.ts rename to clients/client-license-manager/src/commands/ListLicenseManagerReportGeneratorsCommand.ts diff --git a/clients/client-license-manager/commands/ListLicenseSpecificationsForResourceCommand.ts b/clients/client-license-manager/src/commands/ListLicenseSpecificationsForResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicenseSpecificationsForResourceCommand.ts rename to clients/client-license-manager/src/commands/ListLicenseSpecificationsForResourceCommand.ts diff --git a/clients/client-license-manager/commands/ListLicenseVersionsCommand.ts b/clients/client-license-manager/src/commands/ListLicenseVersionsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicenseVersionsCommand.ts rename to clients/client-license-manager/src/commands/ListLicenseVersionsCommand.ts diff --git a/clients/client-license-manager/commands/ListLicensesCommand.ts b/clients/client-license-manager/src/commands/ListLicensesCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListLicensesCommand.ts rename to clients/client-license-manager/src/commands/ListLicensesCommand.ts diff --git a/clients/client-license-manager/commands/ListReceivedGrantsCommand.ts b/clients/client-license-manager/src/commands/ListReceivedGrantsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListReceivedGrantsCommand.ts rename to clients/client-license-manager/src/commands/ListReceivedGrantsCommand.ts diff --git a/clients/client-license-manager/commands/ListReceivedLicensesCommand.ts b/clients/client-license-manager/src/commands/ListReceivedLicensesCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListReceivedLicensesCommand.ts rename to clients/client-license-manager/src/commands/ListReceivedLicensesCommand.ts diff --git a/clients/client-license-manager/commands/ListResourceInventoryCommand.ts b/clients/client-license-manager/src/commands/ListResourceInventoryCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListResourceInventoryCommand.ts rename to clients/client-license-manager/src/commands/ListResourceInventoryCommand.ts diff --git a/clients/client-license-manager/commands/ListTagsForResourceCommand.ts b/clients/client-license-manager/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListTagsForResourceCommand.ts rename to clients/client-license-manager/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-license-manager/commands/ListTokensCommand.ts b/clients/client-license-manager/src/commands/ListTokensCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListTokensCommand.ts rename to clients/client-license-manager/src/commands/ListTokensCommand.ts diff --git a/clients/client-license-manager/commands/ListUsageForLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/ListUsageForLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/ListUsageForLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/ListUsageForLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/RejectGrantCommand.ts b/clients/client-license-manager/src/commands/RejectGrantCommand.ts similarity index 100% rename from clients/client-license-manager/commands/RejectGrantCommand.ts rename to clients/client-license-manager/src/commands/RejectGrantCommand.ts diff --git a/clients/client-license-manager/commands/TagResourceCommand.ts b/clients/client-license-manager/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/TagResourceCommand.ts rename to clients/client-license-manager/src/commands/TagResourceCommand.ts diff --git a/clients/client-license-manager/commands/UntagResourceCommand.ts b/clients/client-license-manager/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/UntagResourceCommand.ts rename to clients/client-license-manager/src/commands/UntagResourceCommand.ts diff --git a/clients/client-license-manager/commands/UpdateLicenseConfigurationCommand.ts b/clients/client-license-manager/src/commands/UpdateLicenseConfigurationCommand.ts similarity index 100% rename from clients/client-license-manager/commands/UpdateLicenseConfigurationCommand.ts rename to clients/client-license-manager/src/commands/UpdateLicenseConfigurationCommand.ts diff --git a/clients/client-license-manager/commands/UpdateLicenseManagerReportGeneratorCommand.ts b/clients/client-license-manager/src/commands/UpdateLicenseManagerReportGeneratorCommand.ts similarity index 100% rename from clients/client-license-manager/commands/UpdateLicenseManagerReportGeneratorCommand.ts rename to clients/client-license-manager/src/commands/UpdateLicenseManagerReportGeneratorCommand.ts diff --git a/clients/client-license-manager/commands/UpdateLicenseSpecificationsForResourceCommand.ts b/clients/client-license-manager/src/commands/UpdateLicenseSpecificationsForResourceCommand.ts similarity index 100% rename from clients/client-license-manager/commands/UpdateLicenseSpecificationsForResourceCommand.ts rename to clients/client-license-manager/src/commands/UpdateLicenseSpecificationsForResourceCommand.ts diff --git a/clients/client-license-manager/commands/UpdateServiceSettingsCommand.ts b/clients/client-license-manager/src/commands/UpdateServiceSettingsCommand.ts similarity index 100% rename from clients/client-license-manager/commands/UpdateServiceSettingsCommand.ts rename to clients/client-license-manager/src/commands/UpdateServiceSettingsCommand.ts diff --git a/clients/client-license-manager/endpoints.ts b/clients/client-license-manager/src/endpoints.ts similarity index 100% rename from clients/client-license-manager/endpoints.ts rename to clients/client-license-manager/src/endpoints.ts diff --git a/clients/client-license-manager/index.ts b/clients/client-license-manager/src/index.ts similarity index 100% rename from clients/client-license-manager/index.ts rename to clients/client-license-manager/src/index.ts diff --git a/clients/client-license-manager/models/index.ts b/clients/client-license-manager/src/models/index.ts similarity index 100% rename from clients/client-license-manager/models/index.ts rename to clients/client-license-manager/src/models/index.ts diff --git a/clients/client-license-manager/models/models_0.ts b/clients/client-license-manager/src/models/models_0.ts similarity index 100% rename from clients/client-license-manager/models/models_0.ts rename to clients/client-license-manager/src/models/models_0.ts diff --git a/clients/client-license-manager/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-license-manager/protocols/Aws_json1_1.ts rename to clients/client-license-manager/src/protocols/Aws_json1_1.ts diff --git a/clients/client-license-manager/src/runtimeConfig.browser.ts b/clients/client-license-manager/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bfd6dea5b55c --- /dev/null +++ b/clients/client-license-manager/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LicenseManagerClientConfig } from "./LicenseManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-license-manager/runtimeConfig.native.ts b/clients/client-license-manager/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-license-manager/runtimeConfig.native.ts rename to clients/client-license-manager/src/runtimeConfig.native.ts diff --git a/clients/client-license-manager/runtimeConfig.shared.ts b/clients/client-license-manager/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-license-manager/runtimeConfig.shared.ts rename to clients/client-license-manager/src/runtimeConfig.shared.ts diff --git a/clients/client-license-manager/src/runtimeConfig.ts b/clients/client-license-manager/src/runtimeConfig.ts new file mode 100644 index 000000000000..b1726b4b7138 --- /dev/null +++ b/clients/client-license-manager/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LicenseManagerClientConfig } from "./LicenseManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-license-manager/tsconfig.es.json b/clients/client-license-manager/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-license-manager/tsconfig.es.json +++ b/clients/client-license-manager/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-license-manager/tsconfig.json b/clients/client-license-manager/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-license-manager/tsconfig.json +++ b/clients/client-license-manager/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-license-manager/tsconfig.types.json b/clients/client-license-manager/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-license-manager/tsconfig.types.json +++ b/clients/client-license-manager/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lightsail/.gitignore b/clients/client-lightsail/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lightsail/.gitignore +++ b/clients/client-lightsail/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lightsail/package.json b/clients/client-lightsail/package.json index 805e92bf8610..3c26a93ec586 100644 --- a/clients/client-lightsail/package.json +++ b/clients/client-lightsail/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lightsail", "repository": { "type": "git", diff --git a/clients/client-lightsail/runtimeConfig.browser.ts b/clients/client-lightsail/runtimeConfig.browser.ts deleted file mode 100644 index b65ece7bb977..000000000000 --- a/clients/client-lightsail/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LightsailClientConfig } from "./LightsailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LightsailClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lightsail/runtimeConfig.ts b/clients/client-lightsail/runtimeConfig.ts deleted file mode 100644 index 9d34106bf781..000000000000 --- a/clients/client-lightsail/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LightsailClientConfig } from "./LightsailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LightsailClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lightsail/Lightsail.ts b/clients/client-lightsail/src/Lightsail.ts similarity index 100% rename from clients/client-lightsail/Lightsail.ts rename to clients/client-lightsail/src/Lightsail.ts diff --git a/clients/client-lightsail/LightsailClient.ts b/clients/client-lightsail/src/LightsailClient.ts similarity index 100% rename from clients/client-lightsail/LightsailClient.ts rename to clients/client-lightsail/src/LightsailClient.ts diff --git a/clients/client-lightsail/commands/AllocateStaticIpCommand.ts b/clients/client-lightsail/src/commands/AllocateStaticIpCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AllocateStaticIpCommand.ts rename to clients/client-lightsail/src/commands/AllocateStaticIpCommand.ts diff --git a/clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts b/clients/client-lightsail/src/commands/AttachCertificateToDistributionCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AttachCertificateToDistributionCommand.ts rename to clients/client-lightsail/src/commands/AttachCertificateToDistributionCommand.ts diff --git a/clients/client-lightsail/commands/AttachDiskCommand.ts b/clients/client-lightsail/src/commands/AttachDiskCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AttachDiskCommand.ts rename to clients/client-lightsail/src/commands/AttachDiskCommand.ts diff --git a/clients/client-lightsail/commands/AttachInstancesToLoadBalancerCommand.ts b/clients/client-lightsail/src/commands/AttachInstancesToLoadBalancerCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AttachInstancesToLoadBalancerCommand.ts rename to clients/client-lightsail/src/commands/AttachInstancesToLoadBalancerCommand.ts diff --git a/clients/client-lightsail/commands/AttachLoadBalancerTlsCertificateCommand.ts b/clients/client-lightsail/src/commands/AttachLoadBalancerTlsCertificateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AttachLoadBalancerTlsCertificateCommand.ts rename to clients/client-lightsail/src/commands/AttachLoadBalancerTlsCertificateCommand.ts diff --git a/clients/client-lightsail/commands/AttachStaticIpCommand.ts b/clients/client-lightsail/src/commands/AttachStaticIpCommand.ts similarity index 100% rename from clients/client-lightsail/commands/AttachStaticIpCommand.ts rename to clients/client-lightsail/src/commands/AttachStaticIpCommand.ts diff --git a/clients/client-lightsail/commands/CloseInstancePublicPortsCommand.ts b/clients/client-lightsail/src/commands/CloseInstancePublicPortsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CloseInstancePublicPortsCommand.ts rename to clients/client-lightsail/src/commands/CloseInstancePublicPortsCommand.ts diff --git a/clients/client-lightsail/commands/CopySnapshotCommand.ts b/clients/client-lightsail/src/commands/CopySnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CopySnapshotCommand.ts rename to clients/client-lightsail/src/commands/CopySnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateBucketAccessKeyCommand.ts b/clients/client-lightsail/src/commands/CreateBucketAccessKeyCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateBucketAccessKeyCommand.ts rename to clients/client-lightsail/src/commands/CreateBucketAccessKeyCommand.ts diff --git a/clients/client-lightsail/commands/CreateBucketCommand.ts b/clients/client-lightsail/src/commands/CreateBucketCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateBucketCommand.ts rename to clients/client-lightsail/src/commands/CreateBucketCommand.ts diff --git a/clients/client-lightsail/commands/CreateCertificateCommand.ts b/clients/client-lightsail/src/commands/CreateCertificateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateCertificateCommand.ts rename to clients/client-lightsail/src/commands/CreateCertificateCommand.ts diff --git a/clients/client-lightsail/commands/CreateCloudFormationStackCommand.ts b/clients/client-lightsail/src/commands/CreateCloudFormationStackCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateCloudFormationStackCommand.ts rename to clients/client-lightsail/src/commands/CreateCloudFormationStackCommand.ts diff --git a/clients/client-lightsail/commands/CreateContactMethodCommand.ts b/clients/client-lightsail/src/commands/CreateContactMethodCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateContactMethodCommand.ts rename to clients/client-lightsail/src/commands/CreateContactMethodCommand.ts diff --git a/clients/client-lightsail/commands/CreateContainerServiceCommand.ts b/clients/client-lightsail/src/commands/CreateContainerServiceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateContainerServiceCommand.ts rename to clients/client-lightsail/src/commands/CreateContainerServiceCommand.ts diff --git a/clients/client-lightsail/commands/CreateContainerServiceDeploymentCommand.ts b/clients/client-lightsail/src/commands/CreateContainerServiceDeploymentCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateContainerServiceDeploymentCommand.ts rename to clients/client-lightsail/src/commands/CreateContainerServiceDeploymentCommand.ts diff --git a/clients/client-lightsail/commands/CreateContainerServiceRegistryLoginCommand.ts b/clients/client-lightsail/src/commands/CreateContainerServiceRegistryLoginCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateContainerServiceRegistryLoginCommand.ts rename to clients/client-lightsail/src/commands/CreateContainerServiceRegistryLoginCommand.ts diff --git a/clients/client-lightsail/commands/CreateDiskCommand.ts b/clients/client-lightsail/src/commands/CreateDiskCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDiskCommand.ts rename to clients/client-lightsail/src/commands/CreateDiskCommand.ts diff --git a/clients/client-lightsail/commands/CreateDiskFromSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateDiskFromSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDiskFromSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateDiskFromSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateDiskSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateDiskSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDiskSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateDiskSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateDistributionCommand.ts b/clients/client-lightsail/src/commands/CreateDistributionCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDistributionCommand.ts rename to clients/client-lightsail/src/commands/CreateDistributionCommand.ts diff --git a/clients/client-lightsail/commands/CreateDomainCommand.ts b/clients/client-lightsail/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDomainCommand.ts rename to clients/client-lightsail/src/commands/CreateDomainCommand.ts diff --git a/clients/client-lightsail/commands/CreateDomainEntryCommand.ts b/clients/client-lightsail/src/commands/CreateDomainEntryCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateDomainEntryCommand.ts rename to clients/client-lightsail/src/commands/CreateDomainEntryCommand.ts diff --git a/clients/client-lightsail/commands/CreateInstanceSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateInstanceSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateInstanceSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateInstanceSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateInstancesCommand.ts b/clients/client-lightsail/src/commands/CreateInstancesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateInstancesCommand.ts rename to clients/client-lightsail/src/commands/CreateInstancesCommand.ts diff --git a/clients/client-lightsail/commands/CreateInstancesFromSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateInstancesFromSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateInstancesFromSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateInstancesFromSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateKeyPairCommand.ts b/clients/client-lightsail/src/commands/CreateKeyPairCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateKeyPairCommand.ts rename to clients/client-lightsail/src/commands/CreateKeyPairCommand.ts diff --git a/clients/client-lightsail/commands/CreateLoadBalancerCommand.ts b/clients/client-lightsail/src/commands/CreateLoadBalancerCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateLoadBalancerCommand.ts rename to clients/client-lightsail/src/commands/CreateLoadBalancerCommand.ts diff --git a/clients/client-lightsail/commands/CreateLoadBalancerTlsCertificateCommand.ts b/clients/client-lightsail/src/commands/CreateLoadBalancerTlsCertificateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateLoadBalancerTlsCertificateCommand.ts rename to clients/client-lightsail/src/commands/CreateLoadBalancerTlsCertificateCommand.ts diff --git a/clients/client-lightsail/commands/CreateRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/CreateRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/CreateRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/CreateRelationalDatabaseFromSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateRelationalDatabaseFromSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateRelationalDatabaseFromSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateRelationalDatabaseFromSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/CreateRelationalDatabaseSnapshotCommand.ts b/clients/client-lightsail/src/commands/CreateRelationalDatabaseSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/CreateRelationalDatabaseSnapshotCommand.ts rename to clients/client-lightsail/src/commands/CreateRelationalDatabaseSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/DeleteAlarmCommand.ts b/clients/client-lightsail/src/commands/DeleteAlarmCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteAlarmCommand.ts rename to clients/client-lightsail/src/commands/DeleteAlarmCommand.ts diff --git a/clients/client-lightsail/commands/DeleteAutoSnapshotCommand.ts b/clients/client-lightsail/src/commands/DeleteAutoSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteAutoSnapshotCommand.ts rename to clients/client-lightsail/src/commands/DeleteAutoSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/DeleteBucketAccessKeyCommand.ts b/clients/client-lightsail/src/commands/DeleteBucketAccessKeyCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteBucketAccessKeyCommand.ts rename to clients/client-lightsail/src/commands/DeleteBucketAccessKeyCommand.ts diff --git a/clients/client-lightsail/commands/DeleteBucketCommand.ts b/clients/client-lightsail/src/commands/DeleteBucketCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteBucketCommand.ts rename to clients/client-lightsail/src/commands/DeleteBucketCommand.ts diff --git a/clients/client-lightsail/commands/DeleteCertificateCommand.ts b/clients/client-lightsail/src/commands/DeleteCertificateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteCertificateCommand.ts rename to clients/client-lightsail/src/commands/DeleteCertificateCommand.ts diff --git a/clients/client-lightsail/commands/DeleteContactMethodCommand.ts b/clients/client-lightsail/src/commands/DeleteContactMethodCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteContactMethodCommand.ts rename to clients/client-lightsail/src/commands/DeleteContactMethodCommand.ts diff --git a/clients/client-lightsail/commands/DeleteContainerImageCommand.ts b/clients/client-lightsail/src/commands/DeleteContainerImageCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteContainerImageCommand.ts rename to clients/client-lightsail/src/commands/DeleteContainerImageCommand.ts diff --git a/clients/client-lightsail/commands/DeleteContainerServiceCommand.ts b/clients/client-lightsail/src/commands/DeleteContainerServiceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteContainerServiceCommand.ts rename to clients/client-lightsail/src/commands/DeleteContainerServiceCommand.ts diff --git a/clients/client-lightsail/commands/DeleteDiskCommand.ts b/clients/client-lightsail/src/commands/DeleteDiskCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteDiskCommand.ts rename to clients/client-lightsail/src/commands/DeleteDiskCommand.ts diff --git a/clients/client-lightsail/commands/DeleteDiskSnapshotCommand.ts b/clients/client-lightsail/src/commands/DeleteDiskSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteDiskSnapshotCommand.ts rename to clients/client-lightsail/src/commands/DeleteDiskSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/DeleteDistributionCommand.ts b/clients/client-lightsail/src/commands/DeleteDistributionCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteDistributionCommand.ts rename to clients/client-lightsail/src/commands/DeleteDistributionCommand.ts diff --git a/clients/client-lightsail/commands/DeleteDomainCommand.ts b/clients/client-lightsail/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteDomainCommand.ts rename to clients/client-lightsail/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-lightsail/commands/DeleteDomainEntryCommand.ts b/clients/client-lightsail/src/commands/DeleteDomainEntryCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteDomainEntryCommand.ts rename to clients/client-lightsail/src/commands/DeleteDomainEntryCommand.ts diff --git a/clients/client-lightsail/commands/DeleteInstanceCommand.ts b/clients/client-lightsail/src/commands/DeleteInstanceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteInstanceCommand.ts rename to clients/client-lightsail/src/commands/DeleteInstanceCommand.ts diff --git a/clients/client-lightsail/commands/DeleteInstanceSnapshotCommand.ts b/clients/client-lightsail/src/commands/DeleteInstanceSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteInstanceSnapshotCommand.ts rename to clients/client-lightsail/src/commands/DeleteInstanceSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/DeleteKeyPairCommand.ts b/clients/client-lightsail/src/commands/DeleteKeyPairCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteKeyPairCommand.ts rename to clients/client-lightsail/src/commands/DeleteKeyPairCommand.ts diff --git a/clients/client-lightsail/commands/DeleteKnownHostKeysCommand.ts b/clients/client-lightsail/src/commands/DeleteKnownHostKeysCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteKnownHostKeysCommand.ts rename to clients/client-lightsail/src/commands/DeleteKnownHostKeysCommand.ts diff --git a/clients/client-lightsail/commands/DeleteLoadBalancerCommand.ts b/clients/client-lightsail/src/commands/DeleteLoadBalancerCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteLoadBalancerCommand.ts rename to clients/client-lightsail/src/commands/DeleteLoadBalancerCommand.ts diff --git a/clients/client-lightsail/commands/DeleteLoadBalancerTlsCertificateCommand.ts b/clients/client-lightsail/src/commands/DeleteLoadBalancerTlsCertificateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteLoadBalancerTlsCertificateCommand.ts rename to clients/client-lightsail/src/commands/DeleteLoadBalancerTlsCertificateCommand.ts diff --git a/clients/client-lightsail/commands/DeleteRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/DeleteRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/DeleteRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/DeleteRelationalDatabaseSnapshotCommand.ts b/clients/client-lightsail/src/commands/DeleteRelationalDatabaseSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DeleteRelationalDatabaseSnapshotCommand.ts rename to clients/client-lightsail/src/commands/DeleteRelationalDatabaseSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/DetachCertificateFromDistributionCommand.ts b/clients/client-lightsail/src/commands/DetachCertificateFromDistributionCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DetachCertificateFromDistributionCommand.ts rename to clients/client-lightsail/src/commands/DetachCertificateFromDistributionCommand.ts diff --git a/clients/client-lightsail/commands/DetachDiskCommand.ts b/clients/client-lightsail/src/commands/DetachDiskCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DetachDiskCommand.ts rename to clients/client-lightsail/src/commands/DetachDiskCommand.ts diff --git a/clients/client-lightsail/commands/DetachInstancesFromLoadBalancerCommand.ts b/clients/client-lightsail/src/commands/DetachInstancesFromLoadBalancerCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DetachInstancesFromLoadBalancerCommand.ts rename to clients/client-lightsail/src/commands/DetachInstancesFromLoadBalancerCommand.ts diff --git a/clients/client-lightsail/commands/DetachStaticIpCommand.ts b/clients/client-lightsail/src/commands/DetachStaticIpCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DetachStaticIpCommand.ts rename to clients/client-lightsail/src/commands/DetachStaticIpCommand.ts diff --git a/clients/client-lightsail/commands/DisableAddOnCommand.ts b/clients/client-lightsail/src/commands/DisableAddOnCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DisableAddOnCommand.ts rename to clients/client-lightsail/src/commands/DisableAddOnCommand.ts diff --git a/clients/client-lightsail/commands/DownloadDefaultKeyPairCommand.ts b/clients/client-lightsail/src/commands/DownloadDefaultKeyPairCommand.ts similarity index 100% rename from clients/client-lightsail/commands/DownloadDefaultKeyPairCommand.ts rename to clients/client-lightsail/src/commands/DownloadDefaultKeyPairCommand.ts diff --git a/clients/client-lightsail/commands/EnableAddOnCommand.ts b/clients/client-lightsail/src/commands/EnableAddOnCommand.ts similarity index 100% rename from clients/client-lightsail/commands/EnableAddOnCommand.ts rename to clients/client-lightsail/src/commands/EnableAddOnCommand.ts diff --git a/clients/client-lightsail/commands/ExportSnapshotCommand.ts b/clients/client-lightsail/src/commands/ExportSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/ExportSnapshotCommand.ts rename to clients/client-lightsail/src/commands/ExportSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/GetActiveNamesCommand.ts b/clients/client-lightsail/src/commands/GetActiveNamesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetActiveNamesCommand.ts rename to clients/client-lightsail/src/commands/GetActiveNamesCommand.ts diff --git a/clients/client-lightsail/commands/GetAlarmsCommand.ts b/clients/client-lightsail/src/commands/GetAlarmsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetAlarmsCommand.ts rename to clients/client-lightsail/src/commands/GetAlarmsCommand.ts diff --git a/clients/client-lightsail/commands/GetAutoSnapshotsCommand.ts b/clients/client-lightsail/src/commands/GetAutoSnapshotsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetAutoSnapshotsCommand.ts rename to clients/client-lightsail/src/commands/GetAutoSnapshotsCommand.ts diff --git a/clients/client-lightsail/commands/GetBlueprintsCommand.ts b/clients/client-lightsail/src/commands/GetBlueprintsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBlueprintsCommand.ts rename to clients/client-lightsail/src/commands/GetBlueprintsCommand.ts diff --git a/clients/client-lightsail/commands/GetBucketAccessKeysCommand.ts b/clients/client-lightsail/src/commands/GetBucketAccessKeysCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBucketAccessKeysCommand.ts rename to clients/client-lightsail/src/commands/GetBucketAccessKeysCommand.ts diff --git a/clients/client-lightsail/commands/GetBucketBundlesCommand.ts b/clients/client-lightsail/src/commands/GetBucketBundlesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBucketBundlesCommand.ts rename to clients/client-lightsail/src/commands/GetBucketBundlesCommand.ts diff --git a/clients/client-lightsail/commands/GetBucketMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetBucketMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBucketMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetBucketMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetBucketsCommand.ts b/clients/client-lightsail/src/commands/GetBucketsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBucketsCommand.ts rename to clients/client-lightsail/src/commands/GetBucketsCommand.ts diff --git a/clients/client-lightsail/commands/GetBundlesCommand.ts b/clients/client-lightsail/src/commands/GetBundlesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetBundlesCommand.ts rename to clients/client-lightsail/src/commands/GetBundlesCommand.ts diff --git a/clients/client-lightsail/commands/GetCertificatesCommand.ts b/clients/client-lightsail/src/commands/GetCertificatesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetCertificatesCommand.ts rename to clients/client-lightsail/src/commands/GetCertificatesCommand.ts diff --git a/clients/client-lightsail/commands/GetCloudFormationStackRecordsCommand.ts b/clients/client-lightsail/src/commands/GetCloudFormationStackRecordsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetCloudFormationStackRecordsCommand.ts rename to clients/client-lightsail/src/commands/GetCloudFormationStackRecordsCommand.ts diff --git a/clients/client-lightsail/commands/GetContactMethodsCommand.ts b/clients/client-lightsail/src/commands/GetContactMethodsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContactMethodsCommand.ts rename to clients/client-lightsail/src/commands/GetContactMethodsCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerAPIMetadataCommand.ts b/clients/client-lightsail/src/commands/GetContainerAPIMetadataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerAPIMetadataCommand.ts rename to clients/client-lightsail/src/commands/GetContainerAPIMetadataCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerImagesCommand.ts b/clients/client-lightsail/src/commands/GetContainerImagesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerImagesCommand.ts rename to clients/client-lightsail/src/commands/GetContainerImagesCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerLogCommand.ts b/clients/client-lightsail/src/commands/GetContainerLogCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerLogCommand.ts rename to clients/client-lightsail/src/commands/GetContainerLogCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerServiceDeploymentsCommand.ts b/clients/client-lightsail/src/commands/GetContainerServiceDeploymentsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerServiceDeploymentsCommand.ts rename to clients/client-lightsail/src/commands/GetContainerServiceDeploymentsCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerServiceMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetContainerServiceMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerServiceMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetContainerServiceMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerServicePowersCommand.ts b/clients/client-lightsail/src/commands/GetContainerServicePowersCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerServicePowersCommand.ts rename to clients/client-lightsail/src/commands/GetContainerServicePowersCommand.ts diff --git a/clients/client-lightsail/commands/GetContainerServicesCommand.ts b/clients/client-lightsail/src/commands/GetContainerServicesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetContainerServicesCommand.ts rename to clients/client-lightsail/src/commands/GetContainerServicesCommand.ts diff --git a/clients/client-lightsail/commands/GetDiskCommand.ts b/clients/client-lightsail/src/commands/GetDiskCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDiskCommand.ts rename to clients/client-lightsail/src/commands/GetDiskCommand.ts diff --git a/clients/client-lightsail/commands/GetDiskSnapshotCommand.ts b/clients/client-lightsail/src/commands/GetDiskSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDiskSnapshotCommand.ts rename to clients/client-lightsail/src/commands/GetDiskSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/GetDiskSnapshotsCommand.ts b/clients/client-lightsail/src/commands/GetDiskSnapshotsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDiskSnapshotsCommand.ts rename to clients/client-lightsail/src/commands/GetDiskSnapshotsCommand.ts diff --git a/clients/client-lightsail/commands/GetDisksCommand.ts b/clients/client-lightsail/src/commands/GetDisksCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDisksCommand.ts rename to clients/client-lightsail/src/commands/GetDisksCommand.ts diff --git a/clients/client-lightsail/commands/GetDistributionBundlesCommand.ts b/clients/client-lightsail/src/commands/GetDistributionBundlesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDistributionBundlesCommand.ts rename to clients/client-lightsail/src/commands/GetDistributionBundlesCommand.ts diff --git a/clients/client-lightsail/commands/GetDistributionLatestCacheResetCommand.ts b/clients/client-lightsail/src/commands/GetDistributionLatestCacheResetCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDistributionLatestCacheResetCommand.ts rename to clients/client-lightsail/src/commands/GetDistributionLatestCacheResetCommand.ts diff --git a/clients/client-lightsail/commands/GetDistributionMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetDistributionMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDistributionMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetDistributionMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetDistributionsCommand.ts b/clients/client-lightsail/src/commands/GetDistributionsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDistributionsCommand.ts rename to clients/client-lightsail/src/commands/GetDistributionsCommand.ts diff --git a/clients/client-lightsail/commands/GetDomainCommand.ts b/clients/client-lightsail/src/commands/GetDomainCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDomainCommand.ts rename to clients/client-lightsail/src/commands/GetDomainCommand.ts diff --git a/clients/client-lightsail/commands/GetDomainsCommand.ts b/clients/client-lightsail/src/commands/GetDomainsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetDomainsCommand.ts rename to clients/client-lightsail/src/commands/GetDomainsCommand.ts diff --git a/clients/client-lightsail/commands/GetExportSnapshotRecordsCommand.ts b/clients/client-lightsail/src/commands/GetExportSnapshotRecordsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetExportSnapshotRecordsCommand.ts rename to clients/client-lightsail/src/commands/GetExportSnapshotRecordsCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceAccessDetailsCommand.ts b/clients/client-lightsail/src/commands/GetInstanceAccessDetailsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceAccessDetailsCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceAccessDetailsCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceCommand.ts b/clients/client-lightsail/src/commands/GetInstanceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetInstanceMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetInstancePortStatesCommand.ts b/clients/client-lightsail/src/commands/GetInstancePortStatesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstancePortStatesCommand.ts rename to clients/client-lightsail/src/commands/GetInstancePortStatesCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceSnapshotCommand.ts b/clients/client-lightsail/src/commands/GetInstanceSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceSnapshotCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceSnapshotsCommand.ts b/clients/client-lightsail/src/commands/GetInstanceSnapshotsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceSnapshotsCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceSnapshotsCommand.ts diff --git a/clients/client-lightsail/commands/GetInstanceStateCommand.ts b/clients/client-lightsail/src/commands/GetInstanceStateCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstanceStateCommand.ts rename to clients/client-lightsail/src/commands/GetInstanceStateCommand.ts diff --git a/clients/client-lightsail/commands/GetInstancesCommand.ts b/clients/client-lightsail/src/commands/GetInstancesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetInstancesCommand.ts rename to clients/client-lightsail/src/commands/GetInstancesCommand.ts diff --git a/clients/client-lightsail/commands/GetKeyPairCommand.ts b/clients/client-lightsail/src/commands/GetKeyPairCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetKeyPairCommand.ts rename to clients/client-lightsail/src/commands/GetKeyPairCommand.ts diff --git a/clients/client-lightsail/commands/GetKeyPairsCommand.ts b/clients/client-lightsail/src/commands/GetKeyPairsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetKeyPairsCommand.ts rename to clients/client-lightsail/src/commands/GetKeyPairsCommand.ts diff --git a/clients/client-lightsail/commands/GetLoadBalancerCommand.ts b/clients/client-lightsail/src/commands/GetLoadBalancerCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetLoadBalancerCommand.ts rename to clients/client-lightsail/src/commands/GetLoadBalancerCommand.ts diff --git a/clients/client-lightsail/commands/GetLoadBalancerMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetLoadBalancerMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetLoadBalancerMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetLoadBalancerMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetLoadBalancerTlsCertificatesCommand.ts b/clients/client-lightsail/src/commands/GetLoadBalancerTlsCertificatesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetLoadBalancerTlsCertificatesCommand.ts rename to clients/client-lightsail/src/commands/GetLoadBalancerTlsCertificatesCommand.ts diff --git a/clients/client-lightsail/commands/GetLoadBalancersCommand.ts b/clients/client-lightsail/src/commands/GetLoadBalancersCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetLoadBalancersCommand.ts rename to clients/client-lightsail/src/commands/GetLoadBalancersCommand.ts diff --git a/clients/client-lightsail/commands/GetOperationCommand.ts b/clients/client-lightsail/src/commands/GetOperationCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetOperationCommand.ts rename to clients/client-lightsail/src/commands/GetOperationCommand.ts diff --git a/clients/client-lightsail/commands/GetOperationsCommand.ts b/clients/client-lightsail/src/commands/GetOperationsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetOperationsCommand.ts rename to clients/client-lightsail/src/commands/GetOperationsCommand.ts diff --git a/clients/client-lightsail/commands/GetOperationsForResourceCommand.ts b/clients/client-lightsail/src/commands/GetOperationsForResourceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetOperationsForResourceCommand.ts rename to clients/client-lightsail/src/commands/GetOperationsForResourceCommand.ts diff --git a/clients/client-lightsail/commands/GetRegionsCommand.ts b/clients/client-lightsail/src/commands/GetRegionsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRegionsCommand.ts rename to clients/client-lightsail/src/commands/GetRegionsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseBlueprintsCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseBlueprintsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseBlueprintsCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseBlueprintsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseBundlesCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseBundlesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseBundlesCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseBundlesCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseEventsCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseEventsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseEventsCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseEventsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseLogEventsCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseLogEventsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseLogEventsCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseLogEventsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseLogStreamsCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseLogStreamsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseLogStreamsCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseLogStreamsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseMasterUserPasswordCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseMasterUserPasswordCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseMasterUserPasswordCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseMasterUserPasswordCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseMetricDataCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseMetricDataCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseMetricDataCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseMetricDataCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseParametersCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseParametersCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseParametersCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseParametersCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseSnapshotCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseSnapshotCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseSnapshotCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseSnapshotCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabaseSnapshotsCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabaseSnapshotsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabaseSnapshotsCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabaseSnapshotsCommand.ts diff --git a/clients/client-lightsail/commands/GetRelationalDatabasesCommand.ts b/clients/client-lightsail/src/commands/GetRelationalDatabasesCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetRelationalDatabasesCommand.ts rename to clients/client-lightsail/src/commands/GetRelationalDatabasesCommand.ts diff --git a/clients/client-lightsail/commands/GetStaticIpCommand.ts b/clients/client-lightsail/src/commands/GetStaticIpCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetStaticIpCommand.ts rename to clients/client-lightsail/src/commands/GetStaticIpCommand.ts diff --git a/clients/client-lightsail/commands/GetStaticIpsCommand.ts b/clients/client-lightsail/src/commands/GetStaticIpsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/GetStaticIpsCommand.ts rename to clients/client-lightsail/src/commands/GetStaticIpsCommand.ts diff --git a/clients/client-lightsail/commands/ImportKeyPairCommand.ts b/clients/client-lightsail/src/commands/ImportKeyPairCommand.ts similarity index 100% rename from clients/client-lightsail/commands/ImportKeyPairCommand.ts rename to clients/client-lightsail/src/commands/ImportKeyPairCommand.ts diff --git a/clients/client-lightsail/commands/IsVpcPeeredCommand.ts b/clients/client-lightsail/src/commands/IsVpcPeeredCommand.ts similarity index 100% rename from clients/client-lightsail/commands/IsVpcPeeredCommand.ts rename to clients/client-lightsail/src/commands/IsVpcPeeredCommand.ts diff --git a/clients/client-lightsail/commands/OpenInstancePublicPortsCommand.ts b/clients/client-lightsail/src/commands/OpenInstancePublicPortsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/OpenInstancePublicPortsCommand.ts rename to clients/client-lightsail/src/commands/OpenInstancePublicPortsCommand.ts diff --git a/clients/client-lightsail/commands/PeerVpcCommand.ts b/clients/client-lightsail/src/commands/PeerVpcCommand.ts similarity index 100% rename from clients/client-lightsail/commands/PeerVpcCommand.ts rename to clients/client-lightsail/src/commands/PeerVpcCommand.ts diff --git a/clients/client-lightsail/commands/PutAlarmCommand.ts b/clients/client-lightsail/src/commands/PutAlarmCommand.ts similarity index 100% rename from clients/client-lightsail/commands/PutAlarmCommand.ts rename to clients/client-lightsail/src/commands/PutAlarmCommand.ts diff --git a/clients/client-lightsail/commands/PutInstancePublicPortsCommand.ts b/clients/client-lightsail/src/commands/PutInstancePublicPortsCommand.ts similarity index 100% rename from clients/client-lightsail/commands/PutInstancePublicPortsCommand.ts rename to clients/client-lightsail/src/commands/PutInstancePublicPortsCommand.ts diff --git a/clients/client-lightsail/commands/RebootInstanceCommand.ts b/clients/client-lightsail/src/commands/RebootInstanceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/RebootInstanceCommand.ts rename to clients/client-lightsail/src/commands/RebootInstanceCommand.ts diff --git a/clients/client-lightsail/commands/RebootRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/RebootRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/RebootRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/RebootRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/RegisterContainerImageCommand.ts b/clients/client-lightsail/src/commands/RegisterContainerImageCommand.ts similarity index 100% rename from clients/client-lightsail/commands/RegisterContainerImageCommand.ts rename to clients/client-lightsail/src/commands/RegisterContainerImageCommand.ts diff --git a/clients/client-lightsail/commands/ReleaseStaticIpCommand.ts b/clients/client-lightsail/src/commands/ReleaseStaticIpCommand.ts similarity index 100% rename from clients/client-lightsail/commands/ReleaseStaticIpCommand.ts rename to clients/client-lightsail/src/commands/ReleaseStaticIpCommand.ts diff --git a/clients/client-lightsail/commands/ResetDistributionCacheCommand.ts b/clients/client-lightsail/src/commands/ResetDistributionCacheCommand.ts similarity index 100% rename from clients/client-lightsail/commands/ResetDistributionCacheCommand.ts rename to clients/client-lightsail/src/commands/ResetDistributionCacheCommand.ts diff --git a/clients/client-lightsail/commands/SendContactMethodVerificationCommand.ts b/clients/client-lightsail/src/commands/SendContactMethodVerificationCommand.ts similarity index 100% rename from clients/client-lightsail/commands/SendContactMethodVerificationCommand.ts rename to clients/client-lightsail/src/commands/SendContactMethodVerificationCommand.ts diff --git a/clients/client-lightsail/commands/SetIpAddressTypeCommand.ts b/clients/client-lightsail/src/commands/SetIpAddressTypeCommand.ts similarity index 100% rename from clients/client-lightsail/commands/SetIpAddressTypeCommand.ts rename to clients/client-lightsail/src/commands/SetIpAddressTypeCommand.ts diff --git a/clients/client-lightsail/commands/SetResourceAccessForBucketCommand.ts b/clients/client-lightsail/src/commands/SetResourceAccessForBucketCommand.ts similarity index 100% rename from clients/client-lightsail/commands/SetResourceAccessForBucketCommand.ts rename to clients/client-lightsail/src/commands/SetResourceAccessForBucketCommand.ts diff --git a/clients/client-lightsail/commands/StartInstanceCommand.ts b/clients/client-lightsail/src/commands/StartInstanceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/StartInstanceCommand.ts rename to clients/client-lightsail/src/commands/StartInstanceCommand.ts diff --git a/clients/client-lightsail/commands/StartRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/StartRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/StartRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/StartRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/StopInstanceCommand.ts b/clients/client-lightsail/src/commands/StopInstanceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/StopInstanceCommand.ts rename to clients/client-lightsail/src/commands/StopInstanceCommand.ts diff --git a/clients/client-lightsail/commands/StopRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/StopRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/StopRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/StopRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/TagResourceCommand.ts b/clients/client-lightsail/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/TagResourceCommand.ts rename to clients/client-lightsail/src/commands/TagResourceCommand.ts diff --git a/clients/client-lightsail/commands/TestAlarmCommand.ts b/clients/client-lightsail/src/commands/TestAlarmCommand.ts similarity index 100% rename from clients/client-lightsail/commands/TestAlarmCommand.ts rename to clients/client-lightsail/src/commands/TestAlarmCommand.ts diff --git a/clients/client-lightsail/commands/UnpeerVpcCommand.ts b/clients/client-lightsail/src/commands/UnpeerVpcCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UnpeerVpcCommand.ts rename to clients/client-lightsail/src/commands/UnpeerVpcCommand.ts diff --git a/clients/client-lightsail/commands/UntagResourceCommand.ts b/clients/client-lightsail/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UntagResourceCommand.ts rename to clients/client-lightsail/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lightsail/commands/UpdateBucketBundleCommand.ts b/clients/client-lightsail/src/commands/UpdateBucketBundleCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateBucketBundleCommand.ts rename to clients/client-lightsail/src/commands/UpdateBucketBundleCommand.ts diff --git a/clients/client-lightsail/commands/UpdateBucketCommand.ts b/clients/client-lightsail/src/commands/UpdateBucketCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateBucketCommand.ts rename to clients/client-lightsail/src/commands/UpdateBucketCommand.ts diff --git a/clients/client-lightsail/commands/UpdateContainerServiceCommand.ts b/clients/client-lightsail/src/commands/UpdateContainerServiceCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateContainerServiceCommand.ts rename to clients/client-lightsail/src/commands/UpdateContainerServiceCommand.ts diff --git a/clients/client-lightsail/commands/UpdateDistributionBundleCommand.ts b/clients/client-lightsail/src/commands/UpdateDistributionBundleCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateDistributionBundleCommand.ts rename to clients/client-lightsail/src/commands/UpdateDistributionBundleCommand.ts diff --git a/clients/client-lightsail/commands/UpdateDistributionCommand.ts b/clients/client-lightsail/src/commands/UpdateDistributionCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateDistributionCommand.ts rename to clients/client-lightsail/src/commands/UpdateDistributionCommand.ts diff --git a/clients/client-lightsail/commands/UpdateDomainEntryCommand.ts b/clients/client-lightsail/src/commands/UpdateDomainEntryCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateDomainEntryCommand.ts rename to clients/client-lightsail/src/commands/UpdateDomainEntryCommand.ts diff --git a/clients/client-lightsail/commands/UpdateLoadBalancerAttributeCommand.ts b/clients/client-lightsail/src/commands/UpdateLoadBalancerAttributeCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateLoadBalancerAttributeCommand.ts rename to clients/client-lightsail/src/commands/UpdateLoadBalancerAttributeCommand.ts diff --git a/clients/client-lightsail/commands/UpdateRelationalDatabaseCommand.ts b/clients/client-lightsail/src/commands/UpdateRelationalDatabaseCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateRelationalDatabaseCommand.ts rename to clients/client-lightsail/src/commands/UpdateRelationalDatabaseCommand.ts diff --git a/clients/client-lightsail/commands/UpdateRelationalDatabaseParametersCommand.ts b/clients/client-lightsail/src/commands/UpdateRelationalDatabaseParametersCommand.ts similarity index 100% rename from clients/client-lightsail/commands/UpdateRelationalDatabaseParametersCommand.ts rename to clients/client-lightsail/src/commands/UpdateRelationalDatabaseParametersCommand.ts diff --git a/clients/client-lightsail/endpoints.ts b/clients/client-lightsail/src/endpoints.ts similarity index 100% rename from clients/client-lightsail/endpoints.ts rename to clients/client-lightsail/src/endpoints.ts diff --git a/clients/client-lightsail/index.ts b/clients/client-lightsail/src/index.ts similarity index 100% rename from clients/client-lightsail/index.ts rename to clients/client-lightsail/src/index.ts diff --git a/clients/client-lightsail/models/index.ts b/clients/client-lightsail/src/models/index.ts similarity index 100% rename from clients/client-lightsail/models/index.ts rename to clients/client-lightsail/src/models/index.ts diff --git a/clients/client-lightsail/models/models_0.ts b/clients/client-lightsail/src/models/models_0.ts similarity index 100% rename from clients/client-lightsail/models/models_0.ts rename to clients/client-lightsail/src/models/models_0.ts diff --git a/clients/client-lightsail/models/models_1.ts b/clients/client-lightsail/src/models/models_1.ts similarity index 100% rename from clients/client-lightsail/models/models_1.ts rename to clients/client-lightsail/src/models/models_1.ts diff --git a/clients/client-lightsail/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-lightsail/protocols/Aws_json1_1.ts rename to clients/client-lightsail/src/protocols/Aws_json1_1.ts diff --git a/clients/client-lightsail/src/runtimeConfig.browser.ts b/clients/client-lightsail/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cf454321a45e --- /dev/null +++ b/clients/client-lightsail/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LightsailClientConfig } from "./LightsailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LightsailClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lightsail/runtimeConfig.native.ts b/clients/client-lightsail/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lightsail/runtimeConfig.native.ts rename to clients/client-lightsail/src/runtimeConfig.native.ts diff --git a/clients/client-lightsail/runtimeConfig.shared.ts b/clients/client-lightsail/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lightsail/runtimeConfig.shared.ts rename to clients/client-lightsail/src/runtimeConfig.shared.ts diff --git a/clients/client-lightsail/src/runtimeConfig.ts b/clients/client-lightsail/src/runtimeConfig.ts new file mode 100644 index 000000000000..3d3302a5ad53 --- /dev/null +++ b/clients/client-lightsail/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LightsailClientConfig } from "./LightsailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LightsailClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lightsail/tsconfig.es.json b/clients/client-lightsail/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lightsail/tsconfig.es.json +++ b/clients/client-lightsail/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lightsail/tsconfig.json b/clients/client-lightsail/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lightsail/tsconfig.json +++ b/clients/client-lightsail/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lightsail/tsconfig.types.json b/clients/client-lightsail/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lightsail/tsconfig.types.json +++ b/clients/client-lightsail/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-location/.gitignore b/clients/client-location/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-location/.gitignore +++ b/clients/client-location/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-location/package.json b/clients/client-location/package.json index 25a429bc2025..fd559039b976 100644 --- a/clients/client-location/package.json +++ b/clients/client-location/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-location", "repository": { "type": "git", diff --git a/clients/client-location/runtimeConfig.browser.ts b/clients/client-location/runtimeConfig.browser.ts deleted file mode 100644 index 22e458fa1105..000000000000 --- a/clients/client-location/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LocationClientConfig } from "./LocationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LocationClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-location/runtimeConfig.ts b/clients/client-location/runtimeConfig.ts deleted file mode 100644 index f1181be27c23..000000000000 --- a/clients/client-location/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LocationClientConfig } from "./LocationClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LocationClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-location/Location.ts b/clients/client-location/src/Location.ts similarity index 100% rename from clients/client-location/Location.ts rename to clients/client-location/src/Location.ts diff --git a/clients/client-location/LocationClient.ts b/clients/client-location/src/LocationClient.ts similarity index 100% rename from clients/client-location/LocationClient.ts rename to clients/client-location/src/LocationClient.ts diff --git a/clients/client-location/commands/AssociateTrackerConsumerCommand.ts b/clients/client-location/src/commands/AssociateTrackerConsumerCommand.ts similarity index 100% rename from clients/client-location/commands/AssociateTrackerConsumerCommand.ts rename to clients/client-location/src/commands/AssociateTrackerConsumerCommand.ts diff --git a/clients/client-location/commands/BatchDeleteDevicePositionHistoryCommand.ts b/clients/client-location/src/commands/BatchDeleteDevicePositionHistoryCommand.ts similarity index 100% rename from clients/client-location/commands/BatchDeleteDevicePositionHistoryCommand.ts rename to clients/client-location/src/commands/BatchDeleteDevicePositionHistoryCommand.ts diff --git a/clients/client-location/commands/BatchDeleteGeofenceCommand.ts b/clients/client-location/src/commands/BatchDeleteGeofenceCommand.ts similarity index 100% rename from clients/client-location/commands/BatchDeleteGeofenceCommand.ts rename to clients/client-location/src/commands/BatchDeleteGeofenceCommand.ts diff --git a/clients/client-location/commands/BatchEvaluateGeofencesCommand.ts b/clients/client-location/src/commands/BatchEvaluateGeofencesCommand.ts similarity index 100% rename from clients/client-location/commands/BatchEvaluateGeofencesCommand.ts rename to clients/client-location/src/commands/BatchEvaluateGeofencesCommand.ts diff --git a/clients/client-location/commands/BatchGetDevicePositionCommand.ts b/clients/client-location/src/commands/BatchGetDevicePositionCommand.ts similarity index 100% rename from clients/client-location/commands/BatchGetDevicePositionCommand.ts rename to clients/client-location/src/commands/BatchGetDevicePositionCommand.ts diff --git a/clients/client-location/commands/BatchPutGeofenceCommand.ts b/clients/client-location/src/commands/BatchPutGeofenceCommand.ts similarity index 100% rename from clients/client-location/commands/BatchPutGeofenceCommand.ts rename to clients/client-location/src/commands/BatchPutGeofenceCommand.ts diff --git a/clients/client-location/commands/BatchUpdateDevicePositionCommand.ts b/clients/client-location/src/commands/BatchUpdateDevicePositionCommand.ts similarity index 100% rename from clients/client-location/commands/BatchUpdateDevicePositionCommand.ts rename to clients/client-location/src/commands/BatchUpdateDevicePositionCommand.ts diff --git a/clients/client-location/commands/CalculateRouteCommand.ts b/clients/client-location/src/commands/CalculateRouteCommand.ts similarity index 100% rename from clients/client-location/commands/CalculateRouteCommand.ts rename to clients/client-location/src/commands/CalculateRouteCommand.ts diff --git a/clients/client-location/commands/CreateGeofenceCollectionCommand.ts b/clients/client-location/src/commands/CreateGeofenceCollectionCommand.ts similarity index 100% rename from clients/client-location/commands/CreateGeofenceCollectionCommand.ts rename to clients/client-location/src/commands/CreateGeofenceCollectionCommand.ts diff --git a/clients/client-location/commands/CreateMapCommand.ts b/clients/client-location/src/commands/CreateMapCommand.ts similarity index 100% rename from clients/client-location/commands/CreateMapCommand.ts rename to clients/client-location/src/commands/CreateMapCommand.ts diff --git a/clients/client-location/commands/CreatePlaceIndexCommand.ts b/clients/client-location/src/commands/CreatePlaceIndexCommand.ts similarity index 100% rename from clients/client-location/commands/CreatePlaceIndexCommand.ts rename to clients/client-location/src/commands/CreatePlaceIndexCommand.ts diff --git a/clients/client-location/commands/CreateRouteCalculatorCommand.ts b/clients/client-location/src/commands/CreateRouteCalculatorCommand.ts similarity index 100% rename from clients/client-location/commands/CreateRouteCalculatorCommand.ts rename to clients/client-location/src/commands/CreateRouteCalculatorCommand.ts diff --git a/clients/client-location/commands/CreateTrackerCommand.ts b/clients/client-location/src/commands/CreateTrackerCommand.ts similarity index 100% rename from clients/client-location/commands/CreateTrackerCommand.ts rename to clients/client-location/src/commands/CreateTrackerCommand.ts diff --git a/clients/client-location/commands/DeleteGeofenceCollectionCommand.ts b/clients/client-location/src/commands/DeleteGeofenceCollectionCommand.ts similarity index 100% rename from clients/client-location/commands/DeleteGeofenceCollectionCommand.ts rename to clients/client-location/src/commands/DeleteGeofenceCollectionCommand.ts diff --git a/clients/client-location/commands/DeleteMapCommand.ts b/clients/client-location/src/commands/DeleteMapCommand.ts similarity index 100% rename from clients/client-location/commands/DeleteMapCommand.ts rename to clients/client-location/src/commands/DeleteMapCommand.ts diff --git a/clients/client-location/commands/DeletePlaceIndexCommand.ts b/clients/client-location/src/commands/DeletePlaceIndexCommand.ts similarity index 100% rename from clients/client-location/commands/DeletePlaceIndexCommand.ts rename to clients/client-location/src/commands/DeletePlaceIndexCommand.ts diff --git a/clients/client-location/commands/DeleteRouteCalculatorCommand.ts b/clients/client-location/src/commands/DeleteRouteCalculatorCommand.ts similarity index 100% rename from clients/client-location/commands/DeleteRouteCalculatorCommand.ts rename to clients/client-location/src/commands/DeleteRouteCalculatorCommand.ts diff --git a/clients/client-location/commands/DeleteTrackerCommand.ts b/clients/client-location/src/commands/DeleteTrackerCommand.ts similarity index 100% rename from clients/client-location/commands/DeleteTrackerCommand.ts rename to clients/client-location/src/commands/DeleteTrackerCommand.ts diff --git a/clients/client-location/commands/DescribeGeofenceCollectionCommand.ts b/clients/client-location/src/commands/DescribeGeofenceCollectionCommand.ts similarity index 100% rename from clients/client-location/commands/DescribeGeofenceCollectionCommand.ts rename to clients/client-location/src/commands/DescribeGeofenceCollectionCommand.ts diff --git a/clients/client-location/commands/DescribeMapCommand.ts b/clients/client-location/src/commands/DescribeMapCommand.ts similarity index 100% rename from clients/client-location/commands/DescribeMapCommand.ts rename to clients/client-location/src/commands/DescribeMapCommand.ts diff --git a/clients/client-location/commands/DescribePlaceIndexCommand.ts b/clients/client-location/src/commands/DescribePlaceIndexCommand.ts similarity index 100% rename from clients/client-location/commands/DescribePlaceIndexCommand.ts rename to clients/client-location/src/commands/DescribePlaceIndexCommand.ts diff --git a/clients/client-location/commands/DescribeRouteCalculatorCommand.ts b/clients/client-location/src/commands/DescribeRouteCalculatorCommand.ts similarity index 100% rename from clients/client-location/commands/DescribeRouteCalculatorCommand.ts rename to clients/client-location/src/commands/DescribeRouteCalculatorCommand.ts diff --git a/clients/client-location/commands/DescribeTrackerCommand.ts b/clients/client-location/src/commands/DescribeTrackerCommand.ts similarity index 100% rename from clients/client-location/commands/DescribeTrackerCommand.ts rename to clients/client-location/src/commands/DescribeTrackerCommand.ts diff --git a/clients/client-location/commands/DisassociateTrackerConsumerCommand.ts b/clients/client-location/src/commands/DisassociateTrackerConsumerCommand.ts similarity index 100% rename from clients/client-location/commands/DisassociateTrackerConsumerCommand.ts rename to clients/client-location/src/commands/DisassociateTrackerConsumerCommand.ts diff --git a/clients/client-location/commands/GetDevicePositionCommand.ts b/clients/client-location/src/commands/GetDevicePositionCommand.ts similarity index 100% rename from clients/client-location/commands/GetDevicePositionCommand.ts rename to clients/client-location/src/commands/GetDevicePositionCommand.ts diff --git a/clients/client-location/commands/GetDevicePositionHistoryCommand.ts b/clients/client-location/src/commands/GetDevicePositionHistoryCommand.ts similarity index 100% rename from clients/client-location/commands/GetDevicePositionHistoryCommand.ts rename to clients/client-location/src/commands/GetDevicePositionHistoryCommand.ts diff --git a/clients/client-location/commands/GetGeofenceCommand.ts b/clients/client-location/src/commands/GetGeofenceCommand.ts similarity index 100% rename from clients/client-location/commands/GetGeofenceCommand.ts rename to clients/client-location/src/commands/GetGeofenceCommand.ts diff --git a/clients/client-location/commands/GetMapGlyphsCommand.ts b/clients/client-location/src/commands/GetMapGlyphsCommand.ts similarity index 100% rename from clients/client-location/commands/GetMapGlyphsCommand.ts rename to clients/client-location/src/commands/GetMapGlyphsCommand.ts diff --git a/clients/client-location/commands/GetMapSpritesCommand.ts b/clients/client-location/src/commands/GetMapSpritesCommand.ts similarity index 100% rename from clients/client-location/commands/GetMapSpritesCommand.ts rename to clients/client-location/src/commands/GetMapSpritesCommand.ts diff --git a/clients/client-location/commands/GetMapStyleDescriptorCommand.ts b/clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts similarity index 100% rename from clients/client-location/commands/GetMapStyleDescriptorCommand.ts rename to clients/client-location/src/commands/GetMapStyleDescriptorCommand.ts diff --git a/clients/client-location/commands/GetMapTileCommand.ts b/clients/client-location/src/commands/GetMapTileCommand.ts similarity index 100% rename from clients/client-location/commands/GetMapTileCommand.ts rename to clients/client-location/src/commands/GetMapTileCommand.ts diff --git a/clients/client-location/commands/ListDevicePositionsCommand.ts b/clients/client-location/src/commands/ListDevicePositionsCommand.ts similarity index 100% rename from clients/client-location/commands/ListDevicePositionsCommand.ts rename to clients/client-location/src/commands/ListDevicePositionsCommand.ts diff --git a/clients/client-location/commands/ListGeofenceCollectionsCommand.ts b/clients/client-location/src/commands/ListGeofenceCollectionsCommand.ts similarity index 100% rename from clients/client-location/commands/ListGeofenceCollectionsCommand.ts rename to clients/client-location/src/commands/ListGeofenceCollectionsCommand.ts diff --git a/clients/client-location/commands/ListGeofencesCommand.ts b/clients/client-location/src/commands/ListGeofencesCommand.ts similarity index 100% rename from clients/client-location/commands/ListGeofencesCommand.ts rename to clients/client-location/src/commands/ListGeofencesCommand.ts diff --git a/clients/client-location/commands/ListMapsCommand.ts b/clients/client-location/src/commands/ListMapsCommand.ts similarity index 100% rename from clients/client-location/commands/ListMapsCommand.ts rename to clients/client-location/src/commands/ListMapsCommand.ts diff --git a/clients/client-location/commands/ListPlaceIndexesCommand.ts b/clients/client-location/src/commands/ListPlaceIndexesCommand.ts similarity index 100% rename from clients/client-location/commands/ListPlaceIndexesCommand.ts rename to clients/client-location/src/commands/ListPlaceIndexesCommand.ts diff --git a/clients/client-location/commands/ListRouteCalculatorsCommand.ts b/clients/client-location/src/commands/ListRouteCalculatorsCommand.ts similarity index 100% rename from clients/client-location/commands/ListRouteCalculatorsCommand.ts rename to clients/client-location/src/commands/ListRouteCalculatorsCommand.ts diff --git a/clients/client-location/commands/ListTagsForResourceCommand.ts b/clients/client-location/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-location/commands/ListTagsForResourceCommand.ts rename to clients/client-location/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-location/commands/ListTrackerConsumersCommand.ts b/clients/client-location/src/commands/ListTrackerConsumersCommand.ts similarity index 100% rename from clients/client-location/commands/ListTrackerConsumersCommand.ts rename to clients/client-location/src/commands/ListTrackerConsumersCommand.ts diff --git a/clients/client-location/commands/ListTrackersCommand.ts b/clients/client-location/src/commands/ListTrackersCommand.ts similarity index 100% rename from clients/client-location/commands/ListTrackersCommand.ts rename to clients/client-location/src/commands/ListTrackersCommand.ts diff --git a/clients/client-location/commands/PutGeofenceCommand.ts b/clients/client-location/src/commands/PutGeofenceCommand.ts similarity index 100% rename from clients/client-location/commands/PutGeofenceCommand.ts rename to clients/client-location/src/commands/PutGeofenceCommand.ts diff --git a/clients/client-location/commands/SearchPlaceIndexForPositionCommand.ts b/clients/client-location/src/commands/SearchPlaceIndexForPositionCommand.ts similarity index 100% rename from clients/client-location/commands/SearchPlaceIndexForPositionCommand.ts rename to clients/client-location/src/commands/SearchPlaceIndexForPositionCommand.ts diff --git a/clients/client-location/commands/SearchPlaceIndexForTextCommand.ts b/clients/client-location/src/commands/SearchPlaceIndexForTextCommand.ts similarity index 100% rename from clients/client-location/commands/SearchPlaceIndexForTextCommand.ts rename to clients/client-location/src/commands/SearchPlaceIndexForTextCommand.ts diff --git a/clients/client-location/commands/TagResourceCommand.ts b/clients/client-location/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-location/commands/TagResourceCommand.ts rename to clients/client-location/src/commands/TagResourceCommand.ts diff --git a/clients/client-location/commands/UntagResourceCommand.ts b/clients/client-location/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-location/commands/UntagResourceCommand.ts rename to clients/client-location/src/commands/UntagResourceCommand.ts diff --git a/clients/client-location/commands/UpdateGeofenceCollectionCommand.ts b/clients/client-location/src/commands/UpdateGeofenceCollectionCommand.ts similarity index 100% rename from clients/client-location/commands/UpdateGeofenceCollectionCommand.ts rename to clients/client-location/src/commands/UpdateGeofenceCollectionCommand.ts diff --git a/clients/client-location/commands/UpdateMapCommand.ts b/clients/client-location/src/commands/UpdateMapCommand.ts similarity index 100% rename from clients/client-location/commands/UpdateMapCommand.ts rename to clients/client-location/src/commands/UpdateMapCommand.ts diff --git a/clients/client-location/commands/UpdatePlaceIndexCommand.ts b/clients/client-location/src/commands/UpdatePlaceIndexCommand.ts similarity index 100% rename from clients/client-location/commands/UpdatePlaceIndexCommand.ts rename to clients/client-location/src/commands/UpdatePlaceIndexCommand.ts diff --git a/clients/client-location/commands/UpdateRouteCalculatorCommand.ts b/clients/client-location/src/commands/UpdateRouteCalculatorCommand.ts similarity index 100% rename from clients/client-location/commands/UpdateRouteCalculatorCommand.ts rename to clients/client-location/src/commands/UpdateRouteCalculatorCommand.ts diff --git a/clients/client-location/commands/UpdateTrackerCommand.ts b/clients/client-location/src/commands/UpdateTrackerCommand.ts similarity index 100% rename from clients/client-location/commands/UpdateTrackerCommand.ts rename to clients/client-location/src/commands/UpdateTrackerCommand.ts diff --git a/clients/client-location/endpoints.ts b/clients/client-location/src/endpoints.ts similarity index 100% rename from clients/client-location/endpoints.ts rename to clients/client-location/src/endpoints.ts diff --git a/clients/client-location/index.ts b/clients/client-location/src/index.ts similarity index 100% rename from clients/client-location/index.ts rename to clients/client-location/src/index.ts diff --git a/clients/client-location/models/index.ts b/clients/client-location/src/models/index.ts similarity index 100% rename from clients/client-location/models/index.ts rename to clients/client-location/src/models/index.ts diff --git a/clients/client-location/models/models_0.ts b/clients/client-location/src/models/models_0.ts similarity index 100% rename from clients/client-location/models/models_0.ts rename to clients/client-location/src/models/models_0.ts diff --git a/clients/client-location/pagination/GetDevicePositionHistoryPaginator.ts b/clients/client-location/src/pagination/GetDevicePositionHistoryPaginator.ts similarity index 100% rename from clients/client-location/pagination/GetDevicePositionHistoryPaginator.ts rename to clients/client-location/src/pagination/GetDevicePositionHistoryPaginator.ts diff --git a/clients/client-location/pagination/Interfaces.ts b/clients/client-location/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-location/pagination/Interfaces.ts rename to clients/client-location/src/pagination/Interfaces.ts diff --git a/clients/client-location/pagination/ListDevicePositionsPaginator.ts b/clients/client-location/src/pagination/ListDevicePositionsPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListDevicePositionsPaginator.ts rename to clients/client-location/src/pagination/ListDevicePositionsPaginator.ts diff --git a/clients/client-location/pagination/ListGeofenceCollectionsPaginator.ts b/clients/client-location/src/pagination/ListGeofenceCollectionsPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListGeofenceCollectionsPaginator.ts rename to clients/client-location/src/pagination/ListGeofenceCollectionsPaginator.ts diff --git a/clients/client-location/pagination/ListGeofencesPaginator.ts b/clients/client-location/src/pagination/ListGeofencesPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListGeofencesPaginator.ts rename to clients/client-location/src/pagination/ListGeofencesPaginator.ts diff --git a/clients/client-location/pagination/ListMapsPaginator.ts b/clients/client-location/src/pagination/ListMapsPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListMapsPaginator.ts rename to clients/client-location/src/pagination/ListMapsPaginator.ts diff --git a/clients/client-location/pagination/ListPlaceIndexesPaginator.ts b/clients/client-location/src/pagination/ListPlaceIndexesPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListPlaceIndexesPaginator.ts rename to clients/client-location/src/pagination/ListPlaceIndexesPaginator.ts diff --git a/clients/client-location/pagination/ListRouteCalculatorsPaginator.ts b/clients/client-location/src/pagination/ListRouteCalculatorsPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListRouteCalculatorsPaginator.ts rename to clients/client-location/src/pagination/ListRouteCalculatorsPaginator.ts diff --git a/clients/client-location/pagination/ListTrackerConsumersPaginator.ts b/clients/client-location/src/pagination/ListTrackerConsumersPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListTrackerConsumersPaginator.ts rename to clients/client-location/src/pagination/ListTrackerConsumersPaginator.ts diff --git a/clients/client-location/pagination/ListTrackersPaginator.ts b/clients/client-location/src/pagination/ListTrackersPaginator.ts similarity index 100% rename from clients/client-location/pagination/ListTrackersPaginator.ts rename to clients/client-location/src/pagination/ListTrackersPaginator.ts diff --git a/clients/client-location/protocols/Aws_restJson1.ts b/clients/client-location/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-location/protocols/Aws_restJson1.ts rename to clients/client-location/src/protocols/Aws_restJson1.ts diff --git a/clients/client-location/src/runtimeConfig.browser.ts b/clients/client-location/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f82694454847 --- /dev/null +++ b/clients/client-location/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LocationClientConfig } from "./LocationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LocationClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-location/runtimeConfig.native.ts b/clients/client-location/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-location/runtimeConfig.native.ts rename to clients/client-location/src/runtimeConfig.native.ts diff --git a/clients/client-location/runtimeConfig.shared.ts b/clients/client-location/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-location/runtimeConfig.shared.ts rename to clients/client-location/src/runtimeConfig.shared.ts diff --git a/clients/client-location/src/runtimeConfig.ts b/clients/client-location/src/runtimeConfig.ts new file mode 100644 index 000000000000..bc6fa3d53da5 --- /dev/null +++ b/clients/client-location/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LocationClientConfig } from "./LocationClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LocationClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-location/tsconfig.es.json b/clients/client-location/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-location/tsconfig.es.json +++ b/clients/client-location/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-location/tsconfig.json b/clients/client-location/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-location/tsconfig.json +++ b/clients/client-location/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-location/tsconfig.types.json b/clients/client-location/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-location/tsconfig.types.json +++ b/clients/client-location/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lookoutequipment/.gitignore b/clients/client-lookoutequipment/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-lookoutequipment/.gitignore +++ b/clients/client-lookoutequipment/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lookoutequipment/package.json b/clients/client-lookoutequipment/package.json index 32592b1b930a..9359196d513f 100644 --- a/clients/client-lookoutequipment/package.json +++ b/clients/client-lookoutequipment/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lookoutequipment", "repository": { "type": "git", diff --git a/clients/client-lookoutequipment/runtimeConfig.browser.ts b/clients/client-lookoutequipment/runtimeConfig.browser.ts deleted file mode 100644 index 0b9623959f95..000000000000 --- a/clients/client-lookoutequipment/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LookoutEquipmentClientConfig } from "./LookoutEquipmentClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutequipment/runtimeConfig.ts b/clients/client-lookoutequipment/runtimeConfig.ts deleted file mode 100644 index ecff1a982c42..000000000000 --- a/clients/client-lookoutequipment/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LookoutEquipmentClientConfig } from "./LookoutEquipmentClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutequipment/LookoutEquipment.ts b/clients/client-lookoutequipment/src/LookoutEquipment.ts similarity index 100% rename from clients/client-lookoutequipment/LookoutEquipment.ts rename to clients/client-lookoutequipment/src/LookoutEquipment.ts diff --git a/clients/client-lookoutequipment/LookoutEquipmentClient.ts b/clients/client-lookoutequipment/src/LookoutEquipmentClient.ts similarity index 100% rename from clients/client-lookoutequipment/LookoutEquipmentClient.ts rename to clients/client-lookoutequipment/src/LookoutEquipmentClient.ts diff --git a/clients/client-lookoutequipment/commands/CreateDatasetCommand.ts b/clients/client-lookoutequipment/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/CreateDatasetCommand.ts rename to clients/client-lookoutequipment/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-lookoutequipment/commands/CreateInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/CreateInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/CreateInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/CreateInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/commands/CreateModelCommand.ts b/clients/client-lookoutequipment/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/CreateModelCommand.ts rename to clients/client-lookoutequipment/src/commands/CreateModelCommand.ts diff --git a/clients/client-lookoutequipment/commands/DeleteDatasetCommand.ts b/clients/client-lookoutequipment/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DeleteDatasetCommand.ts rename to clients/client-lookoutequipment/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-lookoutequipment/commands/DeleteInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/DeleteInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DeleteInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/DeleteInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/commands/DeleteModelCommand.ts b/clients/client-lookoutequipment/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DeleteModelCommand.ts rename to clients/client-lookoutequipment/src/commands/DeleteModelCommand.ts diff --git a/clients/client-lookoutequipment/commands/DescribeDataIngestionJobCommand.ts b/clients/client-lookoutequipment/src/commands/DescribeDataIngestionJobCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DescribeDataIngestionJobCommand.ts rename to clients/client-lookoutequipment/src/commands/DescribeDataIngestionJobCommand.ts diff --git a/clients/client-lookoutequipment/commands/DescribeDatasetCommand.ts b/clients/client-lookoutequipment/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DescribeDatasetCommand.ts rename to clients/client-lookoutequipment/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-lookoutequipment/commands/DescribeInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/DescribeInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DescribeInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/DescribeInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/commands/DescribeModelCommand.ts b/clients/client-lookoutequipment/src/commands/DescribeModelCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/DescribeModelCommand.ts rename to clients/client-lookoutequipment/src/commands/DescribeModelCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListDataIngestionJobsCommand.ts b/clients/client-lookoutequipment/src/commands/ListDataIngestionJobsCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListDataIngestionJobsCommand.ts rename to clients/client-lookoutequipment/src/commands/ListDataIngestionJobsCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListDatasetsCommand.ts b/clients/client-lookoutequipment/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListDatasetsCommand.ts rename to clients/client-lookoutequipment/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListInferenceExecutionsCommand.ts b/clients/client-lookoutequipment/src/commands/ListInferenceExecutionsCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListInferenceExecutionsCommand.ts rename to clients/client-lookoutequipment/src/commands/ListInferenceExecutionsCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListInferenceSchedulersCommand.ts b/clients/client-lookoutequipment/src/commands/ListInferenceSchedulersCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListInferenceSchedulersCommand.ts rename to clients/client-lookoutequipment/src/commands/ListInferenceSchedulersCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListModelsCommand.ts b/clients/client-lookoutequipment/src/commands/ListModelsCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListModelsCommand.ts rename to clients/client-lookoutequipment/src/commands/ListModelsCommand.ts diff --git a/clients/client-lookoutequipment/commands/ListTagsForResourceCommand.ts b/clients/client-lookoutequipment/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/ListTagsForResourceCommand.ts rename to clients/client-lookoutequipment/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-lookoutequipment/commands/StartDataIngestionJobCommand.ts b/clients/client-lookoutequipment/src/commands/StartDataIngestionJobCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/StartDataIngestionJobCommand.ts rename to clients/client-lookoutequipment/src/commands/StartDataIngestionJobCommand.ts diff --git a/clients/client-lookoutequipment/commands/StartInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/StartInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/StartInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/StartInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/commands/StopInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/StopInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/StopInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/StopInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/commands/TagResourceCommand.ts b/clients/client-lookoutequipment/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/TagResourceCommand.ts rename to clients/client-lookoutequipment/src/commands/TagResourceCommand.ts diff --git a/clients/client-lookoutequipment/commands/UntagResourceCommand.ts b/clients/client-lookoutequipment/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/UntagResourceCommand.ts rename to clients/client-lookoutequipment/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lookoutequipment/commands/UpdateInferenceSchedulerCommand.ts b/clients/client-lookoutequipment/src/commands/UpdateInferenceSchedulerCommand.ts similarity index 100% rename from clients/client-lookoutequipment/commands/UpdateInferenceSchedulerCommand.ts rename to clients/client-lookoutequipment/src/commands/UpdateInferenceSchedulerCommand.ts diff --git a/clients/client-lookoutequipment/endpoints.ts b/clients/client-lookoutequipment/src/endpoints.ts similarity index 100% rename from clients/client-lookoutequipment/endpoints.ts rename to clients/client-lookoutequipment/src/endpoints.ts diff --git a/clients/client-lookoutequipment/index.ts b/clients/client-lookoutequipment/src/index.ts similarity index 100% rename from clients/client-lookoutequipment/index.ts rename to clients/client-lookoutequipment/src/index.ts diff --git a/clients/client-lookoutequipment/models/index.ts b/clients/client-lookoutequipment/src/models/index.ts similarity index 100% rename from clients/client-lookoutequipment/models/index.ts rename to clients/client-lookoutequipment/src/models/index.ts diff --git a/clients/client-lookoutequipment/models/models_0.ts b/clients/client-lookoutequipment/src/models/models_0.ts similarity index 100% rename from clients/client-lookoutequipment/models/models_0.ts rename to clients/client-lookoutequipment/src/models/models_0.ts diff --git a/clients/client-lookoutequipment/pagination/Interfaces.ts b/clients/client-lookoutequipment/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/Interfaces.ts rename to clients/client-lookoutequipment/src/pagination/Interfaces.ts diff --git a/clients/client-lookoutequipment/pagination/ListDataIngestionJobsPaginator.ts b/clients/client-lookoutequipment/src/pagination/ListDataIngestionJobsPaginator.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/ListDataIngestionJobsPaginator.ts rename to clients/client-lookoutequipment/src/pagination/ListDataIngestionJobsPaginator.ts diff --git a/clients/client-lookoutequipment/pagination/ListDatasetsPaginator.ts b/clients/client-lookoutequipment/src/pagination/ListDatasetsPaginator.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/ListDatasetsPaginator.ts rename to clients/client-lookoutequipment/src/pagination/ListDatasetsPaginator.ts diff --git a/clients/client-lookoutequipment/pagination/ListInferenceExecutionsPaginator.ts b/clients/client-lookoutequipment/src/pagination/ListInferenceExecutionsPaginator.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/ListInferenceExecutionsPaginator.ts rename to clients/client-lookoutequipment/src/pagination/ListInferenceExecutionsPaginator.ts diff --git a/clients/client-lookoutequipment/pagination/ListInferenceSchedulersPaginator.ts b/clients/client-lookoutequipment/src/pagination/ListInferenceSchedulersPaginator.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/ListInferenceSchedulersPaginator.ts rename to clients/client-lookoutequipment/src/pagination/ListInferenceSchedulersPaginator.ts diff --git a/clients/client-lookoutequipment/pagination/ListModelsPaginator.ts b/clients/client-lookoutequipment/src/pagination/ListModelsPaginator.ts similarity index 100% rename from clients/client-lookoutequipment/pagination/ListModelsPaginator.ts rename to clients/client-lookoutequipment/src/pagination/ListModelsPaginator.ts diff --git a/clients/client-lookoutequipment/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-lookoutequipment/protocols/Aws_json1_0.ts rename to clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts diff --git a/clients/client-lookoutequipment/src/runtimeConfig.browser.ts b/clients/client-lookoutequipment/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0a51b699da9b --- /dev/null +++ b/clients/client-lookoutequipment/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LookoutEquipmentClientConfig } from "./LookoutEquipmentClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutequipment/runtimeConfig.native.ts b/clients/client-lookoutequipment/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lookoutequipment/runtimeConfig.native.ts rename to clients/client-lookoutequipment/src/runtimeConfig.native.ts diff --git a/clients/client-lookoutequipment/runtimeConfig.shared.ts b/clients/client-lookoutequipment/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lookoutequipment/runtimeConfig.shared.ts rename to clients/client-lookoutequipment/src/runtimeConfig.shared.ts diff --git a/clients/client-lookoutequipment/src/runtimeConfig.ts b/clients/client-lookoutequipment/src/runtimeConfig.ts new file mode 100644 index 000000000000..286c6d787d4e --- /dev/null +++ b/clients/client-lookoutequipment/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LookoutEquipmentClientConfig } from "./LookoutEquipmentClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutequipment/tsconfig.es.json b/clients/client-lookoutequipment/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lookoutequipment/tsconfig.es.json +++ b/clients/client-lookoutequipment/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lookoutequipment/tsconfig.json b/clients/client-lookoutequipment/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lookoutequipment/tsconfig.json +++ b/clients/client-lookoutequipment/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lookoutequipment/tsconfig.types.json b/clients/client-lookoutequipment/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lookoutequipment/tsconfig.types.json +++ b/clients/client-lookoutequipment/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lookoutmetrics/.gitignore b/clients/client-lookoutmetrics/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-lookoutmetrics/.gitignore +++ b/clients/client-lookoutmetrics/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lookoutmetrics/package.json b/clients/client-lookoutmetrics/package.json index 7153558ddbf3..b50ef2f0a1d0 100644 --- a/clients/client-lookoutmetrics/package.json +++ b/clients/client-lookoutmetrics/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lookoutmetrics", "repository": { "type": "git", diff --git a/clients/client-lookoutmetrics/runtimeConfig.browser.ts b/clients/client-lookoutmetrics/runtimeConfig.browser.ts deleted file mode 100644 index 8bdd8ff74be2..000000000000 --- a/clients/client-lookoutmetrics/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LookoutMetricsClientConfig } from "./LookoutMetricsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutmetrics/runtimeConfig.ts b/clients/client-lookoutmetrics/runtimeConfig.ts deleted file mode 100644 index 5a24943f45fd..000000000000 --- a/clients/client-lookoutmetrics/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LookoutMetricsClientConfig } from "./LookoutMetricsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutmetrics/LookoutMetrics.ts b/clients/client-lookoutmetrics/src/LookoutMetrics.ts similarity index 100% rename from clients/client-lookoutmetrics/LookoutMetrics.ts rename to clients/client-lookoutmetrics/src/LookoutMetrics.ts diff --git a/clients/client-lookoutmetrics/LookoutMetricsClient.ts b/clients/client-lookoutmetrics/src/LookoutMetricsClient.ts similarity index 100% rename from clients/client-lookoutmetrics/LookoutMetricsClient.ts rename to clients/client-lookoutmetrics/src/LookoutMetricsClient.ts diff --git a/clients/client-lookoutmetrics/commands/ActivateAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/ActivateAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ActivateAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/ActivateAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/BackTestAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/BackTestAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/BackTestAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/BackTestAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/CreateAlertCommand.ts b/clients/client-lookoutmetrics/src/commands/CreateAlertCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/CreateAlertCommand.ts rename to clients/client-lookoutmetrics/src/commands/CreateAlertCommand.ts diff --git a/clients/client-lookoutmetrics/commands/CreateAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/CreateAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/CreateAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/CreateAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/CreateMetricSetCommand.ts b/clients/client-lookoutmetrics/src/commands/CreateMetricSetCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/CreateMetricSetCommand.ts rename to clients/client-lookoutmetrics/src/commands/CreateMetricSetCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DeleteAlertCommand.ts b/clients/client-lookoutmetrics/src/commands/DeleteAlertCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DeleteAlertCommand.ts rename to clients/client-lookoutmetrics/src/commands/DeleteAlertCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DeleteAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/DeleteAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DeleteAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/DeleteAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DescribeAlertCommand.ts b/clients/client-lookoutmetrics/src/commands/DescribeAlertCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DescribeAlertCommand.ts rename to clients/client-lookoutmetrics/src/commands/DescribeAlertCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DescribeAnomalyDetectionExecutionsCommand.ts b/clients/client-lookoutmetrics/src/commands/DescribeAnomalyDetectionExecutionsCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DescribeAnomalyDetectionExecutionsCommand.ts rename to clients/client-lookoutmetrics/src/commands/DescribeAnomalyDetectionExecutionsCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DescribeAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/DescribeAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DescribeAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/DescribeAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/DescribeMetricSetCommand.ts b/clients/client-lookoutmetrics/src/commands/DescribeMetricSetCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/DescribeMetricSetCommand.ts rename to clients/client-lookoutmetrics/src/commands/DescribeMetricSetCommand.ts diff --git a/clients/client-lookoutmetrics/commands/GetAnomalyGroupCommand.ts b/clients/client-lookoutmetrics/src/commands/GetAnomalyGroupCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/GetAnomalyGroupCommand.ts rename to clients/client-lookoutmetrics/src/commands/GetAnomalyGroupCommand.ts diff --git a/clients/client-lookoutmetrics/commands/GetFeedbackCommand.ts b/clients/client-lookoutmetrics/src/commands/GetFeedbackCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/GetFeedbackCommand.ts rename to clients/client-lookoutmetrics/src/commands/GetFeedbackCommand.ts diff --git a/clients/client-lookoutmetrics/commands/GetSampleDataCommand.ts b/clients/client-lookoutmetrics/src/commands/GetSampleDataCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/GetSampleDataCommand.ts rename to clients/client-lookoutmetrics/src/commands/GetSampleDataCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListAlertsCommand.ts b/clients/client-lookoutmetrics/src/commands/ListAlertsCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListAlertsCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListAlertsCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListAnomalyDetectorsCommand.ts b/clients/client-lookoutmetrics/src/commands/ListAnomalyDetectorsCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListAnomalyDetectorsCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListAnomalyDetectorsCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListAnomalyGroupSummariesCommand.ts b/clients/client-lookoutmetrics/src/commands/ListAnomalyGroupSummariesCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListAnomalyGroupSummariesCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListAnomalyGroupSummariesCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListAnomalyGroupTimeSeriesCommand.ts b/clients/client-lookoutmetrics/src/commands/ListAnomalyGroupTimeSeriesCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListAnomalyGroupTimeSeriesCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListAnomalyGroupTimeSeriesCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListMetricSetsCommand.ts b/clients/client-lookoutmetrics/src/commands/ListMetricSetsCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListMetricSetsCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListMetricSetsCommand.ts diff --git a/clients/client-lookoutmetrics/commands/ListTagsForResourceCommand.ts b/clients/client-lookoutmetrics/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/ListTagsForResourceCommand.ts rename to clients/client-lookoutmetrics/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-lookoutmetrics/commands/PutFeedbackCommand.ts b/clients/client-lookoutmetrics/src/commands/PutFeedbackCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/PutFeedbackCommand.ts rename to clients/client-lookoutmetrics/src/commands/PutFeedbackCommand.ts diff --git a/clients/client-lookoutmetrics/commands/TagResourceCommand.ts b/clients/client-lookoutmetrics/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/TagResourceCommand.ts rename to clients/client-lookoutmetrics/src/commands/TagResourceCommand.ts diff --git a/clients/client-lookoutmetrics/commands/UntagResourceCommand.ts b/clients/client-lookoutmetrics/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/UntagResourceCommand.ts rename to clients/client-lookoutmetrics/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lookoutmetrics/commands/UpdateAnomalyDetectorCommand.ts b/clients/client-lookoutmetrics/src/commands/UpdateAnomalyDetectorCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/UpdateAnomalyDetectorCommand.ts rename to clients/client-lookoutmetrics/src/commands/UpdateAnomalyDetectorCommand.ts diff --git a/clients/client-lookoutmetrics/commands/UpdateMetricSetCommand.ts b/clients/client-lookoutmetrics/src/commands/UpdateMetricSetCommand.ts similarity index 100% rename from clients/client-lookoutmetrics/commands/UpdateMetricSetCommand.ts rename to clients/client-lookoutmetrics/src/commands/UpdateMetricSetCommand.ts diff --git a/clients/client-lookoutmetrics/endpoints.ts b/clients/client-lookoutmetrics/src/endpoints.ts similarity index 100% rename from clients/client-lookoutmetrics/endpoints.ts rename to clients/client-lookoutmetrics/src/endpoints.ts diff --git a/clients/client-lookoutmetrics/index.ts b/clients/client-lookoutmetrics/src/index.ts similarity index 100% rename from clients/client-lookoutmetrics/index.ts rename to clients/client-lookoutmetrics/src/index.ts diff --git a/clients/client-lookoutmetrics/models/index.ts b/clients/client-lookoutmetrics/src/models/index.ts similarity index 100% rename from clients/client-lookoutmetrics/models/index.ts rename to clients/client-lookoutmetrics/src/models/index.ts diff --git a/clients/client-lookoutmetrics/models/models_0.ts b/clients/client-lookoutmetrics/src/models/models_0.ts similarity index 100% rename from clients/client-lookoutmetrics/models/models_0.ts rename to clients/client-lookoutmetrics/src/models/models_0.ts diff --git a/clients/client-lookoutmetrics/pagination/DescribeAnomalyDetectionExecutionsPaginator.ts b/clients/client-lookoutmetrics/src/pagination/DescribeAnomalyDetectionExecutionsPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/DescribeAnomalyDetectionExecutionsPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/DescribeAnomalyDetectionExecutionsPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/GetFeedbackPaginator.ts b/clients/client-lookoutmetrics/src/pagination/GetFeedbackPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/GetFeedbackPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/GetFeedbackPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/Interfaces.ts b/clients/client-lookoutmetrics/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/Interfaces.ts rename to clients/client-lookoutmetrics/src/pagination/Interfaces.ts diff --git a/clients/client-lookoutmetrics/pagination/ListAlertsPaginator.ts b/clients/client-lookoutmetrics/src/pagination/ListAlertsPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/ListAlertsPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/ListAlertsPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/ListAnomalyDetectorsPaginator.ts b/clients/client-lookoutmetrics/src/pagination/ListAnomalyDetectorsPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/ListAnomalyDetectorsPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/ListAnomalyDetectorsPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/ListAnomalyGroupSummariesPaginator.ts b/clients/client-lookoutmetrics/src/pagination/ListAnomalyGroupSummariesPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/ListAnomalyGroupSummariesPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/ListAnomalyGroupSummariesPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/ListAnomalyGroupTimeSeriesPaginator.ts b/clients/client-lookoutmetrics/src/pagination/ListAnomalyGroupTimeSeriesPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/ListAnomalyGroupTimeSeriesPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/ListAnomalyGroupTimeSeriesPaginator.ts diff --git a/clients/client-lookoutmetrics/pagination/ListMetricSetsPaginator.ts b/clients/client-lookoutmetrics/src/pagination/ListMetricSetsPaginator.ts similarity index 100% rename from clients/client-lookoutmetrics/pagination/ListMetricSetsPaginator.ts rename to clients/client-lookoutmetrics/src/pagination/ListMetricSetsPaginator.ts diff --git a/clients/client-lookoutmetrics/protocols/Aws_restJson1.ts b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lookoutmetrics/protocols/Aws_restJson1.ts rename to clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lookoutmetrics/src/runtimeConfig.browser.ts b/clients/client-lookoutmetrics/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..ab03a52f8449 --- /dev/null +++ b/clients/client-lookoutmetrics/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LookoutMetricsClientConfig } from "./LookoutMetricsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutmetrics/runtimeConfig.native.ts b/clients/client-lookoutmetrics/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lookoutmetrics/runtimeConfig.native.ts rename to clients/client-lookoutmetrics/src/runtimeConfig.native.ts diff --git a/clients/client-lookoutmetrics/runtimeConfig.shared.ts b/clients/client-lookoutmetrics/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lookoutmetrics/runtimeConfig.shared.ts rename to clients/client-lookoutmetrics/src/runtimeConfig.shared.ts diff --git a/clients/client-lookoutmetrics/src/runtimeConfig.ts b/clients/client-lookoutmetrics/src/runtimeConfig.ts new file mode 100644 index 000000000000..2152725dbc16 --- /dev/null +++ b/clients/client-lookoutmetrics/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LookoutMetricsClientConfig } from "./LookoutMetricsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutmetrics/tsconfig.es.json b/clients/client-lookoutmetrics/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lookoutmetrics/tsconfig.es.json +++ b/clients/client-lookoutmetrics/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lookoutmetrics/tsconfig.json b/clients/client-lookoutmetrics/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lookoutmetrics/tsconfig.json +++ b/clients/client-lookoutmetrics/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lookoutmetrics/tsconfig.types.json b/clients/client-lookoutmetrics/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lookoutmetrics/tsconfig.types.json +++ b/clients/client-lookoutmetrics/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-lookoutvision/.gitignore b/clients/client-lookoutvision/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-lookoutvision/.gitignore +++ b/clients/client-lookoutvision/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-lookoutvision/package.json b/clients/client-lookoutvision/package.json index 2f6b497ba12b..4210110155dd 100644 --- a/clients/client-lookoutvision/package.json +++ b/clients/client-lookoutvision/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-lookoutvision", "repository": { "type": "git", diff --git a/clients/client-lookoutvision/runtimeConfig.browser.ts b/clients/client-lookoutvision/runtimeConfig.browser.ts deleted file mode 100644 index 2915b600cbca..000000000000 --- a/clients/client-lookoutvision/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { LookoutVisionClientConfig } from "./LookoutVisionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutvision/runtimeConfig.ts b/clients/client-lookoutvision/runtimeConfig.ts deleted file mode 100644 index 7821efade9da..000000000000 --- a/clients/client-lookoutvision/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { LookoutVisionClientConfig } from "./LookoutVisionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-lookoutvision/LookoutVision.ts b/clients/client-lookoutvision/src/LookoutVision.ts similarity index 100% rename from clients/client-lookoutvision/LookoutVision.ts rename to clients/client-lookoutvision/src/LookoutVision.ts diff --git a/clients/client-lookoutvision/LookoutVisionClient.ts b/clients/client-lookoutvision/src/LookoutVisionClient.ts similarity index 100% rename from clients/client-lookoutvision/LookoutVisionClient.ts rename to clients/client-lookoutvision/src/LookoutVisionClient.ts diff --git a/clients/client-lookoutvision/commands/CreateDatasetCommand.ts b/clients/client-lookoutvision/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/CreateDatasetCommand.ts rename to clients/client-lookoutvision/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-lookoutvision/commands/CreateModelCommand.ts b/clients/client-lookoutvision/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/CreateModelCommand.ts rename to clients/client-lookoutvision/src/commands/CreateModelCommand.ts diff --git a/clients/client-lookoutvision/commands/CreateProjectCommand.ts b/clients/client-lookoutvision/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/CreateProjectCommand.ts rename to clients/client-lookoutvision/src/commands/CreateProjectCommand.ts diff --git a/clients/client-lookoutvision/commands/DeleteDatasetCommand.ts b/clients/client-lookoutvision/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DeleteDatasetCommand.ts rename to clients/client-lookoutvision/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-lookoutvision/commands/DeleteModelCommand.ts b/clients/client-lookoutvision/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DeleteModelCommand.ts rename to clients/client-lookoutvision/src/commands/DeleteModelCommand.ts diff --git a/clients/client-lookoutvision/commands/DeleteProjectCommand.ts b/clients/client-lookoutvision/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DeleteProjectCommand.ts rename to clients/client-lookoutvision/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-lookoutvision/commands/DescribeDatasetCommand.ts b/clients/client-lookoutvision/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DescribeDatasetCommand.ts rename to clients/client-lookoutvision/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-lookoutvision/commands/DescribeModelCommand.ts b/clients/client-lookoutvision/src/commands/DescribeModelCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DescribeModelCommand.ts rename to clients/client-lookoutvision/src/commands/DescribeModelCommand.ts diff --git a/clients/client-lookoutvision/commands/DescribeProjectCommand.ts b/clients/client-lookoutvision/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DescribeProjectCommand.ts rename to clients/client-lookoutvision/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-lookoutvision/commands/DetectAnomaliesCommand.ts b/clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/DetectAnomaliesCommand.ts rename to clients/client-lookoutvision/src/commands/DetectAnomaliesCommand.ts diff --git a/clients/client-lookoutvision/commands/ListDatasetEntriesCommand.ts b/clients/client-lookoutvision/src/commands/ListDatasetEntriesCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/ListDatasetEntriesCommand.ts rename to clients/client-lookoutvision/src/commands/ListDatasetEntriesCommand.ts diff --git a/clients/client-lookoutvision/commands/ListModelsCommand.ts b/clients/client-lookoutvision/src/commands/ListModelsCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/ListModelsCommand.ts rename to clients/client-lookoutvision/src/commands/ListModelsCommand.ts diff --git a/clients/client-lookoutvision/commands/ListProjectsCommand.ts b/clients/client-lookoutvision/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/ListProjectsCommand.ts rename to clients/client-lookoutvision/src/commands/ListProjectsCommand.ts diff --git a/clients/client-lookoutvision/commands/ListTagsForResourceCommand.ts b/clients/client-lookoutvision/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/ListTagsForResourceCommand.ts rename to clients/client-lookoutvision/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-lookoutvision/commands/StartModelCommand.ts b/clients/client-lookoutvision/src/commands/StartModelCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/StartModelCommand.ts rename to clients/client-lookoutvision/src/commands/StartModelCommand.ts diff --git a/clients/client-lookoutvision/commands/StopModelCommand.ts b/clients/client-lookoutvision/src/commands/StopModelCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/StopModelCommand.ts rename to clients/client-lookoutvision/src/commands/StopModelCommand.ts diff --git a/clients/client-lookoutvision/commands/TagResourceCommand.ts b/clients/client-lookoutvision/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/TagResourceCommand.ts rename to clients/client-lookoutvision/src/commands/TagResourceCommand.ts diff --git a/clients/client-lookoutvision/commands/UntagResourceCommand.ts b/clients/client-lookoutvision/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/UntagResourceCommand.ts rename to clients/client-lookoutvision/src/commands/UntagResourceCommand.ts diff --git a/clients/client-lookoutvision/commands/UpdateDatasetEntriesCommand.ts b/clients/client-lookoutvision/src/commands/UpdateDatasetEntriesCommand.ts similarity index 100% rename from clients/client-lookoutvision/commands/UpdateDatasetEntriesCommand.ts rename to clients/client-lookoutvision/src/commands/UpdateDatasetEntriesCommand.ts diff --git a/clients/client-lookoutvision/endpoints.ts b/clients/client-lookoutvision/src/endpoints.ts similarity index 100% rename from clients/client-lookoutvision/endpoints.ts rename to clients/client-lookoutvision/src/endpoints.ts diff --git a/clients/client-lookoutvision/index.ts b/clients/client-lookoutvision/src/index.ts similarity index 100% rename from clients/client-lookoutvision/index.ts rename to clients/client-lookoutvision/src/index.ts diff --git a/clients/client-lookoutvision/models/index.ts b/clients/client-lookoutvision/src/models/index.ts similarity index 100% rename from clients/client-lookoutvision/models/index.ts rename to clients/client-lookoutvision/src/models/index.ts diff --git a/clients/client-lookoutvision/models/models_0.ts b/clients/client-lookoutvision/src/models/models_0.ts similarity index 100% rename from clients/client-lookoutvision/models/models_0.ts rename to clients/client-lookoutvision/src/models/models_0.ts diff --git a/clients/client-lookoutvision/pagination/Interfaces.ts b/clients/client-lookoutvision/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-lookoutvision/pagination/Interfaces.ts rename to clients/client-lookoutvision/src/pagination/Interfaces.ts diff --git a/clients/client-lookoutvision/pagination/ListDatasetEntriesPaginator.ts b/clients/client-lookoutvision/src/pagination/ListDatasetEntriesPaginator.ts similarity index 100% rename from clients/client-lookoutvision/pagination/ListDatasetEntriesPaginator.ts rename to clients/client-lookoutvision/src/pagination/ListDatasetEntriesPaginator.ts diff --git a/clients/client-lookoutvision/pagination/ListModelsPaginator.ts b/clients/client-lookoutvision/src/pagination/ListModelsPaginator.ts similarity index 100% rename from clients/client-lookoutvision/pagination/ListModelsPaginator.ts rename to clients/client-lookoutvision/src/pagination/ListModelsPaginator.ts diff --git a/clients/client-lookoutvision/pagination/ListProjectsPaginator.ts b/clients/client-lookoutvision/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-lookoutvision/pagination/ListProjectsPaginator.ts rename to clients/client-lookoutvision/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-lookoutvision/protocols/Aws_restJson1.ts b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-lookoutvision/protocols/Aws_restJson1.ts rename to clients/client-lookoutvision/src/protocols/Aws_restJson1.ts diff --git a/clients/client-lookoutvision/src/runtimeConfig.browser.ts b/clients/client-lookoutvision/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1c38cd37ae8f --- /dev/null +++ b/clients/client-lookoutvision/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { LookoutVisionClientConfig } from "./LookoutVisionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutvision/runtimeConfig.native.ts b/clients/client-lookoutvision/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-lookoutvision/runtimeConfig.native.ts rename to clients/client-lookoutvision/src/runtimeConfig.native.ts diff --git a/clients/client-lookoutvision/runtimeConfig.shared.ts b/clients/client-lookoutvision/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-lookoutvision/runtimeConfig.shared.ts rename to clients/client-lookoutvision/src/runtimeConfig.shared.ts diff --git a/clients/client-lookoutvision/src/runtimeConfig.ts b/clients/client-lookoutvision/src/runtimeConfig.ts new file mode 100644 index 000000000000..8cf78f521a83 --- /dev/null +++ b/clients/client-lookoutvision/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { LookoutVisionClientConfig } from "./LookoutVisionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-lookoutvision/tsconfig.es.json b/clients/client-lookoutvision/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-lookoutvision/tsconfig.es.json +++ b/clients/client-lookoutvision/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-lookoutvision/tsconfig.json b/clients/client-lookoutvision/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-lookoutvision/tsconfig.json +++ b/clients/client-lookoutvision/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-lookoutvision/tsconfig.types.json b/clients/client-lookoutvision/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-lookoutvision/tsconfig.types.json +++ b/clients/client-lookoutvision/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-machine-learning/.gitignore b/clients/client-machine-learning/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-machine-learning/.gitignore +++ b/clients/client-machine-learning/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-machine-learning/package.json b/clients/client-machine-learning/package.json index 479540c7b60c..1f2072c2f7cc 100644 --- a/clients/client-machine-learning/package.json +++ b/clients/client-machine-learning/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-machine-learning", "repository": { "type": "git", diff --git a/clients/client-machine-learning/runtimeConfig.browser.ts b/clients/client-machine-learning/runtimeConfig.browser.ts deleted file mode 100644 index a55776303209..000000000000 --- a/clients/client-machine-learning/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MachineLearningClientConfig } from "./MachineLearningClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MachineLearningClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-machine-learning/runtimeConfig.ts b/clients/client-machine-learning/runtimeConfig.ts deleted file mode 100644 index 05e2ff63236a..000000000000 --- a/clients/client-machine-learning/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MachineLearningClientConfig } from "./MachineLearningClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MachineLearningClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-machine-learning/MachineLearning.ts b/clients/client-machine-learning/src/MachineLearning.ts similarity index 100% rename from clients/client-machine-learning/MachineLearning.ts rename to clients/client-machine-learning/src/MachineLearning.ts diff --git a/clients/client-machine-learning/MachineLearningClient.ts b/clients/client-machine-learning/src/MachineLearningClient.ts similarity index 100% rename from clients/client-machine-learning/MachineLearningClient.ts rename to clients/client-machine-learning/src/MachineLearningClient.ts diff --git a/clients/client-machine-learning/commands/AddTagsCommand.ts b/clients/client-machine-learning/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/AddTagsCommand.ts rename to clients/client-machine-learning/src/commands/AddTagsCommand.ts diff --git a/clients/client-machine-learning/commands/CreateBatchPredictionCommand.ts b/clients/client-machine-learning/src/commands/CreateBatchPredictionCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateBatchPredictionCommand.ts rename to clients/client-machine-learning/src/commands/CreateBatchPredictionCommand.ts diff --git a/clients/client-machine-learning/commands/CreateDataSourceFromRDSCommand.ts b/clients/client-machine-learning/src/commands/CreateDataSourceFromRDSCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateDataSourceFromRDSCommand.ts rename to clients/client-machine-learning/src/commands/CreateDataSourceFromRDSCommand.ts diff --git a/clients/client-machine-learning/commands/CreateDataSourceFromRedshiftCommand.ts b/clients/client-machine-learning/src/commands/CreateDataSourceFromRedshiftCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateDataSourceFromRedshiftCommand.ts rename to clients/client-machine-learning/src/commands/CreateDataSourceFromRedshiftCommand.ts diff --git a/clients/client-machine-learning/commands/CreateDataSourceFromS3Command.ts b/clients/client-machine-learning/src/commands/CreateDataSourceFromS3Command.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateDataSourceFromS3Command.ts rename to clients/client-machine-learning/src/commands/CreateDataSourceFromS3Command.ts diff --git a/clients/client-machine-learning/commands/CreateEvaluationCommand.ts b/clients/client-machine-learning/src/commands/CreateEvaluationCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateEvaluationCommand.ts rename to clients/client-machine-learning/src/commands/CreateEvaluationCommand.ts diff --git a/clients/client-machine-learning/commands/CreateMLModelCommand.ts b/clients/client-machine-learning/src/commands/CreateMLModelCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateMLModelCommand.ts rename to clients/client-machine-learning/src/commands/CreateMLModelCommand.ts diff --git a/clients/client-machine-learning/commands/CreateRealtimeEndpointCommand.ts b/clients/client-machine-learning/src/commands/CreateRealtimeEndpointCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/CreateRealtimeEndpointCommand.ts rename to clients/client-machine-learning/src/commands/CreateRealtimeEndpointCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteBatchPredictionCommand.ts b/clients/client-machine-learning/src/commands/DeleteBatchPredictionCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteBatchPredictionCommand.ts rename to clients/client-machine-learning/src/commands/DeleteBatchPredictionCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteDataSourceCommand.ts b/clients/client-machine-learning/src/commands/DeleteDataSourceCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteDataSourceCommand.ts rename to clients/client-machine-learning/src/commands/DeleteDataSourceCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteEvaluationCommand.ts b/clients/client-machine-learning/src/commands/DeleteEvaluationCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteEvaluationCommand.ts rename to clients/client-machine-learning/src/commands/DeleteEvaluationCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteMLModelCommand.ts b/clients/client-machine-learning/src/commands/DeleteMLModelCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteMLModelCommand.ts rename to clients/client-machine-learning/src/commands/DeleteMLModelCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteRealtimeEndpointCommand.ts b/clients/client-machine-learning/src/commands/DeleteRealtimeEndpointCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteRealtimeEndpointCommand.ts rename to clients/client-machine-learning/src/commands/DeleteRealtimeEndpointCommand.ts diff --git a/clients/client-machine-learning/commands/DeleteTagsCommand.ts b/clients/client-machine-learning/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DeleteTagsCommand.ts rename to clients/client-machine-learning/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-machine-learning/commands/DescribeBatchPredictionsCommand.ts b/clients/client-machine-learning/src/commands/DescribeBatchPredictionsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DescribeBatchPredictionsCommand.ts rename to clients/client-machine-learning/src/commands/DescribeBatchPredictionsCommand.ts diff --git a/clients/client-machine-learning/commands/DescribeDataSourcesCommand.ts b/clients/client-machine-learning/src/commands/DescribeDataSourcesCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DescribeDataSourcesCommand.ts rename to clients/client-machine-learning/src/commands/DescribeDataSourcesCommand.ts diff --git a/clients/client-machine-learning/commands/DescribeEvaluationsCommand.ts b/clients/client-machine-learning/src/commands/DescribeEvaluationsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DescribeEvaluationsCommand.ts rename to clients/client-machine-learning/src/commands/DescribeEvaluationsCommand.ts diff --git a/clients/client-machine-learning/commands/DescribeMLModelsCommand.ts b/clients/client-machine-learning/src/commands/DescribeMLModelsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DescribeMLModelsCommand.ts rename to clients/client-machine-learning/src/commands/DescribeMLModelsCommand.ts diff --git a/clients/client-machine-learning/commands/DescribeTagsCommand.ts b/clients/client-machine-learning/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/DescribeTagsCommand.ts rename to clients/client-machine-learning/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-machine-learning/commands/GetBatchPredictionCommand.ts b/clients/client-machine-learning/src/commands/GetBatchPredictionCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/GetBatchPredictionCommand.ts rename to clients/client-machine-learning/src/commands/GetBatchPredictionCommand.ts diff --git a/clients/client-machine-learning/commands/GetDataSourceCommand.ts b/clients/client-machine-learning/src/commands/GetDataSourceCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/GetDataSourceCommand.ts rename to clients/client-machine-learning/src/commands/GetDataSourceCommand.ts diff --git a/clients/client-machine-learning/commands/GetEvaluationCommand.ts b/clients/client-machine-learning/src/commands/GetEvaluationCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/GetEvaluationCommand.ts rename to clients/client-machine-learning/src/commands/GetEvaluationCommand.ts diff --git a/clients/client-machine-learning/commands/GetMLModelCommand.ts b/clients/client-machine-learning/src/commands/GetMLModelCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/GetMLModelCommand.ts rename to clients/client-machine-learning/src/commands/GetMLModelCommand.ts diff --git a/clients/client-machine-learning/commands/PredictCommand.ts b/clients/client-machine-learning/src/commands/PredictCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/PredictCommand.ts rename to clients/client-machine-learning/src/commands/PredictCommand.ts diff --git a/clients/client-machine-learning/commands/UpdateBatchPredictionCommand.ts b/clients/client-machine-learning/src/commands/UpdateBatchPredictionCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/UpdateBatchPredictionCommand.ts rename to clients/client-machine-learning/src/commands/UpdateBatchPredictionCommand.ts diff --git a/clients/client-machine-learning/commands/UpdateDataSourceCommand.ts b/clients/client-machine-learning/src/commands/UpdateDataSourceCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/UpdateDataSourceCommand.ts rename to clients/client-machine-learning/src/commands/UpdateDataSourceCommand.ts diff --git a/clients/client-machine-learning/commands/UpdateEvaluationCommand.ts b/clients/client-machine-learning/src/commands/UpdateEvaluationCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/UpdateEvaluationCommand.ts rename to clients/client-machine-learning/src/commands/UpdateEvaluationCommand.ts diff --git a/clients/client-machine-learning/commands/UpdateMLModelCommand.ts b/clients/client-machine-learning/src/commands/UpdateMLModelCommand.ts similarity index 100% rename from clients/client-machine-learning/commands/UpdateMLModelCommand.ts rename to clients/client-machine-learning/src/commands/UpdateMLModelCommand.ts diff --git a/clients/client-machine-learning/endpoints.ts b/clients/client-machine-learning/src/endpoints.ts similarity index 100% rename from clients/client-machine-learning/endpoints.ts rename to clients/client-machine-learning/src/endpoints.ts diff --git a/clients/client-machine-learning/index.ts b/clients/client-machine-learning/src/index.ts similarity index 100% rename from clients/client-machine-learning/index.ts rename to clients/client-machine-learning/src/index.ts diff --git a/clients/client-machine-learning/models/index.ts b/clients/client-machine-learning/src/models/index.ts similarity index 100% rename from clients/client-machine-learning/models/index.ts rename to clients/client-machine-learning/src/models/index.ts diff --git a/clients/client-machine-learning/models/models_0.ts b/clients/client-machine-learning/src/models/models_0.ts similarity index 100% rename from clients/client-machine-learning/models/models_0.ts rename to clients/client-machine-learning/src/models/models_0.ts diff --git a/clients/client-machine-learning/pagination/DescribeBatchPredictionsPaginator.ts b/clients/client-machine-learning/src/pagination/DescribeBatchPredictionsPaginator.ts similarity index 100% rename from clients/client-machine-learning/pagination/DescribeBatchPredictionsPaginator.ts rename to clients/client-machine-learning/src/pagination/DescribeBatchPredictionsPaginator.ts diff --git a/clients/client-machine-learning/pagination/DescribeDataSourcesPaginator.ts b/clients/client-machine-learning/src/pagination/DescribeDataSourcesPaginator.ts similarity index 100% rename from clients/client-machine-learning/pagination/DescribeDataSourcesPaginator.ts rename to clients/client-machine-learning/src/pagination/DescribeDataSourcesPaginator.ts diff --git a/clients/client-machine-learning/pagination/DescribeEvaluationsPaginator.ts b/clients/client-machine-learning/src/pagination/DescribeEvaluationsPaginator.ts similarity index 100% rename from clients/client-machine-learning/pagination/DescribeEvaluationsPaginator.ts rename to clients/client-machine-learning/src/pagination/DescribeEvaluationsPaginator.ts diff --git a/clients/client-machine-learning/pagination/DescribeMLModelsPaginator.ts b/clients/client-machine-learning/src/pagination/DescribeMLModelsPaginator.ts similarity index 100% rename from clients/client-machine-learning/pagination/DescribeMLModelsPaginator.ts rename to clients/client-machine-learning/src/pagination/DescribeMLModelsPaginator.ts diff --git a/clients/client-machine-learning/pagination/Interfaces.ts b/clients/client-machine-learning/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-machine-learning/pagination/Interfaces.ts rename to clients/client-machine-learning/src/pagination/Interfaces.ts diff --git a/clients/client-machine-learning/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-machine-learning/protocols/Aws_json1_1.ts rename to clients/client-machine-learning/src/protocols/Aws_json1_1.ts diff --git a/clients/client-machine-learning/src/runtimeConfig.browser.ts b/clients/client-machine-learning/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9ee9bab6ed41 --- /dev/null +++ b/clients/client-machine-learning/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MachineLearningClientConfig } from "./MachineLearningClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MachineLearningClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-machine-learning/runtimeConfig.native.ts b/clients/client-machine-learning/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-machine-learning/runtimeConfig.native.ts rename to clients/client-machine-learning/src/runtimeConfig.native.ts diff --git a/clients/client-machine-learning/runtimeConfig.shared.ts b/clients/client-machine-learning/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-machine-learning/runtimeConfig.shared.ts rename to clients/client-machine-learning/src/runtimeConfig.shared.ts diff --git a/clients/client-machine-learning/src/runtimeConfig.ts b/clients/client-machine-learning/src/runtimeConfig.ts new file mode 100644 index 000000000000..7cf6c7f265ed --- /dev/null +++ b/clients/client-machine-learning/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MachineLearningClientConfig } from "./MachineLearningClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MachineLearningClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-machine-learning/waiters/waitForBatchPredictionAvailable.ts b/clients/client-machine-learning/src/waiters/waitForBatchPredictionAvailable.ts similarity index 100% rename from clients/client-machine-learning/waiters/waitForBatchPredictionAvailable.ts rename to clients/client-machine-learning/src/waiters/waitForBatchPredictionAvailable.ts diff --git a/clients/client-machine-learning/waiters/waitForDataSourceAvailable.ts b/clients/client-machine-learning/src/waiters/waitForDataSourceAvailable.ts similarity index 100% rename from clients/client-machine-learning/waiters/waitForDataSourceAvailable.ts rename to clients/client-machine-learning/src/waiters/waitForDataSourceAvailable.ts diff --git a/clients/client-machine-learning/waiters/waitForEvaluationAvailable.ts b/clients/client-machine-learning/src/waiters/waitForEvaluationAvailable.ts similarity index 100% rename from clients/client-machine-learning/waiters/waitForEvaluationAvailable.ts rename to clients/client-machine-learning/src/waiters/waitForEvaluationAvailable.ts diff --git a/clients/client-machine-learning/waiters/waitForMLModelAvailable.ts b/clients/client-machine-learning/src/waiters/waitForMLModelAvailable.ts similarity index 100% rename from clients/client-machine-learning/waiters/waitForMLModelAvailable.ts rename to clients/client-machine-learning/src/waiters/waitForMLModelAvailable.ts diff --git a/clients/client-machine-learning/tsconfig.es.json b/clients/client-machine-learning/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-machine-learning/tsconfig.es.json +++ b/clients/client-machine-learning/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-machine-learning/tsconfig.json b/clients/client-machine-learning/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-machine-learning/tsconfig.json +++ b/clients/client-machine-learning/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-machine-learning/tsconfig.types.json b/clients/client-machine-learning/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-machine-learning/tsconfig.types.json +++ b/clients/client-machine-learning/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-macie/.gitignore b/clients/client-macie/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-macie/.gitignore +++ b/clients/client-macie/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-macie/package.json b/clients/client-macie/package.json index 27a8a471be74..10485580e6b1 100644 --- a/clients/client-macie/package.json +++ b/clients/client-macie/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-macie", "repository": { "type": "git", diff --git a/clients/client-macie/runtimeConfig.browser.ts b/clients/client-macie/runtimeConfig.browser.ts deleted file mode 100644 index 1da7ec25f436..000000000000 --- a/clients/client-macie/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MacieClientConfig } from "./MacieClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MacieClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-macie/runtimeConfig.ts b/clients/client-macie/runtimeConfig.ts deleted file mode 100644 index b91cecf17fc9..000000000000 --- a/clients/client-macie/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MacieClientConfig } from "./MacieClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MacieClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-macie/Macie.ts b/clients/client-macie/src/Macie.ts similarity index 100% rename from clients/client-macie/Macie.ts rename to clients/client-macie/src/Macie.ts diff --git a/clients/client-macie/MacieClient.ts b/clients/client-macie/src/MacieClient.ts similarity index 100% rename from clients/client-macie/MacieClient.ts rename to clients/client-macie/src/MacieClient.ts diff --git a/clients/client-macie/commands/AssociateMemberAccountCommand.ts b/clients/client-macie/src/commands/AssociateMemberAccountCommand.ts similarity index 100% rename from clients/client-macie/commands/AssociateMemberAccountCommand.ts rename to clients/client-macie/src/commands/AssociateMemberAccountCommand.ts diff --git a/clients/client-macie/commands/AssociateS3ResourcesCommand.ts b/clients/client-macie/src/commands/AssociateS3ResourcesCommand.ts similarity index 100% rename from clients/client-macie/commands/AssociateS3ResourcesCommand.ts rename to clients/client-macie/src/commands/AssociateS3ResourcesCommand.ts diff --git a/clients/client-macie/commands/DisassociateMemberAccountCommand.ts b/clients/client-macie/src/commands/DisassociateMemberAccountCommand.ts similarity index 100% rename from clients/client-macie/commands/DisassociateMemberAccountCommand.ts rename to clients/client-macie/src/commands/DisassociateMemberAccountCommand.ts diff --git a/clients/client-macie/commands/DisassociateS3ResourcesCommand.ts b/clients/client-macie/src/commands/DisassociateS3ResourcesCommand.ts similarity index 100% rename from clients/client-macie/commands/DisassociateS3ResourcesCommand.ts rename to clients/client-macie/src/commands/DisassociateS3ResourcesCommand.ts diff --git a/clients/client-macie/commands/ListMemberAccountsCommand.ts b/clients/client-macie/src/commands/ListMemberAccountsCommand.ts similarity index 100% rename from clients/client-macie/commands/ListMemberAccountsCommand.ts rename to clients/client-macie/src/commands/ListMemberAccountsCommand.ts diff --git a/clients/client-macie/commands/ListS3ResourcesCommand.ts b/clients/client-macie/src/commands/ListS3ResourcesCommand.ts similarity index 100% rename from clients/client-macie/commands/ListS3ResourcesCommand.ts rename to clients/client-macie/src/commands/ListS3ResourcesCommand.ts diff --git a/clients/client-macie/commands/UpdateS3ResourcesCommand.ts b/clients/client-macie/src/commands/UpdateS3ResourcesCommand.ts similarity index 100% rename from clients/client-macie/commands/UpdateS3ResourcesCommand.ts rename to clients/client-macie/src/commands/UpdateS3ResourcesCommand.ts diff --git a/clients/client-macie/endpoints.ts b/clients/client-macie/src/endpoints.ts similarity index 100% rename from clients/client-macie/endpoints.ts rename to clients/client-macie/src/endpoints.ts diff --git a/clients/client-macie/index.ts b/clients/client-macie/src/index.ts similarity index 100% rename from clients/client-macie/index.ts rename to clients/client-macie/src/index.ts diff --git a/clients/client-macie/models/index.ts b/clients/client-macie/src/models/index.ts similarity index 100% rename from clients/client-macie/models/index.ts rename to clients/client-macie/src/models/index.ts diff --git a/clients/client-macie/models/models_0.ts b/clients/client-macie/src/models/models_0.ts similarity index 100% rename from clients/client-macie/models/models_0.ts rename to clients/client-macie/src/models/models_0.ts diff --git a/clients/client-macie/pagination/Interfaces.ts b/clients/client-macie/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-macie/pagination/Interfaces.ts rename to clients/client-macie/src/pagination/Interfaces.ts diff --git a/clients/client-macie/pagination/ListMemberAccountsPaginator.ts b/clients/client-macie/src/pagination/ListMemberAccountsPaginator.ts similarity index 100% rename from clients/client-macie/pagination/ListMemberAccountsPaginator.ts rename to clients/client-macie/src/pagination/ListMemberAccountsPaginator.ts diff --git a/clients/client-macie/pagination/ListS3ResourcesPaginator.ts b/clients/client-macie/src/pagination/ListS3ResourcesPaginator.ts similarity index 100% rename from clients/client-macie/pagination/ListS3ResourcesPaginator.ts rename to clients/client-macie/src/pagination/ListS3ResourcesPaginator.ts diff --git a/clients/client-macie/protocols/Aws_json1_1.ts b/clients/client-macie/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-macie/protocols/Aws_json1_1.ts rename to clients/client-macie/src/protocols/Aws_json1_1.ts diff --git a/clients/client-macie/src/runtimeConfig.browser.ts b/clients/client-macie/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..534c6f5db7b4 --- /dev/null +++ b/clients/client-macie/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MacieClientConfig } from "./MacieClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MacieClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-macie/runtimeConfig.native.ts b/clients/client-macie/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-macie/runtimeConfig.native.ts rename to clients/client-macie/src/runtimeConfig.native.ts diff --git a/clients/client-macie/runtimeConfig.shared.ts b/clients/client-macie/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-macie/runtimeConfig.shared.ts rename to clients/client-macie/src/runtimeConfig.shared.ts diff --git a/clients/client-macie/src/runtimeConfig.ts b/clients/client-macie/src/runtimeConfig.ts new file mode 100644 index 000000000000..88d4f6acdf6b --- /dev/null +++ b/clients/client-macie/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MacieClientConfig } from "./MacieClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MacieClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-macie/tsconfig.es.json b/clients/client-macie/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-macie/tsconfig.es.json +++ b/clients/client-macie/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-macie/tsconfig.json b/clients/client-macie/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-macie/tsconfig.json +++ b/clients/client-macie/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-macie/tsconfig.types.json b/clients/client-macie/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-macie/tsconfig.types.json +++ b/clients/client-macie/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-macie2/.gitignore b/clients/client-macie2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-macie2/.gitignore +++ b/clients/client-macie2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-macie2/package.json b/clients/client-macie2/package.json index 964d4c1462c6..991aca3b27ce 100644 --- a/clients/client-macie2/package.json +++ b/clients/client-macie2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-macie2", "repository": { "type": "git", diff --git a/clients/client-macie2/runtimeConfig.browser.ts b/clients/client-macie2/runtimeConfig.browser.ts deleted file mode 100644 index 2c186873641b..000000000000 --- a/clients/client-macie2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Macie2ClientConfig } from "./Macie2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Macie2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-macie2/runtimeConfig.ts b/clients/client-macie2/runtimeConfig.ts deleted file mode 100644 index 65d2ef7f0b84..000000000000 --- a/clients/client-macie2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Macie2ClientConfig } from "./Macie2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Macie2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-macie2/Macie2.ts b/clients/client-macie2/src/Macie2.ts similarity index 100% rename from clients/client-macie2/Macie2.ts rename to clients/client-macie2/src/Macie2.ts diff --git a/clients/client-macie2/Macie2Client.ts b/clients/client-macie2/src/Macie2Client.ts similarity index 100% rename from clients/client-macie2/Macie2Client.ts rename to clients/client-macie2/src/Macie2Client.ts diff --git a/clients/client-macie2/commands/AcceptInvitationCommand.ts b/clients/client-macie2/src/commands/AcceptInvitationCommand.ts similarity index 100% rename from clients/client-macie2/commands/AcceptInvitationCommand.ts rename to clients/client-macie2/src/commands/AcceptInvitationCommand.ts diff --git a/clients/client-macie2/commands/BatchGetCustomDataIdentifiersCommand.ts b/clients/client-macie2/src/commands/BatchGetCustomDataIdentifiersCommand.ts similarity index 100% rename from clients/client-macie2/commands/BatchGetCustomDataIdentifiersCommand.ts rename to clients/client-macie2/src/commands/BatchGetCustomDataIdentifiersCommand.ts diff --git a/clients/client-macie2/commands/CreateClassificationJobCommand.ts b/clients/client-macie2/src/commands/CreateClassificationJobCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateClassificationJobCommand.ts rename to clients/client-macie2/src/commands/CreateClassificationJobCommand.ts diff --git a/clients/client-macie2/commands/CreateCustomDataIdentifierCommand.ts b/clients/client-macie2/src/commands/CreateCustomDataIdentifierCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateCustomDataIdentifierCommand.ts rename to clients/client-macie2/src/commands/CreateCustomDataIdentifierCommand.ts diff --git a/clients/client-macie2/commands/CreateFindingsFilterCommand.ts b/clients/client-macie2/src/commands/CreateFindingsFilterCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateFindingsFilterCommand.ts rename to clients/client-macie2/src/commands/CreateFindingsFilterCommand.ts diff --git a/clients/client-macie2/commands/CreateInvitationsCommand.ts b/clients/client-macie2/src/commands/CreateInvitationsCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateInvitationsCommand.ts rename to clients/client-macie2/src/commands/CreateInvitationsCommand.ts diff --git a/clients/client-macie2/commands/CreateMemberCommand.ts b/clients/client-macie2/src/commands/CreateMemberCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateMemberCommand.ts rename to clients/client-macie2/src/commands/CreateMemberCommand.ts diff --git a/clients/client-macie2/commands/CreateSampleFindingsCommand.ts b/clients/client-macie2/src/commands/CreateSampleFindingsCommand.ts similarity index 100% rename from clients/client-macie2/commands/CreateSampleFindingsCommand.ts rename to clients/client-macie2/src/commands/CreateSampleFindingsCommand.ts diff --git a/clients/client-macie2/commands/DeclineInvitationsCommand.ts b/clients/client-macie2/src/commands/DeclineInvitationsCommand.ts similarity index 100% rename from clients/client-macie2/commands/DeclineInvitationsCommand.ts rename to clients/client-macie2/src/commands/DeclineInvitationsCommand.ts diff --git a/clients/client-macie2/commands/DeleteCustomDataIdentifierCommand.ts b/clients/client-macie2/src/commands/DeleteCustomDataIdentifierCommand.ts similarity index 100% rename from clients/client-macie2/commands/DeleteCustomDataIdentifierCommand.ts rename to clients/client-macie2/src/commands/DeleteCustomDataIdentifierCommand.ts diff --git a/clients/client-macie2/commands/DeleteFindingsFilterCommand.ts b/clients/client-macie2/src/commands/DeleteFindingsFilterCommand.ts similarity index 100% rename from clients/client-macie2/commands/DeleteFindingsFilterCommand.ts rename to clients/client-macie2/src/commands/DeleteFindingsFilterCommand.ts diff --git a/clients/client-macie2/commands/DeleteInvitationsCommand.ts b/clients/client-macie2/src/commands/DeleteInvitationsCommand.ts similarity index 100% rename from clients/client-macie2/commands/DeleteInvitationsCommand.ts rename to clients/client-macie2/src/commands/DeleteInvitationsCommand.ts diff --git a/clients/client-macie2/commands/DeleteMemberCommand.ts b/clients/client-macie2/src/commands/DeleteMemberCommand.ts similarity index 100% rename from clients/client-macie2/commands/DeleteMemberCommand.ts rename to clients/client-macie2/src/commands/DeleteMemberCommand.ts diff --git a/clients/client-macie2/commands/DescribeBucketsCommand.ts b/clients/client-macie2/src/commands/DescribeBucketsCommand.ts similarity index 100% rename from clients/client-macie2/commands/DescribeBucketsCommand.ts rename to clients/client-macie2/src/commands/DescribeBucketsCommand.ts diff --git a/clients/client-macie2/commands/DescribeClassificationJobCommand.ts b/clients/client-macie2/src/commands/DescribeClassificationJobCommand.ts similarity index 100% rename from clients/client-macie2/commands/DescribeClassificationJobCommand.ts rename to clients/client-macie2/src/commands/DescribeClassificationJobCommand.ts diff --git a/clients/client-macie2/commands/DescribeOrganizationConfigurationCommand.ts b/clients/client-macie2/src/commands/DescribeOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/DescribeOrganizationConfigurationCommand.ts rename to clients/client-macie2/src/commands/DescribeOrganizationConfigurationCommand.ts diff --git a/clients/client-macie2/commands/DisableMacieCommand.ts b/clients/client-macie2/src/commands/DisableMacieCommand.ts similarity index 100% rename from clients/client-macie2/commands/DisableMacieCommand.ts rename to clients/client-macie2/src/commands/DisableMacieCommand.ts diff --git a/clients/client-macie2/commands/DisableOrganizationAdminAccountCommand.ts b/clients/client-macie2/src/commands/DisableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/DisableOrganizationAdminAccountCommand.ts rename to clients/client-macie2/src/commands/DisableOrganizationAdminAccountCommand.ts diff --git a/clients/client-macie2/commands/DisassociateFromAdministratorAccountCommand.ts b/clients/client-macie2/src/commands/DisassociateFromAdministratorAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/DisassociateFromAdministratorAccountCommand.ts rename to clients/client-macie2/src/commands/DisassociateFromAdministratorAccountCommand.ts diff --git a/clients/client-macie2/commands/DisassociateFromMasterAccountCommand.ts b/clients/client-macie2/src/commands/DisassociateFromMasterAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/DisassociateFromMasterAccountCommand.ts rename to clients/client-macie2/src/commands/DisassociateFromMasterAccountCommand.ts diff --git a/clients/client-macie2/commands/DisassociateMemberCommand.ts b/clients/client-macie2/src/commands/DisassociateMemberCommand.ts similarity index 100% rename from clients/client-macie2/commands/DisassociateMemberCommand.ts rename to clients/client-macie2/src/commands/DisassociateMemberCommand.ts diff --git a/clients/client-macie2/commands/EnableMacieCommand.ts b/clients/client-macie2/src/commands/EnableMacieCommand.ts similarity index 100% rename from clients/client-macie2/commands/EnableMacieCommand.ts rename to clients/client-macie2/src/commands/EnableMacieCommand.ts diff --git a/clients/client-macie2/commands/EnableOrganizationAdminAccountCommand.ts b/clients/client-macie2/src/commands/EnableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/EnableOrganizationAdminAccountCommand.ts rename to clients/client-macie2/src/commands/EnableOrganizationAdminAccountCommand.ts diff --git a/clients/client-macie2/commands/GetAdministratorAccountCommand.ts b/clients/client-macie2/src/commands/GetAdministratorAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetAdministratorAccountCommand.ts rename to clients/client-macie2/src/commands/GetAdministratorAccountCommand.ts diff --git a/clients/client-macie2/commands/GetBucketStatisticsCommand.ts b/clients/client-macie2/src/commands/GetBucketStatisticsCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetBucketStatisticsCommand.ts rename to clients/client-macie2/src/commands/GetBucketStatisticsCommand.ts diff --git a/clients/client-macie2/commands/GetClassificationExportConfigurationCommand.ts b/clients/client-macie2/src/commands/GetClassificationExportConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetClassificationExportConfigurationCommand.ts rename to clients/client-macie2/src/commands/GetClassificationExportConfigurationCommand.ts diff --git a/clients/client-macie2/commands/GetCustomDataIdentifierCommand.ts b/clients/client-macie2/src/commands/GetCustomDataIdentifierCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetCustomDataIdentifierCommand.ts rename to clients/client-macie2/src/commands/GetCustomDataIdentifierCommand.ts diff --git a/clients/client-macie2/commands/GetFindingStatisticsCommand.ts b/clients/client-macie2/src/commands/GetFindingStatisticsCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetFindingStatisticsCommand.ts rename to clients/client-macie2/src/commands/GetFindingStatisticsCommand.ts diff --git a/clients/client-macie2/commands/GetFindingsCommand.ts b/clients/client-macie2/src/commands/GetFindingsCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetFindingsCommand.ts rename to clients/client-macie2/src/commands/GetFindingsCommand.ts diff --git a/clients/client-macie2/commands/GetFindingsFilterCommand.ts b/clients/client-macie2/src/commands/GetFindingsFilterCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetFindingsFilterCommand.ts rename to clients/client-macie2/src/commands/GetFindingsFilterCommand.ts diff --git a/clients/client-macie2/commands/GetFindingsPublicationConfigurationCommand.ts b/clients/client-macie2/src/commands/GetFindingsPublicationConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetFindingsPublicationConfigurationCommand.ts rename to clients/client-macie2/src/commands/GetFindingsPublicationConfigurationCommand.ts diff --git a/clients/client-macie2/commands/GetInvitationsCountCommand.ts b/clients/client-macie2/src/commands/GetInvitationsCountCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetInvitationsCountCommand.ts rename to clients/client-macie2/src/commands/GetInvitationsCountCommand.ts diff --git a/clients/client-macie2/commands/GetMacieSessionCommand.ts b/clients/client-macie2/src/commands/GetMacieSessionCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetMacieSessionCommand.ts rename to clients/client-macie2/src/commands/GetMacieSessionCommand.ts diff --git a/clients/client-macie2/commands/GetMasterAccountCommand.ts b/clients/client-macie2/src/commands/GetMasterAccountCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetMasterAccountCommand.ts rename to clients/client-macie2/src/commands/GetMasterAccountCommand.ts diff --git a/clients/client-macie2/commands/GetMemberCommand.ts b/clients/client-macie2/src/commands/GetMemberCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetMemberCommand.ts rename to clients/client-macie2/src/commands/GetMemberCommand.ts diff --git a/clients/client-macie2/commands/GetUsageStatisticsCommand.ts b/clients/client-macie2/src/commands/GetUsageStatisticsCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetUsageStatisticsCommand.ts rename to clients/client-macie2/src/commands/GetUsageStatisticsCommand.ts diff --git a/clients/client-macie2/commands/GetUsageTotalsCommand.ts b/clients/client-macie2/src/commands/GetUsageTotalsCommand.ts similarity index 100% rename from clients/client-macie2/commands/GetUsageTotalsCommand.ts rename to clients/client-macie2/src/commands/GetUsageTotalsCommand.ts diff --git a/clients/client-macie2/commands/ListClassificationJobsCommand.ts b/clients/client-macie2/src/commands/ListClassificationJobsCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListClassificationJobsCommand.ts rename to clients/client-macie2/src/commands/ListClassificationJobsCommand.ts diff --git a/clients/client-macie2/commands/ListCustomDataIdentifiersCommand.ts b/clients/client-macie2/src/commands/ListCustomDataIdentifiersCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListCustomDataIdentifiersCommand.ts rename to clients/client-macie2/src/commands/ListCustomDataIdentifiersCommand.ts diff --git a/clients/client-macie2/commands/ListFindingsCommand.ts b/clients/client-macie2/src/commands/ListFindingsCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListFindingsCommand.ts rename to clients/client-macie2/src/commands/ListFindingsCommand.ts diff --git a/clients/client-macie2/commands/ListFindingsFiltersCommand.ts b/clients/client-macie2/src/commands/ListFindingsFiltersCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListFindingsFiltersCommand.ts rename to clients/client-macie2/src/commands/ListFindingsFiltersCommand.ts diff --git a/clients/client-macie2/commands/ListInvitationsCommand.ts b/clients/client-macie2/src/commands/ListInvitationsCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListInvitationsCommand.ts rename to clients/client-macie2/src/commands/ListInvitationsCommand.ts diff --git a/clients/client-macie2/commands/ListManagedDataIdentifiersCommand.ts b/clients/client-macie2/src/commands/ListManagedDataIdentifiersCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListManagedDataIdentifiersCommand.ts rename to clients/client-macie2/src/commands/ListManagedDataIdentifiersCommand.ts diff --git a/clients/client-macie2/commands/ListMembersCommand.ts b/clients/client-macie2/src/commands/ListMembersCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListMembersCommand.ts rename to clients/client-macie2/src/commands/ListMembersCommand.ts diff --git a/clients/client-macie2/commands/ListOrganizationAdminAccountsCommand.ts b/clients/client-macie2/src/commands/ListOrganizationAdminAccountsCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListOrganizationAdminAccountsCommand.ts rename to clients/client-macie2/src/commands/ListOrganizationAdminAccountsCommand.ts diff --git a/clients/client-macie2/commands/ListTagsForResourceCommand.ts b/clients/client-macie2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-macie2/commands/ListTagsForResourceCommand.ts rename to clients/client-macie2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-macie2/commands/PutClassificationExportConfigurationCommand.ts b/clients/client-macie2/src/commands/PutClassificationExportConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/PutClassificationExportConfigurationCommand.ts rename to clients/client-macie2/src/commands/PutClassificationExportConfigurationCommand.ts diff --git a/clients/client-macie2/commands/PutFindingsPublicationConfigurationCommand.ts b/clients/client-macie2/src/commands/PutFindingsPublicationConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/PutFindingsPublicationConfigurationCommand.ts rename to clients/client-macie2/src/commands/PutFindingsPublicationConfigurationCommand.ts diff --git a/clients/client-macie2/commands/SearchResourcesCommand.ts b/clients/client-macie2/src/commands/SearchResourcesCommand.ts similarity index 100% rename from clients/client-macie2/commands/SearchResourcesCommand.ts rename to clients/client-macie2/src/commands/SearchResourcesCommand.ts diff --git a/clients/client-macie2/commands/TagResourceCommand.ts b/clients/client-macie2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-macie2/commands/TagResourceCommand.ts rename to clients/client-macie2/src/commands/TagResourceCommand.ts diff --git a/clients/client-macie2/commands/TestCustomDataIdentifierCommand.ts b/clients/client-macie2/src/commands/TestCustomDataIdentifierCommand.ts similarity index 100% rename from clients/client-macie2/commands/TestCustomDataIdentifierCommand.ts rename to clients/client-macie2/src/commands/TestCustomDataIdentifierCommand.ts diff --git a/clients/client-macie2/commands/UntagResourceCommand.ts b/clients/client-macie2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-macie2/commands/UntagResourceCommand.ts rename to clients/client-macie2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-macie2/commands/UpdateClassificationJobCommand.ts b/clients/client-macie2/src/commands/UpdateClassificationJobCommand.ts similarity index 100% rename from clients/client-macie2/commands/UpdateClassificationJobCommand.ts rename to clients/client-macie2/src/commands/UpdateClassificationJobCommand.ts diff --git a/clients/client-macie2/commands/UpdateFindingsFilterCommand.ts b/clients/client-macie2/src/commands/UpdateFindingsFilterCommand.ts similarity index 100% rename from clients/client-macie2/commands/UpdateFindingsFilterCommand.ts rename to clients/client-macie2/src/commands/UpdateFindingsFilterCommand.ts diff --git a/clients/client-macie2/commands/UpdateMacieSessionCommand.ts b/clients/client-macie2/src/commands/UpdateMacieSessionCommand.ts similarity index 100% rename from clients/client-macie2/commands/UpdateMacieSessionCommand.ts rename to clients/client-macie2/src/commands/UpdateMacieSessionCommand.ts diff --git a/clients/client-macie2/commands/UpdateMemberSessionCommand.ts b/clients/client-macie2/src/commands/UpdateMemberSessionCommand.ts similarity index 100% rename from clients/client-macie2/commands/UpdateMemberSessionCommand.ts rename to clients/client-macie2/src/commands/UpdateMemberSessionCommand.ts diff --git a/clients/client-macie2/commands/UpdateOrganizationConfigurationCommand.ts b/clients/client-macie2/src/commands/UpdateOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-macie2/commands/UpdateOrganizationConfigurationCommand.ts rename to clients/client-macie2/src/commands/UpdateOrganizationConfigurationCommand.ts diff --git a/clients/client-macie2/endpoints.ts b/clients/client-macie2/src/endpoints.ts similarity index 100% rename from clients/client-macie2/endpoints.ts rename to clients/client-macie2/src/endpoints.ts diff --git a/clients/client-macie2/index.ts b/clients/client-macie2/src/index.ts similarity index 100% rename from clients/client-macie2/index.ts rename to clients/client-macie2/src/index.ts diff --git a/clients/client-macie2/models/index.ts b/clients/client-macie2/src/models/index.ts similarity index 100% rename from clients/client-macie2/models/index.ts rename to clients/client-macie2/src/models/index.ts diff --git a/clients/client-macie2/models/models_0.ts b/clients/client-macie2/src/models/models_0.ts similarity index 100% rename from clients/client-macie2/models/models_0.ts rename to clients/client-macie2/src/models/models_0.ts diff --git a/clients/client-macie2/pagination/DescribeBucketsPaginator.ts b/clients/client-macie2/src/pagination/DescribeBucketsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/DescribeBucketsPaginator.ts rename to clients/client-macie2/src/pagination/DescribeBucketsPaginator.ts diff --git a/clients/client-macie2/pagination/GetUsageStatisticsPaginator.ts b/clients/client-macie2/src/pagination/GetUsageStatisticsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/GetUsageStatisticsPaginator.ts rename to clients/client-macie2/src/pagination/GetUsageStatisticsPaginator.ts diff --git a/clients/client-macie2/pagination/Interfaces.ts b/clients/client-macie2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-macie2/pagination/Interfaces.ts rename to clients/client-macie2/src/pagination/Interfaces.ts diff --git a/clients/client-macie2/pagination/ListClassificationJobsPaginator.ts b/clients/client-macie2/src/pagination/ListClassificationJobsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListClassificationJobsPaginator.ts rename to clients/client-macie2/src/pagination/ListClassificationJobsPaginator.ts diff --git a/clients/client-macie2/pagination/ListCustomDataIdentifiersPaginator.ts b/clients/client-macie2/src/pagination/ListCustomDataIdentifiersPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListCustomDataIdentifiersPaginator.ts rename to clients/client-macie2/src/pagination/ListCustomDataIdentifiersPaginator.ts diff --git a/clients/client-macie2/pagination/ListFindingsFiltersPaginator.ts b/clients/client-macie2/src/pagination/ListFindingsFiltersPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListFindingsFiltersPaginator.ts rename to clients/client-macie2/src/pagination/ListFindingsFiltersPaginator.ts diff --git a/clients/client-macie2/pagination/ListFindingsPaginator.ts b/clients/client-macie2/src/pagination/ListFindingsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListFindingsPaginator.ts rename to clients/client-macie2/src/pagination/ListFindingsPaginator.ts diff --git a/clients/client-macie2/pagination/ListInvitationsPaginator.ts b/clients/client-macie2/src/pagination/ListInvitationsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListInvitationsPaginator.ts rename to clients/client-macie2/src/pagination/ListInvitationsPaginator.ts diff --git a/clients/client-macie2/pagination/ListMembersPaginator.ts b/clients/client-macie2/src/pagination/ListMembersPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListMembersPaginator.ts rename to clients/client-macie2/src/pagination/ListMembersPaginator.ts diff --git a/clients/client-macie2/pagination/ListOrganizationAdminAccountsPaginator.ts b/clients/client-macie2/src/pagination/ListOrganizationAdminAccountsPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/ListOrganizationAdminAccountsPaginator.ts rename to clients/client-macie2/src/pagination/ListOrganizationAdminAccountsPaginator.ts diff --git a/clients/client-macie2/pagination/SearchResourcesPaginator.ts b/clients/client-macie2/src/pagination/SearchResourcesPaginator.ts similarity index 100% rename from clients/client-macie2/pagination/SearchResourcesPaginator.ts rename to clients/client-macie2/src/pagination/SearchResourcesPaginator.ts diff --git a/clients/client-macie2/protocols/Aws_restJson1.ts b/clients/client-macie2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-macie2/protocols/Aws_restJson1.ts rename to clients/client-macie2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-macie2/src/runtimeConfig.browser.ts b/clients/client-macie2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2845da4d7cc1 --- /dev/null +++ b/clients/client-macie2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Macie2ClientConfig } from "./Macie2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Macie2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-macie2/runtimeConfig.native.ts b/clients/client-macie2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-macie2/runtimeConfig.native.ts rename to clients/client-macie2/src/runtimeConfig.native.ts diff --git a/clients/client-macie2/runtimeConfig.shared.ts b/clients/client-macie2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-macie2/runtimeConfig.shared.ts rename to clients/client-macie2/src/runtimeConfig.shared.ts diff --git a/clients/client-macie2/src/runtimeConfig.ts b/clients/client-macie2/src/runtimeConfig.ts new file mode 100644 index 000000000000..be62593840aa --- /dev/null +++ b/clients/client-macie2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Macie2ClientConfig } from "./Macie2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Macie2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-macie2/tsconfig.es.json b/clients/client-macie2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-macie2/tsconfig.es.json +++ b/clients/client-macie2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-macie2/tsconfig.json b/clients/client-macie2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-macie2/tsconfig.json +++ b/clients/client-macie2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-macie2/tsconfig.types.json b/clients/client-macie2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-macie2/tsconfig.types.json +++ b/clients/client-macie2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-managedblockchain/.gitignore b/clients/client-managedblockchain/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-managedblockchain/.gitignore +++ b/clients/client-managedblockchain/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-managedblockchain/package.json b/clients/client-managedblockchain/package.json index 33572c34c3f8..f3a8f54c3712 100644 --- a/clients/client-managedblockchain/package.json +++ b/clients/client-managedblockchain/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-managedblockchain", "repository": { "type": "git", diff --git a/clients/client-managedblockchain/runtimeConfig.browser.ts b/clients/client-managedblockchain/runtimeConfig.browser.ts deleted file mode 100644 index 60bcae8e54b6..000000000000 --- a/clients/client-managedblockchain/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ManagedBlockchainClientConfig } from "./ManagedBlockchainClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-managedblockchain/runtimeConfig.ts b/clients/client-managedblockchain/runtimeConfig.ts deleted file mode 100644 index 7a4fa335f84c..000000000000 --- a/clients/client-managedblockchain/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ManagedBlockchainClientConfig } from "./ManagedBlockchainClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-managedblockchain/ManagedBlockchain.ts b/clients/client-managedblockchain/src/ManagedBlockchain.ts similarity index 100% rename from clients/client-managedblockchain/ManagedBlockchain.ts rename to clients/client-managedblockchain/src/ManagedBlockchain.ts diff --git a/clients/client-managedblockchain/ManagedBlockchainClient.ts b/clients/client-managedblockchain/src/ManagedBlockchainClient.ts similarity index 100% rename from clients/client-managedblockchain/ManagedBlockchainClient.ts rename to clients/client-managedblockchain/src/ManagedBlockchainClient.ts diff --git a/clients/client-managedblockchain/commands/CreateMemberCommand.ts b/clients/client-managedblockchain/src/commands/CreateMemberCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/CreateMemberCommand.ts rename to clients/client-managedblockchain/src/commands/CreateMemberCommand.ts diff --git a/clients/client-managedblockchain/commands/CreateNetworkCommand.ts b/clients/client-managedblockchain/src/commands/CreateNetworkCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/CreateNetworkCommand.ts rename to clients/client-managedblockchain/src/commands/CreateNetworkCommand.ts diff --git a/clients/client-managedblockchain/commands/CreateNodeCommand.ts b/clients/client-managedblockchain/src/commands/CreateNodeCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/CreateNodeCommand.ts rename to clients/client-managedblockchain/src/commands/CreateNodeCommand.ts diff --git a/clients/client-managedblockchain/commands/CreateProposalCommand.ts b/clients/client-managedblockchain/src/commands/CreateProposalCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/CreateProposalCommand.ts rename to clients/client-managedblockchain/src/commands/CreateProposalCommand.ts diff --git a/clients/client-managedblockchain/commands/DeleteMemberCommand.ts b/clients/client-managedblockchain/src/commands/DeleteMemberCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/DeleteMemberCommand.ts rename to clients/client-managedblockchain/src/commands/DeleteMemberCommand.ts diff --git a/clients/client-managedblockchain/commands/DeleteNodeCommand.ts b/clients/client-managedblockchain/src/commands/DeleteNodeCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/DeleteNodeCommand.ts rename to clients/client-managedblockchain/src/commands/DeleteNodeCommand.ts diff --git a/clients/client-managedblockchain/commands/GetMemberCommand.ts b/clients/client-managedblockchain/src/commands/GetMemberCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/GetMemberCommand.ts rename to clients/client-managedblockchain/src/commands/GetMemberCommand.ts diff --git a/clients/client-managedblockchain/commands/GetNetworkCommand.ts b/clients/client-managedblockchain/src/commands/GetNetworkCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/GetNetworkCommand.ts rename to clients/client-managedblockchain/src/commands/GetNetworkCommand.ts diff --git a/clients/client-managedblockchain/commands/GetNodeCommand.ts b/clients/client-managedblockchain/src/commands/GetNodeCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/GetNodeCommand.ts rename to clients/client-managedblockchain/src/commands/GetNodeCommand.ts diff --git a/clients/client-managedblockchain/commands/GetProposalCommand.ts b/clients/client-managedblockchain/src/commands/GetProposalCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/GetProposalCommand.ts rename to clients/client-managedblockchain/src/commands/GetProposalCommand.ts diff --git a/clients/client-managedblockchain/commands/ListInvitationsCommand.ts b/clients/client-managedblockchain/src/commands/ListInvitationsCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListInvitationsCommand.ts rename to clients/client-managedblockchain/src/commands/ListInvitationsCommand.ts diff --git a/clients/client-managedblockchain/commands/ListMembersCommand.ts b/clients/client-managedblockchain/src/commands/ListMembersCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListMembersCommand.ts rename to clients/client-managedblockchain/src/commands/ListMembersCommand.ts diff --git a/clients/client-managedblockchain/commands/ListNetworksCommand.ts b/clients/client-managedblockchain/src/commands/ListNetworksCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListNetworksCommand.ts rename to clients/client-managedblockchain/src/commands/ListNetworksCommand.ts diff --git a/clients/client-managedblockchain/commands/ListNodesCommand.ts b/clients/client-managedblockchain/src/commands/ListNodesCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListNodesCommand.ts rename to clients/client-managedblockchain/src/commands/ListNodesCommand.ts diff --git a/clients/client-managedblockchain/commands/ListProposalVotesCommand.ts b/clients/client-managedblockchain/src/commands/ListProposalVotesCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListProposalVotesCommand.ts rename to clients/client-managedblockchain/src/commands/ListProposalVotesCommand.ts diff --git a/clients/client-managedblockchain/commands/ListProposalsCommand.ts b/clients/client-managedblockchain/src/commands/ListProposalsCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListProposalsCommand.ts rename to clients/client-managedblockchain/src/commands/ListProposalsCommand.ts diff --git a/clients/client-managedblockchain/commands/ListTagsForResourceCommand.ts b/clients/client-managedblockchain/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/ListTagsForResourceCommand.ts rename to clients/client-managedblockchain/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-managedblockchain/commands/RejectInvitationCommand.ts b/clients/client-managedblockchain/src/commands/RejectInvitationCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/RejectInvitationCommand.ts rename to clients/client-managedblockchain/src/commands/RejectInvitationCommand.ts diff --git a/clients/client-managedblockchain/commands/TagResourceCommand.ts b/clients/client-managedblockchain/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/TagResourceCommand.ts rename to clients/client-managedblockchain/src/commands/TagResourceCommand.ts diff --git a/clients/client-managedblockchain/commands/UntagResourceCommand.ts b/clients/client-managedblockchain/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/UntagResourceCommand.ts rename to clients/client-managedblockchain/src/commands/UntagResourceCommand.ts diff --git a/clients/client-managedblockchain/commands/UpdateMemberCommand.ts b/clients/client-managedblockchain/src/commands/UpdateMemberCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/UpdateMemberCommand.ts rename to clients/client-managedblockchain/src/commands/UpdateMemberCommand.ts diff --git a/clients/client-managedblockchain/commands/UpdateNodeCommand.ts b/clients/client-managedblockchain/src/commands/UpdateNodeCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/UpdateNodeCommand.ts rename to clients/client-managedblockchain/src/commands/UpdateNodeCommand.ts diff --git a/clients/client-managedblockchain/commands/VoteOnProposalCommand.ts b/clients/client-managedblockchain/src/commands/VoteOnProposalCommand.ts similarity index 100% rename from clients/client-managedblockchain/commands/VoteOnProposalCommand.ts rename to clients/client-managedblockchain/src/commands/VoteOnProposalCommand.ts diff --git a/clients/client-managedblockchain/endpoints.ts b/clients/client-managedblockchain/src/endpoints.ts similarity index 100% rename from clients/client-managedblockchain/endpoints.ts rename to clients/client-managedblockchain/src/endpoints.ts diff --git a/clients/client-managedblockchain/index.ts b/clients/client-managedblockchain/src/index.ts similarity index 100% rename from clients/client-managedblockchain/index.ts rename to clients/client-managedblockchain/src/index.ts diff --git a/clients/client-managedblockchain/models/index.ts b/clients/client-managedblockchain/src/models/index.ts similarity index 100% rename from clients/client-managedblockchain/models/index.ts rename to clients/client-managedblockchain/src/models/index.ts diff --git a/clients/client-managedblockchain/models/models_0.ts b/clients/client-managedblockchain/src/models/models_0.ts similarity index 100% rename from clients/client-managedblockchain/models/models_0.ts rename to clients/client-managedblockchain/src/models/models_0.ts diff --git a/clients/client-managedblockchain/pagination/Interfaces.ts b/clients/client-managedblockchain/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-managedblockchain/pagination/Interfaces.ts rename to clients/client-managedblockchain/src/pagination/Interfaces.ts diff --git a/clients/client-managedblockchain/pagination/ListInvitationsPaginator.ts b/clients/client-managedblockchain/src/pagination/ListInvitationsPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListInvitationsPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListInvitationsPaginator.ts diff --git a/clients/client-managedblockchain/pagination/ListMembersPaginator.ts b/clients/client-managedblockchain/src/pagination/ListMembersPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListMembersPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListMembersPaginator.ts diff --git a/clients/client-managedblockchain/pagination/ListNetworksPaginator.ts b/clients/client-managedblockchain/src/pagination/ListNetworksPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListNetworksPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListNetworksPaginator.ts diff --git a/clients/client-managedblockchain/pagination/ListNodesPaginator.ts b/clients/client-managedblockchain/src/pagination/ListNodesPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListNodesPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListNodesPaginator.ts diff --git a/clients/client-managedblockchain/pagination/ListProposalVotesPaginator.ts b/clients/client-managedblockchain/src/pagination/ListProposalVotesPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListProposalVotesPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListProposalVotesPaginator.ts diff --git a/clients/client-managedblockchain/pagination/ListProposalsPaginator.ts b/clients/client-managedblockchain/src/pagination/ListProposalsPaginator.ts similarity index 100% rename from clients/client-managedblockchain/pagination/ListProposalsPaginator.ts rename to clients/client-managedblockchain/src/pagination/ListProposalsPaginator.ts diff --git a/clients/client-managedblockchain/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-managedblockchain/protocols/Aws_restJson1.ts rename to clients/client-managedblockchain/src/protocols/Aws_restJson1.ts diff --git a/clients/client-managedblockchain/src/runtimeConfig.browser.ts b/clients/client-managedblockchain/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7037046aa84f --- /dev/null +++ b/clients/client-managedblockchain/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ManagedBlockchainClientConfig } from "./ManagedBlockchainClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-managedblockchain/runtimeConfig.native.ts b/clients/client-managedblockchain/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-managedblockchain/runtimeConfig.native.ts rename to clients/client-managedblockchain/src/runtimeConfig.native.ts diff --git a/clients/client-managedblockchain/runtimeConfig.shared.ts b/clients/client-managedblockchain/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-managedblockchain/runtimeConfig.shared.ts rename to clients/client-managedblockchain/src/runtimeConfig.shared.ts diff --git a/clients/client-managedblockchain/src/runtimeConfig.ts b/clients/client-managedblockchain/src/runtimeConfig.ts new file mode 100644 index 000000000000..6df291248603 --- /dev/null +++ b/clients/client-managedblockchain/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ManagedBlockchainClientConfig } from "./ManagedBlockchainClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-managedblockchain/tsconfig.es.json b/clients/client-managedblockchain/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-managedblockchain/tsconfig.es.json +++ b/clients/client-managedblockchain/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-managedblockchain/tsconfig.json b/clients/client-managedblockchain/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-managedblockchain/tsconfig.json +++ b/clients/client-managedblockchain/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-managedblockchain/tsconfig.types.json b/clients/client-managedblockchain/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-managedblockchain/tsconfig.types.json +++ b/clients/client-managedblockchain/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-marketplace-catalog/.gitignore b/clients/client-marketplace-catalog/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-marketplace-catalog/.gitignore +++ b/clients/client-marketplace-catalog/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-marketplace-catalog/package.json b/clients/client-marketplace-catalog/package.json index 508614f8f011..52dceb8b9412 100644 --- a/clients/client-marketplace-catalog/package.json +++ b/clients/client-marketplace-catalog/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-marketplace-catalog", "repository": { "type": "git", diff --git a/clients/client-marketplace-catalog/runtimeConfig.browser.ts b/clients/client-marketplace-catalog/runtimeConfig.browser.ts deleted file mode 100644 index 1c65ba5fff62..000000000000 --- a/clients/client-marketplace-catalog/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MarketplaceCatalogClientConfig } from "./MarketplaceCatalogClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-catalog/runtimeConfig.ts b/clients/client-marketplace-catalog/runtimeConfig.ts deleted file mode 100644 index 60b7304212d2..000000000000 --- a/clients/client-marketplace-catalog/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MarketplaceCatalogClientConfig } from "./MarketplaceCatalogClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-catalog/MarketplaceCatalog.ts b/clients/client-marketplace-catalog/src/MarketplaceCatalog.ts similarity index 100% rename from clients/client-marketplace-catalog/MarketplaceCatalog.ts rename to clients/client-marketplace-catalog/src/MarketplaceCatalog.ts diff --git a/clients/client-marketplace-catalog/MarketplaceCatalogClient.ts b/clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts similarity index 100% rename from clients/client-marketplace-catalog/MarketplaceCatalogClient.ts rename to clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts diff --git a/clients/client-marketplace-catalog/commands/CancelChangeSetCommand.ts b/clients/client-marketplace-catalog/src/commands/CancelChangeSetCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/CancelChangeSetCommand.ts rename to clients/client-marketplace-catalog/src/commands/CancelChangeSetCommand.ts diff --git a/clients/client-marketplace-catalog/commands/DescribeChangeSetCommand.ts b/clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/DescribeChangeSetCommand.ts rename to clients/client-marketplace-catalog/src/commands/DescribeChangeSetCommand.ts diff --git a/clients/client-marketplace-catalog/commands/DescribeEntityCommand.ts b/clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/DescribeEntityCommand.ts rename to clients/client-marketplace-catalog/src/commands/DescribeEntityCommand.ts diff --git a/clients/client-marketplace-catalog/commands/ListChangeSetsCommand.ts b/clients/client-marketplace-catalog/src/commands/ListChangeSetsCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/ListChangeSetsCommand.ts rename to clients/client-marketplace-catalog/src/commands/ListChangeSetsCommand.ts diff --git a/clients/client-marketplace-catalog/commands/ListEntitiesCommand.ts b/clients/client-marketplace-catalog/src/commands/ListEntitiesCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/ListEntitiesCommand.ts rename to clients/client-marketplace-catalog/src/commands/ListEntitiesCommand.ts diff --git a/clients/client-marketplace-catalog/commands/StartChangeSetCommand.ts b/clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts similarity index 100% rename from clients/client-marketplace-catalog/commands/StartChangeSetCommand.ts rename to clients/client-marketplace-catalog/src/commands/StartChangeSetCommand.ts diff --git a/clients/client-marketplace-catalog/endpoints.ts b/clients/client-marketplace-catalog/src/endpoints.ts similarity index 100% rename from clients/client-marketplace-catalog/endpoints.ts rename to clients/client-marketplace-catalog/src/endpoints.ts diff --git a/clients/client-marketplace-catalog/index.ts b/clients/client-marketplace-catalog/src/index.ts similarity index 100% rename from clients/client-marketplace-catalog/index.ts rename to clients/client-marketplace-catalog/src/index.ts diff --git a/clients/client-marketplace-catalog/models/index.ts b/clients/client-marketplace-catalog/src/models/index.ts similarity index 100% rename from clients/client-marketplace-catalog/models/index.ts rename to clients/client-marketplace-catalog/src/models/index.ts diff --git a/clients/client-marketplace-catalog/models/models_0.ts b/clients/client-marketplace-catalog/src/models/models_0.ts similarity index 100% rename from clients/client-marketplace-catalog/models/models_0.ts rename to clients/client-marketplace-catalog/src/models/models_0.ts diff --git a/clients/client-marketplace-catalog/pagination/Interfaces.ts b/clients/client-marketplace-catalog/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-marketplace-catalog/pagination/Interfaces.ts rename to clients/client-marketplace-catalog/src/pagination/Interfaces.ts diff --git a/clients/client-marketplace-catalog/pagination/ListChangeSetsPaginator.ts b/clients/client-marketplace-catalog/src/pagination/ListChangeSetsPaginator.ts similarity index 100% rename from clients/client-marketplace-catalog/pagination/ListChangeSetsPaginator.ts rename to clients/client-marketplace-catalog/src/pagination/ListChangeSetsPaginator.ts diff --git a/clients/client-marketplace-catalog/pagination/ListEntitiesPaginator.ts b/clients/client-marketplace-catalog/src/pagination/ListEntitiesPaginator.ts similarity index 100% rename from clients/client-marketplace-catalog/pagination/ListEntitiesPaginator.ts rename to clients/client-marketplace-catalog/src/pagination/ListEntitiesPaginator.ts diff --git a/clients/client-marketplace-catalog/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-marketplace-catalog/protocols/Aws_restJson1.ts rename to clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts diff --git a/clients/client-marketplace-catalog/src/runtimeConfig.browser.ts b/clients/client-marketplace-catalog/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9784e9119a8c --- /dev/null +++ b/clients/client-marketplace-catalog/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MarketplaceCatalogClientConfig } from "./MarketplaceCatalogClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-catalog/runtimeConfig.native.ts b/clients/client-marketplace-catalog/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-marketplace-catalog/runtimeConfig.native.ts rename to clients/client-marketplace-catalog/src/runtimeConfig.native.ts diff --git a/clients/client-marketplace-catalog/runtimeConfig.shared.ts b/clients/client-marketplace-catalog/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-marketplace-catalog/runtimeConfig.shared.ts rename to clients/client-marketplace-catalog/src/runtimeConfig.shared.ts diff --git a/clients/client-marketplace-catalog/src/runtimeConfig.ts b/clients/client-marketplace-catalog/src/runtimeConfig.ts new file mode 100644 index 000000000000..2248bd25e7f4 --- /dev/null +++ b/clients/client-marketplace-catalog/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MarketplaceCatalogClientConfig } from "./MarketplaceCatalogClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-catalog/tsconfig.es.json b/clients/client-marketplace-catalog/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-marketplace-catalog/tsconfig.es.json +++ b/clients/client-marketplace-catalog/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-marketplace-catalog/tsconfig.json b/clients/client-marketplace-catalog/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-marketplace-catalog/tsconfig.json +++ b/clients/client-marketplace-catalog/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-marketplace-catalog/tsconfig.types.json b/clients/client-marketplace-catalog/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-marketplace-catalog/tsconfig.types.json +++ b/clients/client-marketplace-catalog/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-marketplace-commerce-analytics/.gitignore b/clients/client-marketplace-commerce-analytics/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-marketplace-commerce-analytics/.gitignore +++ b/clients/client-marketplace-commerce-analytics/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-marketplace-commerce-analytics/package.json b/clients/client-marketplace-commerce-analytics/package.json index 3b9af9654ccd..cffdb4aa3e93 100644 --- a/clients/client-marketplace-commerce-analytics/package.json +++ b/clients/client-marketplace-commerce-analytics/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-marketplace-commerce-analytics", "repository": { "type": "git", diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts deleted file mode 100644 index 20ab8ade731b..000000000000 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MarketplaceCommerceAnalyticsClientConfig } from "./MarketplaceCommerceAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/runtimeConfig.ts deleted file mode 100644 index 895ef3ca9cf0..000000000000 --- a/clients/client-marketplace-commerce-analytics/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MarketplaceCommerceAnalyticsClientConfig } from "./MarketplaceCommerceAnalyticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalytics.ts b/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalytics.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalytics.ts rename to clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalytics.ts diff --git a/clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts b/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/MarketplaceCommerceAnalyticsClient.ts rename to clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts diff --git a/clients/client-marketplace-commerce-analytics/commands/GenerateDataSetCommand.ts b/clients/client-marketplace-commerce-analytics/src/commands/GenerateDataSetCommand.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/commands/GenerateDataSetCommand.ts rename to clients/client-marketplace-commerce-analytics/src/commands/GenerateDataSetCommand.ts diff --git a/clients/client-marketplace-commerce-analytics/commands/StartSupportDataExportCommand.ts b/clients/client-marketplace-commerce-analytics/src/commands/StartSupportDataExportCommand.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/commands/StartSupportDataExportCommand.ts rename to clients/client-marketplace-commerce-analytics/src/commands/StartSupportDataExportCommand.ts diff --git a/clients/client-marketplace-commerce-analytics/endpoints.ts b/clients/client-marketplace-commerce-analytics/src/endpoints.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/endpoints.ts rename to clients/client-marketplace-commerce-analytics/src/endpoints.ts diff --git a/clients/client-marketplace-commerce-analytics/index.ts b/clients/client-marketplace-commerce-analytics/src/index.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/index.ts rename to clients/client-marketplace-commerce-analytics/src/index.ts diff --git a/clients/client-marketplace-commerce-analytics/models/index.ts b/clients/client-marketplace-commerce-analytics/src/models/index.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/models/index.ts rename to clients/client-marketplace-commerce-analytics/src/models/index.ts diff --git a/clients/client-marketplace-commerce-analytics/models/models_0.ts b/clients/client-marketplace-commerce-analytics/src/models/models_0.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/models/models_0.ts rename to clients/client-marketplace-commerce-analytics/src/models/models_0.ts diff --git a/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts rename to clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts diff --git a/clients/client-marketplace-commerce-analytics/src/runtimeConfig.browser.ts b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..ef7df4b5eecf --- /dev/null +++ b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MarketplaceCommerceAnalyticsClientConfig } from "./MarketplaceCommerceAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/runtimeConfig.native.ts rename to clients/client-marketplace-commerce-analytics/src/runtimeConfig.native.ts diff --git a/clients/client-marketplace-commerce-analytics/runtimeConfig.shared.ts b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-marketplace-commerce-analytics/runtimeConfig.shared.ts rename to clients/client-marketplace-commerce-analytics/src/runtimeConfig.shared.ts diff --git a/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts new file mode 100644 index 000000000000..5a7bd6cca706 --- /dev/null +++ b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MarketplaceCommerceAnalyticsClientConfig } from "./MarketplaceCommerceAnalyticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-commerce-analytics/tsconfig.es.json b/clients/client-marketplace-commerce-analytics/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-marketplace-commerce-analytics/tsconfig.es.json +++ b/clients/client-marketplace-commerce-analytics/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-marketplace-commerce-analytics/tsconfig.json b/clients/client-marketplace-commerce-analytics/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-marketplace-commerce-analytics/tsconfig.json +++ b/clients/client-marketplace-commerce-analytics/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-marketplace-commerce-analytics/tsconfig.types.json b/clients/client-marketplace-commerce-analytics/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-marketplace-commerce-analytics/tsconfig.types.json +++ b/clients/client-marketplace-commerce-analytics/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-marketplace-entitlement-service/.gitignore b/clients/client-marketplace-entitlement-service/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-marketplace-entitlement-service/.gitignore +++ b/clients/client-marketplace-entitlement-service/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-marketplace-entitlement-service/package.json b/clients/client-marketplace-entitlement-service/package.json index 18e0ad90d82b..47fb74b53bd3 100644 --- a/clients/client-marketplace-entitlement-service/package.json +++ b/clients/client-marketplace-entitlement-service/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-marketplace-entitlement-service", "repository": { "type": "git", diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts deleted file mode 100644 index f87415943843..000000000000 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MarketplaceEntitlementServiceClientConfig } from "./MarketplaceEntitlementServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/runtimeConfig.ts deleted file mode 100644 index e5656dafe11b..000000000000 --- a/clients/client-marketplace-entitlement-service/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MarketplaceEntitlementServiceClientConfig } from "./MarketplaceEntitlementServiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementService.ts b/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementService.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/MarketplaceEntitlementService.ts rename to clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementService.ts diff --git a/clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts b/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/MarketplaceEntitlementServiceClient.ts rename to clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts diff --git a/clients/client-marketplace-entitlement-service/commands/GetEntitlementsCommand.ts b/clients/client-marketplace-entitlement-service/src/commands/GetEntitlementsCommand.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/commands/GetEntitlementsCommand.ts rename to clients/client-marketplace-entitlement-service/src/commands/GetEntitlementsCommand.ts diff --git a/clients/client-marketplace-entitlement-service/endpoints.ts b/clients/client-marketplace-entitlement-service/src/endpoints.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/endpoints.ts rename to clients/client-marketplace-entitlement-service/src/endpoints.ts diff --git a/clients/client-marketplace-entitlement-service/index.ts b/clients/client-marketplace-entitlement-service/src/index.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/index.ts rename to clients/client-marketplace-entitlement-service/src/index.ts diff --git a/clients/client-marketplace-entitlement-service/models/index.ts b/clients/client-marketplace-entitlement-service/src/models/index.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/models/index.ts rename to clients/client-marketplace-entitlement-service/src/models/index.ts diff --git a/clients/client-marketplace-entitlement-service/models/models_0.ts b/clients/client-marketplace-entitlement-service/src/models/models_0.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/models/models_0.ts rename to clients/client-marketplace-entitlement-service/src/models/models_0.ts diff --git a/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts rename to clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts diff --git a/clients/client-marketplace-entitlement-service/src/runtimeConfig.browser.ts b/clients/client-marketplace-entitlement-service/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4e1b4867dafa --- /dev/null +++ b/clients/client-marketplace-entitlement-service/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MarketplaceEntitlementServiceClientConfig } from "./MarketplaceEntitlementServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.native.ts b/clients/client-marketplace-entitlement-service/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/runtimeConfig.native.ts rename to clients/client-marketplace-entitlement-service/src/runtimeConfig.native.ts diff --git a/clients/client-marketplace-entitlement-service/runtimeConfig.shared.ts b/clients/client-marketplace-entitlement-service/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-marketplace-entitlement-service/runtimeConfig.shared.ts rename to clients/client-marketplace-entitlement-service/src/runtimeConfig.shared.ts diff --git a/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts new file mode 100644 index 000000000000..232a48cce4e3 --- /dev/null +++ b/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MarketplaceEntitlementServiceClientConfig } from "./MarketplaceEntitlementServiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-entitlement-service/tsconfig.es.json b/clients/client-marketplace-entitlement-service/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-marketplace-entitlement-service/tsconfig.es.json +++ b/clients/client-marketplace-entitlement-service/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-marketplace-entitlement-service/tsconfig.json b/clients/client-marketplace-entitlement-service/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-marketplace-entitlement-service/tsconfig.json +++ b/clients/client-marketplace-entitlement-service/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-marketplace-entitlement-service/tsconfig.types.json b/clients/client-marketplace-entitlement-service/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-marketplace-entitlement-service/tsconfig.types.json +++ b/clients/client-marketplace-entitlement-service/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-marketplace-metering/.gitignore b/clients/client-marketplace-metering/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-marketplace-metering/.gitignore +++ b/clients/client-marketplace-metering/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-marketplace-metering/package.json b/clients/client-marketplace-metering/package.json index ef2a811cf69a..f0ab20395d4a 100644 --- a/clients/client-marketplace-metering/package.json +++ b/clients/client-marketplace-metering/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-marketplace-metering", "repository": { "type": "git", diff --git a/clients/client-marketplace-metering/runtimeConfig.browser.ts b/clients/client-marketplace-metering/runtimeConfig.browser.ts deleted file mode 100644 index 8c98538103ba..000000000000 --- a/clients/client-marketplace-metering/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MarketplaceMeteringClientConfig } from "./MarketplaceMeteringClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-metering/runtimeConfig.ts b/clients/client-marketplace-metering/runtimeConfig.ts deleted file mode 100644 index c2a676b4891a..000000000000 --- a/clients/client-marketplace-metering/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MarketplaceMeteringClientConfig } from "./MarketplaceMeteringClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-marketplace-metering/MarketplaceMetering.ts b/clients/client-marketplace-metering/src/MarketplaceMetering.ts similarity index 100% rename from clients/client-marketplace-metering/MarketplaceMetering.ts rename to clients/client-marketplace-metering/src/MarketplaceMetering.ts diff --git a/clients/client-marketplace-metering/MarketplaceMeteringClient.ts b/clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts similarity index 100% rename from clients/client-marketplace-metering/MarketplaceMeteringClient.ts rename to clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts diff --git a/clients/client-marketplace-metering/commands/BatchMeterUsageCommand.ts b/clients/client-marketplace-metering/src/commands/BatchMeterUsageCommand.ts similarity index 100% rename from clients/client-marketplace-metering/commands/BatchMeterUsageCommand.ts rename to clients/client-marketplace-metering/src/commands/BatchMeterUsageCommand.ts diff --git a/clients/client-marketplace-metering/commands/MeterUsageCommand.ts b/clients/client-marketplace-metering/src/commands/MeterUsageCommand.ts similarity index 100% rename from clients/client-marketplace-metering/commands/MeterUsageCommand.ts rename to clients/client-marketplace-metering/src/commands/MeterUsageCommand.ts diff --git a/clients/client-marketplace-metering/commands/RegisterUsageCommand.ts b/clients/client-marketplace-metering/src/commands/RegisterUsageCommand.ts similarity index 100% rename from clients/client-marketplace-metering/commands/RegisterUsageCommand.ts rename to clients/client-marketplace-metering/src/commands/RegisterUsageCommand.ts diff --git a/clients/client-marketplace-metering/commands/ResolveCustomerCommand.ts b/clients/client-marketplace-metering/src/commands/ResolveCustomerCommand.ts similarity index 100% rename from clients/client-marketplace-metering/commands/ResolveCustomerCommand.ts rename to clients/client-marketplace-metering/src/commands/ResolveCustomerCommand.ts diff --git a/clients/client-marketplace-metering/endpoints.ts b/clients/client-marketplace-metering/src/endpoints.ts similarity index 100% rename from clients/client-marketplace-metering/endpoints.ts rename to clients/client-marketplace-metering/src/endpoints.ts diff --git a/clients/client-marketplace-metering/index.ts b/clients/client-marketplace-metering/src/index.ts similarity index 100% rename from clients/client-marketplace-metering/index.ts rename to clients/client-marketplace-metering/src/index.ts diff --git a/clients/client-marketplace-metering/models/index.ts b/clients/client-marketplace-metering/src/models/index.ts similarity index 100% rename from clients/client-marketplace-metering/models/index.ts rename to clients/client-marketplace-metering/src/models/index.ts diff --git a/clients/client-marketplace-metering/models/models_0.ts b/clients/client-marketplace-metering/src/models/models_0.ts similarity index 100% rename from clients/client-marketplace-metering/models/models_0.ts rename to clients/client-marketplace-metering/src/models/models_0.ts diff --git a/clients/client-marketplace-metering/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-marketplace-metering/protocols/Aws_json1_1.ts rename to clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts diff --git a/clients/client-marketplace-metering/src/runtimeConfig.browser.ts b/clients/client-marketplace-metering/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..485f814a2376 --- /dev/null +++ b/clients/client-marketplace-metering/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MarketplaceMeteringClientConfig } from "./MarketplaceMeteringClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-metering/runtimeConfig.native.ts b/clients/client-marketplace-metering/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-marketplace-metering/runtimeConfig.native.ts rename to clients/client-marketplace-metering/src/runtimeConfig.native.ts diff --git a/clients/client-marketplace-metering/runtimeConfig.shared.ts b/clients/client-marketplace-metering/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-marketplace-metering/runtimeConfig.shared.ts rename to clients/client-marketplace-metering/src/runtimeConfig.shared.ts diff --git a/clients/client-marketplace-metering/src/runtimeConfig.ts b/clients/client-marketplace-metering/src/runtimeConfig.ts new file mode 100644 index 000000000000..4f9a716ee411 --- /dev/null +++ b/clients/client-marketplace-metering/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MarketplaceMeteringClientConfig } from "./MarketplaceMeteringClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-marketplace-metering/tsconfig.es.json b/clients/client-marketplace-metering/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-marketplace-metering/tsconfig.es.json +++ b/clients/client-marketplace-metering/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-marketplace-metering/tsconfig.json b/clients/client-marketplace-metering/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-marketplace-metering/tsconfig.json +++ b/clients/client-marketplace-metering/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-marketplace-metering/tsconfig.types.json b/clients/client-marketplace-metering/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-marketplace-metering/tsconfig.types.json +++ b/clients/client-marketplace-metering/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediaconnect/.gitignore b/clients/client-mediaconnect/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediaconnect/.gitignore +++ b/clients/client-mediaconnect/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediaconnect/package.json b/clients/client-mediaconnect/package.json index fe39cc83ab0d..2b14e547d1d7 100644 --- a/clients/client-mediaconnect/package.json +++ b/clients/client-mediaconnect/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediaconnect", "repository": { "type": "git", diff --git a/clients/client-mediaconnect/runtimeConfig.browser.ts b/clients/client-mediaconnect/runtimeConfig.browser.ts deleted file mode 100644 index 37e0658c9b91..000000000000 --- a/clients/client-mediaconnect/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaConnectClientConfig } from "./MediaConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaConnectClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediaconnect/runtimeConfig.ts b/clients/client-mediaconnect/runtimeConfig.ts deleted file mode 100644 index affea14eddc6..000000000000 --- a/clients/client-mediaconnect/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaConnectClientConfig } from "./MediaConnectClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaConnectClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediaconnect/MediaConnect.ts b/clients/client-mediaconnect/src/MediaConnect.ts similarity index 100% rename from clients/client-mediaconnect/MediaConnect.ts rename to clients/client-mediaconnect/src/MediaConnect.ts diff --git a/clients/client-mediaconnect/MediaConnectClient.ts b/clients/client-mediaconnect/src/MediaConnectClient.ts similarity index 100% rename from clients/client-mediaconnect/MediaConnectClient.ts rename to clients/client-mediaconnect/src/MediaConnectClient.ts diff --git a/clients/client-mediaconnect/commands/AddFlowMediaStreamsCommand.ts b/clients/client-mediaconnect/src/commands/AddFlowMediaStreamsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/AddFlowMediaStreamsCommand.ts rename to clients/client-mediaconnect/src/commands/AddFlowMediaStreamsCommand.ts diff --git a/clients/client-mediaconnect/commands/AddFlowOutputsCommand.ts b/clients/client-mediaconnect/src/commands/AddFlowOutputsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/AddFlowOutputsCommand.ts rename to clients/client-mediaconnect/src/commands/AddFlowOutputsCommand.ts diff --git a/clients/client-mediaconnect/commands/AddFlowSourcesCommand.ts b/clients/client-mediaconnect/src/commands/AddFlowSourcesCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/AddFlowSourcesCommand.ts rename to clients/client-mediaconnect/src/commands/AddFlowSourcesCommand.ts diff --git a/clients/client-mediaconnect/commands/AddFlowVpcInterfacesCommand.ts b/clients/client-mediaconnect/src/commands/AddFlowVpcInterfacesCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/AddFlowVpcInterfacesCommand.ts rename to clients/client-mediaconnect/src/commands/AddFlowVpcInterfacesCommand.ts diff --git a/clients/client-mediaconnect/commands/CreateFlowCommand.ts b/clients/client-mediaconnect/src/commands/CreateFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/CreateFlowCommand.ts rename to clients/client-mediaconnect/src/commands/CreateFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/DeleteFlowCommand.ts b/clients/client-mediaconnect/src/commands/DeleteFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/DeleteFlowCommand.ts rename to clients/client-mediaconnect/src/commands/DeleteFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/DescribeFlowCommand.ts b/clients/client-mediaconnect/src/commands/DescribeFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/DescribeFlowCommand.ts rename to clients/client-mediaconnect/src/commands/DescribeFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/DescribeOfferingCommand.ts b/clients/client-mediaconnect/src/commands/DescribeOfferingCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/DescribeOfferingCommand.ts rename to clients/client-mediaconnect/src/commands/DescribeOfferingCommand.ts diff --git a/clients/client-mediaconnect/commands/DescribeReservationCommand.ts b/clients/client-mediaconnect/src/commands/DescribeReservationCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/DescribeReservationCommand.ts rename to clients/client-mediaconnect/src/commands/DescribeReservationCommand.ts diff --git a/clients/client-mediaconnect/commands/GrantFlowEntitlementsCommand.ts b/clients/client-mediaconnect/src/commands/GrantFlowEntitlementsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/GrantFlowEntitlementsCommand.ts rename to clients/client-mediaconnect/src/commands/GrantFlowEntitlementsCommand.ts diff --git a/clients/client-mediaconnect/commands/ListEntitlementsCommand.ts b/clients/client-mediaconnect/src/commands/ListEntitlementsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/ListEntitlementsCommand.ts rename to clients/client-mediaconnect/src/commands/ListEntitlementsCommand.ts diff --git a/clients/client-mediaconnect/commands/ListFlowsCommand.ts b/clients/client-mediaconnect/src/commands/ListFlowsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/ListFlowsCommand.ts rename to clients/client-mediaconnect/src/commands/ListFlowsCommand.ts diff --git a/clients/client-mediaconnect/commands/ListOfferingsCommand.ts b/clients/client-mediaconnect/src/commands/ListOfferingsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/ListOfferingsCommand.ts rename to clients/client-mediaconnect/src/commands/ListOfferingsCommand.ts diff --git a/clients/client-mediaconnect/commands/ListReservationsCommand.ts b/clients/client-mediaconnect/src/commands/ListReservationsCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/ListReservationsCommand.ts rename to clients/client-mediaconnect/src/commands/ListReservationsCommand.ts diff --git a/clients/client-mediaconnect/commands/ListTagsForResourceCommand.ts b/clients/client-mediaconnect/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/ListTagsForResourceCommand.ts rename to clients/client-mediaconnect/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediaconnect/commands/PurchaseOfferingCommand.ts b/clients/client-mediaconnect/src/commands/PurchaseOfferingCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/PurchaseOfferingCommand.ts rename to clients/client-mediaconnect/src/commands/PurchaseOfferingCommand.ts diff --git a/clients/client-mediaconnect/commands/RemoveFlowMediaStreamCommand.ts b/clients/client-mediaconnect/src/commands/RemoveFlowMediaStreamCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/RemoveFlowMediaStreamCommand.ts rename to clients/client-mediaconnect/src/commands/RemoveFlowMediaStreamCommand.ts diff --git a/clients/client-mediaconnect/commands/RemoveFlowOutputCommand.ts b/clients/client-mediaconnect/src/commands/RemoveFlowOutputCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/RemoveFlowOutputCommand.ts rename to clients/client-mediaconnect/src/commands/RemoveFlowOutputCommand.ts diff --git a/clients/client-mediaconnect/commands/RemoveFlowSourceCommand.ts b/clients/client-mediaconnect/src/commands/RemoveFlowSourceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/RemoveFlowSourceCommand.ts rename to clients/client-mediaconnect/src/commands/RemoveFlowSourceCommand.ts diff --git a/clients/client-mediaconnect/commands/RemoveFlowVpcInterfaceCommand.ts b/clients/client-mediaconnect/src/commands/RemoveFlowVpcInterfaceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/RemoveFlowVpcInterfaceCommand.ts rename to clients/client-mediaconnect/src/commands/RemoveFlowVpcInterfaceCommand.ts diff --git a/clients/client-mediaconnect/commands/RevokeFlowEntitlementCommand.ts b/clients/client-mediaconnect/src/commands/RevokeFlowEntitlementCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/RevokeFlowEntitlementCommand.ts rename to clients/client-mediaconnect/src/commands/RevokeFlowEntitlementCommand.ts diff --git a/clients/client-mediaconnect/commands/StartFlowCommand.ts b/clients/client-mediaconnect/src/commands/StartFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/StartFlowCommand.ts rename to clients/client-mediaconnect/src/commands/StartFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/StopFlowCommand.ts b/clients/client-mediaconnect/src/commands/StopFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/StopFlowCommand.ts rename to clients/client-mediaconnect/src/commands/StopFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/TagResourceCommand.ts b/clients/client-mediaconnect/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/TagResourceCommand.ts rename to clients/client-mediaconnect/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediaconnect/commands/UntagResourceCommand.ts b/clients/client-mediaconnect/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UntagResourceCommand.ts rename to clients/client-mediaconnect/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediaconnect/commands/UpdateFlowCommand.ts b/clients/client-mediaconnect/src/commands/UpdateFlowCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UpdateFlowCommand.ts rename to clients/client-mediaconnect/src/commands/UpdateFlowCommand.ts diff --git a/clients/client-mediaconnect/commands/UpdateFlowEntitlementCommand.ts b/clients/client-mediaconnect/src/commands/UpdateFlowEntitlementCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UpdateFlowEntitlementCommand.ts rename to clients/client-mediaconnect/src/commands/UpdateFlowEntitlementCommand.ts diff --git a/clients/client-mediaconnect/commands/UpdateFlowMediaStreamCommand.ts b/clients/client-mediaconnect/src/commands/UpdateFlowMediaStreamCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UpdateFlowMediaStreamCommand.ts rename to clients/client-mediaconnect/src/commands/UpdateFlowMediaStreamCommand.ts diff --git a/clients/client-mediaconnect/commands/UpdateFlowOutputCommand.ts b/clients/client-mediaconnect/src/commands/UpdateFlowOutputCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UpdateFlowOutputCommand.ts rename to clients/client-mediaconnect/src/commands/UpdateFlowOutputCommand.ts diff --git a/clients/client-mediaconnect/commands/UpdateFlowSourceCommand.ts b/clients/client-mediaconnect/src/commands/UpdateFlowSourceCommand.ts similarity index 100% rename from clients/client-mediaconnect/commands/UpdateFlowSourceCommand.ts rename to clients/client-mediaconnect/src/commands/UpdateFlowSourceCommand.ts diff --git a/clients/client-mediaconnect/endpoints.ts b/clients/client-mediaconnect/src/endpoints.ts similarity index 100% rename from clients/client-mediaconnect/endpoints.ts rename to clients/client-mediaconnect/src/endpoints.ts diff --git a/clients/client-mediaconnect/index.ts b/clients/client-mediaconnect/src/index.ts similarity index 100% rename from clients/client-mediaconnect/index.ts rename to clients/client-mediaconnect/src/index.ts diff --git a/clients/client-mediaconnect/models/index.ts b/clients/client-mediaconnect/src/models/index.ts similarity index 100% rename from clients/client-mediaconnect/models/index.ts rename to clients/client-mediaconnect/src/models/index.ts diff --git a/clients/client-mediaconnect/models/models_0.ts b/clients/client-mediaconnect/src/models/models_0.ts similarity index 100% rename from clients/client-mediaconnect/models/models_0.ts rename to clients/client-mediaconnect/src/models/models_0.ts diff --git a/clients/client-mediaconnect/pagination/Interfaces.ts b/clients/client-mediaconnect/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediaconnect/pagination/Interfaces.ts rename to clients/client-mediaconnect/src/pagination/Interfaces.ts diff --git a/clients/client-mediaconnect/pagination/ListEntitlementsPaginator.ts b/clients/client-mediaconnect/src/pagination/ListEntitlementsPaginator.ts similarity index 100% rename from clients/client-mediaconnect/pagination/ListEntitlementsPaginator.ts rename to clients/client-mediaconnect/src/pagination/ListEntitlementsPaginator.ts diff --git a/clients/client-mediaconnect/pagination/ListFlowsPaginator.ts b/clients/client-mediaconnect/src/pagination/ListFlowsPaginator.ts similarity index 100% rename from clients/client-mediaconnect/pagination/ListFlowsPaginator.ts rename to clients/client-mediaconnect/src/pagination/ListFlowsPaginator.ts diff --git a/clients/client-mediaconnect/pagination/ListOfferingsPaginator.ts b/clients/client-mediaconnect/src/pagination/ListOfferingsPaginator.ts similarity index 100% rename from clients/client-mediaconnect/pagination/ListOfferingsPaginator.ts rename to clients/client-mediaconnect/src/pagination/ListOfferingsPaginator.ts diff --git a/clients/client-mediaconnect/pagination/ListReservationsPaginator.ts b/clients/client-mediaconnect/src/pagination/ListReservationsPaginator.ts similarity index 100% rename from clients/client-mediaconnect/pagination/ListReservationsPaginator.ts rename to clients/client-mediaconnect/src/pagination/ListReservationsPaginator.ts diff --git a/clients/client-mediaconnect/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediaconnect/protocols/Aws_restJson1.ts rename to clients/client-mediaconnect/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediaconnect/src/runtimeConfig.browser.ts b/clients/client-mediaconnect/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9499071d1af4 --- /dev/null +++ b/clients/client-mediaconnect/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaConnectClientConfig } from "./MediaConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaConnectClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediaconnect/runtimeConfig.native.ts b/clients/client-mediaconnect/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediaconnect/runtimeConfig.native.ts rename to clients/client-mediaconnect/src/runtimeConfig.native.ts diff --git a/clients/client-mediaconnect/runtimeConfig.shared.ts b/clients/client-mediaconnect/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediaconnect/runtimeConfig.shared.ts rename to clients/client-mediaconnect/src/runtimeConfig.shared.ts diff --git a/clients/client-mediaconnect/src/runtimeConfig.ts b/clients/client-mediaconnect/src/runtimeConfig.ts new file mode 100644 index 000000000000..879c179220e9 --- /dev/null +++ b/clients/client-mediaconnect/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaConnectClientConfig } from "./MediaConnectClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaConnectClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediaconnect/waiters/waitForFlowActive.ts b/clients/client-mediaconnect/src/waiters/waitForFlowActive.ts similarity index 100% rename from clients/client-mediaconnect/waiters/waitForFlowActive.ts rename to clients/client-mediaconnect/src/waiters/waitForFlowActive.ts diff --git a/clients/client-mediaconnect/waiters/waitForFlowDeleted.ts b/clients/client-mediaconnect/src/waiters/waitForFlowDeleted.ts similarity index 100% rename from clients/client-mediaconnect/waiters/waitForFlowDeleted.ts rename to clients/client-mediaconnect/src/waiters/waitForFlowDeleted.ts diff --git a/clients/client-mediaconnect/waiters/waitForFlowStandby.ts b/clients/client-mediaconnect/src/waiters/waitForFlowStandby.ts similarity index 100% rename from clients/client-mediaconnect/waiters/waitForFlowStandby.ts rename to clients/client-mediaconnect/src/waiters/waitForFlowStandby.ts diff --git a/clients/client-mediaconnect/tsconfig.es.json b/clients/client-mediaconnect/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediaconnect/tsconfig.es.json +++ b/clients/client-mediaconnect/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediaconnect/tsconfig.json b/clients/client-mediaconnect/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediaconnect/tsconfig.json +++ b/clients/client-mediaconnect/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediaconnect/tsconfig.types.json b/clients/client-mediaconnect/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediaconnect/tsconfig.types.json +++ b/clients/client-mediaconnect/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediaconvert/.gitignore b/clients/client-mediaconvert/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediaconvert/.gitignore +++ b/clients/client-mediaconvert/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediaconvert/package.json b/clients/client-mediaconvert/package.json index bb09fb137fb6..3e6d9c8bdabb 100644 --- a/clients/client-mediaconvert/package.json +++ b/clients/client-mediaconvert/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediaconvert", "repository": { "type": "git", diff --git a/clients/client-mediaconvert/runtimeConfig.browser.ts b/clients/client-mediaconvert/runtimeConfig.browser.ts deleted file mode 100644 index 52124ea9654f..000000000000 --- a/clients/client-mediaconvert/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaConvertClientConfig } from "./MediaConvertClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaConvertClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediaconvert/runtimeConfig.ts b/clients/client-mediaconvert/runtimeConfig.ts deleted file mode 100644 index a7e7a3e85929..000000000000 --- a/clients/client-mediaconvert/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaConvertClientConfig } from "./MediaConvertClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaConvertClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediaconvert/MediaConvert.ts b/clients/client-mediaconvert/src/MediaConvert.ts similarity index 100% rename from clients/client-mediaconvert/MediaConvert.ts rename to clients/client-mediaconvert/src/MediaConvert.ts diff --git a/clients/client-mediaconvert/MediaConvertClient.ts b/clients/client-mediaconvert/src/MediaConvertClient.ts similarity index 100% rename from clients/client-mediaconvert/MediaConvertClient.ts rename to clients/client-mediaconvert/src/MediaConvertClient.ts diff --git a/clients/client-mediaconvert/commands/AssociateCertificateCommand.ts b/clients/client-mediaconvert/src/commands/AssociateCertificateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/AssociateCertificateCommand.ts rename to clients/client-mediaconvert/src/commands/AssociateCertificateCommand.ts diff --git a/clients/client-mediaconvert/commands/CancelJobCommand.ts b/clients/client-mediaconvert/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/CancelJobCommand.ts rename to clients/client-mediaconvert/src/commands/CancelJobCommand.ts diff --git a/clients/client-mediaconvert/commands/CreateJobCommand.ts b/clients/client-mediaconvert/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/CreateJobCommand.ts rename to clients/client-mediaconvert/src/commands/CreateJobCommand.ts diff --git a/clients/client-mediaconvert/commands/CreateJobTemplateCommand.ts b/clients/client-mediaconvert/src/commands/CreateJobTemplateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/CreateJobTemplateCommand.ts rename to clients/client-mediaconvert/src/commands/CreateJobTemplateCommand.ts diff --git a/clients/client-mediaconvert/commands/CreatePresetCommand.ts b/clients/client-mediaconvert/src/commands/CreatePresetCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/CreatePresetCommand.ts rename to clients/client-mediaconvert/src/commands/CreatePresetCommand.ts diff --git a/clients/client-mediaconvert/commands/CreateQueueCommand.ts b/clients/client-mediaconvert/src/commands/CreateQueueCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/CreateQueueCommand.ts rename to clients/client-mediaconvert/src/commands/CreateQueueCommand.ts diff --git a/clients/client-mediaconvert/commands/DeleteJobTemplateCommand.ts b/clients/client-mediaconvert/src/commands/DeleteJobTemplateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/DeleteJobTemplateCommand.ts rename to clients/client-mediaconvert/src/commands/DeleteJobTemplateCommand.ts diff --git a/clients/client-mediaconvert/commands/DeletePresetCommand.ts b/clients/client-mediaconvert/src/commands/DeletePresetCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/DeletePresetCommand.ts rename to clients/client-mediaconvert/src/commands/DeletePresetCommand.ts diff --git a/clients/client-mediaconvert/commands/DeleteQueueCommand.ts b/clients/client-mediaconvert/src/commands/DeleteQueueCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/DeleteQueueCommand.ts rename to clients/client-mediaconvert/src/commands/DeleteQueueCommand.ts diff --git a/clients/client-mediaconvert/commands/DescribeEndpointsCommand.ts b/clients/client-mediaconvert/src/commands/DescribeEndpointsCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/DescribeEndpointsCommand.ts rename to clients/client-mediaconvert/src/commands/DescribeEndpointsCommand.ts diff --git a/clients/client-mediaconvert/commands/DisassociateCertificateCommand.ts b/clients/client-mediaconvert/src/commands/DisassociateCertificateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/DisassociateCertificateCommand.ts rename to clients/client-mediaconvert/src/commands/DisassociateCertificateCommand.ts diff --git a/clients/client-mediaconvert/commands/GetJobCommand.ts b/clients/client-mediaconvert/src/commands/GetJobCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/GetJobCommand.ts rename to clients/client-mediaconvert/src/commands/GetJobCommand.ts diff --git a/clients/client-mediaconvert/commands/GetJobTemplateCommand.ts b/clients/client-mediaconvert/src/commands/GetJobTemplateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/GetJobTemplateCommand.ts rename to clients/client-mediaconvert/src/commands/GetJobTemplateCommand.ts diff --git a/clients/client-mediaconvert/commands/GetPresetCommand.ts b/clients/client-mediaconvert/src/commands/GetPresetCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/GetPresetCommand.ts rename to clients/client-mediaconvert/src/commands/GetPresetCommand.ts diff --git a/clients/client-mediaconvert/commands/GetQueueCommand.ts b/clients/client-mediaconvert/src/commands/GetQueueCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/GetQueueCommand.ts rename to clients/client-mediaconvert/src/commands/GetQueueCommand.ts diff --git a/clients/client-mediaconvert/commands/ListJobTemplatesCommand.ts b/clients/client-mediaconvert/src/commands/ListJobTemplatesCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/ListJobTemplatesCommand.ts rename to clients/client-mediaconvert/src/commands/ListJobTemplatesCommand.ts diff --git a/clients/client-mediaconvert/commands/ListJobsCommand.ts b/clients/client-mediaconvert/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/ListJobsCommand.ts rename to clients/client-mediaconvert/src/commands/ListJobsCommand.ts diff --git a/clients/client-mediaconvert/commands/ListPresetsCommand.ts b/clients/client-mediaconvert/src/commands/ListPresetsCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/ListPresetsCommand.ts rename to clients/client-mediaconvert/src/commands/ListPresetsCommand.ts diff --git a/clients/client-mediaconvert/commands/ListQueuesCommand.ts b/clients/client-mediaconvert/src/commands/ListQueuesCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/ListQueuesCommand.ts rename to clients/client-mediaconvert/src/commands/ListQueuesCommand.ts diff --git a/clients/client-mediaconvert/commands/ListTagsForResourceCommand.ts b/clients/client-mediaconvert/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/ListTagsForResourceCommand.ts rename to clients/client-mediaconvert/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediaconvert/commands/TagResourceCommand.ts b/clients/client-mediaconvert/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/TagResourceCommand.ts rename to clients/client-mediaconvert/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediaconvert/commands/UntagResourceCommand.ts b/clients/client-mediaconvert/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/UntagResourceCommand.ts rename to clients/client-mediaconvert/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediaconvert/commands/UpdateJobTemplateCommand.ts b/clients/client-mediaconvert/src/commands/UpdateJobTemplateCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/UpdateJobTemplateCommand.ts rename to clients/client-mediaconvert/src/commands/UpdateJobTemplateCommand.ts diff --git a/clients/client-mediaconvert/commands/UpdatePresetCommand.ts b/clients/client-mediaconvert/src/commands/UpdatePresetCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/UpdatePresetCommand.ts rename to clients/client-mediaconvert/src/commands/UpdatePresetCommand.ts diff --git a/clients/client-mediaconvert/commands/UpdateQueueCommand.ts b/clients/client-mediaconvert/src/commands/UpdateQueueCommand.ts similarity index 100% rename from clients/client-mediaconvert/commands/UpdateQueueCommand.ts rename to clients/client-mediaconvert/src/commands/UpdateQueueCommand.ts diff --git a/clients/client-mediaconvert/endpoints.ts b/clients/client-mediaconvert/src/endpoints.ts similarity index 100% rename from clients/client-mediaconvert/endpoints.ts rename to clients/client-mediaconvert/src/endpoints.ts diff --git a/clients/client-mediaconvert/index.ts b/clients/client-mediaconvert/src/index.ts similarity index 100% rename from clients/client-mediaconvert/index.ts rename to clients/client-mediaconvert/src/index.ts diff --git a/clients/client-mediaconvert/models/index.ts b/clients/client-mediaconvert/src/models/index.ts similarity index 100% rename from clients/client-mediaconvert/models/index.ts rename to clients/client-mediaconvert/src/models/index.ts diff --git a/clients/client-mediaconvert/models/models_0.ts b/clients/client-mediaconvert/src/models/models_0.ts similarity index 100% rename from clients/client-mediaconvert/models/models_0.ts rename to clients/client-mediaconvert/src/models/models_0.ts diff --git a/clients/client-mediaconvert/models/models_1.ts b/clients/client-mediaconvert/src/models/models_1.ts similarity index 100% rename from clients/client-mediaconvert/models/models_1.ts rename to clients/client-mediaconvert/src/models/models_1.ts diff --git a/clients/client-mediaconvert/pagination/DescribeEndpointsPaginator.ts b/clients/client-mediaconvert/src/pagination/DescribeEndpointsPaginator.ts similarity index 100% rename from clients/client-mediaconvert/pagination/DescribeEndpointsPaginator.ts rename to clients/client-mediaconvert/src/pagination/DescribeEndpointsPaginator.ts diff --git a/clients/client-mediaconvert/pagination/Interfaces.ts b/clients/client-mediaconvert/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediaconvert/pagination/Interfaces.ts rename to clients/client-mediaconvert/src/pagination/Interfaces.ts diff --git a/clients/client-mediaconvert/pagination/ListJobTemplatesPaginator.ts b/clients/client-mediaconvert/src/pagination/ListJobTemplatesPaginator.ts similarity index 100% rename from clients/client-mediaconvert/pagination/ListJobTemplatesPaginator.ts rename to clients/client-mediaconvert/src/pagination/ListJobTemplatesPaginator.ts diff --git a/clients/client-mediaconvert/pagination/ListJobsPaginator.ts b/clients/client-mediaconvert/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-mediaconvert/pagination/ListJobsPaginator.ts rename to clients/client-mediaconvert/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-mediaconvert/pagination/ListPresetsPaginator.ts b/clients/client-mediaconvert/src/pagination/ListPresetsPaginator.ts similarity index 100% rename from clients/client-mediaconvert/pagination/ListPresetsPaginator.ts rename to clients/client-mediaconvert/src/pagination/ListPresetsPaginator.ts diff --git a/clients/client-mediaconvert/pagination/ListQueuesPaginator.ts b/clients/client-mediaconvert/src/pagination/ListQueuesPaginator.ts similarity index 100% rename from clients/client-mediaconvert/pagination/ListQueuesPaginator.ts rename to clients/client-mediaconvert/src/pagination/ListQueuesPaginator.ts diff --git a/clients/client-mediaconvert/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediaconvert/protocols/Aws_restJson1.ts rename to clients/client-mediaconvert/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediaconvert/src/runtimeConfig.browser.ts b/clients/client-mediaconvert/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..451e181d8f02 --- /dev/null +++ b/clients/client-mediaconvert/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaConvertClientConfig } from "./MediaConvertClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaConvertClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediaconvert/runtimeConfig.native.ts b/clients/client-mediaconvert/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediaconvert/runtimeConfig.native.ts rename to clients/client-mediaconvert/src/runtimeConfig.native.ts diff --git a/clients/client-mediaconvert/runtimeConfig.shared.ts b/clients/client-mediaconvert/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediaconvert/runtimeConfig.shared.ts rename to clients/client-mediaconvert/src/runtimeConfig.shared.ts diff --git a/clients/client-mediaconvert/src/runtimeConfig.ts b/clients/client-mediaconvert/src/runtimeConfig.ts new file mode 100644 index 000000000000..9bb9e495a90a --- /dev/null +++ b/clients/client-mediaconvert/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaConvertClientConfig } from "./MediaConvertClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaConvertClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediaconvert/tsconfig.es.json b/clients/client-mediaconvert/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediaconvert/tsconfig.es.json +++ b/clients/client-mediaconvert/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediaconvert/tsconfig.json b/clients/client-mediaconvert/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediaconvert/tsconfig.json +++ b/clients/client-mediaconvert/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediaconvert/tsconfig.types.json b/clients/client-mediaconvert/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediaconvert/tsconfig.types.json +++ b/clients/client-mediaconvert/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-medialive/.gitignore b/clients/client-medialive/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-medialive/.gitignore +++ b/clients/client-medialive/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-medialive/package.json b/clients/client-medialive/package.json index 4045e7b4865b..1d61d8dd6dd6 100644 --- a/clients/client-medialive/package.json +++ b/clients/client-medialive/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-medialive", "repository": { "type": "git", diff --git a/clients/client-medialive/runtimeConfig.browser.ts b/clients/client-medialive/runtimeConfig.browser.ts deleted file mode 100644 index a04ce83c867b..000000000000 --- a/clients/client-medialive/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaLiveClientConfig } from "./MediaLiveClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaLiveClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-medialive/runtimeConfig.ts b/clients/client-medialive/runtimeConfig.ts deleted file mode 100644 index aa92cd9d35f3..000000000000 --- a/clients/client-medialive/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaLiveClientConfig } from "./MediaLiveClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaLiveClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-medialive/MediaLive.ts b/clients/client-medialive/src/MediaLive.ts similarity index 100% rename from clients/client-medialive/MediaLive.ts rename to clients/client-medialive/src/MediaLive.ts diff --git a/clients/client-medialive/MediaLiveClient.ts b/clients/client-medialive/src/MediaLiveClient.ts similarity index 100% rename from clients/client-medialive/MediaLiveClient.ts rename to clients/client-medialive/src/MediaLiveClient.ts diff --git a/clients/client-medialive/commands/AcceptInputDeviceTransferCommand.ts b/clients/client-medialive/src/commands/AcceptInputDeviceTransferCommand.ts similarity index 100% rename from clients/client-medialive/commands/AcceptInputDeviceTransferCommand.ts rename to clients/client-medialive/src/commands/AcceptInputDeviceTransferCommand.ts diff --git a/clients/client-medialive/commands/BatchDeleteCommand.ts b/clients/client-medialive/src/commands/BatchDeleteCommand.ts similarity index 100% rename from clients/client-medialive/commands/BatchDeleteCommand.ts rename to clients/client-medialive/src/commands/BatchDeleteCommand.ts diff --git a/clients/client-medialive/commands/BatchStartCommand.ts b/clients/client-medialive/src/commands/BatchStartCommand.ts similarity index 100% rename from clients/client-medialive/commands/BatchStartCommand.ts rename to clients/client-medialive/src/commands/BatchStartCommand.ts diff --git a/clients/client-medialive/commands/BatchStopCommand.ts b/clients/client-medialive/src/commands/BatchStopCommand.ts similarity index 100% rename from clients/client-medialive/commands/BatchStopCommand.ts rename to clients/client-medialive/src/commands/BatchStopCommand.ts diff --git a/clients/client-medialive/commands/BatchUpdateScheduleCommand.ts b/clients/client-medialive/src/commands/BatchUpdateScheduleCommand.ts similarity index 100% rename from clients/client-medialive/commands/BatchUpdateScheduleCommand.ts rename to clients/client-medialive/src/commands/BatchUpdateScheduleCommand.ts diff --git a/clients/client-medialive/commands/CancelInputDeviceTransferCommand.ts b/clients/client-medialive/src/commands/CancelInputDeviceTransferCommand.ts similarity index 100% rename from clients/client-medialive/commands/CancelInputDeviceTransferCommand.ts rename to clients/client-medialive/src/commands/CancelInputDeviceTransferCommand.ts diff --git a/clients/client-medialive/commands/CreateChannelCommand.ts b/clients/client-medialive/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateChannelCommand.ts rename to clients/client-medialive/src/commands/CreateChannelCommand.ts diff --git a/clients/client-medialive/commands/CreateInputCommand.ts b/clients/client-medialive/src/commands/CreateInputCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateInputCommand.ts rename to clients/client-medialive/src/commands/CreateInputCommand.ts diff --git a/clients/client-medialive/commands/CreateInputSecurityGroupCommand.ts b/clients/client-medialive/src/commands/CreateInputSecurityGroupCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateInputSecurityGroupCommand.ts rename to clients/client-medialive/src/commands/CreateInputSecurityGroupCommand.ts diff --git a/clients/client-medialive/commands/CreateMultiplexCommand.ts b/clients/client-medialive/src/commands/CreateMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateMultiplexCommand.ts rename to clients/client-medialive/src/commands/CreateMultiplexCommand.ts diff --git a/clients/client-medialive/commands/CreateMultiplexProgramCommand.ts b/clients/client-medialive/src/commands/CreateMultiplexProgramCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateMultiplexProgramCommand.ts rename to clients/client-medialive/src/commands/CreateMultiplexProgramCommand.ts diff --git a/clients/client-medialive/commands/CreatePartnerInputCommand.ts b/clients/client-medialive/src/commands/CreatePartnerInputCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreatePartnerInputCommand.ts rename to clients/client-medialive/src/commands/CreatePartnerInputCommand.ts diff --git a/clients/client-medialive/commands/CreateTagsCommand.ts b/clients/client-medialive/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-medialive/commands/CreateTagsCommand.ts rename to clients/client-medialive/src/commands/CreateTagsCommand.ts diff --git a/clients/client-medialive/commands/DeleteChannelCommand.ts b/clients/client-medialive/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteChannelCommand.ts rename to clients/client-medialive/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-medialive/commands/DeleteInputCommand.ts b/clients/client-medialive/src/commands/DeleteInputCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteInputCommand.ts rename to clients/client-medialive/src/commands/DeleteInputCommand.ts diff --git a/clients/client-medialive/commands/DeleteInputSecurityGroupCommand.ts b/clients/client-medialive/src/commands/DeleteInputSecurityGroupCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteInputSecurityGroupCommand.ts rename to clients/client-medialive/src/commands/DeleteInputSecurityGroupCommand.ts diff --git a/clients/client-medialive/commands/DeleteMultiplexCommand.ts b/clients/client-medialive/src/commands/DeleteMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteMultiplexCommand.ts rename to clients/client-medialive/src/commands/DeleteMultiplexCommand.ts diff --git a/clients/client-medialive/commands/DeleteMultiplexProgramCommand.ts b/clients/client-medialive/src/commands/DeleteMultiplexProgramCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteMultiplexProgramCommand.ts rename to clients/client-medialive/src/commands/DeleteMultiplexProgramCommand.ts diff --git a/clients/client-medialive/commands/DeleteReservationCommand.ts b/clients/client-medialive/src/commands/DeleteReservationCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteReservationCommand.ts rename to clients/client-medialive/src/commands/DeleteReservationCommand.ts diff --git a/clients/client-medialive/commands/DeleteScheduleCommand.ts b/clients/client-medialive/src/commands/DeleteScheduleCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteScheduleCommand.ts rename to clients/client-medialive/src/commands/DeleteScheduleCommand.ts diff --git a/clients/client-medialive/commands/DeleteTagsCommand.ts b/clients/client-medialive/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-medialive/commands/DeleteTagsCommand.ts rename to clients/client-medialive/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-medialive/commands/DescribeChannelCommand.ts b/clients/client-medialive/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeChannelCommand.ts rename to clients/client-medialive/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-medialive/commands/DescribeInputCommand.ts b/clients/client-medialive/src/commands/DescribeInputCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeInputCommand.ts rename to clients/client-medialive/src/commands/DescribeInputCommand.ts diff --git a/clients/client-medialive/commands/DescribeInputDeviceCommand.ts b/clients/client-medialive/src/commands/DescribeInputDeviceCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeInputDeviceCommand.ts rename to clients/client-medialive/src/commands/DescribeInputDeviceCommand.ts diff --git a/clients/client-medialive/commands/DescribeInputDeviceThumbnailCommand.ts b/clients/client-medialive/src/commands/DescribeInputDeviceThumbnailCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeInputDeviceThumbnailCommand.ts rename to clients/client-medialive/src/commands/DescribeInputDeviceThumbnailCommand.ts diff --git a/clients/client-medialive/commands/DescribeInputSecurityGroupCommand.ts b/clients/client-medialive/src/commands/DescribeInputSecurityGroupCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeInputSecurityGroupCommand.ts rename to clients/client-medialive/src/commands/DescribeInputSecurityGroupCommand.ts diff --git a/clients/client-medialive/commands/DescribeMultiplexCommand.ts b/clients/client-medialive/src/commands/DescribeMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeMultiplexCommand.ts rename to clients/client-medialive/src/commands/DescribeMultiplexCommand.ts diff --git a/clients/client-medialive/commands/DescribeMultiplexProgramCommand.ts b/clients/client-medialive/src/commands/DescribeMultiplexProgramCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeMultiplexProgramCommand.ts rename to clients/client-medialive/src/commands/DescribeMultiplexProgramCommand.ts diff --git a/clients/client-medialive/commands/DescribeOfferingCommand.ts b/clients/client-medialive/src/commands/DescribeOfferingCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeOfferingCommand.ts rename to clients/client-medialive/src/commands/DescribeOfferingCommand.ts diff --git a/clients/client-medialive/commands/DescribeReservationCommand.ts b/clients/client-medialive/src/commands/DescribeReservationCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeReservationCommand.ts rename to clients/client-medialive/src/commands/DescribeReservationCommand.ts diff --git a/clients/client-medialive/commands/DescribeScheduleCommand.ts b/clients/client-medialive/src/commands/DescribeScheduleCommand.ts similarity index 100% rename from clients/client-medialive/commands/DescribeScheduleCommand.ts rename to clients/client-medialive/src/commands/DescribeScheduleCommand.ts diff --git a/clients/client-medialive/commands/ListChannelsCommand.ts b/clients/client-medialive/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListChannelsCommand.ts rename to clients/client-medialive/src/commands/ListChannelsCommand.ts diff --git a/clients/client-medialive/commands/ListInputDeviceTransfersCommand.ts b/clients/client-medialive/src/commands/ListInputDeviceTransfersCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListInputDeviceTransfersCommand.ts rename to clients/client-medialive/src/commands/ListInputDeviceTransfersCommand.ts diff --git a/clients/client-medialive/commands/ListInputDevicesCommand.ts b/clients/client-medialive/src/commands/ListInputDevicesCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListInputDevicesCommand.ts rename to clients/client-medialive/src/commands/ListInputDevicesCommand.ts diff --git a/clients/client-medialive/commands/ListInputSecurityGroupsCommand.ts b/clients/client-medialive/src/commands/ListInputSecurityGroupsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListInputSecurityGroupsCommand.ts rename to clients/client-medialive/src/commands/ListInputSecurityGroupsCommand.ts diff --git a/clients/client-medialive/commands/ListInputsCommand.ts b/clients/client-medialive/src/commands/ListInputsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListInputsCommand.ts rename to clients/client-medialive/src/commands/ListInputsCommand.ts diff --git a/clients/client-medialive/commands/ListMultiplexProgramsCommand.ts b/clients/client-medialive/src/commands/ListMultiplexProgramsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListMultiplexProgramsCommand.ts rename to clients/client-medialive/src/commands/ListMultiplexProgramsCommand.ts diff --git a/clients/client-medialive/commands/ListMultiplexesCommand.ts b/clients/client-medialive/src/commands/ListMultiplexesCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListMultiplexesCommand.ts rename to clients/client-medialive/src/commands/ListMultiplexesCommand.ts diff --git a/clients/client-medialive/commands/ListOfferingsCommand.ts b/clients/client-medialive/src/commands/ListOfferingsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListOfferingsCommand.ts rename to clients/client-medialive/src/commands/ListOfferingsCommand.ts diff --git a/clients/client-medialive/commands/ListReservationsCommand.ts b/clients/client-medialive/src/commands/ListReservationsCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListReservationsCommand.ts rename to clients/client-medialive/src/commands/ListReservationsCommand.ts diff --git a/clients/client-medialive/commands/ListTagsForResourceCommand.ts b/clients/client-medialive/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-medialive/commands/ListTagsForResourceCommand.ts rename to clients/client-medialive/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-medialive/commands/PurchaseOfferingCommand.ts b/clients/client-medialive/src/commands/PurchaseOfferingCommand.ts similarity index 100% rename from clients/client-medialive/commands/PurchaseOfferingCommand.ts rename to clients/client-medialive/src/commands/PurchaseOfferingCommand.ts diff --git a/clients/client-medialive/commands/RejectInputDeviceTransferCommand.ts b/clients/client-medialive/src/commands/RejectInputDeviceTransferCommand.ts similarity index 100% rename from clients/client-medialive/commands/RejectInputDeviceTransferCommand.ts rename to clients/client-medialive/src/commands/RejectInputDeviceTransferCommand.ts diff --git a/clients/client-medialive/commands/StartChannelCommand.ts b/clients/client-medialive/src/commands/StartChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/StartChannelCommand.ts rename to clients/client-medialive/src/commands/StartChannelCommand.ts diff --git a/clients/client-medialive/commands/StartMultiplexCommand.ts b/clients/client-medialive/src/commands/StartMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/StartMultiplexCommand.ts rename to clients/client-medialive/src/commands/StartMultiplexCommand.ts diff --git a/clients/client-medialive/commands/StopChannelCommand.ts b/clients/client-medialive/src/commands/StopChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/StopChannelCommand.ts rename to clients/client-medialive/src/commands/StopChannelCommand.ts diff --git a/clients/client-medialive/commands/StopMultiplexCommand.ts b/clients/client-medialive/src/commands/StopMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/StopMultiplexCommand.ts rename to clients/client-medialive/src/commands/StopMultiplexCommand.ts diff --git a/clients/client-medialive/commands/TransferInputDeviceCommand.ts b/clients/client-medialive/src/commands/TransferInputDeviceCommand.ts similarity index 100% rename from clients/client-medialive/commands/TransferInputDeviceCommand.ts rename to clients/client-medialive/src/commands/TransferInputDeviceCommand.ts diff --git a/clients/client-medialive/commands/UpdateChannelClassCommand.ts b/clients/client-medialive/src/commands/UpdateChannelClassCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateChannelClassCommand.ts rename to clients/client-medialive/src/commands/UpdateChannelClassCommand.ts diff --git a/clients/client-medialive/commands/UpdateChannelCommand.ts b/clients/client-medialive/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateChannelCommand.ts rename to clients/client-medialive/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-medialive/commands/UpdateInputCommand.ts b/clients/client-medialive/src/commands/UpdateInputCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateInputCommand.ts rename to clients/client-medialive/src/commands/UpdateInputCommand.ts diff --git a/clients/client-medialive/commands/UpdateInputDeviceCommand.ts b/clients/client-medialive/src/commands/UpdateInputDeviceCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateInputDeviceCommand.ts rename to clients/client-medialive/src/commands/UpdateInputDeviceCommand.ts diff --git a/clients/client-medialive/commands/UpdateInputSecurityGroupCommand.ts b/clients/client-medialive/src/commands/UpdateInputSecurityGroupCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateInputSecurityGroupCommand.ts rename to clients/client-medialive/src/commands/UpdateInputSecurityGroupCommand.ts diff --git a/clients/client-medialive/commands/UpdateMultiplexCommand.ts b/clients/client-medialive/src/commands/UpdateMultiplexCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateMultiplexCommand.ts rename to clients/client-medialive/src/commands/UpdateMultiplexCommand.ts diff --git a/clients/client-medialive/commands/UpdateMultiplexProgramCommand.ts b/clients/client-medialive/src/commands/UpdateMultiplexProgramCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateMultiplexProgramCommand.ts rename to clients/client-medialive/src/commands/UpdateMultiplexProgramCommand.ts diff --git a/clients/client-medialive/commands/UpdateReservationCommand.ts b/clients/client-medialive/src/commands/UpdateReservationCommand.ts similarity index 100% rename from clients/client-medialive/commands/UpdateReservationCommand.ts rename to clients/client-medialive/src/commands/UpdateReservationCommand.ts diff --git a/clients/client-medialive/endpoints.ts b/clients/client-medialive/src/endpoints.ts similarity index 100% rename from clients/client-medialive/endpoints.ts rename to clients/client-medialive/src/endpoints.ts diff --git a/clients/client-medialive/index.ts b/clients/client-medialive/src/index.ts similarity index 100% rename from clients/client-medialive/index.ts rename to clients/client-medialive/src/index.ts diff --git a/clients/client-medialive/models/index.ts b/clients/client-medialive/src/models/index.ts similarity index 100% rename from clients/client-medialive/models/index.ts rename to clients/client-medialive/src/models/index.ts diff --git a/clients/client-medialive/models/models_0.ts b/clients/client-medialive/src/models/models_0.ts similarity index 100% rename from clients/client-medialive/models/models_0.ts rename to clients/client-medialive/src/models/models_0.ts diff --git a/clients/client-medialive/models/models_1.ts b/clients/client-medialive/src/models/models_1.ts similarity index 100% rename from clients/client-medialive/models/models_1.ts rename to clients/client-medialive/src/models/models_1.ts diff --git a/clients/client-medialive/pagination/DescribeSchedulePaginator.ts b/clients/client-medialive/src/pagination/DescribeSchedulePaginator.ts similarity index 100% rename from clients/client-medialive/pagination/DescribeSchedulePaginator.ts rename to clients/client-medialive/src/pagination/DescribeSchedulePaginator.ts diff --git a/clients/client-medialive/pagination/Interfaces.ts b/clients/client-medialive/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-medialive/pagination/Interfaces.ts rename to clients/client-medialive/src/pagination/Interfaces.ts diff --git a/clients/client-medialive/pagination/ListChannelsPaginator.ts b/clients/client-medialive/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListChannelsPaginator.ts rename to clients/client-medialive/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-medialive/pagination/ListInputDeviceTransfersPaginator.ts b/clients/client-medialive/src/pagination/ListInputDeviceTransfersPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListInputDeviceTransfersPaginator.ts rename to clients/client-medialive/src/pagination/ListInputDeviceTransfersPaginator.ts diff --git a/clients/client-medialive/pagination/ListInputDevicesPaginator.ts b/clients/client-medialive/src/pagination/ListInputDevicesPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListInputDevicesPaginator.ts rename to clients/client-medialive/src/pagination/ListInputDevicesPaginator.ts diff --git a/clients/client-medialive/pagination/ListInputSecurityGroupsPaginator.ts b/clients/client-medialive/src/pagination/ListInputSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListInputSecurityGroupsPaginator.ts rename to clients/client-medialive/src/pagination/ListInputSecurityGroupsPaginator.ts diff --git a/clients/client-medialive/pagination/ListInputsPaginator.ts b/clients/client-medialive/src/pagination/ListInputsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListInputsPaginator.ts rename to clients/client-medialive/src/pagination/ListInputsPaginator.ts diff --git a/clients/client-medialive/pagination/ListMultiplexProgramsPaginator.ts b/clients/client-medialive/src/pagination/ListMultiplexProgramsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListMultiplexProgramsPaginator.ts rename to clients/client-medialive/src/pagination/ListMultiplexProgramsPaginator.ts diff --git a/clients/client-medialive/pagination/ListMultiplexesPaginator.ts b/clients/client-medialive/src/pagination/ListMultiplexesPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListMultiplexesPaginator.ts rename to clients/client-medialive/src/pagination/ListMultiplexesPaginator.ts diff --git a/clients/client-medialive/pagination/ListOfferingsPaginator.ts b/clients/client-medialive/src/pagination/ListOfferingsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListOfferingsPaginator.ts rename to clients/client-medialive/src/pagination/ListOfferingsPaginator.ts diff --git a/clients/client-medialive/pagination/ListReservationsPaginator.ts b/clients/client-medialive/src/pagination/ListReservationsPaginator.ts similarity index 100% rename from clients/client-medialive/pagination/ListReservationsPaginator.ts rename to clients/client-medialive/src/pagination/ListReservationsPaginator.ts diff --git a/clients/client-medialive/protocols/Aws_restJson1.ts b/clients/client-medialive/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-medialive/protocols/Aws_restJson1.ts rename to clients/client-medialive/src/protocols/Aws_restJson1.ts diff --git a/clients/client-medialive/src/runtimeConfig.browser.ts b/clients/client-medialive/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5d60366cb6c3 --- /dev/null +++ b/clients/client-medialive/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaLiveClientConfig } from "./MediaLiveClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaLiveClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-medialive/runtimeConfig.native.ts b/clients/client-medialive/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-medialive/runtimeConfig.native.ts rename to clients/client-medialive/src/runtimeConfig.native.ts diff --git a/clients/client-medialive/runtimeConfig.shared.ts b/clients/client-medialive/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-medialive/runtimeConfig.shared.ts rename to clients/client-medialive/src/runtimeConfig.shared.ts diff --git a/clients/client-medialive/src/runtimeConfig.ts b/clients/client-medialive/src/runtimeConfig.ts new file mode 100644 index 000000000000..ec9308cc6870 --- /dev/null +++ b/clients/client-medialive/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaLiveClientConfig } from "./MediaLiveClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaLiveClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-medialive/waiters/waitForChannelCreated.ts b/clients/client-medialive/src/waiters/waitForChannelCreated.ts similarity index 100% rename from clients/client-medialive/waiters/waitForChannelCreated.ts rename to clients/client-medialive/src/waiters/waitForChannelCreated.ts diff --git a/clients/client-medialive/waiters/waitForChannelDeleted.ts b/clients/client-medialive/src/waiters/waitForChannelDeleted.ts similarity index 100% rename from clients/client-medialive/waiters/waitForChannelDeleted.ts rename to clients/client-medialive/src/waiters/waitForChannelDeleted.ts diff --git a/clients/client-medialive/waiters/waitForChannelRunning.ts b/clients/client-medialive/src/waiters/waitForChannelRunning.ts similarity index 100% rename from clients/client-medialive/waiters/waitForChannelRunning.ts rename to clients/client-medialive/src/waiters/waitForChannelRunning.ts diff --git a/clients/client-medialive/waiters/waitForChannelStopped.ts b/clients/client-medialive/src/waiters/waitForChannelStopped.ts similarity index 100% rename from clients/client-medialive/waiters/waitForChannelStopped.ts rename to clients/client-medialive/src/waiters/waitForChannelStopped.ts diff --git a/clients/client-medialive/waiters/waitForInputAttached.ts b/clients/client-medialive/src/waiters/waitForInputAttached.ts similarity index 100% rename from clients/client-medialive/waiters/waitForInputAttached.ts rename to clients/client-medialive/src/waiters/waitForInputAttached.ts diff --git a/clients/client-medialive/waiters/waitForInputDeleted.ts b/clients/client-medialive/src/waiters/waitForInputDeleted.ts similarity index 100% rename from clients/client-medialive/waiters/waitForInputDeleted.ts rename to clients/client-medialive/src/waiters/waitForInputDeleted.ts diff --git a/clients/client-medialive/waiters/waitForInputDetached.ts b/clients/client-medialive/src/waiters/waitForInputDetached.ts similarity index 100% rename from clients/client-medialive/waiters/waitForInputDetached.ts rename to clients/client-medialive/src/waiters/waitForInputDetached.ts diff --git a/clients/client-medialive/waiters/waitForMultiplexCreated.ts b/clients/client-medialive/src/waiters/waitForMultiplexCreated.ts similarity index 100% rename from clients/client-medialive/waiters/waitForMultiplexCreated.ts rename to clients/client-medialive/src/waiters/waitForMultiplexCreated.ts diff --git a/clients/client-medialive/waiters/waitForMultiplexDeleted.ts b/clients/client-medialive/src/waiters/waitForMultiplexDeleted.ts similarity index 100% rename from clients/client-medialive/waiters/waitForMultiplexDeleted.ts rename to clients/client-medialive/src/waiters/waitForMultiplexDeleted.ts diff --git a/clients/client-medialive/waiters/waitForMultiplexRunning.ts b/clients/client-medialive/src/waiters/waitForMultiplexRunning.ts similarity index 100% rename from clients/client-medialive/waiters/waitForMultiplexRunning.ts rename to clients/client-medialive/src/waiters/waitForMultiplexRunning.ts diff --git a/clients/client-medialive/waiters/waitForMultiplexStopped.ts b/clients/client-medialive/src/waiters/waitForMultiplexStopped.ts similarity index 100% rename from clients/client-medialive/waiters/waitForMultiplexStopped.ts rename to clients/client-medialive/src/waiters/waitForMultiplexStopped.ts diff --git a/clients/client-medialive/tsconfig.es.json b/clients/client-medialive/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-medialive/tsconfig.es.json +++ b/clients/client-medialive/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-medialive/tsconfig.json b/clients/client-medialive/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-medialive/tsconfig.json +++ b/clients/client-medialive/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-medialive/tsconfig.types.json b/clients/client-medialive/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-medialive/tsconfig.types.json +++ b/clients/client-medialive/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediapackage-vod/.gitignore b/clients/client-mediapackage-vod/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediapackage-vod/.gitignore +++ b/clients/client-mediapackage-vod/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediapackage-vod/package.json b/clients/client-mediapackage-vod/package.json index 9a6673efdb3e..6879d981d31c 100644 --- a/clients/client-mediapackage-vod/package.json +++ b/clients/client-mediapackage-vod/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediapackage-vod", "repository": { "type": "git", diff --git a/clients/client-mediapackage-vod/runtimeConfig.browser.ts b/clients/client-mediapackage-vod/runtimeConfig.browser.ts deleted file mode 100644 index fc39ba3e91e4..000000000000 --- a/clients/client-mediapackage-vod/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaPackageVodClientConfig } from "./MediaPackageVodClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediapackage-vod/runtimeConfig.ts b/clients/client-mediapackage-vod/runtimeConfig.ts deleted file mode 100644 index d482f02f2809..000000000000 --- a/clients/client-mediapackage-vod/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaPackageVodClientConfig } from "./MediaPackageVodClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediapackage-vod/MediaPackageVod.ts b/clients/client-mediapackage-vod/src/MediaPackageVod.ts similarity index 100% rename from clients/client-mediapackage-vod/MediaPackageVod.ts rename to clients/client-mediapackage-vod/src/MediaPackageVod.ts diff --git a/clients/client-mediapackage-vod/MediaPackageVodClient.ts b/clients/client-mediapackage-vod/src/MediaPackageVodClient.ts similarity index 100% rename from clients/client-mediapackage-vod/MediaPackageVodClient.ts rename to clients/client-mediapackage-vod/src/MediaPackageVodClient.ts diff --git a/clients/client-mediapackage-vod/commands/ConfigureLogsCommand.ts b/clients/client-mediapackage-vod/src/commands/ConfigureLogsCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/ConfigureLogsCommand.ts rename to clients/client-mediapackage-vod/src/commands/ConfigureLogsCommand.ts diff --git a/clients/client-mediapackage-vod/commands/CreateAssetCommand.ts b/clients/client-mediapackage-vod/src/commands/CreateAssetCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/CreateAssetCommand.ts rename to clients/client-mediapackage-vod/src/commands/CreateAssetCommand.ts diff --git a/clients/client-mediapackage-vod/commands/CreatePackagingConfigurationCommand.ts b/clients/client-mediapackage-vod/src/commands/CreatePackagingConfigurationCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/CreatePackagingConfigurationCommand.ts rename to clients/client-mediapackage-vod/src/commands/CreatePackagingConfigurationCommand.ts diff --git a/clients/client-mediapackage-vod/commands/CreatePackagingGroupCommand.ts b/clients/client-mediapackage-vod/src/commands/CreatePackagingGroupCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/CreatePackagingGroupCommand.ts rename to clients/client-mediapackage-vod/src/commands/CreatePackagingGroupCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DeleteAssetCommand.ts b/clients/client-mediapackage-vod/src/commands/DeleteAssetCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DeleteAssetCommand.ts rename to clients/client-mediapackage-vod/src/commands/DeleteAssetCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DeletePackagingConfigurationCommand.ts b/clients/client-mediapackage-vod/src/commands/DeletePackagingConfigurationCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DeletePackagingConfigurationCommand.ts rename to clients/client-mediapackage-vod/src/commands/DeletePackagingConfigurationCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DeletePackagingGroupCommand.ts b/clients/client-mediapackage-vod/src/commands/DeletePackagingGroupCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DeletePackagingGroupCommand.ts rename to clients/client-mediapackage-vod/src/commands/DeletePackagingGroupCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DescribeAssetCommand.ts b/clients/client-mediapackage-vod/src/commands/DescribeAssetCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DescribeAssetCommand.ts rename to clients/client-mediapackage-vod/src/commands/DescribeAssetCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DescribePackagingConfigurationCommand.ts b/clients/client-mediapackage-vod/src/commands/DescribePackagingConfigurationCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DescribePackagingConfigurationCommand.ts rename to clients/client-mediapackage-vod/src/commands/DescribePackagingConfigurationCommand.ts diff --git a/clients/client-mediapackage-vod/commands/DescribePackagingGroupCommand.ts b/clients/client-mediapackage-vod/src/commands/DescribePackagingGroupCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/DescribePackagingGroupCommand.ts rename to clients/client-mediapackage-vod/src/commands/DescribePackagingGroupCommand.ts diff --git a/clients/client-mediapackage-vod/commands/ListAssetsCommand.ts b/clients/client-mediapackage-vod/src/commands/ListAssetsCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/ListAssetsCommand.ts rename to clients/client-mediapackage-vod/src/commands/ListAssetsCommand.ts diff --git a/clients/client-mediapackage-vod/commands/ListPackagingConfigurationsCommand.ts b/clients/client-mediapackage-vod/src/commands/ListPackagingConfigurationsCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/ListPackagingConfigurationsCommand.ts rename to clients/client-mediapackage-vod/src/commands/ListPackagingConfigurationsCommand.ts diff --git a/clients/client-mediapackage-vod/commands/ListPackagingGroupsCommand.ts b/clients/client-mediapackage-vod/src/commands/ListPackagingGroupsCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/ListPackagingGroupsCommand.ts rename to clients/client-mediapackage-vod/src/commands/ListPackagingGroupsCommand.ts diff --git a/clients/client-mediapackage-vod/commands/ListTagsForResourceCommand.ts b/clients/client-mediapackage-vod/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/ListTagsForResourceCommand.ts rename to clients/client-mediapackage-vod/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediapackage-vod/commands/TagResourceCommand.ts b/clients/client-mediapackage-vod/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/TagResourceCommand.ts rename to clients/client-mediapackage-vod/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediapackage-vod/commands/UntagResourceCommand.ts b/clients/client-mediapackage-vod/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/UntagResourceCommand.ts rename to clients/client-mediapackage-vod/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediapackage-vod/commands/UpdatePackagingGroupCommand.ts b/clients/client-mediapackage-vod/src/commands/UpdatePackagingGroupCommand.ts similarity index 100% rename from clients/client-mediapackage-vod/commands/UpdatePackagingGroupCommand.ts rename to clients/client-mediapackage-vod/src/commands/UpdatePackagingGroupCommand.ts diff --git a/clients/client-mediapackage-vod/endpoints.ts b/clients/client-mediapackage-vod/src/endpoints.ts similarity index 100% rename from clients/client-mediapackage-vod/endpoints.ts rename to clients/client-mediapackage-vod/src/endpoints.ts diff --git a/clients/client-mediapackage-vod/index.ts b/clients/client-mediapackage-vod/src/index.ts similarity index 100% rename from clients/client-mediapackage-vod/index.ts rename to clients/client-mediapackage-vod/src/index.ts diff --git a/clients/client-mediapackage-vod/models/index.ts b/clients/client-mediapackage-vod/src/models/index.ts similarity index 100% rename from clients/client-mediapackage-vod/models/index.ts rename to clients/client-mediapackage-vod/src/models/index.ts diff --git a/clients/client-mediapackage-vod/models/models_0.ts b/clients/client-mediapackage-vod/src/models/models_0.ts similarity index 100% rename from clients/client-mediapackage-vod/models/models_0.ts rename to clients/client-mediapackage-vod/src/models/models_0.ts diff --git a/clients/client-mediapackage-vod/pagination/Interfaces.ts b/clients/client-mediapackage-vod/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediapackage-vod/pagination/Interfaces.ts rename to clients/client-mediapackage-vod/src/pagination/Interfaces.ts diff --git a/clients/client-mediapackage-vod/pagination/ListAssetsPaginator.ts b/clients/client-mediapackage-vod/src/pagination/ListAssetsPaginator.ts similarity index 100% rename from clients/client-mediapackage-vod/pagination/ListAssetsPaginator.ts rename to clients/client-mediapackage-vod/src/pagination/ListAssetsPaginator.ts diff --git a/clients/client-mediapackage-vod/pagination/ListPackagingConfigurationsPaginator.ts b/clients/client-mediapackage-vod/src/pagination/ListPackagingConfigurationsPaginator.ts similarity index 100% rename from clients/client-mediapackage-vod/pagination/ListPackagingConfigurationsPaginator.ts rename to clients/client-mediapackage-vod/src/pagination/ListPackagingConfigurationsPaginator.ts diff --git a/clients/client-mediapackage-vod/pagination/ListPackagingGroupsPaginator.ts b/clients/client-mediapackage-vod/src/pagination/ListPackagingGroupsPaginator.ts similarity index 100% rename from clients/client-mediapackage-vod/pagination/ListPackagingGroupsPaginator.ts rename to clients/client-mediapackage-vod/src/pagination/ListPackagingGroupsPaginator.ts diff --git a/clients/client-mediapackage-vod/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediapackage-vod/protocols/Aws_restJson1.ts rename to clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediapackage-vod/src/runtimeConfig.browser.ts b/clients/client-mediapackage-vod/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..65aaa16a005c --- /dev/null +++ b/clients/client-mediapackage-vod/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaPackageVodClientConfig } from "./MediaPackageVodClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediapackage-vod/runtimeConfig.native.ts b/clients/client-mediapackage-vod/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediapackage-vod/runtimeConfig.native.ts rename to clients/client-mediapackage-vod/src/runtimeConfig.native.ts diff --git a/clients/client-mediapackage-vod/runtimeConfig.shared.ts b/clients/client-mediapackage-vod/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediapackage-vod/runtimeConfig.shared.ts rename to clients/client-mediapackage-vod/src/runtimeConfig.shared.ts diff --git a/clients/client-mediapackage-vod/src/runtimeConfig.ts b/clients/client-mediapackage-vod/src/runtimeConfig.ts new file mode 100644 index 000000000000..c7f117e5dce4 --- /dev/null +++ b/clients/client-mediapackage-vod/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaPackageVodClientConfig } from "./MediaPackageVodClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediapackage-vod/tsconfig.es.json b/clients/client-mediapackage-vod/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediapackage-vod/tsconfig.es.json +++ b/clients/client-mediapackage-vod/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediapackage-vod/tsconfig.json b/clients/client-mediapackage-vod/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediapackage-vod/tsconfig.json +++ b/clients/client-mediapackage-vod/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediapackage-vod/tsconfig.types.json b/clients/client-mediapackage-vod/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediapackage-vod/tsconfig.types.json +++ b/clients/client-mediapackage-vod/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediapackage/.gitignore b/clients/client-mediapackage/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediapackage/.gitignore +++ b/clients/client-mediapackage/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediapackage/package.json b/clients/client-mediapackage/package.json index 1964596c7eed..544f1e2eb2cd 100644 --- a/clients/client-mediapackage/package.json +++ b/clients/client-mediapackage/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediapackage", "repository": { "type": "git", diff --git a/clients/client-mediapackage/runtimeConfig.browser.ts b/clients/client-mediapackage/runtimeConfig.browser.ts deleted file mode 100644 index 9a77ff189a9a..000000000000 --- a/clients/client-mediapackage/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaPackageClientConfig } from "./MediaPackageClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaPackageClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediapackage/runtimeConfig.ts b/clients/client-mediapackage/runtimeConfig.ts deleted file mode 100644 index f14da62f2670..000000000000 --- a/clients/client-mediapackage/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaPackageClientConfig } from "./MediaPackageClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaPackageClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediapackage/MediaPackage.ts b/clients/client-mediapackage/src/MediaPackage.ts similarity index 100% rename from clients/client-mediapackage/MediaPackage.ts rename to clients/client-mediapackage/src/MediaPackage.ts diff --git a/clients/client-mediapackage/MediaPackageClient.ts b/clients/client-mediapackage/src/MediaPackageClient.ts similarity index 100% rename from clients/client-mediapackage/MediaPackageClient.ts rename to clients/client-mediapackage/src/MediaPackageClient.ts diff --git a/clients/client-mediapackage/commands/ConfigureLogsCommand.ts b/clients/client-mediapackage/src/commands/ConfigureLogsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/ConfigureLogsCommand.ts rename to clients/client-mediapackage/src/commands/ConfigureLogsCommand.ts diff --git a/clients/client-mediapackage/commands/CreateChannelCommand.ts b/clients/client-mediapackage/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/CreateChannelCommand.ts rename to clients/client-mediapackage/src/commands/CreateChannelCommand.ts diff --git a/clients/client-mediapackage/commands/CreateHarvestJobCommand.ts b/clients/client-mediapackage/src/commands/CreateHarvestJobCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/CreateHarvestJobCommand.ts rename to clients/client-mediapackage/src/commands/CreateHarvestJobCommand.ts diff --git a/clients/client-mediapackage/commands/CreateOriginEndpointCommand.ts b/clients/client-mediapackage/src/commands/CreateOriginEndpointCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/CreateOriginEndpointCommand.ts rename to clients/client-mediapackage/src/commands/CreateOriginEndpointCommand.ts diff --git a/clients/client-mediapackage/commands/DeleteChannelCommand.ts b/clients/client-mediapackage/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/DeleteChannelCommand.ts rename to clients/client-mediapackage/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-mediapackage/commands/DeleteOriginEndpointCommand.ts b/clients/client-mediapackage/src/commands/DeleteOriginEndpointCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/DeleteOriginEndpointCommand.ts rename to clients/client-mediapackage/src/commands/DeleteOriginEndpointCommand.ts diff --git a/clients/client-mediapackage/commands/DescribeChannelCommand.ts b/clients/client-mediapackage/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/DescribeChannelCommand.ts rename to clients/client-mediapackage/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-mediapackage/commands/DescribeHarvestJobCommand.ts b/clients/client-mediapackage/src/commands/DescribeHarvestJobCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/DescribeHarvestJobCommand.ts rename to clients/client-mediapackage/src/commands/DescribeHarvestJobCommand.ts diff --git a/clients/client-mediapackage/commands/DescribeOriginEndpointCommand.ts b/clients/client-mediapackage/src/commands/DescribeOriginEndpointCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/DescribeOriginEndpointCommand.ts rename to clients/client-mediapackage/src/commands/DescribeOriginEndpointCommand.ts diff --git a/clients/client-mediapackage/commands/ListChannelsCommand.ts b/clients/client-mediapackage/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/ListChannelsCommand.ts rename to clients/client-mediapackage/src/commands/ListChannelsCommand.ts diff --git a/clients/client-mediapackage/commands/ListHarvestJobsCommand.ts b/clients/client-mediapackage/src/commands/ListHarvestJobsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/ListHarvestJobsCommand.ts rename to clients/client-mediapackage/src/commands/ListHarvestJobsCommand.ts diff --git a/clients/client-mediapackage/commands/ListOriginEndpointsCommand.ts b/clients/client-mediapackage/src/commands/ListOriginEndpointsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/ListOriginEndpointsCommand.ts rename to clients/client-mediapackage/src/commands/ListOriginEndpointsCommand.ts diff --git a/clients/client-mediapackage/commands/ListTagsForResourceCommand.ts b/clients/client-mediapackage/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/ListTagsForResourceCommand.ts rename to clients/client-mediapackage/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediapackage/commands/RotateChannelCredentialsCommand.ts b/clients/client-mediapackage/src/commands/RotateChannelCredentialsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/RotateChannelCredentialsCommand.ts rename to clients/client-mediapackage/src/commands/RotateChannelCredentialsCommand.ts diff --git a/clients/client-mediapackage/commands/RotateIngestEndpointCredentialsCommand.ts b/clients/client-mediapackage/src/commands/RotateIngestEndpointCredentialsCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/RotateIngestEndpointCredentialsCommand.ts rename to clients/client-mediapackage/src/commands/RotateIngestEndpointCredentialsCommand.ts diff --git a/clients/client-mediapackage/commands/TagResourceCommand.ts b/clients/client-mediapackage/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/TagResourceCommand.ts rename to clients/client-mediapackage/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediapackage/commands/UntagResourceCommand.ts b/clients/client-mediapackage/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/UntagResourceCommand.ts rename to clients/client-mediapackage/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediapackage/commands/UpdateChannelCommand.ts b/clients/client-mediapackage/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/UpdateChannelCommand.ts rename to clients/client-mediapackage/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-mediapackage/commands/UpdateOriginEndpointCommand.ts b/clients/client-mediapackage/src/commands/UpdateOriginEndpointCommand.ts similarity index 100% rename from clients/client-mediapackage/commands/UpdateOriginEndpointCommand.ts rename to clients/client-mediapackage/src/commands/UpdateOriginEndpointCommand.ts diff --git a/clients/client-mediapackage/endpoints.ts b/clients/client-mediapackage/src/endpoints.ts similarity index 100% rename from clients/client-mediapackage/endpoints.ts rename to clients/client-mediapackage/src/endpoints.ts diff --git a/clients/client-mediapackage/index.ts b/clients/client-mediapackage/src/index.ts similarity index 100% rename from clients/client-mediapackage/index.ts rename to clients/client-mediapackage/src/index.ts diff --git a/clients/client-mediapackage/models/index.ts b/clients/client-mediapackage/src/models/index.ts similarity index 100% rename from clients/client-mediapackage/models/index.ts rename to clients/client-mediapackage/src/models/index.ts diff --git a/clients/client-mediapackage/models/models_0.ts b/clients/client-mediapackage/src/models/models_0.ts similarity index 100% rename from clients/client-mediapackage/models/models_0.ts rename to clients/client-mediapackage/src/models/models_0.ts diff --git a/clients/client-mediapackage/pagination/Interfaces.ts b/clients/client-mediapackage/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediapackage/pagination/Interfaces.ts rename to clients/client-mediapackage/src/pagination/Interfaces.ts diff --git a/clients/client-mediapackage/pagination/ListChannelsPaginator.ts b/clients/client-mediapackage/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-mediapackage/pagination/ListChannelsPaginator.ts rename to clients/client-mediapackage/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-mediapackage/pagination/ListHarvestJobsPaginator.ts b/clients/client-mediapackage/src/pagination/ListHarvestJobsPaginator.ts similarity index 100% rename from clients/client-mediapackage/pagination/ListHarvestJobsPaginator.ts rename to clients/client-mediapackage/src/pagination/ListHarvestJobsPaginator.ts diff --git a/clients/client-mediapackage/pagination/ListOriginEndpointsPaginator.ts b/clients/client-mediapackage/src/pagination/ListOriginEndpointsPaginator.ts similarity index 100% rename from clients/client-mediapackage/pagination/ListOriginEndpointsPaginator.ts rename to clients/client-mediapackage/src/pagination/ListOriginEndpointsPaginator.ts diff --git a/clients/client-mediapackage/protocols/Aws_restJson1.ts b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediapackage/protocols/Aws_restJson1.ts rename to clients/client-mediapackage/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediapackage/src/runtimeConfig.browser.ts b/clients/client-mediapackage/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2fe5a1bda1b8 --- /dev/null +++ b/clients/client-mediapackage/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaPackageClientConfig } from "./MediaPackageClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaPackageClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediapackage/runtimeConfig.native.ts b/clients/client-mediapackage/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediapackage/runtimeConfig.native.ts rename to clients/client-mediapackage/src/runtimeConfig.native.ts diff --git a/clients/client-mediapackage/runtimeConfig.shared.ts b/clients/client-mediapackage/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediapackage/runtimeConfig.shared.ts rename to clients/client-mediapackage/src/runtimeConfig.shared.ts diff --git a/clients/client-mediapackage/src/runtimeConfig.ts b/clients/client-mediapackage/src/runtimeConfig.ts new file mode 100644 index 000000000000..f98d889b87a6 --- /dev/null +++ b/clients/client-mediapackage/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaPackageClientConfig } from "./MediaPackageClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaPackageClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediapackage/tsconfig.es.json b/clients/client-mediapackage/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediapackage/tsconfig.es.json +++ b/clients/client-mediapackage/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediapackage/tsconfig.json b/clients/client-mediapackage/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediapackage/tsconfig.json +++ b/clients/client-mediapackage/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediapackage/tsconfig.types.json b/clients/client-mediapackage/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediapackage/tsconfig.types.json +++ b/clients/client-mediapackage/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediastore-data/.gitignore b/clients/client-mediastore-data/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediastore-data/.gitignore +++ b/clients/client-mediastore-data/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediastore-data/MidiaStoreData.spec.ts b/clients/client-mediastore-data/MidiaStoreData.spec.ts deleted file mode 100644 index 3530259c2564..000000000000 --- a/clients/client-mediastore-data/MidiaStoreData.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { expect } from "chai"; -import { MediaStoreData } from "./MediaStoreData"; -import { SerializeMiddleware } from "@aws-sdk/types"; -import { HttpRequest } from "@aws-sdk/protocol-http"; - -describe("@aws-sdk/client-mediastore-data", () => { - describe("PutObject", () => { - it("should contain correct x-amz-content-sha256 header", async () => { - const validator: SerializeMiddleware = (next) => (args) => { - // middleware intercept the request and return it early - const request = args.request as HttpRequest; - expect(request.headers).to.have.property("x-amz-content-sha256", "UNSIGNED-PAYLOAD"); - return Promise.resolve({ output: {} as any, response: {} as any }); - }; - const client = new MediaStoreData({ - region: "us-west-2", - }); - client.middlewareStack.add(validator, { - step: "serialize", - name: "endpointValidator", - priority: "low", - }); - return await client.putObject({ - Path: "foo.avi", - Body: "binary body", - }); - }); - }); -}); diff --git a/clients/client-mediastore-data/package.json b/clients/client-mediastore-data/package.json index 69828f52d48b..6108a79cce01 100644 --- a/clients/client-mediastore-data/package.json +++ b/clients/client-mediastore-data/package.json @@ -11,19 +11,13 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "yarn test:unit", - "test:unit": "mocha **/cjs/**/*.spec.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" + "test:unit": "ts-mocha test/**/*.spec.ts" }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediastore-data", "repository": { "type": "git", diff --git a/clients/client-mediastore-data/runtimeConfig.browser.ts b/clients/client-mediastore-data/runtimeConfig.browser.ts deleted file mode 100644 index 7440ef544232..000000000000 --- a/clients/client-mediastore-data/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaStoreDataClientConfig } from "./MediaStoreDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediastore-data/runtimeConfig.ts b/clients/client-mediastore-data/runtimeConfig.ts deleted file mode 100644 index 704707aec107..000000000000 --- a/clients/client-mediastore-data/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaStoreDataClientConfig } from "./MediaStoreDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediastore-data/MediaStoreData.ts b/clients/client-mediastore-data/src/MediaStoreData.ts similarity index 100% rename from clients/client-mediastore-data/MediaStoreData.ts rename to clients/client-mediastore-data/src/MediaStoreData.ts diff --git a/clients/client-mediastore-data/MediaStoreDataClient.ts b/clients/client-mediastore-data/src/MediaStoreDataClient.ts similarity index 100% rename from clients/client-mediastore-data/MediaStoreDataClient.ts rename to clients/client-mediastore-data/src/MediaStoreDataClient.ts diff --git a/clients/client-mediastore-data/commands/DeleteObjectCommand.ts b/clients/client-mediastore-data/src/commands/DeleteObjectCommand.ts similarity index 100% rename from clients/client-mediastore-data/commands/DeleteObjectCommand.ts rename to clients/client-mediastore-data/src/commands/DeleteObjectCommand.ts diff --git a/clients/client-mediastore-data/commands/DescribeObjectCommand.ts b/clients/client-mediastore-data/src/commands/DescribeObjectCommand.ts similarity index 100% rename from clients/client-mediastore-data/commands/DescribeObjectCommand.ts rename to clients/client-mediastore-data/src/commands/DescribeObjectCommand.ts diff --git a/clients/client-mediastore-data/commands/GetObjectCommand.ts b/clients/client-mediastore-data/src/commands/GetObjectCommand.ts similarity index 100% rename from clients/client-mediastore-data/commands/GetObjectCommand.ts rename to clients/client-mediastore-data/src/commands/GetObjectCommand.ts diff --git a/clients/client-mediastore-data/commands/ListItemsCommand.ts b/clients/client-mediastore-data/src/commands/ListItemsCommand.ts similarity index 100% rename from clients/client-mediastore-data/commands/ListItemsCommand.ts rename to clients/client-mediastore-data/src/commands/ListItemsCommand.ts diff --git a/clients/client-mediastore-data/commands/PutObjectCommand.ts b/clients/client-mediastore-data/src/commands/PutObjectCommand.ts similarity index 100% rename from clients/client-mediastore-data/commands/PutObjectCommand.ts rename to clients/client-mediastore-data/src/commands/PutObjectCommand.ts diff --git a/clients/client-mediastore-data/endpoints.ts b/clients/client-mediastore-data/src/endpoints.ts similarity index 100% rename from clients/client-mediastore-data/endpoints.ts rename to clients/client-mediastore-data/src/endpoints.ts diff --git a/clients/client-mediastore-data/index.ts b/clients/client-mediastore-data/src/index.ts similarity index 100% rename from clients/client-mediastore-data/index.ts rename to clients/client-mediastore-data/src/index.ts diff --git a/clients/client-mediastore-data/models/index.ts b/clients/client-mediastore-data/src/models/index.ts similarity index 100% rename from clients/client-mediastore-data/models/index.ts rename to clients/client-mediastore-data/src/models/index.ts diff --git a/clients/client-mediastore-data/models/models_0.ts b/clients/client-mediastore-data/src/models/models_0.ts similarity index 100% rename from clients/client-mediastore-data/models/models_0.ts rename to clients/client-mediastore-data/src/models/models_0.ts diff --git a/clients/client-mediastore-data/pagination/Interfaces.ts b/clients/client-mediastore-data/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediastore-data/pagination/Interfaces.ts rename to clients/client-mediastore-data/src/pagination/Interfaces.ts diff --git a/clients/client-mediastore-data/pagination/ListItemsPaginator.ts b/clients/client-mediastore-data/src/pagination/ListItemsPaginator.ts similarity index 100% rename from clients/client-mediastore-data/pagination/ListItemsPaginator.ts rename to clients/client-mediastore-data/src/pagination/ListItemsPaginator.ts diff --git a/clients/client-mediastore-data/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediastore-data/protocols/Aws_restJson1.ts rename to clients/client-mediastore-data/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediastore-data/src/runtimeConfig.browser.ts b/clients/client-mediastore-data/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..202b11a907bf --- /dev/null +++ b/clients/client-mediastore-data/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaStoreDataClientConfig } from "./MediaStoreDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediastore-data/runtimeConfig.native.ts b/clients/client-mediastore-data/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediastore-data/runtimeConfig.native.ts rename to clients/client-mediastore-data/src/runtimeConfig.native.ts diff --git a/clients/client-mediastore-data/runtimeConfig.shared.ts b/clients/client-mediastore-data/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediastore-data/runtimeConfig.shared.ts rename to clients/client-mediastore-data/src/runtimeConfig.shared.ts diff --git a/clients/client-mediastore-data/src/runtimeConfig.ts b/clients/client-mediastore-data/src/runtimeConfig.ts new file mode 100644 index 000000000000..95a532ae5409 --- /dev/null +++ b/clients/client-mediastore-data/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaStoreDataClientConfig } from "./MediaStoreDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediastore-data/test/MediaStoreData.spec.ts b/clients/client-mediastore-data/test/MediaStoreData.spec.ts new file mode 100644 index 000000000000..222195c2d0f9 --- /dev/null +++ b/clients/client-mediastore-data/test/MediaStoreData.spec.ts @@ -0,0 +1,31 @@ +/// +import { HttpRequest } from "@aws-sdk/protocol-http"; +import { SerializeMiddleware } from "@aws-sdk/types"; +import { expect } from "chai"; + +import { MediaStoreData } from "../src/MediaStoreData"; + +describe("@aws-sdk/client-mediastore-data", () => { + describe("PutObject", () => { + it("should contain correct x-amz-content-sha256 header", async () => { + const validator: SerializeMiddleware = (next) => (args) => { + // middleware intercept the request and return it early + const request = args.request as HttpRequest; + expect(request.headers).to.have.property("x-amz-content-sha256", "UNSIGNED-PAYLOAD"); + return Promise.resolve({ output: {} as any, response: {} as any }); + }; + const client = new MediaStoreData({ + region: "us-west-2", + }); + client.middlewareStack.add(validator, { + step: "serialize", + name: "endpointValidator", + priority: "low", + }); + return await client.putObject({ + Path: "foo.avi", + Body: "binary body", + }); + }); + }); +}); diff --git a/clients/client-mediastore-data/tsconfig.es.json b/clients/client-mediastore-data/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediastore-data/tsconfig.es.json +++ b/clients/client-mediastore-data/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediastore-data/tsconfig.json b/clients/client-mediastore-data/tsconfig.json index da76e3e6255c..9c47e41f1772 100644 --- a/clients/client-mediastore-data/tsconfig.json +++ b/clients/client-mediastore-data/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true, "types": ["mocha"] }, @@ -28,5 +29,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediastore-data/tsconfig.types.json b/clients/client-mediastore-data/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediastore-data/tsconfig.types.json +++ b/clients/client-mediastore-data/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediastore/.gitignore b/clients/client-mediastore/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediastore/.gitignore +++ b/clients/client-mediastore/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediastore/package.json b/clients/client-mediastore/package.json index 9d8986cbac7d..9e20ad71baa0 100644 --- a/clients/client-mediastore/package.json +++ b/clients/client-mediastore/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediastore", "repository": { "type": "git", diff --git a/clients/client-mediastore/runtimeConfig.browser.ts b/clients/client-mediastore/runtimeConfig.browser.ts deleted file mode 100644 index 546e5a1bf207..000000000000 --- a/clients/client-mediastore/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaStoreClientConfig } from "./MediaStoreClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaStoreClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediastore/runtimeConfig.ts b/clients/client-mediastore/runtimeConfig.ts deleted file mode 100644 index 8676bfc7fed1..000000000000 --- a/clients/client-mediastore/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaStoreClientConfig } from "./MediaStoreClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaStoreClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediastore/MediaStore.ts b/clients/client-mediastore/src/MediaStore.ts similarity index 100% rename from clients/client-mediastore/MediaStore.ts rename to clients/client-mediastore/src/MediaStore.ts diff --git a/clients/client-mediastore/MediaStoreClient.ts b/clients/client-mediastore/src/MediaStoreClient.ts similarity index 100% rename from clients/client-mediastore/MediaStoreClient.ts rename to clients/client-mediastore/src/MediaStoreClient.ts diff --git a/clients/client-mediastore/commands/CreateContainerCommand.ts b/clients/client-mediastore/src/commands/CreateContainerCommand.ts similarity index 100% rename from clients/client-mediastore/commands/CreateContainerCommand.ts rename to clients/client-mediastore/src/commands/CreateContainerCommand.ts diff --git a/clients/client-mediastore/commands/DeleteContainerCommand.ts b/clients/client-mediastore/src/commands/DeleteContainerCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DeleteContainerCommand.ts rename to clients/client-mediastore/src/commands/DeleteContainerCommand.ts diff --git a/clients/client-mediastore/commands/DeleteContainerPolicyCommand.ts b/clients/client-mediastore/src/commands/DeleteContainerPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DeleteContainerPolicyCommand.ts rename to clients/client-mediastore/src/commands/DeleteContainerPolicyCommand.ts diff --git a/clients/client-mediastore/commands/DeleteCorsPolicyCommand.ts b/clients/client-mediastore/src/commands/DeleteCorsPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DeleteCorsPolicyCommand.ts rename to clients/client-mediastore/src/commands/DeleteCorsPolicyCommand.ts diff --git a/clients/client-mediastore/commands/DeleteLifecyclePolicyCommand.ts b/clients/client-mediastore/src/commands/DeleteLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DeleteLifecyclePolicyCommand.ts rename to clients/client-mediastore/src/commands/DeleteLifecyclePolicyCommand.ts diff --git a/clients/client-mediastore/commands/DeleteMetricPolicyCommand.ts b/clients/client-mediastore/src/commands/DeleteMetricPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DeleteMetricPolicyCommand.ts rename to clients/client-mediastore/src/commands/DeleteMetricPolicyCommand.ts diff --git a/clients/client-mediastore/commands/DescribeContainerCommand.ts b/clients/client-mediastore/src/commands/DescribeContainerCommand.ts similarity index 100% rename from clients/client-mediastore/commands/DescribeContainerCommand.ts rename to clients/client-mediastore/src/commands/DescribeContainerCommand.ts diff --git a/clients/client-mediastore/commands/GetContainerPolicyCommand.ts b/clients/client-mediastore/src/commands/GetContainerPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/GetContainerPolicyCommand.ts rename to clients/client-mediastore/src/commands/GetContainerPolicyCommand.ts diff --git a/clients/client-mediastore/commands/GetCorsPolicyCommand.ts b/clients/client-mediastore/src/commands/GetCorsPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/GetCorsPolicyCommand.ts rename to clients/client-mediastore/src/commands/GetCorsPolicyCommand.ts diff --git a/clients/client-mediastore/commands/GetLifecyclePolicyCommand.ts b/clients/client-mediastore/src/commands/GetLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/GetLifecyclePolicyCommand.ts rename to clients/client-mediastore/src/commands/GetLifecyclePolicyCommand.ts diff --git a/clients/client-mediastore/commands/GetMetricPolicyCommand.ts b/clients/client-mediastore/src/commands/GetMetricPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/GetMetricPolicyCommand.ts rename to clients/client-mediastore/src/commands/GetMetricPolicyCommand.ts diff --git a/clients/client-mediastore/commands/ListContainersCommand.ts b/clients/client-mediastore/src/commands/ListContainersCommand.ts similarity index 100% rename from clients/client-mediastore/commands/ListContainersCommand.ts rename to clients/client-mediastore/src/commands/ListContainersCommand.ts diff --git a/clients/client-mediastore/commands/ListTagsForResourceCommand.ts b/clients/client-mediastore/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediastore/commands/ListTagsForResourceCommand.ts rename to clients/client-mediastore/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediastore/commands/PutContainerPolicyCommand.ts b/clients/client-mediastore/src/commands/PutContainerPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/PutContainerPolicyCommand.ts rename to clients/client-mediastore/src/commands/PutContainerPolicyCommand.ts diff --git a/clients/client-mediastore/commands/PutCorsPolicyCommand.ts b/clients/client-mediastore/src/commands/PutCorsPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/PutCorsPolicyCommand.ts rename to clients/client-mediastore/src/commands/PutCorsPolicyCommand.ts diff --git a/clients/client-mediastore/commands/PutLifecyclePolicyCommand.ts b/clients/client-mediastore/src/commands/PutLifecyclePolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/PutLifecyclePolicyCommand.ts rename to clients/client-mediastore/src/commands/PutLifecyclePolicyCommand.ts diff --git a/clients/client-mediastore/commands/PutMetricPolicyCommand.ts b/clients/client-mediastore/src/commands/PutMetricPolicyCommand.ts similarity index 100% rename from clients/client-mediastore/commands/PutMetricPolicyCommand.ts rename to clients/client-mediastore/src/commands/PutMetricPolicyCommand.ts diff --git a/clients/client-mediastore/commands/StartAccessLoggingCommand.ts b/clients/client-mediastore/src/commands/StartAccessLoggingCommand.ts similarity index 100% rename from clients/client-mediastore/commands/StartAccessLoggingCommand.ts rename to clients/client-mediastore/src/commands/StartAccessLoggingCommand.ts diff --git a/clients/client-mediastore/commands/StopAccessLoggingCommand.ts b/clients/client-mediastore/src/commands/StopAccessLoggingCommand.ts similarity index 100% rename from clients/client-mediastore/commands/StopAccessLoggingCommand.ts rename to clients/client-mediastore/src/commands/StopAccessLoggingCommand.ts diff --git a/clients/client-mediastore/commands/TagResourceCommand.ts b/clients/client-mediastore/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediastore/commands/TagResourceCommand.ts rename to clients/client-mediastore/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediastore/commands/UntagResourceCommand.ts b/clients/client-mediastore/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediastore/commands/UntagResourceCommand.ts rename to clients/client-mediastore/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediastore/endpoints.ts b/clients/client-mediastore/src/endpoints.ts similarity index 100% rename from clients/client-mediastore/endpoints.ts rename to clients/client-mediastore/src/endpoints.ts diff --git a/clients/client-mediastore/index.ts b/clients/client-mediastore/src/index.ts similarity index 100% rename from clients/client-mediastore/index.ts rename to clients/client-mediastore/src/index.ts diff --git a/clients/client-mediastore/models/index.ts b/clients/client-mediastore/src/models/index.ts similarity index 100% rename from clients/client-mediastore/models/index.ts rename to clients/client-mediastore/src/models/index.ts diff --git a/clients/client-mediastore/models/models_0.ts b/clients/client-mediastore/src/models/models_0.ts similarity index 100% rename from clients/client-mediastore/models/models_0.ts rename to clients/client-mediastore/src/models/models_0.ts diff --git a/clients/client-mediastore/pagination/Interfaces.ts b/clients/client-mediastore/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediastore/pagination/Interfaces.ts rename to clients/client-mediastore/src/pagination/Interfaces.ts diff --git a/clients/client-mediastore/pagination/ListContainersPaginator.ts b/clients/client-mediastore/src/pagination/ListContainersPaginator.ts similarity index 100% rename from clients/client-mediastore/pagination/ListContainersPaginator.ts rename to clients/client-mediastore/src/pagination/ListContainersPaginator.ts diff --git a/clients/client-mediastore/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-mediastore/protocols/Aws_json1_1.ts rename to clients/client-mediastore/src/protocols/Aws_json1_1.ts diff --git a/clients/client-mediastore/src/runtimeConfig.browser.ts b/clients/client-mediastore/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..05b64ee56b13 --- /dev/null +++ b/clients/client-mediastore/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaStoreClientConfig } from "./MediaStoreClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaStoreClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediastore/runtimeConfig.native.ts b/clients/client-mediastore/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediastore/runtimeConfig.native.ts rename to clients/client-mediastore/src/runtimeConfig.native.ts diff --git a/clients/client-mediastore/runtimeConfig.shared.ts b/clients/client-mediastore/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediastore/runtimeConfig.shared.ts rename to clients/client-mediastore/src/runtimeConfig.shared.ts diff --git a/clients/client-mediastore/src/runtimeConfig.ts b/clients/client-mediastore/src/runtimeConfig.ts new file mode 100644 index 000000000000..527c32bc5a97 --- /dev/null +++ b/clients/client-mediastore/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaStoreClientConfig } from "./MediaStoreClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaStoreClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediastore/tsconfig.es.json b/clients/client-mediastore/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediastore/tsconfig.es.json +++ b/clients/client-mediastore/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediastore/tsconfig.json b/clients/client-mediastore/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediastore/tsconfig.json +++ b/clients/client-mediastore/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediastore/tsconfig.types.json b/clients/client-mediastore/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediastore/tsconfig.types.json +++ b/clients/client-mediastore/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mediatailor/.gitignore b/clients/client-mediatailor/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mediatailor/.gitignore +++ b/clients/client-mediatailor/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mediatailor/package.json b/clients/client-mediatailor/package.json index 6099cf964e51..a82b35f8e847 100644 --- a/clients/client-mediatailor/package.json +++ b/clients/client-mediatailor/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mediatailor", "repository": { "type": "git", diff --git a/clients/client-mediatailor/runtimeConfig.browser.ts b/clients/client-mediatailor/runtimeConfig.browser.ts deleted file mode 100644 index 271912914b28..000000000000 --- a/clients/client-mediatailor/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MediaTailorClientConfig } from "./MediaTailorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaTailorClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediatailor/runtimeConfig.ts b/clients/client-mediatailor/runtimeConfig.ts deleted file mode 100644 index ab77c6a0f833..000000000000 --- a/clients/client-mediatailor/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MediaTailorClientConfig } from "./MediaTailorClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MediaTailorClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mediatailor/MediaTailor.ts b/clients/client-mediatailor/src/MediaTailor.ts similarity index 100% rename from clients/client-mediatailor/MediaTailor.ts rename to clients/client-mediatailor/src/MediaTailor.ts diff --git a/clients/client-mediatailor/MediaTailorClient.ts b/clients/client-mediatailor/src/MediaTailorClient.ts similarity index 100% rename from clients/client-mediatailor/MediaTailorClient.ts rename to clients/client-mediatailor/src/MediaTailorClient.ts diff --git a/clients/client-mediatailor/commands/ConfigureLogsForPlaybackConfigurationCommand.ts b/clients/client-mediatailor/src/commands/ConfigureLogsForPlaybackConfigurationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ConfigureLogsForPlaybackConfigurationCommand.ts rename to clients/client-mediatailor/src/commands/ConfigureLogsForPlaybackConfigurationCommand.ts diff --git a/clients/client-mediatailor/commands/CreateChannelCommand.ts b/clients/client-mediatailor/src/commands/CreateChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/CreateChannelCommand.ts rename to clients/client-mediatailor/src/commands/CreateChannelCommand.ts diff --git a/clients/client-mediatailor/commands/CreateProgramCommand.ts b/clients/client-mediatailor/src/commands/CreateProgramCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/CreateProgramCommand.ts rename to clients/client-mediatailor/src/commands/CreateProgramCommand.ts diff --git a/clients/client-mediatailor/commands/CreateSourceLocationCommand.ts b/clients/client-mediatailor/src/commands/CreateSourceLocationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/CreateSourceLocationCommand.ts rename to clients/client-mediatailor/src/commands/CreateSourceLocationCommand.ts diff --git a/clients/client-mediatailor/commands/CreateVodSourceCommand.ts b/clients/client-mediatailor/src/commands/CreateVodSourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/CreateVodSourceCommand.ts rename to clients/client-mediatailor/src/commands/CreateVodSourceCommand.ts diff --git a/clients/client-mediatailor/commands/DeleteChannelCommand.ts b/clients/client-mediatailor/src/commands/DeleteChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeleteChannelCommand.ts rename to clients/client-mediatailor/src/commands/DeleteChannelCommand.ts diff --git a/clients/client-mediatailor/commands/DeleteChannelPolicyCommand.ts b/clients/client-mediatailor/src/commands/DeleteChannelPolicyCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeleteChannelPolicyCommand.ts rename to clients/client-mediatailor/src/commands/DeleteChannelPolicyCommand.ts diff --git a/clients/client-mediatailor/commands/DeletePlaybackConfigurationCommand.ts b/clients/client-mediatailor/src/commands/DeletePlaybackConfigurationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeletePlaybackConfigurationCommand.ts rename to clients/client-mediatailor/src/commands/DeletePlaybackConfigurationCommand.ts diff --git a/clients/client-mediatailor/commands/DeleteProgramCommand.ts b/clients/client-mediatailor/src/commands/DeleteProgramCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeleteProgramCommand.ts rename to clients/client-mediatailor/src/commands/DeleteProgramCommand.ts diff --git a/clients/client-mediatailor/commands/DeleteSourceLocationCommand.ts b/clients/client-mediatailor/src/commands/DeleteSourceLocationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeleteSourceLocationCommand.ts rename to clients/client-mediatailor/src/commands/DeleteSourceLocationCommand.ts diff --git a/clients/client-mediatailor/commands/DeleteVodSourceCommand.ts b/clients/client-mediatailor/src/commands/DeleteVodSourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DeleteVodSourceCommand.ts rename to clients/client-mediatailor/src/commands/DeleteVodSourceCommand.ts diff --git a/clients/client-mediatailor/commands/DescribeChannelCommand.ts b/clients/client-mediatailor/src/commands/DescribeChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DescribeChannelCommand.ts rename to clients/client-mediatailor/src/commands/DescribeChannelCommand.ts diff --git a/clients/client-mediatailor/commands/DescribeProgramCommand.ts b/clients/client-mediatailor/src/commands/DescribeProgramCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DescribeProgramCommand.ts rename to clients/client-mediatailor/src/commands/DescribeProgramCommand.ts diff --git a/clients/client-mediatailor/commands/DescribeSourceLocationCommand.ts b/clients/client-mediatailor/src/commands/DescribeSourceLocationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DescribeSourceLocationCommand.ts rename to clients/client-mediatailor/src/commands/DescribeSourceLocationCommand.ts diff --git a/clients/client-mediatailor/commands/DescribeVodSourceCommand.ts b/clients/client-mediatailor/src/commands/DescribeVodSourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/DescribeVodSourceCommand.ts rename to clients/client-mediatailor/src/commands/DescribeVodSourceCommand.ts diff --git a/clients/client-mediatailor/commands/GetChannelPolicyCommand.ts b/clients/client-mediatailor/src/commands/GetChannelPolicyCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/GetChannelPolicyCommand.ts rename to clients/client-mediatailor/src/commands/GetChannelPolicyCommand.ts diff --git a/clients/client-mediatailor/commands/GetChannelScheduleCommand.ts b/clients/client-mediatailor/src/commands/GetChannelScheduleCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/GetChannelScheduleCommand.ts rename to clients/client-mediatailor/src/commands/GetChannelScheduleCommand.ts diff --git a/clients/client-mediatailor/commands/GetPlaybackConfigurationCommand.ts b/clients/client-mediatailor/src/commands/GetPlaybackConfigurationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/GetPlaybackConfigurationCommand.ts rename to clients/client-mediatailor/src/commands/GetPlaybackConfigurationCommand.ts diff --git a/clients/client-mediatailor/commands/ListAlertsCommand.ts b/clients/client-mediatailor/src/commands/ListAlertsCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListAlertsCommand.ts rename to clients/client-mediatailor/src/commands/ListAlertsCommand.ts diff --git a/clients/client-mediatailor/commands/ListChannelsCommand.ts b/clients/client-mediatailor/src/commands/ListChannelsCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListChannelsCommand.ts rename to clients/client-mediatailor/src/commands/ListChannelsCommand.ts diff --git a/clients/client-mediatailor/commands/ListPlaybackConfigurationsCommand.ts b/clients/client-mediatailor/src/commands/ListPlaybackConfigurationsCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListPlaybackConfigurationsCommand.ts rename to clients/client-mediatailor/src/commands/ListPlaybackConfigurationsCommand.ts diff --git a/clients/client-mediatailor/commands/ListSourceLocationsCommand.ts b/clients/client-mediatailor/src/commands/ListSourceLocationsCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListSourceLocationsCommand.ts rename to clients/client-mediatailor/src/commands/ListSourceLocationsCommand.ts diff --git a/clients/client-mediatailor/commands/ListTagsForResourceCommand.ts b/clients/client-mediatailor/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListTagsForResourceCommand.ts rename to clients/client-mediatailor/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mediatailor/commands/ListVodSourcesCommand.ts b/clients/client-mediatailor/src/commands/ListVodSourcesCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/ListVodSourcesCommand.ts rename to clients/client-mediatailor/src/commands/ListVodSourcesCommand.ts diff --git a/clients/client-mediatailor/commands/PutChannelPolicyCommand.ts b/clients/client-mediatailor/src/commands/PutChannelPolicyCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/PutChannelPolicyCommand.ts rename to clients/client-mediatailor/src/commands/PutChannelPolicyCommand.ts diff --git a/clients/client-mediatailor/commands/PutPlaybackConfigurationCommand.ts b/clients/client-mediatailor/src/commands/PutPlaybackConfigurationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/PutPlaybackConfigurationCommand.ts rename to clients/client-mediatailor/src/commands/PutPlaybackConfigurationCommand.ts diff --git a/clients/client-mediatailor/commands/StartChannelCommand.ts b/clients/client-mediatailor/src/commands/StartChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/StartChannelCommand.ts rename to clients/client-mediatailor/src/commands/StartChannelCommand.ts diff --git a/clients/client-mediatailor/commands/StopChannelCommand.ts b/clients/client-mediatailor/src/commands/StopChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/StopChannelCommand.ts rename to clients/client-mediatailor/src/commands/StopChannelCommand.ts diff --git a/clients/client-mediatailor/commands/TagResourceCommand.ts b/clients/client-mediatailor/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/TagResourceCommand.ts rename to clients/client-mediatailor/src/commands/TagResourceCommand.ts diff --git a/clients/client-mediatailor/commands/UntagResourceCommand.ts b/clients/client-mediatailor/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/UntagResourceCommand.ts rename to clients/client-mediatailor/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mediatailor/commands/UpdateChannelCommand.ts b/clients/client-mediatailor/src/commands/UpdateChannelCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/UpdateChannelCommand.ts rename to clients/client-mediatailor/src/commands/UpdateChannelCommand.ts diff --git a/clients/client-mediatailor/commands/UpdateSourceLocationCommand.ts b/clients/client-mediatailor/src/commands/UpdateSourceLocationCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/UpdateSourceLocationCommand.ts rename to clients/client-mediatailor/src/commands/UpdateSourceLocationCommand.ts diff --git a/clients/client-mediatailor/commands/UpdateVodSourceCommand.ts b/clients/client-mediatailor/src/commands/UpdateVodSourceCommand.ts similarity index 100% rename from clients/client-mediatailor/commands/UpdateVodSourceCommand.ts rename to clients/client-mediatailor/src/commands/UpdateVodSourceCommand.ts diff --git a/clients/client-mediatailor/endpoints.ts b/clients/client-mediatailor/src/endpoints.ts similarity index 100% rename from clients/client-mediatailor/endpoints.ts rename to clients/client-mediatailor/src/endpoints.ts diff --git a/clients/client-mediatailor/index.ts b/clients/client-mediatailor/src/index.ts similarity index 100% rename from clients/client-mediatailor/index.ts rename to clients/client-mediatailor/src/index.ts diff --git a/clients/client-mediatailor/models/index.ts b/clients/client-mediatailor/src/models/index.ts similarity index 100% rename from clients/client-mediatailor/models/index.ts rename to clients/client-mediatailor/src/models/index.ts diff --git a/clients/client-mediatailor/models/models_0.ts b/clients/client-mediatailor/src/models/models_0.ts similarity index 100% rename from clients/client-mediatailor/models/models_0.ts rename to clients/client-mediatailor/src/models/models_0.ts diff --git a/clients/client-mediatailor/pagination/GetChannelSchedulePaginator.ts b/clients/client-mediatailor/src/pagination/GetChannelSchedulePaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/GetChannelSchedulePaginator.ts rename to clients/client-mediatailor/src/pagination/GetChannelSchedulePaginator.ts diff --git a/clients/client-mediatailor/pagination/Interfaces.ts b/clients/client-mediatailor/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mediatailor/pagination/Interfaces.ts rename to clients/client-mediatailor/src/pagination/Interfaces.ts diff --git a/clients/client-mediatailor/pagination/ListAlertsPaginator.ts b/clients/client-mediatailor/src/pagination/ListAlertsPaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/ListAlertsPaginator.ts rename to clients/client-mediatailor/src/pagination/ListAlertsPaginator.ts diff --git a/clients/client-mediatailor/pagination/ListChannelsPaginator.ts b/clients/client-mediatailor/src/pagination/ListChannelsPaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/ListChannelsPaginator.ts rename to clients/client-mediatailor/src/pagination/ListChannelsPaginator.ts diff --git a/clients/client-mediatailor/pagination/ListPlaybackConfigurationsPaginator.ts b/clients/client-mediatailor/src/pagination/ListPlaybackConfigurationsPaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/ListPlaybackConfigurationsPaginator.ts rename to clients/client-mediatailor/src/pagination/ListPlaybackConfigurationsPaginator.ts diff --git a/clients/client-mediatailor/pagination/ListSourceLocationsPaginator.ts b/clients/client-mediatailor/src/pagination/ListSourceLocationsPaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/ListSourceLocationsPaginator.ts rename to clients/client-mediatailor/src/pagination/ListSourceLocationsPaginator.ts diff --git a/clients/client-mediatailor/pagination/ListVodSourcesPaginator.ts b/clients/client-mediatailor/src/pagination/ListVodSourcesPaginator.ts similarity index 100% rename from clients/client-mediatailor/pagination/ListVodSourcesPaginator.ts rename to clients/client-mediatailor/src/pagination/ListVodSourcesPaginator.ts diff --git a/clients/client-mediatailor/protocols/Aws_restJson1.ts b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mediatailor/protocols/Aws_restJson1.ts rename to clients/client-mediatailor/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mediatailor/src/runtimeConfig.browser.ts b/clients/client-mediatailor/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6d354eb5ccc0 --- /dev/null +++ b/clients/client-mediatailor/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MediaTailorClientConfig } from "./MediaTailorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaTailorClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediatailor/runtimeConfig.native.ts b/clients/client-mediatailor/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mediatailor/runtimeConfig.native.ts rename to clients/client-mediatailor/src/runtimeConfig.native.ts diff --git a/clients/client-mediatailor/runtimeConfig.shared.ts b/clients/client-mediatailor/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mediatailor/runtimeConfig.shared.ts rename to clients/client-mediatailor/src/runtimeConfig.shared.ts diff --git a/clients/client-mediatailor/src/runtimeConfig.ts b/clients/client-mediatailor/src/runtimeConfig.ts new file mode 100644 index 000000000000..9608b3cecf19 --- /dev/null +++ b/clients/client-mediatailor/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MediaTailorClientConfig } from "./MediaTailorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MediaTailorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mediatailor/tsconfig.es.json b/clients/client-mediatailor/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mediatailor/tsconfig.es.json +++ b/clients/client-mediatailor/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mediatailor/tsconfig.json b/clients/client-mediatailor/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mediatailor/tsconfig.json +++ b/clients/client-mediatailor/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mediatailor/tsconfig.types.json b/clients/client-mediatailor/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mediatailor/tsconfig.types.json +++ b/clients/client-mediatailor/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-memorydb/.gitignore b/clients/client-memorydb/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-memorydb/.gitignore +++ b/clients/client-memorydb/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-memorydb/package.json b/clients/client-memorydb/package.json index 54b0158f84b6..cd658821d9a6 100644 --- a/clients/client-memorydb/package.json +++ b/clients/client-memorydb/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-memorydb", "repository": { "type": "git", diff --git a/clients/client-memorydb/runtimeConfig.browser.ts b/clients/client-memorydb/runtimeConfig.browser.ts deleted file mode 100644 index 4dba986ae92b..000000000000 --- a/clients/client-memorydb/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MemoryDBClientConfig } from "./MemoryDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MemoryDBClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-memorydb/runtimeConfig.ts b/clients/client-memorydb/runtimeConfig.ts deleted file mode 100644 index c31035989710..000000000000 --- a/clients/client-memorydb/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MemoryDBClientConfig } from "./MemoryDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MemoryDBClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-memorydb/MemoryDB.ts b/clients/client-memorydb/src/MemoryDB.ts similarity index 100% rename from clients/client-memorydb/MemoryDB.ts rename to clients/client-memorydb/src/MemoryDB.ts diff --git a/clients/client-memorydb/MemoryDBClient.ts b/clients/client-memorydb/src/MemoryDBClient.ts similarity index 100% rename from clients/client-memorydb/MemoryDBClient.ts rename to clients/client-memorydb/src/MemoryDBClient.ts diff --git a/clients/client-memorydb/commands/BatchUpdateClusterCommand.ts b/clients/client-memorydb/src/commands/BatchUpdateClusterCommand.ts similarity index 100% rename from clients/client-memorydb/commands/BatchUpdateClusterCommand.ts rename to clients/client-memorydb/src/commands/BatchUpdateClusterCommand.ts diff --git a/clients/client-memorydb/commands/CopySnapshotCommand.ts b/clients/client-memorydb/src/commands/CopySnapshotCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CopySnapshotCommand.ts rename to clients/client-memorydb/src/commands/CopySnapshotCommand.ts diff --git a/clients/client-memorydb/commands/CreateACLCommand.ts b/clients/client-memorydb/src/commands/CreateACLCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateACLCommand.ts rename to clients/client-memorydb/src/commands/CreateACLCommand.ts diff --git a/clients/client-memorydb/commands/CreateClusterCommand.ts b/clients/client-memorydb/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateClusterCommand.ts rename to clients/client-memorydb/src/commands/CreateClusterCommand.ts diff --git a/clients/client-memorydb/commands/CreateParameterGroupCommand.ts b/clients/client-memorydb/src/commands/CreateParameterGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateParameterGroupCommand.ts rename to clients/client-memorydb/src/commands/CreateParameterGroupCommand.ts diff --git a/clients/client-memorydb/commands/CreateSnapshotCommand.ts b/clients/client-memorydb/src/commands/CreateSnapshotCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateSnapshotCommand.ts rename to clients/client-memorydb/src/commands/CreateSnapshotCommand.ts diff --git a/clients/client-memorydb/commands/CreateSubnetGroupCommand.ts b/clients/client-memorydb/src/commands/CreateSubnetGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateSubnetGroupCommand.ts rename to clients/client-memorydb/src/commands/CreateSubnetGroupCommand.ts diff --git a/clients/client-memorydb/commands/CreateUserCommand.ts b/clients/client-memorydb/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-memorydb/commands/CreateUserCommand.ts rename to clients/client-memorydb/src/commands/CreateUserCommand.ts diff --git a/clients/client-memorydb/commands/DeleteACLCommand.ts b/clients/client-memorydb/src/commands/DeleteACLCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteACLCommand.ts rename to clients/client-memorydb/src/commands/DeleteACLCommand.ts diff --git a/clients/client-memorydb/commands/DeleteClusterCommand.ts b/clients/client-memorydb/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteClusterCommand.ts rename to clients/client-memorydb/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-memorydb/commands/DeleteParameterGroupCommand.ts b/clients/client-memorydb/src/commands/DeleteParameterGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteParameterGroupCommand.ts rename to clients/client-memorydb/src/commands/DeleteParameterGroupCommand.ts diff --git a/clients/client-memorydb/commands/DeleteSnapshotCommand.ts b/clients/client-memorydb/src/commands/DeleteSnapshotCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteSnapshotCommand.ts rename to clients/client-memorydb/src/commands/DeleteSnapshotCommand.ts diff --git a/clients/client-memorydb/commands/DeleteSubnetGroupCommand.ts b/clients/client-memorydb/src/commands/DeleteSubnetGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteSubnetGroupCommand.ts rename to clients/client-memorydb/src/commands/DeleteSubnetGroupCommand.ts diff --git a/clients/client-memorydb/commands/DeleteUserCommand.ts b/clients/client-memorydb/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DeleteUserCommand.ts rename to clients/client-memorydb/src/commands/DeleteUserCommand.ts diff --git a/clients/client-memorydb/commands/DescribeACLsCommand.ts b/clients/client-memorydb/src/commands/DescribeACLsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeACLsCommand.ts rename to clients/client-memorydb/src/commands/DescribeACLsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeClustersCommand.ts b/clients/client-memorydb/src/commands/DescribeClustersCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeClustersCommand.ts rename to clients/client-memorydb/src/commands/DescribeClustersCommand.ts diff --git a/clients/client-memorydb/commands/DescribeEngineVersionsCommand.ts b/clients/client-memorydb/src/commands/DescribeEngineVersionsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeEngineVersionsCommand.ts rename to clients/client-memorydb/src/commands/DescribeEngineVersionsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeEventsCommand.ts b/clients/client-memorydb/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeEventsCommand.ts rename to clients/client-memorydb/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeParameterGroupsCommand.ts b/clients/client-memorydb/src/commands/DescribeParameterGroupsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeParameterGroupsCommand.ts rename to clients/client-memorydb/src/commands/DescribeParameterGroupsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeParametersCommand.ts b/clients/client-memorydb/src/commands/DescribeParametersCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeParametersCommand.ts rename to clients/client-memorydb/src/commands/DescribeParametersCommand.ts diff --git a/clients/client-memorydb/commands/DescribeServiceUpdatesCommand.ts b/clients/client-memorydb/src/commands/DescribeServiceUpdatesCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeServiceUpdatesCommand.ts rename to clients/client-memorydb/src/commands/DescribeServiceUpdatesCommand.ts diff --git a/clients/client-memorydb/commands/DescribeSnapshotsCommand.ts b/clients/client-memorydb/src/commands/DescribeSnapshotsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeSnapshotsCommand.ts rename to clients/client-memorydb/src/commands/DescribeSnapshotsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeSubnetGroupsCommand.ts b/clients/client-memorydb/src/commands/DescribeSubnetGroupsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeSubnetGroupsCommand.ts rename to clients/client-memorydb/src/commands/DescribeSubnetGroupsCommand.ts diff --git a/clients/client-memorydb/commands/DescribeUsersCommand.ts b/clients/client-memorydb/src/commands/DescribeUsersCommand.ts similarity index 100% rename from clients/client-memorydb/commands/DescribeUsersCommand.ts rename to clients/client-memorydb/src/commands/DescribeUsersCommand.ts diff --git a/clients/client-memorydb/commands/FailoverShardCommand.ts b/clients/client-memorydb/src/commands/FailoverShardCommand.ts similarity index 100% rename from clients/client-memorydb/commands/FailoverShardCommand.ts rename to clients/client-memorydb/src/commands/FailoverShardCommand.ts diff --git a/clients/client-memorydb/commands/ListAllowedNodeTypeUpdatesCommand.ts b/clients/client-memorydb/src/commands/ListAllowedNodeTypeUpdatesCommand.ts similarity index 100% rename from clients/client-memorydb/commands/ListAllowedNodeTypeUpdatesCommand.ts rename to clients/client-memorydb/src/commands/ListAllowedNodeTypeUpdatesCommand.ts diff --git a/clients/client-memorydb/commands/ListTagsCommand.ts b/clients/client-memorydb/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-memorydb/commands/ListTagsCommand.ts rename to clients/client-memorydb/src/commands/ListTagsCommand.ts diff --git a/clients/client-memorydb/commands/ResetParameterGroupCommand.ts b/clients/client-memorydb/src/commands/ResetParameterGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/ResetParameterGroupCommand.ts rename to clients/client-memorydb/src/commands/ResetParameterGroupCommand.ts diff --git a/clients/client-memorydb/commands/TagResourceCommand.ts b/clients/client-memorydb/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-memorydb/commands/TagResourceCommand.ts rename to clients/client-memorydb/src/commands/TagResourceCommand.ts diff --git a/clients/client-memorydb/commands/UntagResourceCommand.ts b/clients/client-memorydb/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UntagResourceCommand.ts rename to clients/client-memorydb/src/commands/UntagResourceCommand.ts diff --git a/clients/client-memorydb/commands/UpdateACLCommand.ts b/clients/client-memorydb/src/commands/UpdateACLCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UpdateACLCommand.ts rename to clients/client-memorydb/src/commands/UpdateACLCommand.ts diff --git a/clients/client-memorydb/commands/UpdateClusterCommand.ts b/clients/client-memorydb/src/commands/UpdateClusterCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UpdateClusterCommand.ts rename to clients/client-memorydb/src/commands/UpdateClusterCommand.ts diff --git a/clients/client-memorydb/commands/UpdateParameterGroupCommand.ts b/clients/client-memorydb/src/commands/UpdateParameterGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UpdateParameterGroupCommand.ts rename to clients/client-memorydb/src/commands/UpdateParameterGroupCommand.ts diff --git a/clients/client-memorydb/commands/UpdateSubnetGroupCommand.ts b/clients/client-memorydb/src/commands/UpdateSubnetGroupCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UpdateSubnetGroupCommand.ts rename to clients/client-memorydb/src/commands/UpdateSubnetGroupCommand.ts diff --git a/clients/client-memorydb/commands/UpdateUserCommand.ts b/clients/client-memorydb/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-memorydb/commands/UpdateUserCommand.ts rename to clients/client-memorydb/src/commands/UpdateUserCommand.ts diff --git a/clients/client-memorydb/endpoints.ts b/clients/client-memorydb/src/endpoints.ts similarity index 100% rename from clients/client-memorydb/endpoints.ts rename to clients/client-memorydb/src/endpoints.ts diff --git a/clients/client-memorydb/index.ts b/clients/client-memorydb/src/index.ts similarity index 100% rename from clients/client-memorydb/index.ts rename to clients/client-memorydb/src/index.ts diff --git a/clients/client-memorydb/models/index.ts b/clients/client-memorydb/src/models/index.ts similarity index 100% rename from clients/client-memorydb/models/index.ts rename to clients/client-memorydb/src/models/index.ts diff --git a/clients/client-memorydb/models/models_0.ts b/clients/client-memorydb/src/models/models_0.ts similarity index 100% rename from clients/client-memorydb/models/models_0.ts rename to clients/client-memorydb/src/models/models_0.ts diff --git a/clients/client-memorydb/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-memorydb/protocols/Aws_json1_1.ts rename to clients/client-memorydb/src/protocols/Aws_json1_1.ts diff --git a/clients/client-memorydb/src/runtimeConfig.browser.ts b/clients/client-memorydb/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1e00517f6537 --- /dev/null +++ b/clients/client-memorydb/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MemoryDBClientConfig } from "./MemoryDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MemoryDBClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-memorydb/runtimeConfig.native.ts b/clients/client-memorydb/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-memorydb/runtimeConfig.native.ts rename to clients/client-memorydb/src/runtimeConfig.native.ts diff --git a/clients/client-memorydb/runtimeConfig.shared.ts b/clients/client-memorydb/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-memorydb/runtimeConfig.shared.ts rename to clients/client-memorydb/src/runtimeConfig.shared.ts diff --git a/clients/client-memorydb/src/runtimeConfig.ts b/clients/client-memorydb/src/runtimeConfig.ts new file mode 100644 index 000000000000..66c5623a118e --- /dev/null +++ b/clients/client-memorydb/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MemoryDBClientConfig } from "./MemoryDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MemoryDBClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-memorydb/tsconfig.es.json b/clients/client-memorydb/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-memorydb/tsconfig.es.json +++ b/clients/client-memorydb/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-memorydb/tsconfig.json b/clients/client-memorydb/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-memorydb/tsconfig.json +++ b/clients/client-memorydb/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-memorydb/tsconfig.types.json b/clients/client-memorydb/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-memorydb/tsconfig.types.json +++ b/clients/client-memorydb/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mgn/.gitignore b/clients/client-mgn/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-mgn/.gitignore +++ b/clients/client-mgn/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mgn/package.json b/clients/client-mgn/package.json index 0e8fd0baf620..8181c9a427d4 100644 --- a/clients/client-mgn/package.json +++ b/clients/client-mgn/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mgn", "repository": { "type": "git", diff --git a/clients/client-mgn/runtimeConfig.browser.ts b/clients/client-mgn/runtimeConfig.browser.ts deleted file mode 100644 index cda70e40c551..000000000000 --- a/clients/client-mgn/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MgnClientConfig } from "./MgnClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MgnClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mgn/runtimeConfig.ts b/clients/client-mgn/runtimeConfig.ts deleted file mode 100644 index e9bd7d721cb9..000000000000 --- a/clients/client-mgn/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MgnClientConfig } from "./MgnClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MgnClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mgn/Mgn.ts b/clients/client-mgn/src/Mgn.ts similarity index 100% rename from clients/client-mgn/Mgn.ts rename to clients/client-mgn/src/Mgn.ts diff --git a/clients/client-mgn/MgnClient.ts b/clients/client-mgn/src/MgnClient.ts similarity index 100% rename from clients/client-mgn/MgnClient.ts rename to clients/client-mgn/src/MgnClient.ts diff --git a/clients/client-mgn/commands/ChangeServerLifeCycleStateCommand.ts b/clients/client-mgn/src/commands/ChangeServerLifeCycleStateCommand.ts similarity index 100% rename from clients/client-mgn/commands/ChangeServerLifeCycleStateCommand.ts rename to clients/client-mgn/src/commands/ChangeServerLifeCycleStateCommand.ts diff --git a/clients/client-mgn/commands/CreateReplicationConfigurationTemplateCommand.ts b/clients/client-mgn/src/commands/CreateReplicationConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-mgn/commands/CreateReplicationConfigurationTemplateCommand.ts rename to clients/client-mgn/src/commands/CreateReplicationConfigurationTemplateCommand.ts diff --git a/clients/client-mgn/commands/DeleteJobCommand.ts b/clients/client-mgn/src/commands/DeleteJobCommand.ts similarity index 100% rename from clients/client-mgn/commands/DeleteJobCommand.ts rename to clients/client-mgn/src/commands/DeleteJobCommand.ts diff --git a/clients/client-mgn/commands/DeleteReplicationConfigurationTemplateCommand.ts b/clients/client-mgn/src/commands/DeleteReplicationConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-mgn/commands/DeleteReplicationConfigurationTemplateCommand.ts rename to clients/client-mgn/src/commands/DeleteReplicationConfigurationTemplateCommand.ts diff --git a/clients/client-mgn/commands/DeleteSourceServerCommand.ts b/clients/client-mgn/src/commands/DeleteSourceServerCommand.ts similarity index 100% rename from clients/client-mgn/commands/DeleteSourceServerCommand.ts rename to clients/client-mgn/src/commands/DeleteSourceServerCommand.ts diff --git a/clients/client-mgn/commands/DescribeJobLogItemsCommand.ts b/clients/client-mgn/src/commands/DescribeJobLogItemsCommand.ts similarity index 100% rename from clients/client-mgn/commands/DescribeJobLogItemsCommand.ts rename to clients/client-mgn/src/commands/DescribeJobLogItemsCommand.ts diff --git a/clients/client-mgn/commands/DescribeJobsCommand.ts b/clients/client-mgn/src/commands/DescribeJobsCommand.ts similarity index 100% rename from clients/client-mgn/commands/DescribeJobsCommand.ts rename to clients/client-mgn/src/commands/DescribeJobsCommand.ts diff --git a/clients/client-mgn/commands/DescribeReplicationConfigurationTemplatesCommand.ts b/clients/client-mgn/src/commands/DescribeReplicationConfigurationTemplatesCommand.ts similarity index 100% rename from clients/client-mgn/commands/DescribeReplicationConfigurationTemplatesCommand.ts rename to clients/client-mgn/src/commands/DescribeReplicationConfigurationTemplatesCommand.ts diff --git a/clients/client-mgn/commands/DescribeSourceServersCommand.ts b/clients/client-mgn/src/commands/DescribeSourceServersCommand.ts similarity index 100% rename from clients/client-mgn/commands/DescribeSourceServersCommand.ts rename to clients/client-mgn/src/commands/DescribeSourceServersCommand.ts diff --git a/clients/client-mgn/commands/DisconnectFromServiceCommand.ts b/clients/client-mgn/src/commands/DisconnectFromServiceCommand.ts similarity index 100% rename from clients/client-mgn/commands/DisconnectFromServiceCommand.ts rename to clients/client-mgn/src/commands/DisconnectFromServiceCommand.ts diff --git a/clients/client-mgn/commands/FinalizeCutoverCommand.ts b/clients/client-mgn/src/commands/FinalizeCutoverCommand.ts similarity index 100% rename from clients/client-mgn/commands/FinalizeCutoverCommand.ts rename to clients/client-mgn/src/commands/FinalizeCutoverCommand.ts diff --git a/clients/client-mgn/commands/GetLaunchConfigurationCommand.ts b/clients/client-mgn/src/commands/GetLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-mgn/commands/GetLaunchConfigurationCommand.ts rename to clients/client-mgn/src/commands/GetLaunchConfigurationCommand.ts diff --git a/clients/client-mgn/commands/GetReplicationConfigurationCommand.ts b/clients/client-mgn/src/commands/GetReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-mgn/commands/GetReplicationConfigurationCommand.ts rename to clients/client-mgn/src/commands/GetReplicationConfigurationCommand.ts diff --git a/clients/client-mgn/commands/InitializeServiceCommand.ts b/clients/client-mgn/src/commands/InitializeServiceCommand.ts similarity index 100% rename from clients/client-mgn/commands/InitializeServiceCommand.ts rename to clients/client-mgn/src/commands/InitializeServiceCommand.ts diff --git a/clients/client-mgn/commands/ListTagsForResourceCommand.ts b/clients/client-mgn/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mgn/commands/ListTagsForResourceCommand.ts rename to clients/client-mgn/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mgn/commands/MarkAsArchivedCommand.ts b/clients/client-mgn/src/commands/MarkAsArchivedCommand.ts similarity index 100% rename from clients/client-mgn/commands/MarkAsArchivedCommand.ts rename to clients/client-mgn/src/commands/MarkAsArchivedCommand.ts diff --git a/clients/client-mgn/commands/RetryDataReplicationCommand.ts b/clients/client-mgn/src/commands/RetryDataReplicationCommand.ts similarity index 100% rename from clients/client-mgn/commands/RetryDataReplicationCommand.ts rename to clients/client-mgn/src/commands/RetryDataReplicationCommand.ts diff --git a/clients/client-mgn/commands/StartCutoverCommand.ts b/clients/client-mgn/src/commands/StartCutoverCommand.ts similarity index 100% rename from clients/client-mgn/commands/StartCutoverCommand.ts rename to clients/client-mgn/src/commands/StartCutoverCommand.ts diff --git a/clients/client-mgn/commands/StartTestCommand.ts b/clients/client-mgn/src/commands/StartTestCommand.ts similarity index 100% rename from clients/client-mgn/commands/StartTestCommand.ts rename to clients/client-mgn/src/commands/StartTestCommand.ts diff --git a/clients/client-mgn/commands/TagResourceCommand.ts b/clients/client-mgn/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mgn/commands/TagResourceCommand.ts rename to clients/client-mgn/src/commands/TagResourceCommand.ts diff --git a/clients/client-mgn/commands/TerminateTargetInstancesCommand.ts b/clients/client-mgn/src/commands/TerminateTargetInstancesCommand.ts similarity index 100% rename from clients/client-mgn/commands/TerminateTargetInstancesCommand.ts rename to clients/client-mgn/src/commands/TerminateTargetInstancesCommand.ts diff --git a/clients/client-mgn/commands/UntagResourceCommand.ts b/clients/client-mgn/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mgn/commands/UntagResourceCommand.ts rename to clients/client-mgn/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mgn/commands/UpdateLaunchConfigurationCommand.ts b/clients/client-mgn/src/commands/UpdateLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-mgn/commands/UpdateLaunchConfigurationCommand.ts rename to clients/client-mgn/src/commands/UpdateLaunchConfigurationCommand.ts diff --git a/clients/client-mgn/commands/UpdateReplicationConfigurationCommand.ts b/clients/client-mgn/src/commands/UpdateReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-mgn/commands/UpdateReplicationConfigurationCommand.ts rename to clients/client-mgn/src/commands/UpdateReplicationConfigurationCommand.ts diff --git a/clients/client-mgn/commands/UpdateReplicationConfigurationTemplateCommand.ts b/clients/client-mgn/src/commands/UpdateReplicationConfigurationTemplateCommand.ts similarity index 100% rename from clients/client-mgn/commands/UpdateReplicationConfigurationTemplateCommand.ts rename to clients/client-mgn/src/commands/UpdateReplicationConfigurationTemplateCommand.ts diff --git a/clients/client-mgn/endpoints.ts b/clients/client-mgn/src/endpoints.ts similarity index 100% rename from clients/client-mgn/endpoints.ts rename to clients/client-mgn/src/endpoints.ts diff --git a/clients/client-mgn/index.ts b/clients/client-mgn/src/index.ts similarity index 100% rename from clients/client-mgn/index.ts rename to clients/client-mgn/src/index.ts diff --git a/clients/client-mgn/models/index.ts b/clients/client-mgn/src/models/index.ts similarity index 100% rename from clients/client-mgn/models/index.ts rename to clients/client-mgn/src/models/index.ts diff --git a/clients/client-mgn/models/models_0.ts b/clients/client-mgn/src/models/models_0.ts similarity index 100% rename from clients/client-mgn/models/models_0.ts rename to clients/client-mgn/src/models/models_0.ts diff --git a/clients/client-mgn/pagination/DescribeJobLogItemsPaginator.ts b/clients/client-mgn/src/pagination/DescribeJobLogItemsPaginator.ts similarity index 100% rename from clients/client-mgn/pagination/DescribeJobLogItemsPaginator.ts rename to clients/client-mgn/src/pagination/DescribeJobLogItemsPaginator.ts diff --git a/clients/client-mgn/pagination/DescribeJobsPaginator.ts b/clients/client-mgn/src/pagination/DescribeJobsPaginator.ts similarity index 100% rename from clients/client-mgn/pagination/DescribeJobsPaginator.ts rename to clients/client-mgn/src/pagination/DescribeJobsPaginator.ts diff --git a/clients/client-mgn/pagination/DescribeReplicationConfigurationTemplatesPaginator.ts b/clients/client-mgn/src/pagination/DescribeReplicationConfigurationTemplatesPaginator.ts similarity index 100% rename from clients/client-mgn/pagination/DescribeReplicationConfigurationTemplatesPaginator.ts rename to clients/client-mgn/src/pagination/DescribeReplicationConfigurationTemplatesPaginator.ts diff --git a/clients/client-mgn/pagination/DescribeSourceServersPaginator.ts b/clients/client-mgn/src/pagination/DescribeSourceServersPaginator.ts similarity index 100% rename from clients/client-mgn/pagination/DescribeSourceServersPaginator.ts rename to clients/client-mgn/src/pagination/DescribeSourceServersPaginator.ts diff --git a/clients/client-mgn/pagination/Interfaces.ts b/clients/client-mgn/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mgn/pagination/Interfaces.ts rename to clients/client-mgn/src/pagination/Interfaces.ts diff --git a/clients/client-mgn/protocols/Aws_restJson1.ts b/clients/client-mgn/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mgn/protocols/Aws_restJson1.ts rename to clients/client-mgn/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mgn/src/runtimeConfig.browser.ts b/clients/client-mgn/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b422205181a8 --- /dev/null +++ b/clients/client-mgn/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MgnClientConfig } from "./MgnClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MgnClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mgn/runtimeConfig.native.ts b/clients/client-mgn/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mgn/runtimeConfig.native.ts rename to clients/client-mgn/src/runtimeConfig.native.ts diff --git a/clients/client-mgn/runtimeConfig.shared.ts b/clients/client-mgn/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mgn/runtimeConfig.shared.ts rename to clients/client-mgn/src/runtimeConfig.shared.ts diff --git a/clients/client-mgn/src/runtimeConfig.ts b/clients/client-mgn/src/runtimeConfig.ts new file mode 100644 index 000000000000..faf7c40cc82f --- /dev/null +++ b/clients/client-mgn/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MgnClientConfig } from "./MgnClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MgnClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mgn/tsconfig.es.json b/clients/client-mgn/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mgn/tsconfig.es.json +++ b/clients/client-mgn/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mgn/tsconfig.json b/clients/client-mgn/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mgn/tsconfig.json +++ b/clients/client-mgn/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mgn/tsconfig.types.json b/clients/client-mgn/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mgn/tsconfig.types.json +++ b/clients/client-mgn/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-migration-hub/.gitignore b/clients/client-migration-hub/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-migration-hub/.gitignore +++ b/clients/client-migration-hub/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-migration-hub/package.json b/clients/client-migration-hub/package.json index e273e92a1eb2..4d1558eeace8 100644 --- a/clients/client-migration-hub/package.json +++ b/clients/client-migration-hub/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-migration-hub", "repository": { "type": "git", diff --git a/clients/client-migration-hub/runtimeConfig.browser.ts b/clients/client-migration-hub/runtimeConfig.browser.ts deleted file mode 100644 index 76d3abbf5d88..000000000000 --- a/clients/client-migration-hub/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MigrationHubClientConfig } from "./MigrationHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MigrationHubClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-migration-hub/runtimeConfig.ts b/clients/client-migration-hub/runtimeConfig.ts deleted file mode 100644 index afcb960508ea..000000000000 --- a/clients/client-migration-hub/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MigrationHubClientConfig } from "./MigrationHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MigrationHubClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-migration-hub/MigrationHub.ts b/clients/client-migration-hub/src/MigrationHub.ts similarity index 100% rename from clients/client-migration-hub/MigrationHub.ts rename to clients/client-migration-hub/src/MigrationHub.ts diff --git a/clients/client-migration-hub/MigrationHubClient.ts b/clients/client-migration-hub/src/MigrationHubClient.ts similarity index 100% rename from clients/client-migration-hub/MigrationHubClient.ts rename to clients/client-migration-hub/src/MigrationHubClient.ts diff --git a/clients/client-migration-hub/commands/AssociateCreatedArtifactCommand.ts b/clients/client-migration-hub/src/commands/AssociateCreatedArtifactCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/AssociateCreatedArtifactCommand.ts rename to clients/client-migration-hub/src/commands/AssociateCreatedArtifactCommand.ts diff --git a/clients/client-migration-hub/commands/AssociateDiscoveredResourceCommand.ts b/clients/client-migration-hub/src/commands/AssociateDiscoveredResourceCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/AssociateDiscoveredResourceCommand.ts rename to clients/client-migration-hub/src/commands/AssociateDiscoveredResourceCommand.ts diff --git a/clients/client-migration-hub/commands/CreateProgressUpdateStreamCommand.ts b/clients/client-migration-hub/src/commands/CreateProgressUpdateStreamCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/CreateProgressUpdateStreamCommand.ts rename to clients/client-migration-hub/src/commands/CreateProgressUpdateStreamCommand.ts diff --git a/clients/client-migration-hub/commands/DeleteProgressUpdateStreamCommand.ts b/clients/client-migration-hub/src/commands/DeleteProgressUpdateStreamCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/DeleteProgressUpdateStreamCommand.ts rename to clients/client-migration-hub/src/commands/DeleteProgressUpdateStreamCommand.ts diff --git a/clients/client-migration-hub/commands/DescribeApplicationStateCommand.ts b/clients/client-migration-hub/src/commands/DescribeApplicationStateCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/DescribeApplicationStateCommand.ts rename to clients/client-migration-hub/src/commands/DescribeApplicationStateCommand.ts diff --git a/clients/client-migration-hub/commands/DescribeMigrationTaskCommand.ts b/clients/client-migration-hub/src/commands/DescribeMigrationTaskCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/DescribeMigrationTaskCommand.ts rename to clients/client-migration-hub/src/commands/DescribeMigrationTaskCommand.ts diff --git a/clients/client-migration-hub/commands/DisassociateCreatedArtifactCommand.ts b/clients/client-migration-hub/src/commands/DisassociateCreatedArtifactCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/DisassociateCreatedArtifactCommand.ts rename to clients/client-migration-hub/src/commands/DisassociateCreatedArtifactCommand.ts diff --git a/clients/client-migration-hub/commands/DisassociateDiscoveredResourceCommand.ts b/clients/client-migration-hub/src/commands/DisassociateDiscoveredResourceCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/DisassociateDiscoveredResourceCommand.ts rename to clients/client-migration-hub/src/commands/DisassociateDiscoveredResourceCommand.ts diff --git a/clients/client-migration-hub/commands/ImportMigrationTaskCommand.ts b/clients/client-migration-hub/src/commands/ImportMigrationTaskCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ImportMigrationTaskCommand.ts rename to clients/client-migration-hub/src/commands/ImportMigrationTaskCommand.ts diff --git a/clients/client-migration-hub/commands/ListApplicationStatesCommand.ts b/clients/client-migration-hub/src/commands/ListApplicationStatesCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ListApplicationStatesCommand.ts rename to clients/client-migration-hub/src/commands/ListApplicationStatesCommand.ts diff --git a/clients/client-migration-hub/commands/ListCreatedArtifactsCommand.ts b/clients/client-migration-hub/src/commands/ListCreatedArtifactsCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ListCreatedArtifactsCommand.ts rename to clients/client-migration-hub/src/commands/ListCreatedArtifactsCommand.ts diff --git a/clients/client-migration-hub/commands/ListDiscoveredResourcesCommand.ts b/clients/client-migration-hub/src/commands/ListDiscoveredResourcesCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ListDiscoveredResourcesCommand.ts rename to clients/client-migration-hub/src/commands/ListDiscoveredResourcesCommand.ts diff --git a/clients/client-migration-hub/commands/ListMigrationTasksCommand.ts b/clients/client-migration-hub/src/commands/ListMigrationTasksCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ListMigrationTasksCommand.ts rename to clients/client-migration-hub/src/commands/ListMigrationTasksCommand.ts diff --git a/clients/client-migration-hub/commands/ListProgressUpdateStreamsCommand.ts b/clients/client-migration-hub/src/commands/ListProgressUpdateStreamsCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/ListProgressUpdateStreamsCommand.ts rename to clients/client-migration-hub/src/commands/ListProgressUpdateStreamsCommand.ts diff --git a/clients/client-migration-hub/commands/NotifyApplicationStateCommand.ts b/clients/client-migration-hub/src/commands/NotifyApplicationStateCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/NotifyApplicationStateCommand.ts rename to clients/client-migration-hub/src/commands/NotifyApplicationStateCommand.ts diff --git a/clients/client-migration-hub/commands/NotifyMigrationTaskStateCommand.ts b/clients/client-migration-hub/src/commands/NotifyMigrationTaskStateCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/NotifyMigrationTaskStateCommand.ts rename to clients/client-migration-hub/src/commands/NotifyMigrationTaskStateCommand.ts diff --git a/clients/client-migration-hub/commands/PutResourceAttributesCommand.ts b/clients/client-migration-hub/src/commands/PutResourceAttributesCommand.ts similarity index 100% rename from clients/client-migration-hub/commands/PutResourceAttributesCommand.ts rename to clients/client-migration-hub/src/commands/PutResourceAttributesCommand.ts diff --git a/clients/client-migration-hub/endpoints.ts b/clients/client-migration-hub/src/endpoints.ts similarity index 100% rename from clients/client-migration-hub/endpoints.ts rename to clients/client-migration-hub/src/endpoints.ts diff --git a/clients/client-migration-hub/index.ts b/clients/client-migration-hub/src/index.ts similarity index 100% rename from clients/client-migration-hub/index.ts rename to clients/client-migration-hub/src/index.ts diff --git a/clients/client-migration-hub/models/index.ts b/clients/client-migration-hub/src/models/index.ts similarity index 100% rename from clients/client-migration-hub/models/index.ts rename to clients/client-migration-hub/src/models/index.ts diff --git a/clients/client-migration-hub/models/models_0.ts b/clients/client-migration-hub/src/models/models_0.ts similarity index 100% rename from clients/client-migration-hub/models/models_0.ts rename to clients/client-migration-hub/src/models/models_0.ts diff --git a/clients/client-migration-hub/pagination/Interfaces.ts b/clients/client-migration-hub/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-migration-hub/pagination/Interfaces.ts rename to clients/client-migration-hub/src/pagination/Interfaces.ts diff --git a/clients/client-migration-hub/pagination/ListApplicationStatesPaginator.ts b/clients/client-migration-hub/src/pagination/ListApplicationStatesPaginator.ts similarity index 100% rename from clients/client-migration-hub/pagination/ListApplicationStatesPaginator.ts rename to clients/client-migration-hub/src/pagination/ListApplicationStatesPaginator.ts diff --git a/clients/client-migration-hub/pagination/ListCreatedArtifactsPaginator.ts b/clients/client-migration-hub/src/pagination/ListCreatedArtifactsPaginator.ts similarity index 100% rename from clients/client-migration-hub/pagination/ListCreatedArtifactsPaginator.ts rename to clients/client-migration-hub/src/pagination/ListCreatedArtifactsPaginator.ts diff --git a/clients/client-migration-hub/pagination/ListDiscoveredResourcesPaginator.ts b/clients/client-migration-hub/src/pagination/ListDiscoveredResourcesPaginator.ts similarity index 100% rename from clients/client-migration-hub/pagination/ListDiscoveredResourcesPaginator.ts rename to clients/client-migration-hub/src/pagination/ListDiscoveredResourcesPaginator.ts diff --git a/clients/client-migration-hub/pagination/ListMigrationTasksPaginator.ts b/clients/client-migration-hub/src/pagination/ListMigrationTasksPaginator.ts similarity index 100% rename from clients/client-migration-hub/pagination/ListMigrationTasksPaginator.ts rename to clients/client-migration-hub/src/pagination/ListMigrationTasksPaginator.ts diff --git a/clients/client-migration-hub/pagination/ListProgressUpdateStreamsPaginator.ts b/clients/client-migration-hub/src/pagination/ListProgressUpdateStreamsPaginator.ts similarity index 100% rename from clients/client-migration-hub/pagination/ListProgressUpdateStreamsPaginator.ts rename to clients/client-migration-hub/src/pagination/ListProgressUpdateStreamsPaginator.ts diff --git a/clients/client-migration-hub/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-migration-hub/protocols/Aws_json1_1.ts rename to clients/client-migration-hub/src/protocols/Aws_json1_1.ts diff --git a/clients/client-migration-hub/src/runtimeConfig.browser.ts b/clients/client-migration-hub/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5ea9901fbf4e --- /dev/null +++ b/clients/client-migration-hub/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MigrationHubClientConfig } from "./MigrationHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MigrationHubClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-migration-hub/runtimeConfig.native.ts b/clients/client-migration-hub/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-migration-hub/runtimeConfig.native.ts rename to clients/client-migration-hub/src/runtimeConfig.native.ts diff --git a/clients/client-migration-hub/runtimeConfig.shared.ts b/clients/client-migration-hub/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-migration-hub/runtimeConfig.shared.ts rename to clients/client-migration-hub/src/runtimeConfig.shared.ts diff --git a/clients/client-migration-hub/src/runtimeConfig.ts b/clients/client-migration-hub/src/runtimeConfig.ts new file mode 100644 index 000000000000..ddf8adb28374 --- /dev/null +++ b/clients/client-migration-hub/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MigrationHubClientConfig } from "./MigrationHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MigrationHubClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-migration-hub/tsconfig.es.json b/clients/client-migration-hub/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-migration-hub/tsconfig.es.json +++ b/clients/client-migration-hub/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-migration-hub/tsconfig.json b/clients/client-migration-hub/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-migration-hub/tsconfig.json +++ b/clients/client-migration-hub/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-migration-hub/tsconfig.types.json b/clients/client-migration-hub/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-migration-hub/tsconfig.types.json +++ b/clients/client-migration-hub/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-migrationhub-config/.gitignore b/clients/client-migrationhub-config/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-migrationhub-config/.gitignore +++ b/clients/client-migrationhub-config/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-migrationhub-config/package.json b/clients/client-migrationhub-config/package.json index b5f6e92f8d5a..c578bff51af6 100644 --- a/clients/client-migrationhub-config/package.json +++ b/clients/client-migrationhub-config/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-migrationhub-config", "repository": { "type": "git", diff --git a/clients/client-migrationhub-config/runtimeConfig.browser.ts b/clients/client-migrationhub-config/runtimeConfig.browser.ts deleted file mode 100644 index 01704f107126..000000000000 --- a/clients/client-migrationhub-config/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MigrationHubConfigClientConfig } from "./MigrationHubConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-migrationhub-config/runtimeConfig.ts b/clients/client-migrationhub-config/runtimeConfig.ts deleted file mode 100644 index aa8bfa4f1e18..000000000000 --- a/clients/client-migrationhub-config/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MigrationHubConfigClientConfig } from "./MigrationHubConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-migrationhub-config/MigrationHubConfig.ts b/clients/client-migrationhub-config/src/MigrationHubConfig.ts similarity index 100% rename from clients/client-migrationhub-config/MigrationHubConfig.ts rename to clients/client-migrationhub-config/src/MigrationHubConfig.ts diff --git a/clients/client-migrationhub-config/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts similarity index 100% rename from clients/client-migrationhub-config/MigrationHubConfigClient.ts rename to clients/client-migrationhub-config/src/MigrationHubConfigClient.ts diff --git a/clients/client-migrationhub-config/commands/CreateHomeRegionControlCommand.ts b/clients/client-migrationhub-config/src/commands/CreateHomeRegionControlCommand.ts similarity index 100% rename from clients/client-migrationhub-config/commands/CreateHomeRegionControlCommand.ts rename to clients/client-migrationhub-config/src/commands/CreateHomeRegionControlCommand.ts diff --git a/clients/client-migrationhub-config/commands/DescribeHomeRegionControlsCommand.ts b/clients/client-migrationhub-config/src/commands/DescribeHomeRegionControlsCommand.ts similarity index 100% rename from clients/client-migrationhub-config/commands/DescribeHomeRegionControlsCommand.ts rename to clients/client-migrationhub-config/src/commands/DescribeHomeRegionControlsCommand.ts diff --git a/clients/client-migrationhub-config/commands/GetHomeRegionCommand.ts b/clients/client-migrationhub-config/src/commands/GetHomeRegionCommand.ts similarity index 100% rename from clients/client-migrationhub-config/commands/GetHomeRegionCommand.ts rename to clients/client-migrationhub-config/src/commands/GetHomeRegionCommand.ts diff --git a/clients/client-migrationhub-config/endpoints.ts b/clients/client-migrationhub-config/src/endpoints.ts similarity index 100% rename from clients/client-migrationhub-config/endpoints.ts rename to clients/client-migrationhub-config/src/endpoints.ts diff --git a/clients/client-migrationhub-config/index.ts b/clients/client-migrationhub-config/src/index.ts similarity index 100% rename from clients/client-migrationhub-config/index.ts rename to clients/client-migrationhub-config/src/index.ts diff --git a/clients/client-migrationhub-config/models/index.ts b/clients/client-migrationhub-config/src/models/index.ts similarity index 100% rename from clients/client-migrationhub-config/models/index.ts rename to clients/client-migrationhub-config/src/models/index.ts diff --git a/clients/client-migrationhub-config/models/models_0.ts b/clients/client-migrationhub-config/src/models/models_0.ts similarity index 100% rename from clients/client-migrationhub-config/models/models_0.ts rename to clients/client-migrationhub-config/src/models/models_0.ts diff --git a/clients/client-migrationhub-config/pagination/DescribeHomeRegionControlsPaginator.ts b/clients/client-migrationhub-config/src/pagination/DescribeHomeRegionControlsPaginator.ts similarity index 100% rename from clients/client-migrationhub-config/pagination/DescribeHomeRegionControlsPaginator.ts rename to clients/client-migrationhub-config/src/pagination/DescribeHomeRegionControlsPaginator.ts diff --git a/clients/client-migrationhub-config/pagination/Interfaces.ts b/clients/client-migrationhub-config/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-migrationhub-config/pagination/Interfaces.ts rename to clients/client-migrationhub-config/src/pagination/Interfaces.ts diff --git a/clients/client-migrationhub-config/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-migrationhub-config/protocols/Aws_json1_1.ts rename to clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts diff --git a/clients/client-migrationhub-config/src/runtimeConfig.browser.ts b/clients/client-migrationhub-config/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c9f9f1dec7d9 --- /dev/null +++ b/clients/client-migrationhub-config/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MigrationHubConfigClientConfig } from "./MigrationHubConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-migrationhub-config/runtimeConfig.native.ts b/clients/client-migrationhub-config/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-migrationhub-config/runtimeConfig.native.ts rename to clients/client-migrationhub-config/src/runtimeConfig.native.ts diff --git a/clients/client-migrationhub-config/runtimeConfig.shared.ts b/clients/client-migrationhub-config/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-migrationhub-config/runtimeConfig.shared.ts rename to clients/client-migrationhub-config/src/runtimeConfig.shared.ts diff --git a/clients/client-migrationhub-config/src/runtimeConfig.ts b/clients/client-migrationhub-config/src/runtimeConfig.ts new file mode 100644 index 000000000000..97025248ac01 --- /dev/null +++ b/clients/client-migrationhub-config/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MigrationHubConfigClientConfig } from "./MigrationHubConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-migrationhub-config/tsconfig.es.json b/clients/client-migrationhub-config/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-migrationhub-config/tsconfig.es.json +++ b/clients/client-migrationhub-config/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-migrationhub-config/tsconfig.json b/clients/client-migrationhub-config/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-migrationhub-config/tsconfig.json +++ b/clients/client-migrationhub-config/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-migrationhub-config/tsconfig.types.json b/clients/client-migrationhub-config/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-migrationhub-config/tsconfig.types.json +++ b/clients/client-migrationhub-config/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mobile/.gitignore b/clients/client-mobile/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mobile/.gitignore +++ b/clients/client-mobile/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mobile/package.json b/clients/client-mobile/package.json index 181adbee248c..a847ce6deb4c 100644 --- a/clients/client-mobile/package.json +++ b/clients/client-mobile/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mobile", "repository": { "type": "git", diff --git a/clients/client-mobile/runtimeConfig.browser.ts b/clients/client-mobile/runtimeConfig.browser.ts deleted file mode 100644 index 7437279d54e5..000000000000 --- a/clients/client-mobile/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MobileClientConfig } from "./MobileClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MobileClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mobile/runtimeConfig.ts b/clients/client-mobile/runtimeConfig.ts deleted file mode 100644 index 1aabc84ccbed..000000000000 --- a/clients/client-mobile/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MobileClientConfig } from "./MobileClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MobileClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mobile/Mobile.ts b/clients/client-mobile/src/Mobile.ts similarity index 100% rename from clients/client-mobile/Mobile.ts rename to clients/client-mobile/src/Mobile.ts diff --git a/clients/client-mobile/MobileClient.ts b/clients/client-mobile/src/MobileClient.ts similarity index 100% rename from clients/client-mobile/MobileClient.ts rename to clients/client-mobile/src/MobileClient.ts diff --git a/clients/client-mobile/commands/CreateProjectCommand.ts b/clients/client-mobile/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-mobile/commands/CreateProjectCommand.ts rename to clients/client-mobile/src/commands/CreateProjectCommand.ts diff --git a/clients/client-mobile/commands/DeleteProjectCommand.ts b/clients/client-mobile/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-mobile/commands/DeleteProjectCommand.ts rename to clients/client-mobile/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-mobile/commands/DescribeBundleCommand.ts b/clients/client-mobile/src/commands/DescribeBundleCommand.ts similarity index 100% rename from clients/client-mobile/commands/DescribeBundleCommand.ts rename to clients/client-mobile/src/commands/DescribeBundleCommand.ts diff --git a/clients/client-mobile/commands/DescribeProjectCommand.ts b/clients/client-mobile/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-mobile/commands/DescribeProjectCommand.ts rename to clients/client-mobile/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-mobile/commands/ExportBundleCommand.ts b/clients/client-mobile/src/commands/ExportBundleCommand.ts similarity index 100% rename from clients/client-mobile/commands/ExportBundleCommand.ts rename to clients/client-mobile/src/commands/ExportBundleCommand.ts diff --git a/clients/client-mobile/commands/ExportProjectCommand.ts b/clients/client-mobile/src/commands/ExportProjectCommand.ts similarity index 100% rename from clients/client-mobile/commands/ExportProjectCommand.ts rename to clients/client-mobile/src/commands/ExportProjectCommand.ts diff --git a/clients/client-mobile/commands/ListBundlesCommand.ts b/clients/client-mobile/src/commands/ListBundlesCommand.ts similarity index 100% rename from clients/client-mobile/commands/ListBundlesCommand.ts rename to clients/client-mobile/src/commands/ListBundlesCommand.ts diff --git a/clients/client-mobile/commands/ListProjectsCommand.ts b/clients/client-mobile/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-mobile/commands/ListProjectsCommand.ts rename to clients/client-mobile/src/commands/ListProjectsCommand.ts diff --git a/clients/client-mobile/commands/UpdateProjectCommand.ts b/clients/client-mobile/src/commands/UpdateProjectCommand.ts similarity index 100% rename from clients/client-mobile/commands/UpdateProjectCommand.ts rename to clients/client-mobile/src/commands/UpdateProjectCommand.ts diff --git a/clients/client-mobile/endpoints.ts b/clients/client-mobile/src/endpoints.ts similarity index 100% rename from clients/client-mobile/endpoints.ts rename to clients/client-mobile/src/endpoints.ts diff --git a/clients/client-mobile/index.ts b/clients/client-mobile/src/index.ts similarity index 100% rename from clients/client-mobile/index.ts rename to clients/client-mobile/src/index.ts diff --git a/clients/client-mobile/models/index.ts b/clients/client-mobile/src/models/index.ts similarity index 100% rename from clients/client-mobile/models/index.ts rename to clients/client-mobile/src/models/index.ts diff --git a/clients/client-mobile/models/models_0.ts b/clients/client-mobile/src/models/models_0.ts similarity index 100% rename from clients/client-mobile/models/models_0.ts rename to clients/client-mobile/src/models/models_0.ts diff --git a/clients/client-mobile/pagination/Interfaces.ts b/clients/client-mobile/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mobile/pagination/Interfaces.ts rename to clients/client-mobile/src/pagination/Interfaces.ts diff --git a/clients/client-mobile/pagination/ListBundlesPaginator.ts b/clients/client-mobile/src/pagination/ListBundlesPaginator.ts similarity index 100% rename from clients/client-mobile/pagination/ListBundlesPaginator.ts rename to clients/client-mobile/src/pagination/ListBundlesPaginator.ts diff --git a/clients/client-mobile/pagination/ListProjectsPaginator.ts b/clients/client-mobile/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-mobile/pagination/ListProjectsPaginator.ts rename to clients/client-mobile/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-mobile/protocols/Aws_restJson1.ts b/clients/client-mobile/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mobile/protocols/Aws_restJson1.ts rename to clients/client-mobile/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mobile/src/runtimeConfig.browser.ts b/clients/client-mobile/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..63aa166cda36 --- /dev/null +++ b/clients/client-mobile/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MobileClientConfig } from "./MobileClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MobileClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mobile/runtimeConfig.native.ts b/clients/client-mobile/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mobile/runtimeConfig.native.ts rename to clients/client-mobile/src/runtimeConfig.native.ts diff --git a/clients/client-mobile/runtimeConfig.shared.ts b/clients/client-mobile/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mobile/runtimeConfig.shared.ts rename to clients/client-mobile/src/runtimeConfig.shared.ts diff --git a/clients/client-mobile/src/runtimeConfig.ts b/clients/client-mobile/src/runtimeConfig.ts new file mode 100644 index 000000000000..5c7b461cd750 --- /dev/null +++ b/clients/client-mobile/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MobileClientConfig } from "./MobileClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MobileClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mobile/tsconfig.es.json b/clients/client-mobile/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mobile/tsconfig.es.json +++ b/clients/client-mobile/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mobile/tsconfig.json b/clients/client-mobile/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mobile/tsconfig.json +++ b/clients/client-mobile/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mobile/tsconfig.types.json b/clients/client-mobile/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mobile/tsconfig.types.json +++ b/clients/client-mobile/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mq/.gitignore b/clients/client-mq/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mq/.gitignore +++ b/clients/client-mq/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mq/package.json b/clients/client-mq/package.json index 3d660f6417c5..a97c9e78f8f4 100644 --- a/clients/client-mq/package.json +++ b/clients/client-mq/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mq", "repository": { "type": "git", diff --git a/clients/client-mq/runtimeConfig.browser.ts b/clients/client-mq/runtimeConfig.browser.ts deleted file mode 100644 index 4340798f14ba..000000000000 --- a/clients/client-mq/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MqClientConfig } from "./MqClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MqClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mq/runtimeConfig.ts b/clients/client-mq/runtimeConfig.ts deleted file mode 100644 index 9179e936760d..000000000000 --- a/clients/client-mq/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MqClientConfig } from "./MqClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MqClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mq/Mq.ts b/clients/client-mq/src/Mq.ts similarity index 100% rename from clients/client-mq/Mq.ts rename to clients/client-mq/src/Mq.ts diff --git a/clients/client-mq/MqClient.ts b/clients/client-mq/src/MqClient.ts similarity index 100% rename from clients/client-mq/MqClient.ts rename to clients/client-mq/src/MqClient.ts diff --git a/clients/client-mq/commands/CreateBrokerCommand.ts b/clients/client-mq/src/commands/CreateBrokerCommand.ts similarity index 100% rename from clients/client-mq/commands/CreateBrokerCommand.ts rename to clients/client-mq/src/commands/CreateBrokerCommand.ts diff --git a/clients/client-mq/commands/CreateConfigurationCommand.ts b/clients/client-mq/src/commands/CreateConfigurationCommand.ts similarity index 100% rename from clients/client-mq/commands/CreateConfigurationCommand.ts rename to clients/client-mq/src/commands/CreateConfigurationCommand.ts diff --git a/clients/client-mq/commands/CreateTagsCommand.ts b/clients/client-mq/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-mq/commands/CreateTagsCommand.ts rename to clients/client-mq/src/commands/CreateTagsCommand.ts diff --git a/clients/client-mq/commands/CreateUserCommand.ts b/clients/client-mq/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-mq/commands/CreateUserCommand.ts rename to clients/client-mq/src/commands/CreateUserCommand.ts diff --git a/clients/client-mq/commands/DeleteBrokerCommand.ts b/clients/client-mq/src/commands/DeleteBrokerCommand.ts similarity index 100% rename from clients/client-mq/commands/DeleteBrokerCommand.ts rename to clients/client-mq/src/commands/DeleteBrokerCommand.ts diff --git a/clients/client-mq/commands/DeleteTagsCommand.ts b/clients/client-mq/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-mq/commands/DeleteTagsCommand.ts rename to clients/client-mq/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-mq/commands/DeleteUserCommand.ts b/clients/client-mq/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-mq/commands/DeleteUserCommand.ts rename to clients/client-mq/src/commands/DeleteUserCommand.ts diff --git a/clients/client-mq/commands/DescribeBrokerCommand.ts b/clients/client-mq/src/commands/DescribeBrokerCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeBrokerCommand.ts rename to clients/client-mq/src/commands/DescribeBrokerCommand.ts diff --git a/clients/client-mq/commands/DescribeBrokerEngineTypesCommand.ts b/clients/client-mq/src/commands/DescribeBrokerEngineTypesCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeBrokerEngineTypesCommand.ts rename to clients/client-mq/src/commands/DescribeBrokerEngineTypesCommand.ts diff --git a/clients/client-mq/commands/DescribeBrokerInstanceOptionsCommand.ts b/clients/client-mq/src/commands/DescribeBrokerInstanceOptionsCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeBrokerInstanceOptionsCommand.ts rename to clients/client-mq/src/commands/DescribeBrokerInstanceOptionsCommand.ts diff --git a/clients/client-mq/commands/DescribeConfigurationCommand.ts b/clients/client-mq/src/commands/DescribeConfigurationCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeConfigurationCommand.ts rename to clients/client-mq/src/commands/DescribeConfigurationCommand.ts diff --git a/clients/client-mq/commands/DescribeConfigurationRevisionCommand.ts b/clients/client-mq/src/commands/DescribeConfigurationRevisionCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeConfigurationRevisionCommand.ts rename to clients/client-mq/src/commands/DescribeConfigurationRevisionCommand.ts diff --git a/clients/client-mq/commands/DescribeUserCommand.ts b/clients/client-mq/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-mq/commands/DescribeUserCommand.ts rename to clients/client-mq/src/commands/DescribeUserCommand.ts diff --git a/clients/client-mq/commands/ListBrokersCommand.ts b/clients/client-mq/src/commands/ListBrokersCommand.ts similarity index 100% rename from clients/client-mq/commands/ListBrokersCommand.ts rename to clients/client-mq/src/commands/ListBrokersCommand.ts diff --git a/clients/client-mq/commands/ListConfigurationRevisionsCommand.ts b/clients/client-mq/src/commands/ListConfigurationRevisionsCommand.ts similarity index 100% rename from clients/client-mq/commands/ListConfigurationRevisionsCommand.ts rename to clients/client-mq/src/commands/ListConfigurationRevisionsCommand.ts diff --git a/clients/client-mq/commands/ListConfigurationsCommand.ts b/clients/client-mq/src/commands/ListConfigurationsCommand.ts similarity index 100% rename from clients/client-mq/commands/ListConfigurationsCommand.ts rename to clients/client-mq/src/commands/ListConfigurationsCommand.ts diff --git a/clients/client-mq/commands/ListTagsCommand.ts b/clients/client-mq/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-mq/commands/ListTagsCommand.ts rename to clients/client-mq/src/commands/ListTagsCommand.ts diff --git a/clients/client-mq/commands/ListUsersCommand.ts b/clients/client-mq/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-mq/commands/ListUsersCommand.ts rename to clients/client-mq/src/commands/ListUsersCommand.ts diff --git a/clients/client-mq/commands/RebootBrokerCommand.ts b/clients/client-mq/src/commands/RebootBrokerCommand.ts similarity index 100% rename from clients/client-mq/commands/RebootBrokerCommand.ts rename to clients/client-mq/src/commands/RebootBrokerCommand.ts diff --git a/clients/client-mq/commands/UpdateBrokerCommand.ts b/clients/client-mq/src/commands/UpdateBrokerCommand.ts similarity index 100% rename from clients/client-mq/commands/UpdateBrokerCommand.ts rename to clients/client-mq/src/commands/UpdateBrokerCommand.ts diff --git a/clients/client-mq/commands/UpdateConfigurationCommand.ts b/clients/client-mq/src/commands/UpdateConfigurationCommand.ts similarity index 100% rename from clients/client-mq/commands/UpdateConfigurationCommand.ts rename to clients/client-mq/src/commands/UpdateConfigurationCommand.ts diff --git a/clients/client-mq/commands/UpdateUserCommand.ts b/clients/client-mq/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-mq/commands/UpdateUserCommand.ts rename to clients/client-mq/src/commands/UpdateUserCommand.ts diff --git a/clients/client-mq/endpoints.ts b/clients/client-mq/src/endpoints.ts similarity index 100% rename from clients/client-mq/endpoints.ts rename to clients/client-mq/src/endpoints.ts diff --git a/clients/client-mq/index.ts b/clients/client-mq/src/index.ts similarity index 100% rename from clients/client-mq/index.ts rename to clients/client-mq/src/index.ts diff --git a/clients/client-mq/models/index.ts b/clients/client-mq/src/models/index.ts similarity index 100% rename from clients/client-mq/models/index.ts rename to clients/client-mq/src/models/index.ts diff --git a/clients/client-mq/models/models_0.ts b/clients/client-mq/src/models/models_0.ts similarity index 100% rename from clients/client-mq/models/models_0.ts rename to clients/client-mq/src/models/models_0.ts diff --git a/clients/client-mq/pagination/Interfaces.ts b/clients/client-mq/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mq/pagination/Interfaces.ts rename to clients/client-mq/src/pagination/Interfaces.ts diff --git a/clients/client-mq/pagination/ListBrokersPaginator.ts b/clients/client-mq/src/pagination/ListBrokersPaginator.ts similarity index 100% rename from clients/client-mq/pagination/ListBrokersPaginator.ts rename to clients/client-mq/src/pagination/ListBrokersPaginator.ts diff --git a/clients/client-mq/protocols/Aws_restJson1.ts b/clients/client-mq/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mq/protocols/Aws_restJson1.ts rename to clients/client-mq/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mq/src/runtimeConfig.browser.ts b/clients/client-mq/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6f9bf439302c --- /dev/null +++ b/clients/client-mq/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MqClientConfig } from "./MqClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MqClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mq/runtimeConfig.native.ts b/clients/client-mq/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mq/runtimeConfig.native.ts rename to clients/client-mq/src/runtimeConfig.native.ts diff --git a/clients/client-mq/runtimeConfig.shared.ts b/clients/client-mq/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mq/runtimeConfig.shared.ts rename to clients/client-mq/src/runtimeConfig.shared.ts diff --git a/clients/client-mq/src/runtimeConfig.ts b/clients/client-mq/src/runtimeConfig.ts new file mode 100644 index 000000000000..80489f5bc944 --- /dev/null +++ b/clients/client-mq/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MqClientConfig } from "./MqClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MqClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mq/tsconfig.es.json b/clients/client-mq/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mq/tsconfig.es.json +++ b/clients/client-mq/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mq/tsconfig.json b/clients/client-mq/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mq/tsconfig.json +++ b/clients/client-mq/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mq/tsconfig.types.json b/clients/client-mq/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mq/tsconfig.types.json +++ b/clients/client-mq/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mturk/.gitignore b/clients/client-mturk/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-mturk/.gitignore +++ b/clients/client-mturk/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mturk/package.json b/clients/client-mturk/package.json index b35497c7fe01..8065f22f1549 100644 --- a/clients/client-mturk/package.json +++ b/clients/client-mturk/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mturk", "repository": { "type": "git", diff --git a/clients/client-mturk/runtimeConfig.browser.ts b/clients/client-mturk/runtimeConfig.browser.ts deleted file mode 100644 index 824982bc8aff..000000000000 --- a/clients/client-mturk/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MTurkClientConfig } from "./MTurkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MTurkClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mturk/runtimeConfig.ts b/clients/client-mturk/runtimeConfig.ts deleted file mode 100644 index e022ee30c899..000000000000 --- a/clients/client-mturk/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MTurkClientConfig } from "./MTurkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MTurkClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mturk/MTurk.ts b/clients/client-mturk/src/MTurk.ts similarity index 100% rename from clients/client-mturk/MTurk.ts rename to clients/client-mturk/src/MTurk.ts diff --git a/clients/client-mturk/MTurkClient.ts b/clients/client-mturk/src/MTurkClient.ts similarity index 100% rename from clients/client-mturk/MTurkClient.ts rename to clients/client-mturk/src/MTurkClient.ts diff --git a/clients/client-mturk/commands/AcceptQualificationRequestCommand.ts b/clients/client-mturk/src/commands/AcceptQualificationRequestCommand.ts similarity index 100% rename from clients/client-mturk/commands/AcceptQualificationRequestCommand.ts rename to clients/client-mturk/src/commands/AcceptQualificationRequestCommand.ts diff --git a/clients/client-mturk/commands/ApproveAssignmentCommand.ts b/clients/client-mturk/src/commands/ApproveAssignmentCommand.ts similarity index 100% rename from clients/client-mturk/commands/ApproveAssignmentCommand.ts rename to clients/client-mturk/src/commands/ApproveAssignmentCommand.ts diff --git a/clients/client-mturk/commands/AssociateQualificationWithWorkerCommand.ts b/clients/client-mturk/src/commands/AssociateQualificationWithWorkerCommand.ts similarity index 100% rename from clients/client-mturk/commands/AssociateQualificationWithWorkerCommand.ts rename to clients/client-mturk/src/commands/AssociateQualificationWithWorkerCommand.ts diff --git a/clients/client-mturk/commands/CreateAdditionalAssignmentsForHITCommand.ts b/clients/client-mturk/src/commands/CreateAdditionalAssignmentsForHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateAdditionalAssignmentsForHITCommand.ts rename to clients/client-mturk/src/commands/CreateAdditionalAssignmentsForHITCommand.ts diff --git a/clients/client-mturk/commands/CreateHITCommand.ts b/clients/client-mturk/src/commands/CreateHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateHITCommand.ts rename to clients/client-mturk/src/commands/CreateHITCommand.ts diff --git a/clients/client-mturk/commands/CreateHITTypeCommand.ts b/clients/client-mturk/src/commands/CreateHITTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateHITTypeCommand.ts rename to clients/client-mturk/src/commands/CreateHITTypeCommand.ts diff --git a/clients/client-mturk/commands/CreateHITWithHITTypeCommand.ts b/clients/client-mturk/src/commands/CreateHITWithHITTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateHITWithHITTypeCommand.ts rename to clients/client-mturk/src/commands/CreateHITWithHITTypeCommand.ts diff --git a/clients/client-mturk/commands/CreateQualificationTypeCommand.ts b/clients/client-mturk/src/commands/CreateQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/CreateQualificationTypeCommand.ts diff --git a/clients/client-mturk/commands/CreateWorkerBlockCommand.ts b/clients/client-mturk/src/commands/CreateWorkerBlockCommand.ts similarity index 100% rename from clients/client-mturk/commands/CreateWorkerBlockCommand.ts rename to clients/client-mturk/src/commands/CreateWorkerBlockCommand.ts diff --git a/clients/client-mturk/commands/DeleteHITCommand.ts b/clients/client-mturk/src/commands/DeleteHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/DeleteHITCommand.ts rename to clients/client-mturk/src/commands/DeleteHITCommand.ts diff --git a/clients/client-mturk/commands/DeleteQualificationTypeCommand.ts b/clients/client-mturk/src/commands/DeleteQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/DeleteQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/DeleteQualificationTypeCommand.ts diff --git a/clients/client-mturk/commands/DeleteWorkerBlockCommand.ts b/clients/client-mturk/src/commands/DeleteWorkerBlockCommand.ts similarity index 100% rename from clients/client-mturk/commands/DeleteWorkerBlockCommand.ts rename to clients/client-mturk/src/commands/DeleteWorkerBlockCommand.ts diff --git a/clients/client-mturk/commands/DisassociateQualificationFromWorkerCommand.ts b/clients/client-mturk/src/commands/DisassociateQualificationFromWorkerCommand.ts similarity index 100% rename from clients/client-mturk/commands/DisassociateQualificationFromWorkerCommand.ts rename to clients/client-mturk/src/commands/DisassociateQualificationFromWorkerCommand.ts diff --git a/clients/client-mturk/commands/GetAccountBalanceCommand.ts b/clients/client-mturk/src/commands/GetAccountBalanceCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetAccountBalanceCommand.ts rename to clients/client-mturk/src/commands/GetAccountBalanceCommand.ts diff --git a/clients/client-mturk/commands/GetAssignmentCommand.ts b/clients/client-mturk/src/commands/GetAssignmentCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetAssignmentCommand.ts rename to clients/client-mturk/src/commands/GetAssignmentCommand.ts diff --git a/clients/client-mturk/commands/GetFileUploadURLCommand.ts b/clients/client-mturk/src/commands/GetFileUploadURLCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetFileUploadURLCommand.ts rename to clients/client-mturk/src/commands/GetFileUploadURLCommand.ts diff --git a/clients/client-mturk/commands/GetHITCommand.ts b/clients/client-mturk/src/commands/GetHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetHITCommand.ts rename to clients/client-mturk/src/commands/GetHITCommand.ts diff --git a/clients/client-mturk/commands/GetQualificationScoreCommand.ts b/clients/client-mturk/src/commands/GetQualificationScoreCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetQualificationScoreCommand.ts rename to clients/client-mturk/src/commands/GetQualificationScoreCommand.ts diff --git a/clients/client-mturk/commands/GetQualificationTypeCommand.ts b/clients/client-mturk/src/commands/GetQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/GetQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/GetQualificationTypeCommand.ts diff --git a/clients/client-mturk/commands/ListAssignmentsForHITCommand.ts b/clients/client-mturk/src/commands/ListAssignmentsForHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListAssignmentsForHITCommand.ts rename to clients/client-mturk/src/commands/ListAssignmentsForHITCommand.ts diff --git a/clients/client-mturk/commands/ListBonusPaymentsCommand.ts b/clients/client-mturk/src/commands/ListBonusPaymentsCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListBonusPaymentsCommand.ts rename to clients/client-mturk/src/commands/ListBonusPaymentsCommand.ts diff --git a/clients/client-mturk/commands/ListHITsCommand.ts b/clients/client-mturk/src/commands/ListHITsCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListHITsCommand.ts rename to clients/client-mturk/src/commands/ListHITsCommand.ts diff --git a/clients/client-mturk/commands/ListHITsForQualificationTypeCommand.ts b/clients/client-mturk/src/commands/ListHITsForQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListHITsForQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/ListHITsForQualificationTypeCommand.ts diff --git a/clients/client-mturk/commands/ListQualificationRequestsCommand.ts b/clients/client-mturk/src/commands/ListQualificationRequestsCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListQualificationRequestsCommand.ts rename to clients/client-mturk/src/commands/ListQualificationRequestsCommand.ts diff --git a/clients/client-mturk/commands/ListQualificationTypesCommand.ts b/clients/client-mturk/src/commands/ListQualificationTypesCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListQualificationTypesCommand.ts rename to clients/client-mturk/src/commands/ListQualificationTypesCommand.ts diff --git a/clients/client-mturk/commands/ListReviewPolicyResultsForHITCommand.ts b/clients/client-mturk/src/commands/ListReviewPolicyResultsForHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListReviewPolicyResultsForHITCommand.ts rename to clients/client-mturk/src/commands/ListReviewPolicyResultsForHITCommand.ts diff --git a/clients/client-mturk/commands/ListReviewableHITsCommand.ts b/clients/client-mturk/src/commands/ListReviewableHITsCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListReviewableHITsCommand.ts rename to clients/client-mturk/src/commands/ListReviewableHITsCommand.ts diff --git a/clients/client-mturk/commands/ListWorkerBlocksCommand.ts b/clients/client-mturk/src/commands/ListWorkerBlocksCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListWorkerBlocksCommand.ts rename to clients/client-mturk/src/commands/ListWorkerBlocksCommand.ts diff --git a/clients/client-mturk/commands/ListWorkersWithQualificationTypeCommand.ts b/clients/client-mturk/src/commands/ListWorkersWithQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/ListWorkersWithQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/ListWorkersWithQualificationTypeCommand.ts diff --git a/clients/client-mturk/commands/NotifyWorkersCommand.ts b/clients/client-mturk/src/commands/NotifyWorkersCommand.ts similarity index 100% rename from clients/client-mturk/commands/NotifyWorkersCommand.ts rename to clients/client-mturk/src/commands/NotifyWorkersCommand.ts diff --git a/clients/client-mturk/commands/RejectAssignmentCommand.ts b/clients/client-mturk/src/commands/RejectAssignmentCommand.ts similarity index 100% rename from clients/client-mturk/commands/RejectAssignmentCommand.ts rename to clients/client-mturk/src/commands/RejectAssignmentCommand.ts diff --git a/clients/client-mturk/commands/RejectQualificationRequestCommand.ts b/clients/client-mturk/src/commands/RejectQualificationRequestCommand.ts similarity index 100% rename from clients/client-mturk/commands/RejectQualificationRequestCommand.ts rename to clients/client-mturk/src/commands/RejectQualificationRequestCommand.ts diff --git a/clients/client-mturk/commands/SendBonusCommand.ts b/clients/client-mturk/src/commands/SendBonusCommand.ts similarity index 100% rename from clients/client-mturk/commands/SendBonusCommand.ts rename to clients/client-mturk/src/commands/SendBonusCommand.ts diff --git a/clients/client-mturk/commands/SendTestEventNotificationCommand.ts b/clients/client-mturk/src/commands/SendTestEventNotificationCommand.ts similarity index 100% rename from clients/client-mturk/commands/SendTestEventNotificationCommand.ts rename to clients/client-mturk/src/commands/SendTestEventNotificationCommand.ts diff --git a/clients/client-mturk/commands/UpdateExpirationForHITCommand.ts b/clients/client-mturk/src/commands/UpdateExpirationForHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/UpdateExpirationForHITCommand.ts rename to clients/client-mturk/src/commands/UpdateExpirationForHITCommand.ts diff --git a/clients/client-mturk/commands/UpdateHITReviewStatusCommand.ts b/clients/client-mturk/src/commands/UpdateHITReviewStatusCommand.ts similarity index 100% rename from clients/client-mturk/commands/UpdateHITReviewStatusCommand.ts rename to clients/client-mturk/src/commands/UpdateHITReviewStatusCommand.ts diff --git a/clients/client-mturk/commands/UpdateHITTypeOfHITCommand.ts b/clients/client-mturk/src/commands/UpdateHITTypeOfHITCommand.ts similarity index 100% rename from clients/client-mturk/commands/UpdateHITTypeOfHITCommand.ts rename to clients/client-mturk/src/commands/UpdateHITTypeOfHITCommand.ts diff --git a/clients/client-mturk/commands/UpdateNotificationSettingsCommand.ts b/clients/client-mturk/src/commands/UpdateNotificationSettingsCommand.ts similarity index 100% rename from clients/client-mturk/commands/UpdateNotificationSettingsCommand.ts rename to clients/client-mturk/src/commands/UpdateNotificationSettingsCommand.ts diff --git a/clients/client-mturk/commands/UpdateQualificationTypeCommand.ts b/clients/client-mturk/src/commands/UpdateQualificationTypeCommand.ts similarity index 100% rename from clients/client-mturk/commands/UpdateQualificationTypeCommand.ts rename to clients/client-mturk/src/commands/UpdateQualificationTypeCommand.ts diff --git a/clients/client-mturk/endpoints.ts b/clients/client-mturk/src/endpoints.ts similarity index 100% rename from clients/client-mturk/endpoints.ts rename to clients/client-mturk/src/endpoints.ts diff --git a/clients/client-mturk/index.ts b/clients/client-mturk/src/index.ts similarity index 100% rename from clients/client-mturk/index.ts rename to clients/client-mturk/src/index.ts diff --git a/clients/client-mturk/models/index.ts b/clients/client-mturk/src/models/index.ts similarity index 100% rename from clients/client-mturk/models/index.ts rename to clients/client-mturk/src/models/index.ts diff --git a/clients/client-mturk/models/models_0.ts b/clients/client-mturk/src/models/models_0.ts similarity index 100% rename from clients/client-mturk/models/models_0.ts rename to clients/client-mturk/src/models/models_0.ts diff --git a/clients/client-mturk/pagination/Interfaces.ts b/clients/client-mturk/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mturk/pagination/Interfaces.ts rename to clients/client-mturk/src/pagination/Interfaces.ts diff --git a/clients/client-mturk/pagination/ListAssignmentsForHITPaginator.ts b/clients/client-mturk/src/pagination/ListAssignmentsForHITPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListAssignmentsForHITPaginator.ts rename to clients/client-mturk/src/pagination/ListAssignmentsForHITPaginator.ts diff --git a/clients/client-mturk/pagination/ListBonusPaymentsPaginator.ts b/clients/client-mturk/src/pagination/ListBonusPaymentsPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListBonusPaymentsPaginator.ts rename to clients/client-mturk/src/pagination/ListBonusPaymentsPaginator.ts diff --git a/clients/client-mturk/pagination/ListHITsForQualificationTypePaginator.ts b/clients/client-mturk/src/pagination/ListHITsForQualificationTypePaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListHITsForQualificationTypePaginator.ts rename to clients/client-mturk/src/pagination/ListHITsForQualificationTypePaginator.ts diff --git a/clients/client-mturk/pagination/ListHITsPaginator.ts b/clients/client-mturk/src/pagination/ListHITsPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListHITsPaginator.ts rename to clients/client-mturk/src/pagination/ListHITsPaginator.ts diff --git a/clients/client-mturk/pagination/ListQualificationRequestsPaginator.ts b/clients/client-mturk/src/pagination/ListQualificationRequestsPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListQualificationRequestsPaginator.ts rename to clients/client-mturk/src/pagination/ListQualificationRequestsPaginator.ts diff --git a/clients/client-mturk/pagination/ListQualificationTypesPaginator.ts b/clients/client-mturk/src/pagination/ListQualificationTypesPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListQualificationTypesPaginator.ts rename to clients/client-mturk/src/pagination/ListQualificationTypesPaginator.ts diff --git a/clients/client-mturk/pagination/ListReviewPolicyResultsForHITPaginator.ts b/clients/client-mturk/src/pagination/ListReviewPolicyResultsForHITPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListReviewPolicyResultsForHITPaginator.ts rename to clients/client-mturk/src/pagination/ListReviewPolicyResultsForHITPaginator.ts diff --git a/clients/client-mturk/pagination/ListReviewableHITsPaginator.ts b/clients/client-mturk/src/pagination/ListReviewableHITsPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListReviewableHITsPaginator.ts rename to clients/client-mturk/src/pagination/ListReviewableHITsPaginator.ts diff --git a/clients/client-mturk/pagination/ListWorkerBlocksPaginator.ts b/clients/client-mturk/src/pagination/ListWorkerBlocksPaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListWorkerBlocksPaginator.ts rename to clients/client-mturk/src/pagination/ListWorkerBlocksPaginator.ts diff --git a/clients/client-mturk/pagination/ListWorkersWithQualificationTypePaginator.ts b/clients/client-mturk/src/pagination/ListWorkersWithQualificationTypePaginator.ts similarity index 100% rename from clients/client-mturk/pagination/ListWorkersWithQualificationTypePaginator.ts rename to clients/client-mturk/src/pagination/ListWorkersWithQualificationTypePaginator.ts diff --git a/clients/client-mturk/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-mturk/protocols/Aws_json1_1.ts rename to clients/client-mturk/src/protocols/Aws_json1_1.ts diff --git a/clients/client-mturk/src/runtimeConfig.browser.ts b/clients/client-mturk/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fa4e8bc78e44 --- /dev/null +++ b/clients/client-mturk/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MTurkClientConfig } from "./MTurkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MTurkClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mturk/runtimeConfig.native.ts b/clients/client-mturk/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mturk/runtimeConfig.native.ts rename to clients/client-mturk/src/runtimeConfig.native.ts diff --git a/clients/client-mturk/runtimeConfig.shared.ts b/clients/client-mturk/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mturk/runtimeConfig.shared.ts rename to clients/client-mturk/src/runtimeConfig.shared.ts diff --git a/clients/client-mturk/src/runtimeConfig.ts b/clients/client-mturk/src/runtimeConfig.ts new file mode 100644 index 000000000000..145102886025 --- /dev/null +++ b/clients/client-mturk/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MTurkClientConfig } from "./MTurkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MTurkClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mturk/tsconfig.es.json b/clients/client-mturk/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mturk/tsconfig.es.json +++ b/clients/client-mturk/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mturk/tsconfig.json b/clients/client-mturk/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mturk/tsconfig.json +++ b/clients/client-mturk/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mturk/tsconfig.types.json b/clients/client-mturk/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mturk/tsconfig.types.json +++ b/clients/client-mturk/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-mwaa/.gitignore b/clients/client-mwaa/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-mwaa/.gitignore +++ b/clients/client-mwaa/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-mwaa/package.json b/clients/client-mwaa/package.json index a27d54d21641..95394caf155d 100644 --- a/clients/client-mwaa/package.json +++ b/clients/client-mwaa/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-mwaa", "repository": { "type": "git", diff --git a/clients/client-mwaa/runtimeConfig.browser.ts b/clients/client-mwaa/runtimeConfig.browser.ts deleted file mode 100644 index a33dff82709a..000000000000 --- a/clients/client-mwaa/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { MWAAClientConfig } from "./MWAAClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MWAAClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mwaa/runtimeConfig.ts b/clients/client-mwaa/runtimeConfig.ts deleted file mode 100644 index 20bcd98add32..000000000000 --- a/clients/client-mwaa/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { MWAAClientConfig } from "./MWAAClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: MWAAClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-mwaa/MWAA.ts b/clients/client-mwaa/src/MWAA.ts similarity index 100% rename from clients/client-mwaa/MWAA.ts rename to clients/client-mwaa/src/MWAA.ts diff --git a/clients/client-mwaa/MWAAClient.ts b/clients/client-mwaa/src/MWAAClient.ts similarity index 100% rename from clients/client-mwaa/MWAAClient.ts rename to clients/client-mwaa/src/MWAAClient.ts diff --git a/clients/client-mwaa/commands/CreateCliTokenCommand.ts b/clients/client-mwaa/src/commands/CreateCliTokenCommand.ts similarity index 100% rename from clients/client-mwaa/commands/CreateCliTokenCommand.ts rename to clients/client-mwaa/src/commands/CreateCliTokenCommand.ts diff --git a/clients/client-mwaa/commands/CreateEnvironmentCommand.ts b/clients/client-mwaa/src/commands/CreateEnvironmentCommand.ts similarity index 100% rename from clients/client-mwaa/commands/CreateEnvironmentCommand.ts rename to clients/client-mwaa/src/commands/CreateEnvironmentCommand.ts diff --git a/clients/client-mwaa/commands/CreateWebLoginTokenCommand.ts b/clients/client-mwaa/src/commands/CreateWebLoginTokenCommand.ts similarity index 100% rename from clients/client-mwaa/commands/CreateWebLoginTokenCommand.ts rename to clients/client-mwaa/src/commands/CreateWebLoginTokenCommand.ts diff --git a/clients/client-mwaa/commands/DeleteEnvironmentCommand.ts b/clients/client-mwaa/src/commands/DeleteEnvironmentCommand.ts similarity index 100% rename from clients/client-mwaa/commands/DeleteEnvironmentCommand.ts rename to clients/client-mwaa/src/commands/DeleteEnvironmentCommand.ts diff --git a/clients/client-mwaa/commands/GetEnvironmentCommand.ts b/clients/client-mwaa/src/commands/GetEnvironmentCommand.ts similarity index 100% rename from clients/client-mwaa/commands/GetEnvironmentCommand.ts rename to clients/client-mwaa/src/commands/GetEnvironmentCommand.ts diff --git a/clients/client-mwaa/commands/ListEnvironmentsCommand.ts b/clients/client-mwaa/src/commands/ListEnvironmentsCommand.ts similarity index 100% rename from clients/client-mwaa/commands/ListEnvironmentsCommand.ts rename to clients/client-mwaa/src/commands/ListEnvironmentsCommand.ts diff --git a/clients/client-mwaa/commands/ListTagsForResourceCommand.ts b/clients/client-mwaa/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-mwaa/commands/ListTagsForResourceCommand.ts rename to clients/client-mwaa/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-mwaa/commands/PublishMetricsCommand.ts b/clients/client-mwaa/src/commands/PublishMetricsCommand.ts similarity index 100% rename from clients/client-mwaa/commands/PublishMetricsCommand.ts rename to clients/client-mwaa/src/commands/PublishMetricsCommand.ts diff --git a/clients/client-mwaa/commands/TagResourceCommand.ts b/clients/client-mwaa/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-mwaa/commands/TagResourceCommand.ts rename to clients/client-mwaa/src/commands/TagResourceCommand.ts diff --git a/clients/client-mwaa/commands/UntagResourceCommand.ts b/clients/client-mwaa/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-mwaa/commands/UntagResourceCommand.ts rename to clients/client-mwaa/src/commands/UntagResourceCommand.ts diff --git a/clients/client-mwaa/commands/UpdateEnvironmentCommand.ts b/clients/client-mwaa/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-mwaa/commands/UpdateEnvironmentCommand.ts rename to clients/client-mwaa/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-mwaa/endpoints.ts b/clients/client-mwaa/src/endpoints.ts similarity index 100% rename from clients/client-mwaa/endpoints.ts rename to clients/client-mwaa/src/endpoints.ts diff --git a/clients/client-mwaa/index.ts b/clients/client-mwaa/src/index.ts similarity index 100% rename from clients/client-mwaa/index.ts rename to clients/client-mwaa/src/index.ts diff --git a/clients/client-mwaa/models/index.ts b/clients/client-mwaa/src/models/index.ts similarity index 100% rename from clients/client-mwaa/models/index.ts rename to clients/client-mwaa/src/models/index.ts diff --git a/clients/client-mwaa/models/models_0.ts b/clients/client-mwaa/src/models/models_0.ts similarity index 100% rename from clients/client-mwaa/models/models_0.ts rename to clients/client-mwaa/src/models/models_0.ts diff --git a/clients/client-mwaa/pagination/Interfaces.ts b/clients/client-mwaa/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-mwaa/pagination/Interfaces.ts rename to clients/client-mwaa/src/pagination/Interfaces.ts diff --git a/clients/client-mwaa/pagination/ListEnvironmentsPaginator.ts b/clients/client-mwaa/src/pagination/ListEnvironmentsPaginator.ts similarity index 100% rename from clients/client-mwaa/pagination/ListEnvironmentsPaginator.ts rename to clients/client-mwaa/src/pagination/ListEnvironmentsPaginator.ts diff --git a/clients/client-mwaa/protocols/Aws_restJson1.ts b/clients/client-mwaa/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-mwaa/protocols/Aws_restJson1.ts rename to clients/client-mwaa/src/protocols/Aws_restJson1.ts diff --git a/clients/client-mwaa/src/runtimeConfig.browser.ts b/clients/client-mwaa/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..732d82a9e447 --- /dev/null +++ b/clients/client-mwaa/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { MWAAClientConfig } from "./MWAAClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MWAAClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mwaa/runtimeConfig.native.ts b/clients/client-mwaa/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-mwaa/runtimeConfig.native.ts rename to clients/client-mwaa/src/runtimeConfig.native.ts diff --git a/clients/client-mwaa/runtimeConfig.shared.ts b/clients/client-mwaa/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-mwaa/runtimeConfig.shared.ts rename to clients/client-mwaa/src/runtimeConfig.shared.ts diff --git a/clients/client-mwaa/src/runtimeConfig.ts b/clients/client-mwaa/src/runtimeConfig.ts new file mode 100644 index 000000000000..3d22f35796ae --- /dev/null +++ b/clients/client-mwaa/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { MWAAClientConfig } from "./MWAAClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: MWAAClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-mwaa/tsconfig.es.json b/clients/client-mwaa/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-mwaa/tsconfig.es.json +++ b/clients/client-mwaa/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-mwaa/tsconfig.json b/clients/client-mwaa/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-mwaa/tsconfig.json +++ b/clients/client-mwaa/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-mwaa/tsconfig.types.json b/clients/client-mwaa/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-mwaa/tsconfig.types.json +++ b/clients/client-mwaa/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-neptune/.gitignore b/clients/client-neptune/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-neptune/.gitignore +++ b/clients/client-neptune/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-neptune/package.json b/clients/client-neptune/package.json index 8775490db689..e3414599cb83 100644 --- a/clients/client-neptune/package.json +++ b/clients/client-neptune/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-neptune", "repository": { "type": "git", diff --git a/clients/client-neptune/runtimeConfig.browser.ts b/clients/client-neptune/runtimeConfig.browser.ts deleted file mode 100644 index 0db88a111349..000000000000 --- a/clients/client-neptune/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { NeptuneClientConfig } from "./NeptuneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NeptuneClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-neptune/runtimeConfig.ts b/clients/client-neptune/runtimeConfig.ts deleted file mode 100644 index 384a39955290..000000000000 --- a/clients/client-neptune/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { NeptuneClientConfig } from "./NeptuneClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NeptuneClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-neptune/Neptune.ts b/clients/client-neptune/src/Neptune.ts similarity index 100% rename from clients/client-neptune/Neptune.ts rename to clients/client-neptune/src/Neptune.ts diff --git a/clients/client-neptune/NeptuneClient.ts b/clients/client-neptune/src/NeptuneClient.ts similarity index 100% rename from clients/client-neptune/NeptuneClient.ts rename to clients/client-neptune/src/NeptuneClient.ts diff --git a/clients/client-neptune/commands/AddRoleToDBClusterCommand.ts b/clients/client-neptune/src/commands/AddRoleToDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/AddRoleToDBClusterCommand.ts rename to clients/client-neptune/src/commands/AddRoleToDBClusterCommand.ts diff --git a/clients/client-neptune/commands/AddSourceIdentifierToSubscriptionCommand.ts b/clients/client-neptune/src/commands/AddSourceIdentifierToSubscriptionCommand.ts similarity index 100% rename from clients/client-neptune/commands/AddSourceIdentifierToSubscriptionCommand.ts rename to clients/client-neptune/src/commands/AddSourceIdentifierToSubscriptionCommand.ts diff --git a/clients/client-neptune/commands/AddTagsToResourceCommand.ts b/clients/client-neptune/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-neptune/commands/AddTagsToResourceCommand.ts rename to clients/client-neptune/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-neptune/commands/ApplyPendingMaintenanceActionCommand.ts b/clients/client-neptune/src/commands/ApplyPendingMaintenanceActionCommand.ts similarity index 100% rename from clients/client-neptune/commands/ApplyPendingMaintenanceActionCommand.ts rename to clients/client-neptune/src/commands/ApplyPendingMaintenanceActionCommand.ts diff --git a/clients/client-neptune/commands/CopyDBClusterParameterGroupCommand.ts b/clients/client-neptune/src/commands/CopyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/CopyDBClusterParameterGroupCommand.ts rename to clients/client-neptune/src/commands/CopyDBClusterParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/CopyDBClusterSnapshotCommand.ts b/clients/client-neptune/src/commands/CopyDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-neptune/commands/CopyDBClusterSnapshotCommand.ts rename to clients/client-neptune/src/commands/CopyDBClusterSnapshotCommand.ts diff --git a/clients/client-neptune/commands/CopyDBParameterGroupCommand.ts b/clients/client-neptune/src/commands/CopyDBParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/CopyDBParameterGroupCommand.ts rename to clients/client-neptune/src/commands/CopyDBParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/CreateDBClusterCommand.ts b/clients/client-neptune/src/commands/CreateDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBClusterCommand.ts rename to clients/client-neptune/src/commands/CreateDBClusterCommand.ts diff --git a/clients/client-neptune/commands/CreateDBClusterEndpointCommand.ts b/clients/client-neptune/src/commands/CreateDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBClusterEndpointCommand.ts rename to clients/client-neptune/src/commands/CreateDBClusterEndpointCommand.ts diff --git a/clients/client-neptune/commands/CreateDBClusterParameterGroupCommand.ts b/clients/client-neptune/src/commands/CreateDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBClusterParameterGroupCommand.ts rename to clients/client-neptune/src/commands/CreateDBClusterParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/CreateDBClusterSnapshotCommand.ts b/clients/client-neptune/src/commands/CreateDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBClusterSnapshotCommand.ts rename to clients/client-neptune/src/commands/CreateDBClusterSnapshotCommand.ts diff --git a/clients/client-neptune/commands/CreateDBInstanceCommand.ts b/clients/client-neptune/src/commands/CreateDBInstanceCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBInstanceCommand.ts rename to clients/client-neptune/src/commands/CreateDBInstanceCommand.ts diff --git a/clients/client-neptune/commands/CreateDBParameterGroupCommand.ts b/clients/client-neptune/src/commands/CreateDBParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBParameterGroupCommand.ts rename to clients/client-neptune/src/commands/CreateDBParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/CreateDBSubnetGroupCommand.ts b/clients/client-neptune/src/commands/CreateDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateDBSubnetGroupCommand.ts rename to clients/client-neptune/src/commands/CreateDBSubnetGroupCommand.ts diff --git a/clients/client-neptune/commands/CreateEventSubscriptionCommand.ts b/clients/client-neptune/src/commands/CreateEventSubscriptionCommand.ts similarity index 100% rename from clients/client-neptune/commands/CreateEventSubscriptionCommand.ts rename to clients/client-neptune/src/commands/CreateEventSubscriptionCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBClusterCommand.ts b/clients/client-neptune/src/commands/DeleteDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBClusterCommand.ts rename to clients/client-neptune/src/commands/DeleteDBClusterCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBClusterEndpointCommand.ts b/clients/client-neptune/src/commands/DeleteDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBClusterEndpointCommand.ts rename to clients/client-neptune/src/commands/DeleteDBClusterEndpointCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBClusterParameterGroupCommand.ts b/clients/client-neptune/src/commands/DeleteDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBClusterParameterGroupCommand.ts rename to clients/client-neptune/src/commands/DeleteDBClusterParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBClusterSnapshotCommand.ts b/clients/client-neptune/src/commands/DeleteDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBClusterSnapshotCommand.ts rename to clients/client-neptune/src/commands/DeleteDBClusterSnapshotCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBInstanceCommand.ts b/clients/client-neptune/src/commands/DeleteDBInstanceCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBInstanceCommand.ts rename to clients/client-neptune/src/commands/DeleteDBInstanceCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBParameterGroupCommand.ts b/clients/client-neptune/src/commands/DeleteDBParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBParameterGroupCommand.ts rename to clients/client-neptune/src/commands/DeleteDBParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/DeleteDBSubnetGroupCommand.ts b/clients/client-neptune/src/commands/DeleteDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteDBSubnetGroupCommand.ts rename to clients/client-neptune/src/commands/DeleteDBSubnetGroupCommand.ts diff --git a/clients/client-neptune/commands/DeleteEventSubscriptionCommand.ts b/clients/client-neptune/src/commands/DeleteEventSubscriptionCommand.ts similarity index 100% rename from clients/client-neptune/commands/DeleteEventSubscriptionCommand.ts rename to clients/client-neptune/src/commands/DeleteEventSubscriptionCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClusterEndpointsCommand.ts b/clients/client-neptune/src/commands/DescribeDBClusterEndpointsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClusterEndpointsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClusterEndpointsCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClusterParameterGroupsCommand.ts b/clients/client-neptune/src/commands/DescribeDBClusterParameterGroupsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClusterParameterGroupsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClusterParameterGroupsCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClusterParametersCommand.ts b/clients/client-neptune/src/commands/DescribeDBClusterParametersCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClusterParametersCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClusterParametersCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClusterSnapshotAttributesCommand.ts b/clients/client-neptune/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClusterSnapshotAttributesCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClusterSnapshotsCommand.ts b/clients/client-neptune/src/commands/DescribeDBClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClusterSnapshotsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClusterSnapshotsCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBClustersCommand.ts b/clients/client-neptune/src/commands/DescribeDBClustersCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBClustersCommand.ts rename to clients/client-neptune/src/commands/DescribeDBClustersCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBEngineVersionsCommand.ts b/clients/client-neptune/src/commands/DescribeDBEngineVersionsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBEngineVersionsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBEngineVersionsCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBInstancesCommand.ts b/clients/client-neptune/src/commands/DescribeDBInstancesCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBInstancesCommand.ts rename to clients/client-neptune/src/commands/DescribeDBInstancesCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBParameterGroupsCommand.ts b/clients/client-neptune/src/commands/DescribeDBParameterGroupsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBParameterGroupsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBParameterGroupsCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBParametersCommand.ts b/clients/client-neptune/src/commands/DescribeDBParametersCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBParametersCommand.ts rename to clients/client-neptune/src/commands/DescribeDBParametersCommand.ts diff --git a/clients/client-neptune/commands/DescribeDBSubnetGroupsCommand.ts b/clients/client-neptune/src/commands/DescribeDBSubnetGroupsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeDBSubnetGroupsCommand.ts rename to clients/client-neptune/src/commands/DescribeDBSubnetGroupsCommand.ts diff --git a/clients/client-neptune/commands/DescribeEngineDefaultClusterParametersCommand.ts b/clients/client-neptune/src/commands/DescribeEngineDefaultClusterParametersCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeEngineDefaultClusterParametersCommand.ts rename to clients/client-neptune/src/commands/DescribeEngineDefaultClusterParametersCommand.ts diff --git a/clients/client-neptune/commands/DescribeEngineDefaultParametersCommand.ts b/clients/client-neptune/src/commands/DescribeEngineDefaultParametersCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeEngineDefaultParametersCommand.ts rename to clients/client-neptune/src/commands/DescribeEngineDefaultParametersCommand.ts diff --git a/clients/client-neptune/commands/DescribeEventCategoriesCommand.ts b/clients/client-neptune/src/commands/DescribeEventCategoriesCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeEventCategoriesCommand.ts rename to clients/client-neptune/src/commands/DescribeEventCategoriesCommand.ts diff --git a/clients/client-neptune/commands/DescribeEventSubscriptionsCommand.ts b/clients/client-neptune/src/commands/DescribeEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeEventSubscriptionsCommand.ts rename to clients/client-neptune/src/commands/DescribeEventSubscriptionsCommand.ts diff --git a/clients/client-neptune/commands/DescribeEventsCommand.ts b/clients/client-neptune/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeEventsCommand.ts rename to clients/client-neptune/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-neptune/commands/DescribeOrderableDBInstanceOptionsCommand.ts b/clients/client-neptune/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeOrderableDBInstanceOptionsCommand.ts rename to clients/client-neptune/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts diff --git a/clients/client-neptune/commands/DescribePendingMaintenanceActionsCommand.ts b/clients/client-neptune/src/commands/DescribePendingMaintenanceActionsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribePendingMaintenanceActionsCommand.ts rename to clients/client-neptune/src/commands/DescribePendingMaintenanceActionsCommand.ts diff --git a/clients/client-neptune/commands/DescribeValidDBInstanceModificationsCommand.ts b/clients/client-neptune/src/commands/DescribeValidDBInstanceModificationsCommand.ts similarity index 100% rename from clients/client-neptune/commands/DescribeValidDBInstanceModificationsCommand.ts rename to clients/client-neptune/src/commands/DescribeValidDBInstanceModificationsCommand.ts diff --git a/clients/client-neptune/commands/FailoverDBClusterCommand.ts b/clients/client-neptune/src/commands/FailoverDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/FailoverDBClusterCommand.ts rename to clients/client-neptune/src/commands/FailoverDBClusterCommand.ts diff --git a/clients/client-neptune/commands/ListTagsForResourceCommand.ts b/clients/client-neptune/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-neptune/commands/ListTagsForResourceCommand.ts rename to clients/client-neptune/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBClusterCommand.ts b/clients/client-neptune/src/commands/ModifyDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBClusterCommand.ts rename to clients/client-neptune/src/commands/ModifyDBClusterCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBClusterEndpointCommand.ts b/clients/client-neptune/src/commands/ModifyDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBClusterEndpointCommand.ts rename to clients/client-neptune/src/commands/ModifyDBClusterEndpointCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBClusterParameterGroupCommand.ts b/clients/client-neptune/src/commands/ModifyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBClusterParameterGroupCommand.ts rename to clients/client-neptune/src/commands/ModifyDBClusterParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBClusterSnapshotAttributeCommand.ts b/clients/client-neptune/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBClusterSnapshotAttributeCommand.ts rename to clients/client-neptune/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBInstanceCommand.ts b/clients/client-neptune/src/commands/ModifyDBInstanceCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBInstanceCommand.ts rename to clients/client-neptune/src/commands/ModifyDBInstanceCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBParameterGroupCommand.ts b/clients/client-neptune/src/commands/ModifyDBParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBParameterGroupCommand.ts rename to clients/client-neptune/src/commands/ModifyDBParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/ModifyDBSubnetGroupCommand.ts b/clients/client-neptune/src/commands/ModifyDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyDBSubnetGroupCommand.ts rename to clients/client-neptune/src/commands/ModifyDBSubnetGroupCommand.ts diff --git a/clients/client-neptune/commands/ModifyEventSubscriptionCommand.ts b/clients/client-neptune/src/commands/ModifyEventSubscriptionCommand.ts similarity index 100% rename from clients/client-neptune/commands/ModifyEventSubscriptionCommand.ts rename to clients/client-neptune/src/commands/ModifyEventSubscriptionCommand.ts diff --git a/clients/client-neptune/commands/PromoteReadReplicaDBClusterCommand.ts b/clients/client-neptune/src/commands/PromoteReadReplicaDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/PromoteReadReplicaDBClusterCommand.ts rename to clients/client-neptune/src/commands/PromoteReadReplicaDBClusterCommand.ts diff --git a/clients/client-neptune/commands/RebootDBInstanceCommand.ts b/clients/client-neptune/src/commands/RebootDBInstanceCommand.ts similarity index 100% rename from clients/client-neptune/commands/RebootDBInstanceCommand.ts rename to clients/client-neptune/src/commands/RebootDBInstanceCommand.ts diff --git a/clients/client-neptune/commands/RemoveRoleFromDBClusterCommand.ts b/clients/client-neptune/src/commands/RemoveRoleFromDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/RemoveRoleFromDBClusterCommand.ts rename to clients/client-neptune/src/commands/RemoveRoleFromDBClusterCommand.ts diff --git a/clients/client-neptune/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts b/clients/client-neptune/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts similarity index 100% rename from clients/client-neptune/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts rename to clients/client-neptune/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts diff --git a/clients/client-neptune/commands/RemoveTagsFromResourceCommand.ts b/clients/client-neptune/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-neptune/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-neptune/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-neptune/commands/ResetDBClusterParameterGroupCommand.ts b/clients/client-neptune/src/commands/ResetDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/ResetDBClusterParameterGroupCommand.ts rename to clients/client-neptune/src/commands/ResetDBClusterParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/ResetDBParameterGroupCommand.ts b/clients/client-neptune/src/commands/ResetDBParameterGroupCommand.ts similarity index 100% rename from clients/client-neptune/commands/ResetDBParameterGroupCommand.ts rename to clients/client-neptune/src/commands/ResetDBParameterGroupCommand.ts diff --git a/clients/client-neptune/commands/RestoreDBClusterFromSnapshotCommand.ts b/clients/client-neptune/src/commands/RestoreDBClusterFromSnapshotCommand.ts similarity index 100% rename from clients/client-neptune/commands/RestoreDBClusterFromSnapshotCommand.ts rename to clients/client-neptune/src/commands/RestoreDBClusterFromSnapshotCommand.ts diff --git a/clients/client-neptune/commands/RestoreDBClusterToPointInTimeCommand.ts b/clients/client-neptune/src/commands/RestoreDBClusterToPointInTimeCommand.ts similarity index 100% rename from clients/client-neptune/commands/RestoreDBClusterToPointInTimeCommand.ts rename to clients/client-neptune/src/commands/RestoreDBClusterToPointInTimeCommand.ts diff --git a/clients/client-neptune/commands/StartDBClusterCommand.ts b/clients/client-neptune/src/commands/StartDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/StartDBClusterCommand.ts rename to clients/client-neptune/src/commands/StartDBClusterCommand.ts diff --git a/clients/client-neptune/commands/StopDBClusterCommand.ts b/clients/client-neptune/src/commands/StopDBClusterCommand.ts similarity index 100% rename from clients/client-neptune/commands/StopDBClusterCommand.ts rename to clients/client-neptune/src/commands/StopDBClusterCommand.ts diff --git a/clients/client-neptune/endpoints.ts b/clients/client-neptune/src/endpoints.ts similarity index 100% rename from clients/client-neptune/endpoints.ts rename to clients/client-neptune/src/endpoints.ts diff --git a/clients/client-neptune/index.ts b/clients/client-neptune/src/index.ts similarity index 100% rename from clients/client-neptune/index.ts rename to clients/client-neptune/src/index.ts diff --git a/clients/client-neptune/models/index.ts b/clients/client-neptune/src/models/index.ts similarity index 100% rename from clients/client-neptune/models/index.ts rename to clients/client-neptune/src/models/index.ts diff --git a/clients/client-neptune/models/models_0.ts b/clients/client-neptune/src/models/models_0.ts similarity index 100% rename from clients/client-neptune/models/models_0.ts rename to clients/client-neptune/src/models/models_0.ts diff --git a/clients/client-neptune/pagination/DescribeDBClusterEndpointsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBClusterEndpointsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBClusterEndpointsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBClusterEndpointsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBClusterParameterGroupsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBClusterParameterGroupsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBClusterParametersPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBClusterParametersPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBClusterParametersPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBClusterParametersPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBClusterSnapshotsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBClusterSnapshotsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBClusterSnapshotsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBClusterSnapshotsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBClustersPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBClustersPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBClustersPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBClustersPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBEngineVersionsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBEngineVersionsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBEngineVersionsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBInstancesPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBInstancesPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBInstancesPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBInstancesPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBParameterGroupsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBParameterGroupsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBParameterGroupsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBParameterGroupsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBParametersPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBParametersPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBParametersPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBParametersPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-neptune/src/pagination/DescribeDBSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeDBSubnetGroupsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeDBSubnetGroupsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeEngineDefaultParametersPaginator.ts b/clients/client-neptune/src/pagination/DescribeEngineDefaultParametersPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeEngineDefaultParametersPaginator.ts rename to clients/client-neptune/src/pagination/DescribeEngineDefaultParametersPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-neptune/src/pagination/DescribeEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeEventSubscriptionsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeEventSubscriptionsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeEventsPaginator.ts b/clients/client-neptune/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeEventsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-neptune/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts rename to clients/client-neptune/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts diff --git a/clients/client-neptune/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-neptune/src/pagination/DescribePendingMaintenanceActionsPaginator.ts similarity index 100% rename from clients/client-neptune/pagination/DescribePendingMaintenanceActionsPaginator.ts rename to clients/client-neptune/src/pagination/DescribePendingMaintenanceActionsPaginator.ts diff --git a/clients/client-neptune/pagination/Interfaces.ts b/clients/client-neptune/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-neptune/pagination/Interfaces.ts rename to clients/client-neptune/src/pagination/Interfaces.ts diff --git a/clients/client-neptune/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-neptune/protocols/Aws_query.ts rename to clients/client-neptune/src/protocols/Aws_query.ts diff --git a/clients/client-neptune/src/runtimeConfig.browser.ts b/clients/client-neptune/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..45f39983e586 --- /dev/null +++ b/clients/client-neptune/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { NeptuneClientConfig } from "./NeptuneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NeptuneClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-neptune/runtimeConfig.native.ts b/clients/client-neptune/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-neptune/runtimeConfig.native.ts rename to clients/client-neptune/src/runtimeConfig.native.ts diff --git a/clients/client-neptune/runtimeConfig.shared.ts b/clients/client-neptune/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-neptune/runtimeConfig.shared.ts rename to clients/client-neptune/src/runtimeConfig.shared.ts diff --git a/clients/client-neptune/src/runtimeConfig.ts b/clients/client-neptune/src/runtimeConfig.ts new file mode 100644 index 000000000000..490bd141c6bd --- /dev/null +++ b/clients/client-neptune/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { NeptuneClientConfig } from "./NeptuneClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NeptuneClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-neptune/waiters/waitForDBInstanceAvailable.ts b/clients/client-neptune/src/waiters/waitForDBInstanceAvailable.ts similarity index 100% rename from clients/client-neptune/waiters/waitForDBInstanceAvailable.ts rename to clients/client-neptune/src/waiters/waitForDBInstanceAvailable.ts diff --git a/clients/client-neptune/tsconfig.es.json b/clients/client-neptune/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-neptune/tsconfig.es.json +++ b/clients/client-neptune/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-neptune/tsconfig.json b/clients/client-neptune/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-neptune/tsconfig.json +++ b/clients/client-neptune/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-neptune/tsconfig.types.json b/clients/client-neptune/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-neptune/tsconfig.types.json +++ b/clients/client-neptune/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-network-firewall/.gitignore b/clients/client-network-firewall/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-network-firewall/.gitignore +++ b/clients/client-network-firewall/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-network-firewall/package.json b/clients/client-network-firewall/package.json index f1959e7bf510..e487550ed9c5 100644 --- a/clients/client-network-firewall/package.json +++ b/clients/client-network-firewall/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-network-firewall", "repository": { "type": "git", diff --git a/clients/client-network-firewall/runtimeConfig.browser.ts b/clients/client-network-firewall/runtimeConfig.browser.ts deleted file mode 100644 index 3ff738c396fc..000000000000 --- a/clients/client-network-firewall/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { NetworkFirewallClientConfig } from "./NetworkFirewallClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-network-firewall/runtimeConfig.ts b/clients/client-network-firewall/runtimeConfig.ts deleted file mode 100644 index 98619b68b119..000000000000 --- a/clients/client-network-firewall/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { NetworkFirewallClientConfig } from "./NetworkFirewallClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-network-firewall/NetworkFirewall.ts b/clients/client-network-firewall/src/NetworkFirewall.ts similarity index 100% rename from clients/client-network-firewall/NetworkFirewall.ts rename to clients/client-network-firewall/src/NetworkFirewall.ts diff --git a/clients/client-network-firewall/NetworkFirewallClient.ts b/clients/client-network-firewall/src/NetworkFirewallClient.ts similarity index 100% rename from clients/client-network-firewall/NetworkFirewallClient.ts rename to clients/client-network-firewall/src/NetworkFirewallClient.ts diff --git a/clients/client-network-firewall/commands/AssociateFirewallPolicyCommand.ts b/clients/client-network-firewall/src/commands/AssociateFirewallPolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/AssociateFirewallPolicyCommand.ts rename to clients/client-network-firewall/src/commands/AssociateFirewallPolicyCommand.ts diff --git a/clients/client-network-firewall/commands/AssociateSubnetsCommand.ts b/clients/client-network-firewall/src/commands/AssociateSubnetsCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/AssociateSubnetsCommand.ts rename to clients/client-network-firewall/src/commands/AssociateSubnetsCommand.ts diff --git a/clients/client-network-firewall/commands/CreateFirewallCommand.ts b/clients/client-network-firewall/src/commands/CreateFirewallCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/CreateFirewallCommand.ts rename to clients/client-network-firewall/src/commands/CreateFirewallCommand.ts diff --git a/clients/client-network-firewall/commands/CreateFirewallPolicyCommand.ts b/clients/client-network-firewall/src/commands/CreateFirewallPolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/CreateFirewallPolicyCommand.ts rename to clients/client-network-firewall/src/commands/CreateFirewallPolicyCommand.ts diff --git a/clients/client-network-firewall/commands/CreateRuleGroupCommand.ts b/clients/client-network-firewall/src/commands/CreateRuleGroupCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/CreateRuleGroupCommand.ts rename to clients/client-network-firewall/src/commands/CreateRuleGroupCommand.ts diff --git a/clients/client-network-firewall/commands/DeleteFirewallCommand.ts b/clients/client-network-firewall/src/commands/DeleteFirewallCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DeleteFirewallCommand.ts rename to clients/client-network-firewall/src/commands/DeleteFirewallCommand.ts diff --git a/clients/client-network-firewall/commands/DeleteFirewallPolicyCommand.ts b/clients/client-network-firewall/src/commands/DeleteFirewallPolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DeleteFirewallPolicyCommand.ts rename to clients/client-network-firewall/src/commands/DeleteFirewallPolicyCommand.ts diff --git a/clients/client-network-firewall/commands/DeleteResourcePolicyCommand.ts b/clients/client-network-firewall/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DeleteResourcePolicyCommand.ts rename to clients/client-network-firewall/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-network-firewall/commands/DeleteRuleGroupCommand.ts b/clients/client-network-firewall/src/commands/DeleteRuleGroupCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DeleteRuleGroupCommand.ts rename to clients/client-network-firewall/src/commands/DeleteRuleGroupCommand.ts diff --git a/clients/client-network-firewall/commands/DescribeFirewallCommand.ts b/clients/client-network-firewall/src/commands/DescribeFirewallCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DescribeFirewallCommand.ts rename to clients/client-network-firewall/src/commands/DescribeFirewallCommand.ts diff --git a/clients/client-network-firewall/commands/DescribeFirewallPolicyCommand.ts b/clients/client-network-firewall/src/commands/DescribeFirewallPolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DescribeFirewallPolicyCommand.ts rename to clients/client-network-firewall/src/commands/DescribeFirewallPolicyCommand.ts diff --git a/clients/client-network-firewall/commands/DescribeLoggingConfigurationCommand.ts b/clients/client-network-firewall/src/commands/DescribeLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DescribeLoggingConfigurationCommand.ts rename to clients/client-network-firewall/src/commands/DescribeLoggingConfigurationCommand.ts diff --git a/clients/client-network-firewall/commands/DescribeResourcePolicyCommand.ts b/clients/client-network-firewall/src/commands/DescribeResourcePolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DescribeResourcePolicyCommand.ts rename to clients/client-network-firewall/src/commands/DescribeResourcePolicyCommand.ts diff --git a/clients/client-network-firewall/commands/DescribeRuleGroupCommand.ts b/clients/client-network-firewall/src/commands/DescribeRuleGroupCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DescribeRuleGroupCommand.ts rename to clients/client-network-firewall/src/commands/DescribeRuleGroupCommand.ts diff --git a/clients/client-network-firewall/commands/DisassociateSubnetsCommand.ts b/clients/client-network-firewall/src/commands/DisassociateSubnetsCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/DisassociateSubnetsCommand.ts rename to clients/client-network-firewall/src/commands/DisassociateSubnetsCommand.ts diff --git a/clients/client-network-firewall/commands/ListFirewallPoliciesCommand.ts b/clients/client-network-firewall/src/commands/ListFirewallPoliciesCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/ListFirewallPoliciesCommand.ts rename to clients/client-network-firewall/src/commands/ListFirewallPoliciesCommand.ts diff --git a/clients/client-network-firewall/commands/ListFirewallsCommand.ts b/clients/client-network-firewall/src/commands/ListFirewallsCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/ListFirewallsCommand.ts rename to clients/client-network-firewall/src/commands/ListFirewallsCommand.ts diff --git a/clients/client-network-firewall/commands/ListRuleGroupsCommand.ts b/clients/client-network-firewall/src/commands/ListRuleGroupsCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/ListRuleGroupsCommand.ts rename to clients/client-network-firewall/src/commands/ListRuleGroupsCommand.ts diff --git a/clients/client-network-firewall/commands/ListTagsForResourceCommand.ts b/clients/client-network-firewall/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/ListTagsForResourceCommand.ts rename to clients/client-network-firewall/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-network-firewall/commands/PutResourcePolicyCommand.ts b/clients/client-network-firewall/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/PutResourcePolicyCommand.ts rename to clients/client-network-firewall/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-network-firewall/commands/TagResourceCommand.ts b/clients/client-network-firewall/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/TagResourceCommand.ts rename to clients/client-network-firewall/src/commands/TagResourceCommand.ts diff --git a/clients/client-network-firewall/commands/UntagResourceCommand.ts b/clients/client-network-firewall/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UntagResourceCommand.ts rename to clients/client-network-firewall/src/commands/UntagResourceCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateFirewallDeleteProtectionCommand.ts b/clients/client-network-firewall/src/commands/UpdateFirewallDeleteProtectionCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateFirewallDeleteProtectionCommand.ts rename to clients/client-network-firewall/src/commands/UpdateFirewallDeleteProtectionCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateFirewallDescriptionCommand.ts b/clients/client-network-firewall/src/commands/UpdateFirewallDescriptionCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateFirewallDescriptionCommand.ts rename to clients/client-network-firewall/src/commands/UpdateFirewallDescriptionCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateFirewallPolicyChangeProtectionCommand.ts b/clients/client-network-firewall/src/commands/UpdateFirewallPolicyChangeProtectionCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateFirewallPolicyChangeProtectionCommand.ts rename to clients/client-network-firewall/src/commands/UpdateFirewallPolicyChangeProtectionCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateFirewallPolicyCommand.ts b/clients/client-network-firewall/src/commands/UpdateFirewallPolicyCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateFirewallPolicyCommand.ts rename to clients/client-network-firewall/src/commands/UpdateFirewallPolicyCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateLoggingConfigurationCommand.ts b/clients/client-network-firewall/src/commands/UpdateLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateLoggingConfigurationCommand.ts rename to clients/client-network-firewall/src/commands/UpdateLoggingConfigurationCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateRuleGroupCommand.ts b/clients/client-network-firewall/src/commands/UpdateRuleGroupCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateRuleGroupCommand.ts rename to clients/client-network-firewall/src/commands/UpdateRuleGroupCommand.ts diff --git a/clients/client-network-firewall/commands/UpdateSubnetChangeProtectionCommand.ts b/clients/client-network-firewall/src/commands/UpdateSubnetChangeProtectionCommand.ts similarity index 100% rename from clients/client-network-firewall/commands/UpdateSubnetChangeProtectionCommand.ts rename to clients/client-network-firewall/src/commands/UpdateSubnetChangeProtectionCommand.ts diff --git a/clients/client-network-firewall/endpoints.ts b/clients/client-network-firewall/src/endpoints.ts similarity index 100% rename from clients/client-network-firewall/endpoints.ts rename to clients/client-network-firewall/src/endpoints.ts diff --git a/clients/client-network-firewall/index.ts b/clients/client-network-firewall/src/index.ts similarity index 100% rename from clients/client-network-firewall/index.ts rename to clients/client-network-firewall/src/index.ts diff --git a/clients/client-network-firewall/models/index.ts b/clients/client-network-firewall/src/models/index.ts similarity index 100% rename from clients/client-network-firewall/models/index.ts rename to clients/client-network-firewall/src/models/index.ts diff --git a/clients/client-network-firewall/models/models_0.ts b/clients/client-network-firewall/src/models/models_0.ts similarity index 100% rename from clients/client-network-firewall/models/models_0.ts rename to clients/client-network-firewall/src/models/models_0.ts diff --git a/clients/client-network-firewall/pagination/Interfaces.ts b/clients/client-network-firewall/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-network-firewall/pagination/Interfaces.ts rename to clients/client-network-firewall/src/pagination/Interfaces.ts diff --git a/clients/client-network-firewall/pagination/ListFirewallPoliciesPaginator.ts b/clients/client-network-firewall/src/pagination/ListFirewallPoliciesPaginator.ts similarity index 100% rename from clients/client-network-firewall/pagination/ListFirewallPoliciesPaginator.ts rename to clients/client-network-firewall/src/pagination/ListFirewallPoliciesPaginator.ts diff --git a/clients/client-network-firewall/pagination/ListFirewallsPaginator.ts b/clients/client-network-firewall/src/pagination/ListFirewallsPaginator.ts similarity index 100% rename from clients/client-network-firewall/pagination/ListFirewallsPaginator.ts rename to clients/client-network-firewall/src/pagination/ListFirewallsPaginator.ts diff --git a/clients/client-network-firewall/pagination/ListRuleGroupsPaginator.ts b/clients/client-network-firewall/src/pagination/ListRuleGroupsPaginator.ts similarity index 100% rename from clients/client-network-firewall/pagination/ListRuleGroupsPaginator.ts rename to clients/client-network-firewall/src/pagination/ListRuleGroupsPaginator.ts diff --git a/clients/client-network-firewall/pagination/ListTagsForResourcePaginator.ts b/clients/client-network-firewall/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-network-firewall/pagination/ListTagsForResourcePaginator.ts rename to clients/client-network-firewall/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-network-firewall/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-network-firewall/protocols/Aws_json1_0.ts rename to clients/client-network-firewall/src/protocols/Aws_json1_0.ts diff --git a/clients/client-network-firewall/src/runtimeConfig.browser.ts b/clients/client-network-firewall/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b526d5b26387 --- /dev/null +++ b/clients/client-network-firewall/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { NetworkFirewallClientConfig } from "./NetworkFirewallClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-network-firewall/runtimeConfig.native.ts b/clients/client-network-firewall/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-network-firewall/runtimeConfig.native.ts rename to clients/client-network-firewall/src/runtimeConfig.native.ts diff --git a/clients/client-network-firewall/runtimeConfig.shared.ts b/clients/client-network-firewall/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-network-firewall/runtimeConfig.shared.ts rename to clients/client-network-firewall/src/runtimeConfig.shared.ts diff --git a/clients/client-network-firewall/src/runtimeConfig.ts b/clients/client-network-firewall/src/runtimeConfig.ts new file mode 100644 index 000000000000..b0f4e5855ada --- /dev/null +++ b/clients/client-network-firewall/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { NetworkFirewallClientConfig } from "./NetworkFirewallClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-network-firewall/tsconfig.es.json b/clients/client-network-firewall/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-network-firewall/tsconfig.es.json +++ b/clients/client-network-firewall/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-network-firewall/tsconfig.json b/clients/client-network-firewall/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-network-firewall/tsconfig.json +++ b/clients/client-network-firewall/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-network-firewall/tsconfig.types.json b/clients/client-network-firewall/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-network-firewall/tsconfig.types.json +++ b/clients/client-network-firewall/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-networkmanager/.gitignore b/clients/client-networkmanager/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-networkmanager/.gitignore +++ b/clients/client-networkmanager/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-networkmanager/package.json b/clients/client-networkmanager/package.json index 781d1661545a..4305ac9c518a 100644 --- a/clients/client-networkmanager/package.json +++ b/clients/client-networkmanager/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-networkmanager", "repository": { "type": "git", diff --git a/clients/client-networkmanager/runtimeConfig.browser.ts b/clients/client-networkmanager/runtimeConfig.browser.ts deleted file mode 100644 index 78bf654fa8e3..000000000000 --- a/clients/client-networkmanager/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { NetworkManagerClientConfig } from "./NetworkManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-networkmanager/runtimeConfig.ts b/clients/client-networkmanager/runtimeConfig.ts deleted file mode 100644 index 1b17a25fe313..000000000000 --- a/clients/client-networkmanager/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { NetworkManagerClientConfig } from "./NetworkManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-networkmanager/NetworkManager.ts b/clients/client-networkmanager/src/NetworkManager.ts similarity index 100% rename from clients/client-networkmanager/NetworkManager.ts rename to clients/client-networkmanager/src/NetworkManager.ts diff --git a/clients/client-networkmanager/NetworkManagerClient.ts b/clients/client-networkmanager/src/NetworkManagerClient.ts similarity index 100% rename from clients/client-networkmanager/NetworkManagerClient.ts rename to clients/client-networkmanager/src/NetworkManagerClient.ts diff --git a/clients/client-networkmanager/commands/AssociateCustomerGatewayCommand.ts b/clients/client-networkmanager/src/commands/AssociateCustomerGatewayCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/AssociateCustomerGatewayCommand.ts rename to clients/client-networkmanager/src/commands/AssociateCustomerGatewayCommand.ts diff --git a/clients/client-networkmanager/commands/AssociateLinkCommand.ts b/clients/client-networkmanager/src/commands/AssociateLinkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/AssociateLinkCommand.ts rename to clients/client-networkmanager/src/commands/AssociateLinkCommand.ts diff --git a/clients/client-networkmanager/commands/AssociateTransitGatewayConnectPeerCommand.ts b/clients/client-networkmanager/src/commands/AssociateTransitGatewayConnectPeerCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/AssociateTransitGatewayConnectPeerCommand.ts rename to clients/client-networkmanager/src/commands/AssociateTransitGatewayConnectPeerCommand.ts diff --git a/clients/client-networkmanager/commands/CreateConnectionCommand.ts b/clients/client-networkmanager/src/commands/CreateConnectionCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/CreateConnectionCommand.ts rename to clients/client-networkmanager/src/commands/CreateConnectionCommand.ts diff --git a/clients/client-networkmanager/commands/CreateDeviceCommand.ts b/clients/client-networkmanager/src/commands/CreateDeviceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/CreateDeviceCommand.ts rename to clients/client-networkmanager/src/commands/CreateDeviceCommand.ts diff --git a/clients/client-networkmanager/commands/CreateGlobalNetworkCommand.ts b/clients/client-networkmanager/src/commands/CreateGlobalNetworkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/CreateGlobalNetworkCommand.ts rename to clients/client-networkmanager/src/commands/CreateGlobalNetworkCommand.ts diff --git a/clients/client-networkmanager/commands/CreateLinkCommand.ts b/clients/client-networkmanager/src/commands/CreateLinkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/CreateLinkCommand.ts rename to clients/client-networkmanager/src/commands/CreateLinkCommand.ts diff --git a/clients/client-networkmanager/commands/CreateSiteCommand.ts b/clients/client-networkmanager/src/commands/CreateSiteCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/CreateSiteCommand.ts rename to clients/client-networkmanager/src/commands/CreateSiteCommand.ts diff --git a/clients/client-networkmanager/commands/DeleteConnectionCommand.ts b/clients/client-networkmanager/src/commands/DeleteConnectionCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeleteConnectionCommand.ts rename to clients/client-networkmanager/src/commands/DeleteConnectionCommand.ts diff --git a/clients/client-networkmanager/commands/DeleteDeviceCommand.ts b/clients/client-networkmanager/src/commands/DeleteDeviceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeleteDeviceCommand.ts rename to clients/client-networkmanager/src/commands/DeleteDeviceCommand.ts diff --git a/clients/client-networkmanager/commands/DeleteGlobalNetworkCommand.ts b/clients/client-networkmanager/src/commands/DeleteGlobalNetworkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeleteGlobalNetworkCommand.ts rename to clients/client-networkmanager/src/commands/DeleteGlobalNetworkCommand.ts diff --git a/clients/client-networkmanager/commands/DeleteLinkCommand.ts b/clients/client-networkmanager/src/commands/DeleteLinkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeleteLinkCommand.ts rename to clients/client-networkmanager/src/commands/DeleteLinkCommand.ts diff --git a/clients/client-networkmanager/commands/DeleteSiteCommand.ts b/clients/client-networkmanager/src/commands/DeleteSiteCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeleteSiteCommand.ts rename to clients/client-networkmanager/src/commands/DeleteSiteCommand.ts diff --git a/clients/client-networkmanager/commands/DeregisterTransitGatewayCommand.ts b/clients/client-networkmanager/src/commands/DeregisterTransitGatewayCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DeregisterTransitGatewayCommand.ts rename to clients/client-networkmanager/src/commands/DeregisterTransitGatewayCommand.ts diff --git a/clients/client-networkmanager/commands/DescribeGlobalNetworksCommand.ts b/clients/client-networkmanager/src/commands/DescribeGlobalNetworksCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DescribeGlobalNetworksCommand.ts rename to clients/client-networkmanager/src/commands/DescribeGlobalNetworksCommand.ts diff --git a/clients/client-networkmanager/commands/DisassociateCustomerGatewayCommand.ts b/clients/client-networkmanager/src/commands/DisassociateCustomerGatewayCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DisassociateCustomerGatewayCommand.ts rename to clients/client-networkmanager/src/commands/DisassociateCustomerGatewayCommand.ts diff --git a/clients/client-networkmanager/commands/DisassociateLinkCommand.ts b/clients/client-networkmanager/src/commands/DisassociateLinkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DisassociateLinkCommand.ts rename to clients/client-networkmanager/src/commands/DisassociateLinkCommand.ts diff --git a/clients/client-networkmanager/commands/DisassociateTransitGatewayConnectPeerCommand.ts b/clients/client-networkmanager/src/commands/DisassociateTransitGatewayConnectPeerCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/DisassociateTransitGatewayConnectPeerCommand.ts rename to clients/client-networkmanager/src/commands/DisassociateTransitGatewayConnectPeerCommand.ts diff --git a/clients/client-networkmanager/commands/GetConnectionsCommand.ts b/clients/client-networkmanager/src/commands/GetConnectionsCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetConnectionsCommand.ts rename to clients/client-networkmanager/src/commands/GetConnectionsCommand.ts diff --git a/clients/client-networkmanager/commands/GetCustomerGatewayAssociationsCommand.ts b/clients/client-networkmanager/src/commands/GetCustomerGatewayAssociationsCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetCustomerGatewayAssociationsCommand.ts rename to clients/client-networkmanager/src/commands/GetCustomerGatewayAssociationsCommand.ts diff --git a/clients/client-networkmanager/commands/GetDevicesCommand.ts b/clients/client-networkmanager/src/commands/GetDevicesCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetDevicesCommand.ts rename to clients/client-networkmanager/src/commands/GetDevicesCommand.ts diff --git a/clients/client-networkmanager/commands/GetLinkAssociationsCommand.ts b/clients/client-networkmanager/src/commands/GetLinkAssociationsCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetLinkAssociationsCommand.ts rename to clients/client-networkmanager/src/commands/GetLinkAssociationsCommand.ts diff --git a/clients/client-networkmanager/commands/GetLinksCommand.ts b/clients/client-networkmanager/src/commands/GetLinksCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetLinksCommand.ts rename to clients/client-networkmanager/src/commands/GetLinksCommand.ts diff --git a/clients/client-networkmanager/commands/GetSitesCommand.ts b/clients/client-networkmanager/src/commands/GetSitesCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetSitesCommand.ts rename to clients/client-networkmanager/src/commands/GetSitesCommand.ts diff --git a/clients/client-networkmanager/commands/GetTransitGatewayConnectPeerAssociationsCommand.ts b/clients/client-networkmanager/src/commands/GetTransitGatewayConnectPeerAssociationsCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetTransitGatewayConnectPeerAssociationsCommand.ts rename to clients/client-networkmanager/src/commands/GetTransitGatewayConnectPeerAssociationsCommand.ts diff --git a/clients/client-networkmanager/commands/GetTransitGatewayRegistrationsCommand.ts b/clients/client-networkmanager/src/commands/GetTransitGatewayRegistrationsCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/GetTransitGatewayRegistrationsCommand.ts rename to clients/client-networkmanager/src/commands/GetTransitGatewayRegistrationsCommand.ts diff --git a/clients/client-networkmanager/commands/ListTagsForResourceCommand.ts b/clients/client-networkmanager/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/ListTagsForResourceCommand.ts rename to clients/client-networkmanager/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-networkmanager/commands/RegisterTransitGatewayCommand.ts b/clients/client-networkmanager/src/commands/RegisterTransitGatewayCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/RegisterTransitGatewayCommand.ts rename to clients/client-networkmanager/src/commands/RegisterTransitGatewayCommand.ts diff --git a/clients/client-networkmanager/commands/TagResourceCommand.ts b/clients/client-networkmanager/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/TagResourceCommand.ts rename to clients/client-networkmanager/src/commands/TagResourceCommand.ts diff --git a/clients/client-networkmanager/commands/UntagResourceCommand.ts b/clients/client-networkmanager/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UntagResourceCommand.ts rename to clients/client-networkmanager/src/commands/UntagResourceCommand.ts diff --git a/clients/client-networkmanager/commands/UpdateConnectionCommand.ts b/clients/client-networkmanager/src/commands/UpdateConnectionCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UpdateConnectionCommand.ts rename to clients/client-networkmanager/src/commands/UpdateConnectionCommand.ts diff --git a/clients/client-networkmanager/commands/UpdateDeviceCommand.ts b/clients/client-networkmanager/src/commands/UpdateDeviceCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UpdateDeviceCommand.ts rename to clients/client-networkmanager/src/commands/UpdateDeviceCommand.ts diff --git a/clients/client-networkmanager/commands/UpdateGlobalNetworkCommand.ts b/clients/client-networkmanager/src/commands/UpdateGlobalNetworkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UpdateGlobalNetworkCommand.ts rename to clients/client-networkmanager/src/commands/UpdateGlobalNetworkCommand.ts diff --git a/clients/client-networkmanager/commands/UpdateLinkCommand.ts b/clients/client-networkmanager/src/commands/UpdateLinkCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UpdateLinkCommand.ts rename to clients/client-networkmanager/src/commands/UpdateLinkCommand.ts diff --git a/clients/client-networkmanager/commands/UpdateSiteCommand.ts b/clients/client-networkmanager/src/commands/UpdateSiteCommand.ts similarity index 100% rename from clients/client-networkmanager/commands/UpdateSiteCommand.ts rename to clients/client-networkmanager/src/commands/UpdateSiteCommand.ts diff --git a/clients/client-networkmanager/endpoints.ts b/clients/client-networkmanager/src/endpoints.ts similarity index 100% rename from clients/client-networkmanager/endpoints.ts rename to clients/client-networkmanager/src/endpoints.ts diff --git a/clients/client-networkmanager/index.ts b/clients/client-networkmanager/src/index.ts similarity index 100% rename from clients/client-networkmanager/index.ts rename to clients/client-networkmanager/src/index.ts diff --git a/clients/client-networkmanager/models/index.ts b/clients/client-networkmanager/src/models/index.ts similarity index 100% rename from clients/client-networkmanager/models/index.ts rename to clients/client-networkmanager/src/models/index.ts diff --git a/clients/client-networkmanager/models/models_0.ts b/clients/client-networkmanager/src/models/models_0.ts similarity index 100% rename from clients/client-networkmanager/models/models_0.ts rename to clients/client-networkmanager/src/models/models_0.ts diff --git a/clients/client-networkmanager/pagination/DescribeGlobalNetworksPaginator.ts b/clients/client-networkmanager/src/pagination/DescribeGlobalNetworksPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/DescribeGlobalNetworksPaginator.ts rename to clients/client-networkmanager/src/pagination/DescribeGlobalNetworksPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetConnectionsPaginator.ts b/clients/client-networkmanager/src/pagination/GetConnectionsPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetConnectionsPaginator.ts rename to clients/client-networkmanager/src/pagination/GetConnectionsPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetCustomerGatewayAssociationsPaginator.ts b/clients/client-networkmanager/src/pagination/GetCustomerGatewayAssociationsPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetCustomerGatewayAssociationsPaginator.ts rename to clients/client-networkmanager/src/pagination/GetCustomerGatewayAssociationsPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetDevicesPaginator.ts b/clients/client-networkmanager/src/pagination/GetDevicesPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetDevicesPaginator.ts rename to clients/client-networkmanager/src/pagination/GetDevicesPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetLinkAssociationsPaginator.ts b/clients/client-networkmanager/src/pagination/GetLinkAssociationsPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetLinkAssociationsPaginator.ts rename to clients/client-networkmanager/src/pagination/GetLinkAssociationsPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetLinksPaginator.ts b/clients/client-networkmanager/src/pagination/GetLinksPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetLinksPaginator.ts rename to clients/client-networkmanager/src/pagination/GetLinksPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetSitesPaginator.ts b/clients/client-networkmanager/src/pagination/GetSitesPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetSitesPaginator.ts rename to clients/client-networkmanager/src/pagination/GetSitesPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetTransitGatewayConnectPeerAssociationsPaginator.ts b/clients/client-networkmanager/src/pagination/GetTransitGatewayConnectPeerAssociationsPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetTransitGatewayConnectPeerAssociationsPaginator.ts rename to clients/client-networkmanager/src/pagination/GetTransitGatewayConnectPeerAssociationsPaginator.ts diff --git a/clients/client-networkmanager/pagination/GetTransitGatewayRegistrationsPaginator.ts b/clients/client-networkmanager/src/pagination/GetTransitGatewayRegistrationsPaginator.ts similarity index 100% rename from clients/client-networkmanager/pagination/GetTransitGatewayRegistrationsPaginator.ts rename to clients/client-networkmanager/src/pagination/GetTransitGatewayRegistrationsPaginator.ts diff --git a/clients/client-networkmanager/pagination/Interfaces.ts b/clients/client-networkmanager/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-networkmanager/pagination/Interfaces.ts rename to clients/client-networkmanager/src/pagination/Interfaces.ts diff --git a/clients/client-networkmanager/protocols/Aws_restJson1.ts b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-networkmanager/protocols/Aws_restJson1.ts rename to clients/client-networkmanager/src/protocols/Aws_restJson1.ts diff --git a/clients/client-networkmanager/src/runtimeConfig.browser.ts b/clients/client-networkmanager/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fc0aae2b5290 --- /dev/null +++ b/clients/client-networkmanager/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { NetworkManagerClientConfig } from "./NetworkManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-networkmanager/runtimeConfig.native.ts b/clients/client-networkmanager/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-networkmanager/runtimeConfig.native.ts rename to clients/client-networkmanager/src/runtimeConfig.native.ts diff --git a/clients/client-networkmanager/runtimeConfig.shared.ts b/clients/client-networkmanager/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-networkmanager/runtimeConfig.shared.ts rename to clients/client-networkmanager/src/runtimeConfig.shared.ts diff --git a/clients/client-networkmanager/src/runtimeConfig.ts b/clients/client-networkmanager/src/runtimeConfig.ts new file mode 100644 index 000000000000..ef93ea5c67cd --- /dev/null +++ b/clients/client-networkmanager/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { NetworkManagerClientConfig } from "./NetworkManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-networkmanager/tsconfig.es.json b/clients/client-networkmanager/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-networkmanager/tsconfig.es.json +++ b/clients/client-networkmanager/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-networkmanager/tsconfig.json b/clients/client-networkmanager/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-networkmanager/tsconfig.json +++ b/clients/client-networkmanager/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-networkmanager/tsconfig.types.json b/clients/client-networkmanager/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-networkmanager/tsconfig.types.json +++ b/clients/client-networkmanager/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-nimble/.gitignore b/clients/client-nimble/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-nimble/.gitignore +++ b/clients/client-nimble/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-nimble/package.json b/clients/client-nimble/package.json index 2c1114766c61..ed4cf353ca9a 100644 --- a/clients/client-nimble/package.json +++ b/clients/client-nimble/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-nimble", "repository": { "type": "git", diff --git a/clients/client-nimble/runtimeConfig.browser.ts b/clients/client-nimble/runtimeConfig.browser.ts deleted file mode 100644 index 50190a578430..000000000000 --- a/clients/client-nimble/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { NimbleClientConfig } from "./NimbleClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NimbleClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-nimble/runtimeConfig.ts b/clients/client-nimble/runtimeConfig.ts deleted file mode 100644 index 4a1ac362a332..000000000000 --- a/clients/client-nimble/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { NimbleClientConfig } from "./NimbleClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: NimbleClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-nimble/Nimble.ts b/clients/client-nimble/src/Nimble.ts similarity index 100% rename from clients/client-nimble/Nimble.ts rename to clients/client-nimble/src/Nimble.ts diff --git a/clients/client-nimble/NimbleClient.ts b/clients/client-nimble/src/NimbleClient.ts similarity index 100% rename from clients/client-nimble/NimbleClient.ts rename to clients/client-nimble/src/NimbleClient.ts diff --git a/clients/client-nimble/commands/AcceptEulasCommand.ts b/clients/client-nimble/src/commands/AcceptEulasCommand.ts similarity index 100% rename from clients/client-nimble/commands/AcceptEulasCommand.ts rename to clients/client-nimble/src/commands/AcceptEulasCommand.ts diff --git a/clients/client-nimble/commands/CreateLaunchProfileCommand.ts b/clients/client-nimble/src/commands/CreateLaunchProfileCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateLaunchProfileCommand.ts rename to clients/client-nimble/src/commands/CreateLaunchProfileCommand.ts diff --git a/clients/client-nimble/commands/CreateStreamingImageCommand.ts b/clients/client-nimble/src/commands/CreateStreamingImageCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateStreamingImageCommand.ts rename to clients/client-nimble/src/commands/CreateStreamingImageCommand.ts diff --git a/clients/client-nimble/commands/CreateStreamingSessionCommand.ts b/clients/client-nimble/src/commands/CreateStreamingSessionCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateStreamingSessionCommand.ts rename to clients/client-nimble/src/commands/CreateStreamingSessionCommand.ts diff --git a/clients/client-nimble/commands/CreateStreamingSessionStreamCommand.ts b/clients/client-nimble/src/commands/CreateStreamingSessionStreamCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateStreamingSessionStreamCommand.ts rename to clients/client-nimble/src/commands/CreateStreamingSessionStreamCommand.ts diff --git a/clients/client-nimble/commands/CreateStudioCommand.ts b/clients/client-nimble/src/commands/CreateStudioCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateStudioCommand.ts rename to clients/client-nimble/src/commands/CreateStudioCommand.ts diff --git a/clients/client-nimble/commands/CreateStudioComponentCommand.ts b/clients/client-nimble/src/commands/CreateStudioComponentCommand.ts similarity index 100% rename from clients/client-nimble/commands/CreateStudioComponentCommand.ts rename to clients/client-nimble/src/commands/CreateStudioComponentCommand.ts diff --git a/clients/client-nimble/commands/DeleteLaunchProfileCommand.ts b/clients/client-nimble/src/commands/DeleteLaunchProfileCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteLaunchProfileCommand.ts rename to clients/client-nimble/src/commands/DeleteLaunchProfileCommand.ts diff --git a/clients/client-nimble/commands/DeleteLaunchProfileMemberCommand.ts b/clients/client-nimble/src/commands/DeleteLaunchProfileMemberCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteLaunchProfileMemberCommand.ts rename to clients/client-nimble/src/commands/DeleteLaunchProfileMemberCommand.ts diff --git a/clients/client-nimble/commands/DeleteStreamingImageCommand.ts b/clients/client-nimble/src/commands/DeleteStreamingImageCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteStreamingImageCommand.ts rename to clients/client-nimble/src/commands/DeleteStreamingImageCommand.ts diff --git a/clients/client-nimble/commands/DeleteStreamingSessionCommand.ts b/clients/client-nimble/src/commands/DeleteStreamingSessionCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteStreamingSessionCommand.ts rename to clients/client-nimble/src/commands/DeleteStreamingSessionCommand.ts diff --git a/clients/client-nimble/commands/DeleteStudioCommand.ts b/clients/client-nimble/src/commands/DeleteStudioCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteStudioCommand.ts rename to clients/client-nimble/src/commands/DeleteStudioCommand.ts diff --git a/clients/client-nimble/commands/DeleteStudioComponentCommand.ts b/clients/client-nimble/src/commands/DeleteStudioComponentCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteStudioComponentCommand.ts rename to clients/client-nimble/src/commands/DeleteStudioComponentCommand.ts diff --git a/clients/client-nimble/commands/DeleteStudioMemberCommand.ts b/clients/client-nimble/src/commands/DeleteStudioMemberCommand.ts similarity index 100% rename from clients/client-nimble/commands/DeleteStudioMemberCommand.ts rename to clients/client-nimble/src/commands/DeleteStudioMemberCommand.ts diff --git a/clients/client-nimble/commands/GetEulaCommand.ts b/clients/client-nimble/src/commands/GetEulaCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetEulaCommand.ts rename to clients/client-nimble/src/commands/GetEulaCommand.ts diff --git a/clients/client-nimble/commands/GetLaunchProfileCommand.ts b/clients/client-nimble/src/commands/GetLaunchProfileCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetLaunchProfileCommand.ts rename to clients/client-nimble/src/commands/GetLaunchProfileCommand.ts diff --git a/clients/client-nimble/commands/GetLaunchProfileDetailsCommand.ts b/clients/client-nimble/src/commands/GetLaunchProfileDetailsCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetLaunchProfileDetailsCommand.ts rename to clients/client-nimble/src/commands/GetLaunchProfileDetailsCommand.ts diff --git a/clients/client-nimble/commands/GetLaunchProfileInitializationCommand.ts b/clients/client-nimble/src/commands/GetLaunchProfileInitializationCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetLaunchProfileInitializationCommand.ts rename to clients/client-nimble/src/commands/GetLaunchProfileInitializationCommand.ts diff --git a/clients/client-nimble/commands/GetLaunchProfileMemberCommand.ts b/clients/client-nimble/src/commands/GetLaunchProfileMemberCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetLaunchProfileMemberCommand.ts rename to clients/client-nimble/src/commands/GetLaunchProfileMemberCommand.ts diff --git a/clients/client-nimble/commands/GetStreamingImageCommand.ts b/clients/client-nimble/src/commands/GetStreamingImageCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStreamingImageCommand.ts rename to clients/client-nimble/src/commands/GetStreamingImageCommand.ts diff --git a/clients/client-nimble/commands/GetStreamingSessionCommand.ts b/clients/client-nimble/src/commands/GetStreamingSessionCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStreamingSessionCommand.ts rename to clients/client-nimble/src/commands/GetStreamingSessionCommand.ts diff --git a/clients/client-nimble/commands/GetStreamingSessionStreamCommand.ts b/clients/client-nimble/src/commands/GetStreamingSessionStreamCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStreamingSessionStreamCommand.ts rename to clients/client-nimble/src/commands/GetStreamingSessionStreamCommand.ts diff --git a/clients/client-nimble/commands/GetStudioCommand.ts b/clients/client-nimble/src/commands/GetStudioCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStudioCommand.ts rename to clients/client-nimble/src/commands/GetStudioCommand.ts diff --git a/clients/client-nimble/commands/GetStudioComponentCommand.ts b/clients/client-nimble/src/commands/GetStudioComponentCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStudioComponentCommand.ts rename to clients/client-nimble/src/commands/GetStudioComponentCommand.ts diff --git a/clients/client-nimble/commands/GetStudioMemberCommand.ts b/clients/client-nimble/src/commands/GetStudioMemberCommand.ts similarity index 100% rename from clients/client-nimble/commands/GetStudioMemberCommand.ts rename to clients/client-nimble/src/commands/GetStudioMemberCommand.ts diff --git a/clients/client-nimble/commands/ListEulaAcceptancesCommand.ts b/clients/client-nimble/src/commands/ListEulaAcceptancesCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListEulaAcceptancesCommand.ts rename to clients/client-nimble/src/commands/ListEulaAcceptancesCommand.ts diff --git a/clients/client-nimble/commands/ListEulasCommand.ts b/clients/client-nimble/src/commands/ListEulasCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListEulasCommand.ts rename to clients/client-nimble/src/commands/ListEulasCommand.ts diff --git a/clients/client-nimble/commands/ListLaunchProfileMembersCommand.ts b/clients/client-nimble/src/commands/ListLaunchProfileMembersCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListLaunchProfileMembersCommand.ts rename to clients/client-nimble/src/commands/ListLaunchProfileMembersCommand.ts diff --git a/clients/client-nimble/commands/ListLaunchProfilesCommand.ts b/clients/client-nimble/src/commands/ListLaunchProfilesCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListLaunchProfilesCommand.ts rename to clients/client-nimble/src/commands/ListLaunchProfilesCommand.ts diff --git a/clients/client-nimble/commands/ListStreamingImagesCommand.ts b/clients/client-nimble/src/commands/ListStreamingImagesCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListStreamingImagesCommand.ts rename to clients/client-nimble/src/commands/ListStreamingImagesCommand.ts diff --git a/clients/client-nimble/commands/ListStreamingSessionsCommand.ts b/clients/client-nimble/src/commands/ListStreamingSessionsCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListStreamingSessionsCommand.ts rename to clients/client-nimble/src/commands/ListStreamingSessionsCommand.ts diff --git a/clients/client-nimble/commands/ListStudioComponentsCommand.ts b/clients/client-nimble/src/commands/ListStudioComponentsCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListStudioComponentsCommand.ts rename to clients/client-nimble/src/commands/ListStudioComponentsCommand.ts diff --git a/clients/client-nimble/commands/ListStudioMembersCommand.ts b/clients/client-nimble/src/commands/ListStudioMembersCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListStudioMembersCommand.ts rename to clients/client-nimble/src/commands/ListStudioMembersCommand.ts diff --git a/clients/client-nimble/commands/ListStudiosCommand.ts b/clients/client-nimble/src/commands/ListStudiosCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListStudiosCommand.ts rename to clients/client-nimble/src/commands/ListStudiosCommand.ts diff --git a/clients/client-nimble/commands/ListTagsForResourceCommand.ts b/clients/client-nimble/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-nimble/commands/ListTagsForResourceCommand.ts rename to clients/client-nimble/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-nimble/commands/PutLaunchProfileMembersCommand.ts b/clients/client-nimble/src/commands/PutLaunchProfileMembersCommand.ts similarity index 100% rename from clients/client-nimble/commands/PutLaunchProfileMembersCommand.ts rename to clients/client-nimble/src/commands/PutLaunchProfileMembersCommand.ts diff --git a/clients/client-nimble/commands/PutStudioMembersCommand.ts b/clients/client-nimble/src/commands/PutStudioMembersCommand.ts similarity index 100% rename from clients/client-nimble/commands/PutStudioMembersCommand.ts rename to clients/client-nimble/src/commands/PutStudioMembersCommand.ts diff --git a/clients/client-nimble/commands/StartStudioSSOConfigurationRepairCommand.ts b/clients/client-nimble/src/commands/StartStudioSSOConfigurationRepairCommand.ts similarity index 100% rename from clients/client-nimble/commands/StartStudioSSOConfigurationRepairCommand.ts rename to clients/client-nimble/src/commands/StartStudioSSOConfigurationRepairCommand.ts diff --git a/clients/client-nimble/commands/TagResourceCommand.ts b/clients/client-nimble/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-nimble/commands/TagResourceCommand.ts rename to clients/client-nimble/src/commands/TagResourceCommand.ts diff --git a/clients/client-nimble/commands/UntagResourceCommand.ts b/clients/client-nimble/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-nimble/commands/UntagResourceCommand.ts rename to clients/client-nimble/src/commands/UntagResourceCommand.ts diff --git a/clients/client-nimble/commands/UpdateLaunchProfileCommand.ts b/clients/client-nimble/src/commands/UpdateLaunchProfileCommand.ts similarity index 100% rename from clients/client-nimble/commands/UpdateLaunchProfileCommand.ts rename to clients/client-nimble/src/commands/UpdateLaunchProfileCommand.ts diff --git a/clients/client-nimble/commands/UpdateLaunchProfileMemberCommand.ts b/clients/client-nimble/src/commands/UpdateLaunchProfileMemberCommand.ts similarity index 100% rename from clients/client-nimble/commands/UpdateLaunchProfileMemberCommand.ts rename to clients/client-nimble/src/commands/UpdateLaunchProfileMemberCommand.ts diff --git a/clients/client-nimble/commands/UpdateStreamingImageCommand.ts b/clients/client-nimble/src/commands/UpdateStreamingImageCommand.ts similarity index 100% rename from clients/client-nimble/commands/UpdateStreamingImageCommand.ts rename to clients/client-nimble/src/commands/UpdateStreamingImageCommand.ts diff --git a/clients/client-nimble/commands/UpdateStudioCommand.ts b/clients/client-nimble/src/commands/UpdateStudioCommand.ts similarity index 100% rename from clients/client-nimble/commands/UpdateStudioCommand.ts rename to clients/client-nimble/src/commands/UpdateStudioCommand.ts diff --git a/clients/client-nimble/commands/UpdateStudioComponentCommand.ts b/clients/client-nimble/src/commands/UpdateStudioComponentCommand.ts similarity index 100% rename from clients/client-nimble/commands/UpdateStudioComponentCommand.ts rename to clients/client-nimble/src/commands/UpdateStudioComponentCommand.ts diff --git a/clients/client-nimble/endpoints.ts b/clients/client-nimble/src/endpoints.ts similarity index 100% rename from clients/client-nimble/endpoints.ts rename to clients/client-nimble/src/endpoints.ts diff --git a/clients/client-nimble/index.ts b/clients/client-nimble/src/index.ts similarity index 100% rename from clients/client-nimble/index.ts rename to clients/client-nimble/src/index.ts diff --git a/clients/client-nimble/models/index.ts b/clients/client-nimble/src/models/index.ts similarity index 100% rename from clients/client-nimble/models/index.ts rename to clients/client-nimble/src/models/index.ts diff --git a/clients/client-nimble/models/models_0.ts b/clients/client-nimble/src/models/models_0.ts similarity index 100% rename from clients/client-nimble/models/models_0.ts rename to clients/client-nimble/src/models/models_0.ts diff --git a/clients/client-nimble/protocols/Aws_restJson1.ts b/clients/client-nimble/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-nimble/protocols/Aws_restJson1.ts rename to clients/client-nimble/src/protocols/Aws_restJson1.ts diff --git a/clients/client-nimble/src/runtimeConfig.browser.ts b/clients/client-nimble/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e054e876fd93 --- /dev/null +++ b/clients/client-nimble/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { NimbleClientConfig } from "./NimbleClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NimbleClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-nimble/runtimeConfig.native.ts b/clients/client-nimble/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-nimble/runtimeConfig.native.ts rename to clients/client-nimble/src/runtimeConfig.native.ts diff --git a/clients/client-nimble/runtimeConfig.shared.ts b/clients/client-nimble/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-nimble/runtimeConfig.shared.ts rename to clients/client-nimble/src/runtimeConfig.shared.ts diff --git a/clients/client-nimble/src/runtimeConfig.ts b/clients/client-nimble/src/runtimeConfig.ts new file mode 100644 index 000000000000..060c66ed78ef --- /dev/null +++ b/clients/client-nimble/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { NimbleClientConfig } from "./NimbleClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: NimbleClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-nimble/tsconfig.es.json b/clients/client-nimble/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-nimble/tsconfig.es.json +++ b/clients/client-nimble/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-nimble/tsconfig.json b/clients/client-nimble/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-nimble/tsconfig.json +++ b/clients/client-nimble/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-nimble/tsconfig.types.json b/clients/client-nimble/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-nimble/tsconfig.types.json +++ b/clients/client-nimble/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-opensearch/.gitignore b/clients/client-opensearch/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-opensearch/.gitignore +++ b/clients/client-opensearch/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-opensearch/package.json b/clients/client-opensearch/package.json index 6a2d0e94e77b..eb00d216bda2 100644 --- a/clients/client-opensearch/package.json +++ b/clients/client-opensearch/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-opensearch", "repository": { "type": "git", diff --git a/clients/client-opensearch/runtimeConfig.browser.ts b/clients/client-opensearch/runtimeConfig.browser.ts deleted file mode 100644 index 9f322ee46f7e..000000000000 --- a/clients/client-opensearch/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { OpenSearchClientConfig } from "./OpenSearchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpenSearchClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opensearch/runtimeConfig.ts b/clients/client-opensearch/runtimeConfig.ts deleted file mode 100644 index 5679e9d7c06c..000000000000 --- a/clients/client-opensearch/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { OpenSearchClientConfig } from "./OpenSearchClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpenSearchClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opensearch/OpenSearch.ts b/clients/client-opensearch/src/OpenSearch.ts similarity index 100% rename from clients/client-opensearch/OpenSearch.ts rename to clients/client-opensearch/src/OpenSearch.ts diff --git a/clients/client-opensearch/OpenSearchClient.ts b/clients/client-opensearch/src/OpenSearchClient.ts similarity index 100% rename from clients/client-opensearch/OpenSearchClient.ts rename to clients/client-opensearch/src/OpenSearchClient.ts diff --git a/clients/client-opensearch/commands/AcceptInboundConnectionCommand.ts b/clients/client-opensearch/src/commands/AcceptInboundConnectionCommand.ts similarity index 100% rename from clients/client-opensearch/commands/AcceptInboundConnectionCommand.ts rename to clients/client-opensearch/src/commands/AcceptInboundConnectionCommand.ts diff --git a/clients/client-opensearch/commands/AddTagsCommand.ts b/clients/client-opensearch/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/AddTagsCommand.ts rename to clients/client-opensearch/src/commands/AddTagsCommand.ts diff --git a/clients/client-opensearch/commands/AssociatePackageCommand.ts b/clients/client-opensearch/src/commands/AssociatePackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/AssociatePackageCommand.ts rename to clients/client-opensearch/src/commands/AssociatePackageCommand.ts diff --git a/clients/client-opensearch/commands/CancelServiceSoftwareUpdateCommand.ts b/clients/client-opensearch/src/commands/CancelServiceSoftwareUpdateCommand.ts similarity index 100% rename from clients/client-opensearch/commands/CancelServiceSoftwareUpdateCommand.ts rename to clients/client-opensearch/src/commands/CancelServiceSoftwareUpdateCommand.ts diff --git a/clients/client-opensearch/commands/CreateDomainCommand.ts b/clients/client-opensearch/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-opensearch/commands/CreateDomainCommand.ts rename to clients/client-opensearch/src/commands/CreateDomainCommand.ts diff --git a/clients/client-opensearch/commands/CreateOutboundConnectionCommand.ts b/clients/client-opensearch/src/commands/CreateOutboundConnectionCommand.ts similarity index 100% rename from clients/client-opensearch/commands/CreateOutboundConnectionCommand.ts rename to clients/client-opensearch/src/commands/CreateOutboundConnectionCommand.ts diff --git a/clients/client-opensearch/commands/CreatePackageCommand.ts b/clients/client-opensearch/src/commands/CreatePackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/CreatePackageCommand.ts rename to clients/client-opensearch/src/commands/CreatePackageCommand.ts diff --git a/clients/client-opensearch/commands/DeleteDomainCommand.ts b/clients/client-opensearch/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DeleteDomainCommand.ts rename to clients/client-opensearch/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-opensearch/commands/DeleteInboundConnectionCommand.ts b/clients/client-opensearch/src/commands/DeleteInboundConnectionCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DeleteInboundConnectionCommand.ts rename to clients/client-opensearch/src/commands/DeleteInboundConnectionCommand.ts diff --git a/clients/client-opensearch/commands/DeleteOutboundConnectionCommand.ts b/clients/client-opensearch/src/commands/DeleteOutboundConnectionCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DeleteOutboundConnectionCommand.ts rename to clients/client-opensearch/src/commands/DeleteOutboundConnectionCommand.ts diff --git a/clients/client-opensearch/commands/DeletePackageCommand.ts b/clients/client-opensearch/src/commands/DeletePackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DeletePackageCommand.ts rename to clients/client-opensearch/src/commands/DeletePackageCommand.ts diff --git a/clients/client-opensearch/commands/DescribeDomainAutoTunesCommand.ts b/clients/client-opensearch/src/commands/DescribeDomainAutoTunesCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeDomainAutoTunesCommand.ts rename to clients/client-opensearch/src/commands/DescribeDomainAutoTunesCommand.ts diff --git a/clients/client-opensearch/commands/DescribeDomainCommand.ts b/clients/client-opensearch/src/commands/DescribeDomainCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeDomainCommand.ts rename to clients/client-opensearch/src/commands/DescribeDomainCommand.ts diff --git a/clients/client-opensearch/commands/DescribeDomainConfigCommand.ts b/clients/client-opensearch/src/commands/DescribeDomainConfigCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeDomainConfigCommand.ts rename to clients/client-opensearch/src/commands/DescribeDomainConfigCommand.ts diff --git a/clients/client-opensearch/commands/DescribeDomainsCommand.ts b/clients/client-opensearch/src/commands/DescribeDomainsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeDomainsCommand.ts rename to clients/client-opensearch/src/commands/DescribeDomainsCommand.ts diff --git a/clients/client-opensearch/commands/DescribeInboundConnectionsCommand.ts b/clients/client-opensearch/src/commands/DescribeInboundConnectionsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeInboundConnectionsCommand.ts rename to clients/client-opensearch/src/commands/DescribeInboundConnectionsCommand.ts diff --git a/clients/client-opensearch/commands/DescribeInstanceTypeLimitsCommand.ts b/clients/client-opensearch/src/commands/DescribeInstanceTypeLimitsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeInstanceTypeLimitsCommand.ts rename to clients/client-opensearch/src/commands/DescribeInstanceTypeLimitsCommand.ts diff --git a/clients/client-opensearch/commands/DescribeOutboundConnectionsCommand.ts b/clients/client-opensearch/src/commands/DescribeOutboundConnectionsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeOutboundConnectionsCommand.ts rename to clients/client-opensearch/src/commands/DescribeOutboundConnectionsCommand.ts diff --git a/clients/client-opensearch/commands/DescribePackagesCommand.ts b/clients/client-opensearch/src/commands/DescribePackagesCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribePackagesCommand.ts rename to clients/client-opensearch/src/commands/DescribePackagesCommand.ts diff --git a/clients/client-opensearch/commands/DescribeReservedInstanceOfferingsCommand.ts b/clients/client-opensearch/src/commands/DescribeReservedInstanceOfferingsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeReservedInstanceOfferingsCommand.ts rename to clients/client-opensearch/src/commands/DescribeReservedInstanceOfferingsCommand.ts diff --git a/clients/client-opensearch/commands/DescribeReservedInstancesCommand.ts b/clients/client-opensearch/src/commands/DescribeReservedInstancesCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DescribeReservedInstancesCommand.ts rename to clients/client-opensearch/src/commands/DescribeReservedInstancesCommand.ts diff --git a/clients/client-opensearch/commands/DissociatePackageCommand.ts b/clients/client-opensearch/src/commands/DissociatePackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/DissociatePackageCommand.ts rename to clients/client-opensearch/src/commands/DissociatePackageCommand.ts diff --git a/clients/client-opensearch/commands/GetCompatibleVersionsCommand.ts b/clients/client-opensearch/src/commands/GetCompatibleVersionsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/GetCompatibleVersionsCommand.ts rename to clients/client-opensearch/src/commands/GetCompatibleVersionsCommand.ts diff --git a/clients/client-opensearch/commands/GetPackageVersionHistoryCommand.ts b/clients/client-opensearch/src/commands/GetPackageVersionHistoryCommand.ts similarity index 100% rename from clients/client-opensearch/commands/GetPackageVersionHistoryCommand.ts rename to clients/client-opensearch/src/commands/GetPackageVersionHistoryCommand.ts diff --git a/clients/client-opensearch/commands/GetUpgradeHistoryCommand.ts b/clients/client-opensearch/src/commands/GetUpgradeHistoryCommand.ts similarity index 100% rename from clients/client-opensearch/commands/GetUpgradeHistoryCommand.ts rename to clients/client-opensearch/src/commands/GetUpgradeHistoryCommand.ts diff --git a/clients/client-opensearch/commands/GetUpgradeStatusCommand.ts b/clients/client-opensearch/src/commands/GetUpgradeStatusCommand.ts similarity index 100% rename from clients/client-opensearch/commands/GetUpgradeStatusCommand.ts rename to clients/client-opensearch/src/commands/GetUpgradeStatusCommand.ts diff --git a/clients/client-opensearch/commands/ListDomainNamesCommand.ts b/clients/client-opensearch/src/commands/ListDomainNamesCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListDomainNamesCommand.ts rename to clients/client-opensearch/src/commands/ListDomainNamesCommand.ts diff --git a/clients/client-opensearch/commands/ListDomainsForPackageCommand.ts b/clients/client-opensearch/src/commands/ListDomainsForPackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListDomainsForPackageCommand.ts rename to clients/client-opensearch/src/commands/ListDomainsForPackageCommand.ts diff --git a/clients/client-opensearch/commands/ListInstanceTypeDetailsCommand.ts b/clients/client-opensearch/src/commands/ListInstanceTypeDetailsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListInstanceTypeDetailsCommand.ts rename to clients/client-opensearch/src/commands/ListInstanceTypeDetailsCommand.ts diff --git a/clients/client-opensearch/commands/ListPackagesForDomainCommand.ts b/clients/client-opensearch/src/commands/ListPackagesForDomainCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListPackagesForDomainCommand.ts rename to clients/client-opensearch/src/commands/ListPackagesForDomainCommand.ts diff --git a/clients/client-opensearch/commands/ListTagsCommand.ts b/clients/client-opensearch/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListTagsCommand.ts rename to clients/client-opensearch/src/commands/ListTagsCommand.ts diff --git a/clients/client-opensearch/commands/ListVersionsCommand.ts b/clients/client-opensearch/src/commands/ListVersionsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/ListVersionsCommand.ts rename to clients/client-opensearch/src/commands/ListVersionsCommand.ts diff --git a/clients/client-opensearch/commands/PurchaseReservedInstanceOfferingCommand.ts b/clients/client-opensearch/src/commands/PurchaseReservedInstanceOfferingCommand.ts similarity index 100% rename from clients/client-opensearch/commands/PurchaseReservedInstanceOfferingCommand.ts rename to clients/client-opensearch/src/commands/PurchaseReservedInstanceOfferingCommand.ts diff --git a/clients/client-opensearch/commands/RejectInboundConnectionCommand.ts b/clients/client-opensearch/src/commands/RejectInboundConnectionCommand.ts similarity index 100% rename from clients/client-opensearch/commands/RejectInboundConnectionCommand.ts rename to clients/client-opensearch/src/commands/RejectInboundConnectionCommand.ts diff --git a/clients/client-opensearch/commands/RemoveTagsCommand.ts b/clients/client-opensearch/src/commands/RemoveTagsCommand.ts similarity index 100% rename from clients/client-opensearch/commands/RemoveTagsCommand.ts rename to clients/client-opensearch/src/commands/RemoveTagsCommand.ts diff --git a/clients/client-opensearch/commands/StartServiceSoftwareUpdateCommand.ts b/clients/client-opensearch/src/commands/StartServiceSoftwareUpdateCommand.ts similarity index 100% rename from clients/client-opensearch/commands/StartServiceSoftwareUpdateCommand.ts rename to clients/client-opensearch/src/commands/StartServiceSoftwareUpdateCommand.ts diff --git a/clients/client-opensearch/commands/UpdateDomainConfigCommand.ts b/clients/client-opensearch/src/commands/UpdateDomainConfigCommand.ts similarity index 100% rename from clients/client-opensearch/commands/UpdateDomainConfigCommand.ts rename to clients/client-opensearch/src/commands/UpdateDomainConfigCommand.ts diff --git a/clients/client-opensearch/commands/UpdatePackageCommand.ts b/clients/client-opensearch/src/commands/UpdatePackageCommand.ts similarity index 100% rename from clients/client-opensearch/commands/UpdatePackageCommand.ts rename to clients/client-opensearch/src/commands/UpdatePackageCommand.ts diff --git a/clients/client-opensearch/commands/UpgradeDomainCommand.ts b/clients/client-opensearch/src/commands/UpgradeDomainCommand.ts similarity index 100% rename from clients/client-opensearch/commands/UpgradeDomainCommand.ts rename to clients/client-opensearch/src/commands/UpgradeDomainCommand.ts diff --git a/clients/client-opensearch/endpoints.ts b/clients/client-opensearch/src/endpoints.ts similarity index 100% rename from clients/client-opensearch/endpoints.ts rename to clients/client-opensearch/src/endpoints.ts diff --git a/clients/client-opensearch/index.ts b/clients/client-opensearch/src/index.ts similarity index 100% rename from clients/client-opensearch/index.ts rename to clients/client-opensearch/src/index.ts diff --git a/clients/client-opensearch/models/index.ts b/clients/client-opensearch/src/models/index.ts similarity index 100% rename from clients/client-opensearch/models/index.ts rename to clients/client-opensearch/src/models/index.ts diff --git a/clients/client-opensearch/models/models_0.ts b/clients/client-opensearch/src/models/models_0.ts similarity index 100% rename from clients/client-opensearch/models/models_0.ts rename to clients/client-opensearch/src/models/models_0.ts diff --git a/clients/client-opensearch/pagination/DescribeDomainAutoTunesPaginator.ts b/clients/client-opensearch/src/pagination/DescribeDomainAutoTunesPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribeDomainAutoTunesPaginator.ts rename to clients/client-opensearch/src/pagination/DescribeDomainAutoTunesPaginator.ts diff --git a/clients/client-opensearch/pagination/DescribeInboundConnectionsPaginator.ts b/clients/client-opensearch/src/pagination/DescribeInboundConnectionsPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribeInboundConnectionsPaginator.ts rename to clients/client-opensearch/src/pagination/DescribeInboundConnectionsPaginator.ts diff --git a/clients/client-opensearch/pagination/DescribeOutboundConnectionsPaginator.ts b/clients/client-opensearch/src/pagination/DescribeOutboundConnectionsPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribeOutboundConnectionsPaginator.ts rename to clients/client-opensearch/src/pagination/DescribeOutboundConnectionsPaginator.ts diff --git a/clients/client-opensearch/pagination/DescribePackagesPaginator.ts b/clients/client-opensearch/src/pagination/DescribePackagesPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribePackagesPaginator.ts rename to clients/client-opensearch/src/pagination/DescribePackagesPaginator.ts diff --git a/clients/client-opensearch/pagination/DescribeReservedInstanceOfferingsPaginator.ts b/clients/client-opensearch/src/pagination/DescribeReservedInstanceOfferingsPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribeReservedInstanceOfferingsPaginator.ts rename to clients/client-opensearch/src/pagination/DescribeReservedInstanceOfferingsPaginator.ts diff --git a/clients/client-opensearch/pagination/DescribeReservedInstancesPaginator.ts b/clients/client-opensearch/src/pagination/DescribeReservedInstancesPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/DescribeReservedInstancesPaginator.ts rename to clients/client-opensearch/src/pagination/DescribeReservedInstancesPaginator.ts diff --git a/clients/client-opensearch/pagination/GetPackageVersionHistoryPaginator.ts b/clients/client-opensearch/src/pagination/GetPackageVersionHistoryPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/GetPackageVersionHistoryPaginator.ts rename to clients/client-opensearch/src/pagination/GetPackageVersionHistoryPaginator.ts diff --git a/clients/client-opensearch/pagination/GetUpgradeHistoryPaginator.ts b/clients/client-opensearch/src/pagination/GetUpgradeHistoryPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/GetUpgradeHistoryPaginator.ts rename to clients/client-opensearch/src/pagination/GetUpgradeHistoryPaginator.ts diff --git a/clients/client-opensearch/pagination/Interfaces.ts b/clients/client-opensearch/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-opensearch/pagination/Interfaces.ts rename to clients/client-opensearch/src/pagination/Interfaces.ts diff --git a/clients/client-opensearch/pagination/ListDomainsForPackagePaginator.ts b/clients/client-opensearch/src/pagination/ListDomainsForPackagePaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/ListDomainsForPackagePaginator.ts rename to clients/client-opensearch/src/pagination/ListDomainsForPackagePaginator.ts diff --git a/clients/client-opensearch/pagination/ListInstanceTypeDetailsPaginator.ts b/clients/client-opensearch/src/pagination/ListInstanceTypeDetailsPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/ListInstanceTypeDetailsPaginator.ts rename to clients/client-opensearch/src/pagination/ListInstanceTypeDetailsPaginator.ts diff --git a/clients/client-opensearch/pagination/ListPackagesForDomainPaginator.ts b/clients/client-opensearch/src/pagination/ListPackagesForDomainPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/ListPackagesForDomainPaginator.ts rename to clients/client-opensearch/src/pagination/ListPackagesForDomainPaginator.ts diff --git a/clients/client-opensearch/pagination/ListVersionsPaginator.ts b/clients/client-opensearch/src/pagination/ListVersionsPaginator.ts similarity index 100% rename from clients/client-opensearch/pagination/ListVersionsPaginator.ts rename to clients/client-opensearch/src/pagination/ListVersionsPaginator.ts diff --git a/clients/client-opensearch/protocols/Aws_restJson1.ts b/clients/client-opensearch/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-opensearch/protocols/Aws_restJson1.ts rename to clients/client-opensearch/src/protocols/Aws_restJson1.ts diff --git a/clients/client-opensearch/src/runtimeConfig.browser.ts b/clients/client-opensearch/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5d0ca5902cef --- /dev/null +++ b/clients/client-opensearch/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { OpenSearchClientConfig } from "./OpenSearchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpenSearchClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opensearch/runtimeConfig.native.ts b/clients/client-opensearch/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-opensearch/runtimeConfig.native.ts rename to clients/client-opensearch/src/runtimeConfig.native.ts diff --git a/clients/client-opensearch/runtimeConfig.shared.ts b/clients/client-opensearch/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-opensearch/runtimeConfig.shared.ts rename to clients/client-opensearch/src/runtimeConfig.shared.ts diff --git a/clients/client-opensearch/src/runtimeConfig.ts b/clients/client-opensearch/src/runtimeConfig.ts new file mode 100644 index 000000000000..115fcb62b713 --- /dev/null +++ b/clients/client-opensearch/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { OpenSearchClientConfig } from "./OpenSearchClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpenSearchClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opensearch/tsconfig.es.json b/clients/client-opensearch/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-opensearch/tsconfig.es.json +++ b/clients/client-opensearch/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-opensearch/tsconfig.json b/clients/client-opensearch/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-opensearch/tsconfig.json +++ b/clients/client-opensearch/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-opensearch/tsconfig.types.json b/clients/client-opensearch/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-opensearch/tsconfig.types.json +++ b/clients/client-opensearch/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-opsworks/.gitignore b/clients/client-opsworks/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-opsworks/.gitignore +++ b/clients/client-opsworks/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-opsworks/package.json b/clients/client-opsworks/package.json index f08097533297..f7c3de3c0004 100644 --- a/clients/client-opsworks/package.json +++ b/clients/client-opsworks/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-opsworks", "repository": { "type": "git", diff --git a/clients/client-opsworks/runtimeConfig.browser.ts b/clients/client-opsworks/runtimeConfig.browser.ts deleted file mode 100644 index f59dc64de334..000000000000 --- a/clients/client-opsworks/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { OpsWorksClientConfig } from "./OpsWorksClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpsWorksClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opsworks/runtimeConfig.ts b/clients/client-opsworks/runtimeConfig.ts deleted file mode 100644 index c775ab497816..000000000000 --- a/clients/client-opsworks/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { OpsWorksClientConfig } from "./OpsWorksClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpsWorksClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opsworks/OpsWorks.ts b/clients/client-opsworks/src/OpsWorks.ts similarity index 100% rename from clients/client-opsworks/OpsWorks.ts rename to clients/client-opsworks/src/OpsWorks.ts diff --git a/clients/client-opsworks/OpsWorksClient.ts b/clients/client-opsworks/src/OpsWorksClient.ts similarity index 100% rename from clients/client-opsworks/OpsWorksClient.ts rename to clients/client-opsworks/src/OpsWorksClient.ts diff --git a/clients/client-opsworks/commands/AssignInstanceCommand.ts b/clients/client-opsworks/src/commands/AssignInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/AssignInstanceCommand.ts rename to clients/client-opsworks/src/commands/AssignInstanceCommand.ts diff --git a/clients/client-opsworks/commands/AssignVolumeCommand.ts b/clients/client-opsworks/src/commands/AssignVolumeCommand.ts similarity index 100% rename from clients/client-opsworks/commands/AssignVolumeCommand.ts rename to clients/client-opsworks/src/commands/AssignVolumeCommand.ts diff --git a/clients/client-opsworks/commands/AssociateElasticIpCommand.ts b/clients/client-opsworks/src/commands/AssociateElasticIpCommand.ts similarity index 100% rename from clients/client-opsworks/commands/AssociateElasticIpCommand.ts rename to clients/client-opsworks/src/commands/AssociateElasticIpCommand.ts diff --git a/clients/client-opsworks/commands/AttachElasticLoadBalancerCommand.ts b/clients/client-opsworks/src/commands/AttachElasticLoadBalancerCommand.ts similarity index 100% rename from clients/client-opsworks/commands/AttachElasticLoadBalancerCommand.ts rename to clients/client-opsworks/src/commands/AttachElasticLoadBalancerCommand.ts diff --git a/clients/client-opsworks/commands/CloneStackCommand.ts b/clients/client-opsworks/src/commands/CloneStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CloneStackCommand.ts rename to clients/client-opsworks/src/commands/CloneStackCommand.ts diff --git a/clients/client-opsworks/commands/CreateAppCommand.ts b/clients/client-opsworks/src/commands/CreateAppCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateAppCommand.ts rename to clients/client-opsworks/src/commands/CreateAppCommand.ts diff --git a/clients/client-opsworks/commands/CreateDeploymentCommand.ts b/clients/client-opsworks/src/commands/CreateDeploymentCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateDeploymentCommand.ts rename to clients/client-opsworks/src/commands/CreateDeploymentCommand.ts diff --git a/clients/client-opsworks/commands/CreateInstanceCommand.ts b/clients/client-opsworks/src/commands/CreateInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateInstanceCommand.ts rename to clients/client-opsworks/src/commands/CreateInstanceCommand.ts diff --git a/clients/client-opsworks/commands/CreateLayerCommand.ts b/clients/client-opsworks/src/commands/CreateLayerCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateLayerCommand.ts rename to clients/client-opsworks/src/commands/CreateLayerCommand.ts diff --git a/clients/client-opsworks/commands/CreateStackCommand.ts b/clients/client-opsworks/src/commands/CreateStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateStackCommand.ts rename to clients/client-opsworks/src/commands/CreateStackCommand.ts diff --git a/clients/client-opsworks/commands/CreateUserProfileCommand.ts b/clients/client-opsworks/src/commands/CreateUserProfileCommand.ts similarity index 100% rename from clients/client-opsworks/commands/CreateUserProfileCommand.ts rename to clients/client-opsworks/src/commands/CreateUserProfileCommand.ts diff --git a/clients/client-opsworks/commands/DeleteAppCommand.ts b/clients/client-opsworks/src/commands/DeleteAppCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeleteAppCommand.ts rename to clients/client-opsworks/src/commands/DeleteAppCommand.ts diff --git a/clients/client-opsworks/commands/DeleteInstanceCommand.ts b/clients/client-opsworks/src/commands/DeleteInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeleteInstanceCommand.ts rename to clients/client-opsworks/src/commands/DeleteInstanceCommand.ts diff --git a/clients/client-opsworks/commands/DeleteLayerCommand.ts b/clients/client-opsworks/src/commands/DeleteLayerCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeleteLayerCommand.ts rename to clients/client-opsworks/src/commands/DeleteLayerCommand.ts diff --git a/clients/client-opsworks/commands/DeleteStackCommand.ts b/clients/client-opsworks/src/commands/DeleteStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeleteStackCommand.ts rename to clients/client-opsworks/src/commands/DeleteStackCommand.ts diff --git a/clients/client-opsworks/commands/DeleteUserProfileCommand.ts b/clients/client-opsworks/src/commands/DeleteUserProfileCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeleteUserProfileCommand.ts rename to clients/client-opsworks/src/commands/DeleteUserProfileCommand.ts diff --git a/clients/client-opsworks/commands/DeregisterEcsClusterCommand.ts b/clients/client-opsworks/src/commands/DeregisterEcsClusterCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeregisterEcsClusterCommand.ts rename to clients/client-opsworks/src/commands/DeregisterEcsClusterCommand.ts diff --git a/clients/client-opsworks/commands/DeregisterElasticIpCommand.ts b/clients/client-opsworks/src/commands/DeregisterElasticIpCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeregisterElasticIpCommand.ts rename to clients/client-opsworks/src/commands/DeregisterElasticIpCommand.ts diff --git a/clients/client-opsworks/commands/DeregisterInstanceCommand.ts b/clients/client-opsworks/src/commands/DeregisterInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeregisterInstanceCommand.ts rename to clients/client-opsworks/src/commands/DeregisterInstanceCommand.ts diff --git a/clients/client-opsworks/commands/DeregisterRdsDbInstanceCommand.ts b/clients/client-opsworks/src/commands/DeregisterRdsDbInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeregisterRdsDbInstanceCommand.ts rename to clients/client-opsworks/src/commands/DeregisterRdsDbInstanceCommand.ts diff --git a/clients/client-opsworks/commands/DeregisterVolumeCommand.ts b/clients/client-opsworks/src/commands/DeregisterVolumeCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DeregisterVolumeCommand.ts rename to clients/client-opsworks/src/commands/DeregisterVolumeCommand.ts diff --git a/clients/client-opsworks/commands/DescribeAgentVersionsCommand.ts b/clients/client-opsworks/src/commands/DescribeAgentVersionsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeAgentVersionsCommand.ts rename to clients/client-opsworks/src/commands/DescribeAgentVersionsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeAppsCommand.ts b/clients/client-opsworks/src/commands/DescribeAppsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeAppsCommand.ts rename to clients/client-opsworks/src/commands/DescribeAppsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeCommandsCommand.ts b/clients/client-opsworks/src/commands/DescribeCommandsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeCommandsCommand.ts rename to clients/client-opsworks/src/commands/DescribeCommandsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeDeploymentsCommand.ts b/clients/client-opsworks/src/commands/DescribeDeploymentsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeDeploymentsCommand.ts rename to clients/client-opsworks/src/commands/DescribeDeploymentsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeEcsClustersCommand.ts b/clients/client-opsworks/src/commands/DescribeEcsClustersCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeEcsClustersCommand.ts rename to clients/client-opsworks/src/commands/DescribeEcsClustersCommand.ts diff --git a/clients/client-opsworks/commands/DescribeElasticIpsCommand.ts b/clients/client-opsworks/src/commands/DescribeElasticIpsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeElasticIpsCommand.ts rename to clients/client-opsworks/src/commands/DescribeElasticIpsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeElasticLoadBalancersCommand.ts b/clients/client-opsworks/src/commands/DescribeElasticLoadBalancersCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeElasticLoadBalancersCommand.ts rename to clients/client-opsworks/src/commands/DescribeElasticLoadBalancersCommand.ts diff --git a/clients/client-opsworks/commands/DescribeInstancesCommand.ts b/clients/client-opsworks/src/commands/DescribeInstancesCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeInstancesCommand.ts rename to clients/client-opsworks/src/commands/DescribeInstancesCommand.ts diff --git a/clients/client-opsworks/commands/DescribeLayersCommand.ts b/clients/client-opsworks/src/commands/DescribeLayersCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeLayersCommand.ts rename to clients/client-opsworks/src/commands/DescribeLayersCommand.ts diff --git a/clients/client-opsworks/commands/DescribeLoadBasedAutoScalingCommand.ts b/clients/client-opsworks/src/commands/DescribeLoadBasedAutoScalingCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeLoadBasedAutoScalingCommand.ts rename to clients/client-opsworks/src/commands/DescribeLoadBasedAutoScalingCommand.ts diff --git a/clients/client-opsworks/commands/DescribeMyUserProfileCommand.ts b/clients/client-opsworks/src/commands/DescribeMyUserProfileCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeMyUserProfileCommand.ts rename to clients/client-opsworks/src/commands/DescribeMyUserProfileCommand.ts diff --git a/clients/client-opsworks/commands/DescribeOperatingSystemsCommand.ts b/clients/client-opsworks/src/commands/DescribeOperatingSystemsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeOperatingSystemsCommand.ts rename to clients/client-opsworks/src/commands/DescribeOperatingSystemsCommand.ts diff --git a/clients/client-opsworks/commands/DescribePermissionsCommand.ts b/clients/client-opsworks/src/commands/DescribePermissionsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribePermissionsCommand.ts rename to clients/client-opsworks/src/commands/DescribePermissionsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeRaidArraysCommand.ts b/clients/client-opsworks/src/commands/DescribeRaidArraysCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeRaidArraysCommand.ts rename to clients/client-opsworks/src/commands/DescribeRaidArraysCommand.ts diff --git a/clients/client-opsworks/commands/DescribeRdsDbInstancesCommand.ts b/clients/client-opsworks/src/commands/DescribeRdsDbInstancesCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeRdsDbInstancesCommand.ts rename to clients/client-opsworks/src/commands/DescribeRdsDbInstancesCommand.ts diff --git a/clients/client-opsworks/commands/DescribeServiceErrorsCommand.ts b/clients/client-opsworks/src/commands/DescribeServiceErrorsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeServiceErrorsCommand.ts rename to clients/client-opsworks/src/commands/DescribeServiceErrorsCommand.ts diff --git a/clients/client-opsworks/commands/DescribeStackProvisioningParametersCommand.ts b/clients/client-opsworks/src/commands/DescribeStackProvisioningParametersCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeStackProvisioningParametersCommand.ts rename to clients/client-opsworks/src/commands/DescribeStackProvisioningParametersCommand.ts diff --git a/clients/client-opsworks/commands/DescribeStackSummaryCommand.ts b/clients/client-opsworks/src/commands/DescribeStackSummaryCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeStackSummaryCommand.ts rename to clients/client-opsworks/src/commands/DescribeStackSummaryCommand.ts diff --git a/clients/client-opsworks/commands/DescribeStacksCommand.ts b/clients/client-opsworks/src/commands/DescribeStacksCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeStacksCommand.ts rename to clients/client-opsworks/src/commands/DescribeStacksCommand.ts diff --git a/clients/client-opsworks/commands/DescribeTimeBasedAutoScalingCommand.ts b/clients/client-opsworks/src/commands/DescribeTimeBasedAutoScalingCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeTimeBasedAutoScalingCommand.ts rename to clients/client-opsworks/src/commands/DescribeTimeBasedAutoScalingCommand.ts diff --git a/clients/client-opsworks/commands/DescribeUserProfilesCommand.ts b/clients/client-opsworks/src/commands/DescribeUserProfilesCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeUserProfilesCommand.ts rename to clients/client-opsworks/src/commands/DescribeUserProfilesCommand.ts diff --git a/clients/client-opsworks/commands/DescribeVolumesCommand.ts b/clients/client-opsworks/src/commands/DescribeVolumesCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DescribeVolumesCommand.ts rename to clients/client-opsworks/src/commands/DescribeVolumesCommand.ts diff --git a/clients/client-opsworks/commands/DetachElasticLoadBalancerCommand.ts b/clients/client-opsworks/src/commands/DetachElasticLoadBalancerCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DetachElasticLoadBalancerCommand.ts rename to clients/client-opsworks/src/commands/DetachElasticLoadBalancerCommand.ts diff --git a/clients/client-opsworks/commands/DisassociateElasticIpCommand.ts b/clients/client-opsworks/src/commands/DisassociateElasticIpCommand.ts similarity index 100% rename from clients/client-opsworks/commands/DisassociateElasticIpCommand.ts rename to clients/client-opsworks/src/commands/DisassociateElasticIpCommand.ts diff --git a/clients/client-opsworks/commands/GetHostnameSuggestionCommand.ts b/clients/client-opsworks/src/commands/GetHostnameSuggestionCommand.ts similarity index 100% rename from clients/client-opsworks/commands/GetHostnameSuggestionCommand.ts rename to clients/client-opsworks/src/commands/GetHostnameSuggestionCommand.ts diff --git a/clients/client-opsworks/commands/GrantAccessCommand.ts b/clients/client-opsworks/src/commands/GrantAccessCommand.ts similarity index 100% rename from clients/client-opsworks/commands/GrantAccessCommand.ts rename to clients/client-opsworks/src/commands/GrantAccessCommand.ts diff --git a/clients/client-opsworks/commands/ListTagsCommand.ts b/clients/client-opsworks/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-opsworks/commands/ListTagsCommand.ts rename to clients/client-opsworks/src/commands/ListTagsCommand.ts diff --git a/clients/client-opsworks/commands/RebootInstanceCommand.ts b/clients/client-opsworks/src/commands/RebootInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RebootInstanceCommand.ts rename to clients/client-opsworks/src/commands/RebootInstanceCommand.ts diff --git a/clients/client-opsworks/commands/RegisterEcsClusterCommand.ts b/clients/client-opsworks/src/commands/RegisterEcsClusterCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RegisterEcsClusterCommand.ts rename to clients/client-opsworks/src/commands/RegisterEcsClusterCommand.ts diff --git a/clients/client-opsworks/commands/RegisterElasticIpCommand.ts b/clients/client-opsworks/src/commands/RegisterElasticIpCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RegisterElasticIpCommand.ts rename to clients/client-opsworks/src/commands/RegisterElasticIpCommand.ts diff --git a/clients/client-opsworks/commands/RegisterInstanceCommand.ts b/clients/client-opsworks/src/commands/RegisterInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RegisterInstanceCommand.ts rename to clients/client-opsworks/src/commands/RegisterInstanceCommand.ts diff --git a/clients/client-opsworks/commands/RegisterRdsDbInstanceCommand.ts b/clients/client-opsworks/src/commands/RegisterRdsDbInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RegisterRdsDbInstanceCommand.ts rename to clients/client-opsworks/src/commands/RegisterRdsDbInstanceCommand.ts diff --git a/clients/client-opsworks/commands/RegisterVolumeCommand.ts b/clients/client-opsworks/src/commands/RegisterVolumeCommand.ts similarity index 100% rename from clients/client-opsworks/commands/RegisterVolumeCommand.ts rename to clients/client-opsworks/src/commands/RegisterVolumeCommand.ts diff --git a/clients/client-opsworks/commands/SetLoadBasedAutoScalingCommand.ts b/clients/client-opsworks/src/commands/SetLoadBasedAutoScalingCommand.ts similarity index 100% rename from clients/client-opsworks/commands/SetLoadBasedAutoScalingCommand.ts rename to clients/client-opsworks/src/commands/SetLoadBasedAutoScalingCommand.ts diff --git a/clients/client-opsworks/commands/SetPermissionCommand.ts b/clients/client-opsworks/src/commands/SetPermissionCommand.ts similarity index 100% rename from clients/client-opsworks/commands/SetPermissionCommand.ts rename to clients/client-opsworks/src/commands/SetPermissionCommand.ts diff --git a/clients/client-opsworks/commands/SetTimeBasedAutoScalingCommand.ts b/clients/client-opsworks/src/commands/SetTimeBasedAutoScalingCommand.ts similarity index 100% rename from clients/client-opsworks/commands/SetTimeBasedAutoScalingCommand.ts rename to clients/client-opsworks/src/commands/SetTimeBasedAutoScalingCommand.ts diff --git a/clients/client-opsworks/commands/StartInstanceCommand.ts b/clients/client-opsworks/src/commands/StartInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/StartInstanceCommand.ts rename to clients/client-opsworks/src/commands/StartInstanceCommand.ts diff --git a/clients/client-opsworks/commands/StartStackCommand.ts b/clients/client-opsworks/src/commands/StartStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/StartStackCommand.ts rename to clients/client-opsworks/src/commands/StartStackCommand.ts diff --git a/clients/client-opsworks/commands/StopInstanceCommand.ts b/clients/client-opsworks/src/commands/StopInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/StopInstanceCommand.ts rename to clients/client-opsworks/src/commands/StopInstanceCommand.ts diff --git a/clients/client-opsworks/commands/StopStackCommand.ts b/clients/client-opsworks/src/commands/StopStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/StopStackCommand.ts rename to clients/client-opsworks/src/commands/StopStackCommand.ts diff --git a/clients/client-opsworks/commands/TagResourceCommand.ts b/clients/client-opsworks/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/TagResourceCommand.ts rename to clients/client-opsworks/src/commands/TagResourceCommand.ts diff --git a/clients/client-opsworks/commands/UnassignInstanceCommand.ts b/clients/client-opsworks/src/commands/UnassignInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UnassignInstanceCommand.ts rename to clients/client-opsworks/src/commands/UnassignInstanceCommand.ts diff --git a/clients/client-opsworks/commands/UnassignVolumeCommand.ts b/clients/client-opsworks/src/commands/UnassignVolumeCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UnassignVolumeCommand.ts rename to clients/client-opsworks/src/commands/UnassignVolumeCommand.ts diff --git a/clients/client-opsworks/commands/UntagResourceCommand.ts b/clients/client-opsworks/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UntagResourceCommand.ts rename to clients/client-opsworks/src/commands/UntagResourceCommand.ts diff --git a/clients/client-opsworks/commands/UpdateAppCommand.ts b/clients/client-opsworks/src/commands/UpdateAppCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateAppCommand.ts rename to clients/client-opsworks/src/commands/UpdateAppCommand.ts diff --git a/clients/client-opsworks/commands/UpdateElasticIpCommand.ts b/clients/client-opsworks/src/commands/UpdateElasticIpCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateElasticIpCommand.ts rename to clients/client-opsworks/src/commands/UpdateElasticIpCommand.ts diff --git a/clients/client-opsworks/commands/UpdateInstanceCommand.ts b/clients/client-opsworks/src/commands/UpdateInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateInstanceCommand.ts rename to clients/client-opsworks/src/commands/UpdateInstanceCommand.ts diff --git a/clients/client-opsworks/commands/UpdateLayerCommand.ts b/clients/client-opsworks/src/commands/UpdateLayerCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateLayerCommand.ts rename to clients/client-opsworks/src/commands/UpdateLayerCommand.ts diff --git a/clients/client-opsworks/commands/UpdateMyUserProfileCommand.ts b/clients/client-opsworks/src/commands/UpdateMyUserProfileCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateMyUserProfileCommand.ts rename to clients/client-opsworks/src/commands/UpdateMyUserProfileCommand.ts diff --git a/clients/client-opsworks/commands/UpdateRdsDbInstanceCommand.ts b/clients/client-opsworks/src/commands/UpdateRdsDbInstanceCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateRdsDbInstanceCommand.ts rename to clients/client-opsworks/src/commands/UpdateRdsDbInstanceCommand.ts diff --git a/clients/client-opsworks/commands/UpdateStackCommand.ts b/clients/client-opsworks/src/commands/UpdateStackCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateStackCommand.ts rename to clients/client-opsworks/src/commands/UpdateStackCommand.ts diff --git a/clients/client-opsworks/commands/UpdateUserProfileCommand.ts b/clients/client-opsworks/src/commands/UpdateUserProfileCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateUserProfileCommand.ts rename to clients/client-opsworks/src/commands/UpdateUserProfileCommand.ts diff --git a/clients/client-opsworks/commands/UpdateVolumeCommand.ts b/clients/client-opsworks/src/commands/UpdateVolumeCommand.ts similarity index 100% rename from clients/client-opsworks/commands/UpdateVolumeCommand.ts rename to clients/client-opsworks/src/commands/UpdateVolumeCommand.ts diff --git a/clients/client-opsworks/endpoints.ts b/clients/client-opsworks/src/endpoints.ts similarity index 100% rename from clients/client-opsworks/endpoints.ts rename to clients/client-opsworks/src/endpoints.ts diff --git a/clients/client-opsworks/index.ts b/clients/client-opsworks/src/index.ts similarity index 100% rename from clients/client-opsworks/index.ts rename to clients/client-opsworks/src/index.ts diff --git a/clients/client-opsworks/models/index.ts b/clients/client-opsworks/src/models/index.ts similarity index 100% rename from clients/client-opsworks/models/index.ts rename to clients/client-opsworks/src/models/index.ts diff --git a/clients/client-opsworks/models/models_0.ts b/clients/client-opsworks/src/models/models_0.ts similarity index 100% rename from clients/client-opsworks/models/models_0.ts rename to clients/client-opsworks/src/models/models_0.ts diff --git a/clients/client-opsworks/pagination/DescribeEcsClustersPaginator.ts b/clients/client-opsworks/src/pagination/DescribeEcsClustersPaginator.ts similarity index 100% rename from clients/client-opsworks/pagination/DescribeEcsClustersPaginator.ts rename to clients/client-opsworks/src/pagination/DescribeEcsClustersPaginator.ts diff --git a/clients/client-opsworks/pagination/Interfaces.ts b/clients/client-opsworks/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-opsworks/pagination/Interfaces.ts rename to clients/client-opsworks/src/pagination/Interfaces.ts diff --git a/clients/client-opsworks/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-opsworks/protocols/Aws_json1_1.ts rename to clients/client-opsworks/src/protocols/Aws_json1_1.ts diff --git a/clients/client-opsworks/src/runtimeConfig.browser.ts b/clients/client-opsworks/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b4b2846f3dbd --- /dev/null +++ b/clients/client-opsworks/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { OpsWorksClientConfig } from "./OpsWorksClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpsWorksClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opsworks/runtimeConfig.native.ts b/clients/client-opsworks/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-opsworks/runtimeConfig.native.ts rename to clients/client-opsworks/src/runtimeConfig.native.ts diff --git a/clients/client-opsworks/runtimeConfig.shared.ts b/clients/client-opsworks/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-opsworks/runtimeConfig.shared.ts rename to clients/client-opsworks/src/runtimeConfig.shared.ts diff --git a/clients/client-opsworks/src/runtimeConfig.ts b/clients/client-opsworks/src/runtimeConfig.ts new file mode 100644 index 000000000000..055fab1c3b9a --- /dev/null +++ b/clients/client-opsworks/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { OpsWorksClientConfig } from "./OpsWorksClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpsWorksClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opsworks/waiters/waitForAppExists.ts b/clients/client-opsworks/src/waiters/waitForAppExists.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForAppExists.ts rename to clients/client-opsworks/src/waiters/waitForAppExists.ts diff --git a/clients/client-opsworks/waiters/waitForDeploymentSuccessful.ts b/clients/client-opsworks/src/waiters/waitForDeploymentSuccessful.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForDeploymentSuccessful.ts rename to clients/client-opsworks/src/waiters/waitForDeploymentSuccessful.ts diff --git a/clients/client-opsworks/waiters/waitForInstanceOnline.ts b/clients/client-opsworks/src/waiters/waitForInstanceOnline.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForInstanceOnline.ts rename to clients/client-opsworks/src/waiters/waitForInstanceOnline.ts diff --git a/clients/client-opsworks/waiters/waitForInstanceRegistered.ts b/clients/client-opsworks/src/waiters/waitForInstanceRegistered.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForInstanceRegistered.ts rename to clients/client-opsworks/src/waiters/waitForInstanceRegistered.ts diff --git a/clients/client-opsworks/waiters/waitForInstanceStopped.ts b/clients/client-opsworks/src/waiters/waitForInstanceStopped.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForInstanceStopped.ts rename to clients/client-opsworks/src/waiters/waitForInstanceStopped.ts diff --git a/clients/client-opsworks/waiters/waitForInstanceTerminated.ts b/clients/client-opsworks/src/waiters/waitForInstanceTerminated.ts similarity index 100% rename from clients/client-opsworks/waiters/waitForInstanceTerminated.ts rename to clients/client-opsworks/src/waiters/waitForInstanceTerminated.ts diff --git a/clients/client-opsworks/tsconfig.es.json b/clients/client-opsworks/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-opsworks/tsconfig.es.json +++ b/clients/client-opsworks/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-opsworks/tsconfig.json b/clients/client-opsworks/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-opsworks/tsconfig.json +++ b/clients/client-opsworks/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-opsworks/tsconfig.types.json b/clients/client-opsworks/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-opsworks/tsconfig.types.json +++ b/clients/client-opsworks/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-opsworkscm/.gitignore b/clients/client-opsworkscm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-opsworkscm/.gitignore +++ b/clients/client-opsworkscm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-opsworkscm/package.json b/clients/client-opsworkscm/package.json index 69db67cfcc7d..22fa0ddca6bc 100644 --- a/clients/client-opsworkscm/package.json +++ b/clients/client-opsworkscm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-opsworkscm", "repository": { "type": "git", diff --git a/clients/client-opsworkscm/runtimeConfig.browser.ts b/clients/client-opsworkscm/runtimeConfig.browser.ts deleted file mode 100644 index d18066db1cd8..000000000000 --- a/clients/client-opsworkscm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { OpsWorksCMClientConfig } from "./OpsWorksCMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opsworkscm/runtimeConfig.ts b/clients/client-opsworkscm/runtimeConfig.ts deleted file mode 100644 index 101a4039392f..000000000000 --- a/clients/client-opsworkscm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { OpsWorksCMClientConfig } from "./OpsWorksCMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-opsworkscm/OpsWorksCM.ts b/clients/client-opsworkscm/src/OpsWorksCM.ts similarity index 100% rename from clients/client-opsworkscm/OpsWorksCM.ts rename to clients/client-opsworkscm/src/OpsWorksCM.ts diff --git a/clients/client-opsworkscm/OpsWorksCMClient.ts b/clients/client-opsworkscm/src/OpsWorksCMClient.ts similarity index 100% rename from clients/client-opsworkscm/OpsWorksCMClient.ts rename to clients/client-opsworkscm/src/OpsWorksCMClient.ts diff --git a/clients/client-opsworkscm/commands/AssociateNodeCommand.ts b/clients/client-opsworkscm/src/commands/AssociateNodeCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/AssociateNodeCommand.ts rename to clients/client-opsworkscm/src/commands/AssociateNodeCommand.ts diff --git a/clients/client-opsworkscm/commands/CreateBackupCommand.ts b/clients/client-opsworkscm/src/commands/CreateBackupCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/CreateBackupCommand.ts rename to clients/client-opsworkscm/src/commands/CreateBackupCommand.ts diff --git a/clients/client-opsworkscm/commands/CreateServerCommand.ts b/clients/client-opsworkscm/src/commands/CreateServerCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/CreateServerCommand.ts rename to clients/client-opsworkscm/src/commands/CreateServerCommand.ts diff --git a/clients/client-opsworkscm/commands/DeleteBackupCommand.ts b/clients/client-opsworkscm/src/commands/DeleteBackupCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DeleteBackupCommand.ts rename to clients/client-opsworkscm/src/commands/DeleteBackupCommand.ts diff --git a/clients/client-opsworkscm/commands/DeleteServerCommand.ts b/clients/client-opsworkscm/src/commands/DeleteServerCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DeleteServerCommand.ts rename to clients/client-opsworkscm/src/commands/DeleteServerCommand.ts diff --git a/clients/client-opsworkscm/commands/DescribeAccountAttributesCommand.ts b/clients/client-opsworkscm/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DescribeAccountAttributesCommand.ts rename to clients/client-opsworkscm/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-opsworkscm/commands/DescribeBackupsCommand.ts b/clients/client-opsworkscm/src/commands/DescribeBackupsCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DescribeBackupsCommand.ts rename to clients/client-opsworkscm/src/commands/DescribeBackupsCommand.ts diff --git a/clients/client-opsworkscm/commands/DescribeEventsCommand.ts b/clients/client-opsworkscm/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DescribeEventsCommand.ts rename to clients/client-opsworkscm/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-opsworkscm/commands/DescribeNodeAssociationStatusCommand.ts b/clients/client-opsworkscm/src/commands/DescribeNodeAssociationStatusCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DescribeNodeAssociationStatusCommand.ts rename to clients/client-opsworkscm/src/commands/DescribeNodeAssociationStatusCommand.ts diff --git a/clients/client-opsworkscm/commands/DescribeServersCommand.ts b/clients/client-opsworkscm/src/commands/DescribeServersCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DescribeServersCommand.ts rename to clients/client-opsworkscm/src/commands/DescribeServersCommand.ts diff --git a/clients/client-opsworkscm/commands/DisassociateNodeCommand.ts b/clients/client-opsworkscm/src/commands/DisassociateNodeCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/DisassociateNodeCommand.ts rename to clients/client-opsworkscm/src/commands/DisassociateNodeCommand.ts diff --git a/clients/client-opsworkscm/commands/ExportServerEngineAttributeCommand.ts b/clients/client-opsworkscm/src/commands/ExportServerEngineAttributeCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/ExportServerEngineAttributeCommand.ts rename to clients/client-opsworkscm/src/commands/ExportServerEngineAttributeCommand.ts diff --git a/clients/client-opsworkscm/commands/ListTagsForResourceCommand.ts b/clients/client-opsworkscm/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/ListTagsForResourceCommand.ts rename to clients/client-opsworkscm/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-opsworkscm/commands/RestoreServerCommand.ts b/clients/client-opsworkscm/src/commands/RestoreServerCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/RestoreServerCommand.ts rename to clients/client-opsworkscm/src/commands/RestoreServerCommand.ts diff --git a/clients/client-opsworkscm/commands/StartMaintenanceCommand.ts b/clients/client-opsworkscm/src/commands/StartMaintenanceCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/StartMaintenanceCommand.ts rename to clients/client-opsworkscm/src/commands/StartMaintenanceCommand.ts diff --git a/clients/client-opsworkscm/commands/TagResourceCommand.ts b/clients/client-opsworkscm/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/TagResourceCommand.ts rename to clients/client-opsworkscm/src/commands/TagResourceCommand.ts diff --git a/clients/client-opsworkscm/commands/UntagResourceCommand.ts b/clients/client-opsworkscm/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/UntagResourceCommand.ts rename to clients/client-opsworkscm/src/commands/UntagResourceCommand.ts diff --git a/clients/client-opsworkscm/commands/UpdateServerCommand.ts b/clients/client-opsworkscm/src/commands/UpdateServerCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/UpdateServerCommand.ts rename to clients/client-opsworkscm/src/commands/UpdateServerCommand.ts diff --git a/clients/client-opsworkscm/commands/UpdateServerEngineAttributesCommand.ts b/clients/client-opsworkscm/src/commands/UpdateServerEngineAttributesCommand.ts similarity index 100% rename from clients/client-opsworkscm/commands/UpdateServerEngineAttributesCommand.ts rename to clients/client-opsworkscm/src/commands/UpdateServerEngineAttributesCommand.ts diff --git a/clients/client-opsworkscm/endpoints.ts b/clients/client-opsworkscm/src/endpoints.ts similarity index 100% rename from clients/client-opsworkscm/endpoints.ts rename to clients/client-opsworkscm/src/endpoints.ts diff --git a/clients/client-opsworkscm/index.ts b/clients/client-opsworkscm/src/index.ts similarity index 100% rename from clients/client-opsworkscm/index.ts rename to clients/client-opsworkscm/src/index.ts diff --git a/clients/client-opsworkscm/models/index.ts b/clients/client-opsworkscm/src/models/index.ts similarity index 100% rename from clients/client-opsworkscm/models/index.ts rename to clients/client-opsworkscm/src/models/index.ts diff --git a/clients/client-opsworkscm/models/models_0.ts b/clients/client-opsworkscm/src/models/models_0.ts similarity index 100% rename from clients/client-opsworkscm/models/models_0.ts rename to clients/client-opsworkscm/src/models/models_0.ts diff --git a/clients/client-opsworkscm/pagination/DescribeBackupsPaginator.ts b/clients/client-opsworkscm/src/pagination/DescribeBackupsPaginator.ts similarity index 100% rename from clients/client-opsworkscm/pagination/DescribeBackupsPaginator.ts rename to clients/client-opsworkscm/src/pagination/DescribeBackupsPaginator.ts diff --git a/clients/client-opsworkscm/pagination/DescribeEventsPaginator.ts b/clients/client-opsworkscm/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-opsworkscm/pagination/DescribeEventsPaginator.ts rename to clients/client-opsworkscm/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-opsworkscm/pagination/DescribeServersPaginator.ts b/clients/client-opsworkscm/src/pagination/DescribeServersPaginator.ts similarity index 100% rename from clients/client-opsworkscm/pagination/DescribeServersPaginator.ts rename to clients/client-opsworkscm/src/pagination/DescribeServersPaginator.ts diff --git a/clients/client-opsworkscm/pagination/Interfaces.ts b/clients/client-opsworkscm/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-opsworkscm/pagination/Interfaces.ts rename to clients/client-opsworkscm/src/pagination/Interfaces.ts diff --git a/clients/client-opsworkscm/pagination/ListTagsForResourcePaginator.ts b/clients/client-opsworkscm/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-opsworkscm/pagination/ListTagsForResourcePaginator.ts rename to clients/client-opsworkscm/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-opsworkscm/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-opsworkscm/protocols/Aws_json1_1.ts rename to clients/client-opsworkscm/src/protocols/Aws_json1_1.ts diff --git a/clients/client-opsworkscm/src/runtimeConfig.browser.ts b/clients/client-opsworkscm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..8aa6b63838c3 --- /dev/null +++ b/clients/client-opsworkscm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { OpsWorksCMClientConfig } from "./OpsWorksCMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opsworkscm/runtimeConfig.native.ts b/clients/client-opsworkscm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-opsworkscm/runtimeConfig.native.ts rename to clients/client-opsworkscm/src/runtimeConfig.native.ts diff --git a/clients/client-opsworkscm/runtimeConfig.shared.ts b/clients/client-opsworkscm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-opsworkscm/runtimeConfig.shared.ts rename to clients/client-opsworkscm/src/runtimeConfig.shared.ts diff --git a/clients/client-opsworkscm/src/runtimeConfig.ts b/clients/client-opsworkscm/src/runtimeConfig.ts new file mode 100644 index 000000000000..fee231c4ca8f --- /dev/null +++ b/clients/client-opsworkscm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { OpsWorksCMClientConfig } from "./OpsWorksCMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-opsworkscm/waiters/waitForNodeAssociated.ts b/clients/client-opsworkscm/src/waiters/waitForNodeAssociated.ts similarity index 100% rename from clients/client-opsworkscm/waiters/waitForNodeAssociated.ts rename to clients/client-opsworkscm/src/waiters/waitForNodeAssociated.ts diff --git a/clients/client-opsworkscm/tsconfig.es.json b/clients/client-opsworkscm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-opsworkscm/tsconfig.es.json +++ b/clients/client-opsworkscm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-opsworkscm/tsconfig.json b/clients/client-opsworkscm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-opsworkscm/tsconfig.json +++ b/clients/client-opsworkscm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-opsworkscm/tsconfig.types.json b/clients/client-opsworkscm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-opsworkscm/tsconfig.types.json +++ b/clients/client-opsworkscm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-organizations/.gitignore b/clients/client-organizations/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-organizations/.gitignore +++ b/clients/client-organizations/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-organizations/package.json b/clients/client-organizations/package.json index bab94c0b1547..4b28b20829b2 100644 --- a/clients/client-organizations/package.json +++ b/clients/client-organizations/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-organizations", "repository": { "type": "git", diff --git a/clients/client-organizations/runtimeConfig.browser.ts b/clients/client-organizations/runtimeConfig.browser.ts deleted file mode 100644 index 843ace66cc7b..000000000000 --- a/clients/client-organizations/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { OrganizationsClientConfig } from "./OrganizationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OrganizationsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-organizations/runtimeConfig.ts b/clients/client-organizations/runtimeConfig.ts deleted file mode 100644 index 633e37ea965a..000000000000 --- a/clients/client-organizations/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { OrganizationsClientConfig } from "./OrganizationsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OrganizationsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-organizations/Organizations.ts b/clients/client-organizations/src/Organizations.ts similarity index 100% rename from clients/client-organizations/Organizations.ts rename to clients/client-organizations/src/Organizations.ts diff --git a/clients/client-organizations/OrganizationsClient.ts b/clients/client-organizations/src/OrganizationsClient.ts similarity index 100% rename from clients/client-organizations/OrganizationsClient.ts rename to clients/client-organizations/src/OrganizationsClient.ts diff --git a/clients/client-organizations/commands/AcceptHandshakeCommand.ts b/clients/client-organizations/src/commands/AcceptHandshakeCommand.ts similarity index 100% rename from clients/client-organizations/commands/AcceptHandshakeCommand.ts rename to clients/client-organizations/src/commands/AcceptHandshakeCommand.ts diff --git a/clients/client-organizations/commands/AttachPolicyCommand.ts b/clients/client-organizations/src/commands/AttachPolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/AttachPolicyCommand.ts rename to clients/client-organizations/src/commands/AttachPolicyCommand.ts diff --git a/clients/client-organizations/commands/CancelHandshakeCommand.ts b/clients/client-organizations/src/commands/CancelHandshakeCommand.ts similarity index 100% rename from clients/client-organizations/commands/CancelHandshakeCommand.ts rename to clients/client-organizations/src/commands/CancelHandshakeCommand.ts diff --git a/clients/client-organizations/commands/CreateAccountCommand.ts b/clients/client-organizations/src/commands/CreateAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/CreateAccountCommand.ts rename to clients/client-organizations/src/commands/CreateAccountCommand.ts diff --git a/clients/client-organizations/commands/CreateGovCloudAccountCommand.ts b/clients/client-organizations/src/commands/CreateGovCloudAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/CreateGovCloudAccountCommand.ts rename to clients/client-organizations/src/commands/CreateGovCloudAccountCommand.ts diff --git a/clients/client-organizations/commands/CreateOrganizationCommand.ts b/clients/client-organizations/src/commands/CreateOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/CreateOrganizationCommand.ts rename to clients/client-organizations/src/commands/CreateOrganizationCommand.ts diff --git a/clients/client-organizations/commands/CreateOrganizationalUnitCommand.ts b/clients/client-organizations/src/commands/CreateOrganizationalUnitCommand.ts similarity index 100% rename from clients/client-organizations/commands/CreateOrganizationalUnitCommand.ts rename to clients/client-organizations/src/commands/CreateOrganizationalUnitCommand.ts diff --git a/clients/client-organizations/commands/CreatePolicyCommand.ts b/clients/client-organizations/src/commands/CreatePolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/CreatePolicyCommand.ts rename to clients/client-organizations/src/commands/CreatePolicyCommand.ts diff --git a/clients/client-organizations/commands/DeclineHandshakeCommand.ts b/clients/client-organizations/src/commands/DeclineHandshakeCommand.ts similarity index 100% rename from clients/client-organizations/commands/DeclineHandshakeCommand.ts rename to clients/client-organizations/src/commands/DeclineHandshakeCommand.ts diff --git a/clients/client-organizations/commands/DeleteOrganizationCommand.ts b/clients/client-organizations/src/commands/DeleteOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/DeleteOrganizationCommand.ts rename to clients/client-organizations/src/commands/DeleteOrganizationCommand.ts diff --git a/clients/client-organizations/commands/DeleteOrganizationalUnitCommand.ts b/clients/client-organizations/src/commands/DeleteOrganizationalUnitCommand.ts similarity index 100% rename from clients/client-organizations/commands/DeleteOrganizationalUnitCommand.ts rename to clients/client-organizations/src/commands/DeleteOrganizationalUnitCommand.ts diff --git a/clients/client-organizations/commands/DeletePolicyCommand.ts b/clients/client-organizations/src/commands/DeletePolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/DeletePolicyCommand.ts rename to clients/client-organizations/src/commands/DeletePolicyCommand.ts diff --git a/clients/client-organizations/commands/DeregisterDelegatedAdministratorCommand.ts b/clients/client-organizations/src/commands/DeregisterDelegatedAdministratorCommand.ts similarity index 100% rename from clients/client-organizations/commands/DeregisterDelegatedAdministratorCommand.ts rename to clients/client-organizations/src/commands/DeregisterDelegatedAdministratorCommand.ts diff --git a/clients/client-organizations/commands/DescribeAccountCommand.ts b/clients/client-organizations/src/commands/DescribeAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeAccountCommand.ts rename to clients/client-organizations/src/commands/DescribeAccountCommand.ts diff --git a/clients/client-organizations/commands/DescribeCreateAccountStatusCommand.ts b/clients/client-organizations/src/commands/DescribeCreateAccountStatusCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeCreateAccountStatusCommand.ts rename to clients/client-organizations/src/commands/DescribeCreateAccountStatusCommand.ts diff --git a/clients/client-organizations/commands/DescribeEffectivePolicyCommand.ts b/clients/client-organizations/src/commands/DescribeEffectivePolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeEffectivePolicyCommand.ts rename to clients/client-organizations/src/commands/DescribeEffectivePolicyCommand.ts diff --git a/clients/client-organizations/commands/DescribeHandshakeCommand.ts b/clients/client-organizations/src/commands/DescribeHandshakeCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeHandshakeCommand.ts rename to clients/client-organizations/src/commands/DescribeHandshakeCommand.ts diff --git a/clients/client-organizations/commands/DescribeOrganizationCommand.ts b/clients/client-organizations/src/commands/DescribeOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeOrganizationCommand.ts rename to clients/client-organizations/src/commands/DescribeOrganizationCommand.ts diff --git a/clients/client-organizations/commands/DescribeOrganizationalUnitCommand.ts b/clients/client-organizations/src/commands/DescribeOrganizationalUnitCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribeOrganizationalUnitCommand.ts rename to clients/client-organizations/src/commands/DescribeOrganizationalUnitCommand.ts diff --git a/clients/client-organizations/commands/DescribePolicyCommand.ts b/clients/client-organizations/src/commands/DescribePolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/DescribePolicyCommand.ts rename to clients/client-organizations/src/commands/DescribePolicyCommand.ts diff --git a/clients/client-organizations/commands/DetachPolicyCommand.ts b/clients/client-organizations/src/commands/DetachPolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/DetachPolicyCommand.ts rename to clients/client-organizations/src/commands/DetachPolicyCommand.ts diff --git a/clients/client-organizations/commands/DisableAWSServiceAccessCommand.ts b/clients/client-organizations/src/commands/DisableAWSServiceAccessCommand.ts similarity index 100% rename from clients/client-organizations/commands/DisableAWSServiceAccessCommand.ts rename to clients/client-organizations/src/commands/DisableAWSServiceAccessCommand.ts diff --git a/clients/client-organizations/commands/DisablePolicyTypeCommand.ts b/clients/client-organizations/src/commands/DisablePolicyTypeCommand.ts similarity index 100% rename from clients/client-organizations/commands/DisablePolicyTypeCommand.ts rename to clients/client-organizations/src/commands/DisablePolicyTypeCommand.ts diff --git a/clients/client-organizations/commands/EnableAWSServiceAccessCommand.ts b/clients/client-organizations/src/commands/EnableAWSServiceAccessCommand.ts similarity index 100% rename from clients/client-organizations/commands/EnableAWSServiceAccessCommand.ts rename to clients/client-organizations/src/commands/EnableAWSServiceAccessCommand.ts diff --git a/clients/client-organizations/commands/EnableAllFeaturesCommand.ts b/clients/client-organizations/src/commands/EnableAllFeaturesCommand.ts similarity index 100% rename from clients/client-organizations/commands/EnableAllFeaturesCommand.ts rename to clients/client-organizations/src/commands/EnableAllFeaturesCommand.ts diff --git a/clients/client-organizations/commands/EnablePolicyTypeCommand.ts b/clients/client-organizations/src/commands/EnablePolicyTypeCommand.ts similarity index 100% rename from clients/client-organizations/commands/EnablePolicyTypeCommand.ts rename to clients/client-organizations/src/commands/EnablePolicyTypeCommand.ts diff --git a/clients/client-organizations/commands/InviteAccountToOrganizationCommand.ts b/clients/client-organizations/src/commands/InviteAccountToOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/InviteAccountToOrganizationCommand.ts rename to clients/client-organizations/src/commands/InviteAccountToOrganizationCommand.ts diff --git a/clients/client-organizations/commands/LeaveOrganizationCommand.ts b/clients/client-organizations/src/commands/LeaveOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/LeaveOrganizationCommand.ts rename to clients/client-organizations/src/commands/LeaveOrganizationCommand.ts diff --git a/clients/client-organizations/commands/ListAWSServiceAccessForOrganizationCommand.ts b/clients/client-organizations/src/commands/ListAWSServiceAccessForOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListAWSServiceAccessForOrganizationCommand.ts rename to clients/client-organizations/src/commands/ListAWSServiceAccessForOrganizationCommand.ts diff --git a/clients/client-organizations/commands/ListAccountsCommand.ts b/clients/client-organizations/src/commands/ListAccountsCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListAccountsCommand.ts rename to clients/client-organizations/src/commands/ListAccountsCommand.ts diff --git a/clients/client-organizations/commands/ListAccountsForParentCommand.ts b/clients/client-organizations/src/commands/ListAccountsForParentCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListAccountsForParentCommand.ts rename to clients/client-organizations/src/commands/ListAccountsForParentCommand.ts diff --git a/clients/client-organizations/commands/ListChildrenCommand.ts b/clients/client-organizations/src/commands/ListChildrenCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListChildrenCommand.ts rename to clients/client-organizations/src/commands/ListChildrenCommand.ts diff --git a/clients/client-organizations/commands/ListCreateAccountStatusCommand.ts b/clients/client-organizations/src/commands/ListCreateAccountStatusCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListCreateAccountStatusCommand.ts rename to clients/client-organizations/src/commands/ListCreateAccountStatusCommand.ts diff --git a/clients/client-organizations/commands/ListDelegatedAdministratorsCommand.ts b/clients/client-organizations/src/commands/ListDelegatedAdministratorsCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListDelegatedAdministratorsCommand.ts rename to clients/client-organizations/src/commands/ListDelegatedAdministratorsCommand.ts diff --git a/clients/client-organizations/commands/ListDelegatedServicesForAccountCommand.ts b/clients/client-organizations/src/commands/ListDelegatedServicesForAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListDelegatedServicesForAccountCommand.ts rename to clients/client-organizations/src/commands/ListDelegatedServicesForAccountCommand.ts diff --git a/clients/client-organizations/commands/ListHandshakesForAccountCommand.ts b/clients/client-organizations/src/commands/ListHandshakesForAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListHandshakesForAccountCommand.ts rename to clients/client-organizations/src/commands/ListHandshakesForAccountCommand.ts diff --git a/clients/client-organizations/commands/ListHandshakesForOrganizationCommand.ts b/clients/client-organizations/src/commands/ListHandshakesForOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListHandshakesForOrganizationCommand.ts rename to clients/client-organizations/src/commands/ListHandshakesForOrganizationCommand.ts diff --git a/clients/client-organizations/commands/ListOrganizationalUnitsForParentCommand.ts b/clients/client-organizations/src/commands/ListOrganizationalUnitsForParentCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListOrganizationalUnitsForParentCommand.ts rename to clients/client-organizations/src/commands/ListOrganizationalUnitsForParentCommand.ts diff --git a/clients/client-organizations/commands/ListParentsCommand.ts b/clients/client-organizations/src/commands/ListParentsCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListParentsCommand.ts rename to clients/client-organizations/src/commands/ListParentsCommand.ts diff --git a/clients/client-organizations/commands/ListPoliciesCommand.ts b/clients/client-organizations/src/commands/ListPoliciesCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListPoliciesCommand.ts rename to clients/client-organizations/src/commands/ListPoliciesCommand.ts diff --git a/clients/client-organizations/commands/ListPoliciesForTargetCommand.ts b/clients/client-organizations/src/commands/ListPoliciesForTargetCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListPoliciesForTargetCommand.ts rename to clients/client-organizations/src/commands/ListPoliciesForTargetCommand.ts diff --git a/clients/client-organizations/commands/ListRootsCommand.ts b/clients/client-organizations/src/commands/ListRootsCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListRootsCommand.ts rename to clients/client-organizations/src/commands/ListRootsCommand.ts diff --git a/clients/client-organizations/commands/ListTagsForResourceCommand.ts b/clients/client-organizations/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListTagsForResourceCommand.ts rename to clients/client-organizations/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-organizations/commands/ListTargetsForPolicyCommand.ts b/clients/client-organizations/src/commands/ListTargetsForPolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/ListTargetsForPolicyCommand.ts rename to clients/client-organizations/src/commands/ListTargetsForPolicyCommand.ts diff --git a/clients/client-organizations/commands/MoveAccountCommand.ts b/clients/client-organizations/src/commands/MoveAccountCommand.ts similarity index 100% rename from clients/client-organizations/commands/MoveAccountCommand.ts rename to clients/client-organizations/src/commands/MoveAccountCommand.ts diff --git a/clients/client-organizations/commands/RegisterDelegatedAdministratorCommand.ts b/clients/client-organizations/src/commands/RegisterDelegatedAdministratorCommand.ts similarity index 100% rename from clients/client-organizations/commands/RegisterDelegatedAdministratorCommand.ts rename to clients/client-organizations/src/commands/RegisterDelegatedAdministratorCommand.ts diff --git a/clients/client-organizations/commands/RemoveAccountFromOrganizationCommand.ts b/clients/client-organizations/src/commands/RemoveAccountFromOrganizationCommand.ts similarity index 100% rename from clients/client-organizations/commands/RemoveAccountFromOrganizationCommand.ts rename to clients/client-organizations/src/commands/RemoveAccountFromOrganizationCommand.ts diff --git a/clients/client-organizations/commands/TagResourceCommand.ts b/clients/client-organizations/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-organizations/commands/TagResourceCommand.ts rename to clients/client-organizations/src/commands/TagResourceCommand.ts diff --git a/clients/client-organizations/commands/UntagResourceCommand.ts b/clients/client-organizations/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-organizations/commands/UntagResourceCommand.ts rename to clients/client-organizations/src/commands/UntagResourceCommand.ts diff --git a/clients/client-organizations/commands/UpdateOrganizationalUnitCommand.ts b/clients/client-organizations/src/commands/UpdateOrganizationalUnitCommand.ts similarity index 100% rename from clients/client-organizations/commands/UpdateOrganizationalUnitCommand.ts rename to clients/client-organizations/src/commands/UpdateOrganizationalUnitCommand.ts diff --git a/clients/client-organizations/commands/UpdatePolicyCommand.ts b/clients/client-organizations/src/commands/UpdatePolicyCommand.ts similarity index 100% rename from clients/client-organizations/commands/UpdatePolicyCommand.ts rename to clients/client-organizations/src/commands/UpdatePolicyCommand.ts diff --git a/clients/client-organizations/endpoints.ts b/clients/client-organizations/src/endpoints.ts similarity index 100% rename from clients/client-organizations/endpoints.ts rename to clients/client-organizations/src/endpoints.ts diff --git a/clients/client-organizations/index.ts b/clients/client-organizations/src/index.ts similarity index 100% rename from clients/client-organizations/index.ts rename to clients/client-organizations/src/index.ts diff --git a/clients/client-organizations/models/index.ts b/clients/client-organizations/src/models/index.ts similarity index 100% rename from clients/client-organizations/models/index.ts rename to clients/client-organizations/src/models/index.ts diff --git a/clients/client-organizations/models/models_0.ts b/clients/client-organizations/src/models/models_0.ts similarity index 100% rename from clients/client-organizations/models/models_0.ts rename to clients/client-organizations/src/models/models_0.ts diff --git a/clients/client-organizations/pagination/Interfaces.ts b/clients/client-organizations/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-organizations/pagination/Interfaces.ts rename to clients/client-organizations/src/pagination/Interfaces.ts diff --git a/clients/client-organizations/pagination/ListAWSServiceAccessForOrganizationPaginator.ts b/clients/client-organizations/src/pagination/ListAWSServiceAccessForOrganizationPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListAWSServiceAccessForOrganizationPaginator.ts rename to clients/client-organizations/src/pagination/ListAWSServiceAccessForOrganizationPaginator.ts diff --git a/clients/client-organizations/pagination/ListAccountsForParentPaginator.ts b/clients/client-organizations/src/pagination/ListAccountsForParentPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListAccountsForParentPaginator.ts rename to clients/client-organizations/src/pagination/ListAccountsForParentPaginator.ts diff --git a/clients/client-organizations/pagination/ListAccountsPaginator.ts b/clients/client-organizations/src/pagination/ListAccountsPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListAccountsPaginator.ts rename to clients/client-organizations/src/pagination/ListAccountsPaginator.ts diff --git a/clients/client-organizations/pagination/ListChildrenPaginator.ts b/clients/client-organizations/src/pagination/ListChildrenPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListChildrenPaginator.ts rename to clients/client-organizations/src/pagination/ListChildrenPaginator.ts diff --git a/clients/client-organizations/pagination/ListCreateAccountStatusPaginator.ts b/clients/client-organizations/src/pagination/ListCreateAccountStatusPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListCreateAccountStatusPaginator.ts rename to clients/client-organizations/src/pagination/ListCreateAccountStatusPaginator.ts diff --git a/clients/client-organizations/pagination/ListDelegatedAdministratorsPaginator.ts b/clients/client-organizations/src/pagination/ListDelegatedAdministratorsPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListDelegatedAdministratorsPaginator.ts rename to clients/client-organizations/src/pagination/ListDelegatedAdministratorsPaginator.ts diff --git a/clients/client-organizations/pagination/ListDelegatedServicesForAccountPaginator.ts b/clients/client-organizations/src/pagination/ListDelegatedServicesForAccountPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListDelegatedServicesForAccountPaginator.ts rename to clients/client-organizations/src/pagination/ListDelegatedServicesForAccountPaginator.ts diff --git a/clients/client-organizations/pagination/ListHandshakesForAccountPaginator.ts b/clients/client-organizations/src/pagination/ListHandshakesForAccountPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListHandshakesForAccountPaginator.ts rename to clients/client-organizations/src/pagination/ListHandshakesForAccountPaginator.ts diff --git a/clients/client-organizations/pagination/ListHandshakesForOrganizationPaginator.ts b/clients/client-organizations/src/pagination/ListHandshakesForOrganizationPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListHandshakesForOrganizationPaginator.ts rename to clients/client-organizations/src/pagination/ListHandshakesForOrganizationPaginator.ts diff --git a/clients/client-organizations/pagination/ListOrganizationalUnitsForParentPaginator.ts b/clients/client-organizations/src/pagination/ListOrganizationalUnitsForParentPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListOrganizationalUnitsForParentPaginator.ts rename to clients/client-organizations/src/pagination/ListOrganizationalUnitsForParentPaginator.ts diff --git a/clients/client-organizations/pagination/ListParentsPaginator.ts b/clients/client-organizations/src/pagination/ListParentsPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListParentsPaginator.ts rename to clients/client-organizations/src/pagination/ListParentsPaginator.ts diff --git a/clients/client-organizations/pagination/ListPoliciesForTargetPaginator.ts b/clients/client-organizations/src/pagination/ListPoliciesForTargetPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListPoliciesForTargetPaginator.ts rename to clients/client-organizations/src/pagination/ListPoliciesForTargetPaginator.ts diff --git a/clients/client-organizations/pagination/ListPoliciesPaginator.ts b/clients/client-organizations/src/pagination/ListPoliciesPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListPoliciesPaginator.ts rename to clients/client-organizations/src/pagination/ListPoliciesPaginator.ts diff --git a/clients/client-organizations/pagination/ListRootsPaginator.ts b/clients/client-organizations/src/pagination/ListRootsPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListRootsPaginator.ts rename to clients/client-organizations/src/pagination/ListRootsPaginator.ts diff --git a/clients/client-organizations/pagination/ListTagsForResourcePaginator.ts b/clients/client-organizations/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListTagsForResourcePaginator.ts rename to clients/client-organizations/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-organizations/pagination/ListTargetsForPolicyPaginator.ts b/clients/client-organizations/src/pagination/ListTargetsForPolicyPaginator.ts similarity index 100% rename from clients/client-organizations/pagination/ListTargetsForPolicyPaginator.ts rename to clients/client-organizations/src/pagination/ListTargetsForPolicyPaginator.ts diff --git a/clients/client-organizations/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-organizations/protocols/Aws_json1_1.ts rename to clients/client-organizations/src/protocols/Aws_json1_1.ts diff --git a/clients/client-organizations/src/runtimeConfig.browser.ts b/clients/client-organizations/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..94ae7e5a2091 --- /dev/null +++ b/clients/client-organizations/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { OrganizationsClientConfig } from "./OrganizationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OrganizationsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-organizations/runtimeConfig.native.ts b/clients/client-organizations/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-organizations/runtimeConfig.native.ts rename to clients/client-organizations/src/runtimeConfig.native.ts diff --git a/clients/client-organizations/runtimeConfig.shared.ts b/clients/client-organizations/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-organizations/runtimeConfig.shared.ts rename to clients/client-organizations/src/runtimeConfig.shared.ts diff --git a/clients/client-organizations/src/runtimeConfig.ts b/clients/client-organizations/src/runtimeConfig.ts new file mode 100644 index 000000000000..908af300d2b4 --- /dev/null +++ b/clients/client-organizations/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { OrganizationsClientConfig } from "./OrganizationsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OrganizationsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-organizations/tsconfig.es.json b/clients/client-organizations/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-organizations/tsconfig.es.json +++ b/clients/client-organizations/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-organizations/tsconfig.json b/clients/client-organizations/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-organizations/tsconfig.json +++ b/clients/client-organizations/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-organizations/tsconfig.types.json b/clients/client-organizations/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-organizations/tsconfig.types.json +++ b/clients/client-organizations/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-outposts/.gitignore b/clients/client-outposts/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-outposts/.gitignore +++ b/clients/client-outposts/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-outposts/package.json b/clients/client-outposts/package.json index ab546c99e021..fd5a3c14f568 100644 --- a/clients/client-outposts/package.json +++ b/clients/client-outposts/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-outposts", "repository": { "type": "git", diff --git a/clients/client-outposts/runtimeConfig.browser.ts b/clients/client-outposts/runtimeConfig.browser.ts deleted file mode 100644 index 56d4fa74a956..000000000000 --- a/clients/client-outposts/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { OutpostsClientConfig } from "./OutpostsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OutpostsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-outposts/runtimeConfig.ts b/clients/client-outposts/runtimeConfig.ts deleted file mode 100644 index cd2d73d8b23b..000000000000 --- a/clients/client-outposts/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { OutpostsClientConfig } from "./OutpostsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: OutpostsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-outposts/Outposts.ts b/clients/client-outposts/src/Outposts.ts similarity index 100% rename from clients/client-outposts/Outposts.ts rename to clients/client-outposts/src/Outposts.ts diff --git a/clients/client-outposts/OutpostsClient.ts b/clients/client-outposts/src/OutpostsClient.ts similarity index 100% rename from clients/client-outposts/OutpostsClient.ts rename to clients/client-outposts/src/OutpostsClient.ts diff --git a/clients/client-outposts/commands/CreateOrderCommand.ts b/clients/client-outposts/src/commands/CreateOrderCommand.ts similarity index 100% rename from clients/client-outposts/commands/CreateOrderCommand.ts rename to clients/client-outposts/src/commands/CreateOrderCommand.ts diff --git a/clients/client-outposts/commands/CreateOutpostCommand.ts b/clients/client-outposts/src/commands/CreateOutpostCommand.ts similarity index 100% rename from clients/client-outposts/commands/CreateOutpostCommand.ts rename to clients/client-outposts/src/commands/CreateOutpostCommand.ts diff --git a/clients/client-outposts/commands/DeleteOutpostCommand.ts b/clients/client-outposts/src/commands/DeleteOutpostCommand.ts similarity index 100% rename from clients/client-outposts/commands/DeleteOutpostCommand.ts rename to clients/client-outposts/src/commands/DeleteOutpostCommand.ts diff --git a/clients/client-outposts/commands/DeleteSiteCommand.ts b/clients/client-outposts/src/commands/DeleteSiteCommand.ts similarity index 100% rename from clients/client-outposts/commands/DeleteSiteCommand.ts rename to clients/client-outposts/src/commands/DeleteSiteCommand.ts diff --git a/clients/client-outposts/commands/GetOutpostCommand.ts b/clients/client-outposts/src/commands/GetOutpostCommand.ts similarity index 100% rename from clients/client-outposts/commands/GetOutpostCommand.ts rename to clients/client-outposts/src/commands/GetOutpostCommand.ts diff --git a/clients/client-outposts/commands/GetOutpostInstanceTypesCommand.ts b/clients/client-outposts/src/commands/GetOutpostInstanceTypesCommand.ts similarity index 100% rename from clients/client-outposts/commands/GetOutpostInstanceTypesCommand.ts rename to clients/client-outposts/src/commands/GetOutpostInstanceTypesCommand.ts diff --git a/clients/client-outposts/commands/ListOutpostsCommand.ts b/clients/client-outposts/src/commands/ListOutpostsCommand.ts similarity index 100% rename from clients/client-outposts/commands/ListOutpostsCommand.ts rename to clients/client-outposts/src/commands/ListOutpostsCommand.ts diff --git a/clients/client-outposts/commands/ListSitesCommand.ts b/clients/client-outposts/src/commands/ListSitesCommand.ts similarity index 100% rename from clients/client-outposts/commands/ListSitesCommand.ts rename to clients/client-outposts/src/commands/ListSitesCommand.ts diff --git a/clients/client-outposts/commands/ListTagsForResourceCommand.ts b/clients/client-outposts/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-outposts/commands/ListTagsForResourceCommand.ts rename to clients/client-outposts/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-outposts/commands/TagResourceCommand.ts b/clients/client-outposts/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-outposts/commands/TagResourceCommand.ts rename to clients/client-outposts/src/commands/TagResourceCommand.ts diff --git a/clients/client-outposts/commands/UntagResourceCommand.ts b/clients/client-outposts/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-outposts/commands/UntagResourceCommand.ts rename to clients/client-outposts/src/commands/UntagResourceCommand.ts diff --git a/clients/client-outposts/endpoints.ts b/clients/client-outposts/src/endpoints.ts similarity index 100% rename from clients/client-outposts/endpoints.ts rename to clients/client-outposts/src/endpoints.ts diff --git a/clients/client-outposts/index.ts b/clients/client-outposts/src/index.ts similarity index 100% rename from clients/client-outposts/index.ts rename to clients/client-outposts/src/index.ts diff --git a/clients/client-outposts/models/index.ts b/clients/client-outposts/src/models/index.ts similarity index 100% rename from clients/client-outposts/models/index.ts rename to clients/client-outposts/src/models/index.ts diff --git a/clients/client-outposts/models/models_0.ts b/clients/client-outposts/src/models/models_0.ts similarity index 100% rename from clients/client-outposts/models/models_0.ts rename to clients/client-outposts/src/models/models_0.ts diff --git a/clients/client-outposts/pagination/Interfaces.ts b/clients/client-outposts/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-outposts/pagination/Interfaces.ts rename to clients/client-outposts/src/pagination/Interfaces.ts diff --git a/clients/client-outposts/pagination/ListOutpostsPaginator.ts b/clients/client-outposts/src/pagination/ListOutpostsPaginator.ts similarity index 100% rename from clients/client-outposts/pagination/ListOutpostsPaginator.ts rename to clients/client-outposts/src/pagination/ListOutpostsPaginator.ts diff --git a/clients/client-outposts/pagination/ListSitesPaginator.ts b/clients/client-outposts/src/pagination/ListSitesPaginator.ts similarity index 100% rename from clients/client-outposts/pagination/ListSitesPaginator.ts rename to clients/client-outposts/src/pagination/ListSitesPaginator.ts diff --git a/clients/client-outposts/protocols/Aws_restJson1.ts b/clients/client-outposts/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-outposts/protocols/Aws_restJson1.ts rename to clients/client-outposts/src/protocols/Aws_restJson1.ts diff --git a/clients/client-outposts/src/runtimeConfig.browser.ts b/clients/client-outposts/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0bf06312b39c --- /dev/null +++ b/clients/client-outposts/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { OutpostsClientConfig } from "./OutpostsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OutpostsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-outposts/runtimeConfig.native.ts b/clients/client-outposts/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-outposts/runtimeConfig.native.ts rename to clients/client-outposts/src/runtimeConfig.native.ts diff --git a/clients/client-outposts/runtimeConfig.shared.ts b/clients/client-outposts/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-outposts/runtimeConfig.shared.ts rename to clients/client-outposts/src/runtimeConfig.shared.ts diff --git a/clients/client-outposts/src/runtimeConfig.ts b/clients/client-outposts/src/runtimeConfig.ts new file mode 100644 index 000000000000..49b932700b41 --- /dev/null +++ b/clients/client-outposts/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { OutpostsClientConfig } from "./OutpostsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: OutpostsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-outposts/tsconfig.es.json b/clients/client-outposts/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-outposts/tsconfig.es.json +++ b/clients/client-outposts/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-outposts/tsconfig.json b/clients/client-outposts/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-outposts/tsconfig.json +++ b/clients/client-outposts/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-outposts/tsconfig.types.json b/clients/client-outposts/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-outposts/tsconfig.types.json +++ b/clients/client-outposts/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-personalize-events/.gitignore b/clients/client-personalize-events/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-personalize-events/.gitignore +++ b/clients/client-personalize-events/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-personalize-events/package.json b/clients/client-personalize-events/package.json index 1211d1af6590..75f33112a225 100644 --- a/clients/client-personalize-events/package.json +++ b/clients/client-personalize-events/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-personalize-events", "repository": { "type": "git", diff --git a/clients/client-personalize-events/runtimeConfig.browser.ts b/clients/client-personalize-events/runtimeConfig.browser.ts deleted file mode 100644 index bfa0916f6980..000000000000 --- a/clients/client-personalize-events/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PersonalizeEventsClientConfig } from "./PersonalizeEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize-events/runtimeConfig.ts b/clients/client-personalize-events/runtimeConfig.ts deleted file mode 100644 index 09ddd4ea35d1..000000000000 --- a/clients/client-personalize-events/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PersonalizeEventsClientConfig } from "./PersonalizeEventsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize-events/PersonalizeEvents.ts b/clients/client-personalize-events/src/PersonalizeEvents.ts similarity index 100% rename from clients/client-personalize-events/PersonalizeEvents.ts rename to clients/client-personalize-events/src/PersonalizeEvents.ts diff --git a/clients/client-personalize-events/PersonalizeEventsClient.ts b/clients/client-personalize-events/src/PersonalizeEventsClient.ts similarity index 100% rename from clients/client-personalize-events/PersonalizeEventsClient.ts rename to clients/client-personalize-events/src/PersonalizeEventsClient.ts diff --git a/clients/client-personalize-events/commands/PutEventsCommand.ts b/clients/client-personalize-events/src/commands/PutEventsCommand.ts similarity index 100% rename from clients/client-personalize-events/commands/PutEventsCommand.ts rename to clients/client-personalize-events/src/commands/PutEventsCommand.ts diff --git a/clients/client-personalize-events/commands/PutItemsCommand.ts b/clients/client-personalize-events/src/commands/PutItemsCommand.ts similarity index 100% rename from clients/client-personalize-events/commands/PutItemsCommand.ts rename to clients/client-personalize-events/src/commands/PutItemsCommand.ts diff --git a/clients/client-personalize-events/commands/PutUsersCommand.ts b/clients/client-personalize-events/src/commands/PutUsersCommand.ts similarity index 100% rename from clients/client-personalize-events/commands/PutUsersCommand.ts rename to clients/client-personalize-events/src/commands/PutUsersCommand.ts diff --git a/clients/client-personalize-events/endpoints.ts b/clients/client-personalize-events/src/endpoints.ts similarity index 100% rename from clients/client-personalize-events/endpoints.ts rename to clients/client-personalize-events/src/endpoints.ts diff --git a/clients/client-personalize-events/index.ts b/clients/client-personalize-events/src/index.ts similarity index 100% rename from clients/client-personalize-events/index.ts rename to clients/client-personalize-events/src/index.ts diff --git a/clients/client-personalize-events/models/index.ts b/clients/client-personalize-events/src/models/index.ts similarity index 100% rename from clients/client-personalize-events/models/index.ts rename to clients/client-personalize-events/src/models/index.ts diff --git a/clients/client-personalize-events/models/models_0.ts b/clients/client-personalize-events/src/models/models_0.ts similarity index 100% rename from clients/client-personalize-events/models/models_0.ts rename to clients/client-personalize-events/src/models/models_0.ts diff --git a/clients/client-personalize-events/protocols/Aws_restJson1.ts b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-personalize-events/protocols/Aws_restJson1.ts rename to clients/client-personalize-events/src/protocols/Aws_restJson1.ts diff --git a/clients/client-personalize-events/src/runtimeConfig.browser.ts b/clients/client-personalize-events/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9fb3db634ba3 --- /dev/null +++ b/clients/client-personalize-events/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PersonalizeEventsClientConfig } from "./PersonalizeEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize-events/runtimeConfig.native.ts b/clients/client-personalize-events/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-personalize-events/runtimeConfig.native.ts rename to clients/client-personalize-events/src/runtimeConfig.native.ts diff --git a/clients/client-personalize-events/runtimeConfig.shared.ts b/clients/client-personalize-events/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-personalize-events/runtimeConfig.shared.ts rename to clients/client-personalize-events/src/runtimeConfig.shared.ts diff --git a/clients/client-personalize-events/src/runtimeConfig.ts b/clients/client-personalize-events/src/runtimeConfig.ts new file mode 100644 index 000000000000..43b55636f83b --- /dev/null +++ b/clients/client-personalize-events/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PersonalizeEventsClientConfig } from "./PersonalizeEventsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize-events/tsconfig.es.json b/clients/client-personalize-events/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-personalize-events/tsconfig.es.json +++ b/clients/client-personalize-events/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-personalize-events/tsconfig.json b/clients/client-personalize-events/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-personalize-events/tsconfig.json +++ b/clients/client-personalize-events/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-personalize-events/tsconfig.types.json b/clients/client-personalize-events/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-personalize-events/tsconfig.types.json +++ b/clients/client-personalize-events/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-personalize-runtime/.gitignore b/clients/client-personalize-runtime/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-personalize-runtime/.gitignore +++ b/clients/client-personalize-runtime/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-personalize-runtime/package.json b/clients/client-personalize-runtime/package.json index 1b03b1a58033..673878f14c9f 100644 --- a/clients/client-personalize-runtime/package.json +++ b/clients/client-personalize-runtime/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-personalize-runtime", "repository": { "type": "git", diff --git a/clients/client-personalize-runtime/runtimeConfig.browser.ts b/clients/client-personalize-runtime/runtimeConfig.browser.ts deleted file mode 100644 index 7105630395fc..000000000000 --- a/clients/client-personalize-runtime/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PersonalizeRuntimeClientConfig } from "./PersonalizeRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize-runtime/runtimeConfig.ts b/clients/client-personalize-runtime/runtimeConfig.ts deleted file mode 100644 index 6e43501b1dc9..000000000000 --- a/clients/client-personalize-runtime/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PersonalizeRuntimeClientConfig } from "./PersonalizeRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize-runtime/PersonalizeRuntime.ts b/clients/client-personalize-runtime/src/PersonalizeRuntime.ts similarity index 100% rename from clients/client-personalize-runtime/PersonalizeRuntime.ts rename to clients/client-personalize-runtime/src/PersonalizeRuntime.ts diff --git a/clients/client-personalize-runtime/PersonalizeRuntimeClient.ts b/clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts similarity index 100% rename from clients/client-personalize-runtime/PersonalizeRuntimeClient.ts rename to clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts diff --git a/clients/client-personalize-runtime/commands/GetPersonalizedRankingCommand.ts b/clients/client-personalize-runtime/src/commands/GetPersonalizedRankingCommand.ts similarity index 100% rename from clients/client-personalize-runtime/commands/GetPersonalizedRankingCommand.ts rename to clients/client-personalize-runtime/src/commands/GetPersonalizedRankingCommand.ts diff --git a/clients/client-personalize-runtime/commands/GetRecommendationsCommand.ts b/clients/client-personalize-runtime/src/commands/GetRecommendationsCommand.ts similarity index 100% rename from clients/client-personalize-runtime/commands/GetRecommendationsCommand.ts rename to clients/client-personalize-runtime/src/commands/GetRecommendationsCommand.ts diff --git a/clients/client-personalize-runtime/endpoints.ts b/clients/client-personalize-runtime/src/endpoints.ts similarity index 100% rename from clients/client-personalize-runtime/endpoints.ts rename to clients/client-personalize-runtime/src/endpoints.ts diff --git a/clients/client-personalize-runtime/index.ts b/clients/client-personalize-runtime/src/index.ts similarity index 100% rename from clients/client-personalize-runtime/index.ts rename to clients/client-personalize-runtime/src/index.ts diff --git a/clients/client-personalize-runtime/models/index.ts b/clients/client-personalize-runtime/src/models/index.ts similarity index 100% rename from clients/client-personalize-runtime/models/index.ts rename to clients/client-personalize-runtime/src/models/index.ts diff --git a/clients/client-personalize-runtime/models/models_0.ts b/clients/client-personalize-runtime/src/models/models_0.ts similarity index 100% rename from clients/client-personalize-runtime/models/models_0.ts rename to clients/client-personalize-runtime/src/models/models_0.ts diff --git a/clients/client-personalize-runtime/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-personalize-runtime/protocols/Aws_restJson1.ts rename to clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts diff --git a/clients/client-personalize-runtime/src/runtimeConfig.browser.ts b/clients/client-personalize-runtime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cb377001662a --- /dev/null +++ b/clients/client-personalize-runtime/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PersonalizeRuntimeClientConfig } from "./PersonalizeRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize-runtime/runtimeConfig.native.ts b/clients/client-personalize-runtime/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-personalize-runtime/runtimeConfig.native.ts rename to clients/client-personalize-runtime/src/runtimeConfig.native.ts diff --git a/clients/client-personalize-runtime/runtimeConfig.shared.ts b/clients/client-personalize-runtime/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-personalize-runtime/runtimeConfig.shared.ts rename to clients/client-personalize-runtime/src/runtimeConfig.shared.ts diff --git a/clients/client-personalize-runtime/src/runtimeConfig.ts b/clients/client-personalize-runtime/src/runtimeConfig.ts new file mode 100644 index 000000000000..1aa5a3afb8de --- /dev/null +++ b/clients/client-personalize-runtime/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PersonalizeRuntimeClientConfig } from "./PersonalizeRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize-runtime/tsconfig.es.json b/clients/client-personalize-runtime/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-personalize-runtime/tsconfig.es.json +++ b/clients/client-personalize-runtime/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-personalize-runtime/tsconfig.json b/clients/client-personalize-runtime/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-personalize-runtime/tsconfig.json +++ b/clients/client-personalize-runtime/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-personalize-runtime/tsconfig.types.json b/clients/client-personalize-runtime/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-personalize-runtime/tsconfig.types.json +++ b/clients/client-personalize-runtime/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-personalize/.gitignore b/clients/client-personalize/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-personalize/.gitignore +++ b/clients/client-personalize/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-personalize/package.json b/clients/client-personalize/package.json index e856975ecd44..2bccdf9297a4 100644 --- a/clients/client-personalize/package.json +++ b/clients/client-personalize/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-personalize", "repository": { "type": "git", diff --git a/clients/client-personalize/runtimeConfig.browser.ts b/clients/client-personalize/runtimeConfig.browser.ts deleted file mode 100644 index 81536dc8b0e7..000000000000 --- a/clients/client-personalize/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PersonalizeClientConfig } from "./PersonalizeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize/runtimeConfig.ts b/clients/client-personalize/runtimeConfig.ts deleted file mode 100644 index 1871dff25bf1..000000000000 --- a/clients/client-personalize/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PersonalizeClientConfig } from "./PersonalizeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PersonalizeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-personalize/Personalize.ts b/clients/client-personalize/src/Personalize.ts similarity index 100% rename from clients/client-personalize/Personalize.ts rename to clients/client-personalize/src/Personalize.ts diff --git a/clients/client-personalize/PersonalizeClient.ts b/clients/client-personalize/src/PersonalizeClient.ts similarity index 100% rename from clients/client-personalize/PersonalizeClient.ts rename to clients/client-personalize/src/PersonalizeClient.ts diff --git a/clients/client-personalize/commands/CreateBatchInferenceJobCommand.ts b/clients/client-personalize/src/commands/CreateBatchInferenceJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateBatchInferenceJobCommand.ts rename to clients/client-personalize/src/commands/CreateBatchInferenceJobCommand.ts diff --git a/clients/client-personalize/commands/CreateCampaignCommand.ts b/clients/client-personalize/src/commands/CreateCampaignCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateCampaignCommand.ts rename to clients/client-personalize/src/commands/CreateCampaignCommand.ts diff --git a/clients/client-personalize/commands/CreateDatasetCommand.ts b/clients/client-personalize/src/commands/CreateDatasetCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateDatasetCommand.ts rename to clients/client-personalize/src/commands/CreateDatasetCommand.ts diff --git a/clients/client-personalize/commands/CreateDatasetExportJobCommand.ts b/clients/client-personalize/src/commands/CreateDatasetExportJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateDatasetExportJobCommand.ts rename to clients/client-personalize/src/commands/CreateDatasetExportJobCommand.ts diff --git a/clients/client-personalize/commands/CreateDatasetGroupCommand.ts b/clients/client-personalize/src/commands/CreateDatasetGroupCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateDatasetGroupCommand.ts rename to clients/client-personalize/src/commands/CreateDatasetGroupCommand.ts diff --git a/clients/client-personalize/commands/CreateDatasetImportJobCommand.ts b/clients/client-personalize/src/commands/CreateDatasetImportJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateDatasetImportJobCommand.ts rename to clients/client-personalize/src/commands/CreateDatasetImportJobCommand.ts diff --git a/clients/client-personalize/commands/CreateEventTrackerCommand.ts b/clients/client-personalize/src/commands/CreateEventTrackerCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateEventTrackerCommand.ts rename to clients/client-personalize/src/commands/CreateEventTrackerCommand.ts diff --git a/clients/client-personalize/commands/CreateFilterCommand.ts b/clients/client-personalize/src/commands/CreateFilterCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateFilterCommand.ts rename to clients/client-personalize/src/commands/CreateFilterCommand.ts diff --git a/clients/client-personalize/commands/CreateSchemaCommand.ts b/clients/client-personalize/src/commands/CreateSchemaCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateSchemaCommand.ts rename to clients/client-personalize/src/commands/CreateSchemaCommand.ts diff --git a/clients/client-personalize/commands/CreateSolutionCommand.ts b/clients/client-personalize/src/commands/CreateSolutionCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateSolutionCommand.ts rename to clients/client-personalize/src/commands/CreateSolutionCommand.ts diff --git a/clients/client-personalize/commands/CreateSolutionVersionCommand.ts b/clients/client-personalize/src/commands/CreateSolutionVersionCommand.ts similarity index 100% rename from clients/client-personalize/commands/CreateSolutionVersionCommand.ts rename to clients/client-personalize/src/commands/CreateSolutionVersionCommand.ts diff --git a/clients/client-personalize/commands/DeleteCampaignCommand.ts b/clients/client-personalize/src/commands/DeleteCampaignCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteCampaignCommand.ts rename to clients/client-personalize/src/commands/DeleteCampaignCommand.ts diff --git a/clients/client-personalize/commands/DeleteDatasetCommand.ts b/clients/client-personalize/src/commands/DeleteDatasetCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteDatasetCommand.ts rename to clients/client-personalize/src/commands/DeleteDatasetCommand.ts diff --git a/clients/client-personalize/commands/DeleteDatasetGroupCommand.ts b/clients/client-personalize/src/commands/DeleteDatasetGroupCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteDatasetGroupCommand.ts rename to clients/client-personalize/src/commands/DeleteDatasetGroupCommand.ts diff --git a/clients/client-personalize/commands/DeleteEventTrackerCommand.ts b/clients/client-personalize/src/commands/DeleteEventTrackerCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteEventTrackerCommand.ts rename to clients/client-personalize/src/commands/DeleteEventTrackerCommand.ts diff --git a/clients/client-personalize/commands/DeleteFilterCommand.ts b/clients/client-personalize/src/commands/DeleteFilterCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteFilterCommand.ts rename to clients/client-personalize/src/commands/DeleteFilterCommand.ts diff --git a/clients/client-personalize/commands/DeleteSchemaCommand.ts b/clients/client-personalize/src/commands/DeleteSchemaCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteSchemaCommand.ts rename to clients/client-personalize/src/commands/DeleteSchemaCommand.ts diff --git a/clients/client-personalize/commands/DeleteSolutionCommand.ts b/clients/client-personalize/src/commands/DeleteSolutionCommand.ts similarity index 100% rename from clients/client-personalize/commands/DeleteSolutionCommand.ts rename to clients/client-personalize/src/commands/DeleteSolutionCommand.ts diff --git a/clients/client-personalize/commands/DescribeAlgorithmCommand.ts b/clients/client-personalize/src/commands/DescribeAlgorithmCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeAlgorithmCommand.ts rename to clients/client-personalize/src/commands/DescribeAlgorithmCommand.ts diff --git a/clients/client-personalize/commands/DescribeBatchInferenceJobCommand.ts b/clients/client-personalize/src/commands/DescribeBatchInferenceJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeBatchInferenceJobCommand.ts rename to clients/client-personalize/src/commands/DescribeBatchInferenceJobCommand.ts diff --git a/clients/client-personalize/commands/DescribeCampaignCommand.ts b/clients/client-personalize/src/commands/DescribeCampaignCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeCampaignCommand.ts rename to clients/client-personalize/src/commands/DescribeCampaignCommand.ts diff --git a/clients/client-personalize/commands/DescribeDatasetCommand.ts b/clients/client-personalize/src/commands/DescribeDatasetCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeDatasetCommand.ts rename to clients/client-personalize/src/commands/DescribeDatasetCommand.ts diff --git a/clients/client-personalize/commands/DescribeDatasetExportJobCommand.ts b/clients/client-personalize/src/commands/DescribeDatasetExportJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeDatasetExportJobCommand.ts rename to clients/client-personalize/src/commands/DescribeDatasetExportJobCommand.ts diff --git a/clients/client-personalize/commands/DescribeDatasetGroupCommand.ts b/clients/client-personalize/src/commands/DescribeDatasetGroupCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeDatasetGroupCommand.ts rename to clients/client-personalize/src/commands/DescribeDatasetGroupCommand.ts diff --git a/clients/client-personalize/commands/DescribeDatasetImportJobCommand.ts b/clients/client-personalize/src/commands/DescribeDatasetImportJobCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeDatasetImportJobCommand.ts rename to clients/client-personalize/src/commands/DescribeDatasetImportJobCommand.ts diff --git a/clients/client-personalize/commands/DescribeEventTrackerCommand.ts b/clients/client-personalize/src/commands/DescribeEventTrackerCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeEventTrackerCommand.ts rename to clients/client-personalize/src/commands/DescribeEventTrackerCommand.ts diff --git a/clients/client-personalize/commands/DescribeFeatureTransformationCommand.ts b/clients/client-personalize/src/commands/DescribeFeatureTransformationCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeFeatureTransformationCommand.ts rename to clients/client-personalize/src/commands/DescribeFeatureTransformationCommand.ts diff --git a/clients/client-personalize/commands/DescribeFilterCommand.ts b/clients/client-personalize/src/commands/DescribeFilterCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeFilterCommand.ts rename to clients/client-personalize/src/commands/DescribeFilterCommand.ts diff --git a/clients/client-personalize/commands/DescribeRecipeCommand.ts b/clients/client-personalize/src/commands/DescribeRecipeCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeRecipeCommand.ts rename to clients/client-personalize/src/commands/DescribeRecipeCommand.ts diff --git a/clients/client-personalize/commands/DescribeSchemaCommand.ts b/clients/client-personalize/src/commands/DescribeSchemaCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeSchemaCommand.ts rename to clients/client-personalize/src/commands/DescribeSchemaCommand.ts diff --git a/clients/client-personalize/commands/DescribeSolutionCommand.ts b/clients/client-personalize/src/commands/DescribeSolutionCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeSolutionCommand.ts rename to clients/client-personalize/src/commands/DescribeSolutionCommand.ts diff --git a/clients/client-personalize/commands/DescribeSolutionVersionCommand.ts b/clients/client-personalize/src/commands/DescribeSolutionVersionCommand.ts similarity index 100% rename from clients/client-personalize/commands/DescribeSolutionVersionCommand.ts rename to clients/client-personalize/src/commands/DescribeSolutionVersionCommand.ts diff --git a/clients/client-personalize/commands/GetSolutionMetricsCommand.ts b/clients/client-personalize/src/commands/GetSolutionMetricsCommand.ts similarity index 100% rename from clients/client-personalize/commands/GetSolutionMetricsCommand.ts rename to clients/client-personalize/src/commands/GetSolutionMetricsCommand.ts diff --git a/clients/client-personalize/commands/ListBatchInferenceJobsCommand.ts b/clients/client-personalize/src/commands/ListBatchInferenceJobsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListBatchInferenceJobsCommand.ts rename to clients/client-personalize/src/commands/ListBatchInferenceJobsCommand.ts diff --git a/clients/client-personalize/commands/ListCampaignsCommand.ts b/clients/client-personalize/src/commands/ListCampaignsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListCampaignsCommand.ts rename to clients/client-personalize/src/commands/ListCampaignsCommand.ts diff --git a/clients/client-personalize/commands/ListDatasetExportJobsCommand.ts b/clients/client-personalize/src/commands/ListDatasetExportJobsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListDatasetExportJobsCommand.ts rename to clients/client-personalize/src/commands/ListDatasetExportJobsCommand.ts diff --git a/clients/client-personalize/commands/ListDatasetGroupsCommand.ts b/clients/client-personalize/src/commands/ListDatasetGroupsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListDatasetGroupsCommand.ts rename to clients/client-personalize/src/commands/ListDatasetGroupsCommand.ts diff --git a/clients/client-personalize/commands/ListDatasetImportJobsCommand.ts b/clients/client-personalize/src/commands/ListDatasetImportJobsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListDatasetImportJobsCommand.ts rename to clients/client-personalize/src/commands/ListDatasetImportJobsCommand.ts diff --git a/clients/client-personalize/commands/ListDatasetsCommand.ts b/clients/client-personalize/src/commands/ListDatasetsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListDatasetsCommand.ts rename to clients/client-personalize/src/commands/ListDatasetsCommand.ts diff --git a/clients/client-personalize/commands/ListEventTrackersCommand.ts b/clients/client-personalize/src/commands/ListEventTrackersCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListEventTrackersCommand.ts rename to clients/client-personalize/src/commands/ListEventTrackersCommand.ts diff --git a/clients/client-personalize/commands/ListFiltersCommand.ts b/clients/client-personalize/src/commands/ListFiltersCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListFiltersCommand.ts rename to clients/client-personalize/src/commands/ListFiltersCommand.ts diff --git a/clients/client-personalize/commands/ListRecipesCommand.ts b/clients/client-personalize/src/commands/ListRecipesCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListRecipesCommand.ts rename to clients/client-personalize/src/commands/ListRecipesCommand.ts diff --git a/clients/client-personalize/commands/ListSchemasCommand.ts b/clients/client-personalize/src/commands/ListSchemasCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListSchemasCommand.ts rename to clients/client-personalize/src/commands/ListSchemasCommand.ts diff --git a/clients/client-personalize/commands/ListSolutionVersionsCommand.ts b/clients/client-personalize/src/commands/ListSolutionVersionsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListSolutionVersionsCommand.ts rename to clients/client-personalize/src/commands/ListSolutionVersionsCommand.ts diff --git a/clients/client-personalize/commands/ListSolutionsCommand.ts b/clients/client-personalize/src/commands/ListSolutionsCommand.ts similarity index 100% rename from clients/client-personalize/commands/ListSolutionsCommand.ts rename to clients/client-personalize/src/commands/ListSolutionsCommand.ts diff --git a/clients/client-personalize/commands/StopSolutionVersionCreationCommand.ts b/clients/client-personalize/src/commands/StopSolutionVersionCreationCommand.ts similarity index 100% rename from clients/client-personalize/commands/StopSolutionVersionCreationCommand.ts rename to clients/client-personalize/src/commands/StopSolutionVersionCreationCommand.ts diff --git a/clients/client-personalize/commands/UpdateCampaignCommand.ts b/clients/client-personalize/src/commands/UpdateCampaignCommand.ts similarity index 100% rename from clients/client-personalize/commands/UpdateCampaignCommand.ts rename to clients/client-personalize/src/commands/UpdateCampaignCommand.ts diff --git a/clients/client-personalize/endpoints.ts b/clients/client-personalize/src/endpoints.ts similarity index 100% rename from clients/client-personalize/endpoints.ts rename to clients/client-personalize/src/endpoints.ts diff --git a/clients/client-personalize/index.ts b/clients/client-personalize/src/index.ts similarity index 100% rename from clients/client-personalize/index.ts rename to clients/client-personalize/src/index.ts diff --git a/clients/client-personalize/models/index.ts b/clients/client-personalize/src/models/index.ts similarity index 100% rename from clients/client-personalize/models/index.ts rename to clients/client-personalize/src/models/index.ts diff --git a/clients/client-personalize/models/models_0.ts b/clients/client-personalize/src/models/models_0.ts similarity index 100% rename from clients/client-personalize/models/models_0.ts rename to clients/client-personalize/src/models/models_0.ts diff --git a/clients/client-personalize/pagination/Interfaces.ts b/clients/client-personalize/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-personalize/pagination/Interfaces.ts rename to clients/client-personalize/src/pagination/Interfaces.ts diff --git a/clients/client-personalize/pagination/ListBatchInferenceJobsPaginator.ts b/clients/client-personalize/src/pagination/ListBatchInferenceJobsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListBatchInferenceJobsPaginator.ts rename to clients/client-personalize/src/pagination/ListBatchInferenceJobsPaginator.ts diff --git a/clients/client-personalize/pagination/ListCampaignsPaginator.ts b/clients/client-personalize/src/pagination/ListCampaignsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListCampaignsPaginator.ts rename to clients/client-personalize/src/pagination/ListCampaignsPaginator.ts diff --git a/clients/client-personalize/pagination/ListDatasetExportJobsPaginator.ts b/clients/client-personalize/src/pagination/ListDatasetExportJobsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListDatasetExportJobsPaginator.ts rename to clients/client-personalize/src/pagination/ListDatasetExportJobsPaginator.ts diff --git a/clients/client-personalize/pagination/ListDatasetGroupsPaginator.ts b/clients/client-personalize/src/pagination/ListDatasetGroupsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListDatasetGroupsPaginator.ts rename to clients/client-personalize/src/pagination/ListDatasetGroupsPaginator.ts diff --git a/clients/client-personalize/pagination/ListDatasetImportJobsPaginator.ts b/clients/client-personalize/src/pagination/ListDatasetImportJobsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListDatasetImportJobsPaginator.ts rename to clients/client-personalize/src/pagination/ListDatasetImportJobsPaginator.ts diff --git a/clients/client-personalize/pagination/ListDatasetsPaginator.ts b/clients/client-personalize/src/pagination/ListDatasetsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListDatasetsPaginator.ts rename to clients/client-personalize/src/pagination/ListDatasetsPaginator.ts diff --git a/clients/client-personalize/pagination/ListEventTrackersPaginator.ts b/clients/client-personalize/src/pagination/ListEventTrackersPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListEventTrackersPaginator.ts rename to clients/client-personalize/src/pagination/ListEventTrackersPaginator.ts diff --git a/clients/client-personalize/pagination/ListFiltersPaginator.ts b/clients/client-personalize/src/pagination/ListFiltersPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListFiltersPaginator.ts rename to clients/client-personalize/src/pagination/ListFiltersPaginator.ts diff --git a/clients/client-personalize/pagination/ListRecipesPaginator.ts b/clients/client-personalize/src/pagination/ListRecipesPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListRecipesPaginator.ts rename to clients/client-personalize/src/pagination/ListRecipesPaginator.ts diff --git a/clients/client-personalize/pagination/ListSchemasPaginator.ts b/clients/client-personalize/src/pagination/ListSchemasPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListSchemasPaginator.ts rename to clients/client-personalize/src/pagination/ListSchemasPaginator.ts diff --git a/clients/client-personalize/pagination/ListSolutionVersionsPaginator.ts b/clients/client-personalize/src/pagination/ListSolutionVersionsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListSolutionVersionsPaginator.ts rename to clients/client-personalize/src/pagination/ListSolutionVersionsPaginator.ts diff --git a/clients/client-personalize/pagination/ListSolutionsPaginator.ts b/clients/client-personalize/src/pagination/ListSolutionsPaginator.ts similarity index 100% rename from clients/client-personalize/pagination/ListSolutionsPaginator.ts rename to clients/client-personalize/src/pagination/ListSolutionsPaginator.ts diff --git a/clients/client-personalize/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-personalize/protocols/Aws_json1_1.ts rename to clients/client-personalize/src/protocols/Aws_json1_1.ts diff --git a/clients/client-personalize/src/runtimeConfig.browser.ts b/clients/client-personalize/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e912a4d183a7 --- /dev/null +++ b/clients/client-personalize/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PersonalizeClientConfig } from "./PersonalizeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize/runtimeConfig.native.ts b/clients/client-personalize/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-personalize/runtimeConfig.native.ts rename to clients/client-personalize/src/runtimeConfig.native.ts diff --git a/clients/client-personalize/runtimeConfig.shared.ts b/clients/client-personalize/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-personalize/runtimeConfig.shared.ts rename to clients/client-personalize/src/runtimeConfig.shared.ts diff --git a/clients/client-personalize/src/runtimeConfig.ts b/clients/client-personalize/src/runtimeConfig.ts new file mode 100644 index 000000000000..ad9acc256b6a --- /dev/null +++ b/clients/client-personalize/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PersonalizeClientConfig } from "./PersonalizeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PersonalizeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-personalize/tsconfig.es.json b/clients/client-personalize/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-personalize/tsconfig.es.json +++ b/clients/client-personalize/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-personalize/tsconfig.json b/clients/client-personalize/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-personalize/tsconfig.json +++ b/clients/client-personalize/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-personalize/tsconfig.types.json b/clients/client-personalize/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-personalize/tsconfig.types.json +++ b/clients/client-personalize/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-pi/.gitignore b/clients/client-pi/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-pi/.gitignore +++ b/clients/client-pi/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-pi/package.json b/clients/client-pi/package.json index fb8f111bc1aa..9aebc747d3ba 100644 --- a/clients/client-pi/package.json +++ b/clients/client-pi/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pi", "repository": { "type": "git", diff --git a/clients/client-pi/runtimeConfig.browser.ts b/clients/client-pi/runtimeConfig.browser.ts deleted file mode 100644 index ca9e52c31996..000000000000 --- a/clients/client-pi/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PIClientConfig } from "./PIClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PIClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pi/runtimeConfig.ts b/clients/client-pi/runtimeConfig.ts deleted file mode 100644 index e662eac5704a..000000000000 --- a/clients/client-pi/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PIClientConfig } from "./PIClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PIClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pi/PI.ts b/clients/client-pi/src/PI.ts similarity index 100% rename from clients/client-pi/PI.ts rename to clients/client-pi/src/PI.ts diff --git a/clients/client-pi/PIClient.ts b/clients/client-pi/src/PIClient.ts similarity index 100% rename from clients/client-pi/PIClient.ts rename to clients/client-pi/src/PIClient.ts diff --git a/clients/client-pi/commands/DescribeDimensionKeysCommand.ts b/clients/client-pi/src/commands/DescribeDimensionKeysCommand.ts similarity index 100% rename from clients/client-pi/commands/DescribeDimensionKeysCommand.ts rename to clients/client-pi/src/commands/DescribeDimensionKeysCommand.ts diff --git a/clients/client-pi/commands/GetDimensionKeyDetailsCommand.ts b/clients/client-pi/src/commands/GetDimensionKeyDetailsCommand.ts similarity index 100% rename from clients/client-pi/commands/GetDimensionKeyDetailsCommand.ts rename to clients/client-pi/src/commands/GetDimensionKeyDetailsCommand.ts diff --git a/clients/client-pi/commands/GetResourceMetricsCommand.ts b/clients/client-pi/src/commands/GetResourceMetricsCommand.ts similarity index 100% rename from clients/client-pi/commands/GetResourceMetricsCommand.ts rename to clients/client-pi/src/commands/GetResourceMetricsCommand.ts diff --git a/clients/client-pi/endpoints.ts b/clients/client-pi/src/endpoints.ts similarity index 100% rename from clients/client-pi/endpoints.ts rename to clients/client-pi/src/endpoints.ts diff --git a/clients/client-pi/index.ts b/clients/client-pi/src/index.ts similarity index 100% rename from clients/client-pi/index.ts rename to clients/client-pi/src/index.ts diff --git a/clients/client-pi/models/index.ts b/clients/client-pi/src/models/index.ts similarity index 100% rename from clients/client-pi/models/index.ts rename to clients/client-pi/src/models/index.ts diff --git a/clients/client-pi/models/models_0.ts b/clients/client-pi/src/models/models_0.ts similarity index 100% rename from clients/client-pi/models/models_0.ts rename to clients/client-pi/src/models/models_0.ts diff --git a/clients/client-pi/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-pi/protocols/Aws_json1_1.ts rename to clients/client-pi/src/protocols/Aws_json1_1.ts diff --git a/clients/client-pi/src/runtimeConfig.browser.ts b/clients/client-pi/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..35fb005399a8 --- /dev/null +++ b/clients/client-pi/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PIClientConfig } from "./PIClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PIClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pi/runtimeConfig.native.ts b/clients/client-pi/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-pi/runtimeConfig.native.ts rename to clients/client-pi/src/runtimeConfig.native.ts diff --git a/clients/client-pi/runtimeConfig.shared.ts b/clients/client-pi/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-pi/runtimeConfig.shared.ts rename to clients/client-pi/src/runtimeConfig.shared.ts diff --git a/clients/client-pi/src/runtimeConfig.ts b/clients/client-pi/src/runtimeConfig.ts new file mode 100644 index 000000000000..e33ba9915c30 --- /dev/null +++ b/clients/client-pi/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PIClientConfig } from "./PIClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PIClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pi/tsconfig.es.json b/clients/client-pi/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-pi/tsconfig.es.json +++ b/clients/client-pi/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-pi/tsconfig.json b/clients/client-pi/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-pi/tsconfig.json +++ b/clients/client-pi/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-pi/tsconfig.types.json b/clients/client-pi/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-pi/tsconfig.types.json +++ b/clients/client-pi/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-pinpoint-email/.gitignore b/clients/client-pinpoint-email/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-pinpoint-email/.gitignore +++ b/clients/client-pinpoint-email/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-pinpoint-email/package.json b/clients/client-pinpoint-email/package.json index 6b52808f106b..646eef24adfc 100644 --- a/clients/client-pinpoint-email/package.json +++ b/clients/client-pinpoint-email/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pinpoint-email", "repository": { "type": "git", diff --git a/clients/client-pinpoint-email/runtimeConfig.browser.ts b/clients/client-pinpoint-email/runtimeConfig.browser.ts deleted file mode 100644 index a3ad6695816d..000000000000 --- a/clients/client-pinpoint-email/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PinpointEmailClientConfig } from "./PinpointEmailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint-email/runtimeConfig.ts b/clients/client-pinpoint-email/runtimeConfig.ts deleted file mode 100644 index d4239d02a3da..000000000000 --- a/clients/client-pinpoint-email/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PinpointEmailClientConfig } from "./PinpointEmailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint-email/PinpointEmail.ts b/clients/client-pinpoint-email/src/PinpointEmail.ts similarity index 100% rename from clients/client-pinpoint-email/PinpointEmail.ts rename to clients/client-pinpoint-email/src/PinpointEmail.ts diff --git a/clients/client-pinpoint-email/PinpointEmailClient.ts b/clients/client-pinpoint-email/src/PinpointEmailClient.ts similarity index 100% rename from clients/client-pinpoint-email/PinpointEmailClient.ts rename to clients/client-pinpoint-email/src/PinpointEmailClient.ts diff --git a/clients/client-pinpoint-email/commands/CreateConfigurationSetCommand.ts b/clients/client-pinpoint-email/src/commands/CreateConfigurationSetCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/CreateConfigurationSetCommand.ts rename to clients/client-pinpoint-email/src/commands/CreateConfigurationSetCommand.ts diff --git a/clients/client-pinpoint-email/commands/CreateConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-email/src/commands/CreateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/CreateConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-email/src/commands/CreateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-email/commands/CreateDedicatedIpPoolCommand.ts b/clients/client-pinpoint-email/src/commands/CreateDedicatedIpPoolCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/CreateDedicatedIpPoolCommand.ts rename to clients/client-pinpoint-email/src/commands/CreateDedicatedIpPoolCommand.ts diff --git a/clients/client-pinpoint-email/commands/CreateDeliverabilityTestReportCommand.ts b/clients/client-pinpoint-email/src/commands/CreateDeliverabilityTestReportCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/CreateDeliverabilityTestReportCommand.ts rename to clients/client-pinpoint-email/src/commands/CreateDeliverabilityTestReportCommand.ts diff --git a/clients/client-pinpoint-email/commands/CreateEmailIdentityCommand.ts b/clients/client-pinpoint-email/src/commands/CreateEmailIdentityCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/CreateEmailIdentityCommand.ts rename to clients/client-pinpoint-email/src/commands/CreateEmailIdentityCommand.ts diff --git a/clients/client-pinpoint-email/commands/DeleteConfigurationSetCommand.ts b/clients/client-pinpoint-email/src/commands/DeleteConfigurationSetCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/DeleteConfigurationSetCommand.ts rename to clients/client-pinpoint-email/src/commands/DeleteConfigurationSetCommand.ts diff --git a/clients/client-pinpoint-email/commands/DeleteConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-email/src/commands/DeleteConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/DeleteConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-email/src/commands/DeleteConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-email/commands/DeleteDedicatedIpPoolCommand.ts b/clients/client-pinpoint-email/src/commands/DeleteDedicatedIpPoolCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/DeleteDedicatedIpPoolCommand.ts rename to clients/client-pinpoint-email/src/commands/DeleteDedicatedIpPoolCommand.ts diff --git a/clients/client-pinpoint-email/commands/DeleteEmailIdentityCommand.ts b/clients/client-pinpoint-email/src/commands/DeleteEmailIdentityCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/DeleteEmailIdentityCommand.ts rename to clients/client-pinpoint-email/src/commands/DeleteEmailIdentityCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetAccountCommand.ts b/clients/client-pinpoint-email/src/commands/GetAccountCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetAccountCommand.ts rename to clients/client-pinpoint-email/src/commands/GetAccountCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetBlacklistReportsCommand.ts b/clients/client-pinpoint-email/src/commands/GetBlacklistReportsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetBlacklistReportsCommand.ts rename to clients/client-pinpoint-email/src/commands/GetBlacklistReportsCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetConfigurationSetCommand.ts b/clients/client-pinpoint-email/src/commands/GetConfigurationSetCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetConfigurationSetCommand.ts rename to clients/client-pinpoint-email/src/commands/GetConfigurationSetCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetConfigurationSetEventDestinationsCommand.ts b/clients/client-pinpoint-email/src/commands/GetConfigurationSetEventDestinationsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetConfigurationSetEventDestinationsCommand.ts rename to clients/client-pinpoint-email/src/commands/GetConfigurationSetEventDestinationsCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDedicatedIpCommand.ts b/clients/client-pinpoint-email/src/commands/GetDedicatedIpCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDedicatedIpCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDedicatedIpCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDedicatedIpsCommand.ts b/clients/client-pinpoint-email/src/commands/GetDedicatedIpsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDedicatedIpsCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDedicatedIpsCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDeliverabilityDashboardOptionsCommand.ts b/clients/client-pinpoint-email/src/commands/GetDeliverabilityDashboardOptionsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDeliverabilityDashboardOptionsCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDeliverabilityDashboardOptionsCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDeliverabilityTestReportCommand.ts b/clients/client-pinpoint-email/src/commands/GetDeliverabilityTestReportCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDeliverabilityTestReportCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDeliverabilityTestReportCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDomainDeliverabilityCampaignCommand.ts b/clients/client-pinpoint-email/src/commands/GetDomainDeliverabilityCampaignCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDomainDeliverabilityCampaignCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDomainDeliverabilityCampaignCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetDomainStatisticsReportCommand.ts b/clients/client-pinpoint-email/src/commands/GetDomainStatisticsReportCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetDomainStatisticsReportCommand.ts rename to clients/client-pinpoint-email/src/commands/GetDomainStatisticsReportCommand.ts diff --git a/clients/client-pinpoint-email/commands/GetEmailIdentityCommand.ts b/clients/client-pinpoint-email/src/commands/GetEmailIdentityCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/GetEmailIdentityCommand.ts rename to clients/client-pinpoint-email/src/commands/GetEmailIdentityCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListConfigurationSetsCommand.ts b/clients/client-pinpoint-email/src/commands/ListConfigurationSetsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListConfigurationSetsCommand.ts rename to clients/client-pinpoint-email/src/commands/ListConfigurationSetsCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListDedicatedIpPoolsCommand.ts b/clients/client-pinpoint-email/src/commands/ListDedicatedIpPoolsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListDedicatedIpPoolsCommand.ts rename to clients/client-pinpoint-email/src/commands/ListDedicatedIpPoolsCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListDeliverabilityTestReportsCommand.ts b/clients/client-pinpoint-email/src/commands/ListDeliverabilityTestReportsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListDeliverabilityTestReportsCommand.ts rename to clients/client-pinpoint-email/src/commands/ListDeliverabilityTestReportsCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListDomainDeliverabilityCampaignsCommand.ts b/clients/client-pinpoint-email/src/commands/ListDomainDeliverabilityCampaignsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListDomainDeliverabilityCampaignsCommand.ts rename to clients/client-pinpoint-email/src/commands/ListDomainDeliverabilityCampaignsCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListEmailIdentitiesCommand.ts b/clients/client-pinpoint-email/src/commands/ListEmailIdentitiesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListEmailIdentitiesCommand.ts rename to clients/client-pinpoint-email/src/commands/ListEmailIdentitiesCommand.ts diff --git a/clients/client-pinpoint-email/commands/ListTagsForResourceCommand.ts b/clients/client-pinpoint-email/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/ListTagsForResourceCommand.ts rename to clients/client-pinpoint-email/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutAccountSendingAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutAccountSendingAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutAccountSendingAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutAccountSendingAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutConfigurationSetDeliveryOptionsCommand.ts b/clients/client-pinpoint-email/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutConfigurationSetDeliveryOptionsCommand.ts rename to clients/client-pinpoint-email/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutConfigurationSetReputationOptionsCommand.ts b/clients/client-pinpoint-email/src/commands/PutConfigurationSetReputationOptionsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutConfigurationSetReputationOptionsCommand.ts rename to clients/client-pinpoint-email/src/commands/PutConfigurationSetReputationOptionsCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutConfigurationSetSendingOptionsCommand.ts b/clients/client-pinpoint-email/src/commands/PutConfigurationSetSendingOptionsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutConfigurationSetSendingOptionsCommand.ts rename to clients/client-pinpoint-email/src/commands/PutConfigurationSetSendingOptionsCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutConfigurationSetTrackingOptionsCommand.ts b/clients/client-pinpoint-email/src/commands/PutConfigurationSetTrackingOptionsCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutConfigurationSetTrackingOptionsCommand.ts rename to clients/client-pinpoint-email/src/commands/PutConfigurationSetTrackingOptionsCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutDedicatedIpInPoolCommand.ts b/clients/client-pinpoint-email/src/commands/PutDedicatedIpInPoolCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutDedicatedIpInPoolCommand.ts rename to clients/client-pinpoint-email/src/commands/PutDedicatedIpInPoolCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutDedicatedIpWarmupAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutDedicatedIpWarmupAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutDedicatedIpWarmupAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutDedicatedIpWarmupAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutDeliverabilityDashboardOptionCommand.ts b/clients/client-pinpoint-email/src/commands/PutDeliverabilityDashboardOptionCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutDeliverabilityDashboardOptionCommand.ts rename to clients/client-pinpoint-email/src/commands/PutDeliverabilityDashboardOptionCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutEmailIdentityDkimAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutEmailIdentityDkimAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutEmailIdentityDkimAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutEmailIdentityDkimAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutEmailIdentityFeedbackAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutEmailIdentityFeedbackAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/PutEmailIdentityMailFromAttributesCommand.ts b/clients/client-pinpoint-email/src/commands/PutEmailIdentityMailFromAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/PutEmailIdentityMailFromAttributesCommand.ts rename to clients/client-pinpoint-email/src/commands/PutEmailIdentityMailFromAttributesCommand.ts diff --git a/clients/client-pinpoint-email/commands/SendEmailCommand.ts b/clients/client-pinpoint-email/src/commands/SendEmailCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/SendEmailCommand.ts rename to clients/client-pinpoint-email/src/commands/SendEmailCommand.ts diff --git a/clients/client-pinpoint-email/commands/TagResourceCommand.ts b/clients/client-pinpoint-email/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/TagResourceCommand.ts rename to clients/client-pinpoint-email/src/commands/TagResourceCommand.ts diff --git a/clients/client-pinpoint-email/commands/UntagResourceCommand.ts b/clients/client-pinpoint-email/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/UntagResourceCommand.ts rename to clients/client-pinpoint-email/src/commands/UntagResourceCommand.ts diff --git a/clients/client-pinpoint-email/commands/UpdateConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-email/src/commands/UpdateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-email/commands/UpdateConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-email/src/commands/UpdateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-email/endpoints.ts b/clients/client-pinpoint-email/src/endpoints.ts similarity index 100% rename from clients/client-pinpoint-email/endpoints.ts rename to clients/client-pinpoint-email/src/endpoints.ts diff --git a/clients/client-pinpoint-email/index.ts b/clients/client-pinpoint-email/src/index.ts similarity index 100% rename from clients/client-pinpoint-email/index.ts rename to clients/client-pinpoint-email/src/index.ts diff --git a/clients/client-pinpoint-email/models/index.ts b/clients/client-pinpoint-email/src/models/index.ts similarity index 100% rename from clients/client-pinpoint-email/models/index.ts rename to clients/client-pinpoint-email/src/models/index.ts diff --git a/clients/client-pinpoint-email/models/models_0.ts b/clients/client-pinpoint-email/src/models/models_0.ts similarity index 100% rename from clients/client-pinpoint-email/models/models_0.ts rename to clients/client-pinpoint-email/src/models/models_0.ts diff --git a/clients/client-pinpoint-email/pagination/GetDedicatedIpsPaginator.ts b/clients/client-pinpoint-email/src/pagination/GetDedicatedIpsPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/GetDedicatedIpsPaginator.ts rename to clients/client-pinpoint-email/src/pagination/GetDedicatedIpsPaginator.ts diff --git a/clients/client-pinpoint-email/pagination/Interfaces.ts b/clients/client-pinpoint-email/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/Interfaces.ts rename to clients/client-pinpoint-email/src/pagination/Interfaces.ts diff --git a/clients/client-pinpoint-email/pagination/ListConfigurationSetsPaginator.ts b/clients/client-pinpoint-email/src/pagination/ListConfigurationSetsPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/ListConfigurationSetsPaginator.ts rename to clients/client-pinpoint-email/src/pagination/ListConfigurationSetsPaginator.ts diff --git a/clients/client-pinpoint-email/pagination/ListDedicatedIpPoolsPaginator.ts b/clients/client-pinpoint-email/src/pagination/ListDedicatedIpPoolsPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/ListDedicatedIpPoolsPaginator.ts rename to clients/client-pinpoint-email/src/pagination/ListDedicatedIpPoolsPaginator.ts diff --git a/clients/client-pinpoint-email/pagination/ListDeliverabilityTestReportsPaginator.ts b/clients/client-pinpoint-email/src/pagination/ListDeliverabilityTestReportsPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/ListDeliverabilityTestReportsPaginator.ts rename to clients/client-pinpoint-email/src/pagination/ListDeliverabilityTestReportsPaginator.ts diff --git a/clients/client-pinpoint-email/pagination/ListDomainDeliverabilityCampaignsPaginator.ts b/clients/client-pinpoint-email/src/pagination/ListDomainDeliverabilityCampaignsPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/ListDomainDeliverabilityCampaignsPaginator.ts rename to clients/client-pinpoint-email/src/pagination/ListDomainDeliverabilityCampaignsPaginator.ts diff --git a/clients/client-pinpoint-email/pagination/ListEmailIdentitiesPaginator.ts b/clients/client-pinpoint-email/src/pagination/ListEmailIdentitiesPaginator.ts similarity index 100% rename from clients/client-pinpoint-email/pagination/ListEmailIdentitiesPaginator.ts rename to clients/client-pinpoint-email/src/pagination/ListEmailIdentitiesPaginator.ts diff --git a/clients/client-pinpoint-email/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-pinpoint-email/protocols/Aws_restJson1.ts rename to clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts diff --git a/clients/client-pinpoint-email/src/runtimeConfig.browser.ts b/clients/client-pinpoint-email/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a73df8f3b5f2 --- /dev/null +++ b/clients/client-pinpoint-email/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PinpointEmailClientConfig } from "./PinpointEmailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint-email/runtimeConfig.native.ts b/clients/client-pinpoint-email/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-pinpoint-email/runtimeConfig.native.ts rename to clients/client-pinpoint-email/src/runtimeConfig.native.ts diff --git a/clients/client-pinpoint-email/runtimeConfig.shared.ts b/clients/client-pinpoint-email/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-pinpoint-email/runtimeConfig.shared.ts rename to clients/client-pinpoint-email/src/runtimeConfig.shared.ts diff --git a/clients/client-pinpoint-email/src/runtimeConfig.ts b/clients/client-pinpoint-email/src/runtimeConfig.ts new file mode 100644 index 000000000000..5715a95703fa --- /dev/null +++ b/clients/client-pinpoint-email/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PinpointEmailClientConfig } from "./PinpointEmailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint-email/tsconfig.es.json b/clients/client-pinpoint-email/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-pinpoint-email/tsconfig.es.json +++ b/clients/client-pinpoint-email/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-pinpoint-email/tsconfig.json b/clients/client-pinpoint-email/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-pinpoint-email/tsconfig.json +++ b/clients/client-pinpoint-email/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-pinpoint-email/tsconfig.types.json b/clients/client-pinpoint-email/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-pinpoint-email/tsconfig.types.json +++ b/clients/client-pinpoint-email/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-pinpoint-sms-voice/.gitignore b/clients/client-pinpoint-sms-voice/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-pinpoint-sms-voice/.gitignore +++ b/clients/client-pinpoint-sms-voice/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-pinpoint-sms-voice/package.json b/clients/client-pinpoint-sms-voice/package.json index ff371045c18e..d2b76311f37c 100644 --- a/clients/client-pinpoint-sms-voice/package.json +++ b/clients/client-pinpoint-sms-voice/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pinpoint-sms-voice", "repository": { "type": "git", diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts deleted file mode 100644 index 6660ce21e083..000000000000 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PinpointSMSVoiceClientConfig } from "./PinpointSMSVoiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/runtimeConfig.ts deleted file mode 100644 index e7c2662c6724..000000000000 --- a/clients/client-pinpoint-sms-voice/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PinpointSMSVoiceClientConfig } from "./PinpointSMSVoiceClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint-sms-voice/PinpointSMSVoice.ts b/clients/client-pinpoint-sms-voice/src/PinpointSMSVoice.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/PinpointSMSVoice.ts rename to clients/client-pinpoint-sms-voice/src/PinpointSMSVoice.ts diff --git a/clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts b/clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/PinpointSMSVoiceClient.ts rename to clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts diff --git a/clients/client-pinpoint-sms-voice/commands/CreateConfigurationSetCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/CreateConfigurationSetCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/CreateConfigurationSetCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/CreateConfigurationSetCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/CreateConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/CreateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/CreateConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/CreateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/DeleteConfigurationSetCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/DeleteConfigurationSetCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/DeleteConfigurationSetCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/DeleteConfigurationSetCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/DeleteConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/DeleteConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/DeleteConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/DeleteConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/GetConfigurationSetEventDestinationsCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/GetConfigurationSetEventDestinationsCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/GetConfigurationSetEventDestinationsCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/GetConfigurationSetEventDestinationsCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/ListConfigurationSetsCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/ListConfigurationSetsCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/ListConfigurationSetsCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/ListConfigurationSetsCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/SendVoiceMessageCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/SendVoiceMessageCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/SendVoiceMessageCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/SendVoiceMessageCommand.ts diff --git a/clients/client-pinpoint-sms-voice/commands/UpdateConfigurationSetEventDestinationCommand.ts b/clients/client-pinpoint-sms-voice/src/commands/UpdateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/commands/UpdateConfigurationSetEventDestinationCommand.ts rename to clients/client-pinpoint-sms-voice/src/commands/UpdateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-pinpoint-sms-voice/endpoints.ts b/clients/client-pinpoint-sms-voice/src/endpoints.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/endpoints.ts rename to clients/client-pinpoint-sms-voice/src/endpoints.ts diff --git a/clients/client-pinpoint-sms-voice/index.ts b/clients/client-pinpoint-sms-voice/src/index.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/index.ts rename to clients/client-pinpoint-sms-voice/src/index.ts diff --git a/clients/client-pinpoint-sms-voice/models/index.ts b/clients/client-pinpoint-sms-voice/src/models/index.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/models/index.ts rename to clients/client-pinpoint-sms-voice/src/models/index.ts diff --git a/clients/client-pinpoint-sms-voice/models/models_0.ts b/clients/client-pinpoint-sms-voice/src/models/models_0.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/models/models_0.ts rename to clients/client-pinpoint-sms-voice/src/models/models_0.ts diff --git a/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/protocols/Aws_restJson1.ts rename to clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts diff --git a/clients/client-pinpoint-sms-voice/src/runtimeConfig.browser.ts b/clients/client-pinpoint-sms-voice/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e6ee3dabf805 --- /dev/null +++ b/clients/client-pinpoint-sms-voice/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PinpointSMSVoiceClientConfig } from "./PinpointSMSVoiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.native.ts b/clients/client-pinpoint-sms-voice/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/runtimeConfig.native.ts rename to clients/client-pinpoint-sms-voice/src/runtimeConfig.native.ts diff --git a/clients/client-pinpoint-sms-voice/runtimeConfig.shared.ts b/clients/client-pinpoint-sms-voice/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-pinpoint-sms-voice/runtimeConfig.shared.ts rename to clients/client-pinpoint-sms-voice/src/runtimeConfig.shared.ts diff --git a/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts new file mode 100644 index 000000000000..a4c668ab576b --- /dev/null +++ b/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PinpointSMSVoiceClientConfig } from "./PinpointSMSVoiceClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint-sms-voice/tsconfig.es.json b/clients/client-pinpoint-sms-voice/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-pinpoint-sms-voice/tsconfig.es.json +++ b/clients/client-pinpoint-sms-voice/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-pinpoint-sms-voice/tsconfig.json b/clients/client-pinpoint-sms-voice/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-pinpoint-sms-voice/tsconfig.json +++ b/clients/client-pinpoint-sms-voice/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-pinpoint-sms-voice/tsconfig.types.json b/clients/client-pinpoint-sms-voice/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-pinpoint-sms-voice/tsconfig.types.json +++ b/clients/client-pinpoint-sms-voice/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-pinpoint/.gitignore b/clients/client-pinpoint/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-pinpoint/.gitignore +++ b/clients/client-pinpoint/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-pinpoint/package.json b/clients/client-pinpoint/package.json index b4dfe95554a3..be16679ebbd2 100644 --- a/clients/client-pinpoint/package.json +++ b/clients/client-pinpoint/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pinpoint", "repository": { "type": "git", diff --git a/clients/client-pinpoint/runtimeConfig.browser.ts b/clients/client-pinpoint/runtimeConfig.browser.ts deleted file mode 100644 index 3c77f98eb45e..000000000000 --- a/clients/client-pinpoint/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PinpointClientConfig } from "./PinpointClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint/runtimeConfig.ts b/clients/client-pinpoint/runtimeConfig.ts deleted file mode 100644 index 8566814356e0..000000000000 --- a/clients/client-pinpoint/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PinpointClientConfig } from "./PinpointClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PinpointClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pinpoint/Pinpoint.ts b/clients/client-pinpoint/src/Pinpoint.ts similarity index 100% rename from clients/client-pinpoint/Pinpoint.ts rename to clients/client-pinpoint/src/Pinpoint.ts diff --git a/clients/client-pinpoint/PinpointClient.ts b/clients/client-pinpoint/src/PinpointClient.ts similarity index 100% rename from clients/client-pinpoint/PinpointClient.ts rename to clients/client-pinpoint/src/PinpointClient.ts diff --git a/clients/client-pinpoint/commands/CreateAppCommand.ts b/clients/client-pinpoint/src/commands/CreateAppCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateAppCommand.ts rename to clients/client-pinpoint/src/commands/CreateAppCommand.ts diff --git a/clients/client-pinpoint/commands/CreateCampaignCommand.ts b/clients/client-pinpoint/src/commands/CreateCampaignCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateCampaignCommand.ts rename to clients/client-pinpoint/src/commands/CreateCampaignCommand.ts diff --git a/clients/client-pinpoint/commands/CreateEmailTemplateCommand.ts b/clients/client-pinpoint/src/commands/CreateEmailTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateEmailTemplateCommand.ts rename to clients/client-pinpoint/src/commands/CreateEmailTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/CreateExportJobCommand.ts b/clients/client-pinpoint/src/commands/CreateExportJobCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateExportJobCommand.ts rename to clients/client-pinpoint/src/commands/CreateExportJobCommand.ts diff --git a/clients/client-pinpoint/commands/CreateImportJobCommand.ts b/clients/client-pinpoint/src/commands/CreateImportJobCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateImportJobCommand.ts rename to clients/client-pinpoint/src/commands/CreateImportJobCommand.ts diff --git a/clients/client-pinpoint/commands/CreateInAppTemplateCommand.ts b/clients/client-pinpoint/src/commands/CreateInAppTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateInAppTemplateCommand.ts rename to clients/client-pinpoint/src/commands/CreateInAppTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/CreateJourneyCommand.ts b/clients/client-pinpoint/src/commands/CreateJourneyCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateJourneyCommand.ts rename to clients/client-pinpoint/src/commands/CreateJourneyCommand.ts diff --git a/clients/client-pinpoint/commands/CreatePushTemplateCommand.ts b/clients/client-pinpoint/src/commands/CreatePushTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreatePushTemplateCommand.ts rename to clients/client-pinpoint/src/commands/CreatePushTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/CreateRecommenderConfigurationCommand.ts b/clients/client-pinpoint/src/commands/CreateRecommenderConfigurationCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateRecommenderConfigurationCommand.ts rename to clients/client-pinpoint/src/commands/CreateRecommenderConfigurationCommand.ts diff --git a/clients/client-pinpoint/commands/CreateSegmentCommand.ts b/clients/client-pinpoint/src/commands/CreateSegmentCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateSegmentCommand.ts rename to clients/client-pinpoint/src/commands/CreateSegmentCommand.ts diff --git a/clients/client-pinpoint/commands/CreateSmsTemplateCommand.ts b/clients/client-pinpoint/src/commands/CreateSmsTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateSmsTemplateCommand.ts rename to clients/client-pinpoint/src/commands/CreateSmsTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/CreateVoiceTemplateCommand.ts b/clients/client-pinpoint/src/commands/CreateVoiceTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/CreateVoiceTemplateCommand.ts rename to clients/client-pinpoint/src/commands/CreateVoiceTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteAdmChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteAdmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteAdmChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteAdmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteApnsChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteApnsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteApnsChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteApnsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteApnsSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteApnsSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteApnsSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteApnsSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteApnsVoipChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteApnsVoipChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteApnsVoipChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteApnsVoipChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteApnsVoipSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteApnsVoipSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteApnsVoipSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteApnsVoipSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteAppCommand.ts b/clients/client-pinpoint/src/commands/DeleteAppCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteAppCommand.ts rename to clients/client-pinpoint/src/commands/DeleteAppCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteBaiduChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteBaiduChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteBaiduChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteBaiduChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteCampaignCommand.ts b/clients/client-pinpoint/src/commands/DeleteCampaignCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteCampaignCommand.ts rename to clients/client-pinpoint/src/commands/DeleteCampaignCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteEmailChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteEmailChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteEmailChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteEmailChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteEmailTemplateCommand.ts b/clients/client-pinpoint/src/commands/DeleteEmailTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteEmailTemplateCommand.ts rename to clients/client-pinpoint/src/commands/DeleteEmailTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteEndpointCommand.ts b/clients/client-pinpoint/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteEndpointCommand.ts rename to clients/client-pinpoint/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteEventStreamCommand.ts b/clients/client-pinpoint/src/commands/DeleteEventStreamCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteEventStreamCommand.ts rename to clients/client-pinpoint/src/commands/DeleteEventStreamCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteGcmChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteGcmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteGcmChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteGcmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteInAppTemplateCommand.ts b/clients/client-pinpoint/src/commands/DeleteInAppTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteInAppTemplateCommand.ts rename to clients/client-pinpoint/src/commands/DeleteInAppTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteJourneyCommand.ts b/clients/client-pinpoint/src/commands/DeleteJourneyCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteJourneyCommand.ts rename to clients/client-pinpoint/src/commands/DeleteJourneyCommand.ts diff --git a/clients/client-pinpoint/commands/DeletePushTemplateCommand.ts b/clients/client-pinpoint/src/commands/DeletePushTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeletePushTemplateCommand.ts rename to clients/client-pinpoint/src/commands/DeletePushTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteRecommenderConfigurationCommand.ts b/clients/client-pinpoint/src/commands/DeleteRecommenderConfigurationCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteRecommenderConfigurationCommand.ts rename to clients/client-pinpoint/src/commands/DeleteRecommenderConfigurationCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteSegmentCommand.ts b/clients/client-pinpoint/src/commands/DeleteSegmentCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteSegmentCommand.ts rename to clients/client-pinpoint/src/commands/DeleteSegmentCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteSmsChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteSmsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteSmsChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteSmsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteSmsTemplateCommand.ts b/clients/client-pinpoint/src/commands/DeleteSmsTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteSmsTemplateCommand.ts rename to clients/client-pinpoint/src/commands/DeleteSmsTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteUserEndpointsCommand.ts b/clients/client-pinpoint/src/commands/DeleteUserEndpointsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteUserEndpointsCommand.ts rename to clients/client-pinpoint/src/commands/DeleteUserEndpointsCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteVoiceChannelCommand.ts b/clients/client-pinpoint/src/commands/DeleteVoiceChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteVoiceChannelCommand.ts rename to clients/client-pinpoint/src/commands/DeleteVoiceChannelCommand.ts diff --git a/clients/client-pinpoint/commands/DeleteVoiceTemplateCommand.ts b/clients/client-pinpoint/src/commands/DeleteVoiceTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/DeleteVoiceTemplateCommand.ts rename to clients/client-pinpoint/src/commands/DeleteVoiceTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/GetAdmChannelCommand.ts b/clients/client-pinpoint/src/commands/GetAdmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetAdmChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetAdmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetApnsChannelCommand.ts b/clients/client-pinpoint/src/commands/GetApnsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApnsChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetApnsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetApnsSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/GetApnsSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApnsSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetApnsSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetApnsVoipChannelCommand.ts b/clients/client-pinpoint/src/commands/GetApnsVoipChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApnsVoipChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetApnsVoipChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetApnsVoipSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/GetApnsVoipSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApnsVoipSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetApnsVoipSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetAppCommand.ts b/clients/client-pinpoint/src/commands/GetAppCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetAppCommand.ts rename to clients/client-pinpoint/src/commands/GetAppCommand.ts diff --git a/clients/client-pinpoint/commands/GetApplicationDateRangeKpiCommand.ts b/clients/client-pinpoint/src/commands/GetApplicationDateRangeKpiCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApplicationDateRangeKpiCommand.ts rename to clients/client-pinpoint/src/commands/GetApplicationDateRangeKpiCommand.ts diff --git a/clients/client-pinpoint/commands/GetApplicationSettingsCommand.ts b/clients/client-pinpoint/src/commands/GetApplicationSettingsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetApplicationSettingsCommand.ts rename to clients/client-pinpoint/src/commands/GetApplicationSettingsCommand.ts diff --git a/clients/client-pinpoint/commands/GetAppsCommand.ts b/clients/client-pinpoint/src/commands/GetAppsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetAppsCommand.ts rename to clients/client-pinpoint/src/commands/GetAppsCommand.ts diff --git a/clients/client-pinpoint/commands/GetBaiduChannelCommand.ts b/clients/client-pinpoint/src/commands/GetBaiduChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetBaiduChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetBaiduChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignActivitiesCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignActivitiesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignActivitiesCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignActivitiesCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignDateRangeKpiCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignDateRangeKpiCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignDateRangeKpiCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignDateRangeKpiCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignVersionCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignVersionCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignVersionCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignVersionCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignVersionsCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignVersionsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignVersionsCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignVersionsCommand.ts diff --git a/clients/client-pinpoint/commands/GetCampaignsCommand.ts b/clients/client-pinpoint/src/commands/GetCampaignsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetCampaignsCommand.ts rename to clients/client-pinpoint/src/commands/GetCampaignsCommand.ts diff --git a/clients/client-pinpoint/commands/GetChannelsCommand.ts b/clients/client-pinpoint/src/commands/GetChannelsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetChannelsCommand.ts rename to clients/client-pinpoint/src/commands/GetChannelsCommand.ts diff --git a/clients/client-pinpoint/commands/GetEmailChannelCommand.ts b/clients/client-pinpoint/src/commands/GetEmailChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetEmailChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetEmailChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetEmailTemplateCommand.ts b/clients/client-pinpoint/src/commands/GetEmailTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetEmailTemplateCommand.ts rename to clients/client-pinpoint/src/commands/GetEmailTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/GetEndpointCommand.ts b/clients/client-pinpoint/src/commands/GetEndpointCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetEndpointCommand.ts rename to clients/client-pinpoint/src/commands/GetEndpointCommand.ts diff --git a/clients/client-pinpoint/commands/GetEventStreamCommand.ts b/clients/client-pinpoint/src/commands/GetEventStreamCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetEventStreamCommand.ts rename to clients/client-pinpoint/src/commands/GetEventStreamCommand.ts diff --git a/clients/client-pinpoint/commands/GetExportJobCommand.ts b/clients/client-pinpoint/src/commands/GetExportJobCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetExportJobCommand.ts rename to clients/client-pinpoint/src/commands/GetExportJobCommand.ts diff --git a/clients/client-pinpoint/commands/GetExportJobsCommand.ts b/clients/client-pinpoint/src/commands/GetExportJobsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetExportJobsCommand.ts rename to clients/client-pinpoint/src/commands/GetExportJobsCommand.ts diff --git a/clients/client-pinpoint/commands/GetGcmChannelCommand.ts b/clients/client-pinpoint/src/commands/GetGcmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetGcmChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetGcmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetImportJobCommand.ts b/clients/client-pinpoint/src/commands/GetImportJobCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetImportJobCommand.ts rename to clients/client-pinpoint/src/commands/GetImportJobCommand.ts diff --git a/clients/client-pinpoint/commands/GetImportJobsCommand.ts b/clients/client-pinpoint/src/commands/GetImportJobsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetImportJobsCommand.ts rename to clients/client-pinpoint/src/commands/GetImportJobsCommand.ts diff --git a/clients/client-pinpoint/commands/GetInAppMessagesCommand.ts b/clients/client-pinpoint/src/commands/GetInAppMessagesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetInAppMessagesCommand.ts rename to clients/client-pinpoint/src/commands/GetInAppMessagesCommand.ts diff --git a/clients/client-pinpoint/commands/GetInAppTemplateCommand.ts b/clients/client-pinpoint/src/commands/GetInAppTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetInAppTemplateCommand.ts rename to clients/client-pinpoint/src/commands/GetInAppTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/GetJourneyCommand.ts b/clients/client-pinpoint/src/commands/GetJourneyCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetJourneyCommand.ts rename to clients/client-pinpoint/src/commands/GetJourneyCommand.ts diff --git a/clients/client-pinpoint/commands/GetJourneyDateRangeKpiCommand.ts b/clients/client-pinpoint/src/commands/GetJourneyDateRangeKpiCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetJourneyDateRangeKpiCommand.ts rename to clients/client-pinpoint/src/commands/GetJourneyDateRangeKpiCommand.ts diff --git a/clients/client-pinpoint/commands/GetJourneyExecutionActivityMetricsCommand.ts b/clients/client-pinpoint/src/commands/GetJourneyExecutionActivityMetricsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetJourneyExecutionActivityMetricsCommand.ts rename to clients/client-pinpoint/src/commands/GetJourneyExecutionActivityMetricsCommand.ts diff --git a/clients/client-pinpoint/commands/GetJourneyExecutionMetricsCommand.ts b/clients/client-pinpoint/src/commands/GetJourneyExecutionMetricsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetJourneyExecutionMetricsCommand.ts rename to clients/client-pinpoint/src/commands/GetJourneyExecutionMetricsCommand.ts diff --git a/clients/client-pinpoint/commands/GetPushTemplateCommand.ts b/clients/client-pinpoint/src/commands/GetPushTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetPushTemplateCommand.ts rename to clients/client-pinpoint/src/commands/GetPushTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/GetRecommenderConfigurationCommand.ts b/clients/client-pinpoint/src/commands/GetRecommenderConfigurationCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetRecommenderConfigurationCommand.ts rename to clients/client-pinpoint/src/commands/GetRecommenderConfigurationCommand.ts diff --git a/clients/client-pinpoint/commands/GetRecommenderConfigurationsCommand.ts b/clients/client-pinpoint/src/commands/GetRecommenderConfigurationsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetRecommenderConfigurationsCommand.ts rename to clients/client-pinpoint/src/commands/GetRecommenderConfigurationsCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentExportJobsCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentExportJobsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentExportJobsCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentExportJobsCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentImportJobsCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentImportJobsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentImportJobsCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentImportJobsCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentVersionCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentVersionCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentVersionCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentVersionCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentVersionsCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentVersionsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentVersionsCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentVersionsCommand.ts diff --git a/clients/client-pinpoint/commands/GetSegmentsCommand.ts b/clients/client-pinpoint/src/commands/GetSegmentsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSegmentsCommand.ts rename to clients/client-pinpoint/src/commands/GetSegmentsCommand.ts diff --git a/clients/client-pinpoint/commands/GetSmsChannelCommand.ts b/clients/client-pinpoint/src/commands/GetSmsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSmsChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetSmsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetSmsTemplateCommand.ts b/clients/client-pinpoint/src/commands/GetSmsTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetSmsTemplateCommand.ts rename to clients/client-pinpoint/src/commands/GetSmsTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/GetUserEndpointsCommand.ts b/clients/client-pinpoint/src/commands/GetUserEndpointsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetUserEndpointsCommand.ts rename to clients/client-pinpoint/src/commands/GetUserEndpointsCommand.ts diff --git a/clients/client-pinpoint/commands/GetVoiceChannelCommand.ts b/clients/client-pinpoint/src/commands/GetVoiceChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetVoiceChannelCommand.ts rename to clients/client-pinpoint/src/commands/GetVoiceChannelCommand.ts diff --git a/clients/client-pinpoint/commands/GetVoiceTemplateCommand.ts b/clients/client-pinpoint/src/commands/GetVoiceTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/GetVoiceTemplateCommand.ts rename to clients/client-pinpoint/src/commands/GetVoiceTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/ListJourneysCommand.ts b/clients/client-pinpoint/src/commands/ListJourneysCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/ListJourneysCommand.ts rename to clients/client-pinpoint/src/commands/ListJourneysCommand.ts diff --git a/clients/client-pinpoint/commands/ListTagsForResourceCommand.ts b/clients/client-pinpoint/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/ListTagsForResourceCommand.ts rename to clients/client-pinpoint/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-pinpoint/commands/ListTemplateVersionsCommand.ts b/clients/client-pinpoint/src/commands/ListTemplateVersionsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/ListTemplateVersionsCommand.ts rename to clients/client-pinpoint/src/commands/ListTemplateVersionsCommand.ts diff --git a/clients/client-pinpoint/commands/ListTemplatesCommand.ts b/clients/client-pinpoint/src/commands/ListTemplatesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/ListTemplatesCommand.ts rename to clients/client-pinpoint/src/commands/ListTemplatesCommand.ts diff --git a/clients/client-pinpoint/commands/PhoneNumberValidateCommand.ts b/clients/client-pinpoint/src/commands/PhoneNumberValidateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/PhoneNumberValidateCommand.ts rename to clients/client-pinpoint/src/commands/PhoneNumberValidateCommand.ts diff --git a/clients/client-pinpoint/commands/PutEventStreamCommand.ts b/clients/client-pinpoint/src/commands/PutEventStreamCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/PutEventStreamCommand.ts rename to clients/client-pinpoint/src/commands/PutEventStreamCommand.ts diff --git a/clients/client-pinpoint/commands/PutEventsCommand.ts b/clients/client-pinpoint/src/commands/PutEventsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/PutEventsCommand.ts rename to clients/client-pinpoint/src/commands/PutEventsCommand.ts diff --git a/clients/client-pinpoint/commands/RemoveAttributesCommand.ts b/clients/client-pinpoint/src/commands/RemoveAttributesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/RemoveAttributesCommand.ts rename to clients/client-pinpoint/src/commands/RemoveAttributesCommand.ts diff --git a/clients/client-pinpoint/commands/SendMessagesCommand.ts b/clients/client-pinpoint/src/commands/SendMessagesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/SendMessagesCommand.ts rename to clients/client-pinpoint/src/commands/SendMessagesCommand.ts diff --git a/clients/client-pinpoint/commands/SendUsersMessagesCommand.ts b/clients/client-pinpoint/src/commands/SendUsersMessagesCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/SendUsersMessagesCommand.ts rename to clients/client-pinpoint/src/commands/SendUsersMessagesCommand.ts diff --git a/clients/client-pinpoint/commands/TagResourceCommand.ts b/clients/client-pinpoint/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/TagResourceCommand.ts rename to clients/client-pinpoint/src/commands/TagResourceCommand.ts diff --git a/clients/client-pinpoint/commands/UntagResourceCommand.ts b/clients/client-pinpoint/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UntagResourceCommand.ts rename to clients/client-pinpoint/src/commands/UntagResourceCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateAdmChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateAdmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateAdmChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateAdmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateApnsChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateApnsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateApnsChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateApnsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateApnsSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateApnsSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateApnsSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateApnsSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateApnsVoipChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateApnsVoipChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateApnsVoipChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateApnsVoipChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateApnsVoipSandboxChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateApnsVoipSandboxChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateApnsVoipSandboxChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateApnsVoipSandboxChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateApplicationSettingsCommand.ts b/clients/client-pinpoint/src/commands/UpdateApplicationSettingsCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateApplicationSettingsCommand.ts rename to clients/client-pinpoint/src/commands/UpdateApplicationSettingsCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateBaiduChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateBaiduChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateBaiduChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateBaiduChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateCampaignCommand.ts b/clients/client-pinpoint/src/commands/UpdateCampaignCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateCampaignCommand.ts rename to clients/client-pinpoint/src/commands/UpdateCampaignCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateEmailChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateEmailChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateEmailChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateEmailChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateEmailTemplateCommand.ts b/clients/client-pinpoint/src/commands/UpdateEmailTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateEmailTemplateCommand.ts rename to clients/client-pinpoint/src/commands/UpdateEmailTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateEndpointCommand.ts b/clients/client-pinpoint/src/commands/UpdateEndpointCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateEndpointCommand.ts rename to clients/client-pinpoint/src/commands/UpdateEndpointCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateEndpointsBatchCommand.ts b/clients/client-pinpoint/src/commands/UpdateEndpointsBatchCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateEndpointsBatchCommand.ts rename to clients/client-pinpoint/src/commands/UpdateEndpointsBatchCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateGcmChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateGcmChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateGcmChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateGcmChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateInAppTemplateCommand.ts b/clients/client-pinpoint/src/commands/UpdateInAppTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateInAppTemplateCommand.ts rename to clients/client-pinpoint/src/commands/UpdateInAppTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateJourneyCommand.ts b/clients/client-pinpoint/src/commands/UpdateJourneyCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateJourneyCommand.ts rename to clients/client-pinpoint/src/commands/UpdateJourneyCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateJourneyStateCommand.ts b/clients/client-pinpoint/src/commands/UpdateJourneyStateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateJourneyStateCommand.ts rename to clients/client-pinpoint/src/commands/UpdateJourneyStateCommand.ts diff --git a/clients/client-pinpoint/commands/UpdatePushTemplateCommand.ts b/clients/client-pinpoint/src/commands/UpdatePushTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdatePushTemplateCommand.ts rename to clients/client-pinpoint/src/commands/UpdatePushTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateRecommenderConfigurationCommand.ts b/clients/client-pinpoint/src/commands/UpdateRecommenderConfigurationCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateRecommenderConfigurationCommand.ts rename to clients/client-pinpoint/src/commands/UpdateRecommenderConfigurationCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateSegmentCommand.ts b/clients/client-pinpoint/src/commands/UpdateSegmentCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateSegmentCommand.ts rename to clients/client-pinpoint/src/commands/UpdateSegmentCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateSmsChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateSmsChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateSmsChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateSmsChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateSmsTemplateCommand.ts b/clients/client-pinpoint/src/commands/UpdateSmsTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateSmsTemplateCommand.ts rename to clients/client-pinpoint/src/commands/UpdateSmsTemplateCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateTemplateActiveVersionCommand.ts b/clients/client-pinpoint/src/commands/UpdateTemplateActiveVersionCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateTemplateActiveVersionCommand.ts rename to clients/client-pinpoint/src/commands/UpdateTemplateActiveVersionCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateVoiceChannelCommand.ts b/clients/client-pinpoint/src/commands/UpdateVoiceChannelCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateVoiceChannelCommand.ts rename to clients/client-pinpoint/src/commands/UpdateVoiceChannelCommand.ts diff --git a/clients/client-pinpoint/commands/UpdateVoiceTemplateCommand.ts b/clients/client-pinpoint/src/commands/UpdateVoiceTemplateCommand.ts similarity index 100% rename from clients/client-pinpoint/commands/UpdateVoiceTemplateCommand.ts rename to clients/client-pinpoint/src/commands/UpdateVoiceTemplateCommand.ts diff --git a/clients/client-pinpoint/endpoints.ts b/clients/client-pinpoint/src/endpoints.ts similarity index 100% rename from clients/client-pinpoint/endpoints.ts rename to clients/client-pinpoint/src/endpoints.ts diff --git a/clients/client-pinpoint/index.ts b/clients/client-pinpoint/src/index.ts similarity index 100% rename from clients/client-pinpoint/index.ts rename to clients/client-pinpoint/src/index.ts diff --git a/clients/client-pinpoint/models/index.ts b/clients/client-pinpoint/src/models/index.ts similarity index 100% rename from clients/client-pinpoint/models/index.ts rename to clients/client-pinpoint/src/models/index.ts diff --git a/clients/client-pinpoint/models/models_0.ts b/clients/client-pinpoint/src/models/models_0.ts similarity index 100% rename from clients/client-pinpoint/models/models_0.ts rename to clients/client-pinpoint/src/models/models_0.ts diff --git a/clients/client-pinpoint/models/models_1.ts b/clients/client-pinpoint/src/models/models_1.ts similarity index 100% rename from clients/client-pinpoint/models/models_1.ts rename to clients/client-pinpoint/src/models/models_1.ts diff --git a/clients/client-pinpoint/protocols/Aws_restJson1.ts b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-pinpoint/protocols/Aws_restJson1.ts rename to clients/client-pinpoint/src/protocols/Aws_restJson1.ts diff --git a/clients/client-pinpoint/src/runtimeConfig.browser.ts b/clients/client-pinpoint/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3d542a69893a --- /dev/null +++ b/clients/client-pinpoint/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PinpointClientConfig } from "./PinpointClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint/runtimeConfig.native.ts b/clients/client-pinpoint/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-pinpoint/runtimeConfig.native.ts rename to clients/client-pinpoint/src/runtimeConfig.native.ts diff --git a/clients/client-pinpoint/runtimeConfig.shared.ts b/clients/client-pinpoint/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-pinpoint/runtimeConfig.shared.ts rename to clients/client-pinpoint/src/runtimeConfig.shared.ts diff --git a/clients/client-pinpoint/src/runtimeConfig.ts b/clients/client-pinpoint/src/runtimeConfig.ts new file mode 100644 index 000000000000..0726e7c77b44 --- /dev/null +++ b/clients/client-pinpoint/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PinpointClientConfig } from "./PinpointClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PinpointClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pinpoint/tsconfig.es.json b/clients/client-pinpoint/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-pinpoint/tsconfig.es.json +++ b/clients/client-pinpoint/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-pinpoint/tsconfig.json b/clients/client-pinpoint/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-pinpoint/tsconfig.json +++ b/clients/client-pinpoint/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-pinpoint/tsconfig.types.json b/clients/client-pinpoint/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-pinpoint/tsconfig.types.json +++ b/clients/client-pinpoint/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-polly/.gitignore b/clients/client-polly/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-polly/.gitignore +++ b/clients/client-polly/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-polly/package.json b/clients/client-polly/package.json index 9424ee2b5757..c2eecec74aa0 100644 --- a/clients/client-polly/package.json +++ b/clients/client-polly/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-polly", "repository": { "type": "git", diff --git a/clients/client-polly/runtimeConfig.browser.ts b/clients/client-polly/runtimeConfig.browser.ts deleted file mode 100644 index bd085a27543e..000000000000 --- a/clients/client-polly/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PollyClientConfig } from "./PollyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PollyClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-polly/runtimeConfig.ts b/clients/client-polly/runtimeConfig.ts deleted file mode 100644 index 848ce53dfdc4..000000000000 --- a/clients/client-polly/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PollyClientConfig } from "./PollyClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PollyClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-polly/Polly.ts b/clients/client-polly/src/Polly.ts similarity index 100% rename from clients/client-polly/Polly.ts rename to clients/client-polly/src/Polly.ts diff --git a/clients/client-polly/PollyClient.ts b/clients/client-polly/src/PollyClient.ts similarity index 100% rename from clients/client-polly/PollyClient.ts rename to clients/client-polly/src/PollyClient.ts diff --git a/clients/client-polly/commands/DeleteLexiconCommand.ts b/clients/client-polly/src/commands/DeleteLexiconCommand.ts similarity index 100% rename from clients/client-polly/commands/DeleteLexiconCommand.ts rename to clients/client-polly/src/commands/DeleteLexiconCommand.ts diff --git a/clients/client-polly/commands/DescribeVoicesCommand.ts b/clients/client-polly/src/commands/DescribeVoicesCommand.ts similarity index 100% rename from clients/client-polly/commands/DescribeVoicesCommand.ts rename to clients/client-polly/src/commands/DescribeVoicesCommand.ts diff --git a/clients/client-polly/commands/GetLexiconCommand.ts b/clients/client-polly/src/commands/GetLexiconCommand.ts similarity index 100% rename from clients/client-polly/commands/GetLexiconCommand.ts rename to clients/client-polly/src/commands/GetLexiconCommand.ts diff --git a/clients/client-polly/commands/GetSpeechSynthesisTaskCommand.ts b/clients/client-polly/src/commands/GetSpeechSynthesisTaskCommand.ts similarity index 100% rename from clients/client-polly/commands/GetSpeechSynthesisTaskCommand.ts rename to clients/client-polly/src/commands/GetSpeechSynthesisTaskCommand.ts diff --git a/clients/client-polly/commands/ListLexiconsCommand.ts b/clients/client-polly/src/commands/ListLexiconsCommand.ts similarity index 100% rename from clients/client-polly/commands/ListLexiconsCommand.ts rename to clients/client-polly/src/commands/ListLexiconsCommand.ts diff --git a/clients/client-polly/commands/ListSpeechSynthesisTasksCommand.ts b/clients/client-polly/src/commands/ListSpeechSynthesisTasksCommand.ts similarity index 100% rename from clients/client-polly/commands/ListSpeechSynthesisTasksCommand.ts rename to clients/client-polly/src/commands/ListSpeechSynthesisTasksCommand.ts diff --git a/clients/client-polly/commands/PutLexiconCommand.ts b/clients/client-polly/src/commands/PutLexiconCommand.ts similarity index 100% rename from clients/client-polly/commands/PutLexiconCommand.ts rename to clients/client-polly/src/commands/PutLexiconCommand.ts diff --git a/clients/client-polly/commands/StartSpeechSynthesisTaskCommand.ts b/clients/client-polly/src/commands/StartSpeechSynthesisTaskCommand.ts similarity index 100% rename from clients/client-polly/commands/StartSpeechSynthesisTaskCommand.ts rename to clients/client-polly/src/commands/StartSpeechSynthesisTaskCommand.ts diff --git a/clients/client-polly/commands/SynthesizeSpeechCommand.ts b/clients/client-polly/src/commands/SynthesizeSpeechCommand.ts similarity index 100% rename from clients/client-polly/commands/SynthesizeSpeechCommand.ts rename to clients/client-polly/src/commands/SynthesizeSpeechCommand.ts diff --git a/clients/client-polly/endpoints.ts b/clients/client-polly/src/endpoints.ts similarity index 100% rename from clients/client-polly/endpoints.ts rename to clients/client-polly/src/endpoints.ts diff --git a/clients/client-polly/index.ts b/clients/client-polly/src/index.ts similarity index 100% rename from clients/client-polly/index.ts rename to clients/client-polly/src/index.ts diff --git a/clients/client-polly/models/index.ts b/clients/client-polly/src/models/index.ts similarity index 100% rename from clients/client-polly/models/index.ts rename to clients/client-polly/src/models/index.ts diff --git a/clients/client-polly/models/models_0.ts b/clients/client-polly/src/models/models_0.ts similarity index 100% rename from clients/client-polly/models/models_0.ts rename to clients/client-polly/src/models/models_0.ts diff --git a/clients/client-polly/pagination/Interfaces.ts b/clients/client-polly/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-polly/pagination/Interfaces.ts rename to clients/client-polly/src/pagination/Interfaces.ts diff --git a/clients/client-polly/pagination/ListSpeechSynthesisTasksPaginator.ts b/clients/client-polly/src/pagination/ListSpeechSynthesisTasksPaginator.ts similarity index 100% rename from clients/client-polly/pagination/ListSpeechSynthesisTasksPaginator.ts rename to clients/client-polly/src/pagination/ListSpeechSynthesisTasksPaginator.ts diff --git a/clients/client-polly/protocols/Aws_restJson1.ts b/clients/client-polly/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-polly/protocols/Aws_restJson1.ts rename to clients/client-polly/src/protocols/Aws_restJson1.ts diff --git a/clients/client-polly/src/runtimeConfig.browser.ts b/clients/client-polly/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..ffbd91f47f06 --- /dev/null +++ b/clients/client-polly/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PollyClientConfig } from "./PollyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PollyClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-polly/runtimeConfig.native.ts b/clients/client-polly/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-polly/runtimeConfig.native.ts rename to clients/client-polly/src/runtimeConfig.native.ts diff --git a/clients/client-polly/runtimeConfig.shared.ts b/clients/client-polly/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-polly/runtimeConfig.shared.ts rename to clients/client-polly/src/runtimeConfig.shared.ts diff --git a/clients/client-polly/src/runtimeConfig.ts b/clients/client-polly/src/runtimeConfig.ts new file mode 100644 index 000000000000..b8480938e5b5 --- /dev/null +++ b/clients/client-polly/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PollyClientConfig } from "./PollyClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PollyClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-polly/tsconfig.es.json b/clients/client-polly/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-polly/tsconfig.es.json +++ b/clients/client-polly/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-polly/tsconfig.json b/clients/client-polly/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-polly/tsconfig.json +++ b/clients/client-polly/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-polly/tsconfig.types.json b/clients/client-polly/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-polly/tsconfig.types.json +++ b/clients/client-polly/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-pricing/.gitignore b/clients/client-pricing/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-pricing/.gitignore +++ b/clients/client-pricing/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-pricing/package.json b/clients/client-pricing/package.json index 5d9ff064e961..b98ed7693517 100644 --- a/clients/client-pricing/package.json +++ b/clients/client-pricing/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pricing", "repository": { "type": "git", diff --git a/clients/client-pricing/runtimeConfig.browser.ts b/clients/client-pricing/runtimeConfig.browser.ts deleted file mode 100644 index 1e198822c6e2..000000000000 --- a/clients/client-pricing/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { PricingClientConfig } from "./PricingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PricingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pricing/runtimeConfig.ts b/clients/client-pricing/runtimeConfig.ts deleted file mode 100644 index 58fb87d43b3c..000000000000 --- a/clients/client-pricing/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { PricingClientConfig } from "./PricingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: PricingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-pricing/Pricing.ts b/clients/client-pricing/src/Pricing.ts similarity index 100% rename from clients/client-pricing/Pricing.ts rename to clients/client-pricing/src/Pricing.ts diff --git a/clients/client-pricing/PricingClient.ts b/clients/client-pricing/src/PricingClient.ts similarity index 100% rename from clients/client-pricing/PricingClient.ts rename to clients/client-pricing/src/PricingClient.ts diff --git a/clients/client-pricing/commands/DescribeServicesCommand.ts b/clients/client-pricing/src/commands/DescribeServicesCommand.ts similarity index 100% rename from clients/client-pricing/commands/DescribeServicesCommand.ts rename to clients/client-pricing/src/commands/DescribeServicesCommand.ts diff --git a/clients/client-pricing/commands/GetAttributeValuesCommand.ts b/clients/client-pricing/src/commands/GetAttributeValuesCommand.ts similarity index 100% rename from clients/client-pricing/commands/GetAttributeValuesCommand.ts rename to clients/client-pricing/src/commands/GetAttributeValuesCommand.ts diff --git a/clients/client-pricing/commands/GetProductsCommand.ts b/clients/client-pricing/src/commands/GetProductsCommand.ts similarity index 100% rename from clients/client-pricing/commands/GetProductsCommand.ts rename to clients/client-pricing/src/commands/GetProductsCommand.ts diff --git a/clients/client-pricing/endpoints.ts b/clients/client-pricing/src/endpoints.ts similarity index 100% rename from clients/client-pricing/endpoints.ts rename to clients/client-pricing/src/endpoints.ts diff --git a/clients/client-pricing/index.ts b/clients/client-pricing/src/index.ts similarity index 100% rename from clients/client-pricing/index.ts rename to clients/client-pricing/src/index.ts diff --git a/clients/client-pricing/models/index.ts b/clients/client-pricing/src/models/index.ts similarity index 100% rename from clients/client-pricing/models/index.ts rename to clients/client-pricing/src/models/index.ts diff --git a/clients/client-pricing/models/models_0.ts b/clients/client-pricing/src/models/models_0.ts similarity index 100% rename from clients/client-pricing/models/models_0.ts rename to clients/client-pricing/src/models/models_0.ts diff --git a/clients/client-pricing/pagination/DescribeServicesPaginator.ts b/clients/client-pricing/src/pagination/DescribeServicesPaginator.ts similarity index 100% rename from clients/client-pricing/pagination/DescribeServicesPaginator.ts rename to clients/client-pricing/src/pagination/DescribeServicesPaginator.ts diff --git a/clients/client-pricing/pagination/GetAttributeValuesPaginator.ts b/clients/client-pricing/src/pagination/GetAttributeValuesPaginator.ts similarity index 100% rename from clients/client-pricing/pagination/GetAttributeValuesPaginator.ts rename to clients/client-pricing/src/pagination/GetAttributeValuesPaginator.ts diff --git a/clients/client-pricing/pagination/GetProductsPaginator.ts b/clients/client-pricing/src/pagination/GetProductsPaginator.ts similarity index 100% rename from clients/client-pricing/pagination/GetProductsPaginator.ts rename to clients/client-pricing/src/pagination/GetProductsPaginator.ts diff --git a/clients/client-pricing/pagination/Interfaces.ts b/clients/client-pricing/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-pricing/pagination/Interfaces.ts rename to clients/client-pricing/src/pagination/Interfaces.ts diff --git a/clients/client-pricing/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-pricing/protocols/Aws_json1_1.ts rename to clients/client-pricing/src/protocols/Aws_json1_1.ts diff --git a/clients/client-pricing/src/runtimeConfig.browser.ts b/clients/client-pricing/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6659f133d5de --- /dev/null +++ b/clients/client-pricing/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { PricingClientConfig } from "./PricingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PricingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pricing/runtimeConfig.native.ts b/clients/client-pricing/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-pricing/runtimeConfig.native.ts rename to clients/client-pricing/src/runtimeConfig.native.ts diff --git a/clients/client-pricing/runtimeConfig.shared.ts b/clients/client-pricing/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-pricing/runtimeConfig.shared.ts rename to clients/client-pricing/src/runtimeConfig.shared.ts diff --git a/clients/client-pricing/src/runtimeConfig.ts b/clients/client-pricing/src/runtimeConfig.ts new file mode 100644 index 000000000000..4c4be1e2154b --- /dev/null +++ b/clients/client-pricing/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { PricingClientConfig } from "./PricingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: PricingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-pricing/tsconfig.es.json b/clients/client-pricing/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-pricing/tsconfig.es.json +++ b/clients/client-pricing/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-pricing/tsconfig.json b/clients/client-pricing/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-pricing/tsconfig.json +++ b/clients/client-pricing/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-pricing/tsconfig.types.json b/clients/client-pricing/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-pricing/tsconfig.types.json +++ b/clients/client-pricing/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-proton/.gitignore b/clients/client-proton/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-proton/.gitignore +++ b/clients/client-proton/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-proton/package.json b/clients/client-proton/package.json index 258e198be6bb..625f2fcba9e3 100644 --- a/clients/client-proton/package.json +++ b/clients/client-proton/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-proton", "repository": { "type": "git", diff --git a/clients/client-proton/runtimeConfig.browser.ts b/clients/client-proton/runtimeConfig.browser.ts deleted file mode 100644 index 3d7ba6a60533..000000000000 --- a/clients/client-proton/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ProtonClientConfig } from "./ProtonClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ProtonClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-proton/runtimeConfig.ts b/clients/client-proton/runtimeConfig.ts deleted file mode 100644 index f60017559deb..000000000000 --- a/clients/client-proton/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ProtonClientConfig } from "./ProtonClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ProtonClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-proton/Proton.ts b/clients/client-proton/src/Proton.ts similarity index 100% rename from clients/client-proton/Proton.ts rename to clients/client-proton/src/Proton.ts diff --git a/clients/client-proton/ProtonClient.ts b/clients/client-proton/src/ProtonClient.ts similarity index 100% rename from clients/client-proton/ProtonClient.ts rename to clients/client-proton/src/ProtonClient.ts diff --git a/clients/client-proton/commands/AcceptEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/AcceptEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/AcceptEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/AcceptEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/CancelEnvironmentDeploymentCommand.ts b/clients/client-proton/src/commands/CancelEnvironmentDeploymentCommand.ts similarity index 100% rename from clients/client-proton/commands/CancelEnvironmentDeploymentCommand.ts rename to clients/client-proton/src/commands/CancelEnvironmentDeploymentCommand.ts diff --git a/clients/client-proton/commands/CancelServiceInstanceDeploymentCommand.ts b/clients/client-proton/src/commands/CancelServiceInstanceDeploymentCommand.ts similarity index 100% rename from clients/client-proton/commands/CancelServiceInstanceDeploymentCommand.ts rename to clients/client-proton/src/commands/CancelServiceInstanceDeploymentCommand.ts diff --git a/clients/client-proton/commands/CancelServicePipelineDeploymentCommand.ts b/clients/client-proton/src/commands/CancelServicePipelineDeploymentCommand.ts similarity index 100% rename from clients/client-proton/commands/CancelServicePipelineDeploymentCommand.ts rename to clients/client-proton/src/commands/CancelServicePipelineDeploymentCommand.ts diff --git a/clients/client-proton/commands/CreateEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/CreateEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/CreateEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/CreateEnvironmentCommand.ts b/clients/client-proton/src/commands/CreateEnvironmentCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateEnvironmentCommand.ts rename to clients/client-proton/src/commands/CreateEnvironmentCommand.ts diff --git a/clients/client-proton/commands/CreateEnvironmentTemplateCommand.ts b/clients/client-proton/src/commands/CreateEnvironmentTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateEnvironmentTemplateCommand.ts rename to clients/client-proton/src/commands/CreateEnvironmentTemplateCommand.ts diff --git a/clients/client-proton/commands/CreateEnvironmentTemplateVersionCommand.ts b/clients/client-proton/src/commands/CreateEnvironmentTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateEnvironmentTemplateVersionCommand.ts rename to clients/client-proton/src/commands/CreateEnvironmentTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/CreateServiceCommand.ts b/clients/client-proton/src/commands/CreateServiceCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateServiceCommand.ts rename to clients/client-proton/src/commands/CreateServiceCommand.ts diff --git a/clients/client-proton/commands/CreateServiceTemplateCommand.ts b/clients/client-proton/src/commands/CreateServiceTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateServiceTemplateCommand.ts rename to clients/client-proton/src/commands/CreateServiceTemplateCommand.ts diff --git a/clients/client-proton/commands/CreateServiceTemplateVersionCommand.ts b/clients/client-proton/src/commands/CreateServiceTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/CreateServiceTemplateVersionCommand.ts rename to clients/client-proton/src/commands/CreateServiceTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/DeleteEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/DeleteEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/DeleteEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/DeleteEnvironmentCommand.ts b/clients/client-proton/src/commands/DeleteEnvironmentCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteEnvironmentCommand.ts rename to clients/client-proton/src/commands/DeleteEnvironmentCommand.ts diff --git a/clients/client-proton/commands/DeleteEnvironmentTemplateCommand.ts b/clients/client-proton/src/commands/DeleteEnvironmentTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteEnvironmentTemplateCommand.ts rename to clients/client-proton/src/commands/DeleteEnvironmentTemplateCommand.ts diff --git a/clients/client-proton/commands/DeleteEnvironmentTemplateVersionCommand.ts b/clients/client-proton/src/commands/DeleteEnvironmentTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteEnvironmentTemplateVersionCommand.ts rename to clients/client-proton/src/commands/DeleteEnvironmentTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/DeleteServiceCommand.ts b/clients/client-proton/src/commands/DeleteServiceCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteServiceCommand.ts rename to clients/client-proton/src/commands/DeleteServiceCommand.ts diff --git a/clients/client-proton/commands/DeleteServiceTemplateCommand.ts b/clients/client-proton/src/commands/DeleteServiceTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteServiceTemplateCommand.ts rename to clients/client-proton/src/commands/DeleteServiceTemplateCommand.ts diff --git a/clients/client-proton/commands/DeleteServiceTemplateVersionCommand.ts b/clients/client-proton/src/commands/DeleteServiceTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/DeleteServiceTemplateVersionCommand.ts rename to clients/client-proton/src/commands/DeleteServiceTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/GetAccountSettingsCommand.ts b/clients/client-proton/src/commands/GetAccountSettingsCommand.ts similarity index 100% rename from clients/client-proton/commands/GetAccountSettingsCommand.ts rename to clients/client-proton/src/commands/GetAccountSettingsCommand.ts diff --git a/clients/client-proton/commands/GetEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/GetEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/GetEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/GetEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/GetEnvironmentCommand.ts b/clients/client-proton/src/commands/GetEnvironmentCommand.ts similarity index 100% rename from clients/client-proton/commands/GetEnvironmentCommand.ts rename to clients/client-proton/src/commands/GetEnvironmentCommand.ts diff --git a/clients/client-proton/commands/GetEnvironmentTemplateCommand.ts b/clients/client-proton/src/commands/GetEnvironmentTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/GetEnvironmentTemplateCommand.ts rename to clients/client-proton/src/commands/GetEnvironmentTemplateCommand.ts diff --git a/clients/client-proton/commands/GetEnvironmentTemplateVersionCommand.ts b/clients/client-proton/src/commands/GetEnvironmentTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/GetEnvironmentTemplateVersionCommand.ts rename to clients/client-proton/src/commands/GetEnvironmentTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/GetServiceCommand.ts b/clients/client-proton/src/commands/GetServiceCommand.ts similarity index 100% rename from clients/client-proton/commands/GetServiceCommand.ts rename to clients/client-proton/src/commands/GetServiceCommand.ts diff --git a/clients/client-proton/commands/GetServiceInstanceCommand.ts b/clients/client-proton/src/commands/GetServiceInstanceCommand.ts similarity index 100% rename from clients/client-proton/commands/GetServiceInstanceCommand.ts rename to clients/client-proton/src/commands/GetServiceInstanceCommand.ts diff --git a/clients/client-proton/commands/GetServiceTemplateCommand.ts b/clients/client-proton/src/commands/GetServiceTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/GetServiceTemplateCommand.ts rename to clients/client-proton/src/commands/GetServiceTemplateCommand.ts diff --git a/clients/client-proton/commands/GetServiceTemplateVersionCommand.ts b/clients/client-proton/src/commands/GetServiceTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/GetServiceTemplateVersionCommand.ts rename to clients/client-proton/src/commands/GetServiceTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/ListEnvironmentAccountConnectionsCommand.ts b/clients/client-proton/src/commands/ListEnvironmentAccountConnectionsCommand.ts similarity index 100% rename from clients/client-proton/commands/ListEnvironmentAccountConnectionsCommand.ts rename to clients/client-proton/src/commands/ListEnvironmentAccountConnectionsCommand.ts diff --git a/clients/client-proton/commands/ListEnvironmentTemplateVersionsCommand.ts b/clients/client-proton/src/commands/ListEnvironmentTemplateVersionsCommand.ts similarity index 100% rename from clients/client-proton/commands/ListEnvironmentTemplateVersionsCommand.ts rename to clients/client-proton/src/commands/ListEnvironmentTemplateVersionsCommand.ts diff --git a/clients/client-proton/commands/ListEnvironmentTemplatesCommand.ts b/clients/client-proton/src/commands/ListEnvironmentTemplatesCommand.ts similarity index 100% rename from clients/client-proton/commands/ListEnvironmentTemplatesCommand.ts rename to clients/client-proton/src/commands/ListEnvironmentTemplatesCommand.ts diff --git a/clients/client-proton/commands/ListEnvironmentsCommand.ts b/clients/client-proton/src/commands/ListEnvironmentsCommand.ts similarity index 100% rename from clients/client-proton/commands/ListEnvironmentsCommand.ts rename to clients/client-proton/src/commands/ListEnvironmentsCommand.ts diff --git a/clients/client-proton/commands/ListServiceInstancesCommand.ts b/clients/client-proton/src/commands/ListServiceInstancesCommand.ts similarity index 100% rename from clients/client-proton/commands/ListServiceInstancesCommand.ts rename to clients/client-proton/src/commands/ListServiceInstancesCommand.ts diff --git a/clients/client-proton/commands/ListServiceTemplateVersionsCommand.ts b/clients/client-proton/src/commands/ListServiceTemplateVersionsCommand.ts similarity index 100% rename from clients/client-proton/commands/ListServiceTemplateVersionsCommand.ts rename to clients/client-proton/src/commands/ListServiceTemplateVersionsCommand.ts diff --git a/clients/client-proton/commands/ListServiceTemplatesCommand.ts b/clients/client-proton/src/commands/ListServiceTemplatesCommand.ts similarity index 100% rename from clients/client-proton/commands/ListServiceTemplatesCommand.ts rename to clients/client-proton/src/commands/ListServiceTemplatesCommand.ts diff --git a/clients/client-proton/commands/ListServicesCommand.ts b/clients/client-proton/src/commands/ListServicesCommand.ts similarity index 100% rename from clients/client-proton/commands/ListServicesCommand.ts rename to clients/client-proton/src/commands/ListServicesCommand.ts diff --git a/clients/client-proton/commands/ListTagsForResourceCommand.ts b/clients/client-proton/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-proton/commands/ListTagsForResourceCommand.ts rename to clients/client-proton/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-proton/commands/RejectEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/RejectEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/RejectEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/RejectEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/TagResourceCommand.ts b/clients/client-proton/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-proton/commands/TagResourceCommand.ts rename to clients/client-proton/src/commands/TagResourceCommand.ts diff --git a/clients/client-proton/commands/UntagResourceCommand.ts b/clients/client-proton/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-proton/commands/UntagResourceCommand.ts rename to clients/client-proton/src/commands/UntagResourceCommand.ts diff --git a/clients/client-proton/commands/UpdateAccountSettingsCommand.ts b/clients/client-proton/src/commands/UpdateAccountSettingsCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateAccountSettingsCommand.ts rename to clients/client-proton/src/commands/UpdateAccountSettingsCommand.ts diff --git a/clients/client-proton/commands/UpdateEnvironmentAccountConnectionCommand.ts b/clients/client-proton/src/commands/UpdateEnvironmentAccountConnectionCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateEnvironmentAccountConnectionCommand.ts rename to clients/client-proton/src/commands/UpdateEnvironmentAccountConnectionCommand.ts diff --git a/clients/client-proton/commands/UpdateEnvironmentCommand.ts b/clients/client-proton/src/commands/UpdateEnvironmentCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateEnvironmentCommand.ts rename to clients/client-proton/src/commands/UpdateEnvironmentCommand.ts diff --git a/clients/client-proton/commands/UpdateEnvironmentTemplateCommand.ts b/clients/client-proton/src/commands/UpdateEnvironmentTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateEnvironmentTemplateCommand.ts rename to clients/client-proton/src/commands/UpdateEnvironmentTemplateCommand.ts diff --git a/clients/client-proton/commands/UpdateEnvironmentTemplateVersionCommand.ts b/clients/client-proton/src/commands/UpdateEnvironmentTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateEnvironmentTemplateVersionCommand.ts rename to clients/client-proton/src/commands/UpdateEnvironmentTemplateVersionCommand.ts diff --git a/clients/client-proton/commands/UpdateServiceCommand.ts b/clients/client-proton/src/commands/UpdateServiceCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateServiceCommand.ts rename to clients/client-proton/src/commands/UpdateServiceCommand.ts diff --git a/clients/client-proton/commands/UpdateServiceInstanceCommand.ts b/clients/client-proton/src/commands/UpdateServiceInstanceCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateServiceInstanceCommand.ts rename to clients/client-proton/src/commands/UpdateServiceInstanceCommand.ts diff --git a/clients/client-proton/commands/UpdateServicePipelineCommand.ts b/clients/client-proton/src/commands/UpdateServicePipelineCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateServicePipelineCommand.ts rename to clients/client-proton/src/commands/UpdateServicePipelineCommand.ts diff --git a/clients/client-proton/commands/UpdateServiceTemplateCommand.ts b/clients/client-proton/src/commands/UpdateServiceTemplateCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateServiceTemplateCommand.ts rename to clients/client-proton/src/commands/UpdateServiceTemplateCommand.ts diff --git a/clients/client-proton/commands/UpdateServiceTemplateVersionCommand.ts b/clients/client-proton/src/commands/UpdateServiceTemplateVersionCommand.ts similarity index 100% rename from clients/client-proton/commands/UpdateServiceTemplateVersionCommand.ts rename to clients/client-proton/src/commands/UpdateServiceTemplateVersionCommand.ts diff --git a/clients/client-proton/endpoints.ts b/clients/client-proton/src/endpoints.ts similarity index 100% rename from clients/client-proton/endpoints.ts rename to clients/client-proton/src/endpoints.ts diff --git a/clients/client-proton/index.ts b/clients/client-proton/src/index.ts similarity index 100% rename from clients/client-proton/index.ts rename to clients/client-proton/src/index.ts diff --git a/clients/client-proton/models/index.ts b/clients/client-proton/src/models/index.ts similarity index 100% rename from clients/client-proton/models/index.ts rename to clients/client-proton/src/models/index.ts diff --git a/clients/client-proton/models/models_0.ts b/clients/client-proton/src/models/models_0.ts similarity index 100% rename from clients/client-proton/models/models_0.ts rename to clients/client-proton/src/models/models_0.ts diff --git a/clients/client-proton/pagination/Interfaces.ts b/clients/client-proton/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-proton/pagination/Interfaces.ts rename to clients/client-proton/src/pagination/Interfaces.ts diff --git a/clients/client-proton/pagination/ListEnvironmentAccountConnectionsPaginator.ts b/clients/client-proton/src/pagination/ListEnvironmentAccountConnectionsPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListEnvironmentAccountConnectionsPaginator.ts rename to clients/client-proton/src/pagination/ListEnvironmentAccountConnectionsPaginator.ts diff --git a/clients/client-proton/pagination/ListEnvironmentTemplateVersionsPaginator.ts b/clients/client-proton/src/pagination/ListEnvironmentTemplateVersionsPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListEnvironmentTemplateVersionsPaginator.ts rename to clients/client-proton/src/pagination/ListEnvironmentTemplateVersionsPaginator.ts diff --git a/clients/client-proton/pagination/ListEnvironmentTemplatesPaginator.ts b/clients/client-proton/src/pagination/ListEnvironmentTemplatesPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListEnvironmentTemplatesPaginator.ts rename to clients/client-proton/src/pagination/ListEnvironmentTemplatesPaginator.ts diff --git a/clients/client-proton/pagination/ListEnvironmentsPaginator.ts b/clients/client-proton/src/pagination/ListEnvironmentsPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListEnvironmentsPaginator.ts rename to clients/client-proton/src/pagination/ListEnvironmentsPaginator.ts diff --git a/clients/client-proton/pagination/ListServiceInstancesPaginator.ts b/clients/client-proton/src/pagination/ListServiceInstancesPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListServiceInstancesPaginator.ts rename to clients/client-proton/src/pagination/ListServiceInstancesPaginator.ts diff --git a/clients/client-proton/pagination/ListServiceTemplateVersionsPaginator.ts b/clients/client-proton/src/pagination/ListServiceTemplateVersionsPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListServiceTemplateVersionsPaginator.ts rename to clients/client-proton/src/pagination/ListServiceTemplateVersionsPaginator.ts diff --git a/clients/client-proton/pagination/ListServiceTemplatesPaginator.ts b/clients/client-proton/src/pagination/ListServiceTemplatesPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListServiceTemplatesPaginator.ts rename to clients/client-proton/src/pagination/ListServiceTemplatesPaginator.ts diff --git a/clients/client-proton/pagination/ListServicesPaginator.ts b/clients/client-proton/src/pagination/ListServicesPaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListServicesPaginator.ts rename to clients/client-proton/src/pagination/ListServicesPaginator.ts diff --git a/clients/client-proton/pagination/ListTagsForResourcePaginator.ts b/clients/client-proton/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-proton/pagination/ListTagsForResourcePaginator.ts rename to clients/client-proton/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-proton/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-proton/protocols/Aws_json1_0.ts rename to clients/client-proton/src/protocols/Aws_json1_0.ts diff --git a/clients/client-proton/src/runtimeConfig.browser.ts b/clients/client-proton/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b30602be04cc --- /dev/null +++ b/clients/client-proton/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ProtonClientConfig } from "./ProtonClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ProtonClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-proton/runtimeConfig.native.ts b/clients/client-proton/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-proton/runtimeConfig.native.ts rename to clients/client-proton/src/runtimeConfig.native.ts diff --git a/clients/client-proton/runtimeConfig.shared.ts b/clients/client-proton/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-proton/runtimeConfig.shared.ts rename to clients/client-proton/src/runtimeConfig.shared.ts diff --git a/clients/client-proton/src/runtimeConfig.ts b/clients/client-proton/src/runtimeConfig.ts new file mode 100644 index 000000000000..083a5fda6f6f --- /dev/null +++ b/clients/client-proton/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ProtonClientConfig } from "./ProtonClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ProtonClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-proton/waiters/waitForEnvironmentDeployed.ts b/clients/client-proton/src/waiters/waitForEnvironmentDeployed.ts similarity index 100% rename from clients/client-proton/waiters/waitForEnvironmentDeployed.ts rename to clients/client-proton/src/waiters/waitForEnvironmentDeployed.ts diff --git a/clients/client-proton/waiters/waitForEnvironmentTemplateVersionRegistered.ts b/clients/client-proton/src/waiters/waitForEnvironmentTemplateVersionRegistered.ts similarity index 100% rename from clients/client-proton/waiters/waitForEnvironmentTemplateVersionRegistered.ts rename to clients/client-proton/src/waiters/waitForEnvironmentTemplateVersionRegistered.ts diff --git a/clients/client-proton/waiters/waitForServiceCreated.ts b/clients/client-proton/src/waiters/waitForServiceCreated.ts similarity index 100% rename from clients/client-proton/waiters/waitForServiceCreated.ts rename to clients/client-proton/src/waiters/waitForServiceCreated.ts diff --git a/clients/client-proton/waiters/waitForServiceDeleted.ts b/clients/client-proton/src/waiters/waitForServiceDeleted.ts similarity index 100% rename from clients/client-proton/waiters/waitForServiceDeleted.ts rename to clients/client-proton/src/waiters/waitForServiceDeleted.ts diff --git a/clients/client-proton/waiters/waitForServiceInstanceDeployed.ts b/clients/client-proton/src/waiters/waitForServiceInstanceDeployed.ts similarity index 100% rename from clients/client-proton/waiters/waitForServiceInstanceDeployed.ts rename to clients/client-proton/src/waiters/waitForServiceInstanceDeployed.ts diff --git a/clients/client-proton/waiters/waitForServicePipelineDeployed.ts b/clients/client-proton/src/waiters/waitForServicePipelineDeployed.ts similarity index 100% rename from clients/client-proton/waiters/waitForServicePipelineDeployed.ts rename to clients/client-proton/src/waiters/waitForServicePipelineDeployed.ts diff --git a/clients/client-proton/waiters/waitForServiceTemplateVersionRegistered.ts b/clients/client-proton/src/waiters/waitForServiceTemplateVersionRegistered.ts similarity index 100% rename from clients/client-proton/waiters/waitForServiceTemplateVersionRegistered.ts rename to clients/client-proton/src/waiters/waitForServiceTemplateVersionRegistered.ts diff --git a/clients/client-proton/waiters/waitForServiceUpdated.ts b/clients/client-proton/src/waiters/waitForServiceUpdated.ts similarity index 100% rename from clients/client-proton/waiters/waitForServiceUpdated.ts rename to clients/client-proton/src/waiters/waitForServiceUpdated.ts diff --git a/clients/client-proton/tsconfig.es.json b/clients/client-proton/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-proton/tsconfig.es.json +++ b/clients/client-proton/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-proton/tsconfig.json b/clients/client-proton/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-proton/tsconfig.json +++ b/clients/client-proton/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-proton/tsconfig.types.json b/clients/client-proton/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-proton/tsconfig.types.json +++ b/clients/client-proton/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-qldb-session/.gitignore b/clients/client-qldb-session/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-qldb-session/.gitignore +++ b/clients/client-qldb-session/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-qldb-session/package.json b/clients/client-qldb-session/package.json index 9b8b119d6152..0375ed170eae 100644 --- a/clients/client-qldb-session/package.json +++ b/clients/client-qldb-session/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-qldb-session", "repository": { "type": "git", diff --git a/clients/client-qldb-session/runtimeConfig.browser.ts b/clients/client-qldb-session/runtimeConfig.browser.ts deleted file mode 100644 index 1397bea6890c..000000000000 --- a/clients/client-qldb-session/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { QLDBSessionClientConfig } from "./QLDBSessionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-qldb-session/runtimeConfig.ts b/clients/client-qldb-session/runtimeConfig.ts deleted file mode 100644 index 7afa2fa5381e..000000000000 --- a/clients/client-qldb-session/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { QLDBSessionClientConfig } from "./QLDBSessionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-qldb-session/QLDBSession.ts b/clients/client-qldb-session/src/QLDBSession.ts similarity index 100% rename from clients/client-qldb-session/QLDBSession.ts rename to clients/client-qldb-session/src/QLDBSession.ts diff --git a/clients/client-qldb-session/QLDBSessionClient.ts b/clients/client-qldb-session/src/QLDBSessionClient.ts similarity index 100% rename from clients/client-qldb-session/QLDBSessionClient.ts rename to clients/client-qldb-session/src/QLDBSessionClient.ts diff --git a/clients/client-qldb-session/commands/SendCommandCommand.ts b/clients/client-qldb-session/src/commands/SendCommandCommand.ts similarity index 100% rename from clients/client-qldb-session/commands/SendCommandCommand.ts rename to clients/client-qldb-session/src/commands/SendCommandCommand.ts diff --git a/clients/client-qldb-session/endpoints.ts b/clients/client-qldb-session/src/endpoints.ts similarity index 100% rename from clients/client-qldb-session/endpoints.ts rename to clients/client-qldb-session/src/endpoints.ts diff --git a/clients/client-qldb-session/index.ts b/clients/client-qldb-session/src/index.ts similarity index 100% rename from clients/client-qldb-session/index.ts rename to clients/client-qldb-session/src/index.ts diff --git a/clients/client-qldb-session/models/index.ts b/clients/client-qldb-session/src/models/index.ts similarity index 100% rename from clients/client-qldb-session/models/index.ts rename to clients/client-qldb-session/src/models/index.ts diff --git a/clients/client-qldb-session/models/models_0.ts b/clients/client-qldb-session/src/models/models_0.ts similarity index 100% rename from clients/client-qldb-session/models/models_0.ts rename to clients/client-qldb-session/src/models/models_0.ts diff --git a/clients/client-qldb-session/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-qldb-session/protocols/Aws_json1_0.ts rename to clients/client-qldb-session/src/protocols/Aws_json1_0.ts diff --git a/clients/client-qldb-session/src/runtimeConfig.browser.ts b/clients/client-qldb-session/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2cb30b6fed7e --- /dev/null +++ b/clients/client-qldb-session/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { QLDBSessionClientConfig } from "./QLDBSessionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-qldb-session/runtimeConfig.native.ts b/clients/client-qldb-session/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-qldb-session/runtimeConfig.native.ts rename to clients/client-qldb-session/src/runtimeConfig.native.ts diff --git a/clients/client-qldb-session/runtimeConfig.shared.ts b/clients/client-qldb-session/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-qldb-session/runtimeConfig.shared.ts rename to clients/client-qldb-session/src/runtimeConfig.shared.ts diff --git a/clients/client-qldb-session/src/runtimeConfig.ts b/clients/client-qldb-session/src/runtimeConfig.ts new file mode 100644 index 000000000000..b9149fba6ccd --- /dev/null +++ b/clients/client-qldb-session/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { QLDBSessionClientConfig } from "./QLDBSessionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-qldb-session/tsconfig.es.json b/clients/client-qldb-session/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-qldb-session/tsconfig.es.json +++ b/clients/client-qldb-session/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-qldb-session/tsconfig.json b/clients/client-qldb-session/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-qldb-session/tsconfig.json +++ b/clients/client-qldb-session/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-qldb-session/tsconfig.types.json b/clients/client-qldb-session/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-qldb-session/tsconfig.types.json +++ b/clients/client-qldb-session/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-qldb/.gitignore b/clients/client-qldb/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-qldb/.gitignore +++ b/clients/client-qldb/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-qldb/package.json b/clients/client-qldb/package.json index e42f9237593c..8eb99146d5aa 100644 --- a/clients/client-qldb/package.json +++ b/clients/client-qldb/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-qldb", "repository": { "type": "git", diff --git a/clients/client-qldb/runtimeConfig.browser.ts b/clients/client-qldb/runtimeConfig.browser.ts deleted file mode 100644 index 93c29e6ee08a..000000000000 --- a/clients/client-qldb/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { QLDBClientConfig } from "./QLDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QLDBClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-qldb/runtimeConfig.ts b/clients/client-qldb/runtimeConfig.ts deleted file mode 100644 index 79c56e0ccf81..000000000000 --- a/clients/client-qldb/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { QLDBClientConfig } from "./QLDBClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QLDBClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-qldb/QLDB.ts b/clients/client-qldb/src/QLDB.ts similarity index 100% rename from clients/client-qldb/QLDB.ts rename to clients/client-qldb/src/QLDB.ts diff --git a/clients/client-qldb/QLDBClient.ts b/clients/client-qldb/src/QLDBClient.ts similarity index 100% rename from clients/client-qldb/QLDBClient.ts rename to clients/client-qldb/src/QLDBClient.ts diff --git a/clients/client-qldb/commands/CancelJournalKinesisStreamCommand.ts b/clients/client-qldb/src/commands/CancelJournalKinesisStreamCommand.ts similarity index 100% rename from clients/client-qldb/commands/CancelJournalKinesisStreamCommand.ts rename to clients/client-qldb/src/commands/CancelJournalKinesisStreamCommand.ts diff --git a/clients/client-qldb/commands/CreateLedgerCommand.ts b/clients/client-qldb/src/commands/CreateLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/CreateLedgerCommand.ts rename to clients/client-qldb/src/commands/CreateLedgerCommand.ts diff --git a/clients/client-qldb/commands/DeleteLedgerCommand.ts b/clients/client-qldb/src/commands/DeleteLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/DeleteLedgerCommand.ts rename to clients/client-qldb/src/commands/DeleteLedgerCommand.ts diff --git a/clients/client-qldb/commands/DescribeJournalKinesisStreamCommand.ts b/clients/client-qldb/src/commands/DescribeJournalKinesisStreamCommand.ts similarity index 100% rename from clients/client-qldb/commands/DescribeJournalKinesisStreamCommand.ts rename to clients/client-qldb/src/commands/DescribeJournalKinesisStreamCommand.ts diff --git a/clients/client-qldb/commands/DescribeJournalS3ExportCommand.ts b/clients/client-qldb/src/commands/DescribeJournalS3ExportCommand.ts similarity index 100% rename from clients/client-qldb/commands/DescribeJournalS3ExportCommand.ts rename to clients/client-qldb/src/commands/DescribeJournalS3ExportCommand.ts diff --git a/clients/client-qldb/commands/DescribeLedgerCommand.ts b/clients/client-qldb/src/commands/DescribeLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/DescribeLedgerCommand.ts rename to clients/client-qldb/src/commands/DescribeLedgerCommand.ts diff --git a/clients/client-qldb/commands/ExportJournalToS3Command.ts b/clients/client-qldb/src/commands/ExportJournalToS3Command.ts similarity index 100% rename from clients/client-qldb/commands/ExportJournalToS3Command.ts rename to clients/client-qldb/src/commands/ExportJournalToS3Command.ts diff --git a/clients/client-qldb/commands/GetBlockCommand.ts b/clients/client-qldb/src/commands/GetBlockCommand.ts similarity index 100% rename from clients/client-qldb/commands/GetBlockCommand.ts rename to clients/client-qldb/src/commands/GetBlockCommand.ts diff --git a/clients/client-qldb/commands/GetDigestCommand.ts b/clients/client-qldb/src/commands/GetDigestCommand.ts similarity index 100% rename from clients/client-qldb/commands/GetDigestCommand.ts rename to clients/client-qldb/src/commands/GetDigestCommand.ts diff --git a/clients/client-qldb/commands/GetRevisionCommand.ts b/clients/client-qldb/src/commands/GetRevisionCommand.ts similarity index 100% rename from clients/client-qldb/commands/GetRevisionCommand.ts rename to clients/client-qldb/src/commands/GetRevisionCommand.ts diff --git a/clients/client-qldb/commands/ListJournalKinesisStreamsForLedgerCommand.ts b/clients/client-qldb/src/commands/ListJournalKinesisStreamsForLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/ListJournalKinesisStreamsForLedgerCommand.ts rename to clients/client-qldb/src/commands/ListJournalKinesisStreamsForLedgerCommand.ts diff --git a/clients/client-qldb/commands/ListJournalS3ExportsCommand.ts b/clients/client-qldb/src/commands/ListJournalS3ExportsCommand.ts similarity index 100% rename from clients/client-qldb/commands/ListJournalS3ExportsCommand.ts rename to clients/client-qldb/src/commands/ListJournalS3ExportsCommand.ts diff --git a/clients/client-qldb/commands/ListJournalS3ExportsForLedgerCommand.ts b/clients/client-qldb/src/commands/ListJournalS3ExportsForLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/ListJournalS3ExportsForLedgerCommand.ts rename to clients/client-qldb/src/commands/ListJournalS3ExportsForLedgerCommand.ts diff --git a/clients/client-qldb/commands/ListLedgersCommand.ts b/clients/client-qldb/src/commands/ListLedgersCommand.ts similarity index 100% rename from clients/client-qldb/commands/ListLedgersCommand.ts rename to clients/client-qldb/src/commands/ListLedgersCommand.ts diff --git a/clients/client-qldb/commands/ListTagsForResourceCommand.ts b/clients/client-qldb/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-qldb/commands/ListTagsForResourceCommand.ts rename to clients/client-qldb/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-qldb/commands/StreamJournalToKinesisCommand.ts b/clients/client-qldb/src/commands/StreamJournalToKinesisCommand.ts similarity index 100% rename from clients/client-qldb/commands/StreamJournalToKinesisCommand.ts rename to clients/client-qldb/src/commands/StreamJournalToKinesisCommand.ts diff --git a/clients/client-qldb/commands/TagResourceCommand.ts b/clients/client-qldb/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-qldb/commands/TagResourceCommand.ts rename to clients/client-qldb/src/commands/TagResourceCommand.ts diff --git a/clients/client-qldb/commands/UntagResourceCommand.ts b/clients/client-qldb/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-qldb/commands/UntagResourceCommand.ts rename to clients/client-qldb/src/commands/UntagResourceCommand.ts diff --git a/clients/client-qldb/commands/UpdateLedgerCommand.ts b/clients/client-qldb/src/commands/UpdateLedgerCommand.ts similarity index 100% rename from clients/client-qldb/commands/UpdateLedgerCommand.ts rename to clients/client-qldb/src/commands/UpdateLedgerCommand.ts diff --git a/clients/client-qldb/commands/UpdateLedgerPermissionsModeCommand.ts b/clients/client-qldb/src/commands/UpdateLedgerPermissionsModeCommand.ts similarity index 100% rename from clients/client-qldb/commands/UpdateLedgerPermissionsModeCommand.ts rename to clients/client-qldb/src/commands/UpdateLedgerPermissionsModeCommand.ts diff --git a/clients/client-qldb/endpoints.ts b/clients/client-qldb/src/endpoints.ts similarity index 100% rename from clients/client-qldb/endpoints.ts rename to clients/client-qldb/src/endpoints.ts diff --git a/clients/client-qldb/index.ts b/clients/client-qldb/src/index.ts similarity index 100% rename from clients/client-qldb/index.ts rename to clients/client-qldb/src/index.ts diff --git a/clients/client-qldb/models/index.ts b/clients/client-qldb/src/models/index.ts similarity index 100% rename from clients/client-qldb/models/index.ts rename to clients/client-qldb/src/models/index.ts diff --git a/clients/client-qldb/models/models_0.ts b/clients/client-qldb/src/models/models_0.ts similarity index 100% rename from clients/client-qldb/models/models_0.ts rename to clients/client-qldb/src/models/models_0.ts diff --git a/clients/client-qldb/pagination/Interfaces.ts b/clients/client-qldb/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-qldb/pagination/Interfaces.ts rename to clients/client-qldb/src/pagination/Interfaces.ts diff --git a/clients/client-qldb/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts b/clients/client-qldb/src/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts similarity index 100% rename from clients/client-qldb/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts rename to clients/client-qldb/src/pagination/ListJournalKinesisStreamsForLedgerPaginator.ts diff --git a/clients/client-qldb/pagination/ListJournalS3ExportsForLedgerPaginator.ts b/clients/client-qldb/src/pagination/ListJournalS3ExportsForLedgerPaginator.ts similarity index 100% rename from clients/client-qldb/pagination/ListJournalS3ExportsForLedgerPaginator.ts rename to clients/client-qldb/src/pagination/ListJournalS3ExportsForLedgerPaginator.ts diff --git a/clients/client-qldb/pagination/ListJournalS3ExportsPaginator.ts b/clients/client-qldb/src/pagination/ListJournalS3ExportsPaginator.ts similarity index 100% rename from clients/client-qldb/pagination/ListJournalS3ExportsPaginator.ts rename to clients/client-qldb/src/pagination/ListJournalS3ExportsPaginator.ts diff --git a/clients/client-qldb/pagination/ListLedgersPaginator.ts b/clients/client-qldb/src/pagination/ListLedgersPaginator.ts similarity index 100% rename from clients/client-qldb/pagination/ListLedgersPaginator.ts rename to clients/client-qldb/src/pagination/ListLedgersPaginator.ts diff --git a/clients/client-qldb/protocols/Aws_restJson1.ts b/clients/client-qldb/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-qldb/protocols/Aws_restJson1.ts rename to clients/client-qldb/src/protocols/Aws_restJson1.ts diff --git a/clients/client-qldb/src/runtimeConfig.browser.ts b/clients/client-qldb/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c4859f160fae --- /dev/null +++ b/clients/client-qldb/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { QLDBClientConfig } from "./QLDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QLDBClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-qldb/runtimeConfig.native.ts b/clients/client-qldb/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-qldb/runtimeConfig.native.ts rename to clients/client-qldb/src/runtimeConfig.native.ts diff --git a/clients/client-qldb/runtimeConfig.shared.ts b/clients/client-qldb/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-qldb/runtimeConfig.shared.ts rename to clients/client-qldb/src/runtimeConfig.shared.ts diff --git a/clients/client-qldb/src/runtimeConfig.ts b/clients/client-qldb/src/runtimeConfig.ts new file mode 100644 index 000000000000..9de784fdb605 --- /dev/null +++ b/clients/client-qldb/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { QLDBClientConfig } from "./QLDBClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QLDBClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-qldb/tsconfig.es.json b/clients/client-qldb/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-qldb/tsconfig.es.json +++ b/clients/client-qldb/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-qldb/tsconfig.json b/clients/client-qldb/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-qldb/tsconfig.json +++ b/clients/client-qldb/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-qldb/tsconfig.types.json b/clients/client-qldb/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-qldb/tsconfig.types.json +++ b/clients/client-qldb/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-quicksight/.gitignore b/clients/client-quicksight/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-quicksight/.gitignore +++ b/clients/client-quicksight/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-quicksight/package.json b/clients/client-quicksight/package.json index a69d04e970ce..66666a73831f 100644 --- a/clients/client-quicksight/package.json +++ b/clients/client-quicksight/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-quicksight", "repository": { "type": "git", diff --git a/clients/client-quicksight/runtimeConfig.browser.ts b/clients/client-quicksight/runtimeConfig.browser.ts deleted file mode 100644 index b4ac08cba0ec..000000000000 --- a/clients/client-quicksight/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { QuickSightClientConfig } from "./QuickSightClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QuickSightClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-quicksight/runtimeConfig.ts b/clients/client-quicksight/runtimeConfig.ts deleted file mode 100644 index 9caeb2bf5701..000000000000 --- a/clients/client-quicksight/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { QuickSightClientConfig } from "./QuickSightClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QuickSightClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-quicksight/QuickSight.ts b/clients/client-quicksight/src/QuickSight.ts similarity index 100% rename from clients/client-quicksight/QuickSight.ts rename to clients/client-quicksight/src/QuickSight.ts diff --git a/clients/client-quicksight/QuickSightClient.ts b/clients/client-quicksight/src/QuickSightClient.ts similarity index 100% rename from clients/client-quicksight/QuickSightClient.ts rename to clients/client-quicksight/src/QuickSightClient.ts diff --git a/clients/client-quicksight/commands/CancelIngestionCommand.ts b/clients/client-quicksight/src/commands/CancelIngestionCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CancelIngestionCommand.ts rename to clients/client-quicksight/src/commands/CancelIngestionCommand.ts diff --git a/clients/client-quicksight/commands/CreateAccountCustomizationCommand.ts b/clients/client-quicksight/src/commands/CreateAccountCustomizationCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateAccountCustomizationCommand.ts rename to clients/client-quicksight/src/commands/CreateAccountCustomizationCommand.ts diff --git a/clients/client-quicksight/commands/CreateAnalysisCommand.ts b/clients/client-quicksight/src/commands/CreateAnalysisCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateAnalysisCommand.ts rename to clients/client-quicksight/src/commands/CreateAnalysisCommand.ts diff --git a/clients/client-quicksight/commands/CreateDashboardCommand.ts b/clients/client-quicksight/src/commands/CreateDashboardCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateDashboardCommand.ts rename to clients/client-quicksight/src/commands/CreateDashboardCommand.ts diff --git a/clients/client-quicksight/commands/CreateDataSetCommand.ts b/clients/client-quicksight/src/commands/CreateDataSetCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateDataSetCommand.ts rename to clients/client-quicksight/src/commands/CreateDataSetCommand.ts diff --git a/clients/client-quicksight/commands/CreateDataSourceCommand.ts b/clients/client-quicksight/src/commands/CreateDataSourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateDataSourceCommand.ts rename to clients/client-quicksight/src/commands/CreateDataSourceCommand.ts diff --git a/clients/client-quicksight/commands/CreateFolderCommand.ts b/clients/client-quicksight/src/commands/CreateFolderCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateFolderCommand.ts rename to clients/client-quicksight/src/commands/CreateFolderCommand.ts diff --git a/clients/client-quicksight/commands/CreateFolderMembershipCommand.ts b/clients/client-quicksight/src/commands/CreateFolderMembershipCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateFolderMembershipCommand.ts rename to clients/client-quicksight/src/commands/CreateFolderMembershipCommand.ts diff --git a/clients/client-quicksight/commands/CreateGroupCommand.ts b/clients/client-quicksight/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateGroupCommand.ts rename to clients/client-quicksight/src/commands/CreateGroupCommand.ts diff --git a/clients/client-quicksight/commands/CreateGroupMembershipCommand.ts b/clients/client-quicksight/src/commands/CreateGroupMembershipCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateGroupMembershipCommand.ts rename to clients/client-quicksight/src/commands/CreateGroupMembershipCommand.ts diff --git a/clients/client-quicksight/commands/CreateIAMPolicyAssignmentCommand.ts b/clients/client-quicksight/src/commands/CreateIAMPolicyAssignmentCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateIAMPolicyAssignmentCommand.ts rename to clients/client-quicksight/src/commands/CreateIAMPolicyAssignmentCommand.ts diff --git a/clients/client-quicksight/commands/CreateIngestionCommand.ts b/clients/client-quicksight/src/commands/CreateIngestionCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateIngestionCommand.ts rename to clients/client-quicksight/src/commands/CreateIngestionCommand.ts diff --git a/clients/client-quicksight/commands/CreateNamespaceCommand.ts b/clients/client-quicksight/src/commands/CreateNamespaceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateNamespaceCommand.ts rename to clients/client-quicksight/src/commands/CreateNamespaceCommand.ts diff --git a/clients/client-quicksight/commands/CreateTemplateAliasCommand.ts b/clients/client-quicksight/src/commands/CreateTemplateAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateTemplateAliasCommand.ts rename to clients/client-quicksight/src/commands/CreateTemplateAliasCommand.ts diff --git a/clients/client-quicksight/commands/CreateTemplateCommand.ts b/clients/client-quicksight/src/commands/CreateTemplateCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateTemplateCommand.ts rename to clients/client-quicksight/src/commands/CreateTemplateCommand.ts diff --git a/clients/client-quicksight/commands/CreateThemeAliasCommand.ts b/clients/client-quicksight/src/commands/CreateThemeAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateThemeAliasCommand.ts rename to clients/client-quicksight/src/commands/CreateThemeAliasCommand.ts diff --git a/clients/client-quicksight/commands/CreateThemeCommand.ts b/clients/client-quicksight/src/commands/CreateThemeCommand.ts similarity index 100% rename from clients/client-quicksight/commands/CreateThemeCommand.ts rename to clients/client-quicksight/src/commands/CreateThemeCommand.ts diff --git a/clients/client-quicksight/commands/DeleteAccountCustomizationCommand.ts b/clients/client-quicksight/src/commands/DeleteAccountCustomizationCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteAccountCustomizationCommand.ts rename to clients/client-quicksight/src/commands/DeleteAccountCustomizationCommand.ts diff --git a/clients/client-quicksight/commands/DeleteAnalysisCommand.ts b/clients/client-quicksight/src/commands/DeleteAnalysisCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteAnalysisCommand.ts rename to clients/client-quicksight/src/commands/DeleteAnalysisCommand.ts diff --git a/clients/client-quicksight/commands/DeleteDashboardCommand.ts b/clients/client-quicksight/src/commands/DeleteDashboardCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteDashboardCommand.ts rename to clients/client-quicksight/src/commands/DeleteDashboardCommand.ts diff --git a/clients/client-quicksight/commands/DeleteDataSetCommand.ts b/clients/client-quicksight/src/commands/DeleteDataSetCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteDataSetCommand.ts rename to clients/client-quicksight/src/commands/DeleteDataSetCommand.ts diff --git a/clients/client-quicksight/commands/DeleteDataSourceCommand.ts b/clients/client-quicksight/src/commands/DeleteDataSourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteDataSourceCommand.ts rename to clients/client-quicksight/src/commands/DeleteDataSourceCommand.ts diff --git a/clients/client-quicksight/commands/DeleteFolderCommand.ts b/clients/client-quicksight/src/commands/DeleteFolderCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteFolderCommand.ts rename to clients/client-quicksight/src/commands/DeleteFolderCommand.ts diff --git a/clients/client-quicksight/commands/DeleteFolderMembershipCommand.ts b/clients/client-quicksight/src/commands/DeleteFolderMembershipCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteFolderMembershipCommand.ts rename to clients/client-quicksight/src/commands/DeleteFolderMembershipCommand.ts diff --git a/clients/client-quicksight/commands/DeleteGroupCommand.ts b/clients/client-quicksight/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteGroupCommand.ts rename to clients/client-quicksight/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-quicksight/commands/DeleteGroupMembershipCommand.ts b/clients/client-quicksight/src/commands/DeleteGroupMembershipCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteGroupMembershipCommand.ts rename to clients/client-quicksight/src/commands/DeleteGroupMembershipCommand.ts diff --git a/clients/client-quicksight/commands/DeleteIAMPolicyAssignmentCommand.ts b/clients/client-quicksight/src/commands/DeleteIAMPolicyAssignmentCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteIAMPolicyAssignmentCommand.ts rename to clients/client-quicksight/src/commands/DeleteIAMPolicyAssignmentCommand.ts diff --git a/clients/client-quicksight/commands/DeleteNamespaceCommand.ts b/clients/client-quicksight/src/commands/DeleteNamespaceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteNamespaceCommand.ts rename to clients/client-quicksight/src/commands/DeleteNamespaceCommand.ts diff --git a/clients/client-quicksight/commands/DeleteTemplateAliasCommand.ts b/clients/client-quicksight/src/commands/DeleteTemplateAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteTemplateAliasCommand.ts rename to clients/client-quicksight/src/commands/DeleteTemplateAliasCommand.ts diff --git a/clients/client-quicksight/commands/DeleteTemplateCommand.ts b/clients/client-quicksight/src/commands/DeleteTemplateCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteTemplateCommand.ts rename to clients/client-quicksight/src/commands/DeleteTemplateCommand.ts diff --git a/clients/client-quicksight/commands/DeleteThemeAliasCommand.ts b/clients/client-quicksight/src/commands/DeleteThemeAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteThemeAliasCommand.ts rename to clients/client-quicksight/src/commands/DeleteThemeAliasCommand.ts diff --git a/clients/client-quicksight/commands/DeleteThemeCommand.ts b/clients/client-quicksight/src/commands/DeleteThemeCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteThemeCommand.ts rename to clients/client-quicksight/src/commands/DeleteThemeCommand.ts diff --git a/clients/client-quicksight/commands/DeleteUserByPrincipalIdCommand.ts b/clients/client-quicksight/src/commands/DeleteUserByPrincipalIdCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteUserByPrincipalIdCommand.ts rename to clients/client-quicksight/src/commands/DeleteUserByPrincipalIdCommand.ts diff --git a/clients/client-quicksight/commands/DeleteUserCommand.ts b/clients/client-quicksight/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DeleteUserCommand.ts rename to clients/client-quicksight/src/commands/DeleteUserCommand.ts diff --git a/clients/client-quicksight/commands/DescribeAccountCustomizationCommand.ts b/clients/client-quicksight/src/commands/DescribeAccountCustomizationCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeAccountCustomizationCommand.ts rename to clients/client-quicksight/src/commands/DescribeAccountCustomizationCommand.ts diff --git a/clients/client-quicksight/commands/DescribeAccountSettingsCommand.ts b/clients/client-quicksight/src/commands/DescribeAccountSettingsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeAccountSettingsCommand.ts rename to clients/client-quicksight/src/commands/DescribeAccountSettingsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeAnalysisCommand.ts b/clients/client-quicksight/src/commands/DescribeAnalysisCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeAnalysisCommand.ts rename to clients/client-quicksight/src/commands/DescribeAnalysisCommand.ts diff --git a/clients/client-quicksight/commands/DescribeAnalysisPermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeAnalysisPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeAnalysisPermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeAnalysisPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDashboardCommand.ts b/clients/client-quicksight/src/commands/DescribeDashboardCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDashboardCommand.ts rename to clients/client-quicksight/src/commands/DescribeDashboardCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDashboardPermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeDashboardPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDashboardPermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeDashboardPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDataSetCommand.ts b/clients/client-quicksight/src/commands/DescribeDataSetCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDataSetCommand.ts rename to clients/client-quicksight/src/commands/DescribeDataSetCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDataSetPermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeDataSetPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDataSetPermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeDataSetPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDataSourceCommand.ts b/clients/client-quicksight/src/commands/DescribeDataSourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDataSourceCommand.ts rename to clients/client-quicksight/src/commands/DescribeDataSourceCommand.ts diff --git a/clients/client-quicksight/commands/DescribeDataSourcePermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeDataSourcePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeDataSourcePermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeDataSourcePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeFolderCommand.ts b/clients/client-quicksight/src/commands/DescribeFolderCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeFolderCommand.ts rename to clients/client-quicksight/src/commands/DescribeFolderCommand.ts diff --git a/clients/client-quicksight/commands/DescribeFolderPermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeFolderPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeFolderPermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeFolderPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeFolderResolvedPermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeFolderResolvedPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeFolderResolvedPermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeFolderResolvedPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeGroupCommand.ts b/clients/client-quicksight/src/commands/DescribeGroupCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeGroupCommand.ts rename to clients/client-quicksight/src/commands/DescribeGroupCommand.ts diff --git a/clients/client-quicksight/commands/DescribeIAMPolicyAssignmentCommand.ts b/clients/client-quicksight/src/commands/DescribeIAMPolicyAssignmentCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeIAMPolicyAssignmentCommand.ts rename to clients/client-quicksight/src/commands/DescribeIAMPolicyAssignmentCommand.ts diff --git a/clients/client-quicksight/commands/DescribeIngestionCommand.ts b/clients/client-quicksight/src/commands/DescribeIngestionCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeIngestionCommand.ts rename to clients/client-quicksight/src/commands/DescribeIngestionCommand.ts diff --git a/clients/client-quicksight/commands/DescribeNamespaceCommand.ts b/clients/client-quicksight/src/commands/DescribeNamespaceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeNamespaceCommand.ts rename to clients/client-quicksight/src/commands/DescribeNamespaceCommand.ts diff --git a/clients/client-quicksight/commands/DescribeTemplateAliasCommand.ts b/clients/client-quicksight/src/commands/DescribeTemplateAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeTemplateAliasCommand.ts rename to clients/client-quicksight/src/commands/DescribeTemplateAliasCommand.ts diff --git a/clients/client-quicksight/commands/DescribeTemplateCommand.ts b/clients/client-quicksight/src/commands/DescribeTemplateCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeTemplateCommand.ts rename to clients/client-quicksight/src/commands/DescribeTemplateCommand.ts diff --git a/clients/client-quicksight/commands/DescribeTemplatePermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeTemplatePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeTemplatePermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeTemplatePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeThemeAliasCommand.ts b/clients/client-quicksight/src/commands/DescribeThemeAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeThemeAliasCommand.ts rename to clients/client-quicksight/src/commands/DescribeThemeAliasCommand.ts diff --git a/clients/client-quicksight/commands/DescribeThemeCommand.ts b/clients/client-quicksight/src/commands/DescribeThemeCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeThemeCommand.ts rename to clients/client-quicksight/src/commands/DescribeThemeCommand.ts diff --git a/clients/client-quicksight/commands/DescribeThemePermissionsCommand.ts b/clients/client-quicksight/src/commands/DescribeThemePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeThemePermissionsCommand.ts rename to clients/client-quicksight/src/commands/DescribeThemePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/DescribeUserCommand.ts b/clients/client-quicksight/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/DescribeUserCommand.ts rename to clients/client-quicksight/src/commands/DescribeUserCommand.ts diff --git a/clients/client-quicksight/commands/GenerateEmbedUrlForAnonymousUserCommand.ts b/clients/client-quicksight/src/commands/GenerateEmbedUrlForAnonymousUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/GenerateEmbedUrlForAnonymousUserCommand.ts rename to clients/client-quicksight/src/commands/GenerateEmbedUrlForAnonymousUserCommand.ts diff --git a/clients/client-quicksight/commands/GenerateEmbedUrlForRegisteredUserCommand.ts b/clients/client-quicksight/src/commands/GenerateEmbedUrlForRegisteredUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/GenerateEmbedUrlForRegisteredUserCommand.ts rename to clients/client-quicksight/src/commands/GenerateEmbedUrlForRegisteredUserCommand.ts diff --git a/clients/client-quicksight/commands/GetDashboardEmbedUrlCommand.ts b/clients/client-quicksight/src/commands/GetDashboardEmbedUrlCommand.ts similarity index 100% rename from clients/client-quicksight/commands/GetDashboardEmbedUrlCommand.ts rename to clients/client-quicksight/src/commands/GetDashboardEmbedUrlCommand.ts diff --git a/clients/client-quicksight/commands/GetSessionEmbedUrlCommand.ts b/clients/client-quicksight/src/commands/GetSessionEmbedUrlCommand.ts similarity index 100% rename from clients/client-quicksight/commands/GetSessionEmbedUrlCommand.ts rename to clients/client-quicksight/src/commands/GetSessionEmbedUrlCommand.ts diff --git a/clients/client-quicksight/commands/ListAnalysesCommand.ts b/clients/client-quicksight/src/commands/ListAnalysesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListAnalysesCommand.ts rename to clients/client-quicksight/src/commands/ListAnalysesCommand.ts diff --git a/clients/client-quicksight/commands/ListDashboardVersionsCommand.ts b/clients/client-quicksight/src/commands/ListDashboardVersionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListDashboardVersionsCommand.ts rename to clients/client-quicksight/src/commands/ListDashboardVersionsCommand.ts diff --git a/clients/client-quicksight/commands/ListDashboardsCommand.ts b/clients/client-quicksight/src/commands/ListDashboardsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListDashboardsCommand.ts rename to clients/client-quicksight/src/commands/ListDashboardsCommand.ts diff --git a/clients/client-quicksight/commands/ListDataSetsCommand.ts b/clients/client-quicksight/src/commands/ListDataSetsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListDataSetsCommand.ts rename to clients/client-quicksight/src/commands/ListDataSetsCommand.ts diff --git a/clients/client-quicksight/commands/ListDataSourcesCommand.ts b/clients/client-quicksight/src/commands/ListDataSourcesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListDataSourcesCommand.ts rename to clients/client-quicksight/src/commands/ListDataSourcesCommand.ts diff --git a/clients/client-quicksight/commands/ListFolderMembersCommand.ts b/clients/client-quicksight/src/commands/ListFolderMembersCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListFolderMembersCommand.ts rename to clients/client-quicksight/src/commands/ListFolderMembersCommand.ts diff --git a/clients/client-quicksight/commands/ListFoldersCommand.ts b/clients/client-quicksight/src/commands/ListFoldersCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListFoldersCommand.ts rename to clients/client-quicksight/src/commands/ListFoldersCommand.ts diff --git a/clients/client-quicksight/commands/ListGroupMembershipsCommand.ts b/clients/client-quicksight/src/commands/ListGroupMembershipsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListGroupMembershipsCommand.ts rename to clients/client-quicksight/src/commands/ListGroupMembershipsCommand.ts diff --git a/clients/client-quicksight/commands/ListGroupsCommand.ts b/clients/client-quicksight/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListGroupsCommand.ts rename to clients/client-quicksight/src/commands/ListGroupsCommand.ts diff --git a/clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts b/clients/client-quicksight/src/commands/ListIAMPolicyAssignmentsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListIAMPolicyAssignmentsCommand.ts rename to clients/client-quicksight/src/commands/ListIAMPolicyAssignmentsCommand.ts diff --git a/clients/client-quicksight/commands/ListIAMPolicyAssignmentsForUserCommand.ts b/clients/client-quicksight/src/commands/ListIAMPolicyAssignmentsForUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListIAMPolicyAssignmentsForUserCommand.ts rename to clients/client-quicksight/src/commands/ListIAMPolicyAssignmentsForUserCommand.ts diff --git a/clients/client-quicksight/commands/ListIngestionsCommand.ts b/clients/client-quicksight/src/commands/ListIngestionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListIngestionsCommand.ts rename to clients/client-quicksight/src/commands/ListIngestionsCommand.ts diff --git a/clients/client-quicksight/commands/ListNamespacesCommand.ts b/clients/client-quicksight/src/commands/ListNamespacesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListNamespacesCommand.ts rename to clients/client-quicksight/src/commands/ListNamespacesCommand.ts diff --git a/clients/client-quicksight/commands/ListTagsForResourceCommand.ts b/clients/client-quicksight/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListTagsForResourceCommand.ts rename to clients/client-quicksight/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-quicksight/commands/ListTemplateAliasesCommand.ts b/clients/client-quicksight/src/commands/ListTemplateAliasesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListTemplateAliasesCommand.ts rename to clients/client-quicksight/src/commands/ListTemplateAliasesCommand.ts diff --git a/clients/client-quicksight/commands/ListTemplateVersionsCommand.ts b/clients/client-quicksight/src/commands/ListTemplateVersionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListTemplateVersionsCommand.ts rename to clients/client-quicksight/src/commands/ListTemplateVersionsCommand.ts diff --git a/clients/client-quicksight/commands/ListTemplatesCommand.ts b/clients/client-quicksight/src/commands/ListTemplatesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListTemplatesCommand.ts rename to clients/client-quicksight/src/commands/ListTemplatesCommand.ts diff --git a/clients/client-quicksight/commands/ListThemeAliasesCommand.ts b/clients/client-quicksight/src/commands/ListThemeAliasesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListThemeAliasesCommand.ts rename to clients/client-quicksight/src/commands/ListThemeAliasesCommand.ts diff --git a/clients/client-quicksight/commands/ListThemeVersionsCommand.ts b/clients/client-quicksight/src/commands/ListThemeVersionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListThemeVersionsCommand.ts rename to clients/client-quicksight/src/commands/ListThemeVersionsCommand.ts diff --git a/clients/client-quicksight/commands/ListThemesCommand.ts b/clients/client-quicksight/src/commands/ListThemesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListThemesCommand.ts rename to clients/client-quicksight/src/commands/ListThemesCommand.ts diff --git a/clients/client-quicksight/commands/ListUserGroupsCommand.ts b/clients/client-quicksight/src/commands/ListUserGroupsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListUserGroupsCommand.ts rename to clients/client-quicksight/src/commands/ListUserGroupsCommand.ts diff --git a/clients/client-quicksight/commands/ListUsersCommand.ts b/clients/client-quicksight/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-quicksight/commands/ListUsersCommand.ts rename to clients/client-quicksight/src/commands/ListUsersCommand.ts diff --git a/clients/client-quicksight/commands/RegisterUserCommand.ts b/clients/client-quicksight/src/commands/RegisterUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/RegisterUserCommand.ts rename to clients/client-quicksight/src/commands/RegisterUserCommand.ts diff --git a/clients/client-quicksight/commands/RestoreAnalysisCommand.ts b/clients/client-quicksight/src/commands/RestoreAnalysisCommand.ts similarity index 100% rename from clients/client-quicksight/commands/RestoreAnalysisCommand.ts rename to clients/client-quicksight/src/commands/RestoreAnalysisCommand.ts diff --git a/clients/client-quicksight/commands/SearchAnalysesCommand.ts b/clients/client-quicksight/src/commands/SearchAnalysesCommand.ts similarity index 100% rename from clients/client-quicksight/commands/SearchAnalysesCommand.ts rename to clients/client-quicksight/src/commands/SearchAnalysesCommand.ts diff --git a/clients/client-quicksight/commands/SearchDashboardsCommand.ts b/clients/client-quicksight/src/commands/SearchDashboardsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/SearchDashboardsCommand.ts rename to clients/client-quicksight/src/commands/SearchDashboardsCommand.ts diff --git a/clients/client-quicksight/commands/SearchFoldersCommand.ts b/clients/client-quicksight/src/commands/SearchFoldersCommand.ts similarity index 100% rename from clients/client-quicksight/commands/SearchFoldersCommand.ts rename to clients/client-quicksight/src/commands/SearchFoldersCommand.ts diff --git a/clients/client-quicksight/commands/TagResourceCommand.ts b/clients/client-quicksight/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/TagResourceCommand.ts rename to clients/client-quicksight/src/commands/TagResourceCommand.ts diff --git a/clients/client-quicksight/commands/UntagResourceCommand.ts b/clients/client-quicksight/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UntagResourceCommand.ts rename to clients/client-quicksight/src/commands/UntagResourceCommand.ts diff --git a/clients/client-quicksight/commands/UpdateAccountCustomizationCommand.ts b/clients/client-quicksight/src/commands/UpdateAccountCustomizationCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateAccountCustomizationCommand.ts rename to clients/client-quicksight/src/commands/UpdateAccountCustomizationCommand.ts diff --git a/clients/client-quicksight/commands/UpdateAccountSettingsCommand.ts b/clients/client-quicksight/src/commands/UpdateAccountSettingsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateAccountSettingsCommand.ts rename to clients/client-quicksight/src/commands/UpdateAccountSettingsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateAnalysisCommand.ts b/clients/client-quicksight/src/commands/UpdateAnalysisCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateAnalysisCommand.ts rename to clients/client-quicksight/src/commands/UpdateAnalysisCommand.ts diff --git a/clients/client-quicksight/commands/UpdateAnalysisPermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateAnalysisPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateAnalysisPermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateAnalysisPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDashboardCommand.ts b/clients/client-quicksight/src/commands/UpdateDashboardCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDashboardCommand.ts rename to clients/client-quicksight/src/commands/UpdateDashboardCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDashboardPermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateDashboardPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDashboardPermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateDashboardPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDashboardPublishedVersionCommand.ts b/clients/client-quicksight/src/commands/UpdateDashboardPublishedVersionCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDashboardPublishedVersionCommand.ts rename to clients/client-quicksight/src/commands/UpdateDashboardPublishedVersionCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDataSetCommand.ts b/clients/client-quicksight/src/commands/UpdateDataSetCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDataSetCommand.ts rename to clients/client-quicksight/src/commands/UpdateDataSetCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDataSetPermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateDataSetPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDataSetPermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateDataSetPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDataSourceCommand.ts b/clients/client-quicksight/src/commands/UpdateDataSourceCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDataSourceCommand.ts rename to clients/client-quicksight/src/commands/UpdateDataSourceCommand.ts diff --git a/clients/client-quicksight/commands/UpdateDataSourcePermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateDataSourcePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateDataSourcePermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateDataSourcePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateFolderCommand.ts b/clients/client-quicksight/src/commands/UpdateFolderCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateFolderCommand.ts rename to clients/client-quicksight/src/commands/UpdateFolderCommand.ts diff --git a/clients/client-quicksight/commands/UpdateFolderPermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateFolderPermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateFolderPermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateFolderPermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateGroupCommand.ts b/clients/client-quicksight/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateGroupCommand.ts rename to clients/client-quicksight/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-quicksight/commands/UpdateIAMPolicyAssignmentCommand.ts b/clients/client-quicksight/src/commands/UpdateIAMPolicyAssignmentCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateIAMPolicyAssignmentCommand.ts rename to clients/client-quicksight/src/commands/UpdateIAMPolicyAssignmentCommand.ts diff --git a/clients/client-quicksight/commands/UpdateTemplateAliasCommand.ts b/clients/client-quicksight/src/commands/UpdateTemplateAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateTemplateAliasCommand.ts rename to clients/client-quicksight/src/commands/UpdateTemplateAliasCommand.ts diff --git a/clients/client-quicksight/commands/UpdateTemplateCommand.ts b/clients/client-quicksight/src/commands/UpdateTemplateCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateTemplateCommand.ts rename to clients/client-quicksight/src/commands/UpdateTemplateCommand.ts diff --git a/clients/client-quicksight/commands/UpdateTemplatePermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateTemplatePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateTemplatePermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateTemplatePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateThemeAliasCommand.ts b/clients/client-quicksight/src/commands/UpdateThemeAliasCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateThemeAliasCommand.ts rename to clients/client-quicksight/src/commands/UpdateThemeAliasCommand.ts diff --git a/clients/client-quicksight/commands/UpdateThemeCommand.ts b/clients/client-quicksight/src/commands/UpdateThemeCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateThemeCommand.ts rename to clients/client-quicksight/src/commands/UpdateThemeCommand.ts diff --git a/clients/client-quicksight/commands/UpdateThemePermissionsCommand.ts b/clients/client-quicksight/src/commands/UpdateThemePermissionsCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateThemePermissionsCommand.ts rename to clients/client-quicksight/src/commands/UpdateThemePermissionsCommand.ts diff --git a/clients/client-quicksight/commands/UpdateUserCommand.ts b/clients/client-quicksight/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-quicksight/commands/UpdateUserCommand.ts rename to clients/client-quicksight/src/commands/UpdateUserCommand.ts diff --git a/clients/client-quicksight/endpoints.ts b/clients/client-quicksight/src/endpoints.ts similarity index 100% rename from clients/client-quicksight/endpoints.ts rename to clients/client-quicksight/src/endpoints.ts diff --git a/clients/client-quicksight/index.ts b/clients/client-quicksight/src/index.ts similarity index 100% rename from clients/client-quicksight/index.ts rename to clients/client-quicksight/src/index.ts diff --git a/clients/client-quicksight/models/index.ts b/clients/client-quicksight/src/models/index.ts similarity index 100% rename from clients/client-quicksight/models/index.ts rename to clients/client-quicksight/src/models/index.ts diff --git a/clients/client-quicksight/models/models_0.ts b/clients/client-quicksight/src/models/models_0.ts similarity index 100% rename from clients/client-quicksight/models/models_0.ts rename to clients/client-quicksight/src/models/models_0.ts diff --git a/clients/client-quicksight/models/models_1.ts b/clients/client-quicksight/src/models/models_1.ts similarity index 100% rename from clients/client-quicksight/models/models_1.ts rename to clients/client-quicksight/src/models/models_1.ts diff --git a/clients/client-quicksight/pagination/Interfaces.ts b/clients/client-quicksight/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-quicksight/pagination/Interfaces.ts rename to clients/client-quicksight/src/pagination/Interfaces.ts diff --git a/clients/client-quicksight/pagination/ListAnalysesPaginator.ts b/clients/client-quicksight/src/pagination/ListAnalysesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListAnalysesPaginator.ts rename to clients/client-quicksight/src/pagination/ListAnalysesPaginator.ts diff --git a/clients/client-quicksight/pagination/ListDashboardVersionsPaginator.ts b/clients/client-quicksight/src/pagination/ListDashboardVersionsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListDashboardVersionsPaginator.ts rename to clients/client-quicksight/src/pagination/ListDashboardVersionsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListDashboardsPaginator.ts b/clients/client-quicksight/src/pagination/ListDashboardsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListDashboardsPaginator.ts rename to clients/client-quicksight/src/pagination/ListDashboardsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListDataSetsPaginator.ts b/clients/client-quicksight/src/pagination/ListDataSetsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListDataSetsPaginator.ts rename to clients/client-quicksight/src/pagination/ListDataSetsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListDataSourcesPaginator.ts b/clients/client-quicksight/src/pagination/ListDataSourcesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListDataSourcesPaginator.ts rename to clients/client-quicksight/src/pagination/ListDataSourcesPaginator.ts diff --git a/clients/client-quicksight/pagination/ListIngestionsPaginator.ts b/clients/client-quicksight/src/pagination/ListIngestionsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListIngestionsPaginator.ts rename to clients/client-quicksight/src/pagination/ListIngestionsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListNamespacesPaginator.ts b/clients/client-quicksight/src/pagination/ListNamespacesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListNamespacesPaginator.ts rename to clients/client-quicksight/src/pagination/ListNamespacesPaginator.ts diff --git a/clients/client-quicksight/pagination/ListTemplateAliasesPaginator.ts b/clients/client-quicksight/src/pagination/ListTemplateAliasesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListTemplateAliasesPaginator.ts rename to clients/client-quicksight/src/pagination/ListTemplateAliasesPaginator.ts diff --git a/clients/client-quicksight/pagination/ListTemplateVersionsPaginator.ts b/clients/client-quicksight/src/pagination/ListTemplateVersionsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListTemplateVersionsPaginator.ts rename to clients/client-quicksight/src/pagination/ListTemplateVersionsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListTemplatesPaginator.ts b/clients/client-quicksight/src/pagination/ListTemplatesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListTemplatesPaginator.ts rename to clients/client-quicksight/src/pagination/ListTemplatesPaginator.ts diff --git a/clients/client-quicksight/pagination/ListThemeVersionsPaginator.ts b/clients/client-quicksight/src/pagination/ListThemeVersionsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListThemeVersionsPaginator.ts rename to clients/client-quicksight/src/pagination/ListThemeVersionsPaginator.ts diff --git a/clients/client-quicksight/pagination/ListThemesPaginator.ts b/clients/client-quicksight/src/pagination/ListThemesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/ListThemesPaginator.ts rename to clients/client-quicksight/src/pagination/ListThemesPaginator.ts diff --git a/clients/client-quicksight/pagination/SearchAnalysesPaginator.ts b/clients/client-quicksight/src/pagination/SearchAnalysesPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/SearchAnalysesPaginator.ts rename to clients/client-quicksight/src/pagination/SearchAnalysesPaginator.ts diff --git a/clients/client-quicksight/pagination/SearchDashboardsPaginator.ts b/clients/client-quicksight/src/pagination/SearchDashboardsPaginator.ts similarity index 100% rename from clients/client-quicksight/pagination/SearchDashboardsPaginator.ts rename to clients/client-quicksight/src/pagination/SearchDashboardsPaginator.ts diff --git a/clients/client-quicksight/protocols/Aws_restJson1.ts b/clients/client-quicksight/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-quicksight/protocols/Aws_restJson1.ts rename to clients/client-quicksight/src/protocols/Aws_restJson1.ts diff --git a/clients/client-quicksight/src/runtimeConfig.browser.ts b/clients/client-quicksight/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3fcede9be3aa --- /dev/null +++ b/clients/client-quicksight/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { QuickSightClientConfig } from "./QuickSightClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QuickSightClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-quicksight/runtimeConfig.native.ts b/clients/client-quicksight/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-quicksight/runtimeConfig.native.ts rename to clients/client-quicksight/src/runtimeConfig.native.ts diff --git a/clients/client-quicksight/runtimeConfig.shared.ts b/clients/client-quicksight/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-quicksight/runtimeConfig.shared.ts rename to clients/client-quicksight/src/runtimeConfig.shared.ts diff --git a/clients/client-quicksight/src/runtimeConfig.ts b/clients/client-quicksight/src/runtimeConfig.ts new file mode 100644 index 000000000000..a7fdc59190da --- /dev/null +++ b/clients/client-quicksight/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { QuickSightClientConfig } from "./QuickSightClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QuickSightClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-quicksight/tsconfig.es.json b/clients/client-quicksight/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-quicksight/tsconfig.es.json +++ b/clients/client-quicksight/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-quicksight/tsconfig.json b/clients/client-quicksight/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-quicksight/tsconfig.json +++ b/clients/client-quicksight/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-quicksight/tsconfig.types.json b/clients/client-quicksight/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-quicksight/tsconfig.types.json +++ b/clients/client-quicksight/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ram/.gitignore b/clients/client-ram/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ram/.gitignore +++ b/clients/client-ram/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ram/package.json b/clients/client-ram/package.json index d187cd0f7a35..f50b7c62086e 100644 --- a/clients/client-ram/package.json +++ b/clients/client-ram/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ram", "repository": { "type": "git", diff --git a/clients/client-ram/runtimeConfig.browser.ts b/clients/client-ram/runtimeConfig.browser.ts deleted file mode 100644 index f4d9e4b6f411..000000000000 --- a/clients/client-ram/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RAMClientConfig } from "./RAMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RAMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ram/runtimeConfig.ts b/clients/client-ram/runtimeConfig.ts deleted file mode 100644 index 9b59014b7339..000000000000 --- a/clients/client-ram/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RAMClientConfig } from "./RAMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RAMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ram/RAM.ts b/clients/client-ram/src/RAM.ts similarity index 100% rename from clients/client-ram/RAM.ts rename to clients/client-ram/src/RAM.ts diff --git a/clients/client-ram/RAMClient.ts b/clients/client-ram/src/RAMClient.ts similarity index 100% rename from clients/client-ram/RAMClient.ts rename to clients/client-ram/src/RAMClient.ts diff --git a/clients/client-ram/commands/AcceptResourceShareInvitationCommand.ts b/clients/client-ram/src/commands/AcceptResourceShareInvitationCommand.ts similarity index 100% rename from clients/client-ram/commands/AcceptResourceShareInvitationCommand.ts rename to clients/client-ram/src/commands/AcceptResourceShareInvitationCommand.ts diff --git a/clients/client-ram/commands/AssociateResourceShareCommand.ts b/clients/client-ram/src/commands/AssociateResourceShareCommand.ts similarity index 100% rename from clients/client-ram/commands/AssociateResourceShareCommand.ts rename to clients/client-ram/src/commands/AssociateResourceShareCommand.ts diff --git a/clients/client-ram/commands/AssociateResourceSharePermissionCommand.ts b/clients/client-ram/src/commands/AssociateResourceSharePermissionCommand.ts similarity index 100% rename from clients/client-ram/commands/AssociateResourceSharePermissionCommand.ts rename to clients/client-ram/src/commands/AssociateResourceSharePermissionCommand.ts diff --git a/clients/client-ram/commands/CreateResourceShareCommand.ts b/clients/client-ram/src/commands/CreateResourceShareCommand.ts similarity index 100% rename from clients/client-ram/commands/CreateResourceShareCommand.ts rename to clients/client-ram/src/commands/CreateResourceShareCommand.ts diff --git a/clients/client-ram/commands/DeleteResourceShareCommand.ts b/clients/client-ram/src/commands/DeleteResourceShareCommand.ts similarity index 100% rename from clients/client-ram/commands/DeleteResourceShareCommand.ts rename to clients/client-ram/src/commands/DeleteResourceShareCommand.ts diff --git a/clients/client-ram/commands/DisassociateResourceShareCommand.ts b/clients/client-ram/src/commands/DisassociateResourceShareCommand.ts similarity index 100% rename from clients/client-ram/commands/DisassociateResourceShareCommand.ts rename to clients/client-ram/src/commands/DisassociateResourceShareCommand.ts diff --git a/clients/client-ram/commands/DisassociateResourceSharePermissionCommand.ts b/clients/client-ram/src/commands/DisassociateResourceSharePermissionCommand.ts similarity index 100% rename from clients/client-ram/commands/DisassociateResourceSharePermissionCommand.ts rename to clients/client-ram/src/commands/DisassociateResourceSharePermissionCommand.ts diff --git a/clients/client-ram/commands/EnableSharingWithAwsOrganizationCommand.ts b/clients/client-ram/src/commands/EnableSharingWithAwsOrganizationCommand.ts similarity index 100% rename from clients/client-ram/commands/EnableSharingWithAwsOrganizationCommand.ts rename to clients/client-ram/src/commands/EnableSharingWithAwsOrganizationCommand.ts diff --git a/clients/client-ram/commands/GetPermissionCommand.ts b/clients/client-ram/src/commands/GetPermissionCommand.ts similarity index 100% rename from clients/client-ram/commands/GetPermissionCommand.ts rename to clients/client-ram/src/commands/GetPermissionCommand.ts diff --git a/clients/client-ram/commands/GetResourcePoliciesCommand.ts b/clients/client-ram/src/commands/GetResourcePoliciesCommand.ts similarity index 100% rename from clients/client-ram/commands/GetResourcePoliciesCommand.ts rename to clients/client-ram/src/commands/GetResourcePoliciesCommand.ts diff --git a/clients/client-ram/commands/GetResourceShareAssociationsCommand.ts b/clients/client-ram/src/commands/GetResourceShareAssociationsCommand.ts similarity index 100% rename from clients/client-ram/commands/GetResourceShareAssociationsCommand.ts rename to clients/client-ram/src/commands/GetResourceShareAssociationsCommand.ts diff --git a/clients/client-ram/commands/GetResourceShareInvitationsCommand.ts b/clients/client-ram/src/commands/GetResourceShareInvitationsCommand.ts similarity index 100% rename from clients/client-ram/commands/GetResourceShareInvitationsCommand.ts rename to clients/client-ram/src/commands/GetResourceShareInvitationsCommand.ts diff --git a/clients/client-ram/commands/GetResourceSharesCommand.ts b/clients/client-ram/src/commands/GetResourceSharesCommand.ts similarity index 100% rename from clients/client-ram/commands/GetResourceSharesCommand.ts rename to clients/client-ram/src/commands/GetResourceSharesCommand.ts diff --git a/clients/client-ram/commands/ListPendingInvitationResourcesCommand.ts b/clients/client-ram/src/commands/ListPendingInvitationResourcesCommand.ts similarity index 100% rename from clients/client-ram/commands/ListPendingInvitationResourcesCommand.ts rename to clients/client-ram/src/commands/ListPendingInvitationResourcesCommand.ts diff --git a/clients/client-ram/commands/ListPermissionsCommand.ts b/clients/client-ram/src/commands/ListPermissionsCommand.ts similarity index 100% rename from clients/client-ram/commands/ListPermissionsCommand.ts rename to clients/client-ram/src/commands/ListPermissionsCommand.ts diff --git a/clients/client-ram/commands/ListPrincipalsCommand.ts b/clients/client-ram/src/commands/ListPrincipalsCommand.ts similarity index 100% rename from clients/client-ram/commands/ListPrincipalsCommand.ts rename to clients/client-ram/src/commands/ListPrincipalsCommand.ts diff --git a/clients/client-ram/commands/ListResourceSharePermissionsCommand.ts b/clients/client-ram/src/commands/ListResourceSharePermissionsCommand.ts similarity index 100% rename from clients/client-ram/commands/ListResourceSharePermissionsCommand.ts rename to clients/client-ram/src/commands/ListResourceSharePermissionsCommand.ts diff --git a/clients/client-ram/commands/ListResourceTypesCommand.ts b/clients/client-ram/src/commands/ListResourceTypesCommand.ts similarity index 100% rename from clients/client-ram/commands/ListResourceTypesCommand.ts rename to clients/client-ram/src/commands/ListResourceTypesCommand.ts diff --git a/clients/client-ram/commands/ListResourcesCommand.ts b/clients/client-ram/src/commands/ListResourcesCommand.ts similarity index 100% rename from clients/client-ram/commands/ListResourcesCommand.ts rename to clients/client-ram/src/commands/ListResourcesCommand.ts diff --git a/clients/client-ram/commands/PromoteResourceShareCreatedFromPolicyCommand.ts b/clients/client-ram/src/commands/PromoteResourceShareCreatedFromPolicyCommand.ts similarity index 100% rename from clients/client-ram/commands/PromoteResourceShareCreatedFromPolicyCommand.ts rename to clients/client-ram/src/commands/PromoteResourceShareCreatedFromPolicyCommand.ts diff --git a/clients/client-ram/commands/RejectResourceShareInvitationCommand.ts b/clients/client-ram/src/commands/RejectResourceShareInvitationCommand.ts similarity index 100% rename from clients/client-ram/commands/RejectResourceShareInvitationCommand.ts rename to clients/client-ram/src/commands/RejectResourceShareInvitationCommand.ts diff --git a/clients/client-ram/commands/TagResourceCommand.ts b/clients/client-ram/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ram/commands/TagResourceCommand.ts rename to clients/client-ram/src/commands/TagResourceCommand.ts diff --git a/clients/client-ram/commands/UntagResourceCommand.ts b/clients/client-ram/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ram/commands/UntagResourceCommand.ts rename to clients/client-ram/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ram/commands/UpdateResourceShareCommand.ts b/clients/client-ram/src/commands/UpdateResourceShareCommand.ts similarity index 100% rename from clients/client-ram/commands/UpdateResourceShareCommand.ts rename to clients/client-ram/src/commands/UpdateResourceShareCommand.ts diff --git a/clients/client-ram/endpoints.ts b/clients/client-ram/src/endpoints.ts similarity index 100% rename from clients/client-ram/endpoints.ts rename to clients/client-ram/src/endpoints.ts diff --git a/clients/client-ram/index.ts b/clients/client-ram/src/index.ts similarity index 100% rename from clients/client-ram/index.ts rename to clients/client-ram/src/index.ts diff --git a/clients/client-ram/models/index.ts b/clients/client-ram/src/models/index.ts similarity index 100% rename from clients/client-ram/models/index.ts rename to clients/client-ram/src/models/index.ts diff --git a/clients/client-ram/models/models_0.ts b/clients/client-ram/src/models/models_0.ts similarity index 100% rename from clients/client-ram/models/models_0.ts rename to clients/client-ram/src/models/models_0.ts diff --git a/clients/client-ram/pagination/GetResourcePoliciesPaginator.ts b/clients/client-ram/src/pagination/GetResourcePoliciesPaginator.ts similarity index 100% rename from clients/client-ram/pagination/GetResourcePoliciesPaginator.ts rename to clients/client-ram/src/pagination/GetResourcePoliciesPaginator.ts diff --git a/clients/client-ram/pagination/GetResourceShareAssociationsPaginator.ts b/clients/client-ram/src/pagination/GetResourceShareAssociationsPaginator.ts similarity index 100% rename from clients/client-ram/pagination/GetResourceShareAssociationsPaginator.ts rename to clients/client-ram/src/pagination/GetResourceShareAssociationsPaginator.ts diff --git a/clients/client-ram/pagination/GetResourceShareInvitationsPaginator.ts b/clients/client-ram/src/pagination/GetResourceShareInvitationsPaginator.ts similarity index 100% rename from clients/client-ram/pagination/GetResourceShareInvitationsPaginator.ts rename to clients/client-ram/src/pagination/GetResourceShareInvitationsPaginator.ts diff --git a/clients/client-ram/pagination/GetResourceSharesPaginator.ts b/clients/client-ram/src/pagination/GetResourceSharesPaginator.ts similarity index 100% rename from clients/client-ram/pagination/GetResourceSharesPaginator.ts rename to clients/client-ram/src/pagination/GetResourceSharesPaginator.ts diff --git a/clients/client-ram/pagination/Interfaces.ts b/clients/client-ram/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ram/pagination/Interfaces.ts rename to clients/client-ram/src/pagination/Interfaces.ts diff --git a/clients/client-ram/pagination/ListPendingInvitationResourcesPaginator.ts b/clients/client-ram/src/pagination/ListPendingInvitationResourcesPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListPendingInvitationResourcesPaginator.ts rename to clients/client-ram/src/pagination/ListPendingInvitationResourcesPaginator.ts diff --git a/clients/client-ram/pagination/ListPermissionsPaginator.ts b/clients/client-ram/src/pagination/ListPermissionsPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListPermissionsPaginator.ts rename to clients/client-ram/src/pagination/ListPermissionsPaginator.ts diff --git a/clients/client-ram/pagination/ListPrincipalsPaginator.ts b/clients/client-ram/src/pagination/ListPrincipalsPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListPrincipalsPaginator.ts rename to clients/client-ram/src/pagination/ListPrincipalsPaginator.ts diff --git a/clients/client-ram/pagination/ListResourceSharePermissionsPaginator.ts b/clients/client-ram/src/pagination/ListResourceSharePermissionsPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListResourceSharePermissionsPaginator.ts rename to clients/client-ram/src/pagination/ListResourceSharePermissionsPaginator.ts diff --git a/clients/client-ram/pagination/ListResourceTypesPaginator.ts b/clients/client-ram/src/pagination/ListResourceTypesPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListResourceTypesPaginator.ts rename to clients/client-ram/src/pagination/ListResourceTypesPaginator.ts diff --git a/clients/client-ram/pagination/ListResourcesPaginator.ts b/clients/client-ram/src/pagination/ListResourcesPaginator.ts similarity index 100% rename from clients/client-ram/pagination/ListResourcesPaginator.ts rename to clients/client-ram/src/pagination/ListResourcesPaginator.ts diff --git a/clients/client-ram/protocols/Aws_restJson1.ts b/clients/client-ram/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-ram/protocols/Aws_restJson1.ts rename to clients/client-ram/src/protocols/Aws_restJson1.ts diff --git a/clients/client-ram/src/runtimeConfig.browser.ts b/clients/client-ram/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b3ef937e6e0d --- /dev/null +++ b/clients/client-ram/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RAMClientConfig } from "./RAMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RAMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ram/runtimeConfig.native.ts b/clients/client-ram/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ram/runtimeConfig.native.ts rename to clients/client-ram/src/runtimeConfig.native.ts diff --git a/clients/client-ram/runtimeConfig.shared.ts b/clients/client-ram/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ram/runtimeConfig.shared.ts rename to clients/client-ram/src/runtimeConfig.shared.ts diff --git a/clients/client-ram/src/runtimeConfig.ts b/clients/client-ram/src/runtimeConfig.ts new file mode 100644 index 000000000000..f2734399a1e6 --- /dev/null +++ b/clients/client-ram/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RAMClientConfig } from "./RAMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RAMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ram/tsconfig.es.json b/clients/client-ram/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ram/tsconfig.es.json +++ b/clients/client-ram/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ram/tsconfig.json b/clients/client-ram/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ram/tsconfig.json +++ b/clients/client-ram/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ram/tsconfig.types.json b/clients/client-ram/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ram/tsconfig.types.json +++ b/clients/client-ram/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-rds-data/.gitignore b/clients/client-rds-data/.gitignore index d03da27521df..6182953dfe64 100644 --- a/clients/client-rds-data/.gitignore +++ b/clients/client-rds-data/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-rds-data/lib/smithy.ts b/clients/client-rds-data/lib/smithy.ts deleted file mode 100644 index 666c54d95991..000000000000 --- a/clients/client-rds-data/lib/smithy.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Checks if the given value is a Smithy structure of the given type. - */ -export function isa(o: any, ...ids: string[]): o is T { - return typeof o === "object" && "__type" in o && ids.indexOf(o["__type"]) > -1; -} - -/** - * Type that is implemented by all Smithy shapes marked with the - * error trait. - */ -export interface SmithyException { - /** - * The shape ID name of the exception. - */ - readonly __type: string; - - /** - * Whether the client or server are at fault. - */ - readonly $fault: "client" | "server"; - - /** - * The service that encountered the exception. - */ - readonly $service?: string; -} - -/** - * Smithy document type values. - */ -export namespace DocumentType { - export type Value = Scalar | Structure | List; - export type Scalar = string | number | boolean | null; - export type Structure = { [member: string]: Value }; - export interface List extends Array {} -} diff --git a/clients/client-rds-data/package.json b/clients/client-rds-data/package.json index 977a94ac4d3a..6e89de247668 100644 --- a/clients/client-rds-data/package.json +++ b/clients/client-rds-data/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-rds-data", "repository": { "type": "git", diff --git a/clients/client-rds-data/runtimeConfig.browser.ts b/clients/client-rds-data/runtimeConfig.browser.ts deleted file mode 100644 index a4c503a3051f..000000000000 --- a/clients/client-rds-data/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RDSDataClientConfig } from "./RDSDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RDSDataClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rds-data/runtimeConfig.ts b/clients/client-rds-data/runtimeConfig.ts deleted file mode 100644 index e8ace15b2544..000000000000 --- a/clients/client-rds-data/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RDSDataClientConfig } from "./RDSDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RDSDataClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rds-data/RDSData.ts b/clients/client-rds-data/src/RDSData.ts similarity index 100% rename from clients/client-rds-data/RDSData.ts rename to clients/client-rds-data/src/RDSData.ts diff --git a/clients/client-rds-data/RDSDataClient.ts b/clients/client-rds-data/src/RDSDataClient.ts similarity index 100% rename from clients/client-rds-data/RDSDataClient.ts rename to clients/client-rds-data/src/RDSDataClient.ts diff --git a/clients/client-rds-data/commands/BatchExecuteStatementCommand.ts b/clients/client-rds-data/src/commands/BatchExecuteStatementCommand.ts similarity index 100% rename from clients/client-rds-data/commands/BatchExecuteStatementCommand.ts rename to clients/client-rds-data/src/commands/BatchExecuteStatementCommand.ts diff --git a/clients/client-rds-data/commands/BeginTransactionCommand.ts b/clients/client-rds-data/src/commands/BeginTransactionCommand.ts similarity index 100% rename from clients/client-rds-data/commands/BeginTransactionCommand.ts rename to clients/client-rds-data/src/commands/BeginTransactionCommand.ts diff --git a/clients/client-rds-data/commands/CommitTransactionCommand.ts b/clients/client-rds-data/src/commands/CommitTransactionCommand.ts similarity index 100% rename from clients/client-rds-data/commands/CommitTransactionCommand.ts rename to clients/client-rds-data/src/commands/CommitTransactionCommand.ts diff --git a/clients/client-rds-data/commands/ExecuteSqlCommand.ts b/clients/client-rds-data/src/commands/ExecuteSqlCommand.ts similarity index 100% rename from clients/client-rds-data/commands/ExecuteSqlCommand.ts rename to clients/client-rds-data/src/commands/ExecuteSqlCommand.ts diff --git a/clients/client-rds-data/commands/ExecuteStatementCommand.ts b/clients/client-rds-data/src/commands/ExecuteStatementCommand.ts similarity index 100% rename from clients/client-rds-data/commands/ExecuteStatementCommand.ts rename to clients/client-rds-data/src/commands/ExecuteStatementCommand.ts diff --git a/clients/client-rds-data/commands/RollbackTransactionCommand.ts b/clients/client-rds-data/src/commands/RollbackTransactionCommand.ts similarity index 100% rename from clients/client-rds-data/commands/RollbackTransactionCommand.ts rename to clients/client-rds-data/src/commands/RollbackTransactionCommand.ts diff --git a/clients/client-rds-data/endpoints.ts b/clients/client-rds-data/src/endpoints.ts similarity index 100% rename from clients/client-rds-data/endpoints.ts rename to clients/client-rds-data/src/endpoints.ts diff --git a/clients/client-rds-data/index.ts b/clients/client-rds-data/src/index.ts similarity index 100% rename from clients/client-rds-data/index.ts rename to clients/client-rds-data/src/index.ts diff --git a/clients/client-rds-data/models/index.ts b/clients/client-rds-data/src/models/index.ts similarity index 100% rename from clients/client-rds-data/models/index.ts rename to clients/client-rds-data/src/models/index.ts diff --git a/clients/client-rds-data/models/models_0.ts b/clients/client-rds-data/src/models/models_0.ts similarity index 100% rename from clients/client-rds-data/models/models_0.ts rename to clients/client-rds-data/src/models/models_0.ts diff --git a/clients/client-rds-data/protocols/Aws_restJson1.ts b/clients/client-rds-data/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-rds-data/protocols/Aws_restJson1.ts rename to clients/client-rds-data/src/protocols/Aws_restJson1.ts diff --git a/clients/client-rds-data/src/runtimeConfig.browser.ts b/clients/client-rds-data/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..36b2b97b5b2d --- /dev/null +++ b/clients/client-rds-data/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RDSDataClientConfig } from "./RDSDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RDSDataClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rds-data/runtimeConfig.native.ts b/clients/client-rds-data/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-rds-data/runtimeConfig.native.ts rename to clients/client-rds-data/src/runtimeConfig.native.ts diff --git a/clients/client-rds-data/runtimeConfig.shared.ts b/clients/client-rds-data/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-rds-data/runtimeConfig.shared.ts rename to clients/client-rds-data/src/runtimeConfig.shared.ts diff --git a/clients/client-rds-data/src/runtimeConfig.ts b/clients/client-rds-data/src/runtimeConfig.ts new file mode 100644 index 000000000000..255fb465ed7f --- /dev/null +++ b/clients/client-rds-data/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RDSDataClientConfig } from "./RDSDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RDSDataClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rds-data/tsconfig.es.json b/clients/client-rds-data/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-rds-data/tsconfig.es.json +++ b/clients/client-rds-data/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-rds-data/tsconfig.json b/clients/client-rds-data/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-rds-data/tsconfig.json +++ b/clients/client-rds-data/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-rds-data/tsconfig.types.json b/clients/client-rds-data/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-rds-data/tsconfig.types.json +++ b/clients/client-rds-data/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-rds/.gitignore b/clients/client-rds/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-rds/.gitignore +++ b/clients/client-rds/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-rds/package.json b/clients/client-rds/package.json index ef18425fc39d..3e574f6d0a50 100644 --- a/clients/client-rds/package.json +++ b/clients/client-rds/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-rds", "repository": { "type": "git", diff --git a/clients/client-rds/runtimeConfig.browser.ts b/clients/client-rds/runtimeConfig.browser.ts deleted file mode 100644 index c7c8e141e2c0..000000000000 --- a/clients/client-rds/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RDSClientConfig } from "./RDSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RDSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rds/runtimeConfig.ts b/clients/client-rds/runtimeConfig.ts deleted file mode 100644 index dcf8f4ef22e3..000000000000 --- a/clients/client-rds/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RDSClientConfig } from "./RDSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RDSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rds/RDS.ts b/clients/client-rds/src/RDS.ts similarity index 100% rename from clients/client-rds/RDS.ts rename to clients/client-rds/src/RDS.ts diff --git a/clients/client-rds/RDSClient.ts b/clients/client-rds/src/RDSClient.ts similarity index 100% rename from clients/client-rds/RDSClient.ts rename to clients/client-rds/src/RDSClient.ts diff --git a/clients/client-rds/commands/AddRoleToDBClusterCommand.ts b/clients/client-rds/src/commands/AddRoleToDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/AddRoleToDBClusterCommand.ts rename to clients/client-rds/src/commands/AddRoleToDBClusterCommand.ts diff --git a/clients/client-rds/commands/AddRoleToDBInstanceCommand.ts b/clients/client-rds/src/commands/AddRoleToDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/AddRoleToDBInstanceCommand.ts rename to clients/client-rds/src/commands/AddRoleToDBInstanceCommand.ts diff --git a/clients/client-rds/commands/AddSourceIdentifierToSubscriptionCommand.ts b/clients/client-rds/src/commands/AddSourceIdentifierToSubscriptionCommand.ts similarity index 100% rename from clients/client-rds/commands/AddSourceIdentifierToSubscriptionCommand.ts rename to clients/client-rds/src/commands/AddSourceIdentifierToSubscriptionCommand.ts diff --git a/clients/client-rds/commands/AddTagsToResourceCommand.ts b/clients/client-rds/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-rds/commands/AddTagsToResourceCommand.ts rename to clients/client-rds/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-rds/commands/ApplyPendingMaintenanceActionCommand.ts b/clients/client-rds/src/commands/ApplyPendingMaintenanceActionCommand.ts similarity index 100% rename from clients/client-rds/commands/ApplyPendingMaintenanceActionCommand.ts rename to clients/client-rds/src/commands/ApplyPendingMaintenanceActionCommand.ts diff --git a/clients/client-rds/commands/AuthorizeDBSecurityGroupIngressCommand.ts b/clients/client-rds/src/commands/AuthorizeDBSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-rds/commands/AuthorizeDBSecurityGroupIngressCommand.ts rename to clients/client-rds/src/commands/AuthorizeDBSecurityGroupIngressCommand.ts diff --git a/clients/client-rds/commands/BacktrackDBClusterCommand.ts b/clients/client-rds/src/commands/BacktrackDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/BacktrackDBClusterCommand.ts rename to clients/client-rds/src/commands/BacktrackDBClusterCommand.ts diff --git a/clients/client-rds/commands/CancelExportTaskCommand.ts b/clients/client-rds/src/commands/CancelExportTaskCommand.ts similarity index 100% rename from clients/client-rds/commands/CancelExportTaskCommand.ts rename to clients/client-rds/src/commands/CancelExportTaskCommand.ts diff --git a/clients/client-rds/commands/CopyDBClusterParameterGroupCommand.ts b/clients/client-rds/src/commands/CopyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CopyDBClusterParameterGroupCommand.ts rename to clients/client-rds/src/commands/CopyDBClusterParameterGroupCommand.ts diff --git a/clients/client-rds/commands/CopyDBClusterSnapshotCommand.ts b/clients/client-rds/src/commands/CopyDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/CopyDBClusterSnapshotCommand.ts rename to clients/client-rds/src/commands/CopyDBClusterSnapshotCommand.ts diff --git a/clients/client-rds/commands/CopyDBParameterGroupCommand.ts b/clients/client-rds/src/commands/CopyDBParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CopyDBParameterGroupCommand.ts rename to clients/client-rds/src/commands/CopyDBParameterGroupCommand.ts diff --git a/clients/client-rds/commands/CopyDBSnapshotCommand.ts b/clients/client-rds/src/commands/CopyDBSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/CopyDBSnapshotCommand.ts rename to clients/client-rds/src/commands/CopyDBSnapshotCommand.ts diff --git a/clients/client-rds/commands/CopyOptionGroupCommand.ts b/clients/client-rds/src/commands/CopyOptionGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CopyOptionGroupCommand.ts rename to clients/client-rds/src/commands/CopyOptionGroupCommand.ts diff --git a/clients/client-rds/commands/CreateCustomAvailabilityZoneCommand.ts b/clients/client-rds/src/commands/CreateCustomAvailabilityZoneCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateCustomAvailabilityZoneCommand.ts rename to clients/client-rds/src/commands/CreateCustomAvailabilityZoneCommand.ts diff --git a/clients/client-rds/commands/CreateDBClusterCommand.ts b/clients/client-rds/src/commands/CreateDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBClusterCommand.ts rename to clients/client-rds/src/commands/CreateDBClusterCommand.ts diff --git a/clients/client-rds/commands/CreateDBClusterEndpointCommand.ts b/clients/client-rds/src/commands/CreateDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBClusterEndpointCommand.ts rename to clients/client-rds/src/commands/CreateDBClusterEndpointCommand.ts diff --git a/clients/client-rds/commands/CreateDBClusterParameterGroupCommand.ts b/clients/client-rds/src/commands/CreateDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBClusterParameterGroupCommand.ts rename to clients/client-rds/src/commands/CreateDBClusterParameterGroupCommand.ts diff --git a/clients/client-rds/commands/CreateDBClusterSnapshotCommand.ts b/clients/client-rds/src/commands/CreateDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBClusterSnapshotCommand.ts rename to clients/client-rds/src/commands/CreateDBClusterSnapshotCommand.ts diff --git a/clients/client-rds/commands/CreateDBInstanceCommand.ts b/clients/client-rds/src/commands/CreateDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBInstanceCommand.ts rename to clients/client-rds/src/commands/CreateDBInstanceCommand.ts diff --git a/clients/client-rds/commands/CreateDBInstanceReadReplicaCommand.ts b/clients/client-rds/src/commands/CreateDBInstanceReadReplicaCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBInstanceReadReplicaCommand.ts rename to clients/client-rds/src/commands/CreateDBInstanceReadReplicaCommand.ts diff --git a/clients/client-rds/commands/CreateDBParameterGroupCommand.ts b/clients/client-rds/src/commands/CreateDBParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBParameterGroupCommand.ts rename to clients/client-rds/src/commands/CreateDBParameterGroupCommand.ts diff --git a/clients/client-rds/commands/CreateDBProxyCommand.ts b/clients/client-rds/src/commands/CreateDBProxyCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBProxyCommand.ts rename to clients/client-rds/src/commands/CreateDBProxyCommand.ts diff --git a/clients/client-rds/commands/CreateDBProxyEndpointCommand.ts b/clients/client-rds/src/commands/CreateDBProxyEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBProxyEndpointCommand.ts rename to clients/client-rds/src/commands/CreateDBProxyEndpointCommand.ts diff --git a/clients/client-rds/commands/CreateDBSecurityGroupCommand.ts b/clients/client-rds/src/commands/CreateDBSecurityGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBSecurityGroupCommand.ts rename to clients/client-rds/src/commands/CreateDBSecurityGroupCommand.ts diff --git a/clients/client-rds/commands/CreateDBSnapshotCommand.ts b/clients/client-rds/src/commands/CreateDBSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBSnapshotCommand.ts rename to clients/client-rds/src/commands/CreateDBSnapshotCommand.ts diff --git a/clients/client-rds/commands/CreateDBSubnetGroupCommand.ts b/clients/client-rds/src/commands/CreateDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateDBSubnetGroupCommand.ts rename to clients/client-rds/src/commands/CreateDBSubnetGroupCommand.ts diff --git a/clients/client-rds/commands/CreateEventSubscriptionCommand.ts b/clients/client-rds/src/commands/CreateEventSubscriptionCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateEventSubscriptionCommand.ts rename to clients/client-rds/src/commands/CreateEventSubscriptionCommand.ts diff --git a/clients/client-rds/commands/CreateGlobalClusterCommand.ts b/clients/client-rds/src/commands/CreateGlobalClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateGlobalClusterCommand.ts rename to clients/client-rds/src/commands/CreateGlobalClusterCommand.ts diff --git a/clients/client-rds/commands/CreateOptionGroupCommand.ts b/clients/client-rds/src/commands/CreateOptionGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/CreateOptionGroupCommand.ts rename to clients/client-rds/src/commands/CreateOptionGroupCommand.ts diff --git a/clients/client-rds/commands/DeleteCustomAvailabilityZoneCommand.ts b/clients/client-rds/src/commands/DeleteCustomAvailabilityZoneCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteCustomAvailabilityZoneCommand.ts rename to clients/client-rds/src/commands/DeleteCustomAvailabilityZoneCommand.ts diff --git a/clients/client-rds/commands/DeleteDBClusterCommand.ts b/clients/client-rds/src/commands/DeleteDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBClusterCommand.ts rename to clients/client-rds/src/commands/DeleteDBClusterCommand.ts diff --git a/clients/client-rds/commands/DeleteDBClusterEndpointCommand.ts b/clients/client-rds/src/commands/DeleteDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBClusterEndpointCommand.ts rename to clients/client-rds/src/commands/DeleteDBClusterEndpointCommand.ts diff --git a/clients/client-rds/commands/DeleteDBClusterParameterGroupCommand.ts b/clients/client-rds/src/commands/DeleteDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBClusterParameterGroupCommand.ts rename to clients/client-rds/src/commands/DeleteDBClusterParameterGroupCommand.ts diff --git a/clients/client-rds/commands/DeleteDBClusterSnapshotCommand.ts b/clients/client-rds/src/commands/DeleteDBClusterSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBClusterSnapshotCommand.ts rename to clients/client-rds/src/commands/DeleteDBClusterSnapshotCommand.ts diff --git a/clients/client-rds/commands/DeleteDBInstanceAutomatedBackupCommand.ts b/clients/client-rds/src/commands/DeleteDBInstanceAutomatedBackupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBInstanceAutomatedBackupCommand.ts rename to clients/client-rds/src/commands/DeleteDBInstanceAutomatedBackupCommand.ts diff --git a/clients/client-rds/commands/DeleteDBInstanceCommand.ts b/clients/client-rds/src/commands/DeleteDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBInstanceCommand.ts rename to clients/client-rds/src/commands/DeleteDBInstanceCommand.ts diff --git a/clients/client-rds/commands/DeleteDBParameterGroupCommand.ts b/clients/client-rds/src/commands/DeleteDBParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBParameterGroupCommand.ts rename to clients/client-rds/src/commands/DeleteDBParameterGroupCommand.ts diff --git a/clients/client-rds/commands/DeleteDBProxyCommand.ts b/clients/client-rds/src/commands/DeleteDBProxyCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBProxyCommand.ts rename to clients/client-rds/src/commands/DeleteDBProxyCommand.ts diff --git a/clients/client-rds/commands/DeleteDBProxyEndpointCommand.ts b/clients/client-rds/src/commands/DeleteDBProxyEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBProxyEndpointCommand.ts rename to clients/client-rds/src/commands/DeleteDBProxyEndpointCommand.ts diff --git a/clients/client-rds/commands/DeleteDBSecurityGroupCommand.ts b/clients/client-rds/src/commands/DeleteDBSecurityGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBSecurityGroupCommand.ts rename to clients/client-rds/src/commands/DeleteDBSecurityGroupCommand.ts diff --git a/clients/client-rds/commands/DeleteDBSnapshotCommand.ts b/clients/client-rds/src/commands/DeleteDBSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBSnapshotCommand.ts rename to clients/client-rds/src/commands/DeleteDBSnapshotCommand.ts diff --git a/clients/client-rds/commands/DeleteDBSubnetGroupCommand.ts b/clients/client-rds/src/commands/DeleteDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteDBSubnetGroupCommand.ts rename to clients/client-rds/src/commands/DeleteDBSubnetGroupCommand.ts diff --git a/clients/client-rds/commands/DeleteEventSubscriptionCommand.ts b/clients/client-rds/src/commands/DeleteEventSubscriptionCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteEventSubscriptionCommand.ts rename to clients/client-rds/src/commands/DeleteEventSubscriptionCommand.ts diff --git a/clients/client-rds/commands/DeleteGlobalClusterCommand.ts b/clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteGlobalClusterCommand.ts rename to clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts diff --git a/clients/client-rds/commands/DeleteInstallationMediaCommand.ts b/clients/client-rds/src/commands/DeleteInstallationMediaCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteInstallationMediaCommand.ts rename to clients/client-rds/src/commands/DeleteInstallationMediaCommand.ts diff --git a/clients/client-rds/commands/DeleteOptionGroupCommand.ts b/clients/client-rds/src/commands/DeleteOptionGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/DeleteOptionGroupCommand.ts rename to clients/client-rds/src/commands/DeleteOptionGroupCommand.ts diff --git a/clients/client-rds/commands/DeregisterDBProxyTargetsCommand.ts b/clients/client-rds/src/commands/DeregisterDBProxyTargetsCommand.ts similarity index 100% rename from clients/client-rds/commands/DeregisterDBProxyTargetsCommand.ts rename to clients/client-rds/src/commands/DeregisterDBProxyTargetsCommand.ts diff --git a/clients/client-rds/commands/DescribeAccountAttributesCommand.ts b/clients/client-rds/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeAccountAttributesCommand.ts rename to clients/client-rds/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-rds/commands/DescribeCertificatesCommand.ts b/clients/client-rds/src/commands/DescribeCertificatesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeCertificatesCommand.ts rename to clients/client-rds/src/commands/DescribeCertificatesCommand.ts diff --git a/clients/client-rds/commands/DescribeCustomAvailabilityZonesCommand.ts b/clients/client-rds/src/commands/DescribeCustomAvailabilityZonesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeCustomAvailabilityZonesCommand.ts rename to clients/client-rds/src/commands/DescribeCustomAvailabilityZonesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterBacktracksCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterBacktracksCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterBacktracksCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterBacktracksCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterEndpointsCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterEndpointsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterEndpointsCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterEndpointsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterParameterGroupsCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterParameterGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterParameterGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterParameterGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterParametersCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterParametersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterParametersCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterParametersCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterSnapshotAttributesCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterSnapshotAttributesCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterSnapshotAttributesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClusterSnapshotsCommand.ts b/clients/client-rds/src/commands/DescribeDBClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClusterSnapshotsCommand.ts rename to clients/client-rds/src/commands/DescribeDBClusterSnapshotsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBClustersCommand.ts b/clients/client-rds/src/commands/DescribeDBClustersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBClustersCommand.ts rename to clients/client-rds/src/commands/DescribeDBClustersCommand.ts diff --git a/clients/client-rds/commands/DescribeDBEngineVersionsCommand.ts b/clients/client-rds/src/commands/DescribeDBEngineVersionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBEngineVersionsCommand.ts rename to clients/client-rds/src/commands/DescribeDBEngineVersionsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBInstanceAutomatedBackupsCommand.ts b/clients/client-rds/src/commands/DescribeDBInstanceAutomatedBackupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBInstanceAutomatedBackupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBInstanceAutomatedBackupsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBInstancesCommand.ts b/clients/client-rds/src/commands/DescribeDBInstancesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBInstancesCommand.ts rename to clients/client-rds/src/commands/DescribeDBInstancesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBLogFilesCommand.ts b/clients/client-rds/src/commands/DescribeDBLogFilesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBLogFilesCommand.ts rename to clients/client-rds/src/commands/DescribeDBLogFilesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBParameterGroupsCommand.ts b/clients/client-rds/src/commands/DescribeDBParameterGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBParameterGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBParameterGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBParametersCommand.ts b/clients/client-rds/src/commands/DescribeDBParametersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBParametersCommand.ts rename to clients/client-rds/src/commands/DescribeDBParametersCommand.ts diff --git a/clients/client-rds/commands/DescribeDBProxiesCommand.ts b/clients/client-rds/src/commands/DescribeDBProxiesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBProxiesCommand.ts rename to clients/client-rds/src/commands/DescribeDBProxiesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBProxyEndpointsCommand.ts b/clients/client-rds/src/commands/DescribeDBProxyEndpointsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBProxyEndpointsCommand.ts rename to clients/client-rds/src/commands/DescribeDBProxyEndpointsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBProxyTargetGroupsCommand.ts b/clients/client-rds/src/commands/DescribeDBProxyTargetGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBProxyTargetGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBProxyTargetGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBProxyTargetsCommand.ts b/clients/client-rds/src/commands/DescribeDBProxyTargetsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBProxyTargetsCommand.ts rename to clients/client-rds/src/commands/DescribeDBProxyTargetsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBSecurityGroupsCommand.ts b/clients/client-rds/src/commands/DescribeDBSecurityGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBSecurityGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBSecurityGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBSnapshotAttributesCommand.ts b/clients/client-rds/src/commands/DescribeDBSnapshotAttributesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBSnapshotAttributesCommand.ts rename to clients/client-rds/src/commands/DescribeDBSnapshotAttributesCommand.ts diff --git a/clients/client-rds/commands/DescribeDBSnapshotsCommand.ts b/clients/client-rds/src/commands/DescribeDBSnapshotsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBSnapshotsCommand.ts rename to clients/client-rds/src/commands/DescribeDBSnapshotsCommand.ts diff --git a/clients/client-rds/commands/DescribeDBSubnetGroupsCommand.ts b/clients/client-rds/src/commands/DescribeDBSubnetGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeDBSubnetGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeDBSubnetGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeEngineDefaultClusterParametersCommand.ts b/clients/client-rds/src/commands/DescribeEngineDefaultClusterParametersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeEngineDefaultClusterParametersCommand.ts rename to clients/client-rds/src/commands/DescribeEngineDefaultClusterParametersCommand.ts diff --git a/clients/client-rds/commands/DescribeEngineDefaultParametersCommand.ts b/clients/client-rds/src/commands/DescribeEngineDefaultParametersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeEngineDefaultParametersCommand.ts rename to clients/client-rds/src/commands/DescribeEngineDefaultParametersCommand.ts diff --git a/clients/client-rds/commands/DescribeEventCategoriesCommand.ts b/clients/client-rds/src/commands/DescribeEventCategoriesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeEventCategoriesCommand.ts rename to clients/client-rds/src/commands/DescribeEventCategoriesCommand.ts diff --git a/clients/client-rds/commands/DescribeEventSubscriptionsCommand.ts b/clients/client-rds/src/commands/DescribeEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeEventSubscriptionsCommand.ts rename to clients/client-rds/src/commands/DescribeEventSubscriptionsCommand.ts diff --git a/clients/client-rds/commands/DescribeEventsCommand.ts b/clients/client-rds/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeEventsCommand.ts rename to clients/client-rds/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-rds/commands/DescribeExportTasksCommand.ts b/clients/client-rds/src/commands/DescribeExportTasksCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeExportTasksCommand.ts rename to clients/client-rds/src/commands/DescribeExportTasksCommand.ts diff --git a/clients/client-rds/commands/DescribeGlobalClustersCommand.ts b/clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeGlobalClustersCommand.ts rename to clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts diff --git a/clients/client-rds/commands/DescribeInstallationMediaCommand.ts b/clients/client-rds/src/commands/DescribeInstallationMediaCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeInstallationMediaCommand.ts rename to clients/client-rds/src/commands/DescribeInstallationMediaCommand.ts diff --git a/clients/client-rds/commands/DescribeOptionGroupOptionsCommand.ts b/clients/client-rds/src/commands/DescribeOptionGroupOptionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeOptionGroupOptionsCommand.ts rename to clients/client-rds/src/commands/DescribeOptionGroupOptionsCommand.ts diff --git a/clients/client-rds/commands/DescribeOptionGroupsCommand.ts b/clients/client-rds/src/commands/DescribeOptionGroupsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeOptionGroupsCommand.ts rename to clients/client-rds/src/commands/DescribeOptionGroupsCommand.ts diff --git a/clients/client-rds/commands/DescribeOrderableDBInstanceOptionsCommand.ts b/clients/client-rds/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeOrderableDBInstanceOptionsCommand.ts rename to clients/client-rds/src/commands/DescribeOrderableDBInstanceOptionsCommand.ts diff --git a/clients/client-rds/commands/DescribePendingMaintenanceActionsCommand.ts b/clients/client-rds/src/commands/DescribePendingMaintenanceActionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribePendingMaintenanceActionsCommand.ts rename to clients/client-rds/src/commands/DescribePendingMaintenanceActionsCommand.ts diff --git a/clients/client-rds/commands/DescribeReservedDBInstancesCommand.ts b/clients/client-rds/src/commands/DescribeReservedDBInstancesCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeReservedDBInstancesCommand.ts rename to clients/client-rds/src/commands/DescribeReservedDBInstancesCommand.ts diff --git a/clients/client-rds/commands/DescribeReservedDBInstancesOfferingsCommand.ts b/clients/client-rds/src/commands/DescribeReservedDBInstancesOfferingsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeReservedDBInstancesOfferingsCommand.ts rename to clients/client-rds/src/commands/DescribeReservedDBInstancesOfferingsCommand.ts diff --git a/clients/client-rds/commands/DescribeSourceRegionsCommand.ts b/clients/client-rds/src/commands/DescribeSourceRegionsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeSourceRegionsCommand.ts rename to clients/client-rds/src/commands/DescribeSourceRegionsCommand.ts diff --git a/clients/client-rds/commands/DescribeValidDBInstanceModificationsCommand.ts b/clients/client-rds/src/commands/DescribeValidDBInstanceModificationsCommand.ts similarity index 100% rename from clients/client-rds/commands/DescribeValidDBInstanceModificationsCommand.ts rename to clients/client-rds/src/commands/DescribeValidDBInstanceModificationsCommand.ts diff --git a/clients/client-rds/commands/DownloadDBLogFilePortionCommand.ts b/clients/client-rds/src/commands/DownloadDBLogFilePortionCommand.ts similarity index 100% rename from clients/client-rds/commands/DownloadDBLogFilePortionCommand.ts rename to clients/client-rds/src/commands/DownloadDBLogFilePortionCommand.ts diff --git a/clients/client-rds/commands/FailoverDBClusterCommand.ts b/clients/client-rds/src/commands/FailoverDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/FailoverDBClusterCommand.ts rename to clients/client-rds/src/commands/FailoverDBClusterCommand.ts diff --git a/clients/client-rds/commands/FailoverGlobalClusterCommand.ts b/clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/FailoverGlobalClusterCommand.ts rename to clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts diff --git a/clients/client-rds/commands/ImportInstallationMediaCommand.ts b/clients/client-rds/src/commands/ImportInstallationMediaCommand.ts similarity index 100% rename from clients/client-rds/commands/ImportInstallationMediaCommand.ts rename to clients/client-rds/src/commands/ImportInstallationMediaCommand.ts diff --git a/clients/client-rds/commands/ListTagsForResourceCommand.ts b/clients/client-rds/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-rds/commands/ListTagsForResourceCommand.ts rename to clients/client-rds/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-rds/commands/ModifyCertificatesCommand.ts b/clients/client-rds/src/commands/ModifyCertificatesCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyCertificatesCommand.ts rename to clients/client-rds/src/commands/ModifyCertificatesCommand.ts diff --git a/clients/client-rds/commands/ModifyCurrentDBClusterCapacityCommand.ts b/clients/client-rds/src/commands/ModifyCurrentDBClusterCapacityCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyCurrentDBClusterCapacityCommand.ts rename to clients/client-rds/src/commands/ModifyCurrentDBClusterCapacityCommand.ts diff --git a/clients/client-rds/commands/ModifyDBClusterCommand.ts b/clients/client-rds/src/commands/ModifyDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBClusterCommand.ts rename to clients/client-rds/src/commands/ModifyDBClusterCommand.ts diff --git a/clients/client-rds/commands/ModifyDBClusterEndpointCommand.ts b/clients/client-rds/src/commands/ModifyDBClusterEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBClusterEndpointCommand.ts rename to clients/client-rds/src/commands/ModifyDBClusterEndpointCommand.ts diff --git a/clients/client-rds/commands/ModifyDBClusterParameterGroupCommand.ts b/clients/client-rds/src/commands/ModifyDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBClusterParameterGroupCommand.ts rename to clients/client-rds/src/commands/ModifyDBClusterParameterGroupCommand.ts diff --git a/clients/client-rds/commands/ModifyDBClusterSnapshotAttributeCommand.ts b/clients/client-rds/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBClusterSnapshotAttributeCommand.ts rename to clients/client-rds/src/commands/ModifyDBClusterSnapshotAttributeCommand.ts diff --git a/clients/client-rds/commands/ModifyDBInstanceCommand.ts b/clients/client-rds/src/commands/ModifyDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBInstanceCommand.ts rename to clients/client-rds/src/commands/ModifyDBInstanceCommand.ts diff --git a/clients/client-rds/commands/ModifyDBParameterGroupCommand.ts b/clients/client-rds/src/commands/ModifyDBParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBParameterGroupCommand.ts rename to clients/client-rds/src/commands/ModifyDBParameterGroupCommand.ts diff --git a/clients/client-rds/commands/ModifyDBProxyCommand.ts b/clients/client-rds/src/commands/ModifyDBProxyCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBProxyCommand.ts rename to clients/client-rds/src/commands/ModifyDBProxyCommand.ts diff --git a/clients/client-rds/commands/ModifyDBProxyEndpointCommand.ts b/clients/client-rds/src/commands/ModifyDBProxyEndpointCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBProxyEndpointCommand.ts rename to clients/client-rds/src/commands/ModifyDBProxyEndpointCommand.ts diff --git a/clients/client-rds/commands/ModifyDBProxyTargetGroupCommand.ts b/clients/client-rds/src/commands/ModifyDBProxyTargetGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBProxyTargetGroupCommand.ts rename to clients/client-rds/src/commands/ModifyDBProxyTargetGroupCommand.ts diff --git a/clients/client-rds/commands/ModifyDBSnapshotAttributeCommand.ts b/clients/client-rds/src/commands/ModifyDBSnapshotAttributeCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBSnapshotAttributeCommand.ts rename to clients/client-rds/src/commands/ModifyDBSnapshotAttributeCommand.ts diff --git a/clients/client-rds/commands/ModifyDBSnapshotCommand.ts b/clients/client-rds/src/commands/ModifyDBSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBSnapshotCommand.ts rename to clients/client-rds/src/commands/ModifyDBSnapshotCommand.ts diff --git a/clients/client-rds/commands/ModifyDBSubnetGroupCommand.ts b/clients/client-rds/src/commands/ModifyDBSubnetGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyDBSubnetGroupCommand.ts rename to clients/client-rds/src/commands/ModifyDBSubnetGroupCommand.ts diff --git a/clients/client-rds/commands/ModifyEventSubscriptionCommand.ts b/clients/client-rds/src/commands/ModifyEventSubscriptionCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyEventSubscriptionCommand.ts rename to clients/client-rds/src/commands/ModifyEventSubscriptionCommand.ts diff --git a/clients/client-rds/commands/ModifyGlobalClusterCommand.ts b/clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyGlobalClusterCommand.ts rename to clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts diff --git a/clients/client-rds/commands/ModifyOptionGroupCommand.ts b/clients/client-rds/src/commands/ModifyOptionGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ModifyOptionGroupCommand.ts rename to clients/client-rds/src/commands/ModifyOptionGroupCommand.ts diff --git a/clients/client-rds/commands/PromoteReadReplicaCommand.ts b/clients/client-rds/src/commands/PromoteReadReplicaCommand.ts similarity index 100% rename from clients/client-rds/commands/PromoteReadReplicaCommand.ts rename to clients/client-rds/src/commands/PromoteReadReplicaCommand.ts diff --git a/clients/client-rds/commands/PromoteReadReplicaDBClusterCommand.ts b/clients/client-rds/src/commands/PromoteReadReplicaDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/PromoteReadReplicaDBClusterCommand.ts rename to clients/client-rds/src/commands/PromoteReadReplicaDBClusterCommand.ts diff --git a/clients/client-rds/commands/PurchaseReservedDBInstancesOfferingCommand.ts b/clients/client-rds/src/commands/PurchaseReservedDBInstancesOfferingCommand.ts similarity index 100% rename from clients/client-rds/commands/PurchaseReservedDBInstancesOfferingCommand.ts rename to clients/client-rds/src/commands/PurchaseReservedDBInstancesOfferingCommand.ts diff --git a/clients/client-rds/commands/RebootDBInstanceCommand.ts b/clients/client-rds/src/commands/RebootDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/RebootDBInstanceCommand.ts rename to clients/client-rds/src/commands/RebootDBInstanceCommand.ts diff --git a/clients/client-rds/commands/RegisterDBProxyTargetsCommand.ts b/clients/client-rds/src/commands/RegisterDBProxyTargetsCommand.ts similarity index 100% rename from clients/client-rds/commands/RegisterDBProxyTargetsCommand.ts rename to clients/client-rds/src/commands/RegisterDBProxyTargetsCommand.ts diff --git a/clients/client-rds/commands/RemoveFromGlobalClusterCommand.ts b/clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/RemoveFromGlobalClusterCommand.ts rename to clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts diff --git a/clients/client-rds/commands/RemoveRoleFromDBClusterCommand.ts b/clients/client-rds/src/commands/RemoveRoleFromDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/RemoveRoleFromDBClusterCommand.ts rename to clients/client-rds/src/commands/RemoveRoleFromDBClusterCommand.ts diff --git a/clients/client-rds/commands/RemoveRoleFromDBInstanceCommand.ts b/clients/client-rds/src/commands/RemoveRoleFromDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/RemoveRoleFromDBInstanceCommand.ts rename to clients/client-rds/src/commands/RemoveRoleFromDBInstanceCommand.ts diff --git a/clients/client-rds/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts b/clients/client-rds/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts similarity index 100% rename from clients/client-rds/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts rename to clients/client-rds/src/commands/RemoveSourceIdentifierFromSubscriptionCommand.ts diff --git a/clients/client-rds/commands/RemoveTagsFromResourceCommand.ts b/clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-rds/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-rds/commands/ResetDBClusterParameterGroupCommand.ts b/clients/client-rds/src/commands/ResetDBClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ResetDBClusterParameterGroupCommand.ts rename to clients/client-rds/src/commands/ResetDBClusterParameterGroupCommand.ts diff --git a/clients/client-rds/commands/ResetDBParameterGroupCommand.ts b/clients/client-rds/src/commands/ResetDBParameterGroupCommand.ts similarity index 100% rename from clients/client-rds/commands/ResetDBParameterGroupCommand.ts rename to clients/client-rds/src/commands/ResetDBParameterGroupCommand.ts diff --git a/clients/client-rds/commands/RestoreDBClusterFromS3Command.ts b/clients/client-rds/src/commands/RestoreDBClusterFromS3Command.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBClusterFromS3Command.ts rename to clients/client-rds/src/commands/RestoreDBClusterFromS3Command.ts diff --git a/clients/client-rds/commands/RestoreDBClusterFromSnapshotCommand.ts b/clients/client-rds/src/commands/RestoreDBClusterFromSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBClusterFromSnapshotCommand.ts rename to clients/client-rds/src/commands/RestoreDBClusterFromSnapshotCommand.ts diff --git a/clients/client-rds/commands/RestoreDBClusterToPointInTimeCommand.ts b/clients/client-rds/src/commands/RestoreDBClusterToPointInTimeCommand.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBClusterToPointInTimeCommand.ts rename to clients/client-rds/src/commands/RestoreDBClusterToPointInTimeCommand.ts diff --git a/clients/client-rds/commands/RestoreDBInstanceFromDBSnapshotCommand.ts b/clients/client-rds/src/commands/RestoreDBInstanceFromDBSnapshotCommand.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBInstanceFromDBSnapshotCommand.ts rename to clients/client-rds/src/commands/RestoreDBInstanceFromDBSnapshotCommand.ts diff --git a/clients/client-rds/commands/RestoreDBInstanceFromS3Command.ts b/clients/client-rds/src/commands/RestoreDBInstanceFromS3Command.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBInstanceFromS3Command.ts rename to clients/client-rds/src/commands/RestoreDBInstanceFromS3Command.ts diff --git a/clients/client-rds/commands/RestoreDBInstanceToPointInTimeCommand.ts b/clients/client-rds/src/commands/RestoreDBInstanceToPointInTimeCommand.ts similarity index 100% rename from clients/client-rds/commands/RestoreDBInstanceToPointInTimeCommand.ts rename to clients/client-rds/src/commands/RestoreDBInstanceToPointInTimeCommand.ts diff --git a/clients/client-rds/commands/RevokeDBSecurityGroupIngressCommand.ts b/clients/client-rds/src/commands/RevokeDBSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-rds/commands/RevokeDBSecurityGroupIngressCommand.ts rename to clients/client-rds/src/commands/RevokeDBSecurityGroupIngressCommand.ts diff --git a/clients/client-rds/commands/StartActivityStreamCommand.ts b/clients/client-rds/src/commands/StartActivityStreamCommand.ts similarity index 100% rename from clients/client-rds/commands/StartActivityStreamCommand.ts rename to clients/client-rds/src/commands/StartActivityStreamCommand.ts diff --git a/clients/client-rds/commands/StartDBClusterCommand.ts b/clients/client-rds/src/commands/StartDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/StartDBClusterCommand.ts rename to clients/client-rds/src/commands/StartDBClusterCommand.ts diff --git a/clients/client-rds/commands/StartDBInstanceAutomatedBackupsReplicationCommand.ts b/clients/client-rds/src/commands/StartDBInstanceAutomatedBackupsReplicationCommand.ts similarity index 100% rename from clients/client-rds/commands/StartDBInstanceAutomatedBackupsReplicationCommand.ts rename to clients/client-rds/src/commands/StartDBInstanceAutomatedBackupsReplicationCommand.ts diff --git a/clients/client-rds/commands/StartDBInstanceCommand.ts b/clients/client-rds/src/commands/StartDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/StartDBInstanceCommand.ts rename to clients/client-rds/src/commands/StartDBInstanceCommand.ts diff --git a/clients/client-rds/commands/StartExportTaskCommand.ts b/clients/client-rds/src/commands/StartExportTaskCommand.ts similarity index 100% rename from clients/client-rds/commands/StartExportTaskCommand.ts rename to clients/client-rds/src/commands/StartExportTaskCommand.ts diff --git a/clients/client-rds/commands/StopActivityStreamCommand.ts b/clients/client-rds/src/commands/StopActivityStreamCommand.ts similarity index 100% rename from clients/client-rds/commands/StopActivityStreamCommand.ts rename to clients/client-rds/src/commands/StopActivityStreamCommand.ts diff --git a/clients/client-rds/commands/StopDBClusterCommand.ts b/clients/client-rds/src/commands/StopDBClusterCommand.ts similarity index 100% rename from clients/client-rds/commands/StopDBClusterCommand.ts rename to clients/client-rds/src/commands/StopDBClusterCommand.ts diff --git a/clients/client-rds/commands/StopDBInstanceAutomatedBackupsReplicationCommand.ts b/clients/client-rds/src/commands/StopDBInstanceAutomatedBackupsReplicationCommand.ts similarity index 100% rename from clients/client-rds/commands/StopDBInstanceAutomatedBackupsReplicationCommand.ts rename to clients/client-rds/src/commands/StopDBInstanceAutomatedBackupsReplicationCommand.ts diff --git a/clients/client-rds/commands/StopDBInstanceCommand.ts b/clients/client-rds/src/commands/StopDBInstanceCommand.ts similarity index 100% rename from clients/client-rds/commands/StopDBInstanceCommand.ts rename to clients/client-rds/src/commands/StopDBInstanceCommand.ts diff --git a/clients/client-rds/endpoints.ts b/clients/client-rds/src/endpoints.ts similarity index 100% rename from clients/client-rds/endpoints.ts rename to clients/client-rds/src/endpoints.ts diff --git a/clients/client-rds/index.ts b/clients/client-rds/src/index.ts similarity index 100% rename from clients/client-rds/index.ts rename to clients/client-rds/src/index.ts diff --git a/clients/client-rds/models/index.ts b/clients/client-rds/src/models/index.ts similarity index 100% rename from clients/client-rds/models/index.ts rename to clients/client-rds/src/models/index.ts diff --git a/clients/client-rds/models/models_0.ts b/clients/client-rds/src/models/models_0.ts similarity index 100% rename from clients/client-rds/models/models_0.ts rename to clients/client-rds/src/models/models_0.ts diff --git a/clients/client-rds/models/models_1.ts b/clients/client-rds/src/models/models_1.ts similarity index 100% rename from clients/client-rds/models/models_1.ts rename to clients/client-rds/src/models/models_1.ts diff --git a/clients/client-rds/pagination/DescribeCertificatesPaginator.ts b/clients/client-rds/src/pagination/DescribeCertificatesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeCertificatesPaginator.ts rename to clients/client-rds/src/pagination/DescribeCertificatesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeCustomAvailabilityZonesPaginator.ts b/clients/client-rds/src/pagination/DescribeCustomAvailabilityZonesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeCustomAvailabilityZonesPaginator.ts rename to clients/client-rds/src/pagination/DescribeCustomAvailabilityZonesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClusterBacktracksPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClusterBacktracksPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClusterBacktracksPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClusterBacktracksPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClusterEndpointsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClusterEndpointsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClusterEndpointsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClusterEndpointsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClusterParameterGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClusterParameterGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClusterParameterGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClusterParametersPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClusterParametersPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClusterParametersPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClusterParametersPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClusterSnapshotsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClusterSnapshotsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClusterSnapshotsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClusterSnapshotsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBClustersPaginator.ts b/clients/client-rds/src/pagination/DescribeDBClustersPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBClustersPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBClustersPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBEngineVersionsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBEngineVersionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBEngineVersionsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBEngineVersionsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBInstanceAutomatedBackupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBInstancesPaginator.ts b/clients/client-rds/src/pagination/DescribeDBInstancesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBInstancesPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBInstancesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBLogFilesPaginator.ts b/clients/client-rds/src/pagination/DescribeDBLogFilesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBLogFilesPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBLogFilesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBParameterGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBParameterGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBParameterGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBParameterGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBParametersPaginator.ts b/clients/client-rds/src/pagination/DescribeDBParametersPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBParametersPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBParametersPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBProxiesPaginator.ts b/clients/client-rds/src/pagination/DescribeDBProxiesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBProxiesPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBProxiesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBProxyEndpointsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBProxyEndpointsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBProxyEndpointsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBProxyEndpointsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBProxyTargetGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBProxyTargetGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBProxyTargetGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBProxyTargetGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBProxyTargetsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBProxyTargetsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBProxyTargetsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBProxyTargetsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBSecurityGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBSecurityGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBSecurityGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBSnapshotsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBSnapshotsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBSnapshotsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBSnapshotsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeDBSubnetGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeDBSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeDBSubnetGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeDBSubnetGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeEngineDefaultParametersPaginator.ts b/clients/client-rds/src/pagination/DescribeEngineDefaultParametersPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeEngineDefaultParametersPaginator.ts rename to clients/client-rds/src/pagination/DescribeEngineDefaultParametersPaginator.ts diff --git a/clients/client-rds/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-rds/src/pagination/DescribeEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeEventSubscriptionsPaginator.ts rename to clients/client-rds/src/pagination/DescribeEventSubscriptionsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeEventsPaginator.ts b/clients/client-rds/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeEventsPaginator.ts rename to clients/client-rds/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeExportTasksPaginator.ts b/clients/client-rds/src/pagination/DescribeExportTasksPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeExportTasksPaginator.ts rename to clients/client-rds/src/pagination/DescribeExportTasksPaginator.ts diff --git a/clients/client-rds/pagination/DescribeGlobalClustersPaginator.ts b/clients/client-rds/src/pagination/DescribeGlobalClustersPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeGlobalClustersPaginator.ts rename to clients/client-rds/src/pagination/DescribeGlobalClustersPaginator.ts diff --git a/clients/client-rds/pagination/DescribeInstallationMediaPaginator.ts b/clients/client-rds/src/pagination/DescribeInstallationMediaPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeInstallationMediaPaginator.ts rename to clients/client-rds/src/pagination/DescribeInstallationMediaPaginator.ts diff --git a/clients/client-rds/pagination/DescribeOptionGroupOptionsPaginator.ts b/clients/client-rds/src/pagination/DescribeOptionGroupOptionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeOptionGroupOptionsPaginator.ts rename to clients/client-rds/src/pagination/DescribeOptionGroupOptionsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeOptionGroupsPaginator.ts b/clients/client-rds/src/pagination/DescribeOptionGroupsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeOptionGroupsPaginator.ts rename to clients/client-rds/src/pagination/DescribeOptionGroupsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts b/clients/client-rds/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts rename to clients/client-rds/src/pagination/DescribeOrderableDBInstanceOptionsPaginator.ts diff --git a/clients/client-rds/pagination/DescribePendingMaintenanceActionsPaginator.ts b/clients/client-rds/src/pagination/DescribePendingMaintenanceActionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribePendingMaintenanceActionsPaginator.ts rename to clients/client-rds/src/pagination/DescribePendingMaintenanceActionsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts b/clients/client-rds/src/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts rename to clients/client-rds/src/pagination/DescribeReservedDBInstancesOfferingsPaginator.ts diff --git a/clients/client-rds/pagination/DescribeReservedDBInstancesPaginator.ts b/clients/client-rds/src/pagination/DescribeReservedDBInstancesPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeReservedDBInstancesPaginator.ts rename to clients/client-rds/src/pagination/DescribeReservedDBInstancesPaginator.ts diff --git a/clients/client-rds/pagination/DescribeSourceRegionsPaginator.ts b/clients/client-rds/src/pagination/DescribeSourceRegionsPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DescribeSourceRegionsPaginator.ts rename to clients/client-rds/src/pagination/DescribeSourceRegionsPaginator.ts diff --git a/clients/client-rds/pagination/DownloadDBLogFilePortionPaginator.ts b/clients/client-rds/src/pagination/DownloadDBLogFilePortionPaginator.ts similarity index 100% rename from clients/client-rds/pagination/DownloadDBLogFilePortionPaginator.ts rename to clients/client-rds/src/pagination/DownloadDBLogFilePortionPaginator.ts diff --git a/clients/client-rds/pagination/Interfaces.ts b/clients/client-rds/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-rds/pagination/Interfaces.ts rename to clients/client-rds/src/pagination/Interfaces.ts diff --git a/clients/client-rds/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-rds/protocols/Aws_query.ts rename to clients/client-rds/src/protocols/Aws_query.ts diff --git a/clients/client-rds/src/runtimeConfig.browser.ts b/clients/client-rds/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..477df5cc6096 --- /dev/null +++ b/clients/client-rds/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RDSClientConfig } from "./RDSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RDSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rds/runtimeConfig.native.ts b/clients/client-rds/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-rds/runtimeConfig.native.ts rename to clients/client-rds/src/runtimeConfig.native.ts diff --git a/clients/client-rds/runtimeConfig.shared.ts b/clients/client-rds/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-rds/runtimeConfig.shared.ts rename to clients/client-rds/src/runtimeConfig.shared.ts diff --git a/clients/client-rds/src/runtimeConfig.ts b/clients/client-rds/src/runtimeConfig.ts new file mode 100644 index 000000000000..5f5ecaad4939 --- /dev/null +++ b/clients/client-rds/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RDSClientConfig } from "./RDSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RDSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rds/waiters/waitForDBClusterSnapshotAvailable.ts b/clients/client-rds/src/waiters/waitForDBClusterSnapshotAvailable.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBClusterSnapshotAvailable.ts rename to clients/client-rds/src/waiters/waitForDBClusterSnapshotAvailable.ts diff --git a/clients/client-rds/waiters/waitForDBClusterSnapshotDeleted.ts b/clients/client-rds/src/waiters/waitForDBClusterSnapshotDeleted.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBClusterSnapshotDeleted.ts rename to clients/client-rds/src/waiters/waitForDBClusterSnapshotDeleted.ts diff --git a/clients/client-rds/waiters/waitForDBInstanceAvailable.ts b/clients/client-rds/src/waiters/waitForDBInstanceAvailable.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBInstanceAvailable.ts rename to clients/client-rds/src/waiters/waitForDBInstanceAvailable.ts diff --git a/clients/client-rds/waiters/waitForDBInstanceDeleted.ts b/clients/client-rds/src/waiters/waitForDBInstanceDeleted.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBInstanceDeleted.ts rename to clients/client-rds/src/waiters/waitForDBInstanceDeleted.ts diff --git a/clients/client-rds/waiters/waitForDBSnapshotAvailable.ts b/clients/client-rds/src/waiters/waitForDBSnapshotAvailable.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBSnapshotAvailable.ts rename to clients/client-rds/src/waiters/waitForDBSnapshotAvailable.ts diff --git a/clients/client-rds/waiters/waitForDBSnapshotDeleted.ts b/clients/client-rds/src/waiters/waitForDBSnapshotDeleted.ts similarity index 100% rename from clients/client-rds/waiters/waitForDBSnapshotDeleted.ts rename to clients/client-rds/src/waiters/waitForDBSnapshotDeleted.ts diff --git a/clients/client-rds/tsconfig.es.json b/clients/client-rds/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-rds/tsconfig.es.json +++ b/clients/client-rds/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-rds/tsconfig.json b/clients/client-rds/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-rds/tsconfig.json +++ b/clients/client-rds/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-rds/tsconfig.types.json b/clients/client-rds/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-rds/tsconfig.types.json +++ b/clients/client-rds/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-redshift-data/.gitignore b/clients/client-redshift-data/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-redshift-data/.gitignore +++ b/clients/client-redshift-data/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-redshift-data/package.json b/clients/client-redshift-data/package.json index d5093af9c244..ff13f575b14d 100644 --- a/clients/client-redshift-data/package.json +++ b/clients/client-redshift-data/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-redshift-data", "repository": { "type": "git", diff --git a/clients/client-redshift-data/runtimeConfig.browser.ts b/clients/client-redshift-data/runtimeConfig.browser.ts deleted file mode 100644 index 7d288952ece0..000000000000 --- a/clients/client-redshift-data/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RedshiftDataClientConfig } from "./RedshiftDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-redshift-data/runtimeConfig.ts b/clients/client-redshift-data/runtimeConfig.ts deleted file mode 100644 index 4bb3b0ad74cf..000000000000 --- a/clients/client-redshift-data/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RedshiftDataClientConfig } from "./RedshiftDataClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-redshift-data/RedshiftData.ts b/clients/client-redshift-data/src/RedshiftData.ts similarity index 100% rename from clients/client-redshift-data/RedshiftData.ts rename to clients/client-redshift-data/src/RedshiftData.ts diff --git a/clients/client-redshift-data/RedshiftDataClient.ts b/clients/client-redshift-data/src/RedshiftDataClient.ts similarity index 100% rename from clients/client-redshift-data/RedshiftDataClient.ts rename to clients/client-redshift-data/src/RedshiftDataClient.ts diff --git a/clients/client-redshift-data/commands/BatchExecuteStatementCommand.ts b/clients/client-redshift-data/src/commands/BatchExecuteStatementCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/BatchExecuteStatementCommand.ts rename to clients/client-redshift-data/src/commands/BatchExecuteStatementCommand.ts diff --git a/clients/client-redshift-data/commands/CancelStatementCommand.ts b/clients/client-redshift-data/src/commands/CancelStatementCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/CancelStatementCommand.ts rename to clients/client-redshift-data/src/commands/CancelStatementCommand.ts diff --git a/clients/client-redshift-data/commands/DescribeStatementCommand.ts b/clients/client-redshift-data/src/commands/DescribeStatementCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/DescribeStatementCommand.ts rename to clients/client-redshift-data/src/commands/DescribeStatementCommand.ts diff --git a/clients/client-redshift-data/commands/DescribeTableCommand.ts b/clients/client-redshift-data/src/commands/DescribeTableCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/DescribeTableCommand.ts rename to clients/client-redshift-data/src/commands/DescribeTableCommand.ts diff --git a/clients/client-redshift-data/commands/ExecuteStatementCommand.ts b/clients/client-redshift-data/src/commands/ExecuteStatementCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/ExecuteStatementCommand.ts rename to clients/client-redshift-data/src/commands/ExecuteStatementCommand.ts diff --git a/clients/client-redshift-data/commands/GetStatementResultCommand.ts b/clients/client-redshift-data/src/commands/GetStatementResultCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/GetStatementResultCommand.ts rename to clients/client-redshift-data/src/commands/GetStatementResultCommand.ts diff --git a/clients/client-redshift-data/commands/ListDatabasesCommand.ts b/clients/client-redshift-data/src/commands/ListDatabasesCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/ListDatabasesCommand.ts rename to clients/client-redshift-data/src/commands/ListDatabasesCommand.ts diff --git a/clients/client-redshift-data/commands/ListSchemasCommand.ts b/clients/client-redshift-data/src/commands/ListSchemasCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/ListSchemasCommand.ts rename to clients/client-redshift-data/src/commands/ListSchemasCommand.ts diff --git a/clients/client-redshift-data/commands/ListStatementsCommand.ts b/clients/client-redshift-data/src/commands/ListStatementsCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/ListStatementsCommand.ts rename to clients/client-redshift-data/src/commands/ListStatementsCommand.ts diff --git a/clients/client-redshift-data/commands/ListTablesCommand.ts b/clients/client-redshift-data/src/commands/ListTablesCommand.ts similarity index 100% rename from clients/client-redshift-data/commands/ListTablesCommand.ts rename to clients/client-redshift-data/src/commands/ListTablesCommand.ts diff --git a/clients/client-redshift-data/endpoints.ts b/clients/client-redshift-data/src/endpoints.ts similarity index 100% rename from clients/client-redshift-data/endpoints.ts rename to clients/client-redshift-data/src/endpoints.ts diff --git a/clients/client-redshift-data/index.ts b/clients/client-redshift-data/src/index.ts similarity index 100% rename from clients/client-redshift-data/index.ts rename to clients/client-redshift-data/src/index.ts diff --git a/clients/client-redshift-data/models/index.ts b/clients/client-redshift-data/src/models/index.ts similarity index 100% rename from clients/client-redshift-data/models/index.ts rename to clients/client-redshift-data/src/models/index.ts diff --git a/clients/client-redshift-data/models/models_0.ts b/clients/client-redshift-data/src/models/models_0.ts similarity index 100% rename from clients/client-redshift-data/models/models_0.ts rename to clients/client-redshift-data/src/models/models_0.ts diff --git a/clients/client-redshift-data/pagination/DescribeTablePaginator.ts b/clients/client-redshift-data/src/pagination/DescribeTablePaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/DescribeTablePaginator.ts rename to clients/client-redshift-data/src/pagination/DescribeTablePaginator.ts diff --git a/clients/client-redshift-data/pagination/GetStatementResultPaginator.ts b/clients/client-redshift-data/src/pagination/GetStatementResultPaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/GetStatementResultPaginator.ts rename to clients/client-redshift-data/src/pagination/GetStatementResultPaginator.ts diff --git a/clients/client-redshift-data/pagination/Interfaces.ts b/clients/client-redshift-data/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-redshift-data/pagination/Interfaces.ts rename to clients/client-redshift-data/src/pagination/Interfaces.ts diff --git a/clients/client-redshift-data/pagination/ListDatabasesPaginator.ts b/clients/client-redshift-data/src/pagination/ListDatabasesPaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/ListDatabasesPaginator.ts rename to clients/client-redshift-data/src/pagination/ListDatabasesPaginator.ts diff --git a/clients/client-redshift-data/pagination/ListSchemasPaginator.ts b/clients/client-redshift-data/src/pagination/ListSchemasPaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/ListSchemasPaginator.ts rename to clients/client-redshift-data/src/pagination/ListSchemasPaginator.ts diff --git a/clients/client-redshift-data/pagination/ListStatementsPaginator.ts b/clients/client-redshift-data/src/pagination/ListStatementsPaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/ListStatementsPaginator.ts rename to clients/client-redshift-data/src/pagination/ListStatementsPaginator.ts diff --git a/clients/client-redshift-data/pagination/ListTablesPaginator.ts b/clients/client-redshift-data/src/pagination/ListTablesPaginator.ts similarity index 100% rename from clients/client-redshift-data/pagination/ListTablesPaginator.ts rename to clients/client-redshift-data/src/pagination/ListTablesPaginator.ts diff --git a/clients/client-redshift-data/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-redshift-data/protocols/Aws_json1_1.ts rename to clients/client-redshift-data/src/protocols/Aws_json1_1.ts diff --git a/clients/client-redshift-data/src/runtimeConfig.browser.ts b/clients/client-redshift-data/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..967ceac8cce8 --- /dev/null +++ b/clients/client-redshift-data/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RedshiftDataClientConfig } from "./RedshiftDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-redshift-data/runtimeConfig.native.ts b/clients/client-redshift-data/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-redshift-data/runtimeConfig.native.ts rename to clients/client-redshift-data/src/runtimeConfig.native.ts diff --git a/clients/client-redshift-data/runtimeConfig.shared.ts b/clients/client-redshift-data/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-redshift-data/runtimeConfig.shared.ts rename to clients/client-redshift-data/src/runtimeConfig.shared.ts diff --git a/clients/client-redshift-data/src/runtimeConfig.ts b/clients/client-redshift-data/src/runtimeConfig.ts new file mode 100644 index 000000000000..3bf4e8b949ec --- /dev/null +++ b/clients/client-redshift-data/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RedshiftDataClientConfig } from "./RedshiftDataClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-redshift-data/tsconfig.es.json b/clients/client-redshift-data/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-redshift-data/tsconfig.es.json +++ b/clients/client-redshift-data/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-redshift-data/tsconfig.json b/clients/client-redshift-data/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-redshift-data/tsconfig.json +++ b/clients/client-redshift-data/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-redshift-data/tsconfig.types.json b/clients/client-redshift-data/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-redshift-data/tsconfig.types.json +++ b/clients/client-redshift-data/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-redshift/.gitignore b/clients/client-redshift/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-redshift/.gitignore +++ b/clients/client-redshift/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-redshift/package.json b/clients/client-redshift/package.json index fe0faa714bf8..869a2943cc01 100644 --- a/clients/client-redshift/package.json +++ b/clients/client-redshift/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-redshift", "repository": { "type": "git", diff --git a/clients/client-redshift/runtimeConfig.browser.ts b/clients/client-redshift/runtimeConfig.browser.ts deleted file mode 100644 index 607c635e8886..000000000000 --- a/clients/client-redshift/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RedshiftClientConfig } from "./RedshiftClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RedshiftClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-redshift/runtimeConfig.ts b/clients/client-redshift/runtimeConfig.ts deleted file mode 100644 index c6e6b63d02b9..000000000000 --- a/clients/client-redshift/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RedshiftClientConfig } from "./RedshiftClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RedshiftClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-redshift/Redshift.ts b/clients/client-redshift/src/Redshift.ts similarity index 100% rename from clients/client-redshift/Redshift.ts rename to clients/client-redshift/src/Redshift.ts diff --git a/clients/client-redshift/RedshiftClient.ts b/clients/client-redshift/src/RedshiftClient.ts similarity index 100% rename from clients/client-redshift/RedshiftClient.ts rename to clients/client-redshift/src/RedshiftClient.ts diff --git a/clients/client-redshift/commands/AcceptReservedNodeExchangeCommand.ts b/clients/client-redshift/src/commands/AcceptReservedNodeExchangeCommand.ts similarity index 100% rename from clients/client-redshift/commands/AcceptReservedNodeExchangeCommand.ts rename to clients/client-redshift/src/commands/AcceptReservedNodeExchangeCommand.ts diff --git a/clients/client-redshift/commands/AddPartnerCommand.ts b/clients/client-redshift/src/commands/AddPartnerCommand.ts similarity index 100% rename from clients/client-redshift/commands/AddPartnerCommand.ts rename to clients/client-redshift/src/commands/AddPartnerCommand.ts diff --git a/clients/client-redshift/commands/AssociateDataShareConsumerCommand.ts b/clients/client-redshift/src/commands/AssociateDataShareConsumerCommand.ts similarity index 100% rename from clients/client-redshift/commands/AssociateDataShareConsumerCommand.ts rename to clients/client-redshift/src/commands/AssociateDataShareConsumerCommand.ts diff --git a/clients/client-redshift/commands/AuthorizeClusterSecurityGroupIngressCommand.ts b/clients/client-redshift/src/commands/AuthorizeClusterSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-redshift/commands/AuthorizeClusterSecurityGroupIngressCommand.ts rename to clients/client-redshift/src/commands/AuthorizeClusterSecurityGroupIngressCommand.ts diff --git a/clients/client-redshift/commands/AuthorizeDataShareCommand.ts b/clients/client-redshift/src/commands/AuthorizeDataShareCommand.ts similarity index 100% rename from clients/client-redshift/commands/AuthorizeDataShareCommand.ts rename to clients/client-redshift/src/commands/AuthorizeDataShareCommand.ts diff --git a/clients/client-redshift/commands/AuthorizeEndpointAccessCommand.ts b/clients/client-redshift/src/commands/AuthorizeEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/AuthorizeEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/AuthorizeEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/AuthorizeSnapshotAccessCommand.ts b/clients/client-redshift/src/commands/AuthorizeSnapshotAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/AuthorizeSnapshotAccessCommand.ts rename to clients/client-redshift/src/commands/AuthorizeSnapshotAccessCommand.ts diff --git a/clients/client-redshift/commands/BatchDeleteClusterSnapshotsCommand.ts b/clients/client-redshift/src/commands/BatchDeleteClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-redshift/commands/BatchDeleteClusterSnapshotsCommand.ts rename to clients/client-redshift/src/commands/BatchDeleteClusterSnapshotsCommand.ts diff --git a/clients/client-redshift/commands/BatchModifyClusterSnapshotsCommand.ts b/clients/client-redshift/src/commands/BatchModifyClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-redshift/commands/BatchModifyClusterSnapshotsCommand.ts rename to clients/client-redshift/src/commands/BatchModifyClusterSnapshotsCommand.ts diff --git a/clients/client-redshift/commands/CancelResizeCommand.ts b/clients/client-redshift/src/commands/CancelResizeCommand.ts similarity index 100% rename from clients/client-redshift/commands/CancelResizeCommand.ts rename to clients/client-redshift/src/commands/CancelResizeCommand.ts diff --git a/clients/client-redshift/commands/CopyClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/CopyClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/CopyClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/CopyClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/CreateAuthenticationProfileCommand.ts b/clients/client-redshift/src/commands/CreateAuthenticationProfileCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateAuthenticationProfileCommand.ts rename to clients/client-redshift/src/commands/CreateAuthenticationProfileCommand.ts diff --git a/clients/client-redshift/commands/CreateClusterCommand.ts b/clients/client-redshift/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateClusterCommand.ts rename to clients/client-redshift/src/commands/CreateClusterCommand.ts diff --git a/clients/client-redshift/commands/CreateClusterParameterGroupCommand.ts b/clients/client-redshift/src/commands/CreateClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateClusterParameterGroupCommand.ts rename to clients/client-redshift/src/commands/CreateClusterParameterGroupCommand.ts diff --git a/clients/client-redshift/commands/CreateClusterSecurityGroupCommand.ts b/clients/client-redshift/src/commands/CreateClusterSecurityGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateClusterSecurityGroupCommand.ts rename to clients/client-redshift/src/commands/CreateClusterSecurityGroupCommand.ts diff --git a/clients/client-redshift/commands/CreateClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/CreateClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/CreateClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/CreateClusterSubnetGroupCommand.ts b/clients/client-redshift/src/commands/CreateClusterSubnetGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateClusterSubnetGroupCommand.ts rename to clients/client-redshift/src/commands/CreateClusterSubnetGroupCommand.ts diff --git a/clients/client-redshift/commands/CreateEndpointAccessCommand.ts b/clients/client-redshift/src/commands/CreateEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/CreateEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/CreateEventSubscriptionCommand.ts b/clients/client-redshift/src/commands/CreateEventSubscriptionCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateEventSubscriptionCommand.ts rename to clients/client-redshift/src/commands/CreateEventSubscriptionCommand.ts diff --git a/clients/client-redshift/commands/CreateHsmClientCertificateCommand.ts b/clients/client-redshift/src/commands/CreateHsmClientCertificateCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateHsmClientCertificateCommand.ts rename to clients/client-redshift/src/commands/CreateHsmClientCertificateCommand.ts diff --git a/clients/client-redshift/commands/CreateHsmConfigurationCommand.ts b/clients/client-redshift/src/commands/CreateHsmConfigurationCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateHsmConfigurationCommand.ts rename to clients/client-redshift/src/commands/CreateHsmConfigurationCommand.ts diff --git a/clients/client-redshift/commands/CreateScheduledActionCommand.ts b/clients/client-redshift/src/commands/CreateScheduledActionCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateScheduledActionCommand.ts rename to clients/client-redshift/src/commands/CreateScheduledActionCommand.ts diff --git a/clients/client-redshift/commands/CreateSnapshotCopyGrantCommand.ts b/clients/client-redshift/src/commands/CreateSnapshotCopyGrantCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateSnapshotCopyGrantCommand.ts rename to clients/client-redshift/src/commands/CreateSnapshotCopyGrantCommand.ts diff --git a/clients/client-redshift/commands/CreateSnapshotScheduleCommand.ts b/clients/client-redshift/src/commands/CreateSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateSnapshotScheduleCommand.ts rename to clients/client-redshift/src/commands/CreateSnapshotScheduleCommand.ts diff --git a/clients/client-redshift/commands/CreateTagsCommand.ts b/clients/client-redshift/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateTagsCommand.ts rename to clients/client-redshift/src/commands/CreateTagsCommand.ts diff --git a/clients/client-redshift/commands/CreateUsageLimitCommand.ts b/clients/client-redshift/src/commands/CreateUsageLimitCommand.ts similarity index 100% rename from clients/client-redshift/commands/CreateUsageLimitCommand.ts rename to clients/client-redshift/src/commands/CreateUsageLimitCommand.ts diff --git a/clients/client-redshift/commands/DeauthorizeDataShareCommand.ts b/clients/client-redshift/src/commands/DeauthorizeDataShareCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeauthorizeDataShareCommand.ts rename to clients/client-redshift/src/commands/DeauthorizeDataShareCommand.ts diff --git a/clients/client-redshift/commands/DeleteAuthenticationProfileCommand.ts b/clients/client-redshift/src/commands/DeleteAuthenticationProfileCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteAuthenticationProfileCommand.ts rename to clients/client-redshift/src/commands/DeleteAuthenticationProfileCommand.ts diff --git a/clients/client-redshift/commands/DeleteClusterCommand.ts b/clients/client-redshift/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteClusterCommand.ts rename to clients/client-redshift/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-redshift/commands/DeleteClusterParameterGroupCommand.ts b/clients/client-redshift/src/commands/DeleteClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteClusterParameterGroupCommand.ts rename to clients/client-redshift/src/commands/DeleteClusterParameterGroupCommand.ts diff --git a/clients/client-redshift/commands/DeleteClusterSecurityGroupCommand.ts b/clients/client-redshift/src/commands/DeleteClusterSecurityGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteClusterSecurityGroupCommand.ts rename to clients/client-redshift/src/commands/DeleteClusterSecurityGroupCommand.ts diff --git a/clients/client-redshift/commands/DeleteClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/DeleteClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/DeleteClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/DeleteClusterSubnetGroupCommand.ts b/clients/client-redshift/src/commands/DeleteClusterSubnetGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteClusterSubnetGroupCommand.ts rename to clients/client-redshift/src/commands/DeleteClusterSubnetGroupCommand.ts diff --git a/clients/client-redshift/commands/DeleteEndpointAccessCommand.ts b/clients/client-redshift/src/commands/DeleteEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/DeleteEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/DeleteEventSubscriptionCommand.ts b/clients/client-redshift/src/commands/DeleteEventSubscriptionCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteEventSubscriptionCommand.ts rename to clients/client-redshift/src/commands/DeleteEventSubscriptionCommand.ts diff --git a/clients/client-redshift/commands/DeleteHsmClientCertificateCommand.ts b/clients/client-redshift/src/commands/DeleteHsmClientCertificateCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteHsmClientCertificateCommand.ts rename to clients/client-redshift/src/commands/DeleteHsmClientCertificateCommand.ts diff --git a/clients/client-redshift/commands/DeleteHsmConfigurationCommand.ts b/clients/client-redshift/src/commands/DeleteHsmConfigurationCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteHsmConfigurationCommand.ts rename to clients/client-redshift/src/commands/DeleteHsmConfigurationCommand.ts diff --git a/clients/client-redshift/commands/DeletePartnerCommand.ts b/clients/client-redshift/src/commands/DeletePartnerCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeletePartnerCommand.ts rename to clients/client-redshift/src/commands/DeletePartnerCommand.ts diff --git a/clients/client-redshift/commands/DeleteScheduledActionCommand.ts b/clients/client-redshift/src/commands/DeleteScheduledActionCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteScheduledActionCommand.ts rename to clients/client-redshift/src/commands/DeleteScheduledActionCommand.ts diff --git a/clients/client-redshift/commands/DeleteSnapshotCopyGrantCommand.ts b/clients/client-redshift/src/commands/DeleteSnapshotCopyGrantCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteSnapshotCopyGrantCommand.ts rename to clients/client-redshift/src/commands/DeleteSnapshotCopyGrantCommand.ts diff --git a/clients/client-redshift/commands/DeleteSnapshotScheduleCommand.ts b/clients/client-redshift/src/commands/DeleteSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteSnapshotScheduleCommand.ts rename to clients/client-redshift/src/commands/DeleteSnapshotScheduleCommand.ts diff --git a/clients/client-redshift/commands/DeleteTagsCommand.ts b/clients/client-redshift/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteTagsCommand.ts rename to clients/client-redshift/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-redshift/commands/DeleteUsageLimitCommand.ts b/clients/client-redshift/src/commands/DeleteUsageLimitCommand.ts similarity index 100% rename from clients/client-redshift/commands/DeleteUsageLimitCommand.ts rename to clients/client-redshift/src/commands/DeleteUsageLimitCommand.ts diff --git a/clients/client-redshift/commands/DescribeAccountAttributesCommand.ts b/clients/client-redshift/src/commands/DescribeAccountAttributesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeAccountAttributesCommand.ts rename to clients/client-redshift/src/commands/DescribeAccountAttributesCommand.ts diff --git a/clients/client-redshift/commands/DescribeAuthenticationProfilesCommand.ts b/clients/client-redshift/src/commands/DescribeAuthenticationProfilesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeAuthenticationProfilesCommand.ts rename to clients/client-redshift/src/commands/DescribeAuthenticationProfilesCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterDbRevisionsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterDbRevisionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterDbRevisionsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterDbRevisionsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterParameterGroupsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterParameterGroupsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterParameterGroupsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterParameterGroupsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterParametersCommand.ts b/clients/client-redshift/src/commands/DescribeClusterParametersCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterParametersCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterParametersCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterSecurityGroupsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterSecurityGroupsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterSecurityGroupsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterSecurityGroupsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterSnapshotsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterSnapshotsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterSnapshotsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterSnapshotsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterSubnetGroupsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterSubnetGroupsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterSubnetGroupsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterSubnetGroupsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterTracksCommand.ts b/clients/client-redshift/src/commands/DescribeClusterTracksCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterTracksCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterTracksCommand.ts diff --git a/clients/client-redshift/commands/DescribeClusterVersionsCommand.ts b/clients/client-redshift/src/commands/DescribeClusterVersionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClusterVersionsCommand.ts rename to clients/client-redshift/src/commands/DescribeClusterVersionsCommand.ts diff --git a/clients/client-redshift/commands/DescribeClustersCommand.ts b/clients/client-redshift/src/commands/DescribeClustersCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeClustersCommand.ts rename to clients/client-redshift/src/commands/DescribeClustersCommand.ts diff --git a/clients/client-redshift/commands/DescribeDataSharesCommand.ts b/clients/client-redshift/src/commands/DescribeDataSharesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeDataSharesCommand.ts rename to clients/client-redshift/src/commands/DescribeDataSharesCommand.ts diff --git a/clients/client-redshift/commands/DescribeDataSharesForConsumerCommand.ts b/clients/client-redshift/src/commands/DescribeDataSharesForConsumerCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeDataSharesForConsumerCommand.ts rename to clients/client-redshift/src/commands/DescribeDataSharesForConsumerCommand.ts diff --git a/clients/client-redshift/commands/DescribeDataSharesForProducerCommand.ts b/clients/client-redshift/src/commands/DescribeDataSharesForProducerCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeDataSharesForProducerCommand.ts rename to clients/client-redshift/src/commands/DescribeDataSharesForProducerCommand.ts diff --git a/clients/client-redshift/commands/DescribeDefaultClusterParametersCommand.ts b/clients/client-redshift/src/commands/DescribeDefaultClusterParametersCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeDefaultClusterParametersCommand.ts rename to clients/client-redshift/src/commands/DescribeDefaultClusterParametersCommand.ts diff --git a/clients/client-redshift/commands/DescribeEndpointAccessCommand.ts b/clients/client-redshift/src/commands/DescribeEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/DescribeEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/DescribeEndpointAuthorizationCommand.ts b/clients/client-redshift/src/commands/DescribeEndpointAuthorizationCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeEndpointAuthorizationCommand.ts rename to clients/client-redshift/src/commands/DescribeEndpointAuthorizationCommand.ts diff --git a/clients/client-redshift/commands/DescribeEventCategoriesCommand.ts b/clients/client-redshift/src/commands/DescribeEventCategoriesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeEventCategoriesCommand.ts rename to clients/client-redshift/src/commands/DescribeEventCategoriesCommand.ts diff --git a/clients/client-redshift/commands/DescribeEventSubscriptionsCommand.ts b/clients/client-redshift/src/commands/DescribeEventSubscriptionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeEventSubscriptionsCommand.ts rename to clients/client-redshift/src/commands/DescribeEventSubscriptionsCommand.ts diff --git a/clients/client-redshift/commands/DescribeEventsCommand.ts b/clients/client-redshift/src/commands/DescribeEventsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeEventsCommand.ts rename to clients/client-redshift/src/commands/DescribeEventsCommand.ts diff --git a/clients/client-redshift/commands/DescribeHsmClientCertificatesCommand.ts b/clients/client-redshift/src/commands/DescribeHsmClientCertificatesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeHsmClientCertificatesCommand.ts rename to clients/client-redshift/src/commands/DescribeHsmClientCertificatesCommand.ts diff --git a/clients/client-redshift/commands/DescribeHsmConfigurationsCommand.ts b/clients/client-redshift/src/commands/DescribeHsmConfigurationsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeHsmConfigurationsCommand.ts rename to clients/client-redshift/src/commands/DescribeHsmConfigurationsCommand.ts diff --git a/clients/client-redshift/commands/DescribeLoggingStatusCommand.ts b/clients/client-redshift/src/commands/DescribeLoggingStatusCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeLoggingStatusCommand.ts rename to clients/client-redshift/src/commands/DescribeLoggingStatusCommand.ts diff --git a/clients/client-redshift/commands/DescribeNodeConfigurationOptionsCommand.ts b/clients/client-redshift/src/commands/DescribeNodeConfigurationOptionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeNodeConfigurationOptionsCommand.ts rename to clients/client-redshift/src/commands/DescribeNodeConfigurationOptionsCommand.ts diff --git a/clients/client-redshift/commands/DescribeOrderableClusterOptionsCommand.ts b/clients/client-redshift/src/commands/DescribeOrderableClusterOptionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeOrderableClusterOptionsCommand.ts rename to clients/client-redshift/src/commands/DescribeOrderableClusterOptionsCommand.ts diff --git a/clients/client-redshift/commands/DescribePartnersCommand.ts b/clients/client-redshift/src/commands/DescribePartnersCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribePartnersCommand.ts rename to clients/client-redshift/src/commands/DescribePartnersCommand.ts diff --git a/clients/client-redshift/commands/DescribeReservedNodeOfferingsCommand.ts b/clients/client-redshift/src/commands/DescribeReservedNodeOfferingsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeReservedNodeOfferingsCommand.ts rename to clients/client-redshift/src/commands/DescribeReservedNodeOfferingsCommand.ts diff --git a/clients/client-redshift/commands/DescribeReservedNodesCommand.ts b/clients/client-redshift/src/commands/DescribeReservedNodesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeReservedNodesCommand.ts rename to clients/client-redshift/src/commands/DescribeReservedNodesCommand.ts diff --git a/clients/client-redshift/commands/DescribeResizeCommand.ts b/clients/client-redshift/src/commands/DescribeResizeCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeResizeCommand.ts rename to clients/client-redshift/src/commands/DescribeResizeCommand.ts diff --git a/clients/client-redshift/commands/DescribeScheduledActionsCommand.ts b/clients/client-redshift/src/commands/DescribeScheduledActionsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeScheduledActionsCommand.ts rename to clients/client-redshift/src/commands/DescribeScheduledActionsCommand.ts diff --git a/clients/client-redshift/commands/DescribeSnapshotCopyGrantsCommand.ts b/clients/client-redshift/src/commands/DescribeSnapshotCopyGrantsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeSnapshotCopyGrantsCommand.ts rename to clients/client-redshift/src/commands/DescribeSnapshotCopyGrantsCommand.ts diff --git a/clients/client-redshift/commands/DescribeSnapshotSchedulesCommand.ts b/clients/client-redshift/src/commands/DescribeSnapshotSchedulesCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeSnapshotSchedulesCommand.ts rename to clients/client-redshift/src/commands/DescribeSnapshotSchedulesCommand.ts diff --git a/clients/client-redshift/commands/DescribeStorageCommand.ts b/clients/client-redshift/src/commands/DescribeStorageCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeStorageCommand.ts rename to clients/client-redshift/src/commands/DescribeStorageCommand.ts diff --git a/clients/client-redshift/commands/DescribeTableRestoreStatusCommand.ts b/clients/client-redshift/src/commands/DescribeTableRestoreStatusCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeTableRestoreStatusCommand.ts rename to clients/client-redshift/src/commands/DescribeTableRestoreStatusCommand.ts diff --git a/clients/client-redshift/commands/DescribeTagsCommand.ts b/clients/client-redshift/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeTagsCommand.ts rename to clients/client-redshift/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-redshift/commands/DescribeUsageLimitsCommand.ts b/clients/client-redshift/src/commands/DescribeUsageLimitsCommand.ts similarity index 100% rename from clients/client-redshift/commands/DescribeUsageLimitsCommand.ts rename to clients/client-redshift/src/commands/DescribeUsageLimitsCommand.ts diff --git a/clients/client-redshift/commands/DisableLoggingCommand.ts b/clients/client-redshift/src/commands/DisableLoggingCommand.ts similarity index 100% rename from clients/client-redshift/commands/DisableLoggingCommand.ts rename to clients/client-redshift/src/commands/DisableLoggingCommand.ts diff --git a/clients/client-redshift/commands/DisableSnapshotCopyCommand.ts b/clients/client-redshift/src/commands/DisableSnapshotCopyCommand.ts similarity index 100% rename from clients/client-redshift/commands/DisableSnapshotCopyCommand.ts rename to clients/client-redshift/src/commands/DisableSnapshotCopyCommand.ts diff --git a/clients/client-redshift/commands/DisassociateDataShareConsumerCommand.ts b/clients/client-redshift/src/commands/DisassociateDataShareConsumerCommand.ts similarity index 100% rename from clients/client-redshift/commands/DisassociateDataShareConsumerCommand.ts rename to clients/client-redshift/src/commands/DisassociateDataShareConsumerCommand.ts diff --git a/clients/client-redshift/commands/EnableLoggingCommand.ts b/clients/client-redshift/src/commands/EnableLoggingCommand.ts similarity index 100% rename from clients/client-redshift/commands/EnableLoggingCommand.ts rename to clients/client-redshift/src/commands/EnableLoggingCommand.ts diff --git a/clients/client-redshift/commands/EnableSnapshotCopyCommand.ts b/clients/client-redshift/src/commands/EnableSnapshotCopyCommand.ts similarity index 100% rename from clients/client-redshift/commands/EnableSnapshotCopyCommand.ts rename to clients/client-redshift/src/commands/EnableSnapshotCopyCommand.ts diff --git a/clients/client-redshift/commands/GetClusterCredentialsCommand.ts b/clients/client-redshift/src/commands/GetClusterCredentialsCommand.ts similarity index 100% rename from clients/client-redshift/commands/GetClusterCredentialsCommand.ts rename to clients/client-redshift/src/commands/GetClusterCredentialsCommand.ts diff --git a/clients/client-redshift/commands/GetReservedNodeExchangeOfferingsCommand.ts b/clients/client-redshift/src/commands/GetReservedNodeExchangeOfferingsCommand.ts similarity index 100% rename from clients/client-redshift/commands/GetReservedNodeExchangeOfferingsCommand.ts rename to clients/client-redshift/src/commands/GetReservedNodeExchangeOfferingsCommand.ts diff --git a/clients/client-redshift/commands/ModifyAquaConfigurationCommand.ts b/clients/client-redshift/src/commands/ModifyAquaConfigurationCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyAquaConfigurationCommand.ts rename to clients/client-redshift/src/commands/ModifyAquaConfigurationCommand.ts diff --git a/clients/client-redshift/commands/ModifyAuthenticationProfileCommand.ts b/clients/client-redshift/src/commands/ModifyAuthenticationProfileCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyAuthenticationProfileCommand.ts rename to clients/client-redshift/src/commands/ModifyAuthenticationProfileCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterCommand.ts b/clients/client-redshift/src/commands/ModifyClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterDbRevisionCommand.ts b/clients/client-redshift/src/commands/ModifyClusterDbRevisionCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterDbRevisionCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterDbRevisionCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterIamRolesCommand.ts b/clients/client-redshift/src/commands/ModifyClusterIamRolesCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterIamRolesCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterIamRolesCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterMaintenanceCommand.ts b/clients/client-redshift/src/commands/ModifyClusterMaintenanceCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterMaintenanceCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterMaintenanceCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterParameterGroupCommand.ts b/clients/client-redshift/src/commands/ModifyClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterParameterGroupCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterParameterGroupCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/ModifyClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterSnapshotScheduleCommand.ts b/clients/client-redshift/src/commands/ModifyClusterSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterSnapshotScheduleCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterSnapshotScheduleCommand.ts diff --git a/clients/client-redshift/commands/ModifyClusterSubnetGroupCommand.ts b/clients/client-redshift/src/commands/ModifyClusterSubnetGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyClusterSubnetGroupCommand.ts rename to clients/client-redshift/src/commands/ModifyClusterSubnetGroupCommand.ts diff --git a/clients/client-redshift/commands/ModifyEndpointAccessCommand.ts b/clients/client-redshift/src/commands/ModifyEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/ModifyEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/ModifyEventSubscriptionCommand.ts b/clients/client-redshift/src/commands/ModifyEventSubscriptionCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyEventSubscriptionCommand.ts rename to clients/client-redshift/src/commands/ModifyEventSubscriptionCommand.ts diff --git a/clients/client-redshift/commands/ModifyScheduledActionCommand.ts b/clients/client-redshift/src/commands/ModifyScheduledActionCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyScheduledActionCommand.ts rename to clients/client-redshift/src/commands/ModifyScheduledActionCommand.ts diff --git a/clients/client-redshift/commands/ModifySnapshotCopyRetentionPeriodCommand.ts b/clients/client-redshift/src/commands/ModifySnapshotCopyRetentionPeriodCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifySnapshotCopyRetentionPeriodCommand.ts rename to clients/client-redshift/src/commands/ModifySnapshotCopyRetentionPeriodCommand.ts diff --git a/clients/client-redshift/commands/ModifySnapshotScheduleCommand.ts b/clients/client-redshift/src/commands/ModifySnapshotScheduleCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifySnapshotScheduleCommand.ts rename to clients/client-redshift/src/commands/ModifySnapshotScheduleCommand.ts diff --git a/clients/client-redshift/commands/ModifyUsageLimitCommand.ts b/clients/client-redshift/src/commands/ModifyUsageLimitCommand.ts similarity index 100% rename from clients/client-redshift/commands/ModifyUsageLimitCommand.ts rename to clients/client-redshift/src/commands/ModifyUsageLimitCommand.ts diff --git a/clients/client-redshift/commands/PauseClusterCommand.ts b/clients/client-redshift/src/commands/PauseClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/PauseClusterCommand.ts rename to clients/client-redshift/src/commands/PauseClusterCommand.ts diff --git a/clients/client-redshift/commands/PurchaseReservedNodeOfferingCommand.ts b/clients/client-redshift/src/commands/PurchaseReservedNodeOfferingCommand.ts similarity index 100% rename from clients/client-redshift/commands/PurchaseReservedNodeOfferingCommand.ts rename to clients/client-redshift/src/commands/PurchaseReservedNodeOfferingCommand.ts diff --git a/clients/client-redshift/commands/RebootClusterCommand.ts b/clients/client-redshift/src/commands/RebootClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/RebootClusterCommand.ts rename to clients/client-redshift/src/commands/RebootClusterCommand.ts diff --git a/clients/client-redshift/commands/RejectDataShareCommand.ts b/clients/client-redshift/src/commands/RejectDataShareCommand.ts similarity index 100% rename from clients/client-redshift/commands/RejectDataShareCommand.ts rename to clients/client-redshift/src/commands/RejectDataShareCommand.ts diff --git a/clients/client-redshift/commands/ResetClusterParameterGroupCommand.ts b/clients/client-redshift/src/commands/ResetClusterParameterGroupCommand.ts similarity index 100% rename from clients/client-redshift/commands/ResetClusterParameterGroupCommand.ts rename to clients/client-redshift/src/commands/ResetClusterParameterGroupCommand.ts diff --git a/clients/client-redshift/commands/ResizeClusterCommand.ts b/clients/client-redshift/src/commands/ResizeClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/ResizeClusterCommand.ts rename to clients/client-redshift/src/commands/ResizeClusterCommand.ts diff --git a/clients/client-redshift/commands/RestoreFromClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/RestoreFromClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/RestoreFromClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/RestoreFromClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/RestoreTableFromClusterSnapshotCommand.ts b/clients/client-redshift/src/commands/RestoreTableFromClusterSnapshotCommand.ts similarity index 100% rename from clients/client-redshift/commands/RestoreTableFromClusterSnapshotCommand.ts rename to clients/client-redshift/src/commands/RestoreTableFromClusterSnapshotCommand.ts diff --git a/clients/client-redshift/commands/ResumeClusterCommand.ts b/clients/client-redshift/src/commands/ResumeClusterCommand.ts similarity index 100% rename from clients/client-redshift/commands/ResumeClusterCommand.ts rename to clients/client-redshift/src/commands/ResumeClusterCommand.ts diff --git a/clients/client-redshift/commands/RevokeClusterSecurityGroupIngressCommand.ts b/clients/client-redshift/src/commands/RevokeClusterSecurityGroupIngressCommand.ts similarity index 100% rename from clients/client-redshift/commands/RevokeClusterSecurityGroupIngressCommand.ts rename to clients/client-redshift/src/commands/RevokeClusterSecurityGroupIngressCommand.ts diff --git a/clients/client-redshift/commands/RevokeEndpointAccessCommand.ts b/clients/client-redshift/src/commands/RevokeEndpointAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/RevokeEndpointAccessCommand.ts rename to clients/client-redshift/src/commands/RevokeEndpointAccessCommand.ts diff --git a/clients/client-redshift/commands/RevokeSnapshotAccessCommand.ts b/clients/client-redshift/src/commands/RevokeSnapshotAccessCommand.ts similarity index 100% rename from clients/client-redshift/commands/RevokeSnapshotAccessCommand.ts rename to clients/client-redshift/src/commands/RevokeSnapshotAccessCommand.ts diff --git a/clients/client-redshift/commands/RotateEncryptionKeyCommand.ts b/clients/client-redshift/src/commands/RotateEncryptionKeyCommand.ts similarity index 100% rename from clients/client-redshift/commands/RotateEncryptionKeyCommand.ts rename to clients/client-redshift/src/commands/RotateEncryptionKeyCommand.ts diff --git a/clients/client-redshift/commands/UpdatePartnerStatusCommand.ts b/clients/client-redshift/src/commands/UpdatePartnerStatusCommand.ts similarity index 100% rename from clients/client-redshift/commands/UpdatePartnerStatusCommand.ts rename to clients/client-redshift/src/commands/UpdatePartnerStatusCommand.ts diff --git a/clients/client-redshift/endpoints.ts b/clients/client-redshift/src/endpoints.ts similarity index 100% rename from clients/client-redshift/endpoints.ts rename to clients/client-redshift/src/endpoints.ts diff --git a/clients/client-redshift/index.ts b/clients/client-redshift/src/index.ts similarity index 100% rename from clients/client-redshift/index.ts rename to clients/client-redshift/src/index.ts diff --git a/clients/client-redshift/models/index.ts b/clients/client-redshift/src/models/index.ts similarity index 100% rename from clients/client-redshift/models/index.ts rename to clients/client-redshift/src/models/index.ts diff --git a/clients/client-redshift/models/models_0.ts b/clients/client-redshift/src/models/models_0.ts similarity index 100% rename from clients/client-redshift/models/models_0.ts rename to clients/client-redshift/src/models/models_0.ts diff --git a/clients/client-redshift/models/models_1.ts b/clients/client-redshift/src/models/models_1.ts similarity index 100% rename from clients/client-redshift/models/models_1.ts rename to clients/client-redshift/src/models/models_1.ts diff --git a/clients/client-redshift/pagination/DescribeClusterDbRevisionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterDbRevisionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterDbRevisionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterDbRevisionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterParameterGroupsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterParameterGroupsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterParameterGroupsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterParameterGroupsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterParametersPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterParametersPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterParametersPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterParametersPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterSecurityGroupsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterSecurityGroupsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterSecurityGroupsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterSecurityGroupsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterSnapshotsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterSnapshotsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterSnapshotsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterSnapshotsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterSubnetGroupsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterSubnetGroupsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterSubnetGroupsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterSubnetGroupsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterTracksPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterTracksPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterTracksPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterTracksPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClusterVersionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeClusterVersionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClusterVersionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClusterVersionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeClustersPaginator.ts b/clients/client-redshift/src/pagination/DescribeClustersPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeClustersPaginator.ts rename to clients/client-redshift/src/pagination/DescribeClustersPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeDefaultClusterParametersPaginator.ts b/clients/client-redshift/src/pagination/DescribeDefaultClusterParametersPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeDefaultClusterParametersPaginator.ts rename to clients/client-redshift/src/pagination/DescribeDefaultClusterParametersPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeEndpointAccessPaginator.ts b/clients/client-redshift/src/pagination/DescribeEndpointAccessPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeEndpointAccessPaginator.ts rename to clients/client-redshift/src/pagination/DescribeEndpointAccessPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeEndpointAuthorizationPaginator.ts b/clients/client-redshift/src/pagination/DescribeEndpointAuthorizationPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeEndpointAuthorizationPaginator.ts rename to clients/client-redshift/src/pagination/DescribeEndpointAuthorizationPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeEventSubscriptionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeEventSubscriptionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeEventSubscriptionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeEventSubscriptionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeEventsPaginator.ts b/clients/client-redshift/src/pagination/DescribeEventsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeEventsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeEventsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeHsmClientCertificatesPaginator.ts b/clients/client-redshift/src/pagination/DescribeHsmClientCertificatesPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeHsmClientCertificatesPaginator.ts rename to clients/client-redshift/src/pagination/DescribeHsmClientCertificatesPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeHsmConfigurationsPaginator.ts b/clients/client-redshift/src/pagination/DescribeHsmConfigurationsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeHsmConfigurationsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeHsmConfigurationsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeNodeConfigurationOptionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeNodeConfigurationOptionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeNodeConfigurationOptionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeNodeConfigurationOptionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeOrderableClusterOptionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeOrderableClusterOptionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeOrderableClusterOptionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeOrderableClusterOptionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeReservedNodeOfferingsPaginator.ts b/clients/client-redshift/src/pagination/DescribeReservedNodeOfferingsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeReservedNodeOfferingsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeReservedNodeOfferingsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeReservedNodesPaginator.ts b/clients/client-redshift/src/pagination/DescribeReservedNodesPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeReservedNodesPaginator.ts rename to clients/client-redshift/src/pagination/DescribeReservedNodesPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeScheduledActionsPaginator.ts b/clients/client-redshift/src/pagination/DescribeScheduledActionsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeScheduledActionsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeScheduledActionsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeSnapshotCopyGrantsPaginator.ts b/clients/client-redshift/src/pagination/DescribeSnapshotCopyGrantsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeSnapshotCopyGrantsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeSnapshotCopyGrantsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeSnapshotSchedulesPaginator.ts b/clients/client-redshift/src/pagination/DescribeSnapshotSchedulesPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeSnapshotSchedulesPaginator.ts rename to clients/client-redshift/src/pagination/DescribeSnapshotSchedulesPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeTableRestoreStatusPaginator.ts b/clients/client-redshift/src/pagination/DescribeTableRestoreStatusPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeTableRestoreStatusPaginator.ts rename to clients/client-redshift/src/pagination/DescribeTableRestoreStatusPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeTagsPaginator.ts b/clients/client-redshift/src/pagination/DescribeTagsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeTagsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeTagsPaginator.ts diff --git a/clients/client-redshift/pagination/DescribeUsageLimitsPaginator.ts b/clients/client-redshift/src/pagination/DescribeUsageLimitsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/DescribeUsageLimitsPaginator.ts rename to clients/client-redshift/src/pagination/DescribeUsageLimitsPaginator.ts diff --git a/clients/client-redshift/pagination/GetReservedNodeExchangeOfferingsPaginator.ts b/clients/client-redshift/src/pagination/GetReservedNodeExchangeOfferingsPaginator.ts similarity index 100% rename from clients/client-redshift/pagination/GetReservedNodeExchangeOfferingsPaginator.ts rename to clients/client-redshift/src/pagination/GetReservedNodeExchangeOfferingsPaginator.ts diff --git a/clients/client-redshift/pagination/Interfaces.ts b/clients/client-redshift/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-redshift/pagination/Interfaces.ts rename to clients/client-redshift/src/pagination/Interfaces.ts diff --git a/clients/client-redshift/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-redshift/protocols/Aws_query.ts rename to clients/client-redshift/src/protocols/Aws_query.ts diff --git a/clients/client-redshift/src/runtimeConfig.browser.ts b/clients/client-redshift/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..921812d7bf09 --- /dev/null +++ b/clients/client-redshift/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RedshiftClientConfig } from "./RedshiftClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RedshiftClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-redshift/runtimeConfig.native.ts b/clients/client-redshift/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-redshift/runtimeConfig.native.ts rename to clients/client-redshift/src/runtimeConfig.native.ts diff --git a/clients/client-redshift/runtimeConfig.shared.ts b/clients/client-redshift/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-redshift/runtimeConfig.shared.ts rename to clients/client-redshift/src/runtimeConfig.shared.ts diff --git a/clients/client-redshift/src/runtimeConfig.ts b/clients/client-redshift/src/runtimeConfig.ts new file mode 100644 index 000000000000..5a25ecb40838 --- /dev/null +++ b/clients/client-redshift/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RedshiftClientConfig } from "./RedshiftClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RedshiftClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-redshift/waiters/waitForClusterAvailable.ts b/clients/client-redshift/src/waiters/waitForClusterAvailable.ts similarity index 100% rename from clients/client-redshift/waiters/waitForClusterAvailable.ts rename to clients/client-redshift/src/waiters/waitForClusterAvailable.ts diff --git a/clients/client-redshift/waiters/waitForClusterDeleted.ts b/clients/client-redshift/src/waiters/waitForClusterDeleted.ts similarity index 100% rename from clients/client-redshift/waiters/waitForClusterDeleted.ts rename to clients/client-redshift/src/waiters/waitForClusterDeleted.ts diff --git a/clients/client-redshift/waiters/waitForClusterRestored.ts b/clients/client-redshift/src/waiters/waitForClusterRestored.ts similarity index 100% rename from clients/client-redshift/waiters/waitForClusterRestored.ts rename to clients/client-redshift/src/waiters/waitForClusterRestored.ts diff --git a/clients/client-redshift/waiters/waitForSnapshotAvailable.ts b/clients/client-redshift/src/waiters/waitForSnapshotAvailable.ts similarity index 100% rename from clients/client-redshift/waiters/waitForSnapshotAvailable.ts rename to clients/client-redshift/src/waiters/waitForSnapshotAvailable.ts diff --git a/clients/client-redshift/tsconfig.es.json b/clients/client-redshift/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-redshift/tsconfig.es.json +++ b/clients/client-redshift/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-redshift/tsconfig.json b/clients/client-redshift/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-redshift/tsconfig.json +++ b/clients/client-redshift/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-redshift/tsconfig.types.json b/clients/client-redshift/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-redshift/tsconfig.types.json +++ b/clients/client-redshift/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-rekognition/.gitignore b/clients/client-rekognition/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-rekognition/.gitignore +++ b/clients/client-rekognition/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-rekognition/package.json b/clients/client-rekognition/package.json index 1581f3f99c6e..7853d67f61bb 100644 --- a/clients/client-rekognition/package.json +++ b/clients/client-rekognition/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-rekognition", "repository": { "type": "git", diff --git a/clients/client-rekognition/runtimeConfig.browser.ts b/clients/client-rekognition/runtimeConfig.browser.ts deleted file mode 100644 index 6426b190def5..000000000000 --- a/clients/client-rekognition/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RekognitionClientConfig } from "./RekognitionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RekognitionClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rekognition/runtimeConfig.ts b/clients/client-rekognition/runtimeConfig.ts deleted file mode 100644 index dd5573862aa7..000000000000 --- a/clients/client-rekognition/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RekognitionClientConfig } from "./RekognitionClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RekognitionClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-rekognition/Rekognition.ts b/clients/client-rekognition/src/Rekognition.ts similarity index 100% rename from clients/client-rekognition/Rekognition.ts rename to clients/client-rekognition/src/Rekognition.ts diff --git a/clients/client-rekognition/RekognitionClient.ts b/clients/client-rekognition/src/RekognitionClient.ts similarity index 100% rename from clients/client-rekognition/RekognitionClient.ts rename to clients/client-rekognition/src/RekognitionClient.ts diff --git a/clients/client-rekognition/commands/CompareFacesCommand.ts b/clients/client-rekognition/src/commands/CompareFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/CompareFacesCommand.ts rename to clients/client-rekognition/src/commands/CompareFacesCommand.ts diff --git a/clients/client-rekognition/commands/CreateCollectionCommand.ts b/clients/client-rekognition/src/commands/CreateCollectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/CreateCollectionCommand.ts rename to clients/client-rekognition/src/commands/CreateCollectionCommand.ts diff --git a/clients/client-rekognition/commands/CreateProjectCommand.ts b/clients/client-rekognition/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-rekognition/commands/CreateProjectCommand.ts rename to clients/client-rekognition/src/commands/CreateProjectCommand.ts diff --git a/clients/client-rekognition/commands/CreateProjectVersionCommand.ts b/clients/client-rekognition/src/commands/CreateProjectVersionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/CreateProjectVersionCommand.ts rename to clients/client-rekognition/src/commands/CreateProjectVersionCommand.ts diff --git a/clients/client-rekognition/commands/CreateStreamProcessorCommand.ts b/clients/client-rekognition/src/commands/CreateStreamProcessorCommand.ts similarity index 100% rename from clients/client-rekognition/commands/CreateStreamProcessorCommand.ts rename to clients/client-rekognition/src/commands/CreateStreamProcessorCommand.ts diff --git a/clients/client-rekognition/commands/DeleteCollectionCommand.ts b/clients/client-rekognition/src/commands/DeleteCollectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DeleteCollectionCommand.ts rename to clients/client-rekognition/src/commands/DeleteCollectionCommand.ts diff --git a/clients/client-rekognition/commands/DeleteFacesCommand.ts b/clients/client-rekognition/src/commands/DeleteFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DeleteFacesCommand.ts rename to clients/client-rekognition/src/commands/DeleteFacesCommand.ts diff --git a/clients/client-rekognition/commands/DeleteProjectCommand.ts b/clients/client-rekognition/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DeleteProjectCommand.ts rename to clients/client-rekognition/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-rekognition/commands/DeleteProjectVersionCommand.ts b/clients/client-rekognition/src/commands/DeleteProjectVersionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DeleteProjectVersionCommand.ts rename to clients/client-rekognition/src/commands/DeleteProjectVersionCommand.ts diff --git a/clients/client-rekognition/commands/DeleteStreamProcessorCommand.ts b/clients/client-rekognition/src/commands/DeleteStreamProcessorCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DeleteStreamProcessorCommand.ts rename to clients/client-rekognition/src/commands/DeleteStreamProcessorCommand.ts diff --git a/clients/client-rekognition/commands/DescribeCollectionCommand.ts b/clients/client-rekognition/src/commands/DescribeCollectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DescribeCollectionCommand.ts rename to clients/client-rekognition/src/commands/DescribeCollectionCommand.ts diff --git a/clients/client-rekognition/commands/DescribeProjectVersionsCommand.ts b/clients/client-rekognition/src/commands/DescribeProjectVersionsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DescribeProjectVersionsCommand.ts rename to clients/client-rekognition/src/commands/DescribeProjectVersionsCommand.ts diff --git a/clients/client-rekognition/commands/DescribeProjectsCommand.ts b/clients/client-rekognition/src/commands/DescribeProjectsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DescribeProjectsCommand.ts rename to clients/client-rekognition/src/commands/DescribeProjectsCommand.ts diff --git a/clients/client-rekognition/commands/DescribeStreamProcessorCommand.ts b/clients/client-rekognition/src/commands/DescribeStreamProcessorCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DescribeStreamProcessorCommand.ts rename to clients/client-rekognition/src/commands/DescribeStreamProcessorCommand.ts diff --git a/clients/client-rekognition/commands/DetectCustomLabelsCommand.ts b/clients/client-rekognition/src/commands/DetectCustomLabelsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectCustomLabelsCommand.ts rename to clients/client-rekognition/src/commands/DetectCustomLabelsCommand.ts diff --git a/clients/client-rekognition/commands/DetectFacesCommand.ts b/clients/client-rekognition/src/commands/DetectFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectFacesCommand.ts rename to clients/client-rekognition/src/commands/DetectFacesCommand.ts diff --git a/clients/client-rekognition/commands/DetectLabelsCommand.ts b/clients/client-rekognition/src/commands/DetectLabelsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectLabelsCommand.ts rename to clients/client-rekognition/src/commands/DetectLabelsCommand.ts diff --git a/clients/client-rekognition/commands/DetectModerationLabelsCommand.ts b/clients/client-rekognition/src/commands/DetectModerationLabelsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectModerationLabelsCommand.ts rename to clients/client-rekognition/src/commands/DetectModerationLabelsCommand.ts diff --git a/clients/client-rekognition/commands/DetectProtectiveEquipmentCommand.ts b/clients/client-rekognition/src/commands/DetectProtectiveEquipmentCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectProtectiveEquipmentCommand.ts rename to clients/client-rekognition/src/commands/DetectProtectiveEquipmentCommand.ts diff --git a/clients/client-rekognition/commands/DetectTextCommand.ts b/clients/client-rekognition/src/commands/DetectTextCommand.ts similarity index 100% rename from clients/client-rekognition/commands/DetectTextCommand.ts rename to clients/client-rekognition/src/commands/DetectTextCommand.ts diff --git a/clients/client-rekognition/commands/GetCelebrityInfoCommand.ts b/clients/client-rekognition/src/commands/GetCelebrityInfoCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetCelebrityInfoCommand.ts rename to clients/client-rekognition/src/commands/GetCelebrityInfoCommand.ts diff --git a/clients/client-rekognition/commands/GetCelebrityRecognitionCommand.ts b/clients/client-rekognition/src/commands/GetCelebrityRecognitionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetCelebrityRecognitionCommand.ts rename to clients/client-rekognition/src/commands/GetCelebrityRecognitionCommand.ts diff --git a/clients/client-rekognition/commands/GetContentModerationCommand.ts b/clients/client-rekognition/src/commands/GetContentModerationCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetContentModerationCommand.ts rename to clients/client-rekognition/src/commands/GetContentModerationCommand.ts diff --git a/clients/client-rekognition/commands/GetFaceDetectionCommand.ts b/clients/client-rekognition/src/commands/GetFaceDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetFaceDetectionCommand.ts rename to clients/client-rekognition/src/commands/GetFaceDetectionCommand.ts diff --git a/clients/client-rekognition/commands/GetFaceSearchCommand.ts b/clients/client-rekognition/src/commands/GetFaceSearchCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetFaceSearchCommand.ts rename to clients/client-rekognition/src/commands/GetFaceSearchCommand.ts diff --git a/clients/client-rekognition/commands/GetLabelDetectionCommand.ts b/clients/client-rekognition/src/commands/GetLabelDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetLabelDetectionCommand.ts rename to clients/client-rekognition/src/commands/GetLabelDetectionCommand.ts diff --git a/clients/client-rekognition/commands/GetPersonTrackingCommand.ts b/clients/client-rekognition/src/commands/GetPersonTrackingCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetPersonTrackingCommand.ts rename to clients/client-rekognition/src/commands/GetPersonTrackingCommand.ts diff --git a/clients/client-rekognition/commands/GetSegmentDetectionCommand.ts b/clients/client-rekognition/src/commands/GetSegmentDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetSegmentDetectionCommand.ts rename to clients/client-rekognition/src/commands/GetSegmentDetectionCommand.ts diff --git a/clients/client-rekognition/commands/GetTextDetectionCommand.ts b/clients/client-rekognition/src/commands/GetTextDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/GetTextDetectionCommand.ts rename to clients/client-rekognition/src/commands/GetTextDetectionCommand.ts diff --git a/clients/client-rekognition/commands/IndexFacesCommand.ts b/clients/client-rekognition/src/commands/IndexFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/IndexFacesCommand.ts rename to clients/client-rekognition/src/commands/IndexFacesCommand.ts diff --git a/clients/client-rekognition/commands/ListCollectionsCommand.ts b/clients/client-rekognition/src/commands/ListCollectionsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/ListCollectionsCommand.ts rename to clients/client-rekognition/src/commands/ListCollectionsCommand.ts diff --git a/clients/client-rekognition/commands/ListFacesCommand.ts b/clients/client-rekognition/src/commands/ListFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/ListFacesCommand.ts rename to clients/client-rekognition/src/commands/ListFacesCommand.ts diff --git a/clients/client-rekognition/commands/ListStreamProcessorsCommand.ts b/clients/client-rekognition/src/commands/ListStreamProcessorsCommand.ts similarity index 100% rename from clients/client-rekognition/commands/ListStreamProcessorsCommand.ts rename to clients/client-rekognition/src/commands/ListStreamProcessorsCommand.ts diff --git a/clients/client-rekognition/commands/ListTagsForResourceCommand.ts b/clients/client-rekognition/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-rekognition/commands/ListTagsForResourceCommand.ts rename to clients/client-rekognition/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-rekognition/commands/RecognizeCelebritiesCommand.ts b/clients/client-rekognition/src/commands/RecognizeCelebritiesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/RecognizeCelebritiesCommand.ts rename to clients/client-rekognition/src/commands/RecognizeCelebritiesCommand.ts diff --git a/clients/client-rekognition/commands/SearchFacesByImageCommand.ts b/clients/client-rekognition/src/commands/SearchFacesByImageCommand.ts similarity index 100% rename from clients/client-rekognition/commands/SearchFacesByImageCommand.ts rename to clients/client-rekognition/src/commands/SearchFacesByImageCommand.ts diff --git a/clients/client-rekognition/commands/SearchFacesCommand.ts b/clients/client-rekognition/src/commands/SearchFacesCommand.ts similarity index 100% rename from clients/client-rekognition/commands/SearchFacesCommand.ts rename to clients/client-rekognition/src/commands/SearchFacesCommand.ts diff --git a/clients/client-rekognition/commands/StartCelebrityRecognitionCommand.ts b/clients/client-rekognition/src/commands/StartCelebrityRecognitionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartCelebrityRecognitionCommand.ts rename to clients/client-rekognition/src/commands/StartCelebrityRecognitionCommand.ts diff --git a/clients/client-rekognition/commands/StartContentModerationCommand.ts b/clients/client-rekognition/src/commands/StartContentModerationCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartContentModerationCommand.ts rename to clients/client-rekognition/src/commands/StartContentModerationCommand.ts diff --git a/clients/client-rekognition/commands/StartFaceDetectionCommand.ts b/clients/client-rekognition/src/commands/StartFaceDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartFaceDetectionCommand.ts rename to clients/client-rekognition/src/commands/StartFaceDetectionCommand.ts diff --git a/clients/client-rekognition/commands/StartFaceSearchCommand.ts b/clients/client-rekognition/src/commands/StartFaceSearchCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartFaceSearchCommand.ts rename to clients/client-rekognition/src/commands/StartFaceSearchCommand.ts diff --git a/clients/client-rekognition/commands/StartLabelDetectionCommand.ts b/clients/client-rekognition/src/commands/StartLabelDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartLabelDetectionCommand.ts rename to clients/client-rekognition/src/commands/StartLabelDetectionCommand.ts diff --git a/clients/client-rekognition/commands/StartPersonTrackingCommand.ts b/clients/client-rekognition/src/commands/StartPersonTrackingCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartPersonTrackingCommand.ts rename to clients/client-rekognition/src/commands/StartPersonTrackingCommand.ts diff --git a/clients/client-rekognition/commands/StartProjectVersionCommand.ts b/clients/client-rekognition/src/commands/StartProjectVersionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartProjectVersionCommand.ts rename to clients/client-rekognition/src/commands/StartProjectVersionCommand.ts diff --git a/clients/client-rekognition/commands/StartSegmentDetectionCommand.ts b/clients/client-rekognition/src/commands/StartSegmentDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartSegmentDetectionCommand.ts rename to clients/client-rekognition/src/commands/StartSegmentDetectionCommand.ts diff --git a/clients/client-rekognition/commands/StartStreamProcessorCommand.ts b/clients/client-rekognition/src/commands/StartStreamProcessorCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartStreamProcessorCommand.ts rename to clients/client-rekognition/src/commands/StartStreamProcessorCommand.ts diff --git a/clients/client-rekognition/commands/StartTextDetectionCommand.ts b/clients/client-rekognition/src/commands/StartTextDetectionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StartTextDetectionCommand.ts rename to clients/client-rekognition/src/commands/StartTextDetectionCommand.ts diff --git a/clients/client-rekognition/commands/StopProjectVersionCommand.ts b/clients/client-rekognition/src/commands/StopProjectVersionCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StopProjectVersionCommand.ts rename to clients/client-rekognition/src/commands/StopProjectVersionCommand.ts diff --git a/clients/client-rekognition/commands/StopStreamProcessorCommand.ts b/clients/client-rekognition/src/commands/StopStreamProcessorCommand.ts similarity index 100% rename from clients/client-rekognition/commands/StopStreamProcessorCommand.ts rename to clients/client-rekognition/src/commands/StopStreamProcessorCommand.ts diff --git a/clients/client-rekognition/commands/TagResourceCommand.ts b/clients/client-rekognition/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-rekognition/commands/TagResourceCommand.ts rename to clients/client-rekognition/src/commands/TagResourceCommand.ts diff --git a/clients/client-rekognition/commands/UntagResourceCommand.ts b/clients/client-rekognition/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-rekognition/commands/UntagResourceCommand.ts rename to clients/client-rekognition/src/commands/UntagResourceCommand.ts diff --git a/clients/client-rekognition/endpoints.ts b/clients/client-rekognition/src/endpoints.ts similarity index 100% rename from clients/client-rekognition/endpoints.ts rename to clients/client-rekognition/src/endpoints.ts diff --git a/clients/client-rekognition/index.ts b/clients/client-rekognition/src/index.ts similarity index 100% rename from clients/client-rekognition/index.ts rename to clients/client-rekognition/src/index.ts diff --git a/clients/client-rekognition/models/index.ts b/clients/client-rekognition/src/models/index.ts similarity index 100% rename from clients/client-rekognition/models/index.ts rename to clients/client-rekognition/src/models/index.ts diff --git a/clients/client-rekognition/models/models_0.ts b/clients/client-rekognition/src/models/models_0.ts similarity index 100% rename from clients/client-rekognition/models/models_0.ts rename to clients/client-rekognition/src/models/models_0.ts diff --git a/clients/client-rekognition/pagination/DescribeProjectVersionsPaginator.ts b/clients/client-rekognition/src/pagination/DescribeProjectVersionsPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/DescribeProjectVersionsPaginator.ts rename to clients/client-rekognition/src/pagination/DescribeProjectVersionsPaginator.ts diff --git a/clients/client-rekognition/pagination/DescribeProjectsPaginator.ts b/clients/client-rekognition/src/pagination/DescribeProjectsPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/DescribeProjectsPaginator.ts rename to clients/client-rekognition/src/pagination/DescribeProjectsPaginator.ts diff --git a/clients/client-rekognition/pagination/GetCelebrityRecognitionPaginator.ts b/clients/client-rekognition/src/pagination/GetCelebrityRecognitionPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetCelebrityRecognitionPaginator.ts rename to clients/client-rekognition/src/pagination/GetCelebrityRecognitionPaginator.ts diff --git a/clients/client-rekognition/pagination/GetContentModerationPaginator.ts b/clients/client-rekognition/src/pagination/GetContentModerationPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetContentModerationPaginator.ts rename to clients/client-rekognition/src/pagination/GetContentModerationPaginator.ts diff --git a/clients/client-rekognition/pagination/GetFaceDetectionPaginator.ts b/clients/client-rekognition/src/pagination/GetFaceDetectionPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetFaceDetectionPaginator.ts rename to clients/client-rekognition/src/pagination/GetFaceDetectionPaginator.ts diff --git a/clients/client-rekognition/pagination/GetFaceSearchPaginator.ts b/clients/client-rekognition/src/pagination/GetFaceSearchPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetFaceSearchPaginator.ts rename to clients/client-rekognition/src/pagination/GetFaceSearchPaginator.ts diff --git a/clients/client-rekognition/pagination/GetLabelDetectionPaginator.ts b/clients/client-rekognition/src/pagination/GetLabelDetectionPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetLabelDetectionPaginator.ts rename to clients/client-rekognition/src/pagination/GetLabelDetectionPaginator.ts diff --git a/clients/client-rekognition/pagination/GetPersonTrackingPaginator.ts b/clients/client-rekognition/src/pagination/GetPersonTrackingPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetPersonTrackingPaginator.ts rename to clients/client-rekognition/src/pagination/GetPersonTrackingPaginator.ts diff --git a/clients/client-rekognition/pagination/GetSegmentDetectionPaginator.ts b/clients/client-rekognition/src/pagination/GetSegmentDetectionPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetSegmentDetectionPaginator.ts rename to clients/client-rekognition/src/pagination/GetSegmentDetectionPaginator.ts diff --git a/clients/client-rekognition/pagination/GetTextDetectionPaginator.ts b/clients/client-rekognition/src/pagination/GetTextDetectionPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/GetTextDetectionPaginator.ts rename to clients/client-rekognition/src/pagination/GetTextDetectionPaginator.ts diff --git a/clients/client-rekognition/pagination/Interfaces.ts b/clients/client-rekognition/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-rekognition/pagination/Interfaces.ts rename to clients/client-rekognition/src/pagination/Interfaces.ts diff --git a/clients/client-rekognition/pagination/ListCollectionsPaginator.ts b/clients/client-rekognition/src/pagination/ListCollectionsPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/ListCollectionsPaginator.ts rename to clients/client-rekognition/src/pagination/ListCollectionsPaginator.ts diff --git a/clients/client-rekognition/pagination/ListFacesPaginator.ts b/clients/client-rekognition/src/pagination/ListFacesPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/ListFacesPaginator.ts rename to clients/client-rekognition/src/pagination/ListFacesPaginator.ts diff --git a/clients/client-rekognition/pagination/ListStreamProcessorsPaginator.ts b/clients/client-rekognition/src/pagination/ListStreamProcessorsPaginator.ts similarity index 100% rename from clients/client-rekognition/pagination/ListStreamProcessorsPaginator.ts rename to clients/client-rekognition/src/pagination/ListStreamProcessorsPaginator.ts diff --git a/clients/client-rekognition/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-rekognition/protocols/Aws_json1_1.ts rename to clients/client-rekognition/src/protocols/Aws_json1_1.ts diff --git a/clients/client-rekognition/src/runtimeConfig.browser.ts b/clients/client-rekognition/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e8ec53937819 --- /dev/null +++ b/clients/client-rekognition/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RekognitionClientConfig } from "./RekognitionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RekognitionClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rekognition/runtimeConfig.native.ts b/clients/client-rekognition/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-rekognition/runtimeConfig.native.ts rename to clients/client-rekognition/src/runtimeConfig.native.ts diff --git a/clients/client-rekognition/runtimeConfig.shared.ts b/clients/client-rekognition/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-rekognition/runtimeConfig.shared.ts rename to clients/client-rekognition/src/runtimeConfig.shared.ts diff --git a/clients/client-rekognition/src/runtimeConfig.ts b/clients/client-rekognition/src/runtimeConfig.ts new file mode 100644 index 000000000000..3bb08cc08b85 --- /dev/null +++ b/clients/client-rekognition/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RekognitionClientConfig } from "./RekognitionClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RekognitionClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-rekognition/waiters/waitForProjectVersionRunning.ts b/clients/client-rekognition/src/waiters/waitForProjectVersionRunning.ts similarity index 100% rename from clients/client-rekognition/waiters/waitForProjectVersionRunning.ts rename to clients/client-rekognition/src/waiters/waitForProjectVersionRunning.ts diff --git a/clients/client-rekognition/waiters/waitForProjectVersionTrainingCompleted.ts b/clients/client-rekognition/src/waiters/waitForProjectVersionTrainingCompleted.ts similarity index 100% rename from clients/client-rekognition/waiters/waitForProjectVersionTrainingCompleted.ts rename to clients/client-rekognition/src/waiters/waitForProjectVersionTrainingCompleted.ts diff --git a/clients/client-rekognition/tsconfig.es.json b/clients/client-rekognition/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-rekognition/tsconfig.es.json +++ b/clients/client-rekognition/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-rekognition/tsconfig.json b/clients/client-rekognition/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-rekognition/tsconfig.json +++ b/clients/client-rekognition/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-rekognition/tsconfig.types.json b/clients/client-rekognition/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-rekognition/tsconfig.types.json +++ b/clients/client-rekognition/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-resource-groups-tagging-api/.gitignore b/clients/client-resource-groups-tagging-api/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-resource-groups-tagging-api/.gitignore +++ b/clients/client-resource-groups-tagging-api/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-resource-groups-tagging-api/package.json b/clients/client-resource-groups-tagging-api/package.json index 60deb934b314..033f81012860 100644 --- a/clients/client-resource-groups-tagging-api/package.json +++ b/clients/client-resource-groups-tagging-api/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-resource-groups-tagging-api", "repository": { "type": "git", diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts deleted file mode 100644 index fad396956be1..000000000000 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ResourceGroupsTaggingAPIClientConfig } from "./ResourceGroupsTaggingAPIClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/runtimeConfig.ts deleted file mode 100644 index 5585d072f798..000000000000 --- a/clients/client-resource-groups-tagging-api/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ResourceGroupsTaggingAPIClientConfig } from "./ResourceGroupsTaggingAPIClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPI.ts b/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPI.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPI.ts rename to clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPI.ts diff --git a/clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts b/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/ResourceGroupsTaggingAPIClient.ts rename to clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts diff --git a/clients/client-resource-groups-tagging-api/commands/DescribeReportCreationCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/DescribeReportCreationCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/DescribeReportCreationCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/DescribeReportCreationCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/GetComplianceSummaryCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/GetComplianceSummaryCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/GetComplianceSummaryCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/GetComplianceSummaryCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/GetResourcesCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/GetResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/GetResourcesCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/GetResourcesCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/GetTagKeysCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/GetTagKeysCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/GetTagKeysCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/GetTagKeysCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/GetTagValuesCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/GetTagValuesCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/GetTagValuesCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/GetTagValuesCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/StartReportCreationCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/StartReportCreationCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/StartReportCreationCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/StartReportCreationCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/TagResourcesCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/TagResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/TagResourcesCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/TagResourcesCommand.ts diff --git a/clients/client-resource-groups-tagging-api/commands/UntagResourcesCommand.ts b/clients/client-resource-groups-tagging-api/src/commands/UntagResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/commands/UntagResourcesCommand.ts rename to clients/client-resource-groups-tagging-api/src/commands/UntagResourcesCommand.ts diff --git a/clients/client-resource-groups-tagging-api/endpoints.ts b/clients/client-resource-groups-tagging-api/src/endpoints.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/endpoints.ts rename to clients/client-resource-groups-tagging-api/src/endpoints.ts diff --git a/clients/client-resource-groups-tagging-api/index.ts b/clients/client-resource-groups-tagging-api/src/index.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/index.ts rename to clients/client-resource-groups-tagging-api/src/index.ts diff --git a/clients/client-resource-groups-tagging-api/models/index.ts b/clients/client-resource-groups-tagging-api/src/models/index.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/models/index.ts rename to clients/client-resource-groups-tagging-api/src/models/index.ts diff --git a/clients/client-resource-groups-tagging-api/models/models_0.ts b/clients/client-resource-groups-tagging-api/src/models/models_0.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/models/models_0.ts rename to clients/client-resource-groups-tagging-api/src/models/models_0.ts diff --git a/clients/client-resource-groups-tagging-api/pagination/GetComplianceSummaryPaginator.ts b/clients/client-resource-groups-tagging-api/src/pagination/GetComplianceSummaryPaginator.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/pagination/GetComplianceSummaryPaginator.ts rename to clients/client-resource-groups-tagging-api/src/pagination/GetComplianceSummaryPaginator.ts diff --git a/clients/client-resource-groups-tagging-api/pagination/GetResourcesPaginator.ts b/clients/client-resource-groups-tagging-api/src/pagination/GetResourcesPaginator.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/pagination/GetResourcesPaginator.ts rename to clients/client-resource-groups-tagging-api/src/pagination/GetResourcesPaginator.ts diff --git a/clients/client-resource-groups-tagging-api/pagination/GetTagKeysPaginator.ts b/clients/client-resource-groups-tagging-api/src/pagination/GetTagKeysPaginator.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/pagination/GetTagKeysPaginator.ts rename to clients/client-resource-groups-tagging-api/src/pagination/GetTagKeysPaginator.ts diff --git a/clients/client-resource-groups-tagging-api/pagination/GetTagValuesPaginator.ts b/clients/client-resource-groups-tagging-api/src/pagination/GetTagValuesPaginator.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/pagination/GetTagValuesPaginator.ts rename to clients/client-resource-groups-tagging-api/src/pagination/GetTagValuesPaginator.ts diff --git a/clients/client-resource-groups-tagging-api/pagination/Interfaces.ts b/clients/client-resource-groups-tagging-api/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/pagination/Interfaces.ts rename to clients/client-resource-groups-tagging-api/src/pagination/Interfaces.ts diff --git a/clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/protocols/Aws_json1_1.ts rename to clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts diff --git a/clients/client-resource-groups-tagging-api/src/runtimeConfig.browser.ts b/clients/client-resource-groups-tagging-api/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e545a33f9a34 --- /dev/null +++ b/clients/client-resource-groups-tagging-api/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ResourceGroupsTaggingAPIClientConfig } from "./ResourceGroupsTaggingAPIClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.native.ts b/clients/client-resource-groups-tagging-api/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/runtimeConfig.native.ts rename to clients/client-resource-groups-tagging-api/src/runtimeConfig.native.ts diff --git a/clients/client-resource-groups-tagging-api/runtimeConfig.shared.ts b/clients/client-resource-groups-tagging-api/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-resource-groups-tagging-api/runtimeConfig.shared.ts rename to clients/client-resource-groups-tagging-api/src/runtimeConfig.shared.ts diff --git a/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts new file mode 100644 index 000000000000..8fde2350b54b --- /dev/null +++ b/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ResourceGroupsTaggingAPIClientConfig } from "./ResourceGroupsTaggingAPIClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-resource-groups-tagging-api/tsconfig.es.json b/clients/client-resource-groups-tagging-api/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-resource-groups-tagging-api/tsconfig.es.json +++ b/clients/client-resource-groups-tagging-api/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-resource-groups-tagging-api/tsconfig.json b/clients/client-resource-groups-tagging-api/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-resource-groups-tagging-api/tsconfig.json +++ b/clients/client-resource-groups-tagging-api/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-resource-groups-tagging-api/tsconfig.types.json b/clients/client-resource-groups-tagging-api/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-resource-groups-tagging-api/tsconfig.types.json +++ b/clients/client-resource-groups-tagging-api/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-resource-groups/.gitignore b/clients/client-resource-groups/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-resource-groups/.gitignore +++ b/clients/client-resource-groups/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-resource-groups/package.json b/clients/client-resource-groups/package.json index ba9f709507f2..7e25d22a4bae 100644 --- a/clients/client-resource-groups/package.json +++ b/clients/client-resource-groups/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-resource-groups", "repository": { "type": "git", diff --git a/clients/client-resource-groups/runtimeConfig.browser.ts b/clients/client-resource-groups/runtimeConfig.browser.ts deleted file mode 100644 index 83b2656ba961..000000000000 --- a/clients/client-resource-groups/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ResourceGroupsClientConfig } from "./ResourceGroupsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-resource-groups/runtimeConfig.ts b/clients/client-resource-groups/runtimeConfig.ts deleted file mode 100644 index 43004ab386b2..000000000000 --- a/clients/client-resource-groups/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ResourceGroupsClientConfig } from "./ResourceGroupsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-resource-groups/ResourceGroups.ts b/clients/client-resource-groups/src/ResourceGroups.ts similarity index 100% rename from clients/client-resource-groups/ResourceGroups.ts rename to clients/client-resource-groups/src/ResourceGroups.ts diff --git a/clients/client-resource-groups/ResourceGroupsClient.ts b/clients/client-resource-groups/src/ResourceGroupsClient.ts similarity index 100% rename from clients/client-resource-groups/ResourceGroupsClient.ts rename to clients/client-resource-groups/src/ResourceGroupsClient.ts diff --git a/clients/client-resource-groups/commands/CreateGroupCommand.ts b/clients/client-resource-groups/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/CreateGroupCommand.ts rename to clients/client-resource-groups/src/commands/CreateGroupCommand.ts diff --git a/clients/client-resource-groups/commands/DeleteGroupCommand.ts b/clients/client-resource-groups/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/DeleteGroupCommand.ts rename to clients/client-resource-groups/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-resource-groups/commands/GetGroupCommand.ts b/clients/client-resource-groups/src/commands/GetGroupCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/GetGroupCommand.ts rename to clients/client-resource-groups/src/commands/GetGroupCommand.ts diff --git a/clients/client-resource-groups/commands/GetGroupConfigurationCommand.ts b/clients/client-resource-groups/src/commands/GetGroupConfigurationCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/GetGroupConfigurationCommand.ts rename to clients/client-resource-groups/src/commands/GetGroupConfigurationCommand.ts diff --git a/clients/client-resource-groups/commands/GetGroupQueryCommand.ts b/clients/client-resource-groups/src/commands/GetGroupQueryCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/GetGroupQueryCommand.ts rename to clients/client-resource-groups/src/commands/GetGroupQueryCommand.ts diff --git a/clients/client-resource-groups/commands/GetTagsCommand.ts b/clients/client-resource-groups/src/commands/GetTagsCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/GetTagsCommand.ts rename to clients/client-resource-groups/src/commands/GetTagsCommand.ts diff --git a/clients/client-resource-groups/commands/GroupResourcesCommand.ts b/clients/client-resource-groups/src/commands/GroupResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/GroupResourcesCommand.ts rename to clients/client-resource-groups/src/commands/GroupResourcesCommand.ts diff --git a/clients/client-resource-groups/commands/ListGroupResourcesCommand.ts b/clients/client-resource-groups/src/commands/ListGroupResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/ListGroupResourcesCommand.ts rename to clients/client-resource-groups/src/commands/ListGroupResourcesCommand.ts diff --git a/clients/client-resource-groups/commands/ListGroupsCommand.ts b/clients/client-resource-groups/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/ListGroupsCommand.ts rename to clients/client-resource-groups/src/commands/ListGroupsCommand.ts diff --git a/clients/client-resource-groups/commands/PutGroupConfigurationCommand.ts b/clients/client-resource-groups/src/commands/PutGroupConfigurationCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/PutGroupConfigurationCommand.ts rename to clients/client-resource-groups/src/commands/PutGroupConfigurationCommand.ts diff --git a/clients/client-resource-groups/commands/SearchResourcesCommand.ts b/clients/client-resource-groups/src/commands/SearchResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/SearchResourcesCommand.ts rename to clients/client-resource-groups/src/commands/SearchResourcesCommand.ts diff --git a/clients/client-resource-groups/commands/TagCommand.ts b/clients/client-resource-groups/src/commands/TagCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/TagCommand.ts rename to clients/client-resource-groups/src/commands/TagCommand.ts diff --git a/clients/client-resource-groups/commands/UngroupResourcesCommand.ts b/clients/client-resource-groups/src/commands/UngroupResourcesCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/UngroupResourcesCommand.ts rename to clients/client-resource-groups/src/commands/UngroupResourcesCommand.ts diff --git a/clients/client-resource-groups/commands/UntagCommand.ts b/clients/client-resource-groups/src/commands/UntagCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/UntagCommand.ts rename to clients/client-resource-groups/src/commands/UntagCommand.ts diff --git a/clients/client-resource-groups/commands/UpdateGroupCommand.ts b/clients/client-resource-groups/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/UpdateGroupCommand.ts rename to clients/client-resource-groups/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-resource-groups/commands/UpdateGroupQueryCommand.ts b/clients/client-resource-groups/src/commands/UpdateGroupQueryCommand.ts similarity index 100% rename from clients/client-resource-groups/commands/UpdateGroupQueryCommand.ts rename to clients/client-resource-groups/src/commands/UpdateGroupQueryCommand.ts diff --git a/clients/client-resource-groups/endpoints.ts b/clients/client-resource-groups/src/endpoints.ts similarity index 100% rename from clients/client-resource-groups/endpoints.ts rename to clients/client-resource-groups/src/endpoints.ts diff --git a/clients/client-resource-groups/index.ts b/clients/client-resource-groups/src/index.ts similarity index 100% rename from clients/client-resource-groups/index.ts rename to clients/client-resource-groups/src/index.ts diff --git a/clients/client-resource-groups/models/index.ts b/clients/client-resource-groups/src/models/index.ts similarity index 100% rename from clients/client-resource-groups/models/index.ts rename to clients/client-resource-groups/src/models/index.ts diff --git a/clients/client-resource-groups/models/models_0.ts b/clients/client-resource-groups/src/models/models_0.ts similarity index 100% rename from clients/client-resource-groups/models/models_0.ts rename to clients/client-resource-groups/src/models/models_0.ts diff --git a/clients/client-resource-groups/pagination/Interfaces.ts b/clients/client-resource-groups/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-resource-groups/pagination/Interfaces.ts rename to clients/client-resource-groups/src/pagination/Interfaces.ts diff --git a/clients/client-resource-groups/pagination/ListGroupResourcesPaginator.ts b/clients/client-resource-groups/src/pagination/ListGroupResourcesPaginator.ts similarity index 100% rename from clients/client-resource-groups/pagination/ListGroupResourcesPaginator.ts rename to clients/client-resource-groups/src/pagination/ListGroupResourcesPaginator.ts diff --git a/clients/client-resource-groups/pagination/ListGroupsPaginator.ts b/clients/client-resource-groups/src/pagination/ListGroupsPaginator.ts similarity index 100% rename from clients/client-resource-groups/pagination/ListGroupsPaginator.ts rename to clients/client-resource-groups/src/pagination/ListGroupsPaginator.ts diff --git a/clients/client-resource-groups/pagination/SearchResourcesPaginator.ts b/clients/client-resource-groups/src/pagination/SearchResourcesPaginator.ts similarity index 100% rename from clients/client-resource-groups/pagination/SearchResourcesPaginator.ts rename to clients/client-resource-groups/src/pagination/SearchResourcesPaginator.ts diff --git a/clients/client-resource-groups/protocols/Aws_restJson1.ts b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-resource-groups/protocols/Aws_restJson1.ts rename to clients/client-resource-groups/src/protocols/Aws_restJson1.ts diff --git a/clients/client-resource-groups/src/runtimeConfig.browser.ts b/clients/client-resource-groups/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..29ee64ddc8a2 --- /dev/null +++ b/clients/client-resource-groups/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ResourceGroupsClientConfig } from "./ResourceGroupsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-resource-groups/runtimeConfig.native.ts b/clients/client-resource-groups/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-resource-groups/runtimeConfig.native.ts rename to clients/client-resource-groups/src/runtimeConfig.native.ts diff --git a/clients/client-resource-groups/runtimeConfig.shared.ts b/clients/client-resource-groups/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-resource-groups/runtimeConfig.shared.ts rename to clients/client-resource-groups/src/runtimeConfig.shared.ts diff --git a/clients/client-resource-groups/src/runtimeConfig.ts b/clients/client-resource-groups/src/runtimeConfig.ts new file mode 100644 index 000000000000..a3c0db91c01d --- /dev/null +++ b/clients/client-resource-groups/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ResourceGroupsClientConfig } from "./ResourceGroupsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-resource-groups/tsconfig.es.json b/clients/client-resource-groups/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-resource-groups/tsconfig.es.json +++ b/clients/client-resource-groups/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-resource-groups/tsconfig.json b/clients/client-resource-groups/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-resource-groups/tsconfig.json +++ b/clients/client-resource-groups/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-resource-groups/tsconfig.types.json b/clients/client-resource-groups/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-resource-groups/tsconfig.types.json +++ b/clients/client-resource-groups/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-robomaker/.gitignore b/clients/client-robomaker/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-robomaker/.gitignore +++ b/clients/client-robomaker/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-robomaker/package.json b/clients/client-robomaker/package.json index c320482aa9f1..591873c1e760 100644 --- a/clients/client-robomaker/package.json +++ b/clients/client-robomaker/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-robomaker", "repository": { "type": "git", diff --git a/clients/client-robomaker/runtimeConfig.browser.ts b/clients/client-robomaker/runtimeConfig.browser.ts deleted file mode 100644 index 4cc4e390a714..000000000000 --- a/clients/client-robomaker/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RoboMakerClientConfig } from "./RoboMakerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RoboMakerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-robomaker/runtimeConfig.ts b/clients/client-robomaker/runtimeConfig.ts deleted file mode 100644 index d75badefe543..000000000000 --- a/clients/client-robomaker/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RoboMakerClientConfig } from "./RoboMakerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RoboMakerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-robomaker/RoboMaker.ts b/clients/client-robomaker/src/RoboMaker.ts similarity index 100% rename from clients/client-robomaker/RoboMaker.ts rename to clients/client-robomaker/src/RoboMaker.ts diff --git a/clients/client-robomaker/RoboMakerClient.ts b/clients/client-robomaker/src/RoboMakerClient.ts similarity index 100% rename from clients/client-robomaker/RoboMakerClient.ts rename to clients/client-robomaker/src/RoboMakerClient.ts diff --git a/clients/client-robomaker/commands/BatchDeleteWorldsCommand.ts b/clients/client-robomaker/src/commands/BatchDeleteWorldsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/BatchDeleteWorldsCommand.ts rename to clients/client-robomaker/src/commands/BatchDeleteWorldsCommand.ts diff --git a/clients/client-robomaker/commands/BatchDescribeSimulationJobCommand.ts b/clients/client-robomaker/src/commands/BatchDescribeSimulationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/BatchDescribeSimulationJobCommand.ts rename to clients/client-robomaker/src/commands/BatchDescribeSimulationJobCommand.ts diff --git a/clients/client-robomaker/commands/CancelDeploymentJobCommand.ts b/clients/client-robomaker/src/commands/CancelDeploymentJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CancelDeploymentJobCommand.ts rename to clients/client-robomaker/src/commands/CancelDeploymentJobCommand.ts diff --git a/clients/client-robomaker/commands/CancelSimulationJobBatchCommand.ts b/clients/client-robomaker/src/commands/CancelSimulationJobBatchCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CancelSimulationJobBatchCommand.ts rename to clients/client-robomaker/src/commands/CancelSimulationJobBatchCommand.ts diff --git a/clients/client-robomaker/commands/CancelSimulationJobCommand.ts b/clients/client-robomaker/src/commands/CancelSimulationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CancelSimulationJobCommand.ts rename to clients/client-robomaker/src/commands/CancelSimulationJobCommand.ts diff --git a/clients/client-robomaker/commands/CancelWorldExportJobCommand.ts b/clients/client-robomaker/src/commands/CancelWorldExportJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CancelWorldExportJobCommand.ts rename to clients/client-robomaker/src/commands/CancelWorldExportJobCommand.ts diff --git a/clients/client-robomaker/commands/CancelWorldGenerationJobCommand.ts b/clients/client-robomaker/src/commands/CancelWorldGenerationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CancelWorldGenerationJobCommand.ts rename to clients/client-robomaker/src/commands/CancelWorldGenerationJobCommand.ts diff --git a/clients/client-robomaker/commands/CreateDeploymentJobCommand.ts b/clients/client-robomaker/src/commands/CreateDeploymentJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateDeploymentJobCommand.ts rename to clients/client-robomaker/src/commands/CreateDeploymentJobCommand.ts diff --git a/clients/client-robomaker/commands/CreateFleetCommand.ts b/clients/client-robomaker/src/commands/CreateFleetCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateFleetCommand.ts rename to clients/client-robomaker/src/commands/CreateFleetCommand.ts diff --git a/clients/client-robomaker/commands/CreateRobotApplicationCommand.ts b/clients/client-robomaker/src/commands/CreateRobotApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateRobotApplicationCommand.ts rename to clients/client-robomaker/src/commands/CreateRobotApplicationCommand.ts diff --git a/clients/client-robomaker/commands/CreateRobotApplicationVersionCommand.ts b/clients/client-robomaker/src/commands/CreateRobotApplicationVersionCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateRobotApplicationVersionCommand.ts rename to clients/client-robomaker/src/commands/CreateRobotApplicationVersionCommand.ts diff --git a/clients/client-robomaker/commands/CreateRobotCommand.ts b/clients/client-robomaker/src/commands/CreateRobotCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateRobotCommand.ts rename to clients/client-robomaker/src/commands/CreateRobotCommand.ts diff --git a/clients/client-robomaker/commands/CreateSimulationApplicationCommand.ts b/clients/client-robomaker/src/commands/CreateSimulationApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateSimulationApplicationCommand.ts rename to clients/client-robomaker/src/commands/CreateSimulationApplicationCommand.ts diff --git a/clients/client-robomaker/commands/CreateSimulationApplicationVersionCommand.ts b/clients/client-robomaker/src/commands/CreateSimulationApplicationVersionCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateSimulationApplicationVersionCommand.ts rename to clients/client-robomaker/src/commands/CreateSimulationApplicationVersionCommand.ts diff --git a/clients/client-robomaker/commands/CreateSimulationJobCommand.ts b/clients/client-robomaker/src/commands/CreateSimulationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateSimulationJobCommand.ts rename to clients/client-robomaker/src/commands/CreateSimulationJobCommand.ts diff --git a/clients/client-robomaker/commands/CreateWorldExportJobCommand.ts b/clients/client-robomaker/src/commands/CreateWorldExportJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateWorldExportJobCommand.ts rename to clients/client-robomaker/src/commands/CreateWorldExportJobCommand.ts diff --git a/clients/client-robomaker/commands/CreateWorldGenerationJobCommand.ts b/clients/client-robomaker/src/commands/CreateWorldGenerationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateWorldGenerationJobCommand.ts rename to clients/client-robomaker/src/commands/CreateWorldGenerationJobCommand.ts diff --git a/clients/client-robomaker/commands/CreateWorldTemplateCommand.ts b/clients/client-robomaker/src/commands/CreateWorldTemplateCommand.ts similarity index 100% rename from clients/client-robomaker/commands/CreateWorldTemplateCommand.ts rename to clients/client-robomaker/src/commands/CreateWorldTemplateCommand.ts diff --git a/clients/client-robomaker/commands/DeleteFleetCommand.ts b/clients/client-robomaker/src/commands/DeleteFleetCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeleteFleetCommand.ts rename to clients/client-robomaker/src/commands/DeleteFleetCommand.ts diff --git a/clients/client-robomaker/commands/DeleteRobotApplicationCommand.ts b/clients/client-robomaker/src/commands/DeleteRobotApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeleteRobotApplicationCommand.ts rename to clients/client-robomaker/src/commands/DeleteRobotApplicationCommand.ts diff --git a/clients/client-robomaker/commands/DeleteRobotCommand.ts b/clients/client-robomaker/src/commands/DeleteRobotCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeleteRobotCommand.ts rename to clients/client-robomaker/src/commands/DeleteRobotCommand.ts diff --git a/clients/client-robomaker/commands/DeleteSimulationApplicationCommand.ts b/clients/client-robomaker/src/commands/DeleteSimulationApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeleteSimulationApplicationCommand.ts rename to clients/client-robomaker/src/commands/DeleteSimulationApplicationCommand.ts diff --git a/clients/client-robomaker/commands/DeleteWorldTemplateCommand.ts b/clients/client-robomaker/src/commands/DeleteWorldTemplateCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeleteWorldTemplateCommand.ts rename to clients/client-robomaker/src/commands/DeleteWorldTemplateCommand.ts diff --git a/clients/client-robomaker/commands/DeregisterRobotCommand.ts b/clients/client-robomaker/src/commands/DeregisterRobotCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DeregisterRobotCommand.ts rename to clients/client-robomaker/src/commands/DeregisterRobotCommand.ts diff --git a/clients/client-robomaker/commands/DescribeDeploymentJobCommand.ts b/clients/client-robomaker/src/commands/DescribeDeploymentJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeDeploymentJobCommand.ts rename to clients/client-robomaker/src/commands/DescribeDeploymentJobCommand.ts diff --git a/clients/client-robomaker/commands/DescribeFleetCommand.ts b/clients/client-robomaker/src/commands/DescribeFleetCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeFleetCommand.ts rename to clients/client-robomaker/src/commands/DescribeFleetCommand.ts diff --git a/clients/client-robomaker/commands/DescribeRobotApplicationCommand.ts b/clients/client-robomaker/src/commands/DescribeRobotApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeRobotApplicationCommand.ts rename to clients/client-robomaker/src/commands/DescribeRobotApplicationCommand.ts diff --git a/clients/client-robomaker/commands/DescribeRobotCommand.ts b/clients/client-robomaker/src/commands/DescribeRobotCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeRobotCommand.ts rename to clients/client-robomaker/src/commands/DescribeRobotCommand.ts diff --git a/clients/client-robomaker/commands/DescribeSimulationApplicationCommand.ts b/clients/client-robomaker/src/commands/DescribeSimulationApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeSimulationApplicationCommand.ts rename to clients/client-robomaker/src/commands/DescribeSimulationApplicationCommand.ts diff --git a/clients/client-robomaker/commands/DescribeSimulationJobBatchCommand.ts b/clients/client-robomaker/src/commands/DescribeSimulationJobBatchCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeSimulationJobBatchCommand.ts rename to clients/client-robomaker/src/commands/DescribeSimulationJobBatchCommand.ts diff --git a/clients/client-robomaker/commands/DescribeSimulationJobCommand.ts b/clients/client-robomaker/src/commands/DescribeSimulationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeSimulationJobCommand.ts rename to clients/client-robomaker/src/commands/DescribeSimulationJobCommand.ts diff --git a/clients/client-robomaker/commands/DescribeWorldCommand.ts b/clients/client-robomaker/src/commands/DescribeWorldCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeWorldCommand.ts rename to clients/client-robomaker/src/commands/DescribeWorldCommand.ts diff --git a/clients/client-robomaker/commands/DescribeWorldExportJobCommand.ts b/clients/client-robomaker/src/commands/DescribeWorldExportJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeWorldExportJobCommand.ts rename to clients/client-robomaker/src/commands/DescribeWorldExportJobCommand.ts diff --git a/clients/client-robomaker/commands/DescribeWorldGenerationJobCommand.ts b/clients/client-robomaker/src/commands/DescribeWorldGenerationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeWorldGenerationJobCommand.ts rename to clients/client-robomaker/src/commands/DescribeWorldGenerationJobCommand.ts diff --git a/clients/client-robomaker/commands/DescribeWorldTemplateCommand.ts b/clients/client-robomaker/src/commands/DescribeWorldTemplateCommand.ts similarity index 100% rename from clients/client-robomaker/commands/DescribeWorldTemplateCommand.ts rename to clients/client-robomaker/src/commands/DescribeWorldTemplateCommand.ts diff --git a/clients/client-robomaker/commands/GetWorldTemplateBodyCommand.ts b/clients/client-robomaker/src/commands/GetWorldTemplateBodyCommand.ts similarity index 100% rename from clients/client-robomaker/commands/GetWorldTemplateBodyCommand.ts rename to clients/client-robomaker/src/commands/GetWorldTemplateBodyCommand.ts diff --git a/clients/client-robomaker/commands/ListDeploymentJobsCommand.ts b/clients/client-robomaker/src/commands/ListDeploymentJobsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListDeploymentJobsCommand.ts rename to clients/client-robomaker/src/commands/ListDeploymentJobsCommand.ts diff --git a/clients/client-robomaker/commands/ListFleetsCommand.ts b/clients/client-robomaker/src/commands/ListFleetsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListFleetsCommand.ts rename to clients/client-robomaker/src/commands/ListFleetsCommand.ts diff --git a/clients/client-robomaker/commands/ListRobotApplicationsCommand.ts b/clients/client-robomaker/src/commands/ListRobotApplicationsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListRobotApplicationsCommand.ts rename to clients/client-robomaker/src/commands/ListRobotApplicationsCommand.ts diff --git a/clients/client-robomaker/commands/ListRobotsCommand.ts b/clients/client-robomaker/src/commands/ListRobotsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListRobotsCommand.ts rename to clients/client-robomaker/src/commands/ListRobotsCommand.ts diff --git a/clients/client-robomaker/commands/ListSimulationApplicationsCommand.ts b/clients/client-robomaker/src/commands/ListSimulationApplicationsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListSimulationApplicationsCommand.ts rename to clients/client-robomaker/src/commands/ListSimulationApplicationsCommand.ts diff --git a/clients/client-robomaker/commands/ListSimulationJobBatchesCommand.ts b/clients/client-robomaker/src/commands/ListSimulationJobBatchesCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListSimulationJobBatchesCommand.ts rename to clients/client-robomaker/src/commands/ListSimulationJobBatchesCommand.ts diff --git a/clients/client-robomaker/commands/ListSimulationJobsCommand.ts b/clients/client-robomaker/src/commands/ListSimulationJobsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListSimulationJobsCommand.ts rename to clients/client-robomaker/src/commands/ListSimulationJobsCommand.ts diff --git a/clients/client-robomaker/commands/ListTagsForResourceCommand.ts b/clients/client-robomaker/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListTagsForResourceCommand.ts rename to clients/client-robomaker/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-robomaker/commands/ListWorldExportJobsCommand.ts b/clients/client-robomaker/src/commands/ListWorldExportJobsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListWorldExportJobsCommand.ts rename to clients/client-robomaker/src/commands/ListWorldExportJobsCommand.ts diff --git a/clients/client-robomaker/commands/ListWorldGenerationJobsCommand.ts b/clients/client-robomaker/src/commands/ListWorldGenerationJobsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListWorldGenerationJobsCommand.ts rename to clients/client-robomaker/src/commands/ListWorldGenerationJobsCommand.ts diff --git a/clients/client-robomaker/commands/ListWorldTemplatesCommand.ts b/clients/client-robomaker/src/commands/ListWorldTemplatesCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListWorldTemplatesCommand.ts rename to clients/client-robomaker/src/commands/ListWorldTemplatesCommand.ts diff --git a/clients/client-robomaker/commands/ListWorldsCommand.ts b/clients/client-robomaker/src/commands/ListWorldsCommand.ts similarity index 100% rename from clients/client-robomaker/commands/ListWorldsCommand.ts rename to clients/client-robomaker/src/commands/ListWorldsCommand.ts diff --git a/clients/client-robomaker/commands/RegisterRobotCommand.ts b/clients/client-robomaker/src/commands/RegisterRobotCommand.ts similarity index 100% rename from clients/client-robomaker/commands/RegisterRobotCommand.ts rename to clients/client-robomaker/src/commands/RegisterRobotCommand.ts diff --git a/clients/client-robomaker/commands/RestartSimulationJobCommand.ts b/clients/client-robomaker/src/commands/RestartSimulationJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/RestartSimulationJobCommand.ts rename to clients/client-robomaker/src/commands/RestartSimulationJobCommand.ts diff --git a/clients/client-robomaker/commands/StartSimulationJobBatchCommand.ts b/clients/client-robomaker/src/commands/StartSimulationJobBatchCommand.ts similarity index 100% rename from clients/client-robomaker/commands/StartSimulationJobBatchCommand.ts rename to clients/client-robomaker/src/commands/StartSimulationJobBatchCommand.ts diff --git a/clients/client-robomaker/commands/SyncDeploymentJobCommand.ts b/clients/client-robomaker/src/commands/SyncDeploymentJobCommand.ts similarity index 100% rename from clients/client-robomaker/commands/SyncDeploymentJobCommand.ts rename to clients/client-robomaker/src/commands/SyncDeploymentJobCommand.ts diff --git a/clients/client-robomaker/commands/TagResourceCommand.ts b/clients/client-robomaker/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-robomaker/commands/TagResourceCommand.ts rename to clients/client-robomaker/src/commands/TagResourceCommand.ts diff --git a/clients/client-robomaker/commands/UntagResourceCommand.ts b/clients/client-robomaker/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-robomaker/commands/UntagResourceCommand.ts rename to clients/client-robomaker/src/commands/UntagResourceCommand.ts diff --git a/clients/client-robomaker/commands/UpdateRobotApplicationCommand.ts b/clients/client-robomaker/src/commands/UpdateRobotApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/UpdateRobotApplicationCommand.ts rename to clients/client-robomaker/src/commands/UpdateRobotApplicationCommand.ts diff --git a/clients/client-robomaker/commands/UpdateSimulationApplicationCommand.ts b/clients/client-robomaker/src/commands/UpdateSimulationApplicationCommand.ts similarity index 100% rename from clients/client-robomaker/commands/UpdateSimulationApplicationCommand.ts rename to clients/client-robomaker/src/commands/UpdateSimulationApplicationCommand.ts diff --git a/clients/client-robomaker/commands/UpdateWorldTemplateCommand.ts b/clients/client-robomaker/src/commands/UpdateWorldTemplateCommand.ts similarity index 100% rename from clients/client-robomaker/commands/UpdateWorldTemplateCommand.ts rename to clients/client-robomaker/src/commands/UpdateWorldTemplateCommand.ts diff --git a/clients/client-robomaker/endpoints.ts b/clients/client-robomaker/src/endpoints.ts similarity index 100% rename from clients/client-robomaker/endpoints.ts rename to clients/client-robomaker/src/endpoints.ts diff --git a/clients/client-robomaker/index.ts b/clients/client-robomaker/src/index.ts similarity index 100% rename from clients/client-robomaker/index.ts rename to clients/client-robomaker/src/index.ts diff --git a/clients/client-robomaker/models/index.ts b/clients/client-robomaker/src/models/index.ts similarity index 100% rename from clients/client-robomaker/models/index.ts rename to clients/client-robomaker/src/models/index.ts diff --git a/clients/client-robomaker/models/models_0.ts b/clients/client-robomaker/src/models/models_0.ts similarity index 100% rename from clients/client-robomaker/models/models_0.ts rename to clients/client-robomaker/src/models/models_0.ts diff --git a/clients/client-robomaker/pagination/Interfaces.ts b/clients/client-robomaker/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-robomaker/pagination/Interfaces.ts rename to clients/client-robomaker/src/pagination/Interfaces.ts diff --git a/clients/client-robomaker/pagination/ListDeploymentJobsPaginator.ts b/clients/client-robomaker/src/pagination/ListDeploymentJobsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListDeploymentJobsPaginator.ts rename to clients/client-robomaker/src/pagination/ListDeploymentJobsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListFleetsPaginator.ts b/clients/client-robomaker/src/pagination/ListFleetsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListFleetsPaginator.ts rename to clients/client-robomaker/src/pagination/ListFleetsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListRobotApplicationsPaginator.ts b/clients/client-robomaker/src/pagination/ListRobotApplicationsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListRobotApplicationsPaginator.ts rename to clients/client-robomaker/src/pagination/ListRobotApplicationsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListRobotsPaginator.ts b/clients/client-robomaker/src/pagination/ListRobotsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListRobotsPaginator.ts rename to clients/client-robomaker/src/pagination/ListRobotsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListSimulationApplicationsPaginator.ts b/clients/client-robomaker/src/pagination/ListSimulationApplicationsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListSimulationApplicationsPaginator.ts rename to clients/client-robomaker/src/pagination/ListSimulationApplicationsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListSimulationJobBatchesPaginator.ts b/clients/client-robomaker/src/pagination/ListSimulationJobBatchesPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListSimulationJobBatchesPaginator.ts rename to clients/client-robomaker/src/pagination/ListSimulationJobBatchesPaginator.ts diff --git a/clients/client-robomaker/pagination/ListSimulationJobsPaginator.ts b/clients/client-robomaker/src/pagination/ListSimulationJobsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListSimulationJobsPaginator.ts rename to clients/client-robomaker/src/pagination/ListSimulationJobsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListWorldExportJobsPaginator.ts b/clients/client-robomaker/src/pagination/ListWorldExportJobsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListWorldExportJobsPaginator.ts rename to clients/client-robomaker/src/pagination/ListWorldExportJobsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListWorldGenerationJobsPaginator.ts b/clients/client-robomaker/src/pagination/ListWorldGenerationJobsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListWorldGenerationJobsPaginator.ts rename to clients/client-robomaker/src/pagination/ListWorldGenerationJobsPaginator.ts diff --git a/clients/client-robomaker/pagination/ListWorldTemplatesPaginator.ts b/clients/client-robomaker/src/pagination/ListWorldTemplatesPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListWorldTemplatesPaginator.ts rename to clients/client-robomaker/src/pagination/ListWorldTemplatesPaginator.ts diff --git a/clients/client-robomaker/pagination/ListWorldsPaginator.ts b/clients/client-robomaker/src/pagination/ListWorldsPaginator.ts similarity index 100% rename from clients/client-robomaker/pagination/ListWorldsPaginator.ts rename to clients/client-robomaker/src/pagination/ListWorldsPaginator.ts diff --git a/clients/client-robomaker/protocols/Aws_restJson1.ts b/clients/client-robomaker/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-robomaker/protocols/Aws_restJson1.ts rename to clients/client-robomaker/src/protocols/Aws_restJson1.ts diff --git a/clients/client-robomaker/src/runtimeConfig.browser.ts b/clients/client-robomaker/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..34c2fb9fe57c --- /dev/null +++ b/clients/client-robomaker/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RoboMakerClientConfig } from "./RoboMakerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RoboMakerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-robomaker/runtimeConfig.native.ts b/clients/client-robomaker/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-robomaker/runtimeConfig.native.ts rename to clients/client-robomaker/src/runtimeConfig.native.ts diff --git a/clients/client-robomaker/runtimeConfig.shared.ts b/clients/client-robomaker/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-robomaker/runtimeConfig.shared.ts rename to clients/client-robomaker/src/runtimeConfig.shared.ts diff --git a/clients/client-robomaker/src/runtimeConfig.ts b/clients/client-robomaker/src/runtimeConfig.ts new file mode 100644 index 000000000000..f87d274d2d6e --- /dev/null +++ b/clients/client-robomaker/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RoboMakerClientConfig } from "./RoboMakerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RoboMakerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-robomaker/tsconfig.es.json b/clients/client-robomaker/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-robomaker/tsconfig.es.json +++ b/clients/client-robomaker/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-robomaker/tsconfig.json b/clients/client-robomaker/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-robomaker/tsconfig.json +++ b/clients/client-robomaker/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-robomaker/tsconfig.types.json b/clients/client-robomaker/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-robomaker/tsconfig.types.json +++ b/clients/client-robomaker/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route-53-domains/.gitignore b/clients/client-route-53-domains/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-route-53-domains/.gitignore +++ b/clients/client-route-53-domains/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route-53-domains/package.json b/clients/client-route-53-domains/package.json index 8f49201ce88e..716cce0039b7 100644 --- a/clients/client-route-53-domains/package.json +++ b/clients/client-route-53-domains/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route-53-domains", "repository": { "type": "git", diff --git a/clients/client-route-53-domains/runtimeConfig.browser.ts b/clients/client-route-53-domains/runtimeConfig.browser.ts deleted file mode 100644 index 1f40690b822d..000000000000 --- a/clients/client-route-53-domains/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53DomainsClientConfig } from "./Route53DomainsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route-53-domains/runtimeConfig.ts b/clients/client-route-53-domains/runtimeConfig.ts deleted file mode 100644 index 3ff308e86a20..000000000000 --- a/clients/client-route-53-domains/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53DomainsClientConfig } from "./Route53DomainsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route-53-domains/Route53Domains.ts b/clients/client-route-53-domains/src/Route53Domains.ts similarity index 100% rename from clients/client-route-53-domains/Route53Domains.ts rename to clients/client-route-53-domains/src/Route53Domains.ts diff --git a/clients/client-route-53-domains/Route53DomainsClient.ts b/clients/client-route-53-domains/src/Route53DomainsClient.ts similarity index 100% rename from clients/client-route-53-domains/Route53DomainsClient.ts rename to clients/client-route-53-domains/src/Route53DomainsClient.ts diff --git a/clients/client-route-53-domains/commands/AcceptDomainTransferFromAnotherAwsAccountCommand.ts b/clients/client-route-53-domains/src/commands/AcceptDomainTransferFromAnotherAwsAccountCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/AcceptDomainTransferFromAnotherAwsAccountCommand.ts rename to clients/client-route-53-domains/src/commands/AcceptDomainTransferFromAnotherAwsAccountCommand.ts diff --git a/clients/client-route-53-domains/commands/CancelDomainTransferToAnotherAwsAccountCommand.ts b/clients/client-route-53-domains/src/commands/CancelDomainTransferToAnotherAwsAccountCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/CancelDomainTransferToAnotherAwsAccountCommand.ts rename to clients/client-route-53-domains/src/commands/CancelDomainTransferToAnotherAwsAccountCommand.ts diff --git a/clients/client-route-53-domains/commands/CheckDomainAvailabilityCommand.ts b/clients/client-route-53-domains/src/commands/CheckDomainAvailabilityCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/CheckDomainAvailabilityCommand.ts rename to clients/client-route-53-domains/src/commands/CheckDomainAvailabilityCommand.ts diff --git a/clients/client-route-53-domains/commands/CheckDomainTransferabilityCommand.ts b/clients/client-route-53-domains/src/commands/CheckDomainTransferabilityCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/CheckDomainTransferabilityCommand.ts rename to clients/client-route-53-domains/src/commands/CheckDomainTransferabilityCommand.ts diff --git a/clients/client-route-53-domains/commands/DeleteTagsForDomainCommand.ts b/clients/client-route-53-domains/src/commands/DeleteTagsForDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/DeleteTagsForDomainCommand.ts rename to clients/client-route-53-domains/src/commands/DeleteTagsForDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/DisableDomainAutoRenewCommand.ts b/clients/client-route-53-domains/src/commands/DisableDomainAutoRenewCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/DisableDomainAutoRenewCommand.ts rename to clients/client-route-53-domains/src/commands/DisableDomainAutoRenewCommand.ts diff --git a/clients/client-route-53-domains/commands/DisableDomainTransferLockCommand.ts b/clients/client-route-53-domains/src/commands/DisableDomainTransferLockCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/DisableDomainTransferLockCommand.ts rename to clients/client-route-53-domains/src/commands/DisableDomainTransferLockCommand.ts diff --git a/clients/client-route-53-domains/commands/EnableDomainAutoRenewCommand.ts b/clients/client-route-53-domains/src/commands/EnableDomainAutoRenewCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/EnableDomainAutoRenewCommand.ts rename to clients/client-route-53-domains/src/commands/EnableDomainAutoRenewCommand.ts diff --git a/clients/client-route-53-domains/commands/EnableDomainTransferLockCommand.ts b/clients/client-route-53-domains/src/commands/EnableDomainTransferLockCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/EnableDomainTransferLockCommand.ts rename to clients/client-route-53-domains/src/commands/EnableDomainTransferLockCommand.ts diff --git a/clients/client-route-53-domains/commands/GetContactReachabilityStatusCommand.ts b/clients/client-route-53-domains/src/commands/GetContactReachabilityStatusCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/GetContactReachabilityStatusCommand.ts rename to clients/client-route-53-domains/src/commands/GetContactReachabilityStatusCommand.ts diff --git a/clients/client-route-53-domains/commands/GetDomainDetailCommand.ts b/clients/client-route-53-domains/src/commands/GetDomainDetailCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/GetDomainDetailCommand.ts rename to clients/client-route-53-domains/src/commands/GetDomainDetailCommand.ts diff --git a/clients/client-route-53-domains/commands/GetDomainSuggestionsCommand.ts b/clients/client-route-53-domains/src/commands/GetDomainSuggestionsCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/GetDomainSuggestionsCommand.ts rename to clients/client-route-53-domains/src/commands/GetDomainSuggestionsCommand.ts diff --git a/clients/client-route-53-domains/commands/GetOperationDetailCommand.ts b/clients/client-route-53-domains/src/commands/GetOperationDetailCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/GetOperationDetailCommand.ts rename to clients/client-route-53-domains/src/commands/GetOperationDetailCommand.ts diff --git a/clients/client-route-53-domains/commands/ListDomainsCommand.ts b/clients/client-route-53-domains/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/ListDomainsCommand.ts rename to clients/client-route-53-domains/src/commands/ListDomainsCommand.ts diff --git a/clients/client-route-53-domains/commands/ListOperationsCommand.ts b/clients/client-route-53-domains/src/commands/ListOperationsCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/ListOperationsCommand.ts rename to clients/client-route-53-domains/src/commands/ListOperationsCommand.ts diff --git a/clients/client-route-53-domains/commands/ListTagsForDomainCommand.ts b/clients/client-route-53-domains/src/commands/ListTagsForDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/ListTagsForDomainCommand.ts rename to clients/client-route-53-domains/src/commands/ListTagsForDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/RegisterDomainCommand.ts b/clients/client-route-53-domains/src/commands/RegisterDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/RegisterDomainCommand.ts rename to clients/client-route-53-domains/src/commands/RegisterDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/RejectDomainTransferFromAnotherAwsAccountCommand.ts b/clients/client-route-53-domains/src/commands/RejectDomainTransferFromAnotherAwsAccountCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/RejectDomainTransferFromAnotherAwsAccountCommand.ts rename to clients/client-route-53-domains/src/commands/RejectDomainTransferFromAnotherAwsAccountCommand.ts diff --git a/clients/client-route-53-domains/commands/RenewDomainCommand.ts b/clients/client-route-53-domains/src/commands/RenewDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/RenewDomainCommand.ts rename to clients/client-route-53-domains/src/commands/RenewDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/ResendContactReachabilityEmailCommand.ts b/clients/client-route-53-domains/src/commands/ResendContactReachabilityEmailCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/ResendContactReachabilityEmailCommand.ts rename to clients/client-route-53-domains/src/commands/ResendContactReachabilityEmailCommand.ts diff --git a/clients/client-route-53-domains/commands/RetrieveDomainAuthCodeCommand.ts b/clients/client-route-53-domains/src/commands/RetrieveDomainAuthCodeCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/RetrieveDomainAuthCodeCommand.ts rename to clients/client-route-53-domains/src/commands/RetrieveDomainAuthCodeCommand.ts diff --git a/clients/client-route-53-domains/commands/TransferDomainCommand.ts b/clients/client-route-53-domains/src/commands/TransferDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/TransferDomainCommand.ts rename to clients/client-route-53-domains/src/commands/TransferDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/TransferDomainToAnotherAwsAccountCommand.ts b/clients/client-route-53-domains/src/commands/TransferDomainToAnotherAwsAccountCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/TransferDomainToAnotherAwsAccountCommand.ts rename to clients/client-route-53-domains/src/commands/TransferDomainToAnotherAwsAccountCommand.ts diff --git a/clients/client-route-53-domains/commands/UpdateDomainContactCommand.ts b/clients/client-route-53-domains/src/commands/UpdateDomainContactCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/UpdateDomainContactCommand.ts rename to clients/client-route-53-domains/src/commands/UpdateDomainContactCommand.ts diff --git a/clients/client-route-53-domains/commands/UpdateDomainContactPrivacyCommand.ts b/clients/client-route-53-domains/src/commands/UpdateDomainContactPrivacyCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/UpdateDomainContactPrivacyCommand.ts rename to clients/client-route-53-domains/src/commands/UpdateDomainContactPrivacyCommand.ts diff --git a/clients/client-route-53-domains/commands/UpdateDomainNameserversCommand.ts b/clients/client-route-53-domains/src/commands/UpdateDomainNameserversCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/UpdateDomainNameserversCommand.ts rename to clients/client-route-53-domains/src/commands/UpdateDomainNameserversCommand.ts diff --git a/clients/client-route-53-domains/commands/UpdateTagsForDomainCommand.ts b/clients/client-route-53-domains/src/commands/UpdateTagsForDomainCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/UpdateTagsForDomainCommand.ts rename to clients/client-route-53-domains/src/commands/UpdateTagsForDomainCommand.ts diff --git a/clients/client-route-53-domains/commands/ViewBillingCommand.ts b/clients/client-route-53-domains/src/commands/ViewBillingCommand.ts similarity index 100% rename from clients/client-route-53-domains/commands/ViewBillingCommand.ts rename to clients/client-route-53-domains/src/commands/ViewBillingCommand.ts diff --git a/clients/client-route-53-domains/endpoints.ts b/clients/client-route-53-domains/src/endpoints.ts similarity index 100% rename from clients/client-route-53-domains/endpoints.ts rename to clients/client-route-53-domains/src/endpoints.ts diff --git a/clients/client-route-53-domains/index.ts b/clients/client-route-53-domains/src/index.ts similarity index 100% rename from clients/client-route-53-domains/index.ts rename to clients/client-route-53-domains/src/index.ts diff --git a/clients/client-route-53-domains/models/index.ts b/clients/client-route-53-domains/src/models/index.ts similarity index 100% rename from clients/client-route-53-domains/models/index.ts rename to clients/client-route-53-domains/src/models/index.ts diff --git a/clients/client-route-53-domains/models/models_0.ts b/clients/client-route-53-domains/src/models/models_0.ts similarity index 100% rename from clients/client-route-53-domains/models/models_0.ts rename to clients/client-route-53-domains/src/models/models_0.ts diff --git a/clients/client-route-53-domains/pagination/Interfaces.ts b/clients/client-route-53-domains/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-route-53-domains/pagination/Interfaces.ts rename to clients/client-route-53-domains/src/pagination/Interfaces.ts diff --git a/clients/client-route-53-domains/pagination/ListDomainsPaginator.ts b/clients/client-route-53-domains/src/pagination/ListDomainsPaginator.ts similarity index 100% rename from clients/client-route-53-domains/pagination/ListDomainsPaginator.ts rename to clients/client-route-53-domains/src/pagination/ListDomainsPaginator.ts diff --git a/clients/client-route-53-domains/pagination/ListOperationsPaginator.ts b/clients/client-route-53-domains/src/pagination/ListOperationsPaginator.ts similarity index 100% rename from clients/client-route-53-domains/pagination/ListOperationsPaginator.ts rename to clients/client-route-53-domains/src/pagination/ListOperationsPaginator.ts diff --git a/clients/client-route-53-domains/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-route-53-domains/protocols/Aws_json1_1.ts rename to clients/client-route-53-domains/src/protocols/Aws_json1_1.ts diff --git a/clients/client-route-53-domains/src/runtimeConfig.browser.ts b/clients/client-route-53-domains/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..870e4f521b6e --- /dev/null +++ b/clients/client-route-53-domains/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53DomainsClientConfig } from "./Route53DomainsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route-53-domains/runtimeConfig.native.ts b/clients/client-route-53-domains/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route-53-domains/runtimeConfig.native.ts rename to clients/client-route-53-domains/src/runtimeConfig.native.ts diff --git a/clients/client-route-53-domains/runtimeConfig.shared.ts b/clients/client-route-53-domains/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route-53-domains/runtimeConfig.shared.ts rename to clients/client-route-53-domains/src/runtimeConfig.shared.ts diff --git a/clients/client-route-53-domains/src/runtimeConfig.ts b/clients/client-route-53-domains/src/runtimeConfig.ts new file mode 100644 index 000000000000..49b2f436405a --- /dev/null +++ b/clients/client-route-53-domains/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53DomainsClientConfig } from "./Route53DomainsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route-53-domains/tsconfig.es.json b/clients/client-route-53-domains/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route-53-domains/tsconfig.es.json +++ b/clients/client-route-53-domains/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route-53-domains/tsconfig.json b/clients/client-route-53-domains/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route-53-domains/tsconfig.json +++ b/clients/client-route-53-domains/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route-53-domains/tsconfig.types.json b/clients/client-route-53-domains/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route-53-domains/tsconfig.types.json +++ b/clients/client-route-53-domains/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route-53/.gitignore b/clients/client-route-53/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-route-53/.gitignore +++ b/clients/client-route-53/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route-53/package.json b/clients/client-route-53/package.json index 7b8b0ab5a454..7272b7decf0a 100644 --- a/clients/client-route-53/package.json +++ b/clients/client-route-53/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -77,8 +71,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -87,6 +81,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route-53", "repository": { "type": "git", diff --git a/clients/client-route-53/runtimeConfig.browser.ts b/clients/client-route-53/runtimeConfig.browser.ts deleted file mode 100644 index 19a2b9d73bb5..000000000000 --- a/clients/client-route-53/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53ClientConfig } from "./Route53Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route-53/runtimeConfig.ts b/clients/client-route-53/runtimeConfig.ts deleted file mode 100644 index b7804c3e76c1..000000000000 --- a/clients/client-route-53/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53ClientConfig } from "./Route53Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route-53/Route53.ts b/clients/client-route-53/src/Route53.ts similarity index 100% rename from clients/client-route-53/Route53.ts rename to clients/client-route-53/src/Route53.ts diff --git a/clients/client-route-53/Route53Client.ts b/clients/client-route-53/src/Route53Client.ts similarity index 100% rename from clients/client-route-53/Route53Client.ts rename to clients/client-route-53/src/Route53Client.ts diff --git a/clients/client-route-53/commands/ActivateKeySigningKeyCommand.ts b/clients/client-route-53/src/commands/ActivateKeySigningKeyCommand.ts similarity index 100% rename from clients/client-route-53/commands/ActivateKeySigningKeyCommand.ts rename to clients/client-route-53/src/commands/ActivateKeySigningKeyCommand.ts diff --git a/clients/client-route-53/commands/AssociateVPCWithHostedZoneCommand.ts b/clients/client-route-53/src/commands/AssociateVPCWithHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/AssociateVPCWithHostedZoneCommand.ts rename to clients/client-route-53/src/commands/AssociateVPCWithHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/ChangeResourceRecordSetsCommand.ts b/clients/client-route-53/src/commands/ChangeResourceRecordSetsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ChangeResourceRecordSetsCommand.ts rename to clients/client-route-53/src/commands/ChangeResourceRecordSetsCommand.ts diff --git a/clients/client-route-53/commands/ChangeTagsForResourceCommand.ts b/clients/client-route-53/src/commands/ChangeTagsForResourceCommand.ts similarity index 100% rename from clients/client-route-53/commands/ChangeTagsForResourceCommand.ts rename to clients/client-route-53/src/commands/ChangeTagsForResourceCommand.ts diff --git a/clients/client-route-53/commands/CreateHealthCheckCommand.ts b/clients/client-route-53/src/commands/CreateHealthCheckCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateHealthCheckCommand.ts rename to clients/client-route-53/src/commands/CreateHealthCheckCommand.ts diff --git a/clients/client-route-53/commands/CreateHostedZoneCommand.ts b/clients/client-route-53/src/commands/CreateHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateHostedZoneCommand.ts rename to clients/client-route-53/src/commands/CreateHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/CreateKeySigningKeyCommand.ts b/clients/client-route-53/src/commands/CreateKeySigningKeyCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateKeySigningKeyCommand.ts rename to clients/client-route-53/src/commands/CreateKeySigningKeyCommand.ts diff --git a/clients/client-route-53/commands/CreateQueryLoggingConfigCommand.ts b/clients/client-route-53/src/commands/CreateQueryLoggingConfigCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateQueryLoggingConfigCommand.ts rename to clients/client-route-53/src/commands/CreateQueryLoggingConfigCommand.ts diff --git a/clients/client-route-53/commands/CreateReusableDelegationSetCommand.ts b/clients/client-route-53/src/commands/CreateReusableDelegationSetCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateReusableDelegationSetCommand.ts rename to clients/client-route-53/src/commands/CreateReusableDelegationSetCommand.ts diff --git a/clients/client-route-53/commands/CreateTrafficPolicyCommand.ts b/clients/client-route-53/src/commands/CreateTrafficPolicyCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateTrafficPolicyCommand.ts rename to clients/client-route-53/src/commands/CreateTrafficPolicyCommand.ts diff --git a/clients/client-route-53/commands/CreateTrafficPolicyInstanceCommand.ts b/clients/client-route-53/src/commands/CreateTrafficPolicyInstanceCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateTrafficPolicyInstanceCommand.ts rename to clients/client-route-53/src/commands/CreateTrafficPolicyInstanceCommand.ts diff --git a/clients/client-route-53/commands/CreateTrafficPolicyVersionCommand.ts b/clients/client-route-53/src/commands/CreateTrafficPolicyVersionCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateTrafficPolicyVersionCommand.ts rename to clients/client-route-53/src/commands/CreateTrafficPolicyVersionCommand.ts diff --git a/clients/client-route-53/commands/CreateVPCAssociationAuthorizationCommand.ts b/clients/client-route-53/src/commands/CreateVPCAssociationAuthorizationCommand.ts similarity index 100% rename from clients/client-route-53/commands/CreateVPCAssociationAuthorizationCommand.ts rename to clients/client-route-53/src/commands/CreateVPCAssociationAuthorizationCommand.ts diff --git a/clients/client-route-53/commands/DeactivateKeySigningKeyCommand.ts b/clients/client-route-53/src/commands/DeactivateKeySigningKeyCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeactivateKeySigningKeyCommand.ts rename to clients/client-route-53/src/commands/DeactivateKeySigningKeyCommand.ts diff --git a/clients/client-route-53/commands/DeleteHealthCheckCommand.ts b/clients/client-route-53/src/commands/DeleteHealthCheckCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteHealthCheckCommand.ts rename to clients/client-route-53/src/commands/DeleteHealthCheckCommand.ts diff --git a/clients/client-route-53/commands/DeleteHostedZoneCommand.ts b/clients/client-route-53/src/commands/DeleteHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteHostedZoneCommand.ts rename to clients/client-route-53/src/commands/DeleteHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/DeleteKeySigningKeyCommand.ts b/clients/client-route-53/src/commands/DeleteKeySigningKeyCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteKeySigningKeyCommand.ts rename to clients/client-route-53/src/commands/DeleteKeySigningKeyCommand.ts diff --git a/clients/client-route-53/commands/DeleteQueryLoggingConfigCommand.ts b/clients/client-route-53/src/commands/DeleteQueryLoggingConfigCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteQueryLoggingConfigCommand.ts rename to clients/client-route-53/src/commands/DeleteQueryLoggingConfigCommand.ts diff --git a/clients/client-route-53/commands/DeleteReusableDelegationSetCommand.ts b/clients/client-route-53/src/commands/DeleteReusableDelegationSetCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteReusableDelegationSetCommand.ts rename to clients/client-route-53/src/commands/DeleteReusableDelegationSetCommand.ts diff --git a/clients/client-route-53/commands/DeleteTrafficPolicyCommand.ts b/clients/client-route-53/src/commands/DeleteTrafficPolicyCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteTrafficPolicyCommand.ts rename to clients/client-route-53/src/commands/DeleteTrafficPolicyCommand.ts diff --git a/clients/client-route-53/commands/DeleteTrafficPolicyInstanceCommand.ts b/clients/client-route-53/src/commands/DeleteTrafficPolicyInstanceCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteTrafficPolicyInstanceCommand.ts rename to clients/client-route-53/src/commands/DeleteTrafficPolicyInstanceCommand.ts diff --git a/clients/client-route-53/commands/DeleteVPCAssociationAuthorizationCommand.ts b/clients/client-route-53/src/commands/DeleteVPCAssociationAuthorizationCommand.ts similarity index 100% rename from clients/client-route-53/commands/DeleteVPCAssociationAuthorizationCommand.ts rename to clients/client-route-53/src/commands/DeleteVPCAssociationAuthorizationCommand.ts diff --git a/clients/client-route-53/commands/DisableHostedZoneDNSSECCommand.ts b/clients/client-route-53/src/commands/DisableHostedZoneDNSSECCommand.ts similarity index 100% rename from clients/client-route-53/commands/DisableHostedZoneDNSSECCommand.ts rename to clients/client-route-53/src/commands/DisableHostedZoneDNSSECCommand.ts diff --git a/clients/client-route-53/commands/DisassociateVPCFromHostedZoneCommand.ts b/clients/client-route-53/src/commands/DisassociateVPCFromHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/DisassociateVPCFromHostedZoneCommand.ts rename to clients/client-route-53/src/commands/DisassociateVPCFromHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/EnableHostedZoneDNSSECCommand.ts b/clients/client-route-53/src/commands/EnableHostedZoneDNSSECCommand.ts similarity index 100% rename from clients/client-route-53/commands/EnableHostedZoneDNSSECCommand.ts rename to clients/client-route-53/src/commands/EnableHostedZoneDNSSECCommand.ts diff --git a/clients/client-route-53/commands/GetAccountLimitCommand.ts b/clients/client-route-53/src/commands/GetAccountLimitCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetAccountLimitCommand.ts rename to clients/client-route-53/src/commands/GetAccountLimitCommand.ts diff --git a/clients/client-route-53/commands/GetChangeCommand.ts b/clients/client-route-53/src/commands/GetChangeCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetChangeCommand.ts rename to clients/client-route-53/src/commands/GetChangeCommand.ts diff --git a/clients/client-route-53/commands/GetCheckerIpRangesCommand.ts b/clients/client-route-53/src/commands/GetCheckerIpRangesCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetCheckerIpRangesCommand.ts rename to clients/client-route-53/src/commands/GetCheckerIpRangesCommand.ts diff --git a/clients/client-route-53/commands/GetDNSSECCommand.ts b/clients/client-route-53/src/commands/GetDNSSECCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetDNSSECCommand.ts rename to clients/client-route-53/src/commands/GetDNSSECCommand.ts diff --git a/clients/client-route-53/commands/GetGeoLocationCommand.ts b/clients/client-route-53/src/commands/GetGeoLocationCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetGeoLocationCommand.ts rename to clients/client-route-53/src/commands/GetGeoLocationCommand.ts diff --git a/clients/client-route-53/commands/GetHealthCheckCommand.ts b/clients/client-route-53/src/commands/GetHealthCheckCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHealthCheckCommand.ts rename to clients/client-route-53/src/commands/GetHealthCheckCommand.ts diff --git a/clients/client-route-53/commands/GetHealthCheckCountCommand.ts b/clients/client-route-53/src/commands/GetHealthCheckCountCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHealthCheckCountCommand.ts rename to clients/client-route-53/src/commands/GetHealthCheckCountCommand.ts diff --git a/clients/client-route-53/commands/GetHealthCheckLastFailureReasonCommand.ts b/clients/client-route-53/src/commands/GetHealthCheckLastFailureReasonCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHealthCheckLastFailureReasonCommand.ts rename to clients/client-route-53/src/commands/GetHealthCheckLastFailureReasonCommand.ts diff --git a/clients/client-route-53/commands/GetHealthCheckStatusCommand.ts b/clients/client-route-53/src/commands/GetHealthCheckStatusCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHealthCheckStatusCommand.ts rename to clients/client-route-53/src/commands/GetHealthCheckStatusCommand.ts diff --git a/clients/client-route-53/commands/GetHostedZoneCommand.ts b/clients/client-route-53/src/commands/GetHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHostedZoneCommand.ts rename to clients/client-route-53/src/commands/GetHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/GetHostedZoneCountCommand.ts b/clients/client-route-53/src/commands/GetHostedZoneCountCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHostedZoneCountCommand.ts rename to clients/client-route-53/src/commands/GetHostedZoneCountCommand.ts diff --git a/clients/client-route-53/commands/GetHostedZoneLimitCommand.ts b/clients/client-route-53/src/commands/GetHostedZoneLimitCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetHostedZoneLimitCommand.ts rename to clients/client-route-53/src/commands/GetHostedZoneLimitCommand.ts diff --git a/clients/client-route-53/commands/GetQueryLoggingConfigCommand.ts b/clients/client-route-53/src/commands/GetQueryLoggingConfigCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetQueryLoggingConfigCommand.ts rename to clients/client-route-53/src/commands/GetQueryLoggingConfigCommand.ts diff --git a/clients/client-route-53/commands/GetReusableDelegationSetCommand.ts b/clients/client-route-53/src/commands/GetReusableDelegationSetCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetReusableDelegationSetCommand.ts rename to clients/client-route-53/src/commands/GetReusableDelegationSetCommand.ts diff --git a/clients/client-route-53/commands/GetReusableDelegationSetLimitCommand.ts b/clients/client-route-53/src/commands/GetReusableDelegationSetLimitCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetReusableDelegationSetLimitCommand.ts rename to clients/client-route-53/src/commands/GetReusableDelegationSetLimitCommand.ts diff --git a/clients/client-route-53/commands/GetTrafficPolicyCommand.ts b/clients/client-route-53/src/commands/GetTrafficPolicyCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetTrafficPolicyCommand.ts rename to clients/client-route-53/src/commands/GetTrafficPolicyCommand.ts diff --git a/clients/client-route-53/commands/GetTrafficPolicyInstanceCommand.ts b/clients/client-route-53/src/commands/GetTrafficPolicyInstanceCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetTrafficPolicyInstanceCommand.ts rename to clients/client-route-53/src/commands/GetTrafficPolicyInstanceCommand.ts diff --git a/clients/client-route-53/commands/GetTrafficPolicyInstanceCountCommand.ts b/clients/client-route-53/src/commands/GetTrafficPolicyInstanceCountCommand.ts similarity index 100% rename from clients/client-route-53/commands/GetTrafficPolicyInstanceCountCommand.ts rename to clients/client-route-53/src/commands/GetTrafficPolicyInstanceCountCommand.ts diff --git a/clients/client-route-53/commands/ListGeoLocationsCommand.ts b/clients/client-route-53/src/commands/ListGeoLocationsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListGeoLocationsCommand.ts rename to clients/client-route-53/src/commands/ListGeoLocationsCommand.ts diff --git a/clients/client-route-53/commands/ListHealthChecksCommand.ts b/clients/client-route-53/src/commands/ListHealthChecksCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListHealthChecksCommand.ts rename to clients/client-route-53/src/commands/ListHealthChecksCommand.ts diff --git a/clients/client-route-53/commands/ListHostedZonesByNameCommand.ts b/clients/client-route-53/src/commands/ListHostedZonesByNameCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListHostedZonesByNameCommand.ts rename to clients/client-route-53/src/commands/ListHostedZonesByNameCommand.ts diff --git a/clients/client-route-53/commands/ListHostedZonesByVPCCommand.ts b/clients/client-route-53/src/commands/ListHostedZonesByVPCCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListHostedZonesByVPCCommand.ts rename to clients/client-route-53/src/commands/ListHostedZonesByVPCCommand.ts diff --git a/clients/client-route-53/commands/ListHostedZonesCommand.ts b/clients/client-route-53/src/commands/ListHostedZonesCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListHostedZonesCommand.ts rename to clients/client-route-53/src/commands/ListHostedZonesCommand.ts diff --git a/clients/client-route-53/commands/ListQueryLoggingConfigsCommand.ts b/clients/client-route-53/src/commands/ListQueryLoggingConfigsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListQueryLoggingConfigsCommand.ts rename to clients/client-route-53/src/commands/ListQueryLoggingConfigsCommand.ts diff --git a/clients/client-route-53/commands/ListResourceRecordSetsCommand.ts b/clients/client-route-53/src/commands/ListResourceRecordSetsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListResourceRecordSetsCommand.ts rename to clients/client-route-53/src/commands/ListResourceRecordSetsCommand.ts diff --git a/clients/client-route-53/commands/ListReusableDelegationSetsCommand.ts b/clients/client-route-53/src/commands/ListReusableDelegationSetsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListReusableDelegationSetsCommand.ts rename to clients/client-route-53/src/commands/ListReusableDelegationSetsCommand.ts diff --git a/clients/client-route-53/commands/ListTagsForResourceCommand.ts b/clients/client-route-53/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTagsForResourceCommand.ts rename to clients/client-route-53/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-route-53/commands/ListTagsForResourcesCommand.ts b/clients/client-route-53/src/commands/ListTagsForResourcesCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTagsForResourcesCommand.ts rename to clients/client-route-53/src/commands/ListTagsForResourcesCommand.ts diff --git a/clients/client-route-53/commands/ListTrafficPoliciesCommand.ts b/clients/client-route-53/src/commands/ListTrafficPoliciesCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTrafficPoliciesCommand.ts rename to clients/client-route-53/src/commands/ListTrafficPoliciesCommand.ts diff --git a/clients/client-route-53/commands/ListTrafficPolicyInstancesByHostedZoneCommand.ts b/clients/client-route-53/src/commands/ListTrafficPolicyInstancesByHostedZoneCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTrafficPolicyInstancesByHostedZoneCommand.ts rename to clients/client-route-53/src/commands/ListTrafficPolicyInstancesByHostedZoneCommand.ts diff --git a/clients/client-route-53/commands/ListTrafficPolicyInstancesByPolicyCommand.ts b/clients/client-route-53/src/commands/ListTrafficPolicyInstancesByPolicyCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTrafficPolicyInstancesByPolicyCommand.ts rename to clients/client-route-53/src/commands/ListTrafficPolicyInstancesByPolicyCommand.ts diff --git a/clients/client-route-53/commands/ListTrafficPolicyInstancesCommand.ts b/clients/client-route-53/src/commands/ListTrafficPolicyInstancesCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTrafficPolicyInstancesCommand.ts rename to clients/client-route-53/src/commands/ListTrafficPolicyInstancesCommand.ts diff --git a/clients/client-route-53/commands/ListTrafficPolicyVersionsCommand.ts b/clients/client-route-53/src/commands/ListTrafficPolicyVersionsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListTrafficPolicyVersionsCommand.ts rename to clients/client-route-53/src/commands/ListTrafficPolicyVersionsCommand.ts diff --git a/clients/client-route-53/commands/ListVPCAssociationAuthorizationsCommand.ts b/clients/client-route-53/src/commands/ListVPCAssociationAuthorizationsCommand.ts similarity index 100% rename from clients/client-route-53/commands/ListVPCAssociationAuthorizationsCommand.ts rename to clients/client-route-53/src/commands/ListVPCAssociationAuthorizationsCommand.ts diff --git a/clients/client-route-53/commands/TestDNSAnswerCommand.ts b/clients/client-route-53/src/commands/TestDNSAnswerCommand.ts similarity index 100% rename from clients/client-route-53/commands/TestDNSAnswerCommand.ts rename to clients/client-route-53/src/commands/TestDNSAnswerCommand.ts diff --git a/clients/client-route-53/commands/UpdateHealthCheckCommand.ts b/clients/client-route-53/src/commands/UpdateHealthCheckCommand.ts similarity index 100% rename from clients/client-route-53/commands/UpdateHealthCheckCommand.ts rename to clients/client-route-53/src/commands/UpdateHealthCheckCommand.ts diff --git a/clients/client-route-53/commands/UpdateHostedZoneCommentCommand.ts b/clients/client-route-53/src/commands/UpdateHostedZoneCommentCommand.ts similarity index 100% rename from clients/client-route-53/commands/UpdateHostedZoneCommentCommand.ts rename to clients/client-route-53/src/commands/UpdateHostedZoneCommentCommand.ts diff --git a/clients/client-route-53/commands/UpdateTrafficPolicyCommentCommand.ts b/clients/client-route-53/src/commands/UpdateTrafficPolicyCommentCommand.ts similarity index 100% rename from clients/client-route-53/commands/UpdateTrafficPolicyCommentCommand.ts rename to clients/client-route-53/src/commands/UpdateTrafficPolicyCommentCommand.ts diff --git a/clients/client-route-53/commands/UpdateTrafficPolicyInstanceCommand.ts b/clients/client-route-53/src/commands/UpdateTrafficPolicyInstanceCommand.ts similarity index 100% rename from clients/client-route-53/commands/UpdateTrafficPolicyInstanceCommand.ts rename to clients/client-route-53/src/commands/UpdateTrafficPolicyInstanceCommand.ts diff --git a/clients/client-route-53/endpoints.ts b/clients/client-route-53/src/endpoints.ts similarity index 100% rename from clients/client-route-53/endpoints.ts rename to clients/client-route-53/src/endpoints.ts diff --git a/clients/client-route-53/index.ts b/clients/client-route-53/src/index.ts similarity index 100% rename from clients/client-route-53/index.ts rename to clients/client-route-53/src/index.ts diff --git a/clients/client-route-53/models/index.ts b/clients/client-route-53/src/models/index.ts similarity index 100% rename from clients/client-route-53/models/index.ts rename to clients/client-route-53/src/models/index.ts diff --git a/clients/client-route-53/models/models_0.ts b/clients/client-route-53/src/models/models_0.ts similarity index 100% rename from clients/client-route-53/models/models_0.ts rename to clients/client-route-53/src/models/models_0.ts diff --git a/clients/client-route-53/pagination/Interfaces.ts b/clients/client-route-53/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-route-53/pagination/Interfaces.ts rename to clients/client-route-53/src/pagination/Interfaces.ts diff --git a/clients/client-route-53/pagination/ListHealthChecksPaginator.ts b/clients/client-route-53/src/pagination/ListHealthChecksPaginator.ts similarity index 100% rename from clients/client-route-53/pagination/ListHealthChecksPaginator.ts rename to clients/client-route-53/src/pagination/ListHealthChecksPaginator.ts diff --git a/clients/client-route-53/pagination/ListHostedZonesPaginator.ts b/clients/client-route-53/src/pagination/ListHostedZonesPaginator.ts similarity index 100% rename from clients/client-route-53/pagination/ListHostedZonesPaginator.ts rename to clients/client-route-53/src/pagination/ListHostedZonesPaginator.ts diff --git a/clients/client-route-53/pagination/ListQueryLoggingConfigsPaginator.ts b/clients/client-route-53/src/pagination/ListQueryLoggingConfigsPaginator.ts similarity index 100% rename from clients/client-route-53/pagination/ListQueryLoggingConfigsPaginator.ts rename to clients/client-route-53/src/pagination/ListQueryLoggingConfigsPaginator.ts diff --git a/clients/client-route-53/protocols/Aws_restXml.ts b/clients/client-route-53/src/protocols/Aws_restXml.ts similarity index 100% rename from clients/client-route-53/protocols/Aws_restXml.ts rename to clients/client-route-53/src/protocols/Aws_restXml.ts diff --git a/clients/client-route-53/src/runtimeConfig.browser.ts b/clients/client-route-53/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..eaff5a07b84d --- /dev/null +++ b/clients/client-route-53/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53ClientConfig } from "./Route53Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route-53/runtimeConfig.native.ts b/clients/client-route-53/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route-53/runtimeConfig.native.ts rename to clients/client-route-53/src/runtimeConfig.native.ts diff --git a/clients/client-route-53/runtimeConfig.shared.ts b/clients/client-route-53/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route-53/runtimeConfig.shared.ts rename to clients/client-route-53/src/runtimeConfig.shared.ts diff --git a/clients/client-route-53/src/runtimeConfig.ts b/clients/client-route-53/src/runtimeConfig.ts new file mode 100644 index 000000000000..c9877a742cdb --- /dev/null +++ b/clients/client-route-53/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53ClientConfig } from "./Route53Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route-53/waiters/waitForResourceRecordSetsChanged.ts b/clients/client-route-53/src/waiters/waitForResourceRecordSetsChanged.ts similarity index 100% rename from clients/client-route-53/waiters/waitForResourceRecordSetsChanged.ts rename to clients/client-route-53/src/waiters/waitForResourceRecordSetsChanged.ts diff --git a/clients/client-route-53/tsconfig.es.json b/clients/client-route-53/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route-53/tsconfig.es.json +++ b/clients/client-route-53/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route-53/tsconfig.json b/clients/client-route-53/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route-53/tsconfig.json +++ b/clients/client-route-53/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route-53/tsconfig.types.json b/clients/client-route-53/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route-53/tsconfig.types.json +++ b/clients/client-route-53/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route53-recovery-cluster/.gitignore b/clients/client-route53-recovery-cluster/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-route53-recovery-cluster/.gitignore +++ b/clients/client-route53-recovery-cluster/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route53-recovery-cluster/package.json b/clients/client-route53-recovery-cluster/package.json index db08740e4720..d0464c027074 100644 --- a/clients/client-route53-recovery-cluster/package.json +++ b/clients/client-route53-recovery-cluster/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route53-recovery-cluster", "repository": { "type": "git", diff --git a/clients/client-route53-recovery-cluster/runtimeConfig.browser.ts b/clients/client-route53-recovery-cluster/runtimeConfig.browser.ts deleted file mode 100644 index 4a709a4fac73..000000000000 --- a/clients/client-route53-recovery-cluster/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53RecoveryClusterClientConfig } from "./Route53RecoveryClusterClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-cluster/runtimeConfig.ts b/clients/client-route53-recovery-cluster/runtimeConfig.ts deleted file mode 100644 index 5b086a6761ed..000000000000 --- a/clients/client-route53-recovery-cluster/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53RecoveryClusterClientConfig } from "./Route53RecoveryClusterClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-cluster/Route53RecoveryCluster.ts b/clients/client-route53-recovery-cluster/src/Route53RecoveryCluster.ts similarity index 100% rename from clients/client-route53-recovery-cluster/Route53RecoveryCluster.ts rename to clients/client-route53-recovery-cluster/src/Route53RecoveryCluster.ts diff --git a/clients/client-route53-recovery-cluster/Route53RecoveryClusterClient.ts b/clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts similarity index 100% rename from clients/client-route53-recovery-cluster/Route53RecoveryClusterClient.ts rename to clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts diff --git a/clients/client-route53-recovery-cluster/commands/GetRoutingControlStateCommand.ts b/clients/client-route53-recovery-cluster/src/commands/GetRoutingControlStateCommand.ts similarity index 100% rename from clients/client-route53-recovery-cluster/commands/GetRoutingControlStateCommand.ts rename to clients/client-route53-recovery-cluster/src/commands/GetRoutingControlStateCommand.ts diff --git a/clients/client-route53-recovery-cluster/commands/UpdateRoutingControlStateCommand.ts b/clients/client-route53-recovery-cluster/src/commands/UpdateRoutingControlStateCommand.ts similarity index 100% rename from clients/client-route53-recovery-cluster/commands/UpdateRoutingControlStateCommand.ts rename to clients/client-route53-recovery-cluster/src/commands/UpdateRoutingControlStateCommand.ts diff --git a/clients/client-route53-recovery-cluster/commands/UpdateRoutingControlStatesCommand.ts b/clients/client-route53-recovery-cluster/src/commands/UpdateRoutingControlStatesCommand.ts similarity index 100% rename from clients/client-route53-recovery-cluster/commands/UpdateRoutingControlStatesCommand.ts rename to clients/client-route53-recovery-cluster/src/commands/UpdateRoutingControlStatesCommand.ts diff --git a/clients/client-route53-recovery-cluster/endpoints.ts b/clients/client-route53-recovery-cluster/src/endpoints.ts similarity index 100% rename from clients/client-route53-recovery-cluster/endpoints.ts rename to clients/client-route53-recovery-cluster/src/endpoints.ts diff --git a/clients/client-route53-recovery-cluster/index.ts b/clients/client-route53-recovery-cluster/src/index.ts similarity index 100% rename from clients/client-route53-recovery-cluster/index.ts rename to clients/client-route53-recovery-cluster/src/index.ts diff --git a/clients/client-route53-recovery-cluster/models/index.ts b/clients/client-route53-recovery-cluster/src/models/index.ts similarity index 100% rename from clients/client-route53-recovery-cluster/models/index.ts rename to clients/client-route53-recovery-cluster/src/models/index.ts diff --git a/clients/client-route53-recovery-cluster/models/models_0.ts b/clients/client-route53-recovery-cluster/src/models/models_0.ts similarity index 100% rename from clients/client-route53-recovery-cluster/models/models_0.ts rename to clients/client-route53-recovery-cluster/src/models/models_0.ts diff --git a/clients/client-route53-recovery-cluster/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-route53-recovery-cluster/protocols/Aws_json1_0.ts rename to clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts diff --git a/clients/client-route53-recovery-cluster/src/runtimeConfig.browser.ts b/clients/client-route53-recovery-cluster/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b37388200e5b --- /dev/null +++ b/clients/client-route53-recovery-cluster/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53RecoveryClusterClientConfig } from "./Route53RecoveryClusterClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-cluster/runtimeConfig.native.ts b/clients/client-route53-recovery-cluster/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route53-recovery-cluster/runtimeConfig.native.ts rename to clients/client-route53-recovery-cluster/src/runtimeConfig.native.ts diff --git a/clients/client-route53-recovery-cluster/runtimeConfig.shared.ts b/clients/client-route53-recovery-cluster/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route53-recovery-cluster/runtimeConfig.shared.ts rename to clients/client-route53-recovery-cluster/src/runtimeConfig.shared.ts diff --git a/clients/client-route53-recovery-cluster/src/runtimeConfig.ts b/clients/client-route53-recovery-cluster/src/runtimeConfig.ts new file mode 100644 index 000000000000..c9590f23ec28 --- /dev/null +++ b/clients/client-route53-recovery-cluster/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53RecoveryClusterClientConfig } from "./Route53RecoveryClusterClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-cluster/tsconfig.es.json b/clients/client-route53-recovery-cluster/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route53-recovery-cluster/tsconfig.es.json +++ b/clients/client-route53-recovery-cluster/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route53-recovery-cluster/tsconfig.json b/clients/client-route53-recovery-cluster/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route53-recovery-cluster/tsconfig.json +++ b/clients/client-route53-recovery-cluster/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route53-recovery-cluster/tsconfig.types.json b/clients/client-route53-recovery-cluster/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route53-recovery-cluster/tsconfig.types.json +++ b/clients/client-route53-recovery-cluster/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route53-recovery-control-config/.gitignore b/clients/client-route53-recovery-control-config/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-route53-recovery-control-config/.gitignore +++ b/clients/client-route53-recovery-control-config/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route53-recovery-control-config/package.json b/clients/client-route53-recovery-control-config/package.json index e330c77259d7..79d54de48cb8 100644 --- a/clients/client-route53-recovery-control-config/package.json +++ b/clients/client-route53-recovery-control-config/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route53-recovery-control-config", "repository": { "type": "git", diff --git a/clients/client-route53-recovery-control-config/runtimeConfig.browser.ts b/clients/client-route53-recovery-control-config/runtimeConfig.browser.ts deleted file mode 100644 index 864cfccd3a70..000000000000 --- a/clients/client-route53-recovery-control-config/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53RecoveryControlConfigClientConfig } from "./Route53RecoveryControlConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-control-config/runtimeConfig.ts b/clients/client-route53-recovery-control-config/runtimeConfig.ts deleted file mode 100644 index f9b93132e782..000000000000 --- a/clients/client-route53-recovery-control-config/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53RecoveryControlConfigClientConfig } from "./Route53RecoveryControlConfigClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-control-config/Route53RecoveryControlConfig.ts b/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfig.ts similarity index 100% rename from clients/client-route53-recovery-control-config/Route53RecoveryControlConfig.ts rename to clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfig.ts diff --git a/clients/client-route53-recovery-control-config/Route53RecoveryControlConfigClient.ts b/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts similarity index 100% rename from clients/client-route53-recovery-control-config/Route53RecoveryControlConfigClient.ts rename to clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts diff --git a/clients/client-route53-recovery-control-config/commands/CreateClusterCommand.ts b/clients/client-route53-recovery-control-config/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/CreateClusterCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/CreateClusterCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/CreateControlPanelCommand.ts b/clients/client-route53-recovery-control-config/src/commands/CreateControlPanelCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/CreateControlPanelCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/CreateControlPanelCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/CreateRoutingControlCommand.ts b/clients/client-route53-recovery-control-config/src/commands/CreateRoutingControlCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/CreateRoutingControlCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/CreateRoutingControlCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/CreateSafetyRuleCommand.ts b/clients/client-route53-recovery-control-config/src/commands/CreateSafetyRuleCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/CreateSafetyRuleCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/CreateSafetyRuleCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DeleteClusterCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DeleteClusterCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DeleteClusterCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DeleteClusterCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DeleteControlPanelCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DeleteControlPanelCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DeleteControlPanelCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DeleteControlPanelCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DeleteRoutingControlCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DeleteRoutingControlCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DeleteRoutingControlCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DeleteRoutingControlCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DeleteSafetyRuleCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DeleteSafetyRuleCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DeleteSafetyRuleCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DeleteSafetyRuleCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DescribeClusterCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DescribeClusterCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DescribeClusterCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DescribeClusterCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DescribeControlPanelCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DescribeControlPanelCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DescribeControlPanelCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DescribeControlPanelCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DescribeRoutingControlCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DescribeRoutingControlCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DescribeRoutingControlCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DescribeRoutingControlCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/DescribeSafetyRuleCommand.ts b/clients/client-route53-recovery-control-config/src/commands/DescribeSafetyRuleCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/DescribeSafetyRuleCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/DescribeSafetyRuleCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/ListAssociatedRoute53HealthChecksCommand.ts b/clients/client-route53-recovery-control-config/src/commands/ListAssociatedRoute53HealthChecksCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/ListAssociatedRoute53HealthChecksCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/ListAssociatedRoute53HealthChecksCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/ListClustersCommand.ts b/clients/client-route53-recovery-control-config/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/ListClustersCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/ListClustersCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/ListControlPanelsCommand.ts b/clients/client-route53-recovery-control-config/src/commands/ListControlPanelsCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/ListControlPanelsCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/ListControlPanelsCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/ListRoutingControlsCommand.ts b/clients/client-route53-recovery-control-config/src/commands/ListRoutingControlsCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/ListRoutingControlsCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/ListRoutingControlsCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/ListSafetyRulesCommand.ts b/clients/client-route53-recovery-control-config/src/commands/ListSafetyRulesCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/ListSafetyRulesCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/ListSafetyRulesCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/UpdateControlPanelCommand.ts b/clients/client-route53-recovery-control-config/src/commands/UpdateControlPanelCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/UpdateControlPanelCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/UpdateControlPanelCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/UpdateRoutingControlCommand.ts b/clients/client-route53-recovery-control-config/src/commands/UpdateRoutingControlCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/UpdateRoutingControlCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/UpdateRoutingControlCommand.ts diff --git a/clients/client-route53-recovery-control-config/commands/UpdateSafetyRuleCommand.ts b/clients/client-route53-recovery-control-config/src/commands/UpdateSafetyRuleCommand.ts similarity index 100% rename from clients/client-route53-recovery-control-config/commands/UpdateSafetyRuleCommand.ts rename to clients/client-route53-recovery-control-config/src/commands/UpdateSafetyRuleCommand.ts diff --git a/clients/client-route53-recovery-control-config/endpoints.ts b/clients/client-route53-recovery-control-config/src/endpoints.ts similarity index 100% rename from clients/client-route53-recovery-control-config/endpoints.ts rename to clients/client-route53-recovery-control-config/src/endpoints.ts diff --git a/clients/client-route53-recovery-control-config/index.ts b/clients/client-route53-recovery-control-config/src/index.ts similarity index 100% rename from clients/client-route53-recovery-control-config/index.ts rename to clients/client-route53-recovery-control-config/src/index.ts diff --git a/clients/client-route53-recovery-control-config/models/index.ts b/clients/client-route53-recovery-control-config/src/models/index.ts similarity index 100% rename from clients/client-route53-recovery-control-config/models/index.ts rename to clients/client-route53-recovery-control-config/src/models/index.ts diff --git a/clients/client-route53-recovery-control-config/models/models_0.ts b/clients/client-route53-recovery-control-config/src/models/models_0.ts similarity index 100% rename from clients/client-route53-recovery-control-config/models/models_0.ts rename to clients/client-route53-recovery-control-config/src/models/models_0.ts diff --git a/clients/client-route53-recovery-control-config/pagination/Interfaces.ts b/clients/client-route53-recovery-control-config/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/Interfaces.ts rename to clients/client-route53-recovery-control-config/src/pagination/Interfaces.ts diff --git a/clients/client-route53-recovery-control-config/pagination/ListAssociatedRoute53HealthChecksPaginator.ts b/clients/client-route53-recovery-control-config/src/pagination/ListAssociatedRoute53HealthChecksPaginator.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/ListAssociatedRoute53HealthChecksPaginator.ts rename to clients/client-route53-recovery-control-config/src/pagination/ListAssociatedRoute53HealthChecksPaginator.ts diff --git a/clients/client-route53-recovery-control-config/pagination/ListClustersPaginator.ts b/clients/client-route53-recovery-control-config/src/pagination/ListClustersPaginator.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/ListClustersPaginator.ts rename to clients/client-route53-recovery-control-config/src/pagination/ListClustersPaginator.ts diff --git a/clients/client-route53-recovery-control-config/pagination/ListControlPanelsPaginator.ts b/clients/client-route53-recovery-control-config/src/pagination/ListControlPanelsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/ListControlPanelsPaginator.ts rename to clients/client-route53-recovery-control-config/src/pagination/ListControlPanelsPaginator.ts diff --git a/clients/client-route53-recovery-control-config/pagination/ListRoutingControlsPaginator.ts b/clients/client-route53-recovery-control-config/src/pagination/ListRoutingControlsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/ListRoutingControlsPaginator.ts rename to clients/client-route53-recovery-control-config/src/pagination/ListRoutingControlsPaginator.ts diff --git a/clients/client-route53-recovery-control-config/pagination/ListSafetyRulesPaginator.ts b/clients/client-route53-recovery-control-config/src/pagination/ListSafetyRulesPaginator.ts similarity index 100% rename from clients/client-route53-recovery-control-config/pagination/ListSafetyRulesPaginator.ts rename to clients/client-route53-recovery-control-config/src/pagination/ListSafetyRulesPaginator.ts diff --git a/clients/client-route53-recovery-control-config/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-route53-recovery-control-config/protocols/Aws_restJson1.ts rename to clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts diff --git a/clients/client-route53-recovery-control-config/src/runtimeConfig.browser.ts b/clients/client-route53-recovery-control-config/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f82e2bcd5126 --- /dev/null +++ b/clients/client-route53-recovery-control-config/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53RecoveryControlConfigClientConfig } from "./Route53RecoveryControlConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-control-config/runtimeConfig.native.ts b/clients/client-route53-recovery-control-config/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route53-recovery-control-config/runtimeConfig.native.ts rename to clients/client-route53-recovery-control-config/src/runtimeConfig.native.ts diff --git a/clients/client-route53-recovery-control-config/runtimeConfig.shared.ts b/clients/client-route53-recovery-control-config/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route53-recovery-control-config/runtimeConfig.shared.ts rename to clients/client-route53-recovery-control-config/src/runtimeConfig.shared.ts diff --git a/clients/client-route53-recovery-control-config/src/runtimeConfig.ts b/clients/client-route53-recovery-control-config/src/runtimeConfig.ts new file mode 100644 index 000000000000..3a76323751ab --- /dev/null +++ b/clients/client-route53-recovery-control-config/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53RecoveryControlConfigClientConfig } from "./Route53RecoveryControlConfigClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-control-config/waiters/waitForClusterCreated.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForClusterCreated.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForClusterCreated.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForClusterCreated.ts diff --git a/clients/client-route53-recovery-control-config/waiters/waitForClusterDeleted.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForClusterDeleted.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForClusterDeleted.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForClusterDeleted.ts diff --git a/clients/client-route53-recovery-control-config/waiters/waitForControlPanelCreated.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForControlPanelCreated.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForControlPanelCreated.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForControlPanelCreated.ts diff --git a/clients/client-route53-recovery-control-config/waiters/waitForControlPanelDeleted.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForControlPanelDeleted.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForControlPanelDeleted.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForControlPanelDeleted.ts diff --git a/clients/client-route53-recovery-control-config/waiters/waitForRoutingControlCreated.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForRoutingControlCreated.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForRoutingControlCreated.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForRoutingControlCreated.ts diff --git a/clients/client-route53-recovery-control-config/waiters/waitForRoutingControlDeleted.ts b/clients/client-route53-recovery-control-config/src/waiters/waitForRoutingControlDeleted.ts similarity index 100% rename from clients/client-route53-recovery-control-config/waiters/waitForRoutingControlDeleted.ts rename to clients/client-route53-recovery-control-config/src/waiters/waitForRoutingControlDeleted.ts diff --git a/clients/client-route53-recovery-control-config/tsconfig.es.json b/clients/client-route53-recovery-control-config/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route53-recovery-control-config/tsconfig.es.json +++ b/clients/client-route53-recovery-control-config/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route53-recovery-control-config/tsconfig.json b/clients/client-route53-recovery-control-config/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route53-recovery-control-config/tsconfig.json +++ b/clients/client-route53-recovery-control-config/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route53-recovery-control-config/tsconfig.types.json b/clients/client-route53-recovery-control-config/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route53-recovery-control-config/tsconfig.types.json +++ b/clients/client-route53-recovery-control-config/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route53-recovery-readiness/.gitignore b/clients/client-route53-recovery-readiness/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-route53-recovery-readiness/.gitignore +++ b/clients/client-route53-recovery-readiness/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route53-recovery-readiness/package.json b/clients/client-route53-recovery-readiness/package.json index 368a21a51d38..ff4e176fd34d 100644 --- a/clients/client-route53-recovery-readiness/package.json +++ b/clients/client-route53-recovery-readiness/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route53-recovery-readiness", "repository": { "type": "git", diff --git a/clients/client-route53-recovery-readiness/runtimeConfig.browser.ts b/clients/client-route53-recovery-readiness/runtimeConfig.browser.ts deleted file mode 100644 index d239b7ce969f..000000000000 --- a/clients/client-route53-recovery-readiness/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53RecoveryReadinessClientConfig } from "./Route53RecoveryReadinessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-readiness/runtimeConfig.ts b/clients/client-route53-recovery-readiness/runtimeConfig.ts deleted file mode 100644 index 9c4c4fa3c54e..000000000000 --- a/clients/client-route53-recovery-readiness/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53RecoveryReadinessClientConfig } from "./Route53RecoveryReadinessClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53-recovery-readiness/Route53RecoveryReadiness.ts b/clients/client-route53-recovery-readiness/src/Route53RecoveryReadiness.ts similarity index 100% rename from clients/client-route53-recovery-readiness/Route53RecoveryReadiness.ts rename to clients/client-route53-recovery-readiness/src/Route53RecoveryReadiness.ts diff --git a/clients/client-route53-recovery-readiness/Route53RecoveryReadinessClient.ts b/clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts similarity index 100% rename from clients/client-route53-recovery-readiness/Route53RecoveryReadinessClient.ts rename to clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts diff --git a/clients/client-route53-recovery-readiness/commands/CreateCellCommand.ts b/clients/client-route53-recovery-readiness/src/commands/CreateCellCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/CreateCellCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/CreateCellCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/CreateCrossAccountAuthorizationCommand.ts b/clients/client-route53-recovery-readiness/src/commands/CreateCrossAccountAuthorizationCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/CreateCrossAccountAuthorizationCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/CreateCrossAccountAuthorizationCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/CreateReadinessCheckCommand.ts b/clients/client-route53-recovery-readiness/src/commands/CreateReadinessCheckCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/CreateReadinessCheckCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/CreateReadinessCheckCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/CreateRecoveryGroupCommand.ts b/clients/client-route53-recovery-readiness/src/commands/CreateRecoveryGroupCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/CreateRecoveryGroupCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/CreateRecoveryGroupCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/CreateResourceSetCommand.ts b/clients/client-route53-recovery-readiness/src/commands/CreateResourceSetCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/CreateResourceSetCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/CreateResourceSetCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/DeleteCellCommand.ts b/clients/client-route53-recovery-readiness/src/commands/DeleteCellCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/DeleteCellCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/DeleteCellCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/DeleteCrossAccountAuthorizationCommand.ts b/clients/client-route53-recovery-readiness/src/commands/DeleteCrossAccountAuthorizationCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/DeleteCrossAccountAuthorizationCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/DeleteCrossAccountAuthorizationCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/DeleteReadinessCheckCommand.ts b/clients/client-route53-recovery-readiness/src/commands/DeleteReadinessCheckCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/DeleteReadinessCheckCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/DeleteReadinessCheckCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/DeleteRecoveryGroupCommand.ts b/clients/client-route53-recovery-readiness/src/commands/DeleteRecoveryGroupCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/DeleteRecoveryGroupCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/DeleteRecoveryGroupCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/DeleteResourceSetCommand.ts b/clients/client-route53-recovery-readiness/src/commands/DeleteResourceSetCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/DeleteResourceSetCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/DeleteResourceSetCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetArchitectureRecommendationsCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetArchitectureRecommendationsCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetArchitectureRecommendationsCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetArchitectureRecommendationsCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetCellCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetCellCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetCellCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetCellCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetCellReadinessSummaryCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetCellReadinessSummaryCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetCellReadinessSummaryCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetCellReadinessSummaryCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetReadinessCheckCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetReadinessCheckCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetReadinessCheckResourceStatusCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckResourceStatusCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetReadinessCheckResourceStatusCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckResourceStatusCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetReadinessCheckStatusCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckStatusCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetReadinessCheckStatusCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetReadinessCheckStatusCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetRecoveryGroupCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetRecoveryGroupCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetRecoveryGroupCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetRecoveryGroupCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetRecoveryGroupReadinessSummaryCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetRecoveryGroupReadinessSummaryCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetRecoveryGroupReadinessSummaryCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetRecoveryGroupReadinessSummaryCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/GetResourceSetCommand.ts b/clients/client-route53-recovery-readiness/src/commands/GetResourceSetCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/GetResourceSetCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/GetResourceSetCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListCellsCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListCellsCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListCellsCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListCellsCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListCrossAccountAuthorizationsCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListCrossAccountAuthorizationsCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListCrossAccountAuthorizationsCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListCrossAccountAuthorizationsCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListReadinessChecksCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListReadinessChecksCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListReadinessChecksCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListReadinessChecksCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListRecoveryGroupsCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListRecoveryGroupsCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListRecoveryGroupsCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListRecoveryGroupsCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListResourceSetsCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListResourceSetsCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListResourceSetsCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListResourceSetsCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListRulesCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListRulesCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListRulesCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListRulesCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/ListTagsForResourcesCommand.ts b/clients/client-route53-recovery-readiness/src/commands/ListTagsForResourcesCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/ListTagsForResourcesCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/ListTagsForResourcesCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/TagResourceCommand.ts b/clients/client-route53-recovery-readiness/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/TagResourceCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/TagResourceCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/UntagResourceCommand.ts b/clients/client-route53-recovery-readiness/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/UntagResourceCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/UntagResourceCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/UpdateCellCommand.ts b/clients/client-route53-recovery-readiness/src/commands/UpdateCellCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/UpdateCellCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/UpdateCellCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/UpdateReadinessCheckCommand.ts b/clients/client-route53-recovery-readiness/src/commands/UpdateReadinessCheckCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/UpdateReadinessCheckCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/UpdateReadinessCheckCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/UpdateRecoveryGroupCommand.ts b/clients/client-route53-recovery-readiness/src/commands/UpdateRecoveryGroupCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/UpdateRecoveryGroupCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/UpdateRecoveryGroupCommand.ts diff --git a/clients/client-route53-recovery-readiness/commands/UpdateResourceSetCommand.ts b/clients/client-route53-recovery-readiness/src/commands/UpdateResourceSetCommand.ts similarity index 100% rename from clients/client-route53-recovery-readiness/commands/UpdateResourceSetCommand.ts rename to clients/client-route53-recovery-readiness/src/commands/UpdateResourceSetCommand.ts diff --git a/clients/client-route53-recovery-readiness/endpoints.ts b/clients/client-route53-recovery-readiness/src/endpoints.ts similarity index 100% rename from clients/client-route53-recovery-readiness/endpoints.ts rename to clients/client-route53-recovery-readiness/src/endpoints.ts diff --git a/clients/client-route53-recovery-readiness/index.ts b/clients/client-route53-recovery-readiness/src/index.ts similarity index 100% rename from clients/client-route53-recovery-readiness/index.ts rename to clients/client-route53-recovery-readiness/src/index.ts diff --git a/clients/client-route53-recovery-readiness/models/index.ts b/clients/client-route53-recovery-readiness/src/models/index.ts similarity index 100% rename from clients/client-route53-recovery-readiness/models/index.ts rename to clients/client-route53-recovery-readiness/src/models/index.ts diff --git a/clients/client-route53-recovery-readiness/models/models_0.ts b/clients/client-route53-recovery-readiness/src/models/models_0.ts similarity index 100% rename from clients/client-route53-recovery-readiness/models/models_0.ts rename to clients/client-route53-recovery-readiness/src/models/models_0.ts diff --git a/clients/client-route53-recovery-readiness/pagination/GetCellReadinessSummaryPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/GetCellReadinessSummaryPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/GetCellReadinessSummaryPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/GetCellReadinessSummaryPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/GetReadinessCheckResourceStatusPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/GetReadinessCheckResourceStatusPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/GetReadinessCheckResourceStatusPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/GetReadinessCheckResourceStatusPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/GetReadinessCheckStatusPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/GetReadinessCheckStatusPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/GetReadinessCheckStatusPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/GetReadinessCheckStatusPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/GetRecoveryGroupReadinessSummaryPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/GetRecoveryGroupReadinessSummaryPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/GetRecoveryGroupReadinessSummaryPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/GetRecoveryGroupReadinessSummaryPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/Interfaces.ts b/clients/client-route53-recovery-readiness/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/Interfaces.ts rename to clients/client-route53-recovery-readiness/src/pagination/Interfaces.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListCellsPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListCellsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListCellsPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListCellsPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListCrossAccountAuthorizationsPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListCrossAccountAuthorizationsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListCrossAccountAuthorizationsPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListCrossAccountAuthorizationsPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListReadinessChecksPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListReadinessChecksPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListReadinessChecksPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListReadinessChecksPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListRecoveryGroupsPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListRecoveryGroupsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListRecoveryGroupsPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListRecoveryGroupsPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListResourceSetsPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListResourceSetsPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListResourceSetsPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListResourceSetsPaginator.ts diff --git a/clients/client-route53-recovery-readiness/pagination/ListRulesPaginator.ts b/clients/client-route53-recovery-readiness/src/pagination/ListRulesPaginator.ts similarity index 100% rename from clients/client-route53-recovery-readiness/pagination/ListRulesPaginator.ts rename to clients/client-route53-recovery-readiness/src/pagination/ListRulesPaginator.ts diff --git a/clients/client-route53-recovery-readiness/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-route53-recovery-readiness/protocols/Aws_restJson1.ts rename to clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts diff --git a/clients/client-route53-recovery-readiness/src/runtimeConfig.browser.ts b/clients/client-route53-recovery-readiness/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0f2191823135 --- /dev/null +++ b/clients/client-route53-recovery-readiness/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53RecoveryReadinessClientConfig } from "./Route53RecoveryReadinessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-readiness/runtimeConfig.native.ts b/clients/client-route53-recovery-readiness/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route53-recovery-readiness/runtimeConfig.native.ts rename to clients/client-route53-recovery-readiness/src/runtimeConfig.native.ts diff --git a/clients/client-route53-recovery-readiness/runtimeConfig.shared.ts b/clients/client-route53-recovery-readiness/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route53-recovery-readiness/runtimeConfig.shared.ts rename to clients/client-route53-recovery-readiness/src/runtimeConfig.shared.ts diff --git a/clients/client-route53-recovery-readiness/src/runtimeConfig.ts b/clients/client-route53-recovery-readiness/src/runtimeConfig.ts new file mode 100644 index 000000000000..13973e686492 --- /dev/null +++ b/clients/client-route53-recovery-readiness/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53RecoveryReadinessClientConfig } from "./Route53RecoveryReadinessClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53-recovery-readiness/tsconfig.es.json b/clients/client-route53-recovery-readiness/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route53-recovery-readiness/tsconfig.es.json +++ b/clients/client-route53-recovery-readiness/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route53-recovery-readiness/tsconfig.json b/clients/client-route53-recovery-readiness/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route53-recovery-readiness/tsconfig.json +++ b/clients/client-route53-recovery-readiness/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route53-recovery-readiness/tsconfig.types.json b/clients/client-route53-recovery-readiness/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route53-recovery-readiness/tsconfig.types.json +++ b/clients/client-route53-recovery-readiness/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-route53resolver/.gitignore b/clients/client-route53resolver/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-route53resolver/.gitignore +++ b/clients/client-route53resolver/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-route53resolver/package.json b/clients/client-route53resolver/package.json index 740d1c07835e..cbb54c871c26 100644 --- a/clients/client-route53resolver/package.json +++ b/clients/client-route53resolver/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-route53resolver", "repository": { "type": "git", diff --git a/clients/client-route53resolver/runtimeConfig.browser.ts b/clients/client-route53resolver/runtimeConfig.browser.ts deleted file mode 100644 index d40aa8b3236d..000000000000 --- a/clients/client-route53resolver/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { Route53ResolverClientConfig } from "./Route53ResolverClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53resolver/runtimeConfig.ts b/clients/client-route53resolver/runtimeConfig.ts deleted file mode 100644 index 7c559d521db2..000000000000 --- a/clients/client-route53resolver/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { Route53ResolverClientConfig } from "./Route53ResolverClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-route53resolver/Route53Resolver.ts b/clients/client-route53resolver/src/Route53Resolver.ts similarity index 100% rename from clients/client-route53resolver/Route53Resolver.ts rename to clients/client-route53resolver/src/Route53Resolver.ts diff --git a/clients/client-route53resolver/Route53ResolverClient.ts b/clients/client-route53resolver/src/Route53ResolverClient.ts similarity index 100% rename from clients/client-route53resolver/Route53ResolverClient.ts rename to clients/client-route53resolver/src/Route53ResolverClient.ts diff --git a/clients/client-route53resolver/commands/AssociateFirewallRuleGroupCommand.ts b/clients/client-route53resolver/src/commands/AssociateFirewallRuleGroupCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/AssociateFirewallRuleGroupCommand.ts rename to clients/client-route53resolver/src/commands/AssociateFirewallRuleGroupCommand.ts diff --git a/clients/client-route53resolver/commands/AssociateResolverEndpointIpAddressCommand.ts b/clients/client-route53resolver/src/commands/AssociateResolverEndpointIpAddressCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/AssociateResolverEndpointIpAddressCommand.ts rename to clients/client-route53resolver/src/commands/AssociateResolverEndpointIpAddressCommand.ts diff --git a/clients/client-route53resolver/commands/AssociateResolverQueryLogConfigCommand.ts b/clients/client-route53resolver/src/commands/AssociateResolverQueryLogConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/AssociateResolverQueryLogConfigCommand.ts rename to clients/client-route53resolver/src/commands/AssociateResolverQueryLogConfigCommand.ts diff --git a/clients/client-route53resolver/commands/AssociateResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/AssociateResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/AssociateResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/AssociateResolverRuleCommand.ts diff --git a/clients/client-route53resolver/commands/CreateFirewallDomainListCommand.ts b/clients/client-route53resolver/src/commands/CreateFirewallDomainListCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateFirewallDomainListCommand.ts rename to clients/client-route53resolver/src/commands/CreateFirewallDomainListCommand.ts diff --git a/clients/client-route53resolver/commands/CreateFirewallRuleCommand.ts b/clients/client-route53resolver/src/commands/CreateFirewallRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateFirewallRuleCommand.ts rename to clients/client-route53resolver/src/commands/CreateFirewallRuleCommand.ts diff --git a/clients/client-route53resolver/commands/CreateFirewallRuleGroupCommand.ts b/clients/client-route53resolver/src/commands/CreateFirewallRuleGroupCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateFirewallRuleGroupCommand.ts rename to clients/client-route53resolver/src/commands/CreateFirewallRuleGroupCommand.ts diff --git a/clients/client-route53resolver/commands/CreateResolverEndpointCommand.ts b/clients/client-route53resolver/src/commands/CreateResolverEndpointCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateResolverEndpointCommand.ts rename to clients/client-route53resolver/src/commands/CreateResolverEndpointCommand.ts diff --git a/clients/client-route53resolver/commands/CreateResolverQueryLogConfigCommand.ts b/clients/client-route53resolver/src/commands/CreateResolverQueryLogConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateResolverQueryLogConfigCommand.ts rename to clients/client-route53resolver/src/commands/CreateResolverQueryLogConfigCommand.ts diff --git a/clients/client-route53resolver/commands/CreateResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/CreateResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/CreateResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/CreateResolverRuleCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteFirewallDomainListCommand.ts b/clients/client-route53resolver/src/commands/DeleteFirewallDomainListCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteFirewallDomainListCommand.ts rename to clients/client-route53resolver/src/commands/DeleteFirewallDomainListCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteFirewallRuleCommand.ts b/clients/client-route53resolver/src/commands/DeleteFirewallRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteFirewallRuleCommand.ts rename to clients/client-route53resolver/src/commands/DeleteFirewallRuleCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteFirewallRuleGroupCommand.ts b/clients/client-route53resolver/src/commands/DeleteFirewallRuleGroupCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteFirewallRuleGroupCommand.ts rename to clients/client-route53resolver/src/commands/DeleteFirewallRuleGroupCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteResolverEndpointCommand.ts b/clients/client-route53resolver/src/commands/DeleteResolverEndpointCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteResolverEndpointCommand.ts rename to clients/client-route53resolver/src/commands/DeleteResolverEndpointCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteResolverQueryLogConfigCommand.ts b/clients/client-route53resolver/src/commands/DeleteResolverQueryLogConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteResolverQueryLogConfigCommand.ts rename to clients/client-route53resolver/src/commands/DeleteResolverQueryLogConfigCommand.ts diff --git a/clients/client-route53resolver/commands/DeleteResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/DeleteResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DeleteResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/DeleteResolverRuleCommand.ts diff --git a/clients/client-route53resolver/commands/DisassociateFirewallRuleGroupCommand.ts b/clients/client-route53resolver/src/commands/DisassociateFirewallRuleGroupCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DisassociateFirewallRuleGroupCommand.ts rename to clients/client-route53resolver/src/commands/DisassociateFirewallRuleGroupCommand.ts diff --git a/clients/client-route53resolver/commands/DisassociateResolverEndpointIpAddressCommand.ts b/clients/client-route53resolver/src/commands/DisassociateResolverEndpointIpAddressCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DisassociateResolverEndpointIpAddressCommand.ts rename to clients/client-route53resolver/src/commands/DisassociateResolverEndpointIpAddressCommand.ts diff --git a/clients/client-route53resolver/commands/DisassociateResolverQueryLogConfigCommand.ts b/clients/client-route53resolver/src/commands/DisassociateResolverQueryLogConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DisassociateResolverQueryLogConfigCommand.ts rename to clients/client-route53resolver/src/commands/DisassociateResolverQueryLogConfigCommand.ts diff --git a/clients/client-route53resolver/commands/DisassociateResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/DisassociateResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/DisassociateResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/DisassociateResolverRuleCommand.ts diff --git a/clients/client-route53resolver/commands/GetFirewallConfigCommand.ts b/clients/client-route53resolver/src/commands/GetFirewallConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetFirewallConfigCommand.ts rename to clients/client-route53resolver/src/commands/GetFirewallConfigCommand.ts diff --git a/clients/client-route53resolver/commands/GetFirewallDomainListCommand.ts b/clients/client-route53resolver/src/commands/GetFirewallDomainListCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetFirewallDomainListCommand.ts rename to clients/client-route53resolver/src/commands/GetFirewallDomainListCommand.ts diff --git a/clients/client-route53resolver/commands/GetFirewallRuleGroupAssociationCommand.ts b/clients/client-route53resolver/src/commands/GetFirewallRuleGroupAssociationCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetFirewallRuleGroupAssociationCommand.ts rename to clients/client-route53resolver/src/commands/GetFirewallRuleGroupAssociationCommand.ts diff --git a/clients/client-route53resolver/commands/GetFirewallRuleGroupCommand.ts b/clients/client-route53resolver/src/commands/GetFirewallRuleGroupCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetFirewallRuleGroupCommand.ts rename to clients/client-route53resolver/src/commands/GetFirewallRuleGroupCommand.ts diff --git a/clients/client-route53resolver/commands/GetFirewallRuleGroupPolicyCommand.ts b/clients/client-route53resolver/src/commands/GetFirewallRuleGroupPolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetFirewallRuleGroupPolicyCommand.ts rename to clients/client-route53resolver/src/commands/GetFirewallRuleGroupPolicyCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverDnssecConfigCommand.ts b/clients/client-route53resolver/src/commands/GetResolverDnssecConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverDnssecConfigCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverDnssecConfigCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverEndpointCommand.ts b/clients/client-route53resolver/src/commands/GetResolverEndpointCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverEndpointCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverEndpointCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverQueryLogConfigAssociationCommand.ts b/clients/client-route53resolver/src/commands/GetResolverQueryLogConfigAssociationCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverQueryLogConfigAssociationCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverQueryLogConfigAssociationCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverQueryLogConfigCommand.ts b/clients/client-route53resolver/src/commands/GetResolverQueryLogConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverQueryLogConfigCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverQueryLogConfigCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverQueryLogConfigPolicyCommand.ts b/clients/client-route53resolver/src/commands/GetResolverQueryLogConfigPolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverQueryLogConfigPolicyCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverQueryLogConfigPolicyCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverRuleAssociationCommand.ts b/clients/client-route53resolver/src/commands/GetResolverRuleAssociationCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverRuleAssociationCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverRuleAssociationCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/GetResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverRuleCommand.ts diff --git a/clients/client-route53resolver/commands/GetResolverRulePolicyCommand.ts b/clients/client-route53resolver/src/commands/GetResolverRulePolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/GetResolverRulePolicyCommand.ts rename to clients/client-route53resolver/src/commands/GetResolverRulePolicyCommand.ts diff --git a/clients/client-route53resolver/commands/ImportFirewallDomainsCommand.ts b/clients/client-route53resolver/src/commands/ImportFirewallDomainsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ImportFirewallDomainsCommand.ts rename to clients/client-route53resolver/src/commands/ImportFirewallDomainsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallConfigsCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallConfigsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallConfigsCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallConfigsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallDomainListsCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallDomainListsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallDomainListsCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallDomainListsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallDomainsCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallDomainsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallDomainsCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallDomainsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallRuleGroupAssociationsCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallRuleGroupAssociationsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallRuleGroupAssociationsCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallRuleGroupAssociationsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallRuleGroupsCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallRuleGroupsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallRuleGroupsCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallRuleGroupsCommand.ts diff --git a/clients/client-route53resolver/commands/ListFirewallRulesCommand.ts b/clients/client-route53resolver/src/commands/ListFirewallRulesCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListFirewallRulesCommand.ts rename to clients/client-route53resolver/src/commands/ListFirewallRulesCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverDnssecConfigsCommand.ts b/clients/client-route53resolver/src/commands/ListResolverDnssecConfigsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverDnssecConfigsCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverDnssecConfigsCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverEndpointIpAddressesCommand.ts b/clients/client-route53resolver/src/commands/ListResolverEndpointIpAddressesCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverEndpointIpAddressesCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverEndpointIpAddressesCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverEndpointsCommand.ts b/clients/client-route53resolver/src/commands/ListResolverEndpointsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverEndpointsCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverEndpointsCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverQueryLogConfigAssociationsCommand.ts b/clients/client-route53resolver/src/commands/ListResolverQueryLogConfigAssociationsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverQueryLogConfigAssociationsCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverQueryLogConfigAssociationsCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverQueryLogConfigsCommand.ts b/clients/client-route53resolver/src/commands/ListResolverQueryLogConfigsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverQueryLogConfigsCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverQueryLogConfigsCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverRuleAssociationsCommand.ts b/clients/client-route53resolver/src/commands/ListResolverRuleAssociationsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverRuleAssociationsCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverRuleAssociationsCommand.ts diff --git a/clients/client-route53resolver/commands/ListResolverRulesCommand.ts b/clients/client-route53resolver/src/commands/ListResolverRulesCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListResolverRulesCommand.ts rename to clients/client-route53resolver/src/commands/ListResolverRulesCommand.ts diff --git a/clients/client-route53resolver/commands/ListTagsForResourceCommand.ts b/clients/client-route53resolver/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/ListTagsForResourceCommand.ts rename to clients/client-route53resolver/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-route53resolver/commands/PutFirewallRuleGroupPolicyCommand.ts b/clients/client-route53resolver/src/commands/PutFirewallRuleGroupPolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/PutFirewallRuleGroupPolicyCommand.ts rename to clients/client-route53resolver/src/commands/PutFirewallRuleGroupPolicyCommand.ts diff --git a/clients/client-route53resolver/commands/PutResolverQueryLogConfigPolicyCommand.ts b/clients/client-route53resolver/src/commands/PutResolverQueryLogConfigPolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/PutResolverQueryLogConfigPolicyCommand.ts rename to clients/client-route53resolver/src/commands/PutResolverQueryLogConfigPolicyCommand.ts diff --git a/clients/client-route53resolver/commands/PutResolverRulePolicyCommand.ts b/clients/client-route53resolver/src/commands/PutResolverRulePolicyCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/PutResolverRulePolicyCommand.ts rename to clients/client-route53resolver/src/commands/PutResolverRulePolicyCommand.ts diff --git a/clients/client-route53resolver/commands/TagResourceCommand.ts b/clients/client-route53resolver/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/TagResourceCommand.ts rename to clients/client-route53resolver/src/commands/TagResourceCommand.ts diff --git a/clients/client-route53resolver/commands/UntagResourceCommand.ts b/clients/client-route53resolver/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UntagResourceCommand.ts rename to clients/client-route53resolver/src/commands/UntagResourceCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateFirewallConfigCommand.ts b/clients/client-route53resolver/src/commands/UpdateFirewallConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateFirewallConfigCommand.ts rename to clients/client-route53resolver/src/commands/UpdateFirewallConfigCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateFirewallDomainsCommand.ts b/clients/client-route53resolver/src/commands/UpdateFirewallDomainsCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateFirewallDomainsCommand.ts rename to clients/client-route53resolver/src/commands/UpdateFirewallDomainsCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateFirewallRuleCommand.ts b/clients/client-route53resolver/src/commands/UpdateFirewallRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateFirewallRuleCommand.ts rename to clients/client-route53resolver/src/commands/UpdateFirewallRuleCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateFirewallRuleGroupAssociationCommand.ts b/clients/client-route53resolver/src/commands/UpdateFirewallRuleGroupAssociationCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateFirewallRuleGroupAssociationCommand.ts rename to clients/client-route53resolver/src/commands/UpdateFirewallRuleGroupAssociationCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateResolverDnssecConfigCommand.ts b/clients/client-route53resolver/src/commands/UpdateResolverDnssecConfigCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateResolverDnssecConfigCommand.ts rename to clients/client-route53resolver/src/commands/UpdateResolverDnssecConfigCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateResolverEndpointCommand.ts b/clients/client-route53resolver/src/commands/UpdateResolverEndpointCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateResolverEndpointCommand.ts rename to clients/client-route53resolver/src/commands/UpdateResolverEndpointCommand.ts diff --git a/clients/client-route53resolver/commands/UpdateResolverRuleCommand.ts b/clients/client-route53resolver/src/commands/UpdateResolverRuleCommand.ts similarity index 100% rename from clients/client-route53resolver/commands/UpdateResolverRuleCommand.ts rename to clients/client-route53resolver/src/commands/UpdateResolverRuleCommand.ts diff --git a/clients/client-route53resolver/endpoints.ts b/clients/client-route53resolver/src/endpoints.ts similarity index 100% rename from clients/client-route53resolver/endpoints.ts rename to clients/client-route53resolver/src/endpoints.ts diff --git a/clients/client-route53resolver/index.ts b/clients/client-route53resolver/src/index.ts similarity index 100% rename from clients/client-route53resolver/index.ts rename to clients/client-route53resolver/src/index.ts diff --git a/clients/client-route53resolver/models/index.ts b/clients/client-route53resolver/src/models/index.ts similarity index 100% rename from clients/client-route53resolver/models/index.ts rename to clients/client-route53resolver/src/models/index.ts diff --git a/clients/client-route53resolver/models/models_0.ts b/clients/client-route53resolver/src/models/models_0.ts similarity index 100% rename from clients/client-route53resolver/models/models_0.ts rename to clients/client-route53resolver/src/models/models_0.ts diff --git a/clients/client-route53resolver/pagination/Interfaces.ts b/clients/client-route53resolver/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-route53resolver/pagination/Interfaces.ts rename to clients/client-route53resolver/src/pagination/Interfaces.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallConfigsPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallConfigsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallConfigsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallConfigsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallDomainListsPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallDomainListsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallDomainListsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallDomainListsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallDomainsPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallDomainsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallDomainsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallDomainsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallRuleGroupAssociationsPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallRuleGroupAssociationsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallRuleGroupAssociationsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallRuleGroupAssociationsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallRuleGroupsPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallRuleGroupsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallRuleGroupsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallRuleGroupsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListFirewallRulesPaginator.ts b/clients/client-route53resolver/src/pagination/ListFirewallRulesPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListFirewallRulesPaginator.ts rename to clients/client-route53resolver/src/pagination/ListFirewallRulesPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverDnssecConfigsPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverDnssecConfigsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverDnssecConfigsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverDnssecConfigsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverEndpointIpAddressesPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverEndpointIpAddressesPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverEndpointIpAddressesPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverEndpointIpAddressesPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverEndpointsPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverEndpointsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverEndpointsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverEndpointsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverQueryLogConfigAssociationsPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverQueryLogConfigAssociationsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverQueryLogConfigAssociationsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverQueryLogConfigAssociationsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverQueryLogConfigsPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverQueryLogConfigsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverQueryLogConfigsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverQueryLogConfigsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverRuleAssociationsPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverRuleAssociationsPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverRuleAssociationsPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverRuleAssociationsPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListResolverRulesPaginator.ts b/clients/client-route53resolver/src/pagination/ListResolverRulesPaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListResolverRulesPaginator.ts rename to clients/client-route53resolver/src/pagination/ListResolverRulesPaginator.ts diff --git a/clients/client-route53resolver/pagination/ListTagsForResourcePaginator.ts b/clients/client-route53resolver/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-route53resolver/pagination/ListTagsForResourcePaginator.ts rename to clients/client-route53resolver/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-route53resolver/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-route53resolver/protocols/Aws_json1_1.ts rename to clients/client-route53resolver/src/protocols/Aws_json1_1.ts diff --git a/clients/client-route53resolver/src/runtimeConfig.browser.ts b/clients/client-route53resolver/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..5461d511b6ae --- /dev/null +++ b/clients/client-route53resolver/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { Route53ResolverClientConfig } from "./Route53ResolverClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53resolver/runtimeConfig.native.ts b/clients/client-route53resolver/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-route53resolver/runtimeConfig.native.ts rename to clients/client-route53resolver/src/runtimeConfig.native.ts diff --git a/clients/client-route53resolver/runtimeConfig.shared.ts b/clients/client-route53resolver/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-route53resolver/runtimeConfig.shared.ts rename to clients/client-route53resolver/src/runtimeConfig.shared.ts diff --git a/clients/client-route53resolver/src/runtimeConfig.ts b/clients/client-route53resolver/src/runtimeConfig.ts new file mode 100644 index 000000000000..4f51bcc40dba --- /dev/null +++ b/clients/client-route53resolver/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { Route53ResolverClientConfig } from "./Route53ResolverClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-route53resolver/tsconfig.es.json b/clients/client-route53resolver/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-route53resolver/tsconfig.es.json +++ b/clients/client-route53resolver/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-route53resolver/tsconfig.json b/clients/client-route53resolver/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-route53resolver/tsconfig.json +++ b/clients/client-route53resolver/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-route53resolver/tsconfig.types.json b/clients/client-route53resolver/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-route53resolver/tsconfig.types.json +++ b/clients/client-route53resolver/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-s3-control/.gitignore b/clients/client-s3-control/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-s3-control/.gitignore +++ b/clients/client-s3-control/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-s3-control/package.json b/clients/client-s3-control/package.json index 569fa0de268a..47ab194c72c5 100644 --- a/clients/client-s3-control/package.json +++ b/clients/client-s3-control/package.json @@ -11,19 +11,13 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "yarn test:unit", - "test:unit": "mocha **/cjs/**/*.spec.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" + "test:unit": "ts-mocha test/**/*.spec.ts" }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -84,8 +78,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -94,6 +88,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3-control", "repository": { "type": "git", diff --git a/clients/client-s3-control/runtimeConfig.browser.ts b/clients/client-s3-control/runtimeConfig.browser.ts deleted file mode 100644 index 6ccf95a33ac3..000000000000 --- a/clients/client-s3-control/runtimeConfig.browser.ts +++ /dev/null @@ -1,44 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { Md5 } from "@aws-sdk/md5-js"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { S3ControlClientConfig } from "./S3ControlClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3ControlClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - md5: config?.md5 ?? Md5, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3-control/runtimeConfig.ts b/clients/client-s3-control/runtimeConfig.ts deleted file mode 100644 index 382044bdca4d..000000000000 --- a/clients/client-s3-control/runtimeConfig.ts +++ /dev/null @@ -1,49 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { S3ControlClientConfig } from "./S3ControlClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3ControlClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3-control/S3Control.ts b/clients/client-s3-control/src/S3Control.ts similarity index 100% rename from clients/client-s3-control/S3Control.ts rename to clients/client-s3-control/src/S3Control.ts diff --git a/clients/client-s3-control/S3ControlClient.ts b/clients/client-s3-control/src/S3ControlClient.ts similarity index 100% rename from clients/client-s3-control/S3ControlClient.ts rename to clients/client-s3-control/src/S3ControlClient.ts diff --git a/clients/client-s3-control/commands/CreateAccessPointCommand.ts b/clients/client-s3-control/src/commands/CreateAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/CreateAccessPointCommand.ts rename to clients/client-s3-control/src/commands/CreateAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/CreateAccessPointForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/CreateAccessPointForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/CreateAccessPointForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/CreateAccessPointForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/CreateBucketCommand.ts b/clients/client-s3-control/src/commands/CreateBucketCommand.ts similarity index 100% rename from clients/client-s3-control/commands/CreateBucketCommand.ts rename to clients/client-s3-control/src/commands/CreateBucketCommand.ts diff --git a/clients/client-s3-control/commands/CreateJobCommand.ts b/clients/client-s3-control/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-s3-control/commands/CreateJobCommand.ts rename to clients/client-s3-control/src/commands/CreateJobCommand.ts diff --git a/clients/client-s3-control/commands/CreateMultiRegionAccessPointCommand.ts b/clients/client-s3-control/src/commands/CreateMultiRegionAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/CreateMultiRegionAccessPointCommand.ts rename to clients/client-s3-control/src/commands/CreateMultiRegionAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/DeleteAccessPointCommand.ts b/clients/client-s3-control/src/commands/DeleteAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteAccessPointCommand.ts rename to clients/client-s3-control/src/commands/DeleteAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/DeleteAccessPointForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/DeleteAccessPointForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteAccessPointForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/DeleteAccessPointForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts b/clients/client-s3-control/src/commands/DeleteAccessPointPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteAccessPointPolicyCommand.ts rename to clients/client-s3-control/src/commands/DeleteAccessPointPolicyCommand.ts diff --git a/clients/client-s3-control/commands/DeleteAccessPointPolicyForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/DeleteAccessPointPolicyForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteAccessPointPolicyForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/DeleteAccessPointPolicyForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/DeleteBucketCommand.ts b/clients/client-s3-control/src/commands/DeleteBucketCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteBucketCommand.ts rename to clients/client-s3-control/src/commands/DeleteBucketCommand.ts diff --git a/clients/client-s3-control/commands/DeleteBucketLifecycleConfigurationCommand.ts b/clients/client-s3-control/src/commands/DeleteBucketLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteBucketLifecycleConfigurationCommand.ts rename to clients/client-s3-control/src/commands/DeleteBucketLifecycleConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/DeleteBucketPolicyCommand.ts b/clients/client-s3-control/src/commands/DeleteBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteBucketPolicyCommand.ts rename to clients/client-s3-control/src/commands/DeleteBucketPolicyCommand.ts diff --git a/clients/client-s3-control/commands/DeleteBucketTaggingCommand.ts b/clients/client-s3-control/src/commands/DeleteBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteBucketTaggingCommand.ts rename to clients/client-s3-control/src/commands/DeleteBucketTaggingCommand.ts diff --git a/clients/client-s3-control/commands/DeleteJobTaggingCommand.ts b/clients/client-s3-control/src/commands/DeleteJobTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteJobTaggingCommand.ts rename to clients/client-s3-control/src/commands/DeleteJobTaggingCommand.ts diff --git a/clients/client-s3-control/commands/DeleteMultiRegionAccessPointCommand.ts b/clients/client-s3-control/src/commands/DeleteMultiRegionAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteMultiRegionAccessPointCommand.ts rename to clients/client-s3-control/src/commands/DeleteMultiRegionAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts b/clients/client-s3-control/src/commands/DeletePublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeletePublicAccessBlockCommand.ts rename to clients/client-s3-control/src/commands/DeletePublicAccessBlockCommand.ts diff --git a/clients/client-s3-control/commands/DeleteStorageLensConfigurationCommand.ts b/clients/client-s3-control/src/commands/DeleteStorageLensConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteStorageLensConfigurationCommand.ts rename to clients/client-s3-control/src/commands/DeleteStorageLensConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/DeleteStorageLensConfigurationTaggingCommand.ts b/clients/client-s3-control/src/commands/DeleteStorageLensConfigurationTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DeleteStorageLensConfigurationTaggingCommand.ts rename to clients/client-s3-control/src/commands/DeleteStorageLensConfigurationTaggingCommand.ts diff --git a/clients/client-s3-control/commands/DescribeJobCommand.ts b/clients/client-s3-control/src/commands/DescribeJobCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DescribeJobCommand.ts rename to clients/client-s3-control/src/commands/DescribeJobCommand.ts diff --git a/clients/client-s3-control/commands/DescribeMultiRegionAccessPointOperationCommand.ts b/clients/client-s3-control/src/commands/DescribeMultiRegionAccessPointOperationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/DescribeMultiRegionAccessPointOperationCommand.ts rename to clients/client-s3-control/src/commands/DescribeMultiRegionAccessPointOperationCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointConfigurationForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointConfigurationForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointConfigurationForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointConfigurationForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointPolicyCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointPolicyCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointPolicyForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointPolicyForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointPolicyForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointPolicyStatusCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointPolicyStatusCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointPolicyStatusCommand.ts diff --git a/clients/client-s3-control/commands/GetAccessPointPolicyStatusForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/GetAccessPointPolicyStatusForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetAccessPointPolicyStatusForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/GetAccessPointPolicyStatusForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/GetBucketCommand.ts b/clients/client-s3-control/src/commands/GetBucketCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetBucketCommand.ts rename to clients/client-s3-control/src/commands/GetBucketCommand.ts diff --git a/clients/client-s3-control/commands/GetBucketLifecycleConfigurationCommand.ts b/clients/client-s3-control/src/commands/GetBucketLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetBucketLifecycleConfigurationCommand.ts rename to clients/client-s3-control/src/commands/GetBucketLifecycleConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/GetBucketPolicyCommand.ts b/clients/client-s3-control/src/commands/GetBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetBucketPolicyCommand.ts rename to clients/client-s3-control/src/commands/GetBucketPolicyCommand.ts diff --git a/clients/client-s3-control/commands/GetBucketTaggingCommand.ts b/clients/client-s3-control/src/commands/GetBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetBucketTaggingCommand.ts rename to clients/client-s3-control/src/commands/GetBucketTaggingCommand.ts diff --git a/clients/client-s3-control/commands/GetJobTaggingCommand.ts b/clients/client-s3-control/src/commands/GetJobTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetJobTaggingCommand.ts rename to clients/client-s3-control/src/commands/GetJobTaggingCommand.ts diff --git a/clients/client-s3-control/commands/GetMultiRegionAccessPointCommand.ts b/clients/client-s3-control/src/commands/GetMultiRegionAccessPointCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetMultiRegionAccessPointCommand.ts rename to clients/client-s3-control/src/commands/GetMultiRegionAccessPointCommand.ts diff --git a/clients/client-s3-control/commands/GetMultiRegionAccessPointPolicyCommand.ts b/clients/client-s3-control/src/commands/GetMultiRegionAccessPointPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetMultiRegionAccessPointPolicyCommand.ts rename to clients/client-s3-control/src/commands/GetMultiRegionAccessPointPolicyCommand.ts diff --git a/clients/client-s3-control/commands/GetMultiRegionAccessPointPolicyStatusCommand.ts b/clients/client-s3-control/src/commands/GetMultiRegionAccessPointPolicyStatusCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetMultiRegionAccessPointPolicyStatusCommand.ts rename to clients/client-s3-control/src/commands/GetMultiRegionAccessPointPolicyStatusCommand.ts diff --git a/clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts b/clients/client-s3-control/src/commands/GetPublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetPublicAccessBlockCommand.ts rename to clients/client-s3-control/src/commands/GetPublicAccessBlockCommand.ts diff --git a/clients/client-s3-control/commands/GetStorageLensConfigurationCommand.ts b/clients/client-s3-control/src/commands/GetStorageLensConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetStorageLensConfigurationCommand.ts rename to clients/client-s3-control/src/commands/GetStorageLensConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/GetStorageLensConfigurationTaggingCommand.ts b/clients/client-s3-control/src/commands/GetStorageLensConfigurationTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/GetStorageLensConfigurationTaggingCommand.ts rename to clients/client-s3-control/src/commands/GetStorageLensConfigurationTaggingCommand.ts diff --git a/clients/client-s3-control/commands/ListAccessPointsCommand.ts b/clients/client-s3-control/src/commands/ListAccessPointsCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListAccessPointsCommand.ts rename to clients/client-s3-control/src/commands/ListAccessPointsCommand.ts diff --git a/clients/client-s3-control/commands/ListAccessPointsForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/ListAccessPointsForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListAccessPointsForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/ListAccessPointsForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/ListJobsCommand.ts b/clients/client-s3-control/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListJobsCommand.ts rename to clients/client-s3-control/src/commands/ListJobsCommand.ts diff --git a/clients/client-s3-control/commands/ListMultiRegionAccessPointsCommand.ts b/clients/client-s3-control/src/commands/ListMultiRegionAccessPointsCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListMultiRegionAccessPointsCommand.ts rename to clients/client-s3-control/src/commands/ListMultiRegionAccessPointsCommand.ts diff --git a/clients/client-s3-control/commands/ListRegionalBucketsCommand.ts b/clients/client-s3-control/src/commands/ListRegionalBucketsCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListRegionalBucketsCommand.ts rename to clients/client-s3-control/src/commands/ListRegionalBucketsCommand.ts diff --git a/clients/client-s3-control/commands/ListStorageLensConfigurationsCommand.ts b/clients/client-s3-control/src/commands/ListStorageLensConfigurationsCommand.ts similarity index 100% rename from clients/client-s3-control/commands/ListStorageLensConfigurationsCommand.ts rename to clients/client-s3-control/src/commands/ListStorageLensConfigurationsCommand.ts diff --git a/clients/client-s3-control/commands/PutAccessPointConfigurationForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/PutAccessPointConfigurationForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutAccessPointConfigurationForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/PutAccessPointConfigurationForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts b/clients/client-s3-control/src/commands/PutAccessPointPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutAccessPointPolicyCommand.ts rename to clients/client-s3-control/src/commands/PutAccessPointPolicyCommand.ts diff --git a/clients/client-s3-control/commands/PutAccessPointPolicyForObjectLambdaCommand.ts b/clients/client-s3-control/src/commands/PutAccessPointPolicyForObjectLambdaCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutAccessPointPolicyForObjectLambdaCommand.ts rename to clients/client-s3-control/src/commands/PutAccessPointPolicyForObjectLambdaCommand.ts diff --git a/clients/client-s3-control/commands/PutBucketLifecycleConfigurationCommand.ts b/clients/client-s3-control/src/commands/PutBucketLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutBucketLifecycleConfigurationCommand.ts rename to clients/client-s3-control/src/commands/PutBucketLifecycleConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/PutBucketPolicyCommand.ts b/clients/client-s3-control/src/commands/PutBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutBucketPolicyCommand.ts rename to clients/client-s3-control/src/commands/PutBucketPolicyCommand.ts diff --git a/clients/client-s3-control/commands/PutBucketTaggingCommand.ts b/clients/client-s3-control/src/commands/PutBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutBucketTaggingCommand.ts rename to clients/client-s3-control/src/commands/PutBucketTaggingCommand.ts diff --git a/clients/client-s3-control/commands/PutJobTaggingCommand.ts b/clients/client-s3-control/src/commands/PutJobTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutJobTaggingCommand.ts rename to clients/client-s3-control/src/commands/PutJobTaggingCommand.ts diff --git a/clients/client-s3-control/commands/PutMultiRegionAccessPointPolicyCommand.ts b/clients/client-s3-control/src/commands/PutMultiRegionAccessPointPolicyCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutMultiRegionAccessPointPolicyCommand.ts rename to clients/client-s3-control/src/commands/PutMultiRegionAccessPointPolicyCommand.ts diff --git a/clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts b/clients/client-s3-control/src/commands/PutPublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutPublicAccessBlockCommand.ts rename to clients/client-s3-control/src/commands/PutPublicAccessBlockCommand.ts diff --git a/clients/client-s3-control/commands/PutStorageLensConfigurationCommand.ts b/clients/client-s3-control/src/commands/PutStorageLensConfigurationCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutStorageLensConfigurationCommand.ts rename to clients/client-s3-control/src/commands/PutStorageLensConfigurationCommand.ts diff --git a/clients/client-s3-control/commands/PutStorageLensConfigurationTaggingCommand.ts b/clients/client-s3-control/src/commands/PutStorageLensConfigurationTaggingCommand.ts similarity index 100% rename from clients/client-s3-control/commands/PutStorageLensConfigurationTaggingCommand.ts rename to clients/client-s3-control/src/commands/PutStorageLensConfigurationTaggingCommand.ts diff --git a/clients/client-s3-control/commands/UpdateJobPriorityCommand.ts b/clients/client-s3-control/src/commands/UpdateJobPriorityCommand.ts similarity index 100% rename from clients/client-s3-control/commands/UpdateJobPriorityCommand.ts rename to clients/client-s3-control/src/commands/UpdateJobPriorityCommand.ts diff --git a/clients/client-s3-control/commands/UpdateJobStatusCommand.ts b/clients/client-s3-control/src/commands/UpdateJobStatusCommand.ts similarity index 100% rename from clients/client-s3-control/commands/UpdateJobStatusCommand.ts rename to clients/client-s3-control/src/commands/UpdateJobStatusCommand.ts diff --git a/clients/client-s3-control/endpoints.ts b/clients/client-s3-control/src/endpoints.ts similarity index 100% rename from clients/client-s3-control/endpoints.ts rename to clients/client-s3-control/src/endpoints.ts diff --git a/clients/client-s3-control/index.ts b/clients/client-s3-control/src/index.ts similarity index 100% rename from clients/client-s3-control/index.ts rename to clients/client-s3-control/src/index.ts diff --git a/clients/client-s3-control/models/index.ts b/clients/client-s3-control/src/models/index.ts similarity index 100% rename from clients/client-s3-control/models/index.ts rename to clients/client-s3-control/src/models/index.ts diff --git a/clients/client-s3-control/models/models_0.ts b/clients/client-s3-control/src/models/models_0.ts similarity index 100% rename from clients/client-s3-control/models/models_0.ts rename to clients/client-s3-control/src/models/models_0.ts diff --git a/clients/client-s3-control/pagination/Interfaces.ts b/clients/client-s3-control/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-s3-control/pagination/Interfaces.ts rename to clients/client-s3-control/src/pagination/Interfaces.ts diff --git a/clients/client-s3-control/pagination/ListAccessPointsForObjectLambdaPaginator.ts b/clients/client-s3-control/src/pagination/ListAccessPointsForObjectLambdaPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListAccessPointsForObjectLambdaPaginator.ts rename to clients/client-s3-control/src/pagination/ListAccessPointsForObjectLambdaPaginator.ts diff --git a/clients/client-s3-control/pagination/ListAccessPointsPaginator.ts b/clients/client-s3-control/src/pagination/ListAccessPointsPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListAccessPointsPaginator.ts rename to clients/client-s3-control/src/pagination/ListAccessPointsPaginator.ts diff --git a/clients/client-s3-control/pagination/ListJobsPaginator.ts b/clients/client-s3-control/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListJobsPaginator.ts rename to clients/client-s3-control/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-s3-control/pagination/ListMultiRegionAccessPointsPaginator.ts b/clients/client-s3-control/src/pagination/ListMultiRegionAccessPointsPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListMultiRegionAccessPointsPaginator.ts rename to clients/client-s3-control/src/pagination/ListMultiRegionAccessPointsPaginator.ts diff --git a/clients/client-s3-control/pagination/ListRegionalBucketsPaginator.ts b/clients/client-s3-control/src/pagination/ListRegionalBucketsPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListRegionalBucketsPaginator.ts rename to clients/client-s3-control/src/pagination/ListRegionalBucketsPaginator.ts diff --git a/clients/client-s3-control/pagination/ListStorageLensConfigurationsPaginator.ts b/clients/client-s3-control/src/pagination/ListStorageLensConfigurationsPaginator.ts similarity index 100% rename from clients/client-s3-control/pagination/ListStorageLensConfigurationsPaginator.ts rename to clients/client-s3-control/src/pagination/ListStorageLensConfigurationsPaginator.ts diff --git a/clients/client-s3-control/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts similarity index 100% rename from clients/client-s3-control/protocols/Aws_restXml.ts rename to clients/client-s3-control/src/protocols/Aws_restXml.ts diff --git a/clients/client-s3-control/src/runtimeConfig.browser.ts b/clients/client-s3-control/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fbcb7b4bacdd --- /dev/null +++ b/clients/client-s3-control/src/runtimeConfig.browser.ts @@ -0,0 +1,45 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { Md5 } from "@aws-sdk/md5-js"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { S3ControlClientConfig } from "./S3ControlClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3ControlClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3-control/runtimeConfig.native.ts b/clients/client-s3-control/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-s3-control/runtimeConfig.native.ts rename to clients/client-s3-control/src/runtimeConfig.native.ts diff --git a/clients/client-s3-control/runtimeConfig.shared.ts b/clients/client-s3-control/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-s3-control/runtimeConfig.shared.ts rename to clients/client-s3-control/src/runtimeConfig.shared.ts diff --git a/clients/client-s3-control/src/runtimeConfig.ts b/clients/client-s3-control/src/runtimeConfig.ts new file mode 100644 index 000000000000..019a0d83863e --- /dev/null +++ b/clients/client-s3-control/src/runtimeConfig.ts @@ -0,0 +1,50 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { S3ControlClientConfig } from "./S3ControlClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3ControlClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + md5: config?.md5 ?? Hash.bind(null, "md5"), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3-control/S3Control.spec.ts b/clients/client-s3-control/test/S3Control.spec.ts similarity index 99% rename from clients/client-s3-control/S3Control.spec.ts rename to clients/client-s3-control/test/S3Control.spec.ts index bfe7d6dc9312..ae2abd59e45d 100644 --- a/clients/client-s3-control/S3Control.spec.ts +++ b/clients/client-s3-control/test/S3Control.spec.ts @@ -1,7 +1,8 @@ /// -import { expect } from "chai"; -import { S3Control } from "./S3Control"; import { FinalizeRequestMiddleware } from "@aws-sdk/types"; +import { expect } from "chai"; + +import { S3Control } from "../src/S3Control"; describe("S3Control Client", () => { // Middleware intercept request and return it before reaching the HTTP client. It records the request and context diff --git a/clients/client-s3-control/tsconfig.es.json b/clients/client-s3-control/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-s3-control/tsconfig.es.json +++ b/clients/client-s3-control/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-s3-control/tsconfig.json b/clients/client-s3-control/tsconfig.json index 846d726e4644..cbb7e0dec925 100644 --- a/clients/client-s3-control/tsconfig.json +++ b/clients/client-s3-control/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true, "types": ["mocha", "node"] }, @@ -28,5 +29,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-s3-control/tsconfig.types.json b/clients/client-s3-control/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-s3-control/tsconfig.types.json +++ b/clients/client-s3-control/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-s3/.gitignore b/clients/client-s3/.gitignore index 09915454c880..bbc99354973f 100644 --- a/clients/client-s3/.gitignore +++ b/clients/client-s3/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-s3/karma.conf.js b/clients/client-s3/karma.conf.js index e23ce94b53e1..6f967a55d283 100644 --- a/clients/client-s3/karma.conf.js +++ b/clients/client-s3/karma.conf.js @@ -1,10 +1,12 @@ +const webpack = require("webpack"); + module.exports = function (config) { config.set({ basePath: "", frameworks: ["mocha", "chai"], - files: ["e2e/**/*.ispec.ts"], + files: ["test/e2e/**/*.ispec.ts"], preprocessors: { - "e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], + "test/e2e/**/*.ispec.ts": ["webpack", "sourcemap", "credentials", "env"], }, webpackMiddleware: { stats: "minimal", @@ -33,6 +35,7 @@ module.exports = function (config) { }, ], }, + plugins: [new webpack.NormalModuleReplacementPlugin(/\.\/runtimeConfig$/, "./runtimeConfig.browser")], devtool: "inline-source-map", }, envPreprocessor: ["AWS_SMOKE_TEST_REGION", "AWS_SMOKE_TEST_BUCKET"], diff --git a/clients/client-s3/package.json b/clients/client-s3/package.json index d84391e8696b..9be3b6ee4db7 100644 --- a/clients/client-s3/package.json +++ b/clients/client-s3/package.json @@ -11,20 +11,14 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "yarn test:unit", - "test:e2e": "mocha **/cjs/**/*.ispec.js && karma start karma.conf.js", - "test:unit": "mocha **/cjs/**/*.spec.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" + "test:e2e": "ts-mocha test/**/*.ispec.ts && karma start karma.conf.js", + "test:unit": "ts-mocha test/**/*.spec.ts" }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -92,8 +86,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -102,6 +96,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3", "repository": { "type": "git", diff --git a/clients/client-s3/runtimeConfig.browser.ts b/clients/client-s3/runtimeConfig.browser.ts deleted file mode 100644 index f1221b4e257a..000000000000 --- a/clients/client-s3/runtimeConfig.browser.ts +++ /dev/null @@ -1,46 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { Md5 } from "@aws-sdk/md5-js"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { S3ClientConfig } from "./S3Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - md5: config?.md5 ?? Md5, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3/runtimeConfig.ts b/clients/client-s3/runtimeConfig.ts deleted file mode 100644 index 891e3a684e05..000000000000 --- a/clients/client-s3/runtimeConfig.ts +++ /dev/null @@ -1,53 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; -import { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { S3ClientConfig } from "./S3Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS), - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3/S3.ts b/clients/client-s3/src/S3.ts similarity index 100% rename from clients/client-s3/S3.ts rename to clients/client-s3/src/S3.ts diff --git a/clients/client-s3/S3Client.ts b/clients/client-s3/src/S3Client.ts similarity index 100% rename from clients/client-s3/S3Client.ts rename to clients/client-s3/src/S3Client.ts diff --git a/clients/client-s3/commands/AbortMultipartUploadCommand.ts b/clients/client-s3/src/commands/AbortMultipartUploadCommand.ts similarity index 100% rename from clients/client-s3/commands/AbortMultipartUploadCommand.ts rename to clients/client-s3/src/commands/AbortMultipartUploadCommand.ts diff --git a/clients/client-s3/commands/CompleteMultipartUploadCommand.ts b/clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts similarity index 100% rename from clients/client-s3/commands/CompleteMultipartUploadCommand.ts rename to clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts diff --git a/clients/client-s3/commands/CopyObjectCommand.ts b/clients/client-s3/src/commands/CopyObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/CopyObjectCommand.ts rename to clients/client-s3/src/commands/CopyObjectCommand.ts diff --git a/clients/client-s3/commands/CreateBucketCommand.ts b/clients/client-s3/src/commands/CreateBucketCommand.ts similarity index 100% rename from clients/client-s3/commands/CreateBucketCommand.ts rename to clients/client-s3/src/commands/CreateBucketCommand.ts diff --git a/clients/client-s3/commands/CreateMultipartUploadCommand.ts b/clients/client-s3/src/commands/CreateMultipartUploadCommand.ts similarity index 100% rename from clients/client-s3/commands/CreateMultipartUploadCommand.ts rename to clients/client-s3/src/commands/CreateMultipartUploadCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketAnalyticsConfigurationCommand.ts b/clients/client-s3/src/commands/DeleteBucketAnalyticsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketAnalyticsConfigurationCommand.ts rename to clients/client-s3/src/commands/DeleteBucketAnalyticsConfigurationCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketCommand.ts b/clients/client-s3/src/commands/DeleteBucketCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketCommand.ts rename to clients/client-s3/src/commands/DeleteBucketCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketCorsCommand.ts b/clients/client-s3/src/commands/DeleteBucketCorsCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketCorsCommand.ts rename to clients/client-s3/src/commands/DeleteBucketCorsCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketEncryptionCommand.ts b/clients/client-s3/src/commands/DeleteBucketEncryptionCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketEncryptionCommand.ts rename to clients/client-s3/src/commands/DeleteBucketEncryptionCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketIntelligentTieringConfigurationCommand.ts b/clients/client-s3/src/commands/DeleteBucketIntelligentTieringConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketIntelligentTieringConfigurationCommand.ts rename to clients/client-s3/src/commands/DeleteBucketIntelligentTieringConfigurationCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketInventoryConfigurationCommand.ts b/clients/client-s3/src/commands/DeleteBucketInventoryConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketInventoryConfigurationCommand.ts rename to clients/client-s3/src/commands/DeleteBucketInventoryConfigurationCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketLifecycleCommand.ts b/clients/client-s3/src/commands/DeleteBucketLifecycleCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketLifecycleCommand.ts rename to clients/client-s3/src/commands/DeleteBucketLifecycleCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketMetricsConfigurationCommand.ts b/clients/client-s3/src/commands/DeleteBucketMetricsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketMetricsConfigurationCommand.ts rename to clients/client-s3/src/commands/DeleteBucketMetricsConfigurationCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketOwnershipControlsCommand.ts b/clients/client-s3/src/commands/DeleteBucketOwnershipControlsCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketOwnershipControlsCommand.ts rename to clients/client-s3/src/commands/DeleteBucketOwnershipControlsCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketPolicyCommand.ts b/clients/client-s3/src/commands/DeleteBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketPolicyCommand.ts rename to clients/client-s3/src/commands/DeleteBucketPolicyCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketReplicationCommand.ts b/clients/client-s3/src/commands/DeleteBucketReplicationCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketReplicationCommand.ts rename to clients/client-s3/src/commands/DeleteBucketReplicationCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketTaggingCommand.ts b/clients/client-s3/src/commands/DeleteBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketTaggingCommand.ts rename to clients/client-s3/src/commands/DeleteBucketTaggingCommand.ts diff --git a/clients/client-s3/commands/DeleteBucketWebsiteCommand.ts b/clients/client-s3/src/commands/DeleteBucketWebsiteCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteBucketWebsiteCommand.ts rename to clients/client-s3/src/commands/DeleteBucketWebsiteCommand.ts diff --git a/clients/client-s3/commands/DeleteObjectCommand.ts b/clients/client-s3/src/commands/DeleteObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteObjectCommand.ts rename to clients/client-s3/src/commands/DeleteObjectCommand.ts diff --git a/clients/client-s3/commands/DeleteObjectTaggingCommand.ts b/clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteObjectTaggingCommand.ts rename to clients/client-s3/src/commands/DeleteObjectTaggingCommand.ts diff --git a/clients/client-s3/commands/DeleteObjectsCommand.ts b/clients/client-s3/src/commands/DeleteObjectsCommand.ts similarity index 100% rename from clients/client-s3/commands/DeleteObjectsCommand.ts rename to clients/client-s3/src/commands/DeleteObjectsCommand.ts diff --git a/clients/client-s3/commands/DeletePublicAccessBlockCommand.ts b/clients/client-s3/src/commands/DeletePublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3/commands/DeletePublicAccessBlockCommand.ts rename to clients/client-s3/src/commands/DeletePublicAccessBlockCommand.ts diff --git a/clients/client-s3/commands/GetBucketAccelerateConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketAccelerateConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketAccelerateConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketAccelerateConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketAclCommand.ts b/clients/client-s3/src/commands/GetBucketAclCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketAclCommand.ts rename to clients/client-s3/src/commands/GetBucketAclCommand.ts diff --git a/clients/client-s3/commands/GetBucketAnalyticsConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketAnalyticsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketAnalyticsConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketAnalyticsConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketCorsCommand.ts b/clients/client-s3/src/commands/GetBucketCorsCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketCorsCommand.ts rename to clients/client-s3/src/commands/GetBucketCorsCommand.ts diff --git a/clients/client-s3/commands/GetBucketEncryptionCommand.ts b/clients/client-s3/src/commands/GetBucketEncryptionCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketEncryptionCommand.ts rename to clients/client-s3/src/commands/GetBucketEncryptionCommand.ts diff --git a/clients/client-s3/commands/GetBucketIntelligentTieringConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketIntelligentTieringConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketIntelligentTieringConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketIntelligentTieringConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketInventoryConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketInventoryConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketInventoryConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketInventoryConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketLifecycleConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketLifecycleConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketLifecycleConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketLocationCommand.ts b/clients/client-s3/src/commands/GetBucketLocationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketLocationCommand.ts rename to clients/client-s3/src/commands/GetBucketLocationCommand.ts diff --git a/clients/client-s3/commands/GetBucketLoggingCommand.ts b/clients/client-s3/src/commands/GetBucketLoggingCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketLoggingCommand.ts rename to clients/client-s3/src/commands/GetBucketLoggingCommand.ts diff --git a/clients/client-s3/commands/GetBucketMetricsConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketMetricsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketMetricsConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketMetricsConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketNotificationConfigurationCommand.ts b/clients/client-s3/src/commands/GetBucketNotificationConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketNotificationConfigurationCommand.ts rename to clients/client-s3/src/commands/GetBucketNotificationConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetBucketOwnershipControlsCommand.ts b/clients/client-s3/src/commands/GetBucketOwnershipControlsCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketOwnershipControlsCommand.ts rename to clients/client-s3/src/commands/GetBucketOwnershipControlsCommand.ts diff --git a/clients/client-s3/commands/GetBucketPolicyCommand.ts b/clients/client-s3/src/commands/GetBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketPolicyCommand.ts rename to clients/client-s3/src/commands/GetBucketPolicyCommand.ts diff --git a/clients/client-s3/commands/GetBucketPolicyStatusCommand.ts b/clients/client-s3/src/commands/GetBucketPolicyStatusCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketPolicyStatusCommand.ts rename to clients/client-s3/src/commands/GetBucketPolicyStatusCommand.ts diff --git a/clients/client-s3/commands/GetBucketReplicationCommand.ts b/clients/client-s3/src/commands/GetBucketReplicationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketReplicationCommand.ts rename to clients/client-s3/src/commands/GetBucketReplicationCommand.ts diff --git a/clients/client-s3/commands/GetBucketRequestPaymentCommand.ts b/clients/client-s3/src/commands/GetBucketRequestPaymentCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketRequestPaymentCommand.ts rename to clients/client-s3/src/commands/GetBucketRequestPaymentCommand.ts diff --git a/clients/client-s3/commands/GetBucketTaggingCommand.ts b/clients/client-s3/src/commands/GetBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketTaggingCommand.ts rename to clients/client-s3/src/commands/GetBucketTaggingCommand.ts diff --git a/clients/client-s3/commands/GetBucketVersioningCommand.ts b/clients/client-s3/src/commands/GetBucketVersioningCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketVersioningCommand.ts rename to clients/client-s3/src/commands/GetBucketVersioningCommand.ts diff --git a/clients/client-s3/commands/GetBucketWebsiteCommand.ts b/clients/client-s3/src/commands/GetBucketWebsiteCommand.ts similarity index 100% rename from clients/client-s3/commands/GetBucketWebsiteCommand.ts rename to clients/client-s3/src/commands/GetBucketWebsiteCommand.ts diff --git a/clients/client-s3/commands/GetObjectAclCommand.ts b/clients/client-s3/src/commands/GetObjectAclCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectAclCommand.ts rename to clients/client-s3/src/commands/GetObjectAclCommand.ts diff --git a/clients/client-s3/commands/GetObjectCommand.ts b/clients/client-s3/src/commands/GetObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectCommand.ts rename to clients/client-s3/src/commands/GetObjectCommand.ts diff --git a/clients/client-s3/commands/GetObjectLegalHoldCommand.ts b/clients/client-s3/src/commands/GetObjectLegalHoldCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectLegalHoldCommand.ts rename to clients/client-s3/src/commands/GetObjectLegalHoldCommand.ts diff --git a/clients/client-s3/commands/GetObjectLockConfigurationCommand.ts b/clients/client-s3/src/commands/GetObjectLockConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectLockConfigurationCommand.ts rename to clients/client-s3/src/commands/GetObjectLockConfigurationCommand.ts diff --git a/clients/client-s3/commands/GetObjectRetentionCommand.ts b/clients/client-s3/src/commands/GetObjectRetentionCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectRetentionCommand.ts rename to clients/client-s3/src/commands/GetObjectRetentionCommand.ts diff --git a/clients/client-s3/commands/GetObjectTaggingCommand.ts b/clients/client-s3/src/commands/GetObjectTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectTaggingCommand.ts rename to clients/client-s3/src/commands/GetObjectTaggingCommand.ts diff --git a/clients/client-s3/commands/GetObjectTorrentCommand.ts b/clients/client-s3/src/commands/GetObjectTorrentCommand.ts similarity index 100% rename from clients/client-s3/commands/GetObjectTorrentCommand.ts rename to clients/client-s3/src/commands/GetObjectTorrentCommand.ts diff --git a/clients/client-s3/commands/GetPublicAccessBlockCommand.ts b/clients/client-s3/src/commands/GetPublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3/commands/GetPublicAccessBlockCommand.ts rename to clients/client-s3/src/commands/GetPublicAccessBlockCommand.ts diff --git a/clients/client-s3/commands/HeadBucketCommand.ts b/clients/client-s3/src/commands/HeadBucketCommand.ts similarity index 100% rename from clients/client-s3/commands/HeadBucketCommand.ts rename to clients/client-s3/src/commands/HeadBucketCommand.ts diff --git a/clients/client-s3/commands/HeadObjectCommand.ts b/clients/client-s3/src/commands/HeadObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/HeadObjectCommand.ts rename to clients/client-s3/src/commands/HeadObjectCommand.ts diff --git a/clients/client-s3/commands/ListBucketAnalyticsConfigurationsCommand.ts b/clients/client-s3/src/commands/ListBucketAnalyticsConfigurationsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListBucketAnalyticsConfigurationsCommand.ts rename to clients/client-s3/src/commands/ListBucketAnalyticsConfigurationsCommand.ts diff --git a/clients/client-s3/commands/ListBucketIntelligentTieringConfigurationsCommand.ts b/clients/client-s3/src/commands/ListBucketIntelligentTieringConfigurationsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListBucketIntelligentTieringConfigurationsCommand.ts rename to clients/client-s3/src/commands/ListBucketIntelligentTieringConfigurationsCommand.ts diff --git a/clients/client-s3/commands/ListBucketInventoryConfigurationsCommand.ts b/clients/client-s3/src/commands/ListBucketInventoryConfigurationsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListBucketInventoryConfigurationsCommand.ts rename to clients/client-s3/src/commands/ListBucketInventoryConfigurationsCommand.ts diff --git a/clients/client-s3/commands/ListBucketMetricsConfigurationsCommand.ts b/clients/client-s3/src/commands/ListBucketMetricsConfigurationsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListBucketMetricsConfigurationsCommand.ts rename to clients/client-s3/src/commands/ListBucketMetricsConfigurationsCommand.ts diff --git a/clients/client-s3/commands/ListBucketsCommand.ts b/clients/client-s3/src/commands/ListBucketsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListBucketsCommand.ts rename to clients/client-s3/src/commands/ListBucketsCommand.ts diff --git a/clients/client-s3/commands/ListMultipartUploadsCommand.ts b/clients/client-s3/src/commands/ListMultipartUploadsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListMultipartUploadsCommand.ts rename to clients/client-s3/src/commands/ListMultipartUploadsCommand.ts diff --git a/clients/client-s3/commands/ListObjectVersionsCommand.ts b/clients/client-s3/src/commands/ListObjectVersionsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListObjectVersionsCommand.ts rename to clients/client-s3/src/commands/ListObjectVersionsCommand.ts diff --git a/clients/client-s3/commands/ListObjectsCommand.ts b/clients/client-s3/src/commands/ListObjectsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListObjectsCommand.ts rename to clients/client-s3/src/commands/ListObjectsCommand.ts diff --git a/clients/client-s3/commands/ListObjectsV2Command.ts b/clients/client-s3/src/commands/ListObjectsV2Command.ts similarity index 100% rename from clients/client-s3/commands/ListObjectsV2Command.ts rename to clients/client-s3/src/commands/ListObjectsV2Command.ts diff --git a/clients/client-s3/commands/ListPartsCommand.ts b/clients/client-s3/src/commands/ListPartsCommand.ts similarity index 100% rename from clients/client-s3/commands/ListPartsCommand.ts rename to clients/client-s3/src/commands/ListPartsCommand.ts diff --git a/clients/client-s3/commands/PutBucketAccelerateConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketAccelerateConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketAccelerateConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketAclCommand.ts b/clients/client-s3/src/commands/PutBucketAclCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketAclCommand.ts rename to clients/client-s3/src/commands/PutBucketAclCommand.ts diff --git a/clients/client-s3/commands/PutBucketAnalyticsConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketAnalyticsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketAnalyticsConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketAnalyticsConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketCorsCommand.ts b/clients/client-s3/src/commands/PutBucketCorsCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketCorsCommand.ts rename to clients/client-s3/src/commands/PutBucketCorsCommand.ts diff --git a/clients/client-s3/commands/PutBucketEncryptionCommand.ts b/clients/client-s3/src/commands/PutBucketEncryptionCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketEncryptionCommand.ts rename to clients/client-s3/src/commands/PutBucketEncryptionCommand.ts diff --git a/clients/client-s3/commands/PutBucketIntelligentTieringConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketIntelligentTieringConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketIntelligentTieringConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketIntelligentTieringConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketInventoryConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketInventoryConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketInventoryConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketInventoryConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketLifecycleConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketLifecycleConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketLifecycleConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketLoggingCommand.ts b/clients/client-s3/src/commands/PutBucketLoggingCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketLoggingCommand.ts rename to clients/client-s3/src/commands/PutBucketLoggingCommand.ts diff --git a/clients/client-s3/commands/PutBucketMetricsConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketMetricsConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketMetricsConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketMetricsConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketNotificationConfigurationCommand.ts b/clients/client-s3/src/commands/PutBucketNotificationConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketNotificationConfigurationCommand.ts rename to clients/client-s3/src/commands/PutBucketNotificationConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutBucketOwnershipControlsCommand.ts b/clients/client-s3/src/commands/PutBucketOwnershipControlsCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketOwnershipControlsCommand.ts rename to clients/client-s3/src/commands/PutBucketOwnershipControlsCommand.ts diff --git a/clients/client-s3/commands/PutBucketPolicyCommand.ts b/clients/client-s3/src/commands/PutBucketPolicyCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketPolicyCommand.ts rename to clients/client-s3/src/commands/PutBucketPolicyCommand.ts diff --git a/clients/client-s3/commands/PutBucketReplicationCommand.ts b/clients/client-s3/src/commands/PutBucketReplicationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketReplicationCommand.ts rename to clients/client-s3/src/commands/PutBucketReplicationCommand.ts diff --git a/clients/client-s3/commands/PutBucketRequestPaymentCommand.ts b/clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketRequestPaymentCommand.ts rename to clients/client-s3/src/commands/PutBucketRequestPaymentCommand.ts diff --git a/clients/client-s3/commands/PutBucketTaggingCommand.ts b/clients/client-s3/src/commands/PutBucketTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketTaggingCommand.ts rename to clients/client-s3/src/commands/PutBucketTaggingCommand.ts diff --git a/clients/client-s3/commands/PutBucketVersioningCommand.ts b/clients/client-s3/src/commands/PutBucketVersioningCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketVersioningCommand.ts rename to clients/client-s3/src/commands/PutBucketVersioningCommand.ts diff --git a/clients/client-s3/commands/PutBucketWebsiteCommand.ts b/clients/client-s3/src/commands/PutBucketWebsiteCommand.ts similarity index 100% rename from clients/client-s3/commands/PutBucketWebsiteCommand.ts rename to clients/client-s3/src/commands/PutBucketWebsiteCommand.ts diff --git a/clients/client-s3/commands/PutObjectAclCommand.ts b/clients/client-s3/src/commands/PutObjectAclCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectAclCommand.ts rename to clients/client-s3/src/commands/PutObjectAclCommand.ts diff --git a/clients/client-s3/commands/PutObjectCommand.ts b/clients/client-s3/src/commands/PutObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectCommand.ts rename to clients/client-s3/src/commands/PutObjectCommand.ts diff --git a/clients/client-s3/commands/PutObjectLegalHoldCommand.ts b/clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectLegalHoldCommand.ts rename to clients/client-s3/src/commands/PutObjectLegalHoldCommand.ts diff --git a/clients/client-s3/commands/PutObjectLockConfigurationCommand.ts b/clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectLockConfigurationCommand.ts rename to clients/client-s3/src/commands/PutObjectLockConfigurationCommand.ts diff --git a/clients/client-s3/commands/PutObjectRetentionCommand.ts b/clients/client-s3/src/commands/PutObjectRetentionCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectRetentionCommand.ts rename to clients/client-s3/src/commands/PutObjectRetentionCommand.ts diff --git a/clients/client-s3/commands/PutObjectTaggingCommand.ts b/clients/client-s3/src/commands/PutObjectTaggingCommand.ts similarity index 100% rename from clients/client-s3/commands/PutObjectTaggingCommand.ts rename to clients/client-s3/src/commands/PutObjectTaggingCommand.ts diff --git a/clients/client-s3/commands/PutPublicAccessBlockCommand.ts b/clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts similarity index 100% rename from clients/client-s3/commands/PutPublicAccessBlockCommand.ts rename to clients/client-s3/src/commands/PutPublicAccessBlockCommand.ts diff --git a/clients/client-s3/commands/RestoreObjectCommand.ts b/clients/client-s3/src/commands/RestoreObjectCommand.ts similarity index 100% rename from clients/client-s3/commands/RestoreObjectCommand.ts rename to clients/client-s3/src/commands/RestoreObjectCommand.ts diff --git a/clients/client-s3/commands/SelectObjectContentCommand.ts b/clients/client-s3/src/commands/SelectObjectContentCommand.ts similarity index 100% rename from clients/client-s3/commands/SelectObjectContentCommand.ts rename to clients/client-s3/src/commands/SelectObjectContentCommand.ts diff --git a/clients/client-s3/commands/UploadPartCommand.ts b/clients/client-s3/src/commands/UploadPartCommand.ts similarity index 100% rename from clients/client-s3/commands/UploadPartCommand.ts rename to clients/client-s3/src/commands/UploadPartCommand.ts diff --git a/clients/client-s3/commands/UploadPartCopyCommand.ts b/clients/client-s3/src/commands/UploadPartCopyCommand.ts similarity index 100% rename from clients/client-s3/commands/UploadPartCopyCommand.ts rename to clients/client-s3/src/commands/UploadPartCopyCommand.ts diff --git a/clients/client-s3/commands/WriteGetObjectResponseCommand.ts b/clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts similarity index 100% rename from clients/client-s3/commands/WriteGetObjectResponseCommand.ts rename to clients/client-s3/src/commands/WriteGetObjectResponseCommand.ts diff --git a/clients/client-s3/endpoints.ts b/clients/client-s3/src/endpoints.ts similarity index 100% rename from clients/client-s3/endpoints.ts rename to clients/client-s3/src/endpoints.ts diff --git a/clients/client-s3/index.ts b/clients/client-s3/src/index.ts similarity index 100% rename from clients/client-s3/index.ts rename to clients/client-s3/src/index.ts diff --git a/clients/client-s3/models/index.ts b/clients/client-s3/src/models/index.ts similarity index 100% rename from clients/client-s3/models/index.ts rename to clients/client-s3/src/models/index.ts diff --git a/clients/client-s3/models/models_0.ts b/clients/client-s3/src/models/models_0.ts similarity index 100% rename from clients/client-s3/models/models_0.ts rename to clients/client-s3/src/models/models_0.ts diff --git a/clients/client-s3/models/models_1.ts b/clients/client-s3/src/models/models_1.ts similarity index 100% rename from clients/client-s3/models/models_1.ts rename to clients/client-s3/src/models/models_1.ts diff --git a/clients/client-s3/pagination/Interfaces.ts b/clients/client-s3/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-s3/pagination/Interfaces.ts rename to clients/client-s3/src/pagination/Interfaces.ts diff --git a/clients/client-s3/pagination/ListObjectsV2Paginator.ts b/clients/client-s3/src/pagination/ListObjectsV2Paginator.ts similarity index 100% rename from clients/client-s3/pagination/ListObjectsV2Paginator.ts rename to clients/client-s3/src/pagination/ListObjectsV2Paginator.ts diff --git a/clients/client-s3/pagination/ListPartsPaginator.ts b/clients/client-s3/src/pagination/ListPartsPaginator.ts similarity index 100% rename from clients/client-s3/pagination/ListPartsPaginator.ts rename to clients/client-s3/src/pagination/ListPartsPaginator.ts diff --git a/clients/client-s3/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts similarity index 100% rename from clients/client-s3/protocols/Aws_restXml.ts rename to clients/client-s3/src/protocols/Aws_restXml.ts diff --git a/clients/client-s3/src/runtimeConfig.browser.ts b/clients/client-s3/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f61388213e3c --- /dev/null +++ b/clients/client-s3/src/runtimeConfig.browser.ts @@ -0,0 +1,47 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { Md5 } from "@aws-sdk/md5-js"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { S3ClientConfig } from "./S3Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3/runtimeConfig.native.ts b/clients/client-s3/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-s3/runtimeConfig.native.ts rename to clients/client-s3/src/runtimeConfig.native.ts diff --git a/clients/client-s3/runtimeConfig.shared.ts b/clients/client-s3/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-s3/runtimeConfig.shared.ts rename to clients/client-s3/src/runtimeConfig.shared.ts diff --git a/clients/client-s3/src/runtimeConfig.ts b/clients/client-s3/src/runtimeConfig.ts new file mode 100644 index 000000000000..a1074e6934ee --- /dev/null +++ b/clients/client-s3/src/runtimeConfig.ts @@ -0,0 +1,54 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; +import { NODE_USE_ARN_REGION_CONFIG_OPTIONS } from "@aws-sdk/middleware-bucket-endpoint"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { S3ClientConfig } from "./S3Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + md5: config?.md5 ?? Hash.bind(null, "md5"), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS), + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3/waiters/waitForBucketExists.ts b/clients/client-s3/src/waiters/waitForBucketExists.ts similarity index 100% rename from clients/client-s3/waiters/waitForBucketExists.ts rename to clients/client-s3/src/waiters/waitForBucketExists.ts diff --git a/clients/client-s3/waiters/waitForBucketNotExists.ts b/clients/client-s3/src/waiters/waitForBucketNotExists.ts similarity index 100% rename from clients/client-s3/waiters/waitForBucketNotExists.ts rename to clients/client-s3/src/waiters/waitForBucketNotExists.ts diff --git a/clients/client-s3/waiters/waitForObjectExists.ts b/clients/client-s3/src/waiters/waitForObjectExists.ts similarity index 100% rename from clients/client-s3/waiters/waitForObjectExists.ts rename to clients/client-s3/src/waiters/waitForObjectExists.ts diff --git a/clients/client-s3/waiters/waitForObjectNotExists.ts b/clients/client-s3/src/waiters/waitForObjectNotExists.ts similarity index 100% rename from clients/client-s3/waiters/waitForObjectNotExists.ts rename to clients/client-s3/src/waiters/waitForObjectNotExists.ts diff --git a/clients/client-s3/S3.spec.ts b/clients/client-s3/test/S3.spec.ts similarity index 99% rename from clients/client-s3/S3.spec.ts rename to clients/client-s3/test/S3.spec.ts index 63006b796223..d1b5446fd8c1 100644 --- a/clients/client-s3/S3.spec.ts +++ b/clients/client-s3/test/S3.spec.ts @@ -5,7 +5,7 @@ import chai from "chai"; import chaiAsPromised from "chai-as-promised"; import { PassThrough } from "stream"; -import { S3 } from "./S3"; +import { S3 } from "../src/S3"; chai.use(chaiAsPromised); const { expect } = chai; diff --git a/clients/client-s3/e2e/README.md b/clients/client-s3/test/e2e/README.md similarity index 100% rename from clients/client-s3/e2e/README.md rename to clients/client-s3/test/e2e/README.md diff --git a/clients/client-s3/e2e/S3.ispec.ts b/clients/client-s3/test/e2e/S3.ispec.ts similarity index 99% rename from clients/client-s3/e2e/S3.ispec.ts rename to clients/client-s3/test/e2e/S3.ispec.ts index 23224069c4b6..7ad1859dcce6 100644 --- a/clients/client-s3/e2e/S3.ispec.ts +++ b/clients/client-s3/test/e2e/S3.ispec.ts @@ -3,10 +3,11 @@ * This is the integration test that make sure the client can make request cross-platform-ly * in NodeJS, Chromium and Firefox. This test is written in mocha. */ +import { Credentials } from "@aws-sdk/types"; import chai from "chai"; import chaiAsPromised from "chai-as-promised"; -import { S3 } from "../index"; -import { Credentials } from "@aws-sdk/types"; + +import { S3 } from "../../src/index"; import { createBuffer } from "./helpers"; chai.use(chaiAsPromised); const { expect } = chai; diff --git a/clients/client-s3/e2e/helpers.ts b/clients/client-s3/test/e2e/helpers.ts similarity index 100% rename from clients/client-s3/e2e/helpers.ts rename to clients/client-s3/test/e2e/helpers.ts diff --git a/clients/client-s3/tsconfig.es.json b/clients/client-s3/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-s3/tsconfig.es.json +++ b/clients/client-s3/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-s3/tsconfig.json b/clients/client-s3/tsconfig.json index 846d726e4644..cbb7e0dec925 100644 --- a/clients/client-s3/tsconfig.json +++ b/clients/client-s3/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true, "types": ["mocha", "node"] }, @@ -28,5 +29,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-s3/tsconfig.types.json b/clients/client-s3/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-s3/tsconfig.types.json +++ b/clients/client-s3/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-s3outposts/.gitignore b/clients/client-s3outposts/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-s3outposts/.gitignore +++ b/clients/client-s3outposts/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-s3outposts/package.json b/clients/client-s3outposts/package.json index 5eaaeb8f315e..46946dfe1601 100644 --- a/clients/client-s3outposts/package.json +++ b/clients/client-s3outposts/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3outposts", "repository": { "type": "git", diff --git a/clients/client-s3outposts/runtimeConfig.browser.ts b/clients/client-s3outposts/runtimeConfig.browser.ts deleted file mode 100644 index c30e413bad96..000000000000 --- a/clients/client-s3outposts/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { S3OutpostsClientConfig } from "./S3OutpostsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3outposts/runtimeConfig.ts b/clients/client-s3outposts/runtimeConfig.ts deleted file mode 100644 index 7e0cbf3b1cac..000000000000 --- a/clients/client-s3outposts/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { S3OutpostsClientConfig } from "./S3OutpostsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-s3outposts/S3Outposts.ts b/clients/client-s3outposts/src/S3Outposts.ts similarity index 100% rename from clients/client-s3outposts/S3Outposts.ts rename to clients/client-s3outposts/src/S3Outposts.ts diff --git a/clients/client-s3outposts/S3OutpostsClient.ts b/clients/client-s3outposts/src/S3OutpostsClient.ts similarity index 100% rename from clients/client-s3outposts/S3OutpostsClient.ts rename to clients/client-s3outposts/src/S3OutpostsClient.ts diff --git a/clients/client-s3outposts/commands/CreateEndpointCommand.ts b/clients/client-s3outposts/src/commands/CreateEndpointCommand.ts similarity index 100% rename from clients/client-s3outposts/commands/CreateEndpointCommand.ts rename to clients/client-s3outposts/src/commands/CreateEndpointCommand.ts diff --git a/clients/client-s3outposts/commands/DeleteEndpointCommand.ts b/clients/client-s3outposts/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-s3outposts/commands/DeleteEndpointCommand.ts rename to clients/client-s3outposts/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-s3outposts/commands/ListEndpointsCommand.ts b/clients/client-s3outposts/src/commands/ListEndpointsCommand.ts similarity index 100% rename from clients/client-s3outposts/commands/ListEndpointsCommand.ts rename to clients/client-s3outposts/src/commands/ListEndpointsCommand.ts diff --git a/clients/client-s3outposts/endpoints.ts b/clients/client-s3outposts/src/endpoints.ts similarity index 100% rename from clients/client-s3outposts/endpoints.ts rename to clients/client-s3outposts/src/endpoints.ts diff --git a/clients/client-s3outposts/index.ts b/clients/client-s3outposts/src/index.ts similarity index 100% rename from clients/client-s3outposts/index.ts rename to clients/client-s3outposts/src/index.ts diff --git a/clients/client-s3outposts/models/index.ts b/clients/client-s3outposts/src/models/index.ts similarity index 100% rename from clients/client-s3outposts/models/index.ts rename to clients/client-s3outposts/src/models/index.ts diff --git a/clients/client-s3outposts/models/models_0.ts b/clients/client-s3outposts/src/models/models_0.ts similarity index 100% rename from clients/client-s3outposts/models/models_0.ts rename to clients/client-s3outposts/src/models/models_0.ts diff --git a/clients/client-s3outposts/pagination/Interfaces.ts b/clients/client-s3outposts/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-s3outposts/pagination/Interfaces.ts rename to clients/client-s3outposts/src/pagination/Interfaces.ts diff --git a/clients/client-s3outposts/pagination/ListEndpointsPaginator.ts b/clients/client-s3outposts/src/pagination/ListEndpointsPaginator.ts similarity index 100% rename from clients/client-s3outposts/pagination/ListEndpointsPaginator.ts rename to clients/client-s3outposts/src/pagination/ListEndpointsPaginator.ts diff --git a/clients/client-s3outposts/protocols/Aws_restJson1.ts b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-s3outposts/protocols/Aws_restJson1.ts rename to clients/client-s3outposts/src/protocols/Aws_restJson1.ts diff --git a/clients/client-s3outposts/src/runtimeConfig.browser.ts b/clients/client-s3outposts/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1ac1c4a0671a --- /dev/null +++ b/clients/client-s3outposts/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { S3OutpostsClientConfig } from "./S3OutpostsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3outposts/runtimeConfig.native.ts b/clients/client-s3outposts/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-s3outposts/runtimeConfig.native.ts rename to clients/client-s3outposts/src/runtimeConfig.native.ts diff --git a/clients/client-s3outposts/runtimeConfig.shared.ts b/clients/client-s3outposts/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-s3outposts/runtimeConfig.shared.ts rename to clients/client-s3outposts/src/runtimeConfig.shared.ts diff --git a/clients/client-s3outposts/src/runtimeConfig.ts b/clients/client-s3outposts/src/runtimeConfig.ts new file mode 100644 index 000000000000..8ba7ddcc2a66 --- /dev/null +++ b/clients/client-s3outposts/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { S3OutpostsClientConfig } from "./S3OutpostsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-s3outposts/tsconfig.es.json b/clients/client-s3outposts/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-s3outposts/tsconfig.es.json +++ b/clients/client-s3outposts/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-s3outposts/tsconfig.json b/clients/client-s3outposts/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-s3outposts/tsconfig.json +++ b/clients/client-s3outposts/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-s3outposts/tsconfig.types.json b/clients/client-s3outposts/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-s3outposts/tsconfig.types.json +++ b/clients/client-s3outposts/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sagemaker-a2i-runtime/.gitignore b/clients/client-sagemaker-a2i-runtime/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sagemaker-a2i-runtime/.gitignore +++ b/clients/client-sagemaker-a2i-runtime/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sagemaker-a2i-runtime/package.json b/clients/client-sagemaker-a2i-runtime/package.json index bbf37e6fa9f3..7fe05024b827 100644 --- a/clients/client-sagemaker-a2i-runtime/package.json +++ b/clients/client-sagemaker-a2i-runtime/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sagemaker-a2i-runtime", "repository": { "type": "git", diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts deleted file mode 100644 index ca0f01de6d39..000000000000 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SageMakerA2IRuntimeClientConfig } from "./SageMakerA2IRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts deleted file mode 100644 index 7c550bd10d00..000000000000 --- a/clients/client-sagemaker-a2i-runtime/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SageMakerA2IRuntimeClientConfig } from "./SageMakerA2IRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntime.ts b/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntime.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntime.ts rename to clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntime.ts diff --git a/clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts b/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/SageMakerA2IRuntimeClient.ts rename to clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts diff --git a/clients/client-sagemaker-a2i-runtime/commands/DeleteHumanLoopCommand.ts b/clients/client-sagemaker-a2i-runtime/src/commands/DeleteHumanLoopCommand.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/commands/DeleteHumanLoopCommand.ts rename to clients/client-sagemaker-a2i-runtime/src/commands/DeleteHumanLoopCommand.ts diff --git a/clients/client-sagemaker-a2i-runtime/commands/DescribeHumanLoopCommand.ts b/clients/client-sagemaker-a2i-runtime/src/commands/DescribeHumanLoopCommand.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/commands/DescribeHumanLoopCommand.ts rename to clients/client-sagemaker-a2i-runtime/src/commands/DescribeHumanLoopCommand.ts diff --git a/clients/client-sagemaker-a2i-runtime/commands/ListHumanLoopsCommand.ts b/clients/client-sagemaker-a2i-runtime/src/commands/ListHumanLoopsCommand.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/commands/ListHumanLoopsCommand.ts rename to clients/client-sagemaker-a2i-runtime/src/commands/ListHumanLoopsCommand.ts diff --git a/clients/client-sagemaker-a2i-runtime/commands/StartHumanLoopCommand.ts b/clients/client-sagemaker-a2i-runtime/src/commands/StartHumanLoopCommand.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/commands/StartHumanLoopCommand.ts rename to clients/client-sagemaker-a2i-runtime/src/commands/StartHumanLoopCommand.ts diff --git a/clients/client-sagemaker-a2i-runtime/commands/StopHumanLoopCommand.ts b/clients/client-sagemaker-a2i-runtime/src/commands/StopHumanLoopCommand.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/commands/StopHumanLoopCommand.ts rename to clients/client-sagemaker-a2i-runtime/src/commands/StopHumanLoopCommand.ts diff --git a/clients/client-sagemaker-a2i-runtime/endpoints.ts b/clients/client-sagemaker-a2i-runtime/src/endpoints.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/endpoints.ts rename to clients/client-sagemaker-a2i-runtime/src/endpoints.ts diff --git a/clients/client-sagemaker-a2i-runtime/index.ts b/clients/client-sagemaker-a2i-runtime/src/index.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/index.ts rename to clients/client-sagemaker-a2i-runtime/src/index.ts diff --git a/clients/client-sagemaker-a2i-runtime/models/index.ts b/clients/client-sagemaker-a2i-runtime/src/models/index.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/models/index.ts rename to clients/client-sagemaker-a2i-runtime/src/models/index.ts diff --git a/clients/client-sagemaker-a2i-runtime/models/models_0.ts b/clients/client-sagemaker-a2i-runtime/src/models/models_0.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/models/models_0.ts rename to clients/client-sagemaker-a2i-runtime/src/models/models_0.ts diff --git a/clients/client-sagemaker-a2i-runtime/pagination/Interfaces.ts b/clients/client-sagemaker-a2i-runtime/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/pagination/Interfaces.ts rename to clients/client-sagemaker-a2i-runtime/src/pagination/Interfaces.ts diff --git a/clients/client-sagemaker-a2i-runtime/pagination/ListHumanLoopsPaginator.ts b/clients/client-sagemaker-a2i-runtime/src/pagination/ListHumanLoopsPaginator.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/pagination/ListHumanLoopsPaginator.ts rename to clients/client-sagemaker-a2i-runtime/src/pagination/ListHumanLoopsPaginator.ts diff --git a/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1.ts rename to clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.browser.ts b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..507a4a04bb99 --- /dev/null +++ b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SageMakerA2IRuntimeClientConfig } from "./SageMakerA2IRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/runtimeConfig.native.ts rename to clients/client-sagemaker-a2i-runtime/src/runtimeConfig.native.ts diff --git a/clients/client-sagemaker-a2i-runtime/runtimeConfig.shared.ts b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sagemaker-a2i-runtime/runtimeConfig.shared.ts rename to clients/client-sagemaker-a2i-runtime/src/runtimeConfig.shared.ts diff --git a/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts new file mode 100644 index 000000000000..7f5e7095bae1 --- /dev/null +++ b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SageMakerA2IRuntimeClientConfig } from "./SageMakerA2IRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-a2i-runtime/tsconfig.es.json b/clients/client-sagemaker-a2i-runtime/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sagemaker-a2i-runtime/tsconfig.es.json +++ b/clients/client-sagemaker-a2i-runtime/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sagemaker-a2i-runtime/tsconfig.json b/clients/client-sagemaker-a2i-runtime/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sagemaker-a2i-runtime/tsconfig.json +++ b/clients/client-sagemaker-a2i-runtime/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sagemaker-a2i-runtime/tsconfig.types.json b/clients/client-sagemaker-a2i-runtime/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sagemaker-a2i-runtime/tsconfig.types.json +++ b/clients/client-sagemaker-a2i-runtime/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sagemaker-edge/.gitignore b/clients/client-sagemaker-edge/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sagemaker-edge/.gitignore +++ b/clients/client-sagemaker-edge/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sagemaker-edge/package.json b/clients/client-sagemaker-edge/package.json index 39feeadb5f7b..ba8e32374338 100644 --- a/clients/client-sagemaker-edge/package.json +++ b/clients/client-sagemaker-edge/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sagemaker-edge", "repository": { "type": "git", diff --git a/clients/client-sagemaker-edge/runtimeConfig.browser.ts b/clients/client-sagemaker-edge/runtimeConfig.browser.ts deleted file mode 100644 index 20a313328044..000000000000 --- a/clients/client-sagemaker-edge/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SagemakerEdgeClientConfig } from "./SagemakerEdgeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-edge/runtimeConfig.ts b/clients/client-sagemaker-edge/runtimeConfig.ts deleted file mode 100644 index 8b5853f638a9..000000000000 --- a/clients/client-sagemaker-edge/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SagemakerEdgeClientConfig } from "./SagemakerEdgeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-edge/SagemakerEdge.ts b/clients/client-sagemaker-edge/src/SagemakerEdge.ts similarity index 100% rename from clients/client-sagemaker-edge/SagemakerEdge.ts rename to clients/client-sagemaker-edge/src/SagemakerEdge.ts diff --git a/clients/client-sagemaker-edge/SagemakerEdgeClient.ts b/clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts similarity index 100% rename from clients/client-sagemaker-edge/SagemakerEdgeClient.ts rename to clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts diff --git a/clients/client-sagemaker-edge/commands/GetDeviceRegistrationCommand.ts b/clients/client-sagemaker-edge/src/commands/GetDeviceRegistrationCommand.ts similarity index 100% rename from clients/client-sagemaker-edge/commands/GetDeviceRegistrationCommand.ts rename to clients/client-sagemaker-edge/src/commands/GetDeviceRegistrationCommand.ts diff --git a/clients/client-sagemaker-edge/commands/SendHeartbeatCommand.ts b/clients/client-sagemaker-edge/src/commands/SendHeartbeatCommand.ts similarity index 100% rename from clients/client-sagemaker-edge/commands/SendHeartbeatCommand.ts rename to clients/client-sagemaker-edge/src/commands/SendHeartbeatCommand.ts diff --git a/clients/client-sagemaker-edge/endpoints.ts b/clients/client-sagemaker-edge/src/endpoints.ts similarity index 100% rename from clients/client-sagemaker-edge/endpoints.ts rename to clients/client-sagemaker-edge/src/endpoints.ts diff --git a/clients/client-sagemaker-edge/index.ts b/clients/client-sagemaker-edge/src/index.ts similarity index 100% rename from clients/client-sagemaker-edge/index.ts rename to clients/client-sagemaker-edge/src/index.ts diff --git a/clients/client-sagemaker-edge/models/index.ts b/clients/client-sagemaker-edge/src/models/index.ts similarity index 100% rename from clients/client-sagemaker-edge/models/index.ts rename to clients/client-sagemaker-edge/src/models/index.ts diff --git a/clients/client-sagemaker-edge/models/models_0.ts b/clients/client-sagemaker-edge/src/models/models_0.ts similarity index 100% rename from clients/client-sagemaker-edge/models/models_0.ts rename to clients/client-sagemaker-edge/src/models/models_0.ts diff --git a/clients/client-sagemaker-edge/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sagemaker-edge/protocols/Aws_restJson1.ts rename to clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sagemaker-edge/src/runtimeConfig.browser.ts b/clients/client-sagemaker-edge/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..7482d0f315f2 --- /dev/null +++ b/clients/client-sagemaker-edge/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SagemakerEdgeClientConfig } from "./SagemakerEdgeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-edge/runtimeConfig.native.ts b/clients/client-sagemaker-edge/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sagemaker-edge/runtimeConfig.native.ts rename to clients/client-sagemaker-edge/src/runtimeConfig.native.ts diff --git a/clients/client-sagemaker-edge/runtimeConfig.shared.ts b/clients/client-sagemaker-edge/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sagemaker-edge/runtimeConfig.shared.ts rename to clients/client-sagemaker-edge/src/runtimeConfig.shared.ts diff --git a/clients/client-sagemaker-edge/src/runtimeConfig.ts b/clients/client-sagemaker-edge/src/runtimeConfig.ts new file mode 100644 index 000000000000..9ff4786226da --- /dev/null +++ b/clients/client-sagemaker-edge/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SagemakerEdgeClientConfig } from "./SagemakerEdgeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-edge/tsconfig.es.json b/clients/client-sagemaker-edge/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sagemaker-edge/tsconfig.es.json +++ b/clients/client-sagemaker-edge/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sagemaker-edge/tsconfig.json b/clients/client-sagemaker-edge/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sagemaker-edge/tsconfig.json +++ b/clients/client-sagemaker-edge/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sagemaker-edge/tsconfig.types.json b/clients/client-sagemaker-edge/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sagemaker-edge/tsconfig.types.json +++ b/clients/client-sagemaker-edge/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sagemaker-featurestore-runtime/.gitignore b/clients/client-sagemaker-featurestore-runtime/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sagemaker-featurestore-runtime/.gitignore +++ b/clients/client-sagemaker-featurestore-runtime/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sagemaker-featurestore-runtime/package.json b/clients/client-sagemaker-featurestore-runtime/package.json index d23fb9d5d1be..1a20a4a7a8ff 100644 --- a/clients/client-sagemaker-featurestore-runtime/package.json +++ b/clients/client-sagemaker-featurestore-runtime/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sagemaker-featurestore-runtime", "repository": { "type": "git", diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts deleted file mode 100644 index adae78ac1dec..000000000000 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SageMakerFeatureStoreRuntimeClientConfig } from "./SageMakerFeatureStoreRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts deleted file mode 100644 index 3e0e326bdcb5..000000000000 --- a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SageMakerFeatureStoreRuntimeClientConfig } from "./SageMakerFeatureStoreRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntime.ts b/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntime.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntime.ts rename to clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntime.ts diff --git a/clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts b/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/SageMakerFeatureStoreRuntimeClient.ts rename to clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts diff --git a/clients/client-sagemaker-featurestore-runtime/commands/BatchGetRecordCommand.ts b/clients/client-sagemaker-featurestore-runtime/src/commands/BatchGetRecordCommand.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/commands/BatchGetRecordCommand.ts rename to clients/client-sagemaker-featurestore-runtime/src/commands/BatchGetRecordCommand.ts diff --git a/clients/client-sagemaker-featurestore-runtime/commands/DeleteRecordCommand.ts b/clients/client-sagemaker-featurestore-runtime/src/commands/DeleteRecordCommand.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/commands/DeleteRecordCommand.ts rename to clients/client-sagemaker-featurestore-runtime/src/commands/DeleteRecordCommand.ts diff --git a/clients/client-sagemaker-featurestore-runtime/commands/GetRecordCommand.ts b/clients/client-sagemaker-featurestore-runtime/src/commands/GetRecordCommand.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/commands/GetRecordCommand.ts rename to clients/client-sagemaker-featurestore-runtime/src/commands/GetRecordCommand.ts diff --git a/clients/client-sagemaker-featurestore-runtime/commands/PutRecordCommand.ts b/clients/client-sagemaker-featurestore-runtime/src/commands/PutRecordCommand.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/commands/PutRecordCommand.ts rename to clients/client-sagemaker-featurestore-runtime/src/commands/PutRecordCommand.ts diff --git a/clients/client-sagemaker-featurestore-runtime/endpoints.ts b/clients/client-sagemaker-featurestore-runtime/src/endpoints.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/endpoints.ts rename to clients/client-sagemaker-featurestore-runtime/src/endpoints.ts diff --git a/clients/client-sagemaker-featurestore-runtime/index.ts b/clients/client-sagemaker-featurestore-runtime/src/index.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/index.ts rename to clients/client-sagemaker-featurestore-runtime/src/index.ts diff --git a/clients/client-sagemaker-featurestore-runtime/models/index.ts b/clients/client-sagemaker-featurestore-runtime/src/models/index.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/models/index.ts rename to clients/client-sagemaker-featurestore-runtime/src/models/index.ts diff --git a/clients/client-sagemaker-featurestore-runtime/models/models_0.ts b/clients/client-sagemaker-featurestore-runtime/src/models/models_0.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/models/models_0.ts rename to clients/client-sagemaker-featurestore-runtime/src/models/models_0.ts diff --git a/clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/protocols/Aws_restJson1.ts rename to clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.browser.ts b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..23b7f69f8355 --- /dev/null +++ b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SageMakerFeatureStoreRuntimeClientConfig } from "./SageMakerFeatureStoreRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/runtimeConfig.native.ts rename to clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.native.ts diff --git a/clients/client-sagemaker-featurestore-runtime/runtimeConfig.shared.ts b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sagemaker-featurestore-runtime/runtimeConfig.shared.ts rename to clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.shared.ts diff --git a/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts new file mode 100644 index 000000000000..6e3b549dd112 --- /dev/null +++ b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SageMakerFeatureStoreRuntimeClientConfig } from "./SageMakerFeatureStoreRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-featurestore-runtime/tsconfig.es.json b/clients/client-sagemaker-featurestore-runtime/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sagemaker-featurestore-runtime/tsconfig.es.json +++ b/clients/client-sagemaker-featurestore-runtime/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sagemaker-featurestore-runtime/tsconfig.json b/clients/client-sagemaker-featurestore-runtime/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sagemaker-featurestore-runtime/tsconfig.json +++ b/clients/client-sagemaker-featurestore-runtime/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sagemaker-featurestore-runtime/tsconfig.types.json b/clients/client-sagemaker-featurestore-runtime/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sagemaker-featurestore-runtime/tsconfig.types.json +++ b/clients/client-sagemaker-featurestore-runtime/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sagemaker-runtime/.gitignore b/clients/client-sagemaker-runtime/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sagemaker-runtime/.gitignore +++ b/clients/client-sagemaker-runtime/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sagemaker-runtime/package.json b/clients/client-sagemaker-runtime/package.json index 347ddb5fb277..737ad6d380d1 100644 --- a/clients/client-sagemaker-runtime/package.json +++ b/clients/client-sagemaker-runtime/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sagemaker-runtime", "repository": { "type": "git", diff --git a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts b/clients/client-sagemaker-runtime/runtimeConfig.browser.ts deleted file mode 100644 index 62076fc9bb0d..000000000000 --- a/clients/client-sagemaker-runtime/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SageMakerRuntimeClientConfig } from "./SageMakerRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-runtime/runtimeConfig.ts b/clients/client-sagemaker-runtime/runtimeConfig.ts deleted file mode 100644 index 9f32e5d3df1e..000000000000 --- a/clients/client-sagemaker-runtime/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SageMakerRuntimeClientConfig } from "./SageMakerRuntimeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker-runtime/SageMakerRuntime.ts b/clients/client-sagemaker-runtime/src/SageMakerRuntime.ts similarity index 100% rename from clients/client-sagemaker-runtime/SageMakerRuntime.ts rename to clients/client-sagemaker-runtime/src/SageMakerRuntime.ts diff --git a/clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts b/clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts similarity index 100% rename from clients/client-sagemaker-runtime/SageMakerRuntimeClient.ts rename to clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts diff --git a/clients/client-sagemaker-runtime/commands/InvokeEndpointAsyncCommand.ts b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointAsyncCommand.ts similarity index 100% rename from clients/client-sagemaker-runtime/commands/InvokeEndpointAsyncCommand.ts rename to clients/client-sagemaker-runtime/src/commands/InvokeEndpointAsyncCommand.ts diff --git a/clients/client-sagemaker-runtime/commands/InvokeEndpointCommand.ts b/clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts similarity index 100% rename from clients/client-sagemaker-runtime/commands/InvokeEndpointCommand.ts rename to clients/client-sagemaker-runtime/src/commands/InvokeEndpointCommand.ts diff --git a/clients/client-sagemaker-runtime/endpoints.ts b/clients/client-sagemaker-runtime/src/endpoints.ts similarity index 100% rename from clients/client-sagemaker-runtime/endpoints.ts rename to clients/client-sagemaker-runtime/src/endpoints.ts diff --git a/clients/client-sagemaker-runtime/index.ts b/clients/client-sagemaker-runtime/src/index.ts similarity index 100% rename from clients/client-sagemaker-runtime/index.ts rename to clients/client-sagemaker-runtime/src/index.ts diff --git a/clients/client-sagemaker-runtime/models/index.ts b/clients/client-sagemaker-runtime/src/models/index.ts similarity index 100% rename from clients/client-sagemaker-runtime/models/index.ts rename to clients/client-sagemaker-runtime/src/models/index.ts diff --git a/clients/client-sagemaker-runtime/models/models_0.ts b/clients/client-sagemaker-runtime/src/models/models_0.ts similarity index 100% rename from clients/client-sagemaker-runtime/models/models_0.ts rename to clients/client-sagemaker-runtime/src/models/models_0.ts diff --git a/clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sagemaker-runtime/protocols/Aws_restJson1.ts rename to clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sagemaker-runtime/src/runtimeConfig.browser.ts b/clients/client-sagemaker-runtime/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..1be8472b7955 --- /dev/null +++ b/clients/client-sagemaker-runtime/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SageMakerRuntimeClientConfig } from "./SageMakerRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-runtime/runtimeConfig.native.ts b/clients/client-sagemaker-runtime/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sagemaker-runtime/runtimeConfig.native.ts rename to clients/client-sagemaker-runtime/src/runtimeConfig.native.ts diff --git a/clients/client-sagemaker-runtime/runtimeConfig.shared.ts b/clients/client-sagemaker-runtime/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sagemaker-runtime/runtimeConfig.shared.ts rename to clients/client-sagemaker-runtime/src/runtimeConfig.shared.ts diff --git a/clients/client-sagemaker-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-runtime/src/runtimeConfig.ts new file mode 100644 index 000000000000..3ea363b9a63d --- /dev/null +++ b/clients/client-sagemaker-runtime/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SageMakerRuntimeClientConfig } from "./SageMakerRuntimeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker-runtime/tsconfig.es.json b/clients/client-sagemaker-runtime/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sagemaker-runtime/tsconfig.es.json +++ b/clients/client-sagemaker-runtime/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sagemaker-runtime/tsconfig.json b/clients/client-sagemaker-runtime/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sagemaker-runtime/tsconfig.json +++ b/clients/client-sagemaker-runtime/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sagemaker-runtime/tsconfig.types.json b/clients/client-sagemaker-runtime/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sagemaker-runtime/tsconfig.types.json +++ b/clients/client-sagemaker-runtime/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sagemaker/.gitignore b/clients/client-sagemaker/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sagemaker/.gitignore +++ b/clients/client-sagemaker/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sagemaker/package.json b/clients/client-sagemaker/package.json index d2695a25a1cc..0f8ef9ebd88e 100644 --- a/clients/client-sagemaker/package.json +++ b/clients/client-sagemaker/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sagemaker", "repository": { "type": "git", diff --git a/clients/client-sagemaker/runtimeConfig.browser.ts b/clients/client-sagemaker/runtimeConfig.browser.ts deleted file mode 100644 index fb52c4698738..000000000000 --- a/clients/client-sagemaker/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SageMakerClientConfig } from "./SageMakerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker/runtimeConfig.ts b/clients/client-sagemaker/runtimeConfig.ts deleted file mode 100644 index 295da513b4f3..000000000000 --- a/clients/client-sagemaker/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SageMakerClientConfig } from "./SageMakerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SageMakerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sagemaker/SageMaker.ts b/clients/client-sagemaker/src/SageMaker.ts similarity index 100% rename from clients/client-sagemaker/SageMaker.ts rename to clients/client-sagemaker/src/SageMaker.ts diff --git a/clients/client-sagemaker/SageMakerClient.ts b/clients/client-sagemaker/src/SageMakerClient.ts similarity index 100% rename from clients/client-sagemaker/SageMakerClient.ts rename to clients/client-sagemaker/src/SageMakerClient.ts diff --git a/clients/client-sagemaker/commands/AddAssociationCommand.ts b/clients/client-sagemaker/src/commands/AddAssociationCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/AddAssociationCommand.ts rename to clients/client-sagemaker/src/commands/AddAssociationCommand.ts diff --git a/clients/client-sagemaker/commands/AddTagsCommand.ts b/clients/client-sagemaker/src/commands/AddTagsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/AddTagsCommand.ts rename to clients/client-sagemaker/src/commands/AddTagsCommand.ts diff --git a/clients/client-sagemaker/commands/AssociateTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/AssociateTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/AssociateTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/AssociateTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/CreateActionCommand.ts b/clients/client-sagemaker/src/commands/CreateActionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateActionCommand.ts rename to clients/client-sagemaker/src/commands/CreateActionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateAlgorithmCommand.ts b/clients/client-sagemaker/src/commands/CreateAlgorithmCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateAlgorithmCommand.ts rename to clients/client-sagemaker/src/commands/CreateAlgorithmCommand.ts diff --git a/clients/client-sagemaker/commands/CreateAppCommand.ts b/clients/client-sagemaker/src/commands/CreateAppCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateAppCommand.ts rename to clients/client-sagemaker/src/commands/CreateAppCommand.ts diff --git a/clients/client-sagemaker/commands/CreateAppImageConfigCommand.ts b/clients/client-sagemaker/src/commands/CreateAppImageConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateAppImageConfigCommand.ts rename to clients/client-sagemaker/src/commands/CreateAppImageConfigCommand.ts diff --git a/clients/client-sagemaker/commands/CreateArtifactCommand.ts b/clients/client-sagemaker/src/commands/CreateArtifactCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateArtifactCommand.ts rename to clients/client-sagemaker/src/commands/CreateArtifactCommand.ts diff --git a/clients/client-sagemaker/commands/CreateAutoMLJobCommand.ts b/clients/client-sagemaker/src/commands/CreateAutoMLJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateAutoMLJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateAutoMLJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateCodeRepositoryCommand.ts b/clients/client-sagemaker/src/commands/CreateCodeRepositoryCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateCodeRepositoryCommand.ts rename to clients/client-sagemaker/src/commands/CreateCodeRepositoryCommand.ts diff --git a/clients/client-sagemaker/commands/CreateCompilationJobCommand.ts b/clients/client-sagemaker/src/commands/CreateCompilationJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateCompilationJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateCompilationJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateContextCommand.ts b/clients/client-sagemaker/src/commands/CreateContextCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateContextCommand.ts rename to clients/client-sagemaker/src/commands/CreateContextCommand.ts diff --git a/clients/client-sagemaker/commands/CreateDataQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/CreateDataQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateDataQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/CreateDataQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateDeviceFleetCommand.ts b/clients/client-sagemaker/src/commands/CreateDeviceFleetCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateDeviceFleetCommand.ts rename to clients/client-sagemaker/src/commands/CreateDeviceFleetCommand.ts diff --git a/clients/client-sagemaker/commands/CreateDomainCommand.ts b/clients/client-sagemaker/src/commands/CreateDomainCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateDomainCommand.ts rename to clients/client-sagemaker/src/commands/CreateDomainCommand.ts diff --git a/clients/client-sagemaker/commands/CreateEdgePackagingJobCommand.ts b/clients/client-sagemaker/src/commands/CreateEdgePackagingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateEdgePackagingJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateEdgePackagingJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateEndpointCommand.ts b/clients/client-sagemaker/src/commands/CreateEndpointCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateEndpointCommand.ts rename to clients/client-sagemaker/src/commands/CreateEndpointCommand.ts diff --git a/clients/client-sagemaker/commands/CreateEndpointConfigCommand.ts b/clients/client-sagemaker/src/commands/CreateEndpointConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateEndpointConfigCommand.ts rename to clients/client-sagemaker/src/commands/CreateEndpointConfigCommand.ts diff --git a/clients/client-sagemaker/commands/CreateExperimentCommand.ts b/clients/client-sagemaker/src/commands/CreateExperimentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateExperimentCommand.ts rename to clients/client-sagemaker/src/commands/CreateExperimentCommand.ts diff --git a/clients/client-sagemaker/commands/CreateFeatureGroupCommand.ts b/clients/client-sagemaker/src/commands/CreateFeatureGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateFeatureGroupCommand.ts rename to clients/client-sagemaker/src/commands/CreateFeatureGroupCommand.ts diff --git a/clients/client-sagemaker/commands/CreateFlowDefinitionCommand.ts b/clients/client-sagemaker/src/commands/CreateFlowDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateFlowDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/CreateFlowDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateHumanTaskUiCommand.ts b/clients/client-sagemaker/src/commands/CreateHumanTaskUiCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateHumanTaskUiCommand.ts rename to clients/client-sagemaker/src/commands/CreateHumanTaskUiCommand.ts diff --git a/clients/client-sagemaker/commands/CreateHyperParameterTuningJobCommand.ts b/clients/client-sagemaker/src/commands/CreateHyperParameterTuningJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateHyperParameterTuningJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateHyperParameterTuningJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateImageCommand.ts b/clients/client-sagemaker/src/commands/CreateImageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateImageCommand.ts rename to clients/client-sagemaker/src/commands/CreateImageCommand.ts diff --git a/clients/client-sagemaker/commands/CreateImageVersionCommand.ts b/clients/client-sagemaker/src/commands/CreateImageVersionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateImageVersionCommand.ts rename to clients/client-sagemaker/src/commands/CreateImageVersionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateLabelingJobCommand.ts b/clients/client-sagemaker/src/commands/CreateLabelingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateLabelingJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateLabelingJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelBiasJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/CreateModelBiasJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelBiasJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelBiasJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelCommand.ts b/clients/client-sagemaker/src/commands/CreateModelCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelExplainabilityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/CreateModelExplainabilityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelExplainabilityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelExplainabilityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelPackageCommand.ts b/clients/client-sagemaker/src/commands/CreateModelPackageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelPackageCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelPackageCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelPackageGroupCommand.ts b/clients/client-sagemaker/src/commands/CreateModelPackageGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelPackageGroupCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelPackageGroupCommand.ts diff --git a/clients/client-sagemaker/commands/CreateModelQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/CreateModelQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateModelQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/CreateModelQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/CreateMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/CreateMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/CreateMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/CreateNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/CreateNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/CreateNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/CreateNotebookInstanceLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/CreateNotebookInstanceLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateNotebookInstanceLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/CreateNotebookInstanceLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/CreatePipelineCommand.ts b/clients/client-sagemaker/src/commands/CreatePipelineCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreatePipelineCommand.ts rename to clients/client-sagemaker/src/commands/CreatePipelineCommand.ts diff --git a/clients/client-sagemaker/commands/CreatePresignedDomainUrlCommand.ts b/clients/client-sagemaker/src/commands/CreatePresignedDomainUrlCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreatePresignedDomainUrlCommand.ts rename to clients/client-sagemaker/src/commands/CreatePresignedDomainUrlCommand.ts diff --git a/clients/client-sagemaker/commands/CreatePresignedNotebookInstanceUrlCommand.ts b/clients/client-sagemaker/src/commands/CreatePresignedNotebookInstanceUrlCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreatePresignedNotebookInstanceUrlCommand.ts rename to clients/client-sagemaker/src/commands/CreatePresignedNotebookInstanceUrlCommand.ts diff --git a/clients/client-sagemaker/commands/CreateProcessingJobCommand.ts b/clients/client-sagemaker/src/commands/CreateProcessingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateProcessingJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateProcessingJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateProjectCommand.ts b/clients/client-sagemaker/src/commands/CreateProjectCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateProjectCommand.ts rename to clients/client-sagemaker/src/commands/CreateProjectCommand.ts diff --git a/clients/client-sagemaker/commands/CreateStudioLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/CreateStudioLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateStudioLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/CreateStudioLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/CreateTrainingJobCommand.ts b/clients/client-sagemaker/src/commands/CreateTrainingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateTrainingJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateTrainingJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateTransformJobCommand.ts b/clients/client-sagemaker/src/commands/CreateTransformJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateTransformJobCommand.ts rename to clients/client-sagemaker/src/commands/CreateTransformJobCommand.ts diff --git a/clients/client-sagemaker/commands/CreateTrialCommand.ts b/clients/client-sagemaker/src/commands/CreateTrialCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateTrialCommand.ts rename to clients/client-sagemaker/src/commands/CreateTrialCommand.ts diff --git a/clients/client-sagemaker/commands/CreateTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/CreateTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/CreateTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/CreateUserProfileCommand.ts b/clients/client-sagemaker/src/commands/CreateUserProfileCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateUserProfileCommand.ts rename to clients/client-sagemaker/src/commands/CreateUserProfileCommand.ts diff --git a/clients/client-sagemaker/commands/CreateWorkforceCommand.ts b/clients/client-sagemaker/src/commands/CreateWorkforceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateWorkforceCommand.ts rename to clients/client-sagemaker/src/commands/CreateWorkforceCommand.ts diff --git a/clients/client-sagemaker/commands/CreateWorkteamCommand.ts b/clients/client-sagemaker/src/commands/CreateWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/CreateWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/CreateWorkteamCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteActionCommand.ts b/clients/client-sagemaker/src/commands/DeleteActionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteActionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteActionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteAlgorithmCommand.ts b/clients/client-sagemaker/src/commands/DeleteAlgorithmCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteAlgorithmCommand.ts rename to clients/client-sagemaker/src/commands/DeleteAlgorithmCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteAppCommand.ts b/clients/client-sagemaker/src/commands/DeleteAppCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteAppCommand.ts rename to clients/client-sagemaker/src/commands/DeleteAppCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteAppImageConfigCommand.ts b/clients/client-sagemaker/src/commands/DeleteAppImageConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteAppImageConfigCommand.ts rename to clients/client-sagemaker/src/commands/DeleteAppImageConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteArtifactCommand.ts b/clients/client-sagemaker/src/commands/DeleteArtifactCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteArtifactCommand.ts rename to clients/client-sagemaker/src/commands/DeleteArtifactCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteAssociationCommand.ts b/clients/client-sagemaker/src/commands/DeleteAssociationCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteAssociationCommand.ts rename to clients/client-sagemaker/src/commands/DeleteAssociationCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteCodeRepositoryCommand.ts b/clients/client-sagemaker/src/commands/DeleteCodeRepositoryCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteCodeRepositoryCommand.ts rename to clients/client-sagemaker/src/commands/DeleteCodeRepositoryCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteContextCommand.ts b/clients/client-sagemaker/src/commands/DeleteContextCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteContextCommand.ts rename to clients/client-sagemaker/src/commands/DeleteContextCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteDataQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DeleteDataQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteDataQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteDataQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteDeviceFleetCommand.ts b/clients/client-sagemaker/src/commands/DeleteDeviceFleetCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteDeviceFleetCommand.ts rename to clients/client-sagemaker/src/commands/DeleteDeviceFleetCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteDomainCommand.ts b/clients/client-sagemaker/src/commands/DeleteDomainCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteDomainCommand.ts rename to clients/client-sagemaker/src/commands/DeleteDomainCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteEndpointCommand.ts b/clients/client-sagemaker/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteEndpointCommand.ts rename to clients/client-sagemaker/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteEndpointConfigCommand.ts b/clients/client-sagemaker/src/commands/DeleteEndpointConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteEndpointConfigCommand.ts rename to clients/client-sagemaker/src/commands/DeleteEndpointConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteExperimentCommand.ts b/clients/client-sagemaker/src/commands/DeleteExperimentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteExperimentCommand.ts rename to clients/client-sagemaker/src/commands/DeleteExperimentCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteFeatureGroupCommand.ts b/clients/client-sagemaker/src/commands/DeleteFeatureGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteFeatureGroupCommand.ts rename to clients/client-sagemaker/src/commands/DeleteFeatureGroupCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteFlowDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DeleteFlowDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteFlowDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteFlowDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteHumanTaskUiCommand.ts b/clients/client-sagemaker/src/commands/DeleteHumanTaskUiCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteHumanTaskUiCommand.ts rename to clients/client-sagemaker/src/commands/DeleteHumanTaskUiCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteImageCommand.ts b/clients/client-sagemaker/src/commands/DeleteImageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteImageCommand.ts rename to clients/client-sagemaker/src/commands/DeleteImageCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteImageVersionCommand.ts b/clients/client-sagemaker/src/commands/DeleteImageVersionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteImageVersionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteImageVersionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelBiasJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelBiasJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelBiasJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelBiasJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelExplainabilityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelExplainabilityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelExplainabilityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelExplainabilityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelPackageCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelPackageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelPackageCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelPackageCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelPackageGroupCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelPackageGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelPackageGroupCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelPackageGroupCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelPackageGroupPolicyCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelPackageGroupPolicyCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelPackageGroupPolicyCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelPackageGroupPolicyCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteModelQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DeleteModelQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteModelQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DeleteModelQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/DeleteMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/DeleteMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/DeleteNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/DeleteNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteNotebookInstanceLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/DeleteNotebookInstanceLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteNotebookInstanceLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/DeleteNotebookInstanceLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DeletePipelineCommand.ts b/clients/client-sagemaker/src/commands/DeletePipelineCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeletePipelineCommand.ts rename to clients/client-sagemaker/src/commands/DeletePipelineCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteProjectCommand.ts b/clients/client-sagemaker/src/commands/DeleteProjectCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteProjectCommand.ts rename to clients/client-sagemaker/src/commands/DeleteProjectCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteStudioLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/DeleteStudioLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteStudioLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/DeleteStudioLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteTagsCommand.ts b/clients/client-sagemaker/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteTagsCommand.ts rename to clients/client-sagemaker/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteTrialCommand.ts b/clients/client-sagemaker/src/commands/DeleteTrialCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteTrialCommand.ts rename to clients/client-sagemaker/src/commands/DeleteTrialCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/DeleteTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/DeleteTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteUserProfileCommand.ts b/clients/client-sagemaker/src/commands/DeleteUserProfileCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteUserProfileCommand.ts rename to clients/client-sagemaker/src/commands/DeleteUserProfileCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteWorkforceCommand.ts b/clients/client-sagemaker/src/commands/DeleteWorkforceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteWorkforceCommand.ts rename to clients/client-sagemaker/src/commands/DeleteWorkforceCommand.ts diff --git a/clients/client-sagemaker/commands/DeleteWorkteamCommand.ts b/clients/client-sagemaker/src/commands/DeleteWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeleteWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/DeleteWorkteamCommand.ts diff --git a/clients/client-sagemaker/commands/DeregisterDevicesCommand.ts b/clients/client-sagemaker/src/commands/DeregisterDevicesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DeregisterDevicesCommand.ts rename to clients/client-sagemaker/src/commands/DeregisterDevicesCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeActionCommand.ts b/clients/client-sagemaker/src/commands/DescribeActionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeActionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeActionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeAlgorithmCommand.ts b/clients/client-sagemaker/src/commands/DescribeAlgorithmCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeAlgorithmCommand.ts rename to clients/client-sagemaker/src/commands/DescribeAlgorithmCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeAppCommand.ts b/clients/client-sagemaker/src/commands/DescribeAppCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeAppCommand.ts rename to clients/client-sagemaker/src/commands/DescribeAppCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeAppImageConfigCommand.ts b/clients/client-sagemaker/src/commands/DescribeAppImageConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeAppImageConfigCommand.ts rename to clients/client-sagemaker/src/commands/DescribeAppImageConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeArtifactCommand.ts b/clients/client-sagemaker/src/commands/DescribeArtifactCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeArtifactCommand.ts rename to clients/client-sagemaker/src/commands/DescribeArtifactCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeAutoMLJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeAutoMLJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeAutoMLJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeAutoMLJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeCodeRepositoryCommand.ts b/clients/client-sagemaker/src/commands/DescribeCodeRepositoryCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeCodeRepositoryCommand.ts rename to clients/client-sagemaker/src/commands/DescribeCodeRepositoryCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeCompilationJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeCompilationJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeCompilationJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeCompilationJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeContextCommand.ts b/clients/client-sagemaker/src/commands/DescribeContextCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeContextCommand.ts rename to clients/client-sagemaker/src/commands/DescribeContextCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeDataQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DescribeDataQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeDataQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeDataQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeDeviceCommand.ts b/clients/client-sagemaker/src/commands/DescribeDeviceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeDeviceCommand.ts rename to clients/client-sagemaker/src/commands/DescribeDeviceCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeDeviceFleetCommand.ts b/clients/client-sagemaker/src/commands/DescribeDeviceFleetCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeDeviceFleetCommand.ts rename to clients/client-sagemaker/src/commands/DescribeDeviceFleetCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeDomainCommand.ts b/clients/client-sagemaker/src/commands/DescribeDomainCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeDomainCommand.ts rename to clients/client-sagemaker/src/commands/DescribeDomainCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeEdgePackagingJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeEdgePackagingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeEdgePackagingJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeEdgePackagingJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeEndpointCommand.ts b/clients/client-sagemaker/src/commands/DescribeEndpointCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeEndpointCommand.ts rename to clients/client-sagemaker/src/commands/DescribeEndpointCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeEndpointConfigCommand.ts b/clients/client-sagemaker/src/commands/DescribeEndpointConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeEndpointConfigCommand.ts rename to clients/client-sagemaker/src/commands/DescribeEndpointConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeExperimentCommand.ts b/clients/client-sagemaker/src/commands/DescribeExperimentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeExperimentCommand.ts rename to clients/client-sagemaker/src/commands/DescribeExperimentCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeFeatureGroupCommand.ts b/clients/client-sagemaker/src/commands/DescribeFeatureGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeFeatureGroupCommand.ts rename to clients/client-sagemaker/src/commands/DescribeFeatureGroupCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeFlowDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DescribeFlowDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeFlowDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeFlowDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeHumanTaskUiCommand.ts b/clients/client-sagemaker/src/commands/DescribeHumanTaskUiCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeHumanTaskUiCommand.ts rename to clients/client-sagemaker/src/commands/DescribeHumanTaskUiCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeHyperParameterTuningJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeHyperParameterTuningJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeHyperParameterTuningJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeHyperParameterTuningJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeImageCommand.ts b/clients/client-sagemaker/src/commands/DescribeImageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeImageCommand.ts rename to clients/client-sagemaker/src/commands/DescribeImageCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeImageVersionCommand.ts b/clients/client-sagemaker/src/commands/DescribeImageVersionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeImageVersionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeImageVersionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeLabelingJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeLabelingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeLabelingJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeLabelingJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelBiasJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelBiasJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelBiasJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelBiasJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelExplainabilityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelExplainabilityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelExplainabilityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelExplainabilityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelPackageCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelPackageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelPackageCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelPackageCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelPackageGroupCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelPackageGroupCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelPackageGroupCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelPackageGroupCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeModelQualityJobDefinitionCommand.ts b/clients/client-sagemaker/src/commands/DescribeModelQualityJobDefinitionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeModelQualityJobDefinitionCommand.ts rename to clients/client-sagemaker/src/commands/DescribeModelQualityJobDefinitionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/DescribeMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/DescribeMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/DescribeNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/DescribeNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeNotebookInstanceLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/DescribeNotebookInstanceLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeNotebookInstanceLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/DescribeNotebookInstanceLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DescribePipelineCommand.ts b/clients/client-sagemaker/src/commands/DescribePipelineCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribePipelineCommand.ts rename to clients/client-sagemaker/src/commands/DescribePipelineCommand.ts diff --git a/clients/client-sagemaker/commands/DescribePipelineDefinitionForExecutionCommand.ts b/clients/client-sagemaker/src/commands/DescribePipelineDefinitionForExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribePipelineDefinitionForExecutionCommand.ts rename to clients/client-sagemaker/src/commands/DescribePipelineDefinitionForExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribePipelineExecutionCommand.ts b/clients/client-sagemaker/src/commands/DescribePipelineExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribePipelineExecutionCommand.ts rename to clients/client-sagemaker/src/commands/DescribePipelineExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeProcessingJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeProcessingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeProcessingJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeProcessingJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeProjectCommand.ts b/clients/client-sagemaker/src/commands/DescribeProjectCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeProjectCommand.ts rename to clients/client-sagemaker/src/commands/DescribeProjectCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeStudioLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/DescribeStudioLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeStudioLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/DescribeStudioLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeSubscribedWorkteamCommand.ts b/clients/client-sagemaker/src/commands/DescribeSubscribedWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeSubscribedWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/DescribeSubscribedWorkteamCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeTrainingJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeTrainingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeTrainingJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeTrainingJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeTransformJobCommand.ts b/clients/client-sagemaker/src/commands/DescribeTransformJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeTransformJobCommand.ts rename to clients/client-sagemaker/src/commands/DescribeTransformJobCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeTrialCommand.ts b/clients/client-sagemaker/src/commands/DescribeTrialCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeTrialCommand.ts rename to clients/client-sagemaker/src/commands/DescribeTrialCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/DescribeTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/DescribeTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeUserProfileCommand.ts b/clients/client-sagemaker/src/commands/DescribeUserProfileCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeUserProfileCommand.ts rename to clients/client-sagemaker/src/commands/DescribeUserProfileCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeWorkforceCommand.ts b/clients/client-sagemaker/src/commands/DescribeWorkforceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeWorkforceCommand.ts rename to clients/client-sagemaker/src/commands/DescribeWorkforceCommand.ts diff --git a/clients/client-sagemaker/commands/DescribeWorkteamCommand.ts b/clients/client-sagemaker/src/commands/DescribeWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DescribeWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/DescribeWorkteamCommand.ts diff --git a/clients/client-sagemaker/commands/DisableSagemakerServicecatalogPortfolioCommand.ts b/clients/client-sagemaker/src/commands/DisableSagemakerServicecatalogPortfolioCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DisableSagemakerServicecatalogPortfolioCommand.ts rename to clients/client-sagemaker/src/commands/DisableSagemakerServicecatalogPortfolioCommand.ts diff --git a/clients/client-sagemaker/commands/DisassociateTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/DisassociateTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/DisassociateTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/DisassociateTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/EnableSagemakerServicecatalogPortfolioCommand.ts b/clients/client-sagemaker/src/commands/EnableSagemakerServicecatalogPortfolioCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/EnableSagemakerServicecatalogPortfolioCommand.ts rename to clients/client-sagemaker/src/commands/EnableSagemakerServicecatalogPortfolioCommand.ts diff --git a/clients/client-sagemaker/commands/GetDeviceFleetReportCommand.ts b/clients/client-sagemaker/src/commands/GetDeviceFleetReportCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/GetDeviceFleetReportCommand.ts rename to clients/client-sagemaker/src/commands/GetDeviceFleetReportCommand.ts diff --git a/clients/client-sagemaker/commands/GetModelPackageGroupPolicyCommand.ts b/clients/client-sagemaker/src/commands/GetModelPackageGroupPolicyCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/GetModelPackageGroupPolicyCommand.ts rename to clients/client-sagemaker/src/commands/GetModelPackageGroupPolicyCommand.ts diff --git a/clients/client-sagemaker/commands/GetSagemakerServicecatalogPortfolioStatusCommand.ts b/clients/client-sagemaker/src/commands/GetSagemakerServicecatalogPortfolioStatusCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/GetSagemakerServicecatalogPortfolioStatusCommand.ts rename to clients/client-sagemaker/src/commands/GetSagemakerServicecatalogPortfolioStatusCommand.ts diff --git a/clients/client-sagemaker/commands/GetSearchSuggestionsCommand.ts b/clients/client-sagemaker/src/commands/GetSearchSuggestionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/GetSearchSuggestionsCommand.ts rename to clients/client-sagemaker/src/commands/GetSearchSuggestionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListActionsCommand.ts b/clients/client-sagemaker/src/commands/ListActionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListActionsCommand.ts rename to clients/client-sagemaker/src/commands/ListActionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListAlgorithmsCommand.ts b/clients/client-sagemaker/src/commands/ListAlgorithmsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListAlgorithmsCommand.ts rename to clients/client-sagemaker/src/commands/ListAlgorithmsCommand.ts diff --git a/clients/client-sagemaker/commands/ListAppImageConfigsCommand.ts b/clients/client-sagemaker/src/commands/ListAppImageConfigsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListAppImageConfigsCommand.ts rename to clients/client-sagemaker/src/commands/ListAppImageConfigsCommand.ts diff --git a/clients/client-sagemaker/commands/ListAppsCommand.ts b/clients/client-sagemaker/src/commands/ListAppsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListAppsCommand.ts rename to clients/client-sagemaker/src/commands/ListAppsCommand.ts diff --git a/clients/client-sagemaker/commands/ListArtifactsCommand.ts b/clients/client-sagemaker/src/commands/ListArtifactsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListArtifactsCommand.ts rename to clients/client-sagemaker/src/commands/ListArtifactsCommand.ts diff --git a/clients/client-sagemaker/commands/ListAssociationsCommand.ts b/clients/client-sagemaker/src/commands/ListAssociationsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListAssociationsCommand.ts rename to clients/client-sagemaker/src/commands/ListAssociationsCommand.ts diff --git a/clients/client-sagemaker/commands/ListAutoMLJobsCommand.ts b/clients/client-sagemaker/src/commands/ListAutoMLJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListAutoMLJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListAutoMLJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListCandidatesForAutoMLJobCommand.ts b/clients/client-sagemaker/src/commands/ListCandidatesForAutoMLJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListCandidatesForAutoMLJobCommand.ts rename to clients/client-sagemaker/src/commands/ListCandidatesForAutoMLJobCommand.ts diff --git a/clients/client-sagemaker/commands/ListCodeRepositoriesCommand.ts b/clients/client-sagemaker/src/commands/ListCodeRepositoriesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListCodeRepositoriesCommand.ts rename to clients/client-sagemaker/src/commands/ListCodeRepositoriesCommand.ts diff --git a/clients/client-sagemaker/commands/ListCompilationJobsCommand.ts b/clients/client-sagemaker/src/commands/ListCompilationJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListCompilationJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListCompilationJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListContextsCommand.ts b/clients/client-sagemaker/src/commands/ListContextsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListContextsCommand.ts rename to clients/client-sagemaker/src/commands/ListContextsCommand.ts diff --git a/clients/client-sagemaker/commands/ListDataQualityJobDefinitionsCommand.ts b/clients/client-sagemaker/src/commands/ListDataQualityJobDefinitionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListDataQualityJobDefinitionsCommand.ts rename to clients/client-sagemaker/src/commands/ListDataQualityJobDefinitionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListDeviceFleetsCommand.ts b/clients/client-sagemaker/src/commands/ListDeviceFleetsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListDeviceFleetsCommand.ts rename to clients/client-sagemaker/src/commands/ListDeviceFleetsCommand.ts diff --git a/clients/client-sagemaker/commands/ListDevicesCommand.ts b/clients/client-sagemaker/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListDevicesCommand.ts rename to clients/client-sagemaker/src/commands/ListDevicesCommand.ts diff --git a/clients/client-sagemaker/commands/ListDomainsCommand.ts b/clients/client-sagemaker/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListDomainsCommand.ts rename to clients/client-sagemaker/src/commands/ListDomainsCommand.ts diff --git a/clients/client-sagemaker/commands/ListEdgePackagingJobsCommand.ts b/clients/client-sagemaker/src/commands/ListEdgePackagingJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListEdgePackagingJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListEdgePackagingJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListEndpointConfigsCommand.ts b/clients/client-sagemaker/src/commands/ListEndpointConfigsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListEndpointConfigsCommand.ts rename to clients/client-sagemaker/src/commands/ListEndpointConfigsCommand.ts diff --git a/clients/client-sagemaker/commands/ListEndpointsCommand.ts b/clients/client-sagemaker/src/commands/ListEndpointsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListEndpointsCommand.ts rename to clients/client-sagemaker/src/commands/ListEndpointsCommand.ts diff --git a/clients/client-sagemaker/commands/ListExperimentsCommand.ts b/clients/client-sagemaker/src/commands/ListExperimentsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListExperimentsCommand.ts rename to clients/client-sagemaker/src/commands/ListExperimentsCommand.ts diff --git a/clients/client-sagemaker/commands/ListFeatureGroupsCommand.ts b/clients/client-sagemaker/src/commands/ListFeatureGroupsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListFeatureGroupsCommand.ts rename to clients/client-sagemaker/src/commands/ListFeatureGroupsCommand.ts diff --git a/clients/client-sagemaker/commands/ListFlowDefinitionsCommand.ts b/clients/client-sagemaker/src/commands/ListFlowDefinitionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListFlowDefinitionsCommand.ts rename to clients/client-sagemaker/src/commands/ListFlowDefinitionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListHumanTaskUisCommand.ts b/clients/client-sagemaker/src/commands/ListHumanTaskUisCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListHumanTaskUisCommand.ts rename to clients/client-sagemaker/src/commands/ListHumanTaskUisCommand.ts diff --git a/clients/client-sagemaker/commands/ListHyperParameterTuningJobsCommand.ts b/clients/client-sagemaker/src/commands/ListHyperParameterTuningJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListHyperParameterTuningJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListHyperParameterTuningJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListImageVersionsCommand.ts b/clients/client-sagemaker/src/commands/ListImageVersionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListImageVersionsCommand.ts rename to clients/client-sagemaker/src/commands/ListImageVersionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListImagesCommand.ts b/clients/client-sagemaker/src/commands/ListImagesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListImagesCommand.ts rename to clients/client-sagemaker/src/commands/ListImagesCommand.ts diff --git a/clients/client-sagemaker/commands/ListLabelingJobsCommand.ts b/clients/client-sagemaker/src/commands/ListLabelingJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListLabelingJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListLabelingJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListLabelingJobsForWorkteamCommand.ts b/clients/client-sagemaker/src/commands/ListLabelingJobsForWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListLabelingJobsForWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/ListLabelingJobsForWorkteamCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelBiasJobDefinitionsCommand.ts b/clients/client-sagemaker/src/commands/ListModelBiasJobDefinitionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelBiasJobDefinitionsCommand.ts rename to clients/client-sagemaker/src/commands/ListModelBiasJobDefinitionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelExplainabilityJobDefinitionsCommand.ts b/clients/client-sagemaker/src/commands/ListModelExplainabilityJobDefinitionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelExplainabilityJobDefinitionsCommand.ts rename to clients/client-sagemaker/src/commands/ListModelExplainabilityJobDefinitionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelPackageGroupsCommand.ts b/clients/client-sagemaker/src/commands/ListModelPackageGroupsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelPackageGroupsCommand.ts rename to clients/client-sagemaker/src/commands/ListModelPackageGroupsCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelPackagesCommand.ts b/clients/client-sagemaker/src/commands/ListModelPackagesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelPackagesCommand.ts rename to clients/client-sagemaker/src/commands/ListModelPackagesCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelQualityJobDefinitionsCommand.ts b/clients/client-sagemaker/src/commands/ListModelQualityJobDefinitionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelQualityJobDefinitionsCommand.ts rename to clients/client-sagemaker/src/commands/ListModelQualityJobDefinitionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListModelsCommand.ts b/clients/client-sagemaker/src/commands/ListModelsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListModelsCommand.ts rename to clients/client-sagemaker/src/commands/ListModelsCommand.ts diff --git a/clients/client-sagemaker/commands/ListMonitoringExecutionsCommand.ts b/clients/client-sagemaker/src/commands/ListMonitoringExecutionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListMonitoringExecutionsCommand.ts rename to clients/client-sagemaker/src/commands/ListMonitoringExecutionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListMonitoringSchedulesCommand.ts b/clients/client-sagemaker/src/commands/ListMonitoringSchedulesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListMonitoringSchedulesCommand.ts rename to clients/client-sagemaker/src/commands/ListMonitoringSchedulesCommand.ts diff --git a/clients/client-sagemaker/commands/ListNotebookInstanceLifecycleConfigsCommand.ts b/clients/client-sagemaker/src/commands/ListNotebookInstanceLifecycleConfigsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListNotebookInstanceLifecycleConfigsCommand.ts rename to clients/client-sagemaker/src/commands/ListNotebookInstanceLifecycleConfigsCommand.ts diff --git a/clients/client-sagemaker/commands/ListNotebookInstancesCommand.ts b/clients/client-sagemaker/src/commands/ListNotebookInstancesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListNotebookInstancesCommand.ts rename to clients/client-sagemaker/src/commands/ListNotebookInstancesCommand.ts diff --git a/clients/client-sagemaker/commands/ListPipelineExecutionStepsCommand.ts b/clients/client-sagemaker/src/commands/ListPipelineExecutionStepsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListPipelineExecutionStepsCommand.ts rename to clients/client-sagemaker/src/commands/ListPipelineExecutionStepsCommand.ts diff --git a/clients/client-sagemaker/commands/ListPipelineExecutionsCommand.ts b/clients/client-sagemaker/src/commands/ListPipelineExecutionsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListPipelineExecutionsCommand.ts rename to clients/client-sagemaker/src/commands/ListPipelineExecutionsCommand.ts diff --git a/clients/client-sagemaker/commands/ListPipelineParametersForExecutionCommand.ts b/clients/client-sagemaker/src/commands/ListPipelineParametersForExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListPipelineParametersForExecutionCommand.ts rename to clients/client-sagemaker/src/commands/ListPipelineParametersForExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/ListPipelinesCommand.ts b/clients/client-sagemaker/src/commands/ListPipelinesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListPipelinesCommand.ts rename to clients/client-sagemaker/src/commands/ListPipelinesCommand.ts diff --git a/clients/client-sagemaker/commands/ListProcessingJobsCommand.ts b/clients/client-sagemaker/src/commands/ListProcessingJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListProcessingJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListProcessingJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListProjectsCommand.ts b/clients/client-sagemaker/src/commands/ListProjectsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListProjectsCommand.ts rename to clients/client-sagemaker/src/commands/ListProjectsCommand.ts diff --git a/clients/client-sagemaker/commands/ListStudioLifecycleConfigsCommand.ts b/clients/client-sagemaker/src/commands/ListStudioLifecycleConfigsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListStudioLifecycleConfigsCommand.ts rename to clients/client-sagemaker/src/commands/ListStudioLifecycleConfigsCommand.ts diff --git a/clients/client-sagemaker/commands/ListSubscribedWorkteamsCommand.ts b/clients/client-sagemaker/src/commands/ListSubscribedWorkteamsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListSubscribedWorkteamsCommand.ts rename to clients/client-sagemaker/src/commands/ListSubscribedWorkteamsCommand.ts diff --git a/clients/client-sagemaker/commands/ListTagsCommand.ts b/clients/client-sagemaker/src/commands/ListTagsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTagsCommand.ts rename to clients/client-sagemaker/src/commands/ListTagsCommand.ts diff --git a/clients/client-sagemaker/commands/ListTrainingJobsCommand.ts b/clients/client-sagemaker/src/commands/ListTrainingJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTrainingJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListTrainingJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListTrainingJobsForHyperParameterTuningJobCommand.ts b/clients/client-sagemaker/src/commands/ListTrainingJobsForHyperParameterTuningJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTrainingJobsForHyperParameterTuningJobCommand.ts rename to clients/client-sagemaker/src/commands/ListTrainingJobsForHyperParameterTuningJobCommand.ts diff --git a/clients/client-sagemaker/commands/ListTransformJobsCommand.ts b/clients/client-sagemaker/src/commands/ListTransformJobsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTransformJobsCommand.ts rename to clients/client-sagemaker/src/commands/ListTransformJobsCommand.ts diff --git a/clients/client-sagemaker/commands/ListTrialComponentsCommand.ts b/clients/client-sagemaker/src/commands/ListTrialComponentsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTrialComponentsCommand.ts rename to clients/client-sagemaker/src/commands/ListTrialComponentsCommand.ts diff --git a/clients/client-sagemaker/commands/ListTrialsCommand.ts b/clients/client-sagemaker/src/commands/ListTrialsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListTrialsCommand.ts rename to clients/client-sagemaker/src/commands/ListTrialsCommand.ts diff --git a/clients/client-sagemaker/commands/ListUserProfilesCommand.ts b/clients/client-sagemaker/src/commands/ListUserProfilesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListUserProfilesCommand.ts rename to clients/client-sagemaker/src/commands/ListUserProfilesCommand.ts diff --git a/clients/client-sagemaker/commands/ListWorkforcesCommand.ts b/clients/client-sagemaker/src/commands/ListWorkforcesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListWorkforcesCommand.ts rename to clients/client-sagemaker/src/commands/ListWorkforcesCommand.ts diff --git a/clients/client-sagemaker/commands/ListWorkteamsCommand.ts b/clients/client-sagemaker/src/commands/ListWorkteamsCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/ListWorkteamsCommand.ts rename to clients/client-sagemaker/src/commands/ListWorkteamsCommand.ts diff --git a/clients/client-sagemaker/commands/PutModelPackageGroupPolicyCommand.ts b/clients/client-sagemaker/src/commands/PutModelPackageGroupPolicyCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/PutModelPackageGroupPolicyCommand.ts rename to clients/client-sagemaker/src/commands/PutModelPackageGroupPolicyCommand.ts diff --git a/clients/client-sagemaker/commands/RegisterDevicesCommand.ts b/clients/client-sagemaker/src/commands/RegisterDevicesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/RegisterDevicesCommand.ts rename to clients/client-sagemaker/src/commands/RegisterDevicesCommand.ts diff --git a/clients/client-sagemaker/commands/RenderUiTemplateCommand.ts b/clients/client-sagemaker/src/commands/RenderUiTemplateCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/RenderUiTemplateCommand.ts rename to clients/client-sagemaker/src/commands/RenderUiTemplateCommand.ts diff --git a/clients/client-sagemaker/commands/RetryPipelineExecutionCommand.ts b/clients/client-sagemaker/src/commands/RetryPipelineExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/RetryPipelineExecutionCommand.ts rename to clients/client-sagemaker/src/commands/RetryPipelineExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/SearchCommand.ts b/clients/client-sagemaker/src/commands/SearchCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/SearchCommand.ts rename to clients/client-sagemaker/src/commands/SearchCommand.ts diff --git a/clients/client-sagemaker/commands/SendPipelineExecutionStepFailureCommand.ts b/clients/client-sagemaker/src/commands/SendPipelineExecutionStepFailureCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/SendPipelineExecutionStepFailureCommand.ts rename to clients/client-sagemaker/src/commands/SendPipelineExecutionStepFailureCommand.ts diff --git a/clients/client-sagemaker/commands/SendPipelineExecutionStepSuccessCommand.ts b/clients/client-sagemaker/src/commands/SendPipelineExecutionStepSuccessCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/SendPipelineExecutionStepSuccessCommand.ts rename to clients/client-sagemaker/src/commands/SendPipelineExecutionStepSuccessCommand.ts diff --git a/clients/client-sagemaker/commands/StartMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/StartMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StartMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/StartMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/StartNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/StartNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StartNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/StartNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/StartPipelineExecutionCommand.ts b/clients/client-sagemaker/src/commands/StartPipelineExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StartPipelineExecutionCommand.ts rename to clients/client-sagemaker/src/commands/StartPipelineExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/StopAutoMLJobCommand.ts b/clients/client-sagemaker/src/commands/StopAutoMLJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopAutoMLJobCommand.ts rename to clients/client-sagemaker/src/commands/StopAutoMLJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopCompilationJobCommand.ts b/clients/client-sagemaker/src/commands/StopCompilationJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopCompilationJobCommand.ts rename to clients/client-sagemaker/src/commands/StopCompilationJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopEdgePackagingJobCommand.ts b/clients/client-sagemaker/src/commands/StopEdgePackagingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopEdgePackagingJobCommand.ts rename to clients/client-sagemaker/src/commands/StopEdgePackagingJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopHyperParameterTuningJobCommand.ts b/clients/client-sagemaker/src/commands/StopHyperParameterTuningJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopHyperParameterTuningJobCommand.ts rename to clients/client-sagemaker/src/commands/StopHyperParameterTuningJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopLabelingJobCommand.ts b/clients/client-sagemaker/src/commands/StopLabelingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopLabelingJobCommand.ts rename to clients/client-sagemaker/src/commands/StopLabelingJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/StopMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/StopMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/StopNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/StopNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/StopNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/StopPipelineExecutionCommand.ts b/clients/client-sagemaker/src/commands/StopPipelineExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopPipelineExecutionCommand.ts rename to clients/client-sagemaker/src/commands/StopPipelineExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/StopProcessingJobCommand.ts b/clients/client-sagemaker/src/commands/StopProcessingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopProcessingJobCommand.ts rename to clients/client-sagemaker/src/commands/StopProcessingJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopTrainingJobCommand.ts b/clients/client-sagemaker/src/commands/StopTrainingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopTrainingJobCommand.ts rename to clients/client-sagemaker/src/commands/StopTrainingJobCommand.ts diff --git a/clients/client-sagemaker/commands/StopTransformJobCommand.ts b/clients/client-sagemaker/src/commands/StopTransformJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/StopTransformJobCommand.ts rename to clients/client-sagemaker/src/commands/StopTransformJobCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateActionCommand.ts b/clients/client-sagemaker/src/commands/UpdateActionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateActionCommand.ts rename to clients/client-sagemaker/src/commands/UpdateActionCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateAppImageConfigCommand.ts b/clients/client-sagemaker/src/commands/UpdateAppImageConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateAppImageConfigCommand.ts rename to clients/client-sagemaker/src/commands/UpdateAppImageConfigCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateArtifactCommand.ts b/clients/client-sagemaker/src/commands/UpdateArtifactCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateArtifactCommand.ts rename to clients/client-sagemaker/src/commands/UpdateArtifactCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateCodeRepositoryCommand.ts b/clients/client-sagemaker/src/commands/UpdateCodeRepositoryCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateCodeRepositoryCommand.ts rename to clients/client-sagemaker/src/commands/UpdateCodeRepositoryCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateContextCommand.ts b/clients/client-sagemaker/src/commands/UpdateContextCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateContextCommand.ts rename to clients/client-sagemaker/src/commands/UpdateContextCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateDeviceFleetCommand.ts b/clients/client-sagemaker/src/commands/UpdateDeviceFleetCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateDeviceFleetCommand.ts rename to clients/client-sagemaker/src/commands/UpdateDeviceFleetCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateDevicesCommand.ts b/clients/client-sagemaker/src/commands/UpdateDevicesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateDevicesCommand.ts rename to clients/client-sagemaker/src/commands/UpdateDevicesCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateDomainCommand.ts b/clients/client-sagemaker/src/commands/UpdateDomainCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateDomainCommand.ts rename to clients/client-sagemaker/src/commands/UpdateDomainCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateEndpointCommand.ts b/clients/client-sagemaker/src/commands/UpdateEndpointCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateEndpointCommand.ts rename to clients/client-sagemaker/src/commands/UpdateEndpointCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateEndpointWeightsAndCapacitiesCommand.ts b/clients/client-sagemaker/src/commands/UpdateEndpointWeightsAndCapacitiesCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateEndpointWeightsAndCapacitiesCommand.ts rename to clients/client-sagemaker/src/commands/UpdateEndpointWeightsAndCapacitiesCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateExperimentCommand.ts b/clients/client-sagemaker/src/commands/UpdateExperimentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateExperimentCommand.ts rename to clients/client-sagemaker/src/commands/UpdateExperimentCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateImageCommand.ts b/clients/client-sagemaker/src/commands/UpdateImageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateImageCommand.ts rename to clients/client-sagemaker/src/commands/UpdateImageCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateModelPackageCommand.ts b/clients/client-sagemaker/src/commands/UpdateModelPackageCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateModelPackageCommand.ts rename to clients/client-sagemaker/src/commands/UpdateModelPackageCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateMonitoringScheduleCommand.ts b/clients/client-sagemaker/src/commands/UpdateMonitoringScheduleCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateMonitoringScheduleCommand.ts rename to clients/client-sagemaker/src/commands/UpdateMonitoringScheduleCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateNotebookInstanceCommand.ts b/clients/client-sagemaker/src/commands/UpdateNotebookInstanceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateNotebookInstanceCommand.ts rename to clients/client-sagemaker/src/commands/UpdateNotebookInstanceCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateNotebookInstanceLifecycleConfigCommand.ts b/clients/client-sagemaker/src/commands/UpdateNotebookInstanceLifecycleConfigCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateNotebookInstanceLifecycleConfigCommand.ts rename to clients/client-sagemaker/src/commands/UpdateNotebookInstanceLifecycleConfigCommand.ts diff --git a/clients/client-sagemaker/commands/UpdatePipelineCommand.ts b/clients/client-sagemaker/src/commands/UpdatePipelineCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdatePipelineCommand.ts rename to clients/client-sagemaker/src/commands/UpdatePipelineCommand.ts diff --git a/clients/client-sagemaker/commands/UpdatePipelineExecutionCommand.ts b/clients/client-sagemaker/src/commands/UpdatePipelineExecutionCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdatePipelineExecutionCommand.ts rename to clients/client-sagemaker/src/commands/UpdatePipelineExecutionCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateTrainingJobCommand.ts b/clients/client-sagemaker/src/commands/UpdateTrainingJobCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateTrainingJobCommand.ts rename to clients/client-sagemaker/src/commands/UpdateTrainingJobCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateTrialCommand.ts b/clients/client-sagemaker/src/commands/UpdateTrialCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateTrialCommand.ts rename to clients/client-sagemaker/src/commands/UpdateTrialCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateTrialComponentCommand.ts b/clients/client-sagemaker/src/commands/UpdateTrialComponentCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateTrialComponentCommand.ts rename to clients/client-sagemaker/src/commands/UpdateTrialComponentCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateUserProfileCommand.ts b/clients/client-sagemaker/src/commands/UpdateUserProfileCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateUserProfileCommand.ts rename to clients/client-sagemaker/src/commands/UpdateUserProfileCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateWorkforceCommand.ts b/clients/client-sagemaker/src/commands/UpdateWorkforceCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateWorkforceCommand.ts rename to clients/client-sagemaker/src/commands/UpdateWorkforceCommand.ts diff --git a/clients/client-sagemaker/commands/UpdateWorkteamCommand.ts b/clients/client-sagemaker/src/commands/UpdateWorkteamCommand.ts similarity index 100% rename from clients/client-sagemaker/commands/UpdateWorkteamCommand.ts rename to clients/client-sagemaker/src/commands/UpdateWorkteamCommand.ts diff --git a/clients/client-sagemaker/endpoints.ts b/clients/client-sagemaker/src/endpoints.ts similarity index 100% rename from clients/client-sagemaker/endpoints.ts rename to clients/client-sagemaker/src/endpoints.ts diff --git a/clients/client-sagemaker/index.ts b/clients/client-sagemaker/src/index.ts similarity index 100% rename from clients/client-sagemaker/index.ts rename to clients/client-sagemaker/src/index.ts diff --git a/clients/client-sagemaker/models/index.ts b/clients/client-sagemaker/src/models/index.ts similarity index 100% rename from clients/client-sagemaker/models/index.ts rename to clients/client-sagemaker/src/models/index.ts diff --git a/clients/client-sagemaker/models/models_0.ts b/clients/client-sagemaker/src/models/models_0.ts similarity index 100% rename from clients/client-sagemaker/models/models_0.ts rename to clients/client-sagemaker/src/models/models_0.ts diff --git a/clients/client-sagemaker/models/models_1.ts b/clients/client-sagemaker/src/models/models_1.ts similarity index 100% rename from clients/client-sagemaker/models/models_1.ts rename to clients/client-sagemaker/src/models/models_1.ts diff --git a/clients/client-sagemaker/models/models_2.ts b/clients/client-sagemaker/src/models/models_2.ts similarity index 100% rename from clients/client-sagemaker/models/models_2.ts rename to clients/client-sagemaker/src/models/models_2.ts diff --git a/clients/client-sagemaker/models/models_3.ts b/clients/client-sagemaker/src/models/models_3.ts similarity index 100% rename from clients/client-sagemaker/models/models_3.ts rename to clients/client-sagemaker/src/models/models_3.ts diff --git a/clients/client-sagemaker/pagination/Interfaces.ts b/clients/client-sagemaker/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sagemaker/pagination/Interfaces.ts rename to clients/client-sagemaker/src/pagination/Interfaces.ts diff --git a/clients/client-sagemaker/pagination/ListActionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListActionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListActionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListActionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListAlgorithmsPaginator.ts b/clients/client-sagemaker/src/pagination/ListAlgorithmsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListAlgorithmsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListAlgorithmsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListAppImageConfigsPaginator.ts b/clients/client-sagemaker/src/pagination/ListAppImageConfigsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListAppImageConfigsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListAppImageConfigsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListAppsPaginator.ts b/clients/client-sagemaker/src/pagination/ListAppsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListAppsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListAppsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListArtifactsPaginator.ts b/clients/client-sagemaker/src/pagination/ListArtifactsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListArtifactsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListArtifactsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListAssociationsPaginator.ts b/clients/client-sagemaker/src/pagination/ListAssociationsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListAssociationsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListAssociationsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListAutoMLJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListAutoMLJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListAutoMLJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListAutoMLJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListCandidatesForAutoMLJobPaginator.ts b/clients/client-sagemaker/src/pagination/ListCandidatesForAutoMLJobPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListCandidatesForAutoMLJobPaginator.ts rename to clients/client-sagemaker/src/pagination/ListCandidatesForAutoMLJobPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListCodeRepositoriesPaginator.ts b/clients/client-sagemaker/src/pagination/ListCodeRepositoriesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListCodeRepositoriesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListCodeRepositoriesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListCompilationJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListCompilationJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListCompilationJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListCompilationJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListContextsPaginator.ts b/clients/client-sagemaker/src/pagination/ListContextsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListContextsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListContextsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListDataQualityJobDefinitionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListDataQualityJobDefinitionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListDataQualityJobDefinitionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListDataQualityJobDefinitionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListDeviceFleetsPaginator.ts b/clients/client-sagemaker/src/pagination/ListDeviceFleetsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListDeviceFleetsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListDeviceFleetsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListDevicesPaginator.ts b/clients/client-sagemaker/src/pagination/ListDevicesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListDevicesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListDevicesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListDomainsPaginator.ts b/clients/client-sagemaker/src/pagination/ListDomainsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListDomainsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListDomainsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListEdgePackagingJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListEdgePackagingJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListEdgePackagingJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListEdgePackagingJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListEndpointConfigsPaginator.ts b/clients/client-sagemaker/src/pagination/ListEndpointConfigsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListEndpointConfigsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListEndpointConfigsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListEndpointsPaginator.ts b/clients/client-sagemaker/src/pagination/ListEndpointsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListEndpointsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListEndpointsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListExperimentsPaginator.ts b/clients/client-sagemaker/src/pagination/ListExperimentsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListExperimentsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListExperimentsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListFlowDefinitionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListFlowDefinitionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListFlowDefinitionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListFlowDefinitionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListHumanTaskUisPaginator.ts b/clients/client-sagemaker/src/pagination/ListHumanTaskUisPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListHumanTaskUisPaginator.ts rename to clients/client-sagemaker/src/pagination/ListHumanTaskUisPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListHyperParameterTuningJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListHyperParameterTuningJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListHyperParameterTuningJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListHyperParameterTuningJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListImageVersionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListImageVersionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListImageVersionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListImageVersionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListImagesPaginator.ts b/clients/client-sagemaker/src/pagination/ListImagesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListImagesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListImagesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListLabelingJobsForWorkteamPaginator.ts b/clients/client-sagemaker/src/pagination/ListLabelingJobsForWorkteamPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListLabelingJobsForWorkteamPaginator.ts rename to clients/client-sagemaker/src/pagination/ListLabelingJobsForWorkteamPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListLabelingJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListLabelingJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListLabelingJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListLabelingJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelBiasJobDefinitionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelBiasJobDefinitionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelBiasJobDefinitionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelBiasJobDefinitionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelExplainabilityJobDefinitionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelExplainabilityJobDefinitionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelExplainabilityJobDefinitionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelExplainabilityJobDefinitionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelPackageGroupsPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelPackageGroupsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelPackageGroupsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelPackageGroupsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelPackagesPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelPackagesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelPackagesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelPackagesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelQualityJobDefinitionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelQualityJobDefinitionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelQualityJobDefinitionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelQualityJobDefinitionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListModelsPaginator.ts b/clients/client-sagemaker/src/pagination/ListModelsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListModelsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListModelsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListMonitoringExecutionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListMonitoringExecutionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListMonitoringExecutionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListMonitoringExecutionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListMonitoringSchedulesPaginator.ts b/clients/client-sagemaker/src/pagination/ListMonitoringSchedulesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListMonitoringSchedulesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListMonitoringSchedulesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts b/clients/client-sagemaker/src/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListNotebookInstanceLifecycleConfigsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListNotebookInstancesPaginator.ts b/clients/client-sagemaker/src/pagination/ListNotebookInstancesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListNotebookInstancesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListNotebookInstancesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListPipelineExecutionStepsPaginator.ts b/clients/client-sagemaker/src/pagination/ListPipelineExecutionStepsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListPipelineExecutionStepsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListPipelineExecutionStepsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListPipelineExecutionsPaginator.ts b/clients/client-sagemaker/src/pagination/ListPipelineExecutionsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListPipelineExecutionsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListPipelineExecutionsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListPipelineParametersForExecutionPaginator.ts b/clients/client-sagemaker/src/pagination/ListPipelineParametersForExecutionPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListPipelineParametersForExecutionPaginator.ts rename to clients/client-sagemaker/src/pagination/ListPipelineParametersForExecutionPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListPipelinesPaginator.ts b/clients/client-sagemaker/src/pagination/ListPipelinesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListPipelinesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListPipelinesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListProcessingJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListProcessingJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListProcessingJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListProcessingJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListProjectsPaginator.ts b/clients/client-sagemaker/src/pagination/ListProjectsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListProjectsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListProjectsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListStudioLifecycleConfigsPaginator.ts b/clients/client-sagemaker/src/pagination/ListStudioLifecycleConfigsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListStudioLifecycleConfigsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListStudioLifecycleConfigsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListSubscribedWorkteamsPaginator.ts b/clients/client-sagemaker/src/pagination/ListSubscribedWorkteamsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListSubscribedWorkteamsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListSubscribedWorkteamsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTagsPaginator.ts b/clients/client-sagemaker/src/pagination/ListTagsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTagsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTagsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts b/clients/client-sagemaker/src/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTrainingJobsForHyperParameterTuningJobPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTrainingJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListTrainingJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTrainingJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTrainingJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTransformJobsPaginator.ts b/clients/client-sagemaker/src/pagination/ListTransformJobsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTransformJobsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTransformJobsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTrialComponentsPaginator.ts b/clients/client-sagemaker/src/pagination/ListTrialComponentsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTrialComponentsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTrialComponentsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListTrialsPaginator.ts b/clients/client-sagemaker/src/pagination/ListTrialsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListTrialsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListTrialsPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListUserProfilesPaginator.ts b/clients/client-sagemaker/src/pagination/ListUserProfilesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListUserProfilesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListUserProfilesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListWorkforcesPaginator.ts b/clients/client-sagemaker/src/pagination/ListWorkforcesPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListWorkforcesPaginator.ts rename to clients/client-sagemaker/src/pagination/ListWorkforcesPaginator.ts diff --git a/clients/client-sagemaker/pagination/ListWorkteamsPaginator.ts b/clients/client-sagemaker/src/pagination/ListWorkteamsPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/ListWorkteamsPaginator.ts rename to clients/client-sagemaker/src/pagination/ListWorkteamsPaginator.ts diff --git a/clients/client-sagemaker/pagination/SearchPaginator.ts b/clients/client-sagemaker/src/pagination/SearchPaginator.ts similarity index 100% rename from clients/client-sagemaker/pagination/SearchPaginator.ts rename to clients/client-sagemaker/src/pagination/SearchPaginator.ts diff --git a/clients/client-sagemaker/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-sagemaker/protocols/Aws_json1_1.ts rename to clients/client-sagemaker/src/protocols/Aws_json1_1.ts diff --git a/clients/client-sagemaker/src/runtimeConfig.browser.ts b/clients/client-sagemaker/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..71cb4ba7fb7d --- /dev/null +++ b/clients/client-sagemaker/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SageMakerClientConfig } from "./SageMakerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker/runtimeConfig.native.ts b/clients/client-sagemaker/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sagemaker/runtimeConfig.native.ts rename to clients/client-sagemaker/src/runtimeConfig.native.ts diff --git a/clients/client-sagemaker/runtimeConfig.shared.ts b/clients/client-sagemaker/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sagemaker/runtimeConfig.shared.ts rename to clients/client-sagemaker/src/runtimeConfig.shared.ts diff --git a/clients/client-sagemaker/src/runtimeConfig.ts b/clients/client-sagemaker/src/runtimeConfig.ts new file mode 100644 index 000000000000..a00b3604b7bd --- /dev/null +++ b/clients/client-sagemaker/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SageMakerClientConfig } from "./SageMakerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SageMakerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sagemaker/waiters/waitForEndpointDeleted.ts b/clients/client-sagemaker/src/waiters/waitForEndpointDeleted.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForEndpointDeleted.ts rename to clients/client-sagemaker/src/waiters/waitForEndpointDeleted.ts diff --git a/clients/client-sagemaker/waiters/waitForEndpointInService.ts b/clients/client-sagemaker/src/waiters/waitForEndpointInService.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForEndpointInService.ts rename to clients/client-sagemaker/src/waiters/waitForEndpointInService.ts diff --git a/clients/client-sagemaker/waiters/waitForImageCreated.ts b/clients/client-sagemaker/src/waiters/waitForImageCreated.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForImageCreated.ts rename to clients/client-sagemaker/src/waiters/waitForImageCreated.ts diff --git a/clients/client-sagemaker/waiters/waitForImageDeleted.ts b/clients/client-sagemaker/src/waiters/waitForImageDeleted.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForImageDeleted.ts rename to clients/client-sagemaker/src/waiters/waitForImageDeleted.ts diff --git a/clients/client-sagemaker/waiters/waitForImageUpdated.ts b/clients/client-sagemaker/src/waiters/waitForImageUpdated.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForImageUpdated.ts rename to clients/client-sagemaker/src/waiters/waitForImageUpdated.ts diff --git a/clients/client-sagemaker/waiters/waitForImageVersionCreated.ts b/clients/client-sagemaker/src/waiters/waitForImageVersionCreated.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForImageVersionCreated.ts rename to clients/client-sagemaker/src/waiters/waitForImageVersionCreated.ts diff --git a/clients/client-sagemaker/waiters/waitForImageVersionDeleted.ts b/clients/client-sagemaker/src/waiters/waitForImageVersionDeleted.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForImageVersionDeleted.ts rename to clients/client-sagemaker/src/waiters/waitForImageVersionDeleted.ts diff --git a/clients/client-sagemaker/waiters/waitForNotebookInstanceDeleted.ts b/clients/client-sagemaker/src/waiters/waitForNotebookInstanceDeleted.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForNotebookInstanceDeleted.ts rename to clients/client-sagemaker/src/waiters/waitForNotebookInstanceDeleted.ts diff --git a/clients/client-sagemaker/waiters/waitForNotebookInstanceInService.ts b/clients/client-sagemaker/src/waiters/waitForNotebookInstanceInService.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForNotebookInstanceInService.ts rename to clients/client-sagemaker/src/waiters/waitForNotebookInstanceInService.ts diff --git a/clients/client-sagemaker/waiters/waitForNotebookInstanceStopped.ts b/clients/client-sagemaker/src/waiters/waitForNotebookInstanceStopped.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForNotebookInstanceStopped.ts rename to clients/client-sagemaker/src/waiters/waitForNotebookInstanceStopped.ts diff --git a/clients/client-sagemaker/waiters/waitForProcessingJobCompletedOrStopped.ts b/clients/client-sagemaker/src/waiters/waitForProcessingJobCompletedOrStopped.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForProcessingJobCompletedOrStopped.ts rename to clients/client-sagemaker/src/waiters/waitForProcessingJobCompletedOrStopped.ts diff --git a/clients/client-sagemaker/waiters/waitForTrainingJobCompletedOrStopped.ts b/clients/client-sagemaker/src/waiters/waitForTrainingJobCompletedOrStopped.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForTrainingJobCompletedOrStopped.ts rename to clients/client-sagemaker/src/waiters/waitForTrainingJobCompletedOrStopped.ts diff --git a/clients/client-sagemaker/waiters/waitForTransformJobCompletedOrStopped.ts b/clients/client-sagemaker/src/waiters/waitForTransformJobCompletedOrStopped.ts similarity index 100% rename from clients/client-sagemaker/waiters/waitForTransformJobCompletedOrStopped.ts rename to clients/client-sagemaker/src/waiters/waitForTransformJobCompletedOrStopped.ts diff --git a/clients/client-sagemaker/tsconfig.es.json b/clients/client-sagemaker/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sagemaker/tsconfig.es.json +++ b/clients/client-sagemaker/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sagemaker/tsconfig.json b/clients/client-sagemaker/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sagemaker/tsconfig.json +++ b/clients/client-sagemaker/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sagemaker/tsconfig.types.json b/clients/client-sagemaker/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sagemaker/tsconfig.types.json +++ b/clients/client-sagemaker/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-savingsplans/.gitignore b/clients/client-savingsplans/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-savingsplans/.gitignore +++ b/clients/client-savingsplans/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-savingsplans/package.json b/clients/client-savingsplans/package.json index 4929796807fc..f6a8835dfb8a 100644 --- a/clients/client-savingsplans/package.json +++ b/clients/client-savingsplans/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-savingsplans", "repository": { "type": "git", diff --git a/clients/client-savingsplans/runtimeConfig.browser.ts b/clients/client-savingsplans/runtimeConfig.browser.ts deleted file mode 100644 index 5c8aa793f8a6..000000000000 --- a/clients/client-savingsplans/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SavingsplansClientConfig } from "./SavingsplansClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SavingsplansClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-savingsplans/runtimeConfig.ts b/clients/client-savingsplans/runtimeConfig.ts deleted file mode 100644 index 37652b19362c..000000000000 --- a/clients/client-savingsplans/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SavingsplansClientConfig } from "./SavingsplansClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SavingsplansClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-savingsplans/Savingsplans.ts b/clients/client-savingsplans/src/Savingsplans.ts similarity index 100% rename from clients/client-savingsplans/Savingsplans.ts rename to clients/client-savingsplans/src/Savingsplans.ts diff --git a/clients/client-savingsplans/SavingsplansClient.ts b/clients/client-savingsplans/src/SavingsplansClient.ts similarity index 100% rename from clients/client-savingsplans/SavingsplansClient.ts rename to clients/client-savingsplans/src/SavingsplansClient.ts diff --git a/clients/client-savingsplans/commands/CreateSavingsPlanCommand.ts b/clients/client-savingsplans/src/commands/CreateSavingsPlanCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/CreateSavingsPlanCommand.ts rename to clients/client-savingsplans/src/commands/CreateSavingsPlanCommand.ts diff --git a/clients/client-savingsplans/commands/DeleteQueuedSavingsPlanCommand.ts b/clients/client-savingsplans/src/commands/DeleteQueuedSavingsPlanCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/DeleteQueuedSavingsPlanCommand.ts rename to clients/client-savingsplans/src/commands/DeleteQueuedSavingsPlanCommand.ts diff --git a/clients/client-savingsplans/commands/DescribeSavingsPlanRatesCommand.ts b/clients/client-savingsplans/src/commands/DescribeSavingsPlanRatesCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/DescribeSavingsPlanRatesCommand.ts rename to clients/client-savingsplans/src/commands/DescribeSavingsPlanRatesCommand.ts diff --git a/clients/client-savingsplans/commands/DescribeSavingsPlansCommand.ts b/clients/client-savingsplans/src/commands/DescribeSavingsPlansCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/DescribeSavingsPlansCommand.ts rename to clients/client-savingsplans/src/commands/DescribeSavingsPlansCommand.ts diff --git a/clients/client-savingsplans/commands/DescribeSavingsPlansOfferingRatesCommand.ts b/clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingRatesCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/DescribeSavingsPlansOfferingRatesCommand.ts rename to clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingRatesCommand.ts diff --git a/clients/client-savingsplans/commands/DescribeSavingsPlansOfferingsCommand.ts b/clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingsCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/DescribeSavingsPlansOfferingsCommand.ts rename to clients/client-savingsplans/src/commands/DescribeSavingsPlansOfferingsCommand.ts diff --git a/clients/client-savingsplans/commands/ListTagsForResourceCommand.ts b/clients/client-savingsplans/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/ListTagsForResourceCommand.ts rename to clients/client-savingsplans/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-savingsplans/commands/TagResourceCommand.ts b/clients/client-savingsplans/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/TagResourceCommand.ts rename to clients/client-savingsplans/src/commands/TagResourceCommand.ts diff --git a/clients/client-savingsplans/commands/UntagResourceCommand.ts b/clients/client-savingsplans/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-savingsplans/commands/UntagResourceCommand.ts rename to clients/client-savingsplans/src/commands/UntagResourceCommand.ts diff --git a/clients/client-savingsplans/endpoints.ts b/clients/client-savingsplans/src/endpoints.ts similarity index 100% rename from clients/client-savingsplans/endpoints.ts rename to clients/client-savingsplans/src/endpoints.ts diff --git a/clients/client-savingsplans/index.ts b/clients/client-savingsplans/src/index.ts similarity index 100% rename from clients/client-savingsplans/index.ts rename to clients/client-savingsplans/src/index.ts diff --git a/clients/client-savingsplans/models/index.ts b/clients/client-savingsplans/src/models/index.ts similarity index 100% rename from clients/client-savingsplans/models/index.ts rename to clients/client-savingsplans/src/models/index.ts diff --git a/clients/client-savingsplans/models/models_0.ts b/clients/client-savingsplans/src/models/models_0.ts similarity index 100% rename from clients/client-savingsplans/models/models_0.ts rename to clients/client-savingsplans/src/models/models_0.ts diff --git a/clients/client-savingsplans/protocols/Aws_restJson1.ts b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-savingsplans/protocols/Aws_restJson1.ts rename to clients/client-savingsplans/src/protocols/Aws_restJson1.ts diff --git a/clients/client-savingsplans/src/runtimeConfig.browser.ts b/clients/client-savingsplans/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cbbbcf22e19c --- /dev/null +++ b/clients/client-savingsplans/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SavingsplansClientConfig } from "./SavingsplansClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SavingsplansClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-savingsplans/runtimeConfig.native.ts b/clients/client-savingsplans/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-savingsplans/runtimeConfig.native.ts rename to clients/client-savingsplans/src/runtimeConfig.native.ts diff --git a/clients/client-savingsplans/runtimeConfig.shared.ts b/clients/client-savingsplans/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-savingsplans/runtimeConfig.shared.ts rename to clients/client-savingsplans/src/runtimeConfig.shared.ts diff --git a/clients/client-savingsplans/src/runtimeConfig.ts b/clients/client-savingsplans/src/runtimeConfig.ts new file mode 100644 index 000000000000..e539dd4eed1b --- /dev/null +++ b/clients/client-savingsplans/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SavingsplansClientConfig } from "./SavingsplansClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SavingsplansClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-savingsplans/tsconfig.es.json b/clients/client-savingsplans/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-savingsplans/tsconfig.es.json +++ b/clients/client-savingsplans/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-savingsplans/tsconfig.json b/clients/client-savingsplans/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-savingsplans/tsconfig.json +++ b/clients/client-savingsplans/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-savingsplans/tsconfig.types.json b/clients/client-savingsplans/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-savingsplans/tsconfig.types.json +++ b/clients/client-savingsplans/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-schemas/.gitignore b/clients/client-schemas/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-schemas/.gitignore +++ b/clients/client-schemas/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-schemas/package.json b/clients/client-schemas/package.json index b0894b716a2b..c7e5bb180c6d 100644 --- a/clients/client-schemas/package.json +++ b/clients/client-schemas/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-schemas", "repository": { "type": "git", diff --git a/clients/client-schemas/runtimeConfig.browser.ts b/clients/client-schemas/runtimeConfig.browser.ts deleted file mode 100644 index ecc17788c119..000000000000 --- a/clients/client-schemas/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SchemasClientConfig } from "./SchemasClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SchemasClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-schemas/runtimeConfig.ts b/clients/client-schemas/runtimeConfig.ts deleted file mode 100644 index 39eb41f5bdf2..000000000000 --- a/clients/client-schemas/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SchemasClientConfig } from "./SchemasClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SchemasClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-schemas/Schemas.ts b/clients/client-schemas/src/Schemas.ts similarity index 100% rename from clients/client-schemas/Schemas.ts rename to clients/client-schemas/src/Schemas.ts diff --git a/clients/client-schemas/SchemasClient.ts b/clients/client-schemas/src/SchemasClient.ts similarity index 100% rename from clients/client-schemas/SchemasClient.ts rename to clients/client-schemas/src/SchemasClient.ts diff --git a/clients/client-schemas/commands/CreateDiscovererCommand.ts b/clients/client-schemas/src/commands/CreateDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/CreateDiscovererCommand.ts rename to clients/client-schemas/src/commands/CreateDiscovererCommand.ts diff --git a/clients/client-schemas/commands/CreateRegistryCommand.ts b/clients/client-schemas/src/commands/CreateRegistryCommand.ts similarity index 100% rename from clients/client-schemas/commands/CreateRegistryCommand.ts rename to clients/client-schemas/src/commands/CreateRegistryCommand.ts diff --git a/clients/client-schemas/commands/CreateSchemaCommand.ts b/clients/client-schemas/src/commands/CreateSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/CreateSchemaCommand.ts rename to clients/client-schemas/src/commands/CreateSchemaCommand.ts diff --git a/clients/client-schemas/commands/DeleteDiscovererCommand.ts b/clients/client-schemas/src/commands/DeleteDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/DeleteDiscovererCommand.ts rename to clients/client-schemas/src/commands/DeleteDiscovererCommand.ts diff --git a/clients/client-schemas/commands/DeleteRegistryCommand.ts b/clients/client-schemas/src/commands/DeleteRegistryCommand.ts similarity index 100% rename from clients/client-schemas/commands/DeleteRegistryCommand.ts rename to clients/client-schemas/src/commands/DeleteRegistryCommand.ts diff --git a/clients/client-schemas/commands/DeleteResourcePolicyCommand.ts b/clients/client-schemas/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-schemas/commands/DeleteResourcePolicyCommand.ts rename to clients/client-schemas/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-schemas/commands/DeleteSchemaCommand.ts b/clients/client-schemas/src/commands/DeleteSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/DeleteSchemaCommand.ts rename to clients/client-schemas/src/commands/DeleteSchemaCommand.ts diff --git a/clients/client-schemas/commands/DeleteSchemaVersionCommand.ts b/clients/client-schemas/src/commands/DeleteSchemaVersionCommand.ts similarity index 100% rename from clients/client-schemas/commands/DeleteSchemaVersionCommand.ts rename to clients/client-schemas/src/commands/DeleteSchemaVersionCommand.ts diff --git a/clients/client-schemas/commands/DescribeCodeBindingCommand.ts b/clients/client-schemas/src/commands/DescribeCodeBindingCommand.ts similarity index 100% rename from clients/client-schemas/commands/DescribeCodeBindingCommand.ts rename to clients/client-schemas/src/commands/DescribeCodeBindingCommand.ts diff --git a/clients/client-schemas/commands/DescribeDiscovererCommand.ts b/clients/client-schemas/src/commands/DescribeDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/DescribeDiscovererCommand.ts rename to clients/client-schemas/src/commands/DescribeDiscovererCommand.ts diff --git a/clients/client-schemas/commands/DescribeRegistryCommand.ts b/clients/client-schemas/src/commands/DescribeRegistryCommand.ts similarity index 100% rename from clients/client-schemas/commands/DescribeRegistryCommand.ts rename to clients/client-schemas/src/commands/DescribeRegistryCommand.ts diff --git a/clients/client-schemas/commands/DescribeSchemaCommand.ts b/clients/client-schemas/src/commands/DescribeSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/DescribeSchemaCommand.ts rename to clients/client-schemas/src/commands/DescribeSchemaCommand.ts diff --git a/clients/client-schemas/commands/ExportSchemaCommand.ts b/clients/client-schemas/src/commands/ExportSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/ExportSchemaCommand.ts rename to clients/client-schemas/src/commands/ExportSchemaCommand.ts diff --git a/clients/client-schemas/commands/GetCodeBindingSourceCommand.ts b/clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts similarity index 100% rename from clients/client-schemas/commands/GetCodeBindingSourceCommand.ts rename to clients/client-schemas/src/commands/GetCodeBindingSourceCommand.ts diff --git a/clients/client-schemas/commands/GetDiscoveredSchemaCommand.ts b/clients/client-schemas/src/commands/GetDiscoveredSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/GetDiscoveredSchemaCommand.ts rename to clients/client-schemas/src/commands/GetDiscoveredSchemaCommand.ts diff --git a/clients/client-schemas/commands/GetResourcePolicyCommand.ts b/clients/client-schemas/src/commands/GetResourcePolicyCommand.ts similarity index 100% rename from clients/client-schemas/commands/GetResourcePolicyCommand.ts rename to clients/client-schemas/src/commands/GetResourcePolicyCommand.ts diff --git a/clients/client-schemas/commands/ListDiscoverersCommand.ts b/clients/client-schemas/src/commands/ListDiscoverersCommand.ts similarity index 100% rename from clients/client-schemas/commands/ListDiscoverersCommand.ts rename to clients/client-schemas/src/commands/ListDiscoverersCommand.ts diff --git a/clients/client-schemas/commands/ListRegistriesCommand.ts b/clients/client-schemas/src/commands/ListRegistriesCommand.ts similarity index 100% rename from clients/client-schemas/commands/ListRegistriesCommand.ts rename to clients/client-schemas/src/commands/ListRegistriesCommand.ts diff --git a/clients/client-schemas/commands/ListSchemaVersionsCommand.ts b/clients/client-schemas/src/commands/ListSchemaVersionsCommand.ts similarity index 100% rename from clients/client-schemas/commands/ListSchemaVersionsCommand.ts rename to clients/client-schemas/src/commands/ListSchemaVersionsCommand.ts diff --git a/clients/client-schemas/commands/ListSchemasCommand.ts b/clients/client-schemas/src/commands/ListSchemasCommand.ts similarity index 100% rename from clients/client-schemas/commands/ListSchemasCommand.ts rename to clients/client-schemas/src/commands/ListSchemasCommand.ts diff --git a/clients/client-schemas/commands/ListTagsForResourceCommand.ts b/clients/client-schemas/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-schemas/commands/ListTagsForResourceCommand.ts rename to clients/client-schemas/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-schemas/commands/PutCodeBindingCommand.ts b/clients/client-schemas/src/commands/PutCodeBindingCommand.ts similarity index 100% rename from clients/client-schemas/commands/PutCodeBindingCommand.ts rename to clients/client-schemas/src/commands/PutCodeBindingCommand.ts diff --git a/clients/client-schemas/commands/PutResourcePolicyCommand.ts b/clients/client-schemas/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-schemas/commands/PutResourcePolicyCommand.ts rename to clients/client-schemas/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-schemas/commands/SearchSchemasCommand.ts b/clients/client-schemas/src/commands/SearchSchemasCommand.ts similarity index 100% rename from clients/client-schemas/commands/SearchSchemasCommand.ts rename to clients/client-schemas/src/commands/SearchSchemasCommand.ts diff --git a/clients/client-schemas/commands/StartDiscovererCommand.ts b/clients/client-schemas/src/commands/StartDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/StartDiscovererCommand.ts rename to clients/client-schemas/src/commands/StartDiscovererCommand.ts diff --git a/clients/client-schemas/commands/StopDiscovererCommand.ts b/clients/client-schemas/src/commands/StopDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/StopDiscovererCommand.ts rename to clients/client-schemas/src/commands/StopDiscovererCommand.ts diff --git a/clients/client-schemas/commands/TagResourceCommand.ts b/clients/client-schemas/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-schemas/commands/TagResourceCommand.ts rename to clients/client-schemas/src/commands/TagResourceCommand.ts diff --git a/clients/client-schemas/commands/UntagResourceCommand.ts b/clients/client-schemas/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-schemas/commands/UntagResourceCommand.ts rename to clients/client-schemas/src/commands/UntagResourceCommand.ts diff --git a/clients/client-schemas/commands/UpdateDiscovererCommand.ts b/clients/client-schemas/src/commands/UpdateDiscovererCommand.ts similarity index 100% rename from clients/client-schemas/commands/UpdateDiscovererCommand.ts rename to clients/client-schemas/src/commands/UpdateDiscovererCommand.ts diff --git a/clients/client-schemas/commands/UpdateRegistryCommand.ts b/clients/client-schemas/src/commands/UpdateRegistryCommand.ts similarity index 100% rename from clients/client-schemas/commands/UpdateRegistryCommand.ts rename to clients/client-schemas/src/commands/UpdateRegistryCommand.ts diff --git a/clients/client-schemas/commands/UpdateSchemaCommand.ts b/clients/client-schemas/src/commands/UpdateSchemaCommand.ts similarity index 100% rename from clients/client-schemas/commands/UpdateSchemaCommand.ts rename to clients/client-schemas/src/commands/UpdateSchemaCommand.ts diff --git a/clients/client-schemas/endpoints.ts b/clients/client-schemas/src/endpoints.ts similarity index 100% rename from clients/client-schemas/endpoints.ts rename to clients/client-schemas/src/endpoints.ts diff --git a/clients/client-schemas/index.ts b/clients/client-schemas/src/index.ts similarity index 100% rename from clients/client-schemas/index.ts rename to clients/client-schemas/src/index.ts diff --git a/clients/client-schemas/models/index.ts b/clients/client-schemas/src/models/index.ts similarity index 100% rename from clients/client-schemas/models/index.ts rename to clients/client-schemas/src/models/index.ts diff --git a/clients/client-schemas/models/models_0.ts b/clients/client-schemas/src/models/models_0.ts similarity index 100% rename from clients/client-schemas/models/models_0.ts rename to clients/client-schemas/src/models/models_0.ts diff --git a/clients/client-schemas/pagination/Interfaces.ts b/clients/client-schemas/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-schemas/pagination/Interfaces.ts rename to clients/client-schemas/src/pagination/Interfaces.ts diff --git a/clients/client-schemas/pagination/ListDiscoverersPaginator.ts b/clients/client-schemas/src/pagination/ListDiscoverersPaginator.ts similarity index 100% rename from clients/client-schemas/pagination/ListDiscoverersPaginator.ts rename to clients/client-schemas/src/pagination/ListDiscoverersPaginator.ts diff --git a/clients/client-schemas/pagination/ListRegistriesPaginator.ts b/clients/client-schemas/src/pagination/ListRegistriesPaginator.ts similarity index 100% rename from clients/client-schemas/pagination/ListRegistriesPaginator.ts rename to clients/client-schemas/src/pagination/ListRegistriesPaginator.ts diff --git a/clients/client-schemas/pagination/ListSchemaVersionsPaginator.ts b/clients/client-schemas/src/pagination/ListSchemaVersionsPaginator.ts similarity index 100% rename from clients/client-schemas/pagination/ListSchemaVersionsPaginator.ts rename to clients/client-schemas/src/pagination/ListSchemaVersionsPaginator.ts diff --git a/clients/client-schemas/pagination/ListSchemasPaginator.ts b/clients/client-schemas/src/pagination/ListSchemasPaginator.ts similarity index 100% rename from clients/client-schemas/pagination/ListSchemasPaginator.ts rename to clients/client-schemas/src/pagination/ListSchemasPaginator.ts diff --git a/clients/client-schemas/pagination/SearchSchemasPaginator.ts b/clients/client-schemas/src/pagination/SearchSchemasPaginator.ts similarity index 100% rename from clients/client-schemas/pagination/SearchSchemasPaginator.ts rename to clients/client-schemas/src/pagination/SearchSchemasPaginator.ts diff --git a/clients/client-schemas/protocols/Aws_restJson1.ts b/clients/client-schemas/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-schemas/protocols/Aws_restJson1.ts rename to clients/client-schemas/src/protocols/Aws_restJson1.ts diff --git a/clients/client-schemas/src/runtimeConfig.browser.ts b/clients/client-schemas/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..237bf8eff35b --- /dev/null +++ b/clients/client-schemas/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SchemasClientConfig } from "./SchemasClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SchemasClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-schemas/runtimeConfig.native.ts b/clients/client-schemas/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-schemas/runtimeConfig.native.ts rename to clients/client-schemas/src/runtimeConfig.native.ts diff --git a/clients/client-schemas/runtimeConfig.shared.ts b/clients/client-schemas/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-schemas/runtimeConfig.shared.ts rename to clients/client-schemas/src/runtimeConfig.shared.ts diff --git a/clients/client-schemas/src/runtimeConfig.ts b/clients/client-schemas/src/runtimeConfig.ts new file mode 100644 index 000000000000..19022d805fc0 --- /dev/null +++ b/clients/client-schemas/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SchemasClientConfig } from "./SchemasClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SchemasClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-schemas/waiters/waitForCodeBindingExists.ts b/clients/client-schemas/src/waiters/waitForCodeBindingExists.ts similarity index 100% rename from clients/client-schemas/waiters/waitForCodeBindingExists.ts rename to clients/client-schemas/src/waiters/waitForCodeBindingExists.ts diff --git a/clients/client-schemas/tsconfig.es.json b/clients/client-schemas/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-schemas/tsconfig.es.json +++ b/clients/client-schemas/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-schemas/tsconfig.json b/clients/client-schemas/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-schemas/tsconfig.json +++ b/clients/client-schemas/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-schemas/tsconfig.types.json b/clients/client-schemas/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-schemas/tsconfig.types.json +++ b/clients/client-schemas/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-secrets-manager/.gitignore b/clients/client-secrets-manager/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-secrets-manager/.gitignore +++ b/clients/client-secrets-manager/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-secrets-manager/package.json b/clients/client-secrets-manager/package.json index e2c2019a7b89..d66dcc0057f4 100644 --- a/clients/client-secrets-manager/package.json +++ b/clients/client-secrets-manager/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-secrets-manager", "repository": { "type": "git", diff --git a/clients/client-secrets-manager/runtimeConfig.browser.ts b/clients/client-secrets-manager/runtimeConfig.browser.ts deleted file mode 100644 index cb3815c23f54..000000000000 --- a/clients/client-secrets-manager/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SecretsManagerClientConfig } from "./SecretsManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-secrets-manager/runtimeConfig.ts b/clients/client-secrets-manager/runtimeConfig.ts deleted file mode 100644 index 4bac6afb8858..000000000000 --- a/clients/client-secrets-manager/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SecretsManagerClientConfig } from "./SecretsManagerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-secrets-manager/SecretsManager.ts b/clients/client-secrets-manager/src/SecretsManager.ts similarity index 100% rename from clients/client-secrets-manager/SecretsManager.ts rename to clients/client-secrets-manager/src/SecretsManager.ts diff --git a/clients/client-secrets-manager/SecretsManagerClient.ts b/clients/client-secrets-manager/src/SecretsManagerClient.ts similarity index 100% rename from clients/client-secrets-manager/SecretsManagerClient.ts rename to clients/client-secrets-manager/src/SecretsManagerClient.ts diff --git a/clients/client-secrets-manager/commands/CancelRotateSecretCommand.ts b/clients/client-secrets-manager/src/commands/CancelRotateSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/CancelRotateSecretCommand.ts rename to clients/client-secrets-manager/src/commands/CancelRotateSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/CreateSecretCommand.ts b/clients/client-secrets-manager/src/commands/CreateSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/CreateSecretCommand.ts rename to clients/client-secrets-manager/src/commands/CreateSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/DeleteResourcePolicyCommand.ts b/clients/client-secrets-manager/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/DeleteResourcePolicyCommand.ts rename to clients/client-secrets-manager/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-secrets-manager/commands/DeleteSecretCommand.ts b/clients/client-secrets-manager/src/commands/DeleteSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/DeleteSecretCommand.ts rename to clients/client-secrets-manager/src/commands/DeleteSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/DescribeSecretCommand.ts b/clients/client-secrets-manager/src/commands/DescribeSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/DescribeSecretCommand.ts rename to clients/client-secrets-manager/src/commands/DescribeSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/GetRandomPasswordCommand.ts b/clients/client-secrets-manager/src/commands/GetRandomPasswordCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/GetRandomPasswordCommand.ts rename to clients/client-secrets-manager/src/commands/GetRandomPasswordCommand.ts diff --git a/clients/client-secrets-manager/commands/GetResourcePolicyCommand.ts b/clients/client-secrets-manager/src/commands/GetResourcePolicyCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/GetResourcePolicyCommand.ts rename to clients/client-secrets-manager/src/commands/GetResourcePolicyCommand.ts diff --git a/clients/client-secrets-manager/commands/GetSecretValueCommand.ts b/clients/client-secrets-manager/src/commands/GetSecretValueCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/GetSecretValueCommand.ts rename to clients/client-secrets-manager/src/commands/GetSecretValueCommand.ts diff --git a/clients/client-secrets-manager/commands/ListSecretVersionIdsCommand.ts b/clients/client-secrets-manager/src/commands/ListSecretVersionIdsCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/ListSecretVersionIdsCommand.ts rename to clients/client-secrets-manager/src/commands/ListSecretVersionIdsCommand.ts diff --git a/clients/client-secrets-manager/commands/ListSecretsCommand.ts b/clients/client-secrets-manager/src/commands/ListSecretsCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/ListSecretsCommand.ts rename to clients/client-secrets-manager/src/commands/ListSecretsCommand.ts diff --git a/clients/client-secrets-manager/commands/PutResourcePolicyCommand.ts b/clients/client-secrets-manager/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/PutResourcePolicyCommand.ts rename to clients/client-secrets-manager/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-secrets-manager/commands/PutSecretValueCommand.ts b/clients/client-secrets-manager/src/commands/PutSecretValueCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/PutSecretValueCommand.ts rename to clients/client-secrets-manager/src/commands/PutSecretValueCommand.ts diff --git a/clients/client-secrets-manager/commands/RemoveRegionsFromReplicationCommand.ts b/clients/client-secrets-manager/src/commands/RemoveRegionsFromReplicationCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/RemoveRegionsFromReplicationCommand.ts rename to clients/client-secrets-manager/src/commands/RemoveRegionsFromReplicationCommand.ts diff --git a/clients/client-secrets-manager/commands/ReplicateSecretToRegionsCommand.ts b/clients/client-secrets-manager/src/commands/ReplicateSecretToRegionsCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/ReplicateSecretToRegionsCommand.ts rename to clients/client-secrets-manager/src/commands/ReplicateSecretToRegionsCommand.ts diff --git a/clients/client-secrets-manager/commands/RestoreSecretCommand.ts b/clients/client-secrets-manager/src/commands/RestoreSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/RestoreSecretCommand.ts rename to clients/client-secrets-manager/src/commands/RestoreSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/RotateSecretCommand.ts b/clients/client-secrets-manager/src/commands/RotateSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/RotateSecretCommand.ts rename to clients/client-secrets-manager/src/commands/RotateSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/StopReplicationToReplicaCommand.ts b/clients/client-secrets-manager/src/commands/StopReplicationToReplicaCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/StopReplicationToReplicaCommand.ts rename to clients/client-secrets-manager/src/commands/StopReplicationToReplicaCommand.ts diff --git a/clients/client-secrets-manager/commands/TagResourceCommand.ts b/clients/client-secrets-manager/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/TagResourceCommand.ts rename to clients/client-secrets-manager/src/commands/TagResourceCommand.ts diff --git a/clients/client-secrets-manager/commands/UntagResourceCommand.ts b/clients/client-secrets-manager/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/UntagResourceCommand.ts rename to clients/client-secrets-manager/src/commands/UntagResourceCommand.ts diff --git a/clients/client-secrets-manager/commands/UpdateSecretCommand.ts b/clients/client-secrets-manager/src/commands/UpdateSecretCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/UpdateSecretCommand.ts rename to clients/client-secrets-manager/src/commands/UpdateSecretCommand.ts diff --git a/clients/client-secrets-manager/commands/UpdateSecretVersionStageCommand.ts b/clients/client-secrets-manager/src/commands/UpdateSecretVersionStageCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/UpdateSecretVersionStageCommand.ts rename to clients/client-secrets-manager/src/commands/UpdateSecretVersionStageCommand.ts diff --git a/clients/client-secrets-manager/commands/ValidateResourcePolicyCommand.ts b/clients/client-secrets-manager/src/commands/ValidateResourcePolicyCommand.ts similarity index 100% rename from clients/client-secrets-manager/commands/ValidateResourcePolicyCommand.ts rename to clients/client-secrets-manager/src/commands/ValidateResourcePolicyCommand.ts diff --git a/clients/client-secrets-manager/endpoints.ts b/clients/client-secrets-manager/src/endpoints.ts similarity index 100% rename from clients/client-secrets-manager/endpoints.ts rename to clients/client-secrets-manager/src/endpoints.ts diff --git a/clients/client-secrets-manager/index.ts b/clients/client-secrets-manager/src/index.ts similarity index 100% rename from clients/client-secrets-manager/index.ts rename to clients/client-secrets-manager/src/index.ts diff --git a/clients/client-secrets-manager/models/index.ts b/clients/client-secrets-manager/src/models/index.ts similarity index 100% rename from clients/client-secrets-manager/models/index.ts rename to clients/client-secrets-manager/src/models/index.ts diff --git a/clients/client-secrets-manager/models/models_0.ts b/clients/client-secrets-manager/src/models/models_0.ts similarity index 100% rename from clients/client-secrets-manager/models/models_0.ts rename to clients/client-secrets-manager/src/models/models_0.ts diff --git a/clients/client-secrets-manager/pagination/Interfaces.ts b/clients/client-secrets-manager/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-secrets-manager/pagination/Interfaces.ts rename to clients/client-secrets-manager/src/pagination/Interfaces.ts diff --git a/clients/client-secrets-manager/pagination/ListSecretVersionIdsPaginator.ts b/clients/client-secrets-manager/src/pagination/ListSecretVersionIdsPaginator.ts similarity index 100% rename from clients/client-secrets-manager/pagination/ListSecretVersionIdsPaginator.ts rename to clients/client-secrets-manager/src/pagination/ListSecretVersionIdsPaginator.ts diff --git a/clients/client-secrets-manager/pagination/ListSecretsPaginator.ts b/clients/client-secrets-manager/src/pagination/ListSecretsPaginator.ts similarity index 100% rename from clients/client-secrets-manager/pagination/ListSecretsPaginator.ts rename to clients/client-secrets-manager/src/pagination/ListSecretsPaginator.ts diff --git a/clients/client-secrets-manager/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-secrets-manager/protocols/Aws_json1_1.ts rename to clients/client-secrets-manager/src/protocols/Aws_json1_1.ts diff --git a/clients/client-secrets-manager/src/runtimeConfig.browser.ts b/clients/client-secrets-manager/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..fd82b080a872 --- /dev/null +++ b/clients/client-secrets-manager/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SecretsManagerClientConfig } from "./SecretsManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-secrets-manager/runtimeConfig.native.ts b/clients/client-secrets-manager/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-secrets-manager/runtimeConfig.native.ts rename to clients/client-secrets-manager/src/runtimeConfig.native.ts diff --git a/clients/client-secrets-manager/runtimeConfig.shared.ts b/clients/client-secrets-manager/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-secrets-manager/runtimeConfig.shared.ts rename to clients/client-secrets-manager/src/runtimeConfig.shared.ts diff --git a/clients/client-secrets-manager/src/runtimeConfig.ts b/clients/client-secrets-manager/src/runtimeConfig.ts new file mode 100644 index 000000000000..8c9dbf3e8f18 --- /dev/null +++ b/clients/client-secrets-manager/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SecretsManagerClientConfig } from "./SecretsManagerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-secrets-manager/tsconfig.es.json b/clients/client-secrets-manager/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-secrets-manager/tsconfig.es.json +++ b/clients/client-secrets-manager/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-secrets-manager/tsconfig.json b/clients/client-secrets-manager/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-secrets-manager/tsconfig.json +++ b/clients/client-secrets-manager/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-secrets-manager/tsconfig.types.json b/clients/client-secrets-manager/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-secrets-manager/tsconfig.types.json +++ b/clients/client-secrets-manager/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-securityhub/.gitignore b/clients/client-securityhub/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-securityhub/.gitignore +++ b/clients/client-securityhub/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-securityhub/package.json b/clients/client-securityhub/package.json index b83261809989..b107c987d496 100644 --- a/clients/client-securityhub/package.json +++ b/clients/client-securityhub/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-securityhub", "repository": { "type": "git", diff --git a/clients/client-securityhub/runtimeConfig.browser.ts b/clients/client-securityhub/runtimeConfig.browser.ts deleted file mode 100644 index e5b4e9120f63..000000000000 --- a/clients/client-securityhub/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SecurityHubClientConfig } from "./SecurityHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SecurityHubClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-securityhub/runtimeConfig.ts b/clients/client-securityhub/runtimeConfig.ts deleted file mode 100644 index 1817f8827980..000000000000 --- a/clients/client-securityhub/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SecurityHubClientConfig } from "./SecurityHubClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SecurityHubClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-securityhub/SecurityHub.ts b/clients/client-securityhub/src/SecurityHub.ts similarity index 100% rename from clients/client-securityhub/SecurityHub.ts rename to clients/client-securityhub/src/SecurityHub.ts diff --git a/clients/client-securityhub/SecurityHubClient.ts b/clients/client-securityhub/src/SecurityHubClient.ts similarity index 100% rename from clients/client-securityhub/SecurityHubClient.ts rename to clients/client-securityhub/src/SecurityHubClient.ts diff --git a/clients/client-securityhub/commands/AcceptAdministratorInvitationCommand.ts b/clients/client-securityhub/src/commands/AcceptAdministratorInvitationCommand.ts similarity index 100% rename from clients/client-securityhub/commands/AcceptAdministratorInvitationCommand.ts rename to clients/client-securityhub/src/commands/AcceptAdministratorInvitationCommand.ts diff --git a/clients/client-securityhub/commands/AcceptInvitationCommand.ts b/clients/client-securityhub/src/commands/AcceptInvitationCommand.ts similarity index 100% rename from clients/client-securityhub/commands/AcceptInvitationCommand.ts rename to clients/client-securityhub/src/commands/AcceptInvitationCommand.ts diff --git a/clients/client-securityhub/commands/BatchDisableStandardsCommand.ts b/clients/client-securityhub/src/commands/BatchDisableStandardsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/BatchDisableStandardsCommand.ts rename to clients/client-securityhub/src/commands/BatchDisableStandardsCommand.ts diff --git a/clients/client-securityhub/commands/BatchEnableStandardsCommand.ts b/clients/client-securityhub/src/commands/BatchEnableStandardsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/BatchEnableStandardsCommand.ts rename to clients/client-securityhub/src/commands/BatchEnableStandardsCommand.ts diff --git a/clients/client-securityhub/commands/BatchImportFindingsCommand.ts b/clients/client-securityhub/src/commands/BatchImportFindingsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/BatchImportFindingsCommand.ts rename to clients/client-securityhub/src/commands/BatchImportFindingsCommand.ts diff --git a/clients/client-securityhub/commands/BatchUpdateFindingsCommand.ts b/clients/client-securityhub/src/commands/BatchUpdateFindingsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/BatchUpdateFindingsCommand.ts rename to clients/client-securityhub/src/commands/BatchUpdateFindingsCommand.ts diff --git a/clients/client-securityhub/commands/CreateActionTargetCommand.ts b/clients/client-securityhub/src/commands/CreateActionTargetCommand.ts similarity index 100% rename from clients/client-securityhub/commands/CreateActionTargetCommand.ts rename to clients/client-securityhub/src/commands/CreateActionTargetCommand.ts diff --git a/clients/client-securityhub/commands/CreateInsightCommand.ts b/clients/client-securityhub/src/commands/CreateInsightCommand.ts similarity index 100% rename from clients/client-securityhub/commands/CreateInsightCommand.ts rename to clients/client-securityhub/src/commands/CreateInsightCommand.ts diff --git a/clients/client-securityhub/commands/CreateMembersCommand.ts b/clients/client-securityhub/src/commands/CreateMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/CreateMembersCommand.ts rename to clients/client-securityhub/src/commands/CreateMembersCommand.ts diff --git a/clients/client-securityhub/commands/DeclineInvitationsCommand.ts b/clients/client-securityhub/src/commands/DeclineInvitationsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DeclineInvitationsCommand.ts rename to clients/client-securityhub/src/commands/DeclineInvitationsCommand.ts diff --git a/clients/client-securityhub/commands/DeleteActionTargetCommand.ts b/clients/client-securityhub/src/commands/DeleteActionTargetCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DeleteActionTargetCommand.ts rename to clients/client-securityhub/src/commands/DeleteActionTargetCommand.ts diff --git a/clients/client-securityhub/commands/DeleteInsightCommand.ts b/clients/client-securityhub/src/commands/DeleteInsightCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DeleteInsightCommand.ts rename to clients/client-securityhub/src/commands/DeleteInsightCommand.ts diff --git a/clients/client-securityhub/commands/DeleteInvitationsCommand.ts b/clients/client-securityhub/src/commands/DeleteInvitationsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DeleteInvitationsCommand.ts rename to clients/client-securityhub/src/commands/DeleteInvitationsCommand.ts diff --git a/clients/client-securityhub/commands/DeleteMembersCommand.ts b/clients/client-securityhub/src/commands/DeleteMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DeleteMembersCommand.ts rename to clients/client-securityhub/src/commands/DeleteMembersCommand.ts diff --git a/clients/client-securityhub/commands/DescribeActionTargetsCommand.ts b/clients/client-securityhub/src/commands/DescribeActionTargetsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeActionTargetsCommand.ts rename to clients/client-securityhub/src/commands/DescribeActionTargetsCommand.ts diff --git a/clients/client-securityhub/commands/DescribeHubCommand.ts b/clients/client-securityhub/src/commands/DescribeHubCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeHubCommand.ts rename to clients/client-securityhub/src/commands/DescribeHubCommand.ts diff --git a/clients/client-securityhub/commands/DescribeOrganizationConfigurationCommand.ts b/clients/client-securityhub/src/commands/DescribeOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeOrganizationConfigurationCommand.ts rename to clients/client-securityhub/src/commands/DescribeOrganizationConfigurationCommand.ts diff --git a/clients/client-securityhub/commands/DescribeProductsCommand.ts b/clients/client-securityhub/src/commands/DescribeProductsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeProductsCommand.ts rename to clients/client-securityhub/src/commands/DescribeProductsCommand.ts diff --git a/clients/client-securityhub/commands/DescribeStandardsCommand.ts b/clients/client-securityhub/src/commands/DescribeStandardsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeStandardsCommand.ts rename to clients/client-securityhub/src/commands/DescribeStandardsCommand.ts diff --git a/clients/client-securityhub/commands/DescribeStandardsControlsCommand.ts b/clients/client-securityhub/src/commands/DescribeStandardsControlsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DescribeStandardsControlsCommand.ts rename to clients/client-securityhub/src/commands/DescribeStandardsControlsCommand.ts diff --git a/clients/client-securityhub/commands/DisableImportFindingsForProductCommand.ts b/clients/client-securityhub/src/commands/DisableImportFindingsForProductCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisableImportFindingsForProductCommand.ts rename to clients/client-securityhub/src/commands/DisableImportFindingsForProductCommand.ts diff --git a/clients/client-securityhub/commands/DisableOrganizationAdminAccountCommand.ts b/clients/client-securityhub/src/commands/DisableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisableOrganizationAdminAccountCommand.ts rename to clients/client-securityhub/src/commands/DisableOrganizationAdminAccountCommand.ts diff --git a/clients/client-securityhub/commands/DisableSecurityHubCommand.ts b/clients/client-securityhub/src/commands/DisableSecurityHubCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisableSecurityHubCommand.ts rename to clients/client-securityhub/src/commands/DisableSecurityHubCommand.ts diff --git a/clients/client-securityhub/commands/DisassociateFromAdministratorAccountCommand.ts b/clients/client-securityhub/src/commands/DisassociateFromAdministratorAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisassociateFromAdministratorAccountCommand.ts rename to clients/client-securityhub/src/commands/DisassociateFromAdministratorAccountCommand.ts diff --git a/clients/client-securityhub/commands/DisassociateFromMasterAccountCommand.ts b/clients/client-securityhub/src/commands/DisassociateFromMasterAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisassociateFromMasterAccountCommand.ts rename to clients/client-securityhub/src/commands/DisassociateFromMasterAccountCommand.ts diff --git a/clients/client-securityhub/commands/DisassociateMembersCommand.ts b/clients/client-securityhub/src/commands/DisassociateMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/DisassociateMembersCommand.ts rename to clients/client-securityhub/src/commands/DisassociateMembersCommand.ts diff --git a/clients/client-securityhub/commands/EnableImportFindingsForProductCommand.ts b/clients/client-securityhub/src/commands/EnableImportFindingsForProductCommand.ts similarity index 100% rename from clients/client-securityhub/commands/EnableImportFindingsForProductCommand.ts rename to clients/client-securityhub/src/commands/EnableImportFindingsForProductCommand.ts diff --git a/clients/client-securityhub/commands/EnableOrganizationAdminAccountCommand.ts b/clients/client-securityhub/src/commands/EnableOrganizationAdminAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/EnableOrganizationAdminAccountCommand.ts rename to clients/client-securityhub/src/commands/EnableOrganizationAdminAccountCommand.ts diff --git a/clients/client-securityhub/commands/EnableSecurityHubCommand.ts b/clients/client-securityhub/src/commands/EnableSecurityHubCommand.ts similarity index 100% rename from clients/client-securityhub/commands/EnableSecurityHubCommand.ts rename to clients/client-securityhub/src/commands/EnableSecurityHubCommand.ts diff --git a/clients/client-securityhub/commands/GetAdministratorAccountCommand.ts b/clients/client-securityhub/src/commands/GetAdministratorAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetAdministratorAccountCommand.ts rename to clients/client-securityhub/src/commands/GetAdministratorAccountCommand.ts diff --git a/clients/client-securityhub/commands/GetEnabledStandardsCommand.ts b/clients/client-securityhub/src/commands/GetEnabledStandardsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetEnabledStandardsCommand.ts rename to clients/client-securityhub/src/commands/GetEnabledStandardsCommand.ts diff --git a/clients/client-securityhub/commands/GetFindingsCommand.ts b/clients/client-securityhub/src/commands/GetFindingsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetFindingsCommand.ts rename to clients/client-securityhub/src/commands/GetFindingsCommand.ts diff --git a/clients/client-securityhub/commands/GetInsightResultsCommand.ts b/clients/client-securityhub/src/commands/GetInsightResultsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetInsightResultsCommand.ts rename to clients/client-securityhub/src/commands/GetInsightResultsCommand.ts diff --git a/clients/client-securityhub/commands/GetInsightsCommand.ts b/clients/client-securityhub/src/commands/GetInsightsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetInsightsCommand.ts rename to clients/client-securityhub/src/commands/GetInsightsCommand.ts diff --git a/clients/client-securityhub/commands/GetInvitationsCountCommand.ts b/clients/client-securityhub/src/commands/GetInvitationsCountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetInvitationsCountCommand.ts rename to clients/client-securityhub/src/commands/GetInvitationsCountCommand.ts diff --git a/clients/client-securityhub/commands/GetMasterAccountCommand.ts b/clients/client-securityhub/src/commands/GetMasterAccountCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetMasterAccountCommand.ts rename to clients/client-securityhub/src/commands/GetMasterAccountCommand.ts diff --git a/clients/client-securityhub/commands/GetMembersCommand.ts b/clients/client-securityhub/src/commands/GetMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/GetMembersCommand.ts rename to clients/client-securityhub/src/commands/GetMembersCommand.ts diff --git a/clients/client-securityhub/commands/InviteMembersCommand.ts b/clients/client-securityhub/src/commands/InviteMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/InviteMembersCommand.ts rename to clients/client-securityhub/src/commands/InviteMembersCommand.ts diff --git a/clients/client-securityhub/commands/ListEnabledProductsForImportCommand.ts b/clients/client-securityhub/src/commands/ListEnabledProductsForImportCommand.ts similarity index 100% rename from clients/client-securityhub/commands/ListEnabledProductsForImportCommand.ts rename to clients/client-securityhub/src/commands/ListEnabledProductsForImportCommand.ts diff --git a/clients/client-securityhub/commands/ListInvitationsCommand.ts b/clients/client-securityhub/src/commands/ListInvitationsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/ListInvitationsCommand.ts rename to clients/client-securityhub/src/commands/ListInvitationsCommand.ts diff --git a/clients/client-securityhub/commands/ListMembersCommand.ts b/clients/client-securityhub/src/commands/ListMembersCommand.ts similarity index 100% rename from clients/client-securityhub/commands/ListMembersCommand.ts rename to clients/client-securityhub/src/commands/ListMembersCommand.ts diff --git a/clients/client-securityhub/commands/ListOrganizationAdminAccountsCommand.ts b/clients/client-securityhub/src/commands/ListOrganizationAdminAccountsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/ListOrganizationAdminAccountsCommand.ts rename to clients/client-securityhub/src/commands/ListOrganizationAdminAccountsCommand.ts diff --git a/clients/client-securityhub/commands/ListTagsForResourceCommand.ts b/clients/client-securityhub/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-securityhub/commands/ListTagsForResourceCommand.ts rename to clients/client-securityhub/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-securityhub/commands/TagResourceCommand.ts b/clients/client-securityhub/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-securityhub/commands/TagResourceCommand.ts rename to clients/client-securityhub/src/commands/TagResourceCommand.ts diff --git a/clients/client-securityhub/commands/UntagResourceCommand.ts b/clients/client-securityhub/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UntagResourceCommand.ts rename to clients/client-securityhub/src/commands/UntagResourceCommand.ts diff --git a/clients/client-securityhub/commands/UpdateActionTargetCommand.ts b/clients/client-securityhub/src/commands/UpdateActionTargetCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateActionTargetCommand.ts rename to clients/client-securityhub/src/commands/UpdateActionTargetCommand.ts diff --git a/clients/client-securityhub/commands/UpdateFindingsCommand.ts b/clients/client-securityhub/src/commands/UpdateFindingsCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateFindingsCommand.ts rename to clients/client-securityhub/src/commands/UpdateFindingsCommand.ts diff --git a/clients/client-securityhub/commands/UpdateInsightCommand.ts b/clients/client-securityhub/src/commands/UpdateInsightCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateInsightCommand.ts rename to clients/client-securityhub/src/commands/UpdateInsightCommand.ts diff --git a/clients/client-securityhub/commands/UpdateOrganizationConfigurationCommand.ts b/clients/client-securityhub/src/commands/UpdateOrganizationConfigurationCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateOrganizationConfigurationCommand.ts rename to clients/client-securityhub/src/commands/UpdateOrganizationConfigurationCommand.ts diff --git a/clients/client-securityhub/commands/UpdateSecurityHubConfigurationCommand.ts b/clients/client-securityhub/src/commands/UpdateSecurityHubConfigurationCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateSecurityHubConfigurationCommand.ts rename to clients/client-securityhub/src/commands/UpdateSecurityHubConfigurationCommand.ts diff --git a/clients/client-securityhub/commands/UpdateStandardsControlCommand.ts b/clients/client-securityhub/src/commands/UpdateStandardsControlCommand.ts similarity index 100% rename from clients/client-securityhub/commands/UpdateStandardsControlCommand.ts rename to clients/client-securityhub/src/commands/UpdateStandardsControlCommand.ts diff --git a/clients/client-securityhub/endpoints.ts b/clients/client-securityhub/src/endpoints.ts similarity index 100% rename from clients/client-securityhub/endpoints.ts rename to clients/client-securityhub/src/endpoints.ts diff --git a/clients/client-securityhub/index.ts b/clients/client-securityhub/src/index.ts similarity index 100% rename from clients/client-securityhub/index.ts rename to clients/client-securityhub/src/index.ts diff --git a/clients/client-securityhub/models/index.ts b/clients/client-securityhub/src/models/index.ts similarity index 100% rename from clients/client-securityhub/models/index.ts rename to clients/client-securityhub/src/models/index.ts diff --git a/clients/client-securityhub/models/models_0.ts b/clients/client-securityhub/src/models/models_0.ts similarity index 100% rename from clients/client-securityhub/models/models_0.ts rename to clients/client-securityhub/src/models/models_0.ts diff --git a/clients/client-securityhub/models/models_1.ts b/clients/client-securityhub/src/models/models_1.ts similarity index 100% rename from clients/client-securityhub/models/models_1.ts rename to clients/client-securityhub/src/models/models_1.ts diff --git a/clients/client-securityhub/pagination/DescribeActionTargetsPaginator.ts b/clients/client-securityhub/src/pagination/DescribeActionTargetsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/DescribeActionTargetsPaginator.ts rename to clients/client-securityhub/src/pagination/DescribeActionTargetsPaginator.ts diff --git a/clients/client-securityhub/pagination/DescribeProductsPaginator.ts b/clients/client-securityhub/src/pagination/DescribeProductsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/DescribeProductsPaginator.ts rename to clients/client-securityhub/src/pagination/DescribeProductsPaginator.ts diff --git a/clients/client-securityhub/pagination/DescribeStandardsControlsPaginator.ts b/clients/client-securityhub/src/pagination/DescribeStandardsControlsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/DescribeStandardsControlsPaginator.ts rename to clients/client-securityhub/src/pagination/DescribeStandardsControlsPaginator.ts diff --git a/clients/client-securityhub/pagination/DescribeStandardsPaginator.ts b/clients/client-securityhub/src/pagination/DescribeStandardsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/DescribeStandardsPaginator.ts rename to clients/client-securityhub/src/pagination/DescribeStandardsPaginator.ts diff --git a/clients/client-securityhub/pagination/GetEnabledStandardsPaginator.ts b/clients/client-securityhub/src/pagination/GetEnabledStandardsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/GetEnabledStandardsPaginator.ts rename to clients/client-securityhub/src/pagination/GetEnabledStandardsPaginator.ts diff --git a/clients/client-securityhub/pagination/GetFindingsPaginator.ts b/clients/client-securityhub/src/pagination/GetFindingsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/GetFindingsPaginator.ts rename to clients/client-securityhub/src/pagination/GetFindingsPaginator.ts diff --git a/clients/client-securityhub/pagination/GetInsightsPaginator.ts b/clients/client-securityhub/src/pagination/GetInsightsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/GetInsightsPaginator.ts rename to clients/client-securityhub/src/pagination/GetInsightsPaginator.ts diff --git a/clients/client-securityhub/pagination/Interfaces.ts b/clients/client-securityhub/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-securityhub/pagination/Interfaces.ts rename to clients/client-securityhub/src/pagination/Interfaces.ts diff --git a/clients/client-securityhub/pagination/ListEnabledProductsForImportPaginator.ts b/clients/client-securityhub/src/pagination/ListEnabledProductsForImportPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/ListEnabledProductsForImportPaginator.ts rename to clients/client-securityhub/src/pagination/ListEnabledProductsForImportPaginator.ts diff --git a/clients/client-securityhub/pagination/ListInvitationsPaginator.ts b/clients/client-securityhub/src/pagination/ListInvitationsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/ListInvitationsPaginator.ts rename to clients/client-securityhub/src/pagination/ListInvitationsPaginator.ts diff --git a/clients/client-securityhub/pagination/ListMembersPaginator.ts b/clients/client-securityhub/src/pagination/ListMembersPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/ListMembersPaginator.ts rename to clients/client-securityhub/src/pagination/ListMembersPaginator.ts diff --git a/clients/client-securityhub/pagination/ListOrganizationAdminAccountsPaginator.ts b/clients/client-securityhub/src/pagination/ListOrganizationAdminAccountsPaginator.ts similarity index 100% rename from clients/client-securityhub/pagination/ListOrganizationAdminAccountsPaginator.ts rename to clients/client-securityhub/src/pagination/ListOrganizationAdminAccountsPaginator.ts diff --git a/clients/client-securityhub/protocols/Aws_restJson1.ts b/clients/client-securityhub/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-securityhub/protocols/Aws_restJson1.ts rename to clients/client-securityhub/src/protocols/Aws_restJson1.ts diff --git a/clients/client-securityhub/src/runtimeConfig.browser.ts b/clients/client-securityhub/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..34053da7a6ca --- /dev/null +++ b/clients/client-securityhub/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SecurityHubClientConfig } from "./SecurityHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SecurityHubClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-securityhub/runtimeConfig.native.ts b/clients/client-securityhub/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-securityhub/runtimeConfig.native.ts rename to clients/client-securityhub/src/runtimeConfig.native.ts diff --git a/clients/client-securityhub/runtimeConfig.shared.ts b/clients/client-securityhub/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-securityhub/runtimeConfig.shared.ts rename to clients/client-securityhub/src/runtimeConfig.shared.ts diff --git a/clients/client-securityhub/src/runtimeConfig.ts b/clients/client-securityhub/src/runtimeConfig.ts new file mode 100644 index 000000000000..1153b1618a98 --- /dev/null +++ b/clients/client-securityhub/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SecurityHubClientConfig } from "./SecurityHubClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SecurityHubClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-securityhub/tsconfig.es.json b/clients/client-securityhub/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-securityhub/tsconfig.es.json +++ b/clients/client-securityhub/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-securityhub/tsconfig.json b/clients/client-securityhub/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-securityhub/tsconfig.json +++ b/clients/client-securityhub/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-securityhub/tsconfig.types.json b/clients/client-securityhub/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-securityhub/tsconfig.types.json +++ b/clients/client-securityhub/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-serverlessapplicationrepository/.gitignore b/clients/client-serverlessapplicationrepository/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-serverlessapplicationrepository/.gitignore +++ b/clients/client-serverlessapplicationrepository/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-serverlessapplicationrepository/package.json b/clients/client-serverlessapplicationrepository/package.json index e91735746502..79169ed5243d 100644 --- a/clients/client-serverlessapplicationrepository/package.json +++ b/clients/client-serverlessapplicationrepository/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-serverlessapplicationrepository", "repository": { "type": "git", diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts deleted file mode 100644 index 012ee5c9483d..000000000000 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ServerlessApplicationRepositoryClientConfig } from "./ServerlessApplicationRepositoryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/runtimeConfig.ts deleted file mode 100644 index 9d5fac25a366..000000000000 --- a/clients/client-serverlessapplicationrepository/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ServerlessApplicationRepositoryClientConfig } from "./ServerlessApplicationRepositoryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepository.ts b/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepository.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/ServerlessApplicationRepository.ts rename to clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepository.ts diff --git a/clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts b/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/ServerlessApplicationRepositoryClient.ts rename to clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts diff --git a/clients/client-serverlessapplicationrepository/commands/CreateApplicationCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/CreateApplicationCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/CreateApplicationVersionCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/CreateApplicationVersionCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/CreateApplicationVersionCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/CreateApplicationVersionCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/CreateCloudFormationChangeSetCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/CreateCloudFormationChangeSetCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/CreateCloudFormationChangeSetCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/CreateCloudFormationChangeSetCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/CreateCloudFormationTemplateCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/CreateCloudFormationTemplateCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/CreateCloudFormationTemplateCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/CreateCloudFormationTemplateCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/DeleteApplicationCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/DeleteApplicationCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/GetApplicationCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/GetApplicationCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/GetApplicationCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/GetApplicationCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/GetApplicationPolicyCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/GetApplicationPolicyCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/GetApplicationPolicyCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/GetApplicationPolicyCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/GetCloudFormationTemplateCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/GetCloudFormationTemplateCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/GetCloudFormationTemplateCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/GetCloudFormationTemplateCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/ListApplicationDependenciesCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/ListApplicationDependenciesCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/ListApplicationDependenciesCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/ListApplicationDependenciesCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/ListApplicationVersionsCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/ListApplicationVersionsCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/ListApplicationVersionsCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/ListApplicationVersionsCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/ListApplicationsCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/ListApplicationsCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/PutApplicationPolicyCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/PutApplicationPolicyCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/PutApplicationPolicyCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/PutApplicationPolicyCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/UnshareApplicationCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/UnshareApplicationCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/UnshareApplicationCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/UnshareApplicationCommand.ts diff --git a/clients/client-serverlessapplicationrepository/commands/UpdateApplicationCommand.ts b/clients/client-serverlessapplicationrepository/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/commands/UpdateApplicationCommand.ts rename to clients/client-serverlessapplicationrepository/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-serverlessapplicationrepository/endpoints.ts b/clients/client-serverlessapplicationrepository/src/endpoints.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/endpoints.ts rename to clients/client-serverlessapplicationrepository/src/endpoints.ts diff --git a/clients/client-serverlessapplicationrepository/index.ts b/clients/client-serverlessapplicationrepository/src/index.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/index.ts rename to clients/client-serverlessapplicationrepository/src/index.ts diff --git a/clients/client-serverlessapplicationrepository/models/index.ts b/clients/client-serverlessapplicationrepository/src/models/index.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/models/index.ts rename to clients/client-serverlessapplicationrepository/src/models/index.ts diff --git a/clients/client-serverlessapplicationrepository/models/models_0.ts b/clients/client-serverlessapplicationrepository/src/models/models_0.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/models/models_0.ts rename to clients/client-serverlessapplicationrepository/src/models/models_0.ts diff --git a/clients/client-serverlessapplicationrepository/pagination/Interfaces.ts b/clients/client-serverlessapplicationrepository/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/pagination/Interfaces.ts rename to clients/client-serverlessapplicationrepository/src/pagination/Interfaces.ts diff --git a/clients/client-serverlessapplicationrepository/pagination/ListApplicationDependenciesPaginator.ts b/clients/client-serverlessapplicationrepository/src/pagination/ListApplicationDependenciesPaginator.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/pagination/ListApplicationDependenciesPaginator.ts rename to clients/client-serverlessapplicationrepository/src/pagination/ListApplicationDependenciesPaginator.ts diff --git a/clients/client-serverlessapplicationrepository/pagination/ListApplicationVersionsPaginator.ts b/clients/client-serverlessapplicationrepository/src/pagination/ListApplicationVersionsPaginator.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/pagination/ListApplicationVersionsPaginator.ts rename to clients/client-serverlessapplicationrepository/src/pagination/ListApplicationVersionsPaginator.ts diff --git a/clients/client-serverlessapplicationrepository/pagination/ListApplicationsPaginator.ts b/clients/client-serverlessapplicationrepository/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/pagination/ListApplicationsPaginator.ts rename to clients/client-serverlessapplicationrepository/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/protocols/Aws_restJson1.ts rename to clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts diff --git a/clients/client-serverlessapplicationrepository/src/runtimeConfig.browser.ts b/clients/client-serverlessapplicationrepository/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f52043b14372 --- /dev/null +++ b/clients/client-serverlessapplicationrepository/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ServerlessApplicationRepositoryClientConfig } from "./ServerlessApplicationRepositoryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.native.ts b/clients/client-serverlessapplicationrepository/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/runtimeConfig.native.ts rename to clients/client-serverlessapplicationrepository/src/runtimeConfig.native.ts diff --git a/clients/client-serverlessapplicationrepository/runtimeConfig.shared.ts b/clients/client-serverlessapplicationrepository/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-serverlessapplicationrepository/runtimeConfig.shared.ts rename to clients/client-serverlessapplicationrepository/src/runtimeConfig.shared.ts diff --git a/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts new file mode 100644 index 000000000000..c41658a43c81 --- /dev/null +++ b/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ServerlessApplicationRepositoryClientConfig } from "./ServerlessApplicationRepositoryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-serverlessapplicationrepository/tsconfig.es.json b/clients/client-serverlessapplicationrepository/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-serverlessapplicationrepository/tsconfig.es.json +++ b/clients/client-serverlessapplicationrepository/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-serverlessapplicationrepository/tsconfig.json b/clients/client-serverlessapplicationrepository/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-serverlessapplicationrepository/tsconfig.json +++ b/clients/client-serverlessapplicationrepository/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-serverlessapplicationrepository/tsconfig.types.json b/clients/client-serverlessapplicationrepository/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-serverlessapplicationrepository/tsconfig.types.json +++ b/clients/client-serverlessapplicationrepository/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-service-catalog-appregistry/.gitignore b/clients/client-service-catalog-appregistry/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-service-catalog-appregistry/.gitignore +++ b/clients/client-service-catalog-appregistry/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-service-catalog-appregistry/package.json b/clients/client-service-catalog-appregistry/package.json index 852875d3be96..f79ec500e7ca 100644 --- a/clients/client-service-catalog-appregistry/package.json +++ b/clients/client-service-catalog-appregistry/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-service-catalog-appregistry", "repository": { "type": "git", diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts b/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts deleted file mode 100644 index 77954e83a707..000000000000 --- a/clients/client-service-catalog-appregistry/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ServiceCatalogAppRegistryClientConfig } from "./ServiceCatalogAppRegistryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.ts b/clients/client-service-catalog-appregistry/runtimeConfig.ts deleted file mode 100644 index 336d2376376d..000000000000 --- a/clients/client-service-catalog-appregistry/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ServiceCatalogAppRegistryClientConfig } from "./ServiceCatalogAppRegistryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistry.ts b/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistry.ts similarity index 100% rename from clients/client-service-catalog-appregistry/ServiceCatalogAppRegistry.ts rename to clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistry.ts diff --git a/clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts b/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts similarity index 100% rename from clients/client-service-catalog-appregistry/ServiceCatalogAppRegistryClient.ts rename to clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts diff --git a/clients/client-service-catalog-appregistry/commands/AssociateAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/AssociateAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/AssociateAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/AssociateAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/AssociateResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/AssociateResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/AssociateResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/AssociateResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/CreateApplicationCommand.ts b/clients/client-service-catalog-appregistry/src/commands/CreateApplicationCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/CreateApplicationCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/CreateApplicationCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/CreateAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/CreateAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/CreateAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/CreateAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/DeleteApplicationCommand.ts b/clients/client-service-catalog-appregistry/src/commands/DeleteApplicationCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/DeleteApplicationCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/DeleteApplicationCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/DeleteAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/DeleteAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/DeleteAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/DeleteAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/DisassociateAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/DisassociateAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/DisassociateAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/DisassociateAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/DisassociateResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/DisassociateResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/DisassociateResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/DisassociateResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/GetApplicationCommand.ts b/clients/client-service-catalog-appregistry/src/commands/GetApplicationCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/GetApplicationCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/GetApplicationCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/GetAssociatedResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/GetAssociatedResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/GetAssociatedResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/GetAssociatedResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/GetAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/GetAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/GetAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/GetAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/ListApplicationsCommand.ts b/clients/client-service-catalog-appregistry/src/commands/ListApplicationsCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/ListApplicationsCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/ListApplicationsCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/ListAssociatedAttributeGroupsCommand.ts b/clients/client-service-catalog-appregistry/src/commands/ListAssociatedAttributeGroupsCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/ListAssociatedAttributeGroupsCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/ListAssociatedAttributeGroupsCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/ListAssociatedResourcesCommand.ts b/clients/client-service-catalog-appregistry/src/commands/ListAssociatedResourcesCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/ListAssociatedResourcesCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/ListAssociatedResourcesCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/ListAttributeGroupsCommand.ts b/clients/client-service-catalog-appregistry/src/commands/ListAttributeGroupsCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/ListAttributeGroupsCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/ListAttributeGroupsCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/ListTagsForResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/ListTagsForResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/SyncResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/SyncResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/SyncResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/SyncResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/TagResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/TagResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/TagResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/UntagResourceCommand.ts b/clients/client-service-catalog-appregistry/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/UntagResourceCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/UntagResourceCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/UpdateApplicationCommand.ts b/clients/client-service-catalog-appregistry/src/commands/UpdateApplicationCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/UpdateApplicationCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/UpdateApplicationCommand.ts diff --git a/clients/client-service-catalog-appregistry/commands/UpdateAttributeGroupCommand.ts b/clients/client-service-catalog-appregistry/src/commands/UpdateAttributeGroupCommand.ts similarity index 100% rename from clients/client-service-catalog-appregistry/commands/UpdateAttributeGroupCommand.ts rename to clients/client-service-catalog-appregistry/src/commands/UpdateAttributeGroupCommand.ts diff --git a/clients/client-service-catalog-appregistry/endpoints.ts b/clients/client-service-catalog-appregistry/src/endpoints.ts similarity index 100% rename from clients/client-service-catalog-appregistry/endpoints.ts rename to clients/client-service-catalog-appregistry/src/endpoints.ts diff --git a/clients/client-service-catalog-appregistry/index.ts b/clients/client-service-catalog-appregistry/src/index.ts similarity index 100% rename from clients/client-service-catalog-appregistry/index.ts rename to clients/client-service-catalog-appregistry/src/index.ts diff --git a/clients/client-service-catalog-appregistry/models/index.ts b/clients/client-service-catalog-appregistry/src/models/index.ts similarity index 100% rename from clients/client-service-catalog-appregistry/models/index.ts rename to clients/client-service-catalog-appregistry/src/models/index.ts diff --git a/clients/client-service-catalog-appregistry/models/models_0.ts b/clients/client-service-catalog-appregistry/src/models/models_0.ts similarity index 100% rename from clients/client-service-catalog-appregistry/models/models_0.ts rename to clients/client-service-catalog-appregistry/src/models/models_0.ts diff --git a/clients/client-service-catalog-appregistry/pagination/Interfaces.ts b/clients/client-service-catalog-appregistry/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-service-catalog-appregistry/pagination/Interfaces.ts rename to clients/client-service-catalog-appregistry/src/pagination/Interfaces.ts diff --git a/clients/client-service-catalog-appregistry/pagination/ListApplicationsPaginator.ts b/clients/client-service-catalog-appregistry/src/pagination/ListApplicationsPaginator.ts similarity index 100% rename from clients/client-service-catalog-appregistry/pagination/ListApplicationsPaginator.ts rename to clients/client-service-catalog-appregistry/src/pagination/ListApplicationsPaginator.ts diff --git a/clients/client-service-catalog-appregistry/pagination/ListAssociatedAttributeGroupsPaginator.ts b/clients/client-service-catalog-appregistry/src/pagination/ListAssociatedAttributeGroupsPaginator.ts similarity index 100% rename from clients/client-service-catalog-appregistry/pagination/ListAssociatedAttributeGroupsPaginator.ts rename to clients/client-service-catalog-appregistry/src/pagination/ListAssociatedAttributeGroupsPaginator.ts diff --git a/clients/client-service-catalog-appregistry/pagination/ListAssociatedResourcesPaginator.ts b/clients/client-service-catalog-appregistry/src/pagination/ListAssociatedResourcesPaginator.ts similarity index 100% rename from clients/client-service-catalog-appregistry/pagination/ListAssociatedResourcesPaginator.ts rename to clients/client-service-catalog-appregistry/src/pagination/ListAssociatedResourcesPaginator.ts diff --git a/clients/client-service-catalog-appregistry/pagination/ListAttributeGroupsPaginator.ts b/clients/client-service-catalog-appregistry/src/pagination/ListAttributeGroupsPaginator.ts similarity index 100% rename from clients/client-service-catalog-appregistry/pagination/ListAttributeGroupsPaginator.ts rename to clients/client-service-catalog-appregistry/src/pagination/ListAttributeGroupsPaginator.ts diff --git a/clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-service-catalog-appregistry/protocols/Aws_restJson1.ts rename to clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts diff --git a/clients/client-service-catalog-appregistry/src/runtimeConfig.browser.ts b/clients/client-service-catalog-appregistry/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..96aa202b93e0 --- /dev/null +++ b/clients/client-service-catalog-appregistry/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ServiceCatalogAppRegistryClientConfig } from "./ServiceCatalogAppRegistryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.native.ts b/clients/client-service-catalog-appregistry/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-service-catalog-appregistry/runtimeConfig.native.ts rename to clients/client-service-catalog-appregistry/src/runtimeConfig.native.ts diff --git a/clients/client-service-catalog-appregistry/runtimeConfig.shared.ts b/clients/client-service-catalog-appregistry/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-service-catalog-appregistry/runtimeConfig.shared.ts rename to clients/client-service-catalog-appregistry/src/runtimeConfig.shared.ts diff --git a/clients/client-service-catalog-appregistry/src/runtimeConfig.ts b/clients/client-service-catalog-appregistry/src/runtimeConfig.ts new file mode 100644 index 000000000000..84dc89837b2d --- /dev/null +++ b/clients/client-service-catalog-appregistry/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ServiceCatalogAppRegistryClientConfig } from "./ServiceCatalogAppRegistryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-catalog-appregistry/tsconfig.es.json b/clients/client-service-catalog-appregistry/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-service-catalog-appregistry/tsconfig.es.json +++ b/clients/client-service-catalog-appregistry/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-service-catalog-appregistry/tsconfig.json b/clients/client-service-catalog-appregistry/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-service-catalog-appregistry/tsconfig.json +++ b/clients/client-service-catalog-appregistry/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-service-catalog-appregistry/tsconfig.types.json b/clients/client-service-catalog-appregistry/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-service-catalog-appregistry/tsconfig.types.json +++ b/clients/client-service-catalog-appregistry/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-service-catalog/.gitignore b/clients/client-service-catalog/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-service-catalog/.gitignore +++ b/clients/client-service-catalog/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-service-catalog/package.json b/clients/client-service-catalog/package.json index 292f3267562a..63e3effd9642 100644 --- a/clients/client-service-catalog/package.json +++ b/clients/client-service-catalog/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-service-catalog", "repository": { "type": "git", diff --git a/clients/client-service-catalog/runtimeConfig.browser.ts b/clients/client-service-catalog/runtimeConfig.browser.ts deleted file mode 100644 index 7849eadd1347..000000000000 --- a/clients/client-service-catalog/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ServiceCatalogClientConfig } from "./ServiceCatalogClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-catalog/runtimeConfig.ts b/clients/client-service-catalog/runtimeConfig.ts deleted file mode 100644 index 6d7d0c3af7c8..000000000000 --- a/clients/client-service-catalog/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ServiceCatalogClientConfig } from "./ServiceCatalogClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-catalog/ServiceCatalog.ts b/clients/client-service-catalog/src/ServiceCatalog.ts similarity index 100% rename from clients/client-service-catalog/ServiceCatalog.ts rename to clients/client-service-catalog/src/ServiceCatalog.ts diff --git a/clients/client-service-catalog/ServiceCatalogClient.ts b/clients/client-service-catalog/src/ServiceCatalogClient.ts similarity index 100% rename from clients/client-service-catalog/ServiceCatalogClient.ts rename to clients/client-service-catalog/src/ServiceCatalogClient.ts diff --git a/clients/client-service-catalog/commands/AcceptPortfolioShareCommand.ts b/clients/client-service-catalog/src/commands/AcceptPortfolioShareCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AcceptPortfolioShareCommand.ts rename to clients/client-service-catalog/src/commands/AcceptPortfolioShareCommand.ts diff --git a/clients/client-service-catalog/commands/AssociateBudgetWithResourceCommand.ts b/clients/client-service-catalog/src/commands/AssociateBudgetWithResourceCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AssociateBudgetWithResourceCommand.ts rename to clients/client-service-catalog/src/commands/AssociateBudgetWithResourceCommand.ts diff --git a/clients/client-service-catalog/commands/AssociatePrincipalWithPortfolioCommand.ts b/clients/client-service-catalog/src/commands/AssociatePrincipalWithPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AssociatePrincipalWithPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/AssociatePrincipalWithPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/AssociateProductWithPortfolioCommand.ts b/clients/client-service-catalog/src/commands/AssociateProductWithPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AssociateProductWithPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/AssociateProductWithPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/AssociateServiceActionWithProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/AssociateTagOptionWithResourceCommand.ts b/clients/client-service-catalog/src/commands/AssociateTagOptionWithResourceCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/AssociateTagOptionWithResourceCommand.ts rename to clients/client-service-catalog/src/commands/AssociateTagOptionWithResourceCommand.ts diff --git a/clients/client-service-catalog/commands/BatchAssociateServiceActionWithProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/BatchAssociateServiceActionWithProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/BatchAssociateServiceActionWithProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/BatchAssociateServiceActionWithProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/BatchDisassociateServiceActionFromProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/BatchDisassociateServiceActionFromProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/BatchDisassociateServiceActionFromProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/BatchDisassociateServiceActionFromProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/CopyProductCommand.ts b/clients/client-service-catalog/src/commands/CopyProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CopyProductCommand.ts rename to clients/client-service-catalog/src/commands/CopyProductCommand.ts diff --git a/clients/client-service-catalog/commands/CreateConstraintCommand.ts b/clients/client-service-catalog/src/commands/CreateConstraintCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateConstraintCommand.ts rename to clients/client-service-catalog/src/commands/CreateConstraintCommand.ts diff --git a/clients/client-service-catalog/commands/CreatePortfolioCommand.ts b/clients/client-service-catalog/src/commands/CreatePortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreatePortfolioCommand.ts rename to clients/client-service-catalog/src/commands/CreatePortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/CreatePortfolioShareCommand.ts b/clients/client-service-catalog/src/commands/CreatePortfolioShareCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreatePortfolioShareCommand.ts rename to clients/client-service-catalog/src/commands/CreatePortfolioShareCommand.ts diff --git a/clients/client-service-catalog/commands/CreateProductCommand.ts b/clients/client-service-catalog/src/commands/CreateProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateProductCommand.ts rename to clients/client-service-catalog/src/commands/CreateProductCommand.ts diff --git a/clients/client-service-catalog/commands/CreateProvisionedProductPlanCommand.ts b/clients/client-service-catalog/src/commands/CreateProvisionedProductPlanCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateProvisionedProductPlanCommand.ts rename to clients/client-service-catalog/src/commands/CreateProvisionedProductPlanCommand.ts diff --git a/clients/client-service-catalog/commands/CreateProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/CreateProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/CreateProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/CreateServiceActionCommand.ts b/clients/client-service-catalog/src/commands/CreateServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/CreateServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/CreateTagOptionCommand.ts b/clients/client-service-catalog/src/commands/CreateTagOptionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/CreateTagOptionCommand.ts rename to clients/client-service-catalog/src/commands/CreateTagOptionCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteConstraintCommand.ts b/clients/client-service-catalog/src/commands/DeleteConstraintCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteConstraintCommand.ts rename to clients/client-service-catalog/src/commands/DeleteConstraintCommand.ts diff --git a/clients/client-service-catalog/commands/DeletePortfolioCommand.ts b/clients/client-service-catalog/src/commands/DeletePortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeletePortfolioCommand.ts rename to clients/client-service-catalog/src/commands/DeletePortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/DeletePortfolioShareCommand.ts b/clients/client-service-catalog/src/commands/DeletePortfolioShareCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeletePortfolioShareCommand.ts rename to clients/client-service-catalog/src/commands/DeletePortfolioShareCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteProductCommand.ts b/clients/client-service-catalog/src/commands/DeleteProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteProductCommand.ts rename to clients/client-service-catalog/src/commands/DeleteProductCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteProvisionedProductPlanCommand.ts b/clients/client-service-catalog/src/commands/DeleteProvisionedProductPlanCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteProvisionedProductPlanCommand.ts rename to clients/client-service-catalog/src/commands/DeleteProvisionedProductPlanCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/DeleteProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/DeleteProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteServiceActionCommand.ts b/clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/DeleteServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/DeleteTagOptionCommand.ts b/clients/client-service-catalog/src/commands/DeleteTagOptionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DeleteTagOptionCommand.ts rename to clients/client-service-catalog/src/commands/DeleteTagOptionCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeConstraintCommand.ts b/clients/client-service-catalog/src/commands/DescribeConstraintCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeConstraintCommand.ts rename to clients/client-service-catalog/src/commands/DescribeConstraintCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeCopyProductStatusCommand.ts b/clients/client-service-catalog/src/commands/DescribeCopyProductStatusCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeCopyProductStatusCommand.ts rename to clients/client-service-catalog/src/commands/DescribeCopyProductStatusCommand.ts diff --git a/clients/client-service-catalog/commands/DescribePortfolioCommand.ts b/clients/client-service-catalog/src/commands/DescribePortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribePortfolioCommand.ts rename to clients/client-service-catalog/src/commands/DescribePortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/DescribePortfolioShareStatusCommand.ts b/clients/client-service-catalog/src/commands/DescribePortfolioShareStatusCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribePortfolioShareStatusCommand.ts rename to clients/client-service-catalog/src/commands/DescribePortfolioShareStatusCommand.ts diff --git a/clients/client-service-catalog/commands/DescribePortfolioSharesCommand.ts b/clients/client-service-catalog/src/commands/DescribePortfolioSharesCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribePortfolioSharesCommand.ts rename to clients/client-service-catalog/src/commands/DescribePortfolioSharesCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProductAsAdminCommand.ts b/clients/client-service-catalog/src/commands/DescribeProductAsAdminCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProductAsAdminCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProductAsAdminCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProductCommand.ts b/clients/client-service-catalog/src/commands/DescribeProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProductCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProductCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProductViewCommand.ts b/clients/client-service-catalog/src/commands/DescribeProductViewCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProductViewCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProductViewCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProvisionedProductCommand.ts b/clients/client-service-catalog/src/commands/DescribeProvisionedProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProvisionedProductCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProvisionedProductCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProvisionedProductPlanCommand.ts b/clients/client-service-catalog/src/commands/DescribeProvisionedProductPlanCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProvisionedProductPlanCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProvisionedProductPlanCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/DescribeProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeProvisioningParametersCommand.ts b/clients/client-service-catalog/src/commands/DescribeProvisioningParametersCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeProvisioningParametersCommand.ts rename to clients/client-service-catalog/src/commands/DescribeProvisioningParametersCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeRecordCommand.ts b/clients/client-service-catalog/src/commands/DescribeRecordCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeRecordCommand.ts rename to clients/client-service-catalog/src/commands/DescribeRecordCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeServiceActionCommand.ts b/clients/client-service-catalog/src/commands/DescribeServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/DescribeServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeServiceActionExecutionParametersCommand.ts b/clients/client-service-catalog/src/commands/DescribeServiceActionExecutionParametersCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeServiceActionExecutionParametersCommand.ts rename to clients/client-service-catalog/src/commands/DescribeServiceActionExecutionParametersCommand.ts diff --git a/clients/client-service-catalog/commands/DescribeTagOptionCommand.ts b/clients/client-service-catalog/src/commands/DescribeTagOptionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DescribeTagOptionCommand.ts rename to clients/client-service-catalog/src/commands/DescribeTagOptionCommand.ts diff --git a/clients/client-service-catalog/commands/DisableAWSOrganizationsAccessCommand.ts b/clients/client-service-catalog/src/commands/DisableAWSOrganizationsAccessCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisableAWSOrganizationsAccessCommand.ts rename to clients/client-service-catalog/src/commands/DisableAWSOrganizationsAccessCommand.ts diff --git a/clients/client-service-catalog/commands/DisassociateBudgetFromResourceCommand.ts b/clients/client-service-catalog/src/commands/DisassociateBudgetFromResourceCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisassociateBudgetFromResourceCommand.ts rename to clients/client-service-catalog/src/commands/DisassociateBudgetFromResourceCommand.ts diff --git a/clients/client-service-catalog/commands/DisassociatePrincipalFromPortfolioCommand.ts b/clients/client-service-catalog/src/commands/DisassociatePrincipalFromPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisassociatePrincipalFromPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/DisassociatePrincipalFromPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/DisassociateProductFromPortfolioCommand.ts b/clients/client-service-catalog/src/commands/DisassociateProductFromPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisassociateProductFromPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/DisassociateProductFromPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/DisassociateServiceActionFromProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/DisassociateTagOptionFromResourceCommand.ts b/clients/client-service-catalog/src/commands/DisassociateTagOptionFromResourceCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/DisassociateTagOptionFromResourceCommand.ts rename to clients/client-service-catalog/src/commands/DisassociateTagOptionFromResourceCommand.ts diff --git a/clients/client-service-catalog/commands/EnableAWSOrganizationsAccessCommand.ts b/clients/client-service-catalog/src/commands/EnableAWSOrganizationsAccessCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/EnableAWSOrganizationsAccessCommand.ts rename to clients/client-service-catalog/src/commands/EnableAWSOrganizationsAccessCommand.ts diff --git a/clients/client-service-catalog/commands/ExecuteProvisionedProductPlanCommand.ts b/clients/client-service-catalog/src/commands/ExecuteProvisionedProductPlanCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ExecuteProvisionedProductPlanCommand.ts rename to clients/client-service-catalog/src/commands/ExecuteProvisionedProductPlanCommand.ts diff --git a/clients/client-service-catalog/commands/ExecuteProvisionedProductServiceActionCommand.ts b/clients/client-service-catalog/src/commands/ExecuteProvisionedProductServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ExecuteProvisionedProductServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/ExecuteProvisionedProductServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/GetAWSOrganizationsAccessStatusCommand.ts b/clients/client-service-catalog/src/commands/GetAWSOrganizationsAccessStatusCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/GetAWSOrganizationsAccessStatusCommand.ts rename to clients/client-service-catalog/src/commands/GetAWSOrganizationsAccessStatusCommand.ts diff --git a/clients/client-service-catalog/commands/GetProvisionedProductOutputsCommand.ts b/clients/client-service-catalog/src/commands/GetProvisionedProductOutputsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/GetProvisionedProductOutputsCommand.ts rename to clients/client-service-catalog/src/commands/GetProvisionedProductOutputsCommand.ts diff --git a/clients/client-service-catalog/commands/ImportAsProvisionedProductCommand.ts b/clients/client-service-catalog/src/commands/ImportAsProvisionedProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ImportAsProvisionedProductCommand.ts rename to clients/client-service-catalog/src/commands/ImportAsProvisionedProductCommand.ts diff --git a/clients/client-service-catalog/commands/ListAcceptedPortfolioSharesCommand.ts b/clients/client-service-catalog/src/commands/ListAcceptedPortfolioSharesCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListAcceptedPortfolioSharesCommand.ts rename to clients/client-service-catalog/src/commands/ListAcceptedPortfolioSharesCommand.ts diff --git a/clients/client-service-catalog/commands/ListBudgetsForResourceCommand.ts b/clients/client-service-catalog/src/commands/ListBudgetsForResourceCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListBudgetsForResourceCommand.ts rename to clients/client-service-catalog/src/commands/ListBudgetsForResourceCommand.ts diff --git a/clients/client-service-catalog/commands/ListConstraintsForPortfolioCommand.ts b/clients/client-service-catalog/src/commands/ListConstraintsForPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListConstraintsForPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/ListConstraintsForPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/ListLaunchPathsCommand.ts b/clients/client-service-catalog/src/commands/ListLaunchPathsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListLaunchPathsCommand.ts rename to clients/client-service-catalog/src/commands/ListLaunchPathsCommand.ts diff --git a/clients/client-service-catalog/commands/ListOrganizationPortfolioAccessCommand.ts b/clients/client-service-catalog/src/commands/ListOrganizationPortfolioAccessCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListOrganizationPortfolioAccessCommand.ts rename to clients/client-service-catalog/src/commands/ListOrganizationPortfolioAccessCommand.ts diff --git a/clients/client-service-catalog/commands/ListPortfolioAccessCommand.ts b/clients/client-service-catalog/src/commands/ListPortfolioAccessCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListPortfolioAccessCommand.ts rename to clients/client-service-catalog/src/commands/ListPortfolioAccessCommand.ts diff --git a/clients/client-service-catalog/commands/ListPortfoliosCommand.ts b/clients/client-service-catalog/src/commands/ListPortfoliosCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListPortfoliosCommand.ts rename to clients/client-service-catalog/src/commands/ListPortfoliosCommand.ts diff --git a/clients/client-service-catalog/commands/ListPortfoliosForProductCommand.ts b/clients/client-service-catalog/src/commands/ListPortfoliosForProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListPortfoliosForProductCommand.ts rename to clients/client-service-catalog/src/commands/ListPortfoliosForProductCommand.ts diff --git a/clients/client-service-catalog/commands/ListPrincipalsForPortfolioCommand.ts b/clients/client-service-catalog/src/commands/ListPrincipalsForPortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListPrincipalsForPortfolioCommand.ts rename to clients/client-service-catalog/src/commands/ListPrincipalsForPortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/ListProvisionedProductPlansCommand.ts b/clients/client-service-catalog/src/commands/ListProvisionedProductPlansCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListProvisionedProductPlansCommand.ts rename to clients/client-service-catalog/src/commands/ListProvisionedProductPlansCommand.ts diff --git a/clients/client-service-catalog/commands/ListProvisioningArtifactsCommand.ts b/clients/client-service-catalog/src/commands/ListProvisioningArtifactsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListProvisioningArtifactsCommand.ts rename to clients/client-service-catalog/src/commands/ListProvisioningArtifactsCommand.ts diff --git a/clients/client-service-catalog/commands/ListProvisioningArtifactsForServiceActionCommand.ts b/clients/client-service-catalog/src/commands/ListProvisioningArtifactsForServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListProvisioningArtifactsForServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/ListProvisioningArtifactsForServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/ListRecordHistoryCommand.ts b/clients/client-service-catalog/src/commands/ListRecordHistoryCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListRecordHistoryCommand.ts rename to clients/client-service-catalog/src/commands/ListRecordHistoryCommand.ts diff --git a/clients/client-service-catalog/commands/ListResourcesForTagOptionCommand.ts b/clients/client-service-catalog/src/commands/ListResourcesForTagOptionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListResourcesForTagOptionCommand.ts rename to clients/client-service-catalog/src/commands/ListResourcesForTagOptionCommand.ts diff --git a/clients/client-service-catalog/commands/ListServiceActionsCommand.ts b/clients/client-service-catalog/src/commands/ListServiceActionsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListServiceActionsCommand.ts rename to clients/client-service-catalog/src/commands/ListServiceActionsCommand.ts diff --git a/clients/client-service-catalog/commands/ListServiceActionsForProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/ListServiceActionsForProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListServiceActionsForProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/ListServiceActionsForProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/ListStackInstancesForProvisionedProductCommand.ts b/clients/client-service-catalog/src/commands/ListStackInstancesForProvisionedProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListStackInstancesForProvisionedProductCommand.ts rename to clients/client-service-catalog/src/commands/ListStackInstancesForProvisionedProductCommand.ts diff --git a/clients/client-service-catalog/commands/ListTagOptionsCommand.ts b/clients/client-service-catalog/src/commands/ListTagOptionsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ListTagOptionsCommand.ts rename to clients/client-service-catalog/src/commands/ListTagOptionsCommand.ts diff --git a/clients/client-service-catalog/commands/ProvisionProductCommand.ts b/clients/client-service-catalog/src/commands/ProvisionProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ProvisionProductCommand.ts rename to clients/client-service-catalog/src/commands/ProvisionProductCommand.ts diff --git a/clients/client-service-catalog/commands/RejectPortfolioShareCommand.ts b/clients/client-service-catalog/src/commands/RejectPortfolioShareCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/RejectPortfolioShareCommand.ts rename to clients/client-service-catalog/src/commands/RejectPortfolioShareCommand.ts diff --git a/clients/client-service-catalog/commands/ScanProvisionedProductsCommand.ts b/clients/client-service-catalog/src/commands/ScanProvisionedProductsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/ScanProvisionedProductsCommand.ts rename to clients/client-service-catalog/src/commands/ScanProvisionedProductsCommand.ts diff --git a/clients/client-service-catalog/commands/SearchProductsAsAdminCommand.ts b/clients/client-service-catalog/src/commands/SearchProductsAsAdminCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/SearchProductsAsAdminCommand.ts rename to clients/client-service-catalog/src/commands/SearchProductsAsAdminCommand.ts diff --git a/clients/client-service-catalog/commands/SearchProductsCommand.ts b/clients/client-service-catalog/src/commands/SearchProductsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/SearchProductsCommand.ts rename to clients/client-service-catalog/src/commands/SearchProductsCommand.ts diff --git a/clients/client-service-catalog/commands/SearchProvisionedProductsCommand.ts b/clients/client-service-catalog/src/commands/SearchProvisionedProductsCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/SearchProvisionedProductsCommand.ts rename to clients/client-service-catalog/src/commands/SearchProvisionedProductsCommand.ts diff --git a/clients/client-service-catalog/commands/TerminateProvisionedProductCommand.ts b/clients/client-service-catalog/src/commands/TerminateProvisionedProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/TerminateProvisionedProductCommand.ts rename to clients/client-service-catalog/src/commands/TerminateProvisionedProductCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateConstraintCommand.ts b/clients/client-service-catalog/src/commands/UpdateConstraintCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateConstraintCommand.ts rename to clients/client-service-catalog/src/commands/UpdateConstraintCommand.ts diff --git a/clients/client-service-catalog/commands/UpdatePortfolioCommand.ts b/clients/client-service-catalog/src/commands/UpdatePortfolioCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdatePortfolioCommand.ts rename to clients/client-service-catalog/src/commands/UpdatePortfolioCommand.ts diff --git a/clients/client-service-catalog/commands/UpdatePortfolioShareCommand.ts b/clients/client-service-catalog/src/commands/UpdatePortfolioShareCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdatePortfolioShareCommand.ts rename to clients/client-service-catalog/src/commands/UpdatePortfolioShareCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateProductCommand.ts b/clients/client-service-catalog/src/commands/UpdateProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateProductCommand.ts rename to clients/client-service-catalog/src/commands/UpdateProductCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateProvisionedProductCommand.ts b/clients/client-service-catalog/src/commands/UpdateProvisionedProductCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateProvisionedProductCommand.ts rename to clients/client-service-catalog/src/commands/UpdateProvisionedProductCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateProvisionedProductPropertiesCommand.ts b/clients/client-service-catalog/src/commands/UpdateProvisionedProductPropertiesCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateProvisionedProductPropertiesCommand.ts rename to clients/client-service-catalog/src/commands/UpdateProvisionedProductPropertiesCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateProvisioningArtifactCommand.ts b/clients/client-service-catalog/src/commands/UpdateProvisioningArtifactCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateProvisioningArtifactCommand.ts rename to clients/client-service-catalog/src/commands/UpdateProvisioningArtifactCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateServiceActionCommand.ts b/clients/client-service-catalog/src/commands/UpdateServiceActionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateServiceActionCommand.ts rename to clients/client-service-catalog/src/commands/UpdateServiceActionCommand.ts diff --git a/clients/client-service-catalog/commands/UpdateTagOptionCommand.ts b/clients/client-service-catalog/src/commands/UpdateTagOptionCommand.ts similarity index 100% rename from clients/client-service-catalog/commands/UpdateTagOptionCommand.ts rename to clients/client-service-catalog/src/commands/UpdateTagOptionCommand.ts diff --git a/clients/client-service-catalog/endpoints.ts b/clients/client-service-catalog/src/endpoints.ts similarity index 100% rename from clients/client-service-catalog/endpoints.ts rename to clients/client-service-catalog/src/endpoints.ts diff --git a/clients/client-service-catalog/index.ts b/clients/client-service-catalog/src/index.ts similarity index 100% rename from clients/client-service-catalog/index.ts rename to clients/client-service-catalog/src/index.ts diff --git a/clients/client-service-catalog/models/index.ts b/clients/client-service-catalog/src/models/index.ts similarity index 100% rename from clients/client-service-catalog/models/index.ts rename to clients/client-service-catalog/src/models/index.ts diff --git a/clients/client-service-catalog/models/models_0.ts b/clients/client-service-catalog/src/models/models_0.ts similarity index 100% rename from clients/client-service-catalog/models/models_0.ts rename to clients/client-service-catalog/src/models/models_0.ts diff --git a/clients/client-service-catalog/pagination/DescribePortfolioSharesPaginator.ts b/clients/client-service-catalog/src/pagination/DescribePortfolioSharesPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/DescribePortfolioSharesPaginator.ts rename to clients/client-service-catalog/src/pagination/DescribePortfolioSharesPaginator.ts diff --git a/clients/client-service-catalog/pagination/GetProvisionedProductOutputsPaginator.ts b/clients/client-service-catalog/src/pagination/GetProvisionedProductOutputsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/GetProvisionedProductOutputsPaginator.ts rename to clients/client-service-catalog/src/pagination/GetProvisionedProductOutputsPaginator.ts diff --git a/clients/client-service-catalog/pagination/Interfaces.ts b/clients/client-service-catalog/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-service-catalog/pagination/Interfaces.ts rename to clients/client-service-catalog/src/pagination/Interfaces.ts diff --git a/clients/client-service-catalog/pagination/ListAcceptedPortfolioSharesPaginator.ts b/clients/client-service-catalog/src/pagination/ListAcceptedPortfolioSharesPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListAcceptedPortfolioSharesPaginator.ts rename to clients/client-service-catalog/src/pagination/ListAcceptedPortfolioSharesPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListBudgetsForResourcePaginator.ts b/clients/client-service-catalog/src/pagination/ListBudgetsForResourcePaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListBudgetsForResourcePaginator.ts rename to clients/client-service-catalog/src/pagination/ListBudgetsForResourcePaginator.ts diff --git a/clients/client-service-catalog/pagination/ListConstraintsForPortfolioPaginator.ts b/clients/client-service-catalog/src/pagination/ListConstraintsForPortfolioPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListConstraintsForPortfolioPaginator.ts rename to clients/client-service-catalog/src/pagination/ListConstraintsForPortfolioPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListLaunchPathsPaginator.ts b/clients/client-service-catalog/src/pagination/ListLaunchPathsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListLaunchPathsPaginator.ts rename to clients/client-service-catalog/src/pagination/ListLaunchPathsPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListOrganizationPortfolioAccessPaginator.ts b/clients/client-service-catalog/src/pagination/ListOrganizationPortfolioAccessPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListOrganizationPortfolioAccessPaginator.ts rename to clients/client-service-catalog/src/pagination/ListOrganizationPortfolioAccessPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListPortfolioAccessPaginator.ts b/clients/client-service-catalog/src/pagination/ListPortfolioAccessPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListPortfolioAccessPaginator.ts rename to clients/client-service-catalog/src/pagination/ListPortfolioAccessPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListPortfoliosForProductPaginator.ts b/clients/client-service-catalog/src/pagination/ListPortfoliosForProductPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListPortfoliosForProductPaginator.ts rename to clients/client-service-catalog/src/pagination/ListPortfoliosForProductPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListPortfoliosPaginator.ts b/clients/client-service-catalog/src/pagination/ListPortfoliosPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListPortfoliosPaginator.ts rename to clients/client-service-catalog/src/pagination/ListPortfoliosPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListPrincipalsForPortfolioPaginator.ts b/clients/client-service-catalog/src/pagination/ListPrincipalsForPortfolioPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListPrincipalsForPortfolioPaginator.ts rename to clients/client-service-catalog/src/pagination/ListPrincipalsForPortfolioPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts b/clients/client-service-catalog/src/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts rename to clients/client-service-catalog/src/pagination/ListProvisioningArtifactsForServiceActionPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListResourcesForTagOptionPaginator.ts b/clients/client-service-catalog/src/pagination/ListResourcesForTagOptionPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListResourcesForTagOptionPaginator.ts rename to clients/client-service-catalog/src/pagination/ListResourcesForTagOptionPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts b/clients/client-service-catalog/src/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts rename to clients/client-service-catalog/src/pagination/ListServiceActionsForProvisioningArtifactPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListServiceActionsPaginator.ts b/clients/client-service-catalog/src/pagination/ListServiceActionsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListServiceActionsPaginator.ts rename to clients/client-service-catalog/src/pagination/ListServiceActionsPaginator.ts diff --git a/clients/client-service-catalog/pagination/ListTagOptionsPaginator.ts b/clients/client-service-catalog/src/pagination/ListTagOptionsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/ListTagOptionsPaginator.ts rename to clients/client-service-catalog/src/pagination/ListTagOptionsPaginator.ts diff --git a/clients/client-service-catalog/pagination/SearchProductsAsAdminPaginator.ts b/clients/client-service-catalog/src/pagination/SearchProductsAsAdminPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/SearchProductsAsAdminPaginator.ts rename to clients/client-service-catalog/src/pagination/SearchProductsAsAdminPaginator.ts diff --git a/clients/client-service-catalog/pagination/SearchProductsPaginator.ts b/clients/client-service-catalog/src/pagination/SearchProductsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/SearchProductsPaginator.ts rename to clients/client-service-catalog/src/pagination/SearchProductsPaginator.ts diff --git a/clients/client-service-catalog/pagination/SearchProvisionedProductsPaginator.ts b/clients/client-service-catalog/src/pagination/SearchProvisionedProductsPaginator.ts similarity index 100% rename from clients/client-service-catalog/pagination/SearchProvisionedProductsPaginator.ts rename to clients/client-service-catalog/src/pagination/SearchProvisionedProductsPaginator.ts diff --git a/clients/client-service-catalog/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-service-catalog/protocols/Aws_json1_1.ts rename to clients/client-service-catalog/src/protocols/Aws_json1_1.ts diff --git a/clients/client-service-catalog/src/runtimeConfig.browser.ts b/clients/client-service-catalog/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4d6c439a2b0d --- /dev/null +++ b/clients/client-service-catalog/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ServiceCatalogClientConfig } from "./ServiceCatalogClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-catalog/runtimeConfig.native.ts b/clients/client-service-catalog/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-service-catalog/runtimeConfig.native.ts rename to clients/client-service-catalog/src/runtimeConfig.native.ts diff --git a/clients/client-service-catalog/runtimeConfig.shared.ts b/clients/client-service-catalog/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-service-catalog/runtimeConfig.shared.ts rename to clients/client-service-catalog/src/runtimeConfig.shared.ts diff --git a/clients/client-service-catalog/src/runtimeConfig.ts b/clients/client-service-catalog/src/runtimeConfig.ts new file mode 100644 index 000000000000..e08bc7c763b7 --- /dev/null +++ b/clients/client-service-catalog/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ServiceCatalogClientConfig } from "./ServiceCatalogClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-catalog/tsconfig.es.json b/clients/client-service-catalog/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-service-catalog/tsconfig.es.json +++ b/clients/client-service-catalog/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-service-catalog/tsconfig.json b/clients/client-service-catalog/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-service-catalog/tsconfig.json +++ b/clients/client-service-catalog/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-service-catalog/tsconfig.types.json b/clients/client-service-catalog/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-service-catalog/tsconfig.types.json +++ b/clients/client-service-catalog/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-service-quotas/.gitignore b/clients/client-service-quotas/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-service-quotas/.gitignore +++ b/clients/client-service-quotas/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-service-quotas/package.json b/clients/client-service-quotas/package.json index b8160dfe194b..bbb607c39ed4 100644 --- a/clients/client-service-quotas/package.json +++ b/clients/client-service-quotas/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-service-quotas", "repository": { "type": "git", diff --git a/clients/client-service-quotas/runtimeConfig.browser.ts b/clients/client-service-quotas/runtimeConfig.browser.ts deleted file mode 100644 index 570fca7fbd1d..000000000000 --- a/clients/client-service-quotas/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ServiceQuotasClientConfig } from "./ServiceQuotasClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-quotas/runtimeConfig.ts b/clients/client-service-quotas/runtimeConfig.ts deleted file mode 100644 index 34f63f60b426..000000000000 --- a/clients/client-service-quotas/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ServiceQuotasClientConfig } from "./ServiceQuotasClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-service-quotas/ServiceQuotas.ts b/clients/client-service-quotas/src/ServiceQuotas.ts similarity index 100% rename from clients/client-service-quotas/ServiceQuotas.ts rename to clients/client-service-quotas/src/ServiceQuotas.ts diff --git a/clients/client-service-quotas/ServiceQuotasClient.ts b/clients/client-service-quotas/src/ServiceQuotasClient.ts similarity index 100% rename from clients/client-service-quotas/ServiceQuotasClient.ts rename to clients/client-service-quotas/src/ServiceQuotasClient.ts diff --git a/clients/client-service-quotas/commands/AssociateServiceQuotaTemplateCommand.ts b/clients/client-service-quotas/src/commands/AssociateServiceQuotaTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/AssociateServiceQuotaTemplateCommand.ts rename to clients/client-service-quotas/src/commands/AssociateServiceQuotaTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/DeleteServiceQuotaIncreaseRequestFromTemplateCommand.ts b/clients/client-service-quotas/src/commands/DeleteServiceQuotaIncreaseRequestFromTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/DeleteServiceQuotaIncreaseRequestFromTemplateCommand.ts rename to clients/client-service-quotas/src/commands/DeleteServiceQuotaIncreaseRequestFromTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/DisassociateServiceQuotaTemplateCommand.ts b/clients/client-service-quotas/src/commands/DisassociateServiceQuotaTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/DisassociateServiceQuotaTemplateCommand.ts rename to clients/client-service-quotas/src/commands/DisassociateServiceQuotaTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/GetAWSDefaultServiceQuotaCommand.ts b/clients/client-service-quotas/src/commands/GetAWSDefaultServiceQuotaCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/GetAWSDefaultServiceQuotaCommand.ts rename to clients/client-service-quotas/src/commands/GetAWSDefaultServiceQuotaCommand.ts diff --git a/clients/client-service-quotas/commands/GetAssociationForServiceQuotaTemplateCommand.ts b/clients/client-service-quotas/src/commands/GetAssociationForServiceQuotaTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/GetAssociationForServiceQuotaTemplateCommand.ts rename to clients/client-service-quotas/src/commands/GetAssociationForServiceQuotaTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/GetRequestedServiceQuotaChangeCommand.ts b/clients/client-service-quotas/src/commands/GetRequestedServiceQuotaChangeCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/GetRequestedServiceQuotaChangeCommand.ts rename to clients/client-service-quotas/src/commands/GetRequestedServiceQuotaChangeCommand.ts diff --git a/clients/client-service-quotas/commands/GetServiceQuotaCommand.ts b/clients/client-service-quotas/src/commands/GetServiceQuotaCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/GetServiceQuotaCommand.ts rename to clients/client-service-quotas/src/commands/GetServiceQuotaCommand.ts diff --git a/clients/client-service-quotas/commands/GetServiceQuotaIncreaseRequestFromTemplateCommand.ts b/clients/client-service-quotas/src/commands/GetServiceQuotaIncreaseRequestFromTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/GetServiceQuotaIncreaseRequestFromTemplateCommand.ts rename to clients/client-service-quotas/src/commands/GetServiceQuotaIncreaseRequestFromTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/ListAWSDefaultServiceQuotasCommand.ts b/clients/client-service-quotas/src/commands/ListAWSDefaultServiceQuotasCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListAWSDefaultServiceQuotasCommand.ts rename to clients/client-service-quotas/src/commands/ListAWSDefaultServiceQuotasCommand.ts diff --git a/clients/client-service-quotas/commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand.ts b/clients/client-service-quotas/src/commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand.ts rename to clients/client-service-quotas/src/commands/ListRequestedServiceQuotaChangeHistoryByQuotaCommand.ts diff --git a/clients/client-service-quotas/commands/ListRequestedServiceQuotaChangeHistoryCommand.ts b/clients/client-service-quotas/src/commands/ListRequestedServiceQuotaChangeHistoryCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListRequestedServiceQuotaChangeHistoryCommand.ts rename to clients/client-service-quotas/src/commands/ListRequestedServiceQuotaChangeHistoryCommand.ts diff --git a/clients/client-service-quotas/commands/ListServiceQuotaIncreaseRequestsInTemplateCommand.ts b/clients/client-service-quotas/src/commands/ListServiceQuotaIncreaseRequestsInTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListServiceQuotaIncreaseRequestsInTemplateCommand.ts rename to clients/client-service-quotas/src/commands/ListServiceQuotaIncreaseRequestsInTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/ListServiceQuotasCommand.ts b/clients/client-service-quotas/src/commands/ListServiceQuotasCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListServiceQuotasCommand.ts rename to clients/client-service-quotas/src/commands/ListServiceQuotasCommand.ts diff --git a/clients/client-service-quotas/commands/ListServicesCommand.ts b/clients/client-service-quotas/src/commands/ListServicesCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListServicesCommand.ts rename to clients/client-service-quotas/src/commands/ListServicesCommand.ts diff --git a/clients/client-service-quotas/commands/ListTagsForResourceCommand.ts b/clients/client-service-quotas/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/ListTagsForResourceCommand.ts rename to clients/client-service-quotas/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-service-quotas/commands/PutServiceQuotaIncreaseRequestIntoTemplateCommand.ts b/clients/client-service-quotas/src/commands/PutServiceQuotaIncreaseRequestIntoTemplateCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/PutServiceQuotaIncreaseRequestIntoTemplateCommand.ts rename to clients/client-service-quotas/src/commands/PutServiceQuotaIncreaseRequestIntoTemplateCommand.ts diff --git a/clients/client-service-quotas/commands/RequestServiceQuotaIncreaseCommand.ts b/clients/client-service-quotas/src/commands/RequestServiceQuotaIncreaseCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/RequestServiceQuotaIncreaseCommand.ts rename to clients/client-service-quotas/src/commands/RequestServiceQuotaIncreaseCommand.ts diff --git a/clients/client-service-quotas/commands/TagResourceCommand.ts b/clients/client-service-quotas/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/TagResourceCommand.ts rename to clients/client-service-quotas/src/commands/TagResourceCommand.ts diff --git a/clients/client-service-quotas/commands/UntagResourceCommand.ts b/clients/client-service-quotas/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-service-quotas/commands/UntagResourceCommand.ts rename to clients/client-service-quotas/src/commands/UntagResourceCommand.ts diff --git a/clients/client-service-quotas/endpoints.ts b/clients/client-service-quotas/src/endpoints.ts similarity index 100% rename from clients/client-service-quotas/endpoints.ts rename to clients/client-service-quotas/src/endpoints.ts diff --git a/clients/client-service-quotas/index.ts b/clients/client-service-quotas/src/index.ts similarity index 100% rename from clients/client-service-quotas/index.ts rename to clients/client-service-quotas/src/index.ts diff --git a/clients/client-service-quotas/models/index.ts b/clients/client-service-quotas/src/models/index.ts similarity index 100% rename from clients/client-service-quotas/models/index.ts rename to clients/client-service-quotas/src/models/index.ts diff --git a/clients/client-service-quotas/models/models_0.ts b/clients/client-service-quotas/src/models/models_0.ts similarity index 100% rename from clients/client-service-quotas/models/models_0.ts rename to clients/client-service-quotas/src/models/models_0.ts diff --git a/clients/client-service-quotas/pagination/Interfaces.ts b/clients/client-service-quotas/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-service-quotas/pagination/Interfaces.ts rename to clients/client-service-quotas/src/pagination/Interfaces.ts diff --git a/clients/client-service-quotas/pagination/ListAWSDefaultServiceQuotasPaginator.ts b/clients/client-service-quotas/src/pagination/ListAWSDefaultServiceQuotasPaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListAWSDefaultServiceQuotasPaginator.ts rename to clients/client-service-quotas/src/pagination/ListAWSDefaultServiceQuotasPaginator.ts diff --git a/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts b/clients/client-service-quotas/src/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts rename to clients/client-service-quotas/src/pagination/ListRequestedServiceQuotaChangeHistoryByQuotaPaginator.ts diff --git a/clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts b/clients/client-service-quotas/src/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts rename to clients/client-service-quotas/src/pagination/ListRequestedServiceQuotaChangeHistoryPaginator.ts diff --git a/clients/client-service-quotas/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts b/clients/client-service-quotas/src/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts rename to clients/client-service-quotas/src/pagination/ListServiceQuotaIncreaseRequestsInTemplatePaginator.ts diff --git a/clients/client-service-quotas/pagination/ListServiceQuotasPaginator.ts b/clients/client-service-quotas/src/pagination/ListServiceQuotasPaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListServiceQuotasPaginator.ts rename to clients/client-service-quotas/src/pagination/ListServiceQuotasPaginator.ts diff --git a/clients/client-service-quotas/pagination/ListServicesPaginator.ts b/clients/client-service-quotas/src/pagination/ListServicesPaginator.ts similarity index 100% rename from clients/client-service-quotas/pagination/ListServicesPaginator.ts rename to clients/client-service-quotas/src/pagination/ListServicesPaginator.ts diff --git a/clients/client-service-quotas/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-service-quotas/protocols/Aws_json1_1.ts rename to clients/client-service-quotas/src/protocols/Aws_json1_1.ts diff --git a/clients/client-service-quotas/src/runtimeConfig.browser.ts b/clients/client-service-quotas/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..17f6bed1a0fb --- /dev/null +++ b/clients/client-service-quotas/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ServiceQuotasClientConfig } from "./ServiceQuotasClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-quotas/runtimeConfig.native.ts b/clients/client-service-quotas/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-service-quotas/runtimeConfig.native.ts rename to clients/client-service-quotas/src/runtimeConfig.native.ts diff --git a/clients/client-service-quotas/runtimeConfig.shared.ts b/clients/client-service-quotas/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-service-quotas/runtimeConfig.shared.ts rename to clients/client-service-quotas/src/runtimeConfig.shared.ts diff --git a/clients/client-service-quotas/src/runtimeConfig.ts b/clients/client-service-quotas/src/runtimeConfig.ts new file mode 100644 index 000000000000..b52df4c2fd24 --- /dev/null +++ b/clients/client-service-quotas/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ServiceQuotasClientConfig } from "./ServiceQuotasClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-service-quotas/tsconfig.es.json b/clients/client-service-quotas/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-service-quotas/tsconfig.es.json +++ b/clients/client-service-quotas/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-service-quotas/tsconfig.json b/clients/client-service-quotas/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-service-quotas/tsconfig.json +++ b/clients/client-service-quotas/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-service-quotas/tsconfig.types.json b/clients/client-service-quotas/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-service-quotas/tsconfig.types.json +++ b/clients/client-service-quotas/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-servicediscovery/.gitignore b/clients/client-servicediscovery/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-servicediscovery/.gitignore +++ b/clients/client-servicediscovery/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-servicediscovery/package.json b/clients/client-servicediscovery/package.json index 793e788ca26b..0e6467b0350e 100644 --- a/clients/client-servicediscovery/package.json +++ b/clients/client-servicediscovery/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-servicediscovery", "repository": { "type": "git", diff --git a/clients/client-servicediscovery/runtimeConfig.browser.ts b/clients/client-servicediscovery/runtimeConfig.browser.ts deleted file mode 100644 index c9f7d520fc0f..000000000000 --- a/clients/client-servicediscovery/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ServiceDiscoveryClientConfig } from "./ServiceDiscoveryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-servicediscovery/runtimeConfig.ts b/clients/client-servicediscovery/runtimeConfig.ts deleted file mode 100644 index 88bd907aa6c4..000000000000 --- a/clients/client-servicediscovery/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ServiceDiscoveryClientConfig } from "./ServiceDiscoveryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-servicediscovery/ServiceDiscovery.ts b/clients/client-servicediscovery/src/ServiceDiscovery.ts similarity index 100% rename from clients/client-servicediscovery/ServiceDiscovery.ts rename to clients/client-servicediscovery/src/ServiceDiscovery.ts diff --git a/clients/client-servicediscovery/ServiceDiscoveryClient.ts b/clients/client-servicediscovery/src/ServiceDiscoveryClient.ts similarity index 100% rename from clients/client-servicediscovery/ServiceDiscoveryClient.ts rename to clients/client-servicediscovery/src/ServiceDiscoveryClient.ts diff --git a/clients/client-servicediscovery/commands/CreateHttpNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/CreateHttpNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/CreateHttpNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/CreateHttpNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/CreatePrivateDnsNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/CreatePrivateDnsNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/CreatePrivateDnsNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/CreatePrivateDnsNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/CreatePublicDnsNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/CreatePublicDnsNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/CreatePublicDnsNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/CreatePublicDnsNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/CreateServiceCommand.ts b/clients/client-servicediscovery/src/commands/CreateServiceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/CreateServiceCommand.ts rename to clients/client-servicediscovery/src/commands/CreateServiceCommand.ts diff --git a/clients/client-servicediscovery/commands/DeleteNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/DeleteNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/DeleteNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/DeleteNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/DeleteServiceCommand.ts b/clients/client-servicediscovery/src/commands/DeleteServiceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/DeleteServiceCommand.ts rename to clients/client-servicediscovery/src/commands/DeleteServiceCommand.ts diff --git a/clients/client-servicediscovery/commands/DeregisterInstanceCommand.ts b/clients/client-servicediscovery/src/commands/DeregisterInstanceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/DeregisterInstanceCommand.ts rename to clients/client-servicediscovery/src/commands/DeregisterInstanceCommand.ts diff --git a/clients/client-servicediscovery/commands/DiscoverInstancesCommand.ts b/clients/client-servicediscovery/src/commands/DiscoverInstancesCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/DiscoverInstancesCommand.ts rename to clients/client-servicediscovery/src/commands/DiscoverInstancesCommand.ts diff --git a/clients/client-servicediscovery/commands/GetInstanceCommand.ts b/clients/client-servicediscovery/src/commands/GetInstanceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/GetInstanceCommand.ts rename to clients/client-servicediscovery/src/commands/GetInstanceCommand.ts diff --git a/clients/client-servicediscovery/commands/GetInstancesHealthStatusCommand.ts b/clients/client-servicediscovery/src/commands/GetInstancesHealthStatusCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/GetInstancesHealthStatusCommand.ts rename to clients/client-servicediscovery/src/commands/GetInstancesHealthStatusCommand.ts diff --git a/clients/client-servicediscovery/commands/GetNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/GetNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/GetNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/GetNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/GetOperationCommand.ts b/clients/client-servicediscovery/src/commands/GetOperationCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/GetOperationCommand.ts rename to clients/client-servicediscovery/src/commands/GetOperationCommand.ts diff --git a/clients/client-servicediscovery/commands/GetServiceCommand.ts b/clients/client-servicediscovery/src/commands/GetServiceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/GetServiceCommand.ts rename to clients/client-servicediscovery/src/commands/GetServiceCommand.ts diff --git a/clients/client-servicediscovery/commands/ListInstancesCommand.ts b/clients/client-servicediscovery/src/commands/ListInstancesCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/ListInstancesCommand.ts rename to clients/client-servicediscovery/src/commands/ListInstancesCommand.ts diff --git a/clients/client-servicediscovery/commands/ListNamespacesCommand.ts b/clients/client-servicediscovery/src/commands/ListNamespacesCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/ListNamespacesCommand.ts rename to clients/client-servicediscovery/src/commands/ListNamespacesCommand.ts diff --git a/clients/client-servicediscovery/commands/ListOperationsCommand.ts b/clients/client-servicediscovery/src/commands/ListOperationsCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/ListOperationsCommand.ts rename to clients/client-servicediscovery/src/commands/ListOperationsCommand.ts diff --git a/clients/client-servicediscovery/commands/ListServicesCommand.ts b/clients/client-servicediscovery/src/commands/ListServicesCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/ListServicesCommand.ts rename to clients/client-servicediscovery/src/commands/ListServicesCommand.ts diff --git a/clients/client-servicediscovery/commands/ListTagsForResourceCommand.ts b/clients/client-servicediscovery/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/ListTagsForResourceCommand.ts rename to clients/client-servicediscovery/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-servicediscovery/commands/RegisterInstanceCommand.ts b/clients/client-servicediscovery/src/commands/RegisterInstanceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/RegisterInstanceCommand.ts rename to clients/client-servicediscovery/src/commands/RegisterInstanceCommand.ts diff --git a/clients/client-servicediscovery/commands/TagResourceCommand.ts b/clients/client-servicediscovery/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/TagResourceCommand.ts rename to clients/client-servicediscovery/src/commands/TagResourceCommand.ts diff --git a/clients/client-servicediscovery/commands/UntagResourceCommand.ts b/clients/client-servicediscovery/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UntagResourceCommand.ts rename to clients/client-servicediscovery/src/commands/UntagResourceCommand.ts diff --git a/clients/client-servicediscovery/commands/UpdateHttpNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/UpdateHttpNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UpdateHttpNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/UpdateHttpNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/UpdateInstanceCustomHealthStatusCommand.ts b/clients/client-servicediscovery/src/commands/UpdateInstanceCustomHealthStatusCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UpdateInstanceCustomHealthStatusCommand.ts rename to clients/client-servicediscovery/src/commands/UpdateInstanceCustomHealthStatusCommand.ts diff --git a/clients/client-servicediscovery/commands/UpdatePrivateDnsNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UpdatePrivateDnsNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/UpdatePublicDnsNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/UpdatePublicDnsNamespaceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UpdatePublicDnsNamespaceCommand.ts rename to clients/client-servicediscovery/src/commands/UpdatePublicDnsNamespaceCommand.ts diff --git a/clients/client-servicediscovery/commands/UpdateServiceCommand.ts b/clients/client-servicediscovery/src/commands/UpdateServiceCommand.ts similarity index 100% rename from clients/client-servicediscovery/commands/UpdateServiceCommand.ts rename to clients/client-servicediscovery/src/commands/UpdateServiceCommand.ts diff --git a/clients/client-servicediscovery/endpoints.ts b/clients/client-servicediscovery/src/endpoints.ts similarity index 100% rename from clients/client-servicediscovery/endpoints.ts rename to clients/client-servicediscovery/src/endpoints.ts diff --git a/clients/client-servicediscovery/index.ts b/clients/client-servicediscovery/src/index.ts similarity index 100% rename from clients/client-servicediscovery/index.ts rename to clients/client-servicediscovery/src/index.ts diff --git a/clients/client-servicediscovery/models/index.ts b/clients/client-servicediscovery/src/models/index.ts similarity index 100% rename from clients/client-servicediscovery/models/index.ts rename to clients/client-servicediscovery/src/models/index.ts diff --git a/clients/client-servicediscovery/models/models_0.ts b/clients/client-servicediscovery/src/models/models_0.ts similarity index 100% rename from clients/client-servicediscovery/models/models_0.ts rename to clients/client-servicediscovery/src/models/models_0.ts diff --git a/clients/client-servicediscovery/pagination/GetInstancesHealthStatusPaginator.ts b/clients/client-servicediscovery/src/pagination/GetInstancesHealthStatusPaginator.ts similarity index 100% rename from clients/client-servicediscovery/pagination/GetInstancesHealthStatusPaginator.ts rename to clients/client-servicediscovery/src/pagination/GetInstancesHealthStatusPaginator.ts diff --git a/clients/client-servicediscovery/pagination/Interfaces.ts b/clients/client-servicediscovery/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-servicediscovery/pagination/Interfaces.ts rename to clients/client-servicediscovery/src/pagination/Interfaces.ts diff --git a/clients/client-servicediscovery/pagination/ListInstancesPaginator.ts b/clients/client-servicediscovery/src/pagination/ListInstancesPaginator.ts similarity index 100% rename from clients/client-servicediscovery/pagination/ListInstancesPaginator.ts rename to clients/client-servicediscovery/src/pagination/ListInstancesPaginator.ts diff --git a/clients/client-servicediscovery/pagination/ListNamespacesPaginator.ts b/clients/client-servicediscovery/src/pagination/ListNamespacesPaginator.ts similarity index 100% rename from clients/client-servicediscovery/pagination/ListNamespacesPaginator.ts rename to clients/client-servicediscovery/src/pagination/ListNamespacesPaginator.ts diff --git a/clients/client-servicediscovery/pagination/ListOperationsPaginator.ts b/clients/client-servicediscovery/src/pagination/ListOperationsPaginator.ts similarity index 100% rename from clients/client-servicediscovery/pagination/ListOperationsPaginator.ts rename to clients/client-servicediscovery/src/pagination/ListOperationsPaginator.ts diff --git a/clients/client-servicediscovery/pagination/ListServicesPaginator.ts b/clients/client-servicediscovery/src/pagination/ListServicesPaginator.ts similarity index 100% rename from clients/client-servicediscovery/pagination/ListServicesPaginator.ts rename to clients/client-servicediscovery/src/pagination/ListServicesPaginator.ts diff --git a/clients/client-servicediscovery/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-servicediscovery/protocols/Aws_json1_1.ts rename to clients/client-servicediscovery/src/protocols/Aws_json1_1.ts diff --git a/clients/client-servicediscovery/src/runtimeConfig.browser.ts b/clients/client-servicediscovery/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e5b3b3a047a5 --- /dev/null +++ b/clients/client-servicediscovery/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ServiceDiscoveryClientConfig } from "./ServiceDiscoveryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-servicediscovery/runtimeConfig.native.ts b/clients/client-servicediscovery/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-servicediscovery/runtimeConfig.native.ts rename to clients/client-servicediscovery/src/runtimeConfig.native.ts diff --git a/clients/client-servicediscovery/runtimeConfig.shared.ts b/clients/client-servicediscovery/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-servicediscovery/runtimeConfig.shared.ts rename to clients/client-servicediscovery/src/runtimeConfig.shared.ts diff --git a/clients/client-servicediscovery/src/runtimeConfig.ts b/clients/client-servicediscovery/src/runtimeConfig.ts new file mode 100644 index 000000000000..cd48558ad684 --- /dev/null +++ b/clients/client-servicediscovery/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ServiceDiscoveryClientConfig } from "./ServiceDiscoveryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-servicediscovery/tsconfig.es.json b/clients/client-servicediscovery/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-servicediscovery/tsconfig.es.json +++ b/clients/client-servicediscovery/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-servicediscovery/tsconfig.json b/clients/client-servicediscovery/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-servicediscovery/tsconfig.json +++ b/clients/client-servicediscovery/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-servicediscovery/tsconfig.types.json b/clients/client-servicediscovery/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-servicediscovery/tsconfig.types.json +++ b/clients/client-servicediscovery/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ses/.gitignore b/clients/client-ses/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ses/.gitignore +++ b/clients/client-ses/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ses/package.json b/clients/client-ses/package.json index e05e544ec568..faab11a632e7 100644 --- a/clients/client-ses/package.json +++ b/clients/client-ses/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ses", "repository": { "type": "git", diff --git a/clients/client-ses/runtimeConfig.browser.ts b/clients/client-ses/runtimeConfig.browser.ts deleted file mode 100644 index 07b7fa6ac42d..000000000000 --- a/clients/client-ses/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SESClientConfig } from "./SESClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SESClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ses/runtimeConfig.ts b/clients/client-ses/runtimeConfig.ts deleted file mode 100644 index 2ca92223a87b..000000000000 --- a/clients/client-ses/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SESClientConfig } from "./SESClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SESClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ses/SES.ts b/clients/client-ses/src/SES.ts similarity index 100% rename from clients/client-ses/SES.ts rename to clients/client-ses/src/SES.ts diff --git a/clients/client-ses/SESClient.ts b/clients/client-ses/src/SESClient.ts similarity index 100% rename from clients/client-ses/SESClient.ts rename to clients/client-ses/src/SESClient.ts diff --git a/clients/client-ses/commands/CloneReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/CloneReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/CloneReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/CloneReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/CreateConfigurationSetCommand.ts b/clients/client-ses/src/commands/CreateConfigurationSetCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateConfigurationSetCommand.ts rename to clients/client-ses/src/commands/CreateConfigurationSetCommand.ts diff --git a/clients/client-ses/commands/CreateConfigurationSetEventDestinationCommand.ts b/clients/client-ses/src/commands/CreateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateConfigurationSetEventDestinationCommand.ts rename to clients/client-ses/src/commands/CreateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-ses/commands/CreateConfigurationSetTrackingOptionsCommand.ts b/clients/client-ses/src/commands/CreateConfigurationSetTrackingOptionsCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateConfigurationSetTrackingOptionsCommand.ts rename to clients/client-ses/src/commands/CreateConfigurationSetTrackingOptionsCommand.ts diff --git a/clients/client-ses/commands/CreateCustomVerificationEmailTemplateCommand.ts b/clients/client-ses/src/commands/CreateCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateCustomVerificationEmailTemplateCommand.ts rename to clients/client-ses/src/commands/CreateCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-ses/commands/CreateReceiptFilterCommand.ts b/clients/client-ses/src/commands/CreateReceiptFilterCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateReceiptFilterCommand.ts rename to clients/client-ses/src/commands/CreateReceiptFilterCommand.ts diff --git a/clients/client-ses/commands/CreateReceiptRuleCommand.ts b/clients/client-ses/src/commands/CreateReceiptRuleCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateReceiptRuleCommand.ts rename to clients/client-ses/src/commands/CreateReceiptRuleCommand.ts diff --git a/clients/client-ses/commands/CreateReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/CreateReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/CreateReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/CreateTemplateCommand.ts b/clients/client-ses/src/commands/CreateTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/CreateTemplateCommand.ts rename to clients/client-ses/src/commands/CreateTemplateCommand.ts diff --git a/clients/client-ses/commands/DeleteConfigurationSetCommand.ts b/clients/client-ses/src/commands/DeleteConfigurationSetCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteConfigurationSetCommand.ts rename to clients/client-ses/src/commands/DeleteConfigurationSetCommand.ts diff --git a/clients/client-ses/commands/DeleteConfigurationSetEventDestinationCommand.ts b/clients/client-ses/src/commands/DeleteConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteConfigurationSetEventDestinationCommand.ts rename to clients/client-ses/src/commands/DeleteConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-ses/commands/DeleteConfigurationSetTrackingOptionsCommand.ts b/clients/client-ses/src/commands/DeleteConfigurationSetTrackingOptionsCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteConfigurationSetTrackingOptionsCommand.ts rename to clients/client-ses/src/commands/DeleteConfigurationSetTrackingOptionsCommand.ts diff --git a/clients/client-ses/commands/DeleteCustomVerificationEmailTemplateCommand.ts b/clients/client-ses/src/commands/DeleteCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteCustomVerificationEmailTemplateCommand.ts rename to clients/client-ses/src/commands/DeleteCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-ses/commands/DeleteIdentityCommand.ts b/clients/client-ses/src/commands/DeleteIdentityCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteIdentityCommand.ts rename to clients/client-ses/src/commands/DeleteIdentityCommand.ts diff --git a/clients/client-ses/commands/DeleteIdentityPolicyCommand.ts b/clients/client-ses/src/commands/DeleteIdentityPolicyCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteIdentityPolicyCommand.ts rename to clients/client-ses/src/commands/DeleteIdentityPolicyCommand.ts diff --git a/clients/client-ses/commands/DeleteReceiptFilterCommand.ts b/clients/client-ses/src/commands/DeleteReceiptFilterCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteReceiptFilterCommand.ts rename to clients/client-ses/src/commands/DeleteReceiptFilterCommand.ts diff --git a/clients/client-ses/commands/DeleteReceiptRuleCommand.ts b/clients/client-ses/src/commands/DeleteReceiptRuleCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteReceiptRuleCommand.ts rename to clients/client-ses/src/commands/DeleteReceiptRuleCommand.ts diff --git a/clients/client-ses/commands/DeleteReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/DeleteReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/DeleteReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/DeleteTemplateCommand.ts b/clients/client-ses/src/commands/DeleteTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteTemplateCommand.ts rename to clients/client-ses/src/commands/DeleteTemplateCommand.ts diff --git a/clients/client-ses/commands/DeleteVerifiedEmailAddressCommand.ts b/clients/client-ses/src/commands/DeleteVerifiedEmailAddressCommand.ts similarity index 100% rename from clients/client-ses/commands/DeleteVerifiedEmailAddressCommand.ts rename to clients/client-ses/src/commands/DeleteVerifiedEmailAddressCommand.ts diff --git a/clients/client-ses/commands/DescribeActiveReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/DescribeActiveReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/DescribeActiveReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/DescribeActiveReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/DescribeConfigurationSetCommand.ts b/clients/client-ses/src/commands/DescribeConfigurationSetCommand.ts similarity index 100% rename from clients/client-ses/commands/DescribeConfigurationSetCommand.ts rename to clients/client-ses/src/commands/DescribeConfigurationSetCommand.ts diff --git a/clients/client-ses/commands/DescribeReceiptRuleCommand.ts b/clients/client-ses/src/commands/DescribeReceiptRuleCommand.ts similarity index 100% rename from clients/client-ses/commands/DescribeReceiptRuleCommand.ts rename to clients/client-ses/src/commands/DescribeReceiptRuleCommand.ts diff --git a/clients/client-ses/commands/DescribeReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/DescribeReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/DescribeReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/DescribeReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/GetAccountSendingEnabledCommand.ts b/clients/client-ses/src/commands/GetAccountSendingEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/GetAccountSendingEnabledCommand.ts rename to clients/client-ses/src/commands/GetAccountSendingEnabledCommand.ts diff --git a/clients/client-ses/commands/GetCustomVerificationEmailTemplateCommand.ts b/clients/client-ses/src/commands/GetCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/GetCustomVerificationEmailTemplateCommand.ts rename to clients/client-ses/src/commands/GetCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-ses/commands/GetIdentityDkimAttributesCommand.ts b/clients/client-ses/src/commands/GetIdentityDkimAttributesCommand.ts similarity index 100% rename from clients/client-ses/commands/GetIdentityDkimAttributesCommand.ts rename to clients/client-ses/src/commands/GetIdentityDkimAttributesCommand.ts diff --git a/clients/client-ses/commands/GetIdentityMailFromDomainAttributesCommand.ts b/clients/client-ses/src/commands/GetIdentityMailFromDomainAttributesCommand.ts similarity index 100% rename from clients/client-ses/commands/GetIdentityMailFromDomainAttributesCommand.ts rename to clients/client-ses/src/commands/GetIdentityMailFromDomainAttributesCommand.ts diff --git a/clients/client-ses/commands/GetIdentityNotificationAttributesCommand.ts b/clients/client-ses/src/commands/GetIdentityNotificationAttributesCommand.ts similarity index 100% rename from clients/client-ses/commands/GetIdentityNotificationAttributesCommand.ts rename to clients/client-ses/src/commands/GetIdentityNotificationAttributesCommand.ts diff --git a/clients/client-ses/commands/GetIdentityPoliciesCommand.ts b/clients/client-ses/src/commands/GetIdentityPoliciesCommand.ts similarity index 100% rename from clients/client-ses/commands/GetIdentityPoliciesCommand.ts rename to clients/client-ses/src/commands/GetIdentityPoliciesCommand.ts diff --git a/clients/client-ses/commands/GetIdentityVerificationAttributesCommand.ts b/clients/client-ses/src/commands/GetIdentityVerificationAttributesCommand.ts similarity index 100% rename from clients/client-ses/commands/GetIdentityVerificationAttributesCommand.ts rename to clients/client-ses/src/commands/GetIdentityVerificationAttributesCommand.ts diff --git a/clients/client-ses/commands/GetSendQuotaCommand.ts b/clients/client-ses/src/commands/GetSendQuotaCommand.ts similarity index 100% rename from clients/client-ses/commands/GetSendQuotaCommand.ts rename to clients/client-ses/src/commands/GetSendQuotaCommand.ts diff --git a/clients/client-ses/commands/GetSendStatisticsCommand.ts b/clients/client-ses/src/commands/GetSendStatisticsCommand.ts similarity index 100% rename from clients/client-ses/commands/GetSendStatisticsCommand.ts rename to clients/client-ses/src/commands/GetSendStatisticsCommand.ts diff --git a/clients/client-ses/commands/GetTemplateCommand.ts b/clients/client-ses/src/commands/GetTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/GetTemplateCommand.ts rename to clients/client-ses/src/commands/GetTemplateCommand.ts diff --git a/clients/client-ses/commands/ListConfigurationSetsCommand.ts b/clients/client-ses/src/commands/ListConfigurationSetsCommand.ts similarity index 100% rename from clients/client-ses/commands/ListConfigurationSetsCommand.ts rename to clients/client-ses/src/commands/ListConfigurationSetsCommand.ts diff --git a/clients/client-ses/commands/ListCustomVerificationEmailTemplatesCommand.ts b/clients/client-ses/src/commands/ListCustomVerificationEmailTemplatesCommand.ts similarity index 100% rename from clients/client-ses/commands/ListCustomVerificationEmailTemplatesCommand.ts rename to clients/client-ses/src/commands/ListCustomVerificationEmailTemplatesCommand.ts diff --git a/clients/client-ses/commands/ListIdentitiesCommand.ts b/clients/client-ses/src/commands/ListIdentitiesCommand.ts similarity index 100% rename from clients/client-ses/commands/ListIdentitiesCommand.ts rename to clients/client-ses/src/commands/ListIdentitiesCommand.ts diff --git a/clients/client-ses/commands/ListIdentityPoliciesCommand.ts b/clients/client-ses/src/commands/ListIdentityPoliciesCommand.ts similarity index 100% rename from clients/client-ses/commands/ListIdentityPoliciesCommand.ts rename to clients/client-ses/src/commands/ListIdentityPoliciesCommand.ts diff --git a/clients/client-ses/commands/ListReceiptFiltersCommand.ts b/clients/client-ses/src/commands/ListReceiptFiltersCommand.ts similarity index 100% rename from clients/client-ses/commands/ListReceiptFiltersCommand.ts rename to clients/client-ses/src/commands/ListReceiptFiltersCommand.ts diff --git a/clients/client-ses/commands/ListReceiptRuleSetsCommand.ts b/clients/client-ses/src/commands/ListReceiptRuleSetsCommand.ts similarity index 100% rename from clients/client-ses/commands/ListReceiptRuleSetsCommand.ts rename to clients/client-ses/src/commands/ListReceiptRuleSetsCommand.ts diff --git a/clients/client-ses/commands/ListTemplatesCommand.ts b/clients/client-ses/src/commands/ListTemplatesCommand.ts similarity index 100% rename from clients/client-ses/commands/ListTemplatesCommand.ts rename to clients/client-ses/src/commands/ListTemplatesCommand.ts diff --git a/clients/client-ses/commands/ListVerifiedEmailAddressesCommand.ts b/clients/client-ses/src/commands/ListVerifiedEmailAddressesCommand.ts similarity index 100% rename from clients/client-ses/commands/ListVerifiedEmailAddressesCommand.ts rename to clients/client-ses/src/commands/ListVerifiedEmailAddressesCommand.ts diff --git a/clients/client-ses/commands/PutConfigurationSetDeliveryOptionsCommand.ts b/clients/client-ses/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts similarity index 100% rename from clients/client-ses/commands/PutConfigurationSetDeliveryOptionsCommand.ts rename to clients/client-ses/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts diff --git a/clients/client-ses/commands/PutIdentityPolicyCommand.ts b/clients/client-ses/src/commands/PutIdentityPolicyCommand.ts similarity index 100% rename from clients/client-ses/commands/PutIdentityPolicyCommand.ts rename to clients/client-ses/src/commands/PutIdentityPolicyCommand.ts diff --git a/clients/client-ses/commands/ReorderReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/ReorderReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/ReorderReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/ReorderReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/SendBounceCommand.ts b/clients/client-ses/src/commands/SendBounceCommand.ts similarity index 100% rename from clients/client-ses/commands/SendBounceCommand.ts rename to clients/client-ses/src/commands/SendBounceCommand.ts diff --git a/clients/client-ses/commands/SendBulkTemplatedEmailCommand.ts b/clients/client-ses/src/commands/SendBulkTemplatedEmailCommand.ts similarity index 100% rename from clients/client-ses/commands/SendBulkTemplatedEmailCommand.ts rename to clients/client-ses/src/commands/SendBulkTemplatedEmailCommand.ts diff --git a/clients/client-ses/commands/SendCustomVerificationEmailCommand.ts b/clients/client-ses/src/commands/SendCustomVerificationEmailCommand.ts similarity index 100% rename from clients/client-ses/commands/SendCustomVerificationEmailCommand.ts rename to clients/client-ses/src/commands/SendCustomVerificationEmailCommand.ts diff --git a/clients/client-ses/commands/SendEmailCommand.ts b/clients/client-ses/src/commands/SendEmailCommand.ts similarity index 100% rename from clients/client-ses/commands/SendEmailCommand.ts rename to clients/client-ses/src/commands/SendEmailCommand.ts diff --git a/clients/client-ses/commands/SendRawEmailCommand.ts b/clients/client-ses/src/commands/SendRawEmailCommand.ts similarity index 100% rename from clients/client-ses/commands/SendRawEmailCommand.ts rename to clients/client-ses/src/commands/SendRawEmailCommand.ts diff --git a/clients/client-ses/commands/SendTemplatedEmailCommand.ts b/clients/client-ses/src/commands/SendTemplatedEmailCommand.ts similarity index 100% rename from clients/client-ses/commands/SendTemplatedEmailCommand.ts rename to clients/client-ses/src/commands/SendTemplatedEmailCommand.ts diff --git a/clients/client-ses/commands/SetActiveReceiptRuleSetCommand.ts b/clients/client-ses/src/commands/SetActiveReceiptRuleSetCommand.ts similarity index 100% rename from clients/client-ses/commands/SetActiveReceiptRuleSetCommand.ts rename to clients/client-ses/src/commands/SetActiveReceiptRuleSetCommand.ts diff --git a/clients/client-ses/commands/SetIdentityDkimEnabledCommand.ts b/clients/client-ses/src/commands/SetIdentityDkimEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/SetIdentityDkimEnabledCommand.ts rename to clients/client-ses/src/commands/SetIdentityDkimEnabledCommand.ts diff --git a/clients/client-ses/commands/SetIdentityFeedbackForwardingEnabledCommand.ts b/clients/client-ses/src/commands/SetIdentityFeedbackForwardingEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/SetIdentityFeedbackForwardingEnabledCommand.ts rename to clients/client-ses/src/commands/SetIdentityFeedbackForwardingEnabledCommand.ts diff --git a/clients/client-ses/commands/SetIdentityHeadersInNotificationsEnabledCommand.ts b/clients/client-ses/src/commands/SetIdentityHeadersInNotificationsEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/SetIdentityHeadersInNotificationsEnabledCommand.ts rename to clients/client-ses/src/commands/SetIdentityHeadersInNotificationsEnabledCommand.ts diff --git a/clients/client-ses/commands/SetIdentityMailFromDomainCommand.ts b/clients/client-ses/src/commands/SetIdentityMailFromDomainCommand.ts similarity index 100% rename from clients/client-ses/commands/SetIdentityMailFromDomainCommand.ts rename to clients/client-ses/src/commands/SetIdentityMailFromDomainCommand.ts diff --git a/clients/client-ses/commands/SetIdentityNotificationTopicCommand.ts b/clients/client-ses/src/commands/SetIdentityNotificationTopicCommand.ts similarity index 100% rename from clients/client-ses/commands/SetIdentityNotificationTopicCommand.ts rename to clients/client-ses/src/commands/SetIdentityNotificationTopicCommand.ts diff --git a/clients/client-ses/commands/SetReceiptRulePositionCommand.ts b/clients/client-ses/src/commands/SetReceiptRulePositionCommand.ts similarity index 100% rename from clients/client-ses/commands/SetReceiptRulePositionCommand.ts rename to clients/client-ses/src/commands/SetReceiptRulePositionCommand.ts diff --git a/clients/client-ses/commands/TestRenderTemplateCommand.ts b/clients/client-ses/src/commands/TestRenderTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/TestRenderTemplateCommand.ts rename to clients/client-ses/src/commands/TestRenderTemplateCommand.ts diff --git a/clients/client-ses/commands/UpdateAccountSendingEnabledCommand.ts b/clients/client-ses/src/commands/UpdateAccountSendingEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateAccountSendingEnabledCommand.ts rename to clients/client-ses/src/commands/UpdateAccountSendingEnabledCommand.ts diff --git a/clients/client-ses/commands/UpdateConfigurationSetEventDestinationCommand.ts b/clients/client-ses/src/commands/UpdateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateConfigurationSetEventDestinationCommand.ts rename to clients/client-ses/src/commands/UpdateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-ses/commands/UpdateConfigurationSetReputationMetricsEnabledCommand.ts b/clients/client-ses/src/commands/UpdateConfigurationSetReputationMetricsEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateConfigurationSetReputationMetricsEnabledCommand.ts rename to clients/client-ses/src/commands/UpdateConfigurationSetReputationMetricsEnabledCommand.ts diff --git a/clients/client-ses/commands/UpdateConfigurationSetSendingEnabledCommand.ts b/clients/client-ses/src/commands/UpdateConfigurationSetSendingEnabledCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateConfigurationSetSendingEnabledCommand.ts rename to clients/client-ses/src/commands/UpdateConfigurationSetSendingEnabledCommand.ts diff --git a/clients/client-ses/commands/UpdateConfigurationSetTrackingOptionsCommand.ts b/clients/client-ses/src/commands/UpdateConfigurationSetTrackingOptionsCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateConfigurationSetTrackingOptionsCommand.ts rename to clients/client-ses/src/commands/UpdateConfigurationSetTrackingOptionsCommand.ts diff --git a/clients/client-ses/commands/UpdateCustomVerificationEmailTemplateCommand.ts b/clients/client-ses/src/commands/UpdateCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateCustomVerificationEmailTemplateCommand.ts rename to clients/client-ses/src/commands/UpdateCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-ses/commands/UpdateReceiptRuleCommand.ts b/clients/client-ses/src/commands/UpdateReceiptRuleCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateReceiptRuleCommand.ts rename to clients/client-ses/src/commands/UpdateReceiptRuleCommand.ts diff --git a/clients/client-ses/commands/UpdateTemplateCommand.ts b/clients/client-ses/src/commands/UpdateTemplateCommand.ts similarity index 100% rename from clients/client-ses/commands/UpdateTemplateCommand.ts rename to clients/client-ses/src/commands/UpdateTemplateCommand.ts diff --git a/clients/client-ses/commands/VerifyDomainDkimCommand.ts b/clients/client-ses/src/commands/VerifyDomainDkimCommand.ts similarity index 100% rename from clients/client-ses/commands/VerifyDomainDkimCommand.ts rename to clients/client-ses/src/commands/VerifyDomainDkimCommand.ts diff --git a/clients/client-ses/commands/VerifyDomainIdentityCommand.ts b/clients/client-ses/src/commands/VerifyDomainIdentityCommand.ts similarity index 100% rename from clients/client-ses/commands/VerifyDomainIdentityCommand.ts rename to clients/client-ses/src/commands/VerifyDomainIdentityCommand.ts diff --git a/clients/client-ses/commands/VerifyEmailAddressCommand.ts b/clients/client-ses/src/commands/VerifyEmailAddressCommand.ts similarity index 100% rename from clients/client-ses/commands/VerifyEmailAddressCommand.ts rename to clients/client-ses/src/commands/VerifyEmailAddressCommand.ts diff --git a/clients/client-ses/commands/VerifyEmailIdentityCommand.ts b/clients/client-ses/src/commands/VerifyEmailIdentityCommand.ts similarity index 100% rename from clients/client-ses/commands/VerifyEmailIdentityCommand.ts rename to clients/client-ses/src/commands/VerifyEmailIdentityCommand.ts diff --git a/clients/client-ses/endpoints.ts b/clients/client-ses/src/endpoints.ts similarity index 100% rename from clients/client-ses/endpoints.ts rename to clients/client-ses/src/endpoints.ts diff --git a/clients/client-ses/index.ts b/clients/client-ses/src/index.ts similarity index 100% rename from clients/client-ses/index.ts rename to clients/client-ses/src/index.ts diff --git a/clients/client-ses/models/index.ts b/clients/client-ses/src/models/index.ts similarity index 100% rename from clients/client-ses/models/index.ts rename to clients/client-ses/src/models/index.ts diff --git a/clients/client-ses/models/models_0.ts b/clients/client-ses/src/models/models_0.ts similarity index 100% rename from clients/client-ses/models/models_0.ts rename to clients/client-ses/src/models/models_0.ts diff --git a/clients/client-ses/pagination/Interfaces.ts b/clients/client-ses/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ses/pagination/Interfaces.ts rename to clients/client-ses/src/pagination/Interfaces.ts diff --git a/clients/client-ses/pagination/ListCustomVerificationEmailTemplatesPaginator.ts b/clients/client-ses/src/pagination/ListCustomVerificationEmailTemplatesPaginator.ts similarity index 100% rename from clients/client-ses/pagination/ListCustomVerificationEmailTemplatesPaginator.ts rename to clients/client-ses/src/pagination/ListCustomVerificationEmailTemplatesPaginator.ts diff --git a/clients/client-ses/pagination/ListIdentitiesPaginator.ts b/clients/client-ses/src/pagination/ListIdentitiesPaginator.ts similarity index 100% rename from clients/client-ses/pagination/ListIdentitiesPaginator.ts rename to clients/client-ses/src/pagination/ListIdentitiesPaginator.ts diff --git a/clients/client-ses/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-ses/protocols/Aws_query.ts rename to clients/client-ses/src/protocols/Aws_query.ts diff --git a/clients/client-ses/src/runtimeConfig.browser.ts b/clients/client-ses/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d789e40a3963 --- /dev/null +++ b/clients/client-ses/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SESClientConfig } from "./SESClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SESClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ses/runtimeConfig.native.ts b/clients/client-ses/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ses/runtimeConfig.native.ts rename to clients/client-ses/src/runtimeConfig.native.ts diff --git a/clients/client-ses/runtimeConfig.shared.ts b/clients/client-ses/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ses/runtimeConfig.shared.ts rename to clients/client-ses/src/runtimeConfig.shared.ts diff --git a/clients/client-ses/src/runtimeConfig.ts b/clients/client-ses/src/runtimeConfig.ts new file mode 100644 index 000000000000..8f990a01b4b6 --- /dev/null +++ b/clients/client-ses/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SESClientConfig } from "./SESClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SESClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ses/waiters/waitForIdentityExists.ts b/clients/client-ses/src/waiters/waitForIdentityExists.ts similarity index 100% rename from clients/client-ses/waiters/waitForIdentityExists.ts rename to clients/client-ses/src/waiters/waitForIdentityExists.ts diff --git a/clients/client-ses/tsconfig.es.json b/clients/client-ses/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ses/tsconfig.es.json +++ b/clients/client-ses/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ses/tsconfig.json b/clients/client-ses/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ses/tsconfig.json +++ b/clients/client-ses/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ses/tsconfig.types.json b/clients/client-ses/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ses/tsconfig.types.json +++ b/clients/client-ses/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sesv2/.gitignore b/clients/client-sesv2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sesv2/.gitignore +++ b/clients/client-sesv2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sesv2/package.json b/clients/client-sesv2/package.json index 24ca7a28c590..65f376183b75 100644 --- a/clients/client-sesv2/package.json +++ b/clients/client-sesv2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sesv2", "repository": { "type": "git", diff --git a/clients/client-sesv2/runtimeConfig.browser.ts b/clients/client-sesv2/runtimeConfig.browser.ts deleted file mode 100644 index 5892b00f12c7..000000000000 --- a/clients/client-sesv2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SESv2ClientConfig } from "./SESv2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SESv2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sesv2/runtimeConfig.ts b/clients/client-sesv2/runtimeConfig.ts deleted file mode 100644 index f52b5b31d10f..000000000000 --- a/clients/client-sesv2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SESv2ClientConfig } from "./SESv2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SESv2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sesv2/SESv2.ts b/clients/client-sesv2/src/SESv2.ts similarity index 100% rename from clients/client-sesv2/SESv2.ts rename to clients/client-sesv2/src/SESv2.ts diff --git a/clients/client-sesv2/SESv2Client.ts b/clients/client-sesv2/src/SESv2Client.ts similarity index 100% rename from clients/client-sesv2/SESv2Client.ts rename to clients/client-sesv2/src/SESv2Client.ts diff --git a/clients/client-sesv2/commands/CreateConfigurationSetCommand.ts b/clients/client-sesv2/src/commands/CreateConfigurationSetCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateConfigurationSetCommand.ts rename to clients/client-sesv2/src/commands/CreateConfigurationSetCommand.ts diff --git a/clients/client-sesv2/commands/CreateConfigurationSetEventDestinationCommand.ts b/clients/client-sesv2/src/commands/CreateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateConfigurationSetEventDestinationCommand.ts rename to clients/client-sesv2/src/commands/CreateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-sesv2/commands/CreateContactCommand.ts b/clients/client-sesv2/src/commands/CreateContactCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateContactCommand.ts rename to clients/client-sesv2/src/commands/CreateContactCommand.ts diff --git a/clients/client-sesv2/commands/CreateContactListCommand.ts b/clients/client-sesv2/src/commands/CreateContactListCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateContactListCommand.ts rename to clients/client-sesv2/src/commands/CreateContactListCommand.ts diff --git a/clients/client-sesv2/commands/CreateCustomVerificationEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/CreateCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateCustomVerificationEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/CreateCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/CreateDedicatedIpPoolCommand.ts b/clients/client-sesv2/src/commands/CreateDedicatedIpPoolCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateDedicatedIpPoolCommand.ts rename to clients/client-sesv2/src/commands/CreateDedicatedIpPoolCommand.ts diff --git a/clients/client-sesv2/commands/CreateDeliverabilityTestReportCommand.ts b/clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateDeliverabilityTestReportCommand.ts rename to clients/client-sesv2/src/commands/CreateDeliverabilityTestReportCommand.ts diff --git a/clients/client-sesv2/commands/CreateEmailIdentityCommand.ts b/clients/client-sesv2/src/commands/CreateEmailIdentityCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateEmailIdentityCommand.ts rename to clients/client-sesv2/src/commands/CreateEmailIdentityCommand.ts diff --git a/clients/client-sesv2/commands/CreateEmailIdentityPolicyCommand.ts b/clients/client-sesv2/src/commands/CreateEmailIdentityPolicyCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateEmailIdentityPolicyCommand.ts rename to clients/client-sesv2/src/commands/CreateEmailIdentityPolicyCommand.ts diff --git a/clients/client-sesv2/commands/CreateEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/CreateEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/CreateEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/CreateImportJobCommand.ts b/clients/client-sesv2/src/commands/CreateImportJobCommand.ts similarity index 100% rename from clients/client-sesv2/commands/CreateImportJobCommand.ts rename to clients/client-sesv2/src/commands/CreateImportJobCommand.ts diff --git a/clients/client-sesv2/commands/DeleteConfigurationSetCommand.ts b/clients/client-sesv2/src/commands/DeleteConfigurationSetCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteConfigurationSetCommand.ts rename to clients/client-sesv2/src/commands/DeleteConfigurationSetCommand.ts diff --git a/clients/client-sesv2/commands/DeleteConfigurationSetEventDestinationCommand.ts b/clients/client-sesv2/src/commands/DeleteConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteConfigurationSetEventDestinationCommand.ts rename to clients/client-sesv2/src/commands/DeleteConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-sesv2/commands/DeleteContactCommand.ts b/clients/client-sesv2/src/commands/DeleteContactCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteContactCommand.ts rename to clients/client-sesv2/src/commands/DeleteContactCommand.ts diff --git a/clients/client-sesv2/commands/DeleteContactListCommand.ts b/clients/client-sesv2/src/commands/DeleteContactListCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteContactListCommand.ts rename to clients/client-sesv2/src/commands/DeleteContactListCommand.ts diff --git a/clients/client-sesv2/commands/DeleteCustomVerificationEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/DeleteCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteCustomVerificationEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/DeleteCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/DeleteDedicatedIpPoolCommand.ts b/clients/client-sesv2/src/commands/DeleteDedicatedIpPoolCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteDedicatedIpPoolCommand.ts rename to clients/client-sesv2/src/commands/DeleteDedicatedIpPoolCommand.ts diff --git a/clients/client-sesv2/commands/DeleteEmailIdentityCommand.ts b/clients/client-sesv2/src/commands/DeleteEmailIdentityCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteEmailIdentityCommand.ts rename to clients/client-sesv2/src/commands/DeleteEmailIdentityCommand.ts diff --git a/clients/client-sesv2/commands/DeleteEmailIdentityPolicyCommand.ts b/clients/client-sesv2/src/commands/DeleteEmailIdentityPolicyCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteEmailIdentityPolicyCommand.ts rename to clients/client-sesv2/src/commands/DeleteEmailIdentityPolicyCommand.ts diff --git a/clients/client-sesv2/commands/DeleteEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/DeleteEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/DeleteEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/DeleteSuppressedDestinationCommand.ts b/clients/client-sesv2/src/commands/DeleteSuppressedDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/DeleteSuppressedDestinationCommand.ts rename to clients/client-sesv2/src/commands/DeleteSuppressedDestinationCommand.ts diff --git a/clients/client-sesv2/commands/GetAccountCommand.ts b/clients/client-sesv2/src/commands/GetAccountCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetAccountCommand.ts rename to clients/client-sesv2/src/commands/GetAccountCommand.ts diff --git a/clients/client-sesv2/commands/GetBlacklistReportsCommand.ts b/clients/client-sesv2/src/commands/GetBlacklistReportsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetBlacklistReportsCommand.ts rename to clients/client-sesv2/src/commands/GetBlacklistReportsCommand.ts diff --git a/clients/client-sesv2/commands/GetConfigurationSetCommand.ts b/clients/client-sesv2/src/commands/GetConfigurationSetCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetConfigurationSetCommand.ts rename to clients/client-sesv2/src/commands/GetConfigurationSetCommand.ts diff --git a/clients/client-sesv2/commands/GetConfigurationSetEventDestinationsCommand.ts b/clients/client-sesv2/src/commands/GetConfigurationSetEventDestinationsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetConfigurationSetEventDestinationsCommand.ts rename to clients/client-sesv2/src/commands/GetConfigurationSetEventDestinationsCommand.ts diff --git a/clients/client-sesv2/commands/GetContactCommand.ts b/clients/client-sesv2/src/commands/GetContactCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetContactCommand.ts rename to clients/client-sesv2/src/commands/GetContactCommand.ts diff --git a/clients/client-sesv2/commands/GetContactListCommand.ts b/clients/client-sesv2/src/commands/GetContactListCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetContactListCommand.ts rename to clients/client-sesv2/src/commands/GetContactListCommand.ts diff --git a/clients/client-sesv2/commands/GetCustomVerificationEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/GetCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetCustomVerificationEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/GetCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/GetDedicatedIpCommand.ts b/clients/client-sesv2/src/commands/GetDedicatedIpCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDedicatedIpCommand.ts rename to clients/client-sesv2/src/commands/GetDedicatedIpCommand.ts diff --git a/clients/client-sesv2/commands/GetDedicatedIpsCommand.ts b/clients/client-sesv2/src/commands/GetDedicatedIpsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDedicatedIpsCommand.ts rename to clients/client-sesv2/src/commands/GetDedicatedIpsCommand.ts diff --git a/clients/client-sesv2/commands/GetDeliverabilityDashboardOptionsCommand.ts b/clients/client-sesv2/src/commands/GetDeliverabilityDashboardOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDeliverabilityDashboardOptionsCommand.ts rename to clients/client-sesv2/src/commands/GetDeliverabilityDashboardOptionsCommand.ts diff --git a/clients/client-sesv2/commands/GetDeliverabilityTestReportCommand.ts b/clients/client-sesv2/src/commands/GetDeliverabilityTestReportCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDeliverabilityTestReportCommand.ts rename to clients/client-sesv2/src/commands/GetDeliverabilityTestReportCommand.ts diff --git a/clients/client-sesv2/commands/GetDomainDeliverabilityCampaignCommand.ts b/clients/client-sesv2/src/commands/GetDomainDeliverabilityCampaignCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDomainDeliverabilityCampaignCommand.ts rename to clients/client-sesv2/src/commands/GetDomainDeliverabilityCampaignCommand.ts diff --git a/clients/client-sesv2/commands/GetDomainStatisticsReportCommand.ts b/clients/client-sesv2/src/commands/GetDomainStatisticsReportCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetDomainStatisticsReportCommand.ts rename to clients/client-sesv2/src/commands/GetDomainStatisticsReportCommand.ts diff --git a/clients/client-sesv2/commands/GetEmailIdentityCommand.ts b/clients/client-sesv2/src/commands/GetEmailIdentityCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetEmailIdentityCommand.ts rename to clients/client-sesv2/src/commands/GetEmailIdentityCommand.ts diff --git a/clients/client-sesv2/commands/GetEmailIdentityPoliciesCommand.ts b/clients/client-sesv2/src/commands/GetEmailIdentityPoliciesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetEmailIdentityPoliciesCommand.ts rename to clients/client-sesv2/src/commands/GetEmailIdentityPoliciesCommand.ts diff --git a/clients/client-sesv2/commands/GetEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/GetEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/GetEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/GetImportJobCommand.ts b/clients/client-sesv2/src/commands/GetImportJobCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetImportJobCommand.ts rename to clients/client-sesv2/src/commands/GetImportJobCommand.ts diff --git a/clients/client-sesv2/commands/GetSuppressedDestinationCommand.ts b/clients/client-sesv2/src/commands/GetSuppressedDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/GetSuppressedDestinationCommand.ts rename to clients/client-sesv2/src/commands/GetSuppressedDestinationCommand.ts diff --git a/clients/client-sesv2/commands/ListConfigurationSetsCommand.ts b/clients/client-sesv2/src/commands/ListConfigurationSetsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListConfigurationSetsCommand.ts rename to clients/client-sesv2/src/commands/ListConfigurationSetsCommand.ts diff --git a/clients/client-sesv2/commands/ListContactListsCommand.ts b/clients/client-sesv2/src/commands/ListContactListsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListContactListsCommand.ts rename to clients/client-sesv2/src/commands/ListContactListsCommand.ts diff --git a/clients/client-sesv2/commands/ListContactsCommand.ts b/clients/client-sesv2/src/commands/ListContactsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListContactsCommand.ts rename to clients/client-sesv2/src/commands/ListContactsCommand.ts diff --git a/clients/client-sesv2/commands/ListCustomVerificationEmailTemplatesCommand.ts b/clients/client-sesv2/src/commands/ListCustomVerificationEmailTemplatesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListCustomVerificationEmailTemplatesCommand.ts rename to clients/client-sesv2/src/commands/ListCustomVerificationEmailTemplatesCommand.ts diff --git a/clients/client-sesv2/commands/ListDedicatedIpPoolsCommand.ts b/clients/client-sesv2/src/commands/ListDedicatedIpPoolsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListDedicatedIpPoolsCommand.ts rename to clients/client-sesv2/src/commands/ListDedicatedIpPoolsCommand.ts diff --git a/clients/client-sesv2/commands/ListDeliverabilityTestReportsCommand.ts b/clients/client-sesv2/src/commands/ListDeliverabilityTestReportsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListDeliverabilityTestReportsCommand.ts rename to clients/client-sesv2/src/commands/ListDeliverabilityTestReportsCommand.ts diff --git a/clients/client-sesv2/commands/ListDomainDeliverabilityCampaignsCommand.ts b/clients/client-sesv2/src/commands/ListDomainDeliverabilityCampaignsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListDomainDeliverabilityCampaignsCommand.ts rename to clients/client-sesv2/src/commands/ListDomainDeliverabilityCampaignsCommand.ts diff --git a/clients/client-sesv2/commands/ListEmailIdentitiesCommand.ts b/clients/client-sesv2/src/commands/ListEmailIdentitiesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListEmailIdentitiesCommand.ts rename to clients/client-sesv2/src/commands/ListEmailIdentitiesCommand.ts diff --git a/clients/client-sesv2/commands/ListEmailTemplatesCommand.ts b/clients/client-sesv2/src/commands/ListEmailTemplatesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListEmailTemplatesCommand.ts rename to clients/client-sesv2/src/commands/ListEmailTemplatesCommand.ts diff --git a/clients/client-sesv2/commands/ListImportJobsCommand.ts b/clients/client-sesv2/src/commands/ListImportJobsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListImportJobsCommand.ts rename to clients/client-sesv2/src/commands/ListImportJobsCommand.ts diff --git a/clients/client-sesv2/commands/ListSuppressedDestinationsCommand.ts b/clients/client-sesv2/src/commands/ListSuppressedDestinationsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListSuppressedDestinationsCommand.ts rename to clients/client-sesv2/src/commands/ListSuppressedDestinationsCommand.ts diff --git a/clients/client-sesv2/commands/ListTagsForResourceCommand.ts b/clients/client-sesv2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-sesv2/commands/ListTagsForResourceCommand.ts rename to clients/client-sesv2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-sesv2/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts b/clients/client-sesv2/src/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutAccountDedicatedIpWarmupAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutAccountDetailsCommand.ts b/clients/client-sesv2/src/commands/PutAccountDetailsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutAccountDetailsCommand.ts rename to clients/client-sesv2/src/commands/PutAccountDetailsCommand.ts diff --git a/clients/client-sesv2/commands/PutAccountSendingAttributesCommand.ts b/clients/client-sesv2/src/commands/PutAccountSendingAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutAccountSendingAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutAccountSendingAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutAccountSuppressionAttributesCommand.ts b/clients/client-sesv2/src/commands/PutAccountSuppressionAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutAccountSuppressionAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutAccountSuppressionAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutConfigurationSetDeliveryOptionsCommand.ts b/clients/client-sesv2/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutConfigurationSetDeliveryOptionsCommand.ts rename to clients/client-sesv2/src/commands/PutConfigurationSetDeliveryOptionsCommand.ts diff --git a/clients/client-sesv2/commands/PutConfigurationSetReputationOptionsCommand.ts b/clients/client-sesv2/src/commands/PutConfigurationSetReputationOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutConfigurationSetReputationOptionsCommand.ts rename to clients/client-sesv2/src/commands/PutConfigurationSetReputationOptionsCommand.ts diff --git a/clients/client-sesv2/commands/PutConfigurationSetSendingOptionsCommand.ts b/clients/client-sesv2/src/commands/PutConfigurationSetSendingOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutConfigurationSetSendingOptionsCommand.ts rename to clients/client-sesv2/src/commands/PutConfigurationSetSendingOptionsCommand.ts diff --git a/clients/client-sesv2/commands/PutConfigurationSetSuppressionOptionsCommand.ts b/clients/client-sesv2/src/commands/PutConfigurationSetSuppressionOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutConfigurationSetSuppressionOptionsCommand.ts rename to clients/client-sesv2/src/commands/PutConfigurationSetSuppressionOptionsCommand.ts diff --git a/clients/client-sesv2/commands/PutConfigurationSetTrackingOptionsCommand.ts b/clients/client-sesv2/src/commands/PutConfigurationSetTrackingOptionsCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutConfigurationSetTrackingOptionsCommand.ts rename to clients/client-sesv2/src/commands/PutConfigurationSetTrackingOptionsCommand.ts diff --git a/clients/client-sesv2/commands/PutDedicatedIpInPoolCommand.ts b/clients/client-sesv2/src/commands/PutDedicatedIpInPoolCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutDedicatedIpInPoolCommand.ts rename to clients/client-sesv2/src/commands/PutDedicatedIpInPoolCommand.ts diff --git a/clients/client-sesv2/commands/PutDedicatedIpWarmupAttributesCommand.ts b/clients/client-sesv2/src/commands/PutDedicatedIpWarmupAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutDedicatedIpWarmupAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutDedicatedIpWarmupAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutDeliverabilityDashboardOptionCommand.ts b/clients/client-sesv2/src/commands/PutDeliverabilityDashboardOptionCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutDeliverabilityDashboardOptionCommand.ts rename to clients/client-sesv2/src/commands/PutDeliverabilityDashboardOptionCommand.ts diff --git a/clients/client-sesv2/commands/PutEmailIdentityConfigurationSetAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityConfigurationSetAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutEmailIdentityConfigurationSetAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutEmailIdentityConfigurationSetAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutEmailIdentityDkimAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityDkimAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutEmailIdentityDkimAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutEmailIdentityDkimAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutEmailIdentityDkimSigningAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityDkimSigningAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutEmailIdentityDkimSigningAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutEmailIdentityDkimSigningAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutEmailIdentityFeedbackAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutEmailIdentityFeedbackAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutEmailIdentityFeedbackAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutEmailIdentityMailFromAttributesCommand.ts b/clients/client-sesv2/src/commands/PutEmailIdentityMailFromAttributesCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutEmailIdentityMailFromAttributesCommand.ts rename to clients/client-sesv2/src/commands/PutEmailIdentityMailFromAttributesCommand.ts diff --git a/clients/client-sesv2/commands/PutSuppressedDestinationCommand.ts b/clients/client-sesv2/src/commands/PutSuppressedDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/PutSuppressedDestinationCommand.ts rename to clients/client-sesv2/src/commands/PutSuppressedDestinationCommand.ts diff --git a/clients/client-sesv2/commands/SendBulkEmailCommand.ts b/clients/client-sesv2/src/commands/SendBulkEmailCommand.ts similarity index 100% rename from clients/client-sesv2/commands/SendBulkEmailCommand.ts rename to clients/client-sesv2/src/commands/SendBulkEmailCommand.ts diff --git a/clients/client-sesv2/commands/SendCustomVerificationEmailCommand.ts b/clients/client-sesv2/src/commands/SendCustomVerificationEmailCommand.ts similarity index 100% rename from clients/client-sesv2/commands/SendCustomVerificationEmailCommand.ts rename to clients/client-sesv2/src/commands/SendCustomVerificationEmailCommand.ts diff --git a/clients/client-sesv2/commands/SendEmailCommand.ts b/clients/client-sesv2/src/commands/SendEmailCommand.ts similarity index 100% rename from clients/client-sesv2/commands/SendEmailCommand.ts rename to clients/client-sesv2/src/commands/SendEmailCommand.ts diff --git a/clients/client-sesv2/commands/TagResourceCommand.ts b/clients/client-sesv2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-sesv2/commands/TagResourceCommand.ts rename to clients/client-sesv2/src/commands/TagResourceCommand.ts diff --git a/clients/client-sesv2/commands/TestRenderEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/TestRenderEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/TestRenderEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/TestRenderEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/UntagResourceCommand.ts b/clients/client-sesv2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UntagResourceCommand.ts rename to clients/client-sesv2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-sesv2/commands/UpdateConfigurationSetEventDestinationCommand.ts b/clients/client-sesv2/src/commands/UpdateConfigurationSetEventDestinationCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateConfigurationSetEventDestinationCommand.ts rename to clients/client-sesv2/src/commands/UpdateConfigurationSetEventDestinationCommand.ts diff --git a/clients/client-sesv2/commands/UpdateContactCommand.ts b/clients/client-sesv2/src/commands/UpdateContactCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateContactCommand.ts rename to clients/client-sesv2/src/commands/UpdateContactCommand.ts diff --git a/clients/client-sesv2/commands/UpdateContactListCommand.ts b/clients/client-sesv2/src/commands/UpdateContactListCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateContactListCommand.ts rename to clients/client-sesv2/src/commands/UpdateContactListCommand.ts diff --git a/clients/client-sesv2/commands/UpdateCustomVerificationEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/UpdateCustomVerificationEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateCustomVerificationEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/UpdateCustomVerificationEmailTemplateCommand.ts diff --git a/clients/client-sesv2/commands/UpdateEmailIdentityPolicyCommand.ts b/clients/client-sesv2/src/commands/UpdateEmailIdentityPolicyCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateEmailIdentityPolicyCommand.ts rename to clients/client-sesv2/src/commands/UpdateEmailIdentityPolicyCommand.ts diff --git a/clients/client-sesv2/commands/UpdateEmailTemplateCommand.ts b/clients/client-sesv2/src/commands/UpdateEmailTemplateCommand.ts similarity index 100% rename from clients/client-sesv2/commands/UpdateEmailTemplateCommand.ts rename to clients/client-sesv2/src/commands/UpdateEmailTemplateCommand.ts diff --git a/clients/client-sesv2/endpoints.ts b/clients/client-sesv2/src/endpoints.ts similarity index 100% rename from clients/client-sesv2/endpoints.ts rename to clients/client-sesv2/src/endpoints.ts diff --git a/clients/client-sesv2/index.ts b/clients/client-sesv2/src/index.ts similarity index 100% rename from clients/client-sesv2/index.ts rename to clients/client-sesv2/src/index.ts diff --git a/clients/client-sesv2/models/index.ts b/clients/client-sesv2/src/models/index.ts similarity index 100% rename from clients/client-sesv2/models/index.ts rename to clients/client-sesv2/src/models/index.ts diff --git a/clients/client-sesv2/models/models_0.ts b/clients/client-sesv2/src/models/models_0.ts similarity index 100% rename from clients/client-sesv2/models/models_0.ts rename to clients/client-sesv2/src/models/models_0.ts diff --git a/clients/client-sesv2/pagination/GetDedicatedIpsPaginator.ts b/clients/client-sesv2/src/pagination/GetDedicatedIpsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/GetDedicatedIpsPaginator.ts rename to clients/client-sesv2/src/pagination/GetDedicatedIpsPaginator.ts diff --git a/clients/client-sesv2/pagination/Interfaces.ts b/clients/client-sesv2/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sesv2/pagination/Interfaces.ts rename to clients/client-sesv2/src/pagination/Interfaces.ts diff --git a/clients/client-sesv2/pagination/ListConfigurationSetsPaginator.ts b/clients/client-sesv2/src/pagination/ListConfigurationSetsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListConfigurationSetsPaginator.ts rename to clients/client-sesv2/src/pagination/ListConfigurationSetsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListContactListsPaginator.ts b/clients/client-sesv2/src/pagination/ListContactListsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListContactListsPaginator.ts rename to clients/client-sesv2/src/pagination/ListContactListsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListContactsPaginator.ts b/clients/client-sesv2/src/pagination/ListContactsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListContactsPaginator.ts rename to clients/client-sesv2/src/pagination/ListContactsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListCustomVerificationEmailTemplatesPaginator.ts b/clients/client-sesv2/src/pagination/ListCustomVerificationEmailTemplatesPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListCustomVerificationEmailTemplatesPaginator.ts rename to clients/client-sesv2/src/pagination/ListCustomVerificationEmailTemplatesPaginator.ts diff --git a/clients/client-sesv2/pagination/ListDedicatedIpPoolsPaginator.ts b/clients/client-sesv2/src/pagination/ListDedicatedIpPoolsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListDedicatedIpPoolsPaginator.ts rename to clients/client-sesv2/src/pagination/ListDedicatedIpPoolsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListDeliverabilityTestReportsPaginator.ts b/clients/client-sesv2/src/pagination/ListDeliverabilityTestReportsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListDeliverabilityTestReportsPaginator.ts rename to clients/client-sesv2/src/pagination/ListDeliverabilityTestReportsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListDomainDeliverabilityCampaignsPaginator.ts b/clients/client-sesv2/src/pagination/ListDomainDeliverabilityCampaignsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListDomainDeliverabilityCampaignsPaginator.ts rename to clients/client-sesv2/src/pagination/ListDomainDeliverabilityCampaignsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListEmailIdentitiesPaginator.ts b/clients/client-sesv2/src/pagination/ListEmailIdentitiesPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListEmailIdentitiesPaginator.ts rename to clients/client-sesv2/src/pagination/ListEmailIdentitiesPaginator.ts diff --git a/clients/client-sesv2/pagination/ListEmailTemplatesPaginator.ts b/clients/client-sesv2/src/pagination/ListEmailTemplatesPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListEmailTemplatesPaginator.ts rename to clients/client-sesv2/src/pagination/ListEmailTemplatesPaginator.ts diff --git a/clients/client-sesv2/pagination/ListImportJobsPaginator.ts b/clients/client-sesv2/src/pagination/ListImportJobsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListImportJobsPaginator.ts rename to clients/client-sesv2/src/pagination/ListImportJobsPaginator.ts diff --git a/clients/client-sesv2/pagination/ListSuppressedDestinationsPaginator.ts b/clients/client-sesv2/src/pagination/ListSuppressedDestinationsPaginator.ts similarity index 100% rename from clients/client-sesv2/pagination/ListSuppressedDestinationsPaginator.ts rename to clients/client-sesv2/src/pagination/ListSuppressedDestinationsPaginator.ts diff --git a/clients/client-sesv2/protocols/Aws_restJson1.ts b/clients/client-sesv2/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sesv2/protocols/Aws_restJson1.ts rename to clients/client-sesv2/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sesv2/src/runtimeConfig.browser.ts b/clients/client-sesv2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..cf06932d2c0b --- /dev/null +++ b/clients/client-sesv2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SESv2ClientConfig } from "./SESv2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SESv2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sesv2/runtimeConfig.native.ts b/clients/client-sesv2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sesv2/runtimeConfig.native.ts rename to clients/client-sesv2/src/runtimeConfig.native.ts diff --git a/clients/client-sesv2/runtimeConfig.shared.ts b/clients/client-sesv2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sesv2/runtimeConfig.shared.ts rename to clients/client-sesv2/src/runtimeConfig.shared.ts diff --git a/clients/client-sesv2/src/runtimeConfig.ts b/clients/client-sesv2/src/runtimeConfig.ts new file mode 100644 index 000000000000..88b87e5d9bd8 --- /dev/null +++ b/clients/client-sesv2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SESv2ClientConfig } from "./SESv2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SESv2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sesv2/tsconfig.es.json b/clients/client-sesv2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sesv2/tsconfig.es.json +++ b/clients/client-sesv2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sesv2/tsconfig.json b/clients/client-sesv2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sesv2/tsconfig.json +++ b/clients/client-sesv2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sesv2/tsconfig.types.json b/clients/client-sesv2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sesv2/tsconfig.types.json +++ b/clients/client-sesv2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sfn/.gitignore b/clients/client-sfn/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sfn/.gitignore +++ b/clients/client-sfn/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sfn/package.json b/clients/client-sfn/package.json index 190b47fd8099..006543d9b6f4 100644 --- a/clients/client-sfn/package.json +++ b/clients/client-sfn/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sfn", "repository": { "type": "git", diff --git a/clients/client-sfn/runtimeConfig.browser.ts b/clients/client-sfn/runtimeConfig.browser.ts deleted file mode 100644 index 4c0df503c2c3..000000000000 --- a/clients/client-sfn/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SFNClientConfig } from "./SFNClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SFNClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sfn/runtimeConfig.ts b/clients/client-sfn/runtimeConfig.ts deleted file mode 100644 index 72b35421c4c3..000000000000 --- a/clients/client-sfn/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SFNClientConfig } from "./SFNClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SFNClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sfn/SFN.ts b/clients/client-sfn/src/SFN.ts similarity index 100% rename from clients/client-sfn/SFN.ts rename to clients/client-sfn/src/SFN.ts diff --git a/clients/client-sfn/SFNClient.ts b/clients/client-sfn/src/SFNClient.ts similarity index 100% rename from clients/client-sfn/SFNClient.ts rename to clients/client-sfn/src/SFNClient.ts diff --git a/clients/client-sfn/commands/CreateActivityCommand.ts b/clients/client-sfn/src/commands/CreateActivityCommand.ts similarity index 100% rename from clients/client-sfn/commands/CreateActivityCommand.ts rename to clients/client-sfn/src/commands/CreateActivityCommand.ts diff --git a/clients/client-sfn/commands/CreateStateMachineCommand.ts b/clients/client-sfn/src/commands/CreateStateMachineCommand.ts similarity index 100% rename from clients/client-sfn/commands/CreateStateMachineCommand.ts rename to clients/client-sfn/src/commands/CreateStateMachineCommand.ts diff --git a/clients/client-sfn/commands/DeleteActivityCommand.ts b/clients/client-sfn/src/commands/DeleteActivityCommand.ts similarity index 100% rename from clients/client-sfn/commands/DeleteActivityCommand.ts rename to clients/client-sfn/src/commands/DeleteActivityCommand.ts diff --git a/clients/client-sfn/commands/DeleteStateMachineCommand.ts b/clients/client-sfn/src/commands/DeleteStateMachineCommand.ts similarity index 100% rename from clients/client-sfn/commands/DeleteStateMachineCommand.ts rename to clients/client-sfn/src/commands/DeleteStateMachineCommand.ts diff --git a/clients/client-sfn/commands/DescribeActivityCommand.ts b/clients/client-sfn/src/commands/DescribeActivityCommand.ts similarity index 100% rename from clients/client-sfn/commands/DescribeActivityCommand.ts rename to clients/client-sfn/src/commands/DescribeActivityCommand.ts diff --git a/clients/client-sfn/commands/DescribeExecutionCommand.ts b/clients/client-sfn/src/commands/DescribeExecutionCommand.ts similarity index 100% rename from clients/client-sfn/commands/DescribeExecutionCommand.ts rename to clients/client-sfn/src/commands/DescribeExecutionCommand.ts diff --git a/clients/client-sfn/commands/DescribeStateMachineCommand.ts b/clients/client-sfn/src/commands/DescribeStateMachineCommand.ts similarity index 100% rename from clients/client-sfn/commands/DescribeStateMachineCommand.ts rename to clients/client-sfn/src/commands/DescribeStateMachineCommand.ts diff --git a/clients/client-sfn/commands/DescribeStateMachineForExecutionCommand.ts b/clients/client-sfn/src/commands/DescribeStateMachineForExecutionCommand.ts similarity index 100% rename from clients/client-sfn/commands/DescribeStateMachineForExecutionCommand.ts rename to clients/client-sfn/src/commands/DescribeStateMachineForExecutionCommand.ts diff --git a/clients/client-sfn/commands/GetActivityTaskCommand.ts b/clients/client-sfn/src/commands/GetActivityTaskCommand.ts similarity index 100% rename from clients/client-sfn/commands/GetActivityTaskCommand.ts rename to clients/client-sfn/src/commands/GetActivityTaskCommand.ts diff --git a/clients/client-sfn/commands/GetExecutionHistoryCommand.ts b/clients/client-sfn/src/commands/GetExecutionHistoryCommand.ts similarity index 100% rename from clients/client-sfn/commands/GetExecutionHistoryCommand.ts rename to clients/client-sfn/src/commands/GetExecutionHistoryCommand.ts diff --git a/clients/client-sfn/commands/ListActivitiesCommand.ts b/clients/client-sfn/src/commands/ListActivitiesCommand.ts similarity index 100% rename from clients/client-sfn/commands/ListActivitiesCommand.ts rename to clients/client-sfn/src/commands/ListActivitiesCommand.ts diff --git a/clients/client-sfn/commands/ListExecutionsCommand.ts b/clients/client-sfn/src/commands/ListExecutionsCommand.ts similarity index 100% rename from clients/client-sfn/commands/ListExecutionsCommand.ts rename to clients/client-sfn/src/commands/ListExecutionsCommand.ts diff --git a/clients/client-sfn/commands/ListStateMachinesCommand.ts b/clients/client-sfn/src/commands/ListStateMachinesCommand.ts similarity index 100% rename from clients/client-sfn/commands/ListStateMachinesCommand.ts rename to clients/client-sfn/src/commands/ListStateMachinesCommand.ts diff --git a/clients/client-sfn/commands/ListTagsForResourceCommand.ts b/clients/client-sfn/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-sfn/commands/ListTagsForResourceCommand.ts rename to clients/client-sfn/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-sfn/commands/SendTaskFailureCommand.ts b/clients/client-sfn/src/commands/SendTaskFailureCommand.ts similarity index 100% rename from clients/client-sfn/commands/SendTaskFailureCommand.ts rename to clients/client-sfn/src/commands/SendTaskFailureCommand.ts diff --git a/clients/client-sfn/commands/SendTaskHeartbeatCommand.ts b/clients/client-sfn/src/commands/SendTaskHeartbeatCommand.ts similarity index 100% rename from clients/client-sfn/commands/SendTaskHeartbeatCommand.ts rename to clients/client-sfn/src/commands/SendTaskHeartbeatCommand.ts diff --git a/clients/client-sfn/commands/SendTaskSuccessCommand.ts b/clients/client-sfn/src/commands/SendTaskSuccessCommand.ts similarity index 100% rename from clients/client-sfn/commands/SendTaskSuccessCommand.ts rename to clients/client-sfn/src/commands/SendTaskSuccessCommand.ts diff --git a/clients/client-sfn/commands/StartExecutionCommand.ts b/clients/client-sfn/src/commands/StartExecutionCommand.ts similarity index 100% rename from clients/client-sfn/commands/StartExecutionCommand.ts rename to clients/client-sfn/src/commands/StartExecutionCommand.ts diff --git a/clients/client-sfn/commands/StartSyncExecutionCommand.ts b/clients/client-sfn/src/commands/StartSyncExecutionCommand.ts similarity index 100% rename from clients/client-sfn/commands/StartSyncExecutionCommand.ts rename to clients/client-sfn/src/commands/StartSyncExecutionCommand.ts diff --git a/clients/client-sfn/commands/StopExecutionCommand.ts b/clients/client-sfn/src/commands/StopExecutionCommand.ts similarity index 100% rename from clients/client-sfn/commands/StopExecutionCommand.ts rename to clients/client-sfn/src/commands/StopExecutionCommand.ts diff --git a/clients/client-sfn/commands/TagResourceCommand.ts b/clients/client-sfn/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-sfn/commands/TagResourceCommand.ts rename to clients/client-sfn/src/commands/TagResourceCommand.ts diff --git a/clients/client-sfn/commands/UntagResourceCommand.ts b/clients/client-sfn/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-sfn/commands/UntagResourceCommand.ts rename to clients/client-sfn/src/commands/UntagResourceCommand.ts diff --git a/clients/client-sfn/commands/UpdateStateMachineCommand.ts b/clients/client-sfn/src/commands/UpdateStateMachineCommand.ts similarity index 100% rename from clients/client-sfn/commands/UpdateStateMachineCommand.ts rename to clients/client-sfn/src/commands/UpdateStateMachineCommand.ts diff --git a/clients/client-sfn/endpoints.ts b/clients/client-sfn/src/endpoints.ts similarity index 100% rename from clients/client-sfn/endpoints.ts rename to clients/client-sfn/src/endpoints.ts diff --git a/clients/client-sfn/index.ts b/clients/client-sfn/src/index.ts similarity index 100% rename from clients/client-sfn/index.ts rename to clients/client-sfn/src/index.ts diff --git a/clients/client-sfn/models/index.ts b/clients/client-sfn/src/models/index.ts similarity index 100% rename from clients/client-sfn/models/index.ts rename to clients/client-sfn/src/models/index.ts diff --git a/clients/client-sfn/models/models_0.ts b/clients/client-sfn/src/models/models_0.ts similarity index 100% rename from clients/client-sfn/models/models_0.ts rename to clients/client-sfn/src/models/models_0.ts diff --git a/clients/client-sfn/pagination/GetExecutionHistoryPaginator.ts b/clients/client-sfn/src/pagination/GetExecutionHistoryPaginator.ts similarity index 100% rename from clients/client-sfn/pagination/GetExecutionHistoryPaginator.ts rename to clients/client-sfn/src/pagination/GetExecutionHistoryPaginator.ts diff --git a/clients/client-sfn/pagination/Interfaces.ts b/clients/client-sfn/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sfn/pagination/Interfaces.ts rename to clients/client-sfn/src/pagination/Interfaces.ts diff --git a/clients/client-sfn/pagination/ListActivitiesPaginator.ts b/clients/client-sfn/src/pagination/ListActivitiesPaginator.ts similarity index 100% rename from clients/client-sfn/pagination/ListActivitiesPaginator.ts rename to clients/client-sfn/src/pagination/ListActivitiesPaginator.ts diff --git a/clients/client-sfn/pagination/ListExecutionsPaginator.ts b/clients/client-sfn/src/pagination/ListExecutionsPaginator.ts similarity index 100% rename from clients/client-sfn/pagination/ListExecutionsPaginator.ts rename to clients/client-sfn/src/pagination/ListExecutionsPaginator.ts diff --git a/clients/client-sfn/pagination/ListStateMachinesPaginator.ts b/clients/client-sfn/src/pagination/ListStateMachinesPaginator.ts similarity index 100% rename from clients/client-sfn/pagination/ListStateMachinesPaginator.ts rename to clients/client-sfn/src/pagination/ListStateMachinesPaginator.ts diff --git a/clients/client-sfn/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-sfn/protocols/Aws_json1_0.ts rename to clients/client-sfn/src/protocols/Aws_json1_0.ts diff --git a/clients/client-sfn/src/runtimeConfig.browser.ts b/clients/client-sfn/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bf071b185f07 --- /dev/null +++ b/clients/client-sfn/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SFNClientConfig } from "./SFNClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SFNClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sfn/runtimeConfig.native.ts b/clients/client-sfn/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sfn/runtimeConfig.native.ts rename to clients/client-sfn/src/runtimeConfig.native.ts diff --git a/clients/client-sfn/runtimeConfig.shared.ts b/clients/client-sfn/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sfn/runtimeConfig.shared.ts rename to clients/client-sfn/src/runtimeConfig.shared.ts diff --git a/clients/client-sfn/src/runtimeConfig.ts b/clients/client-sfn/src/runtimeConfig.ts new file mode 100644 index 000000000000..9285306ee290 --- /dev/null +++ b/clients/client-sfn/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SFNClientConfig } from "./SFNClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SFNClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sfn/tsconfig.es.json b/clients/client-sfn/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sfn/tsconfig.es.json +++ b/clients/client-sfn/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sfn/tsconfig.json b/clients/client-sfn/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sfn/tsconfig.json +++ b/clients/client-sfn/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sfn/tsconfig.types.json b/clients/client-sfn/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sfn/tsconfig.types.json +++ b/clients/client-sfn/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-shield/.gitignore b/clients/client-shield/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-shield/.gitignore +++ b/clients/client-shield/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-shield/package.json b/clients/client-shield/package.json index dcba88474195..2f308b2b2da1 100644 --- a/clients/client-shield/package.json +++ b/clients/client-shield/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-shield", "repository": { "type": "git", diff --git a/clients/client-shield/runtimeConfig.browser.ts b/clients/client-shield/runtimeConfig.browser.ts deleted file mode 100644 index 54d6be574a71..000000000000 --- a/clients/client-shield/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { ShieldClientConfig } from "./ShieldClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ShieldClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-shield/runtimeConfig.ts b/clients/client-shield/runtimeConfig.ts deleted file mode 100644 index 02ac56dbce45..000000000000 --- a/clients/client-shield/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { ShieldClientConfig } from "./ShieldClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: ShieldClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-shield/Shield.ts b/clients/client-shield/src/Shield.ts similarity index 100% rename from clients/client-shield/Shield.ts rename to clients/client-shield/src/Shield.ts diff --git a/clients/client-shield/ShieldClient.ts b/clients/client-shield/src/ShieldClient.ts similarity index 100% rename from clients/client-shield/ShieldClient.ts rename to clients/client-shield/src/ShieldClient.ts diff --git a/clients/client-shield/commands/AssociateDRTLogBucketCommand.ts b/clients/client-shield/src/commands/AssociateDRTLogBucketCommand.ts similarity index 100% rename from clients/client-shield/commands/AssociateDRTLogBucketCommand.ts rename to clients/client-shield/src/commands/AssociateDRTLogBucketCommand.ts diff --git a/clients/client-shield/commands/AssociateDRTRoleCommand.ts b/clients/client-shield/src/commands/AssociateDRTRoleCommand.ts similarity index 100% rename from clients/client-shield/commands/AssociateDRTRoleCommand.ts rename to clients/client-shield/src/commands/AssociateDRTRoleCommand.ts diff --git a/clients/client-shield/commands/AssociateHealthCheckCommand.ts b/clients/client-shield/src/commands/AssociateHealthCheckCommand.ts similarity index 100% rename from clients/client-shield/commands/AssociateHealthCheckCommand.ts rename to clients/client-shield/src/commands/AssociateHealthCheckCommand.ts diff --git a/clients/client-shield/commands/AssociateProactiveEngagementDetailsCommand.ts b/clients/client-shield/src/commands/AssociateProactiveEngagementDetailsCommand.ts similarity index 100% rename from clients/client-shield/commands/AssociateProactiveEngagementDetailsCommand.ts rename to clients/client-shield/src/commands/AssociateProactiveEngagementDetailsCommand.ts diff --git a/clients/client-shield/commands/CreateProtectionCommand.ts b/clients/client-shield/src/commands/CreateProtectionCommand.ts similarity index 100% rename from clients/client-shield/commands/CreateProtectionCommand.ts rename to clients/client-shield/src/commands/CreateProtectionCommand.ts diff --git a/clients/client-shield/commands/CreateProtectionGroupCommand.ts b/clients/client-shield/src/commands/CreateProtectionGroupCommand.ts similarity index 100% rename from clients/client-shield/commands/CreateProtectionGroupCommand.ts rename to clients/client-shield/src/commands/CreateProtectionGroupCommand.ts diff --git a/clients/client-shield/commands/CreateSubscriptionCommand.ts b/clients/client-shield/src/commands/CreateSubscriptionCommand.ts similarity index 100% rename from clients/client-shield/commands/CreateSubscriptionCommand.ts rename to clients/client-shield/src/commands/CreateSubscriptionCommand.ts diff --git a/clients/client-shield/commands/DeleteProtectionCommand.ts b/clients/client-shield/src/commands/DeleteProtectionCommand.ts similarity index 100% rename from clients/client-shield/commands/DeleteProtectionCommand.ts rename to clients/client-shield/src/commands/DeleteProtectionCommand.ts diff --git a/clients/client-shield/commands/DeleteProtectionGroupCommand.ts b/clients/client-shield/src/commands/DeleteProtectionGroupCommand.ts similarity index 100% rename from clients/client-shield/commands/DeleteProtectionGroupCommand.ts rename to clients/client-shield/src/commands/DeleteProtectionGroupCommand.ts diff --git a/clients/client-shield/commands/DeleteSubscriptionCommand.ts b/clients/client-shield/src/commands/DeleteSubscriptionCommand.ts similarity index 100% rename from clients/client-shield/commands/DeleteSubscriptionCommand.ts rename to clients/client-shield/src/commands/DeleteSubscriptionCommand.ts diff --git a/clients/client-shield/commands/DescribeAttackCommand.ts b/clients/client-shield/src/commands/DescribeAttackCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeAttackCommand.ts rename to clients/client-shield/src/commands/DescribeAttackCommand.ts diff --git a/clients/client-shield/commands/DescribeAttackStatisticsCommand.ts b/clients/client-shield/src/commands/DescribeAttackStatisticsCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeAttackStatisticsCommand.ts rename to clients/client-shield/src/commands/DescribeAttackStatisticsCommand.ts diff --git a/clients/client-shield/commands/DescribeDRTAccessCommand.ts b/clients/client-shield/src/commands/DescribeDRTAccessCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeDRTAccessCommand.ts rename to clients/client-shield/src/commands/DescribeDRTAccessCommand.ts diff --git a/clients/client-shield/commands/DescribeEmergencyContactSettingsCommand.ts b/clients/client-shield/src/commands/DescribeEmergencyContactSettingsCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeEmergencyContactSettingsCommand.ts rename to clients/client-shield/src/commands/DescribeEmergencyContactSettingsCommand.ts diff --git a/clients/client-shield/commands/DescribeProtectionCommand.ts b/clients/client-shield/src/commands/DescribeProtectionCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeProtectionCommand.ts rename to clients/client-shield/src/commands/DescribeProtectionCommand.ts diff --git a/clients/client-shield/commands/DescribeProtectionGroupCommand.ts b/clients/client-shield/src/commands/DescribeProtectionGroupCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeProtectionGroupCommand.ts rename to clients/client-shield/src/commands/DescribeProtectionGroupCommand.ts diff --git a/clients/client-shield/commands/DescribeSubscriptionCommand.ts b/clients/client-shield/src/commands/DescribeSubscriptionCommand.ts similarity index 100% rename from clients/client-shield/commands/DescribeSubscriptionCommand.ts rename to clients/client-shield/src/commands/DescribeSubscriptionCommand.ts diff --git a/clients/client-shield/commands/DisableProactiveEngagementCommand.ts b/clients/client-shield/src/commands/DisableProactiveEngagementCommand.ts similarity index 100% rename from clients/client-shield/commands/DisableProactiveEngagementCommand.ts rename to clients/client-shield/src/commands/DisableProactiveEngagementCommand.ts diff --git a/clients/client-shield/commands/DisassociateDRTLogBucketCommand.ts b/clients/client-shield/src/commands/DisassociateDRTLogBucketCommand.ts similarity index 100% rename from clients/client-shield/commands/DisassociateDRTLogBucketCommand.ts rename to clients/client-shield/src/commands/DisassociateDRTLogBucketCommand.ts diff --git a/clients/client-shield/commands/DisassociateDRTRoleCommand.ts b/clients/client-shield/src/commands/DisassociateDRTRoleCommand.ts similarity index 100% rename from clients/client-shield/commands/DisassociateDRTRoleCommand.ts rename to clients/client-shield/src/commands/DisassociateDRTRoleCommand.ts diff --git a/clients/client-shield/commands/DisassociateHealthCheckCommand.ts b/clients/client-shield/src/commands/DisassociateHealthCheckCommand.ts similarity index 100% rename from clients/client-shield/commands/DisassociateHealthCheckCommand.ts rename to clients/client-shield/src/commands/DisassociateHealthCheckCommand.ts diff --git a/clients/client-shield/commands/EnableProactiveEngagementCommand.ts b/clients/client-shield/src/commands/EnableProactiveEngagementCommand.ts similarity index 100% rename from clients/client-shield/commands/EnableProactiveEngagementCommand.ts rename to clients/client-shield/src/commands/EnableProactiveEngagementCommand.ts diff --git a/clients/client-shield/commands/GetSubscriptionStateCommand.ts b/clients/client-shield/src/commands/GetSubscriptionStateCommand.ts similarity index 100% rename from clients/client-shield/commands/GetSubscriptionStateCommand.ts rename to clients/client-shield/src/commands/GetSubscriptionStateCommand.ts diff --git a/clients/client-shield/commands/ListAttacksCommand.ts b/clients/client-shield/src/commands/ListAttacksCommand.ts similarity index 100% rename from clients/client-shield/commands/ListAttacksCommand.ts rename to clients/client-shield/src/commands/ListAttacksCommand.ts diff --git a/clients/client-shield/commands/ListProtectionGroupsCommand.ts b/clients/client-shield/src/commands/ListProtectionGroupsCommand.ts similarity index 100% rename from clients/client-shield/commands/ListProtectionGroupsCommand.ts rename to clients/client-shield/src/commands/ListProtectionGroupsCommand.ts diff --git a/clients/client-shield/commands/ListProtectionsCommand.ts b/clients/client-shield/src/commands/ListProtectionsCommand.ts similarity index 100% rename from clients/client-shield/commands/ListProtectionsCommand.ts rename to clients/client-shield/src/commands/ListProtectionsCommand.ts diff --git a/clients/client-shield/commands/ListResourcesInProtectionGroupCommand.ts b/clients/client-shield/src/commands/ListResourcesInProtectionGroupCommand.ts similarity index 100% rename from clients/client-shield/commands/ListResourcesInProtectionGroupCommand.ts rename to clients/client-shield/src/commands/ListResourcesInProtectionGroupCommand.ts diff --git a/clients/client-shield/commands/ListTagsForResourceCommand.ts b/clients/client-shield/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-shield/commands/ListTagsForResourceCommand.ts rename to clients/client-shield/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-shield/commands/TagResourceCommand.ts b/clients/client-shield/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-shield/commands/TagResourceCommand.ts rename to clients/client-shield/src/commands/TagResourceCommand.ts diff --git a/clients/client-shield/commands/UntagResourceCommand.ts b/clients/client-shield/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-shield/commands/UntagResourceCommand.ts rename to clients/client-shield/src/commands/UntagResourceCommand.ts diff --git a/clients/client-shield/commands/UpdateEmergencyContactSettingsCommand.ts b/clients/client-shield/src/commands/UpdateEmergencyContactSettingsCommand.ts similarity index 100% rename from clients/client-shield/commands/UpdateEmergencyContactSettingsCommand.ts rename to clients/client-shield/src/commands/UpdateEmergencyContactSettingsCommand.ts diff --git a/clients/client-shield/commands/UpdateProtectionGroupCommand.ts b/clients/client-shield/src/commands/UpdateProtectionGroupCommand.ts similarity index 100% rename from clients/client-shield/commands/UpdateProtectionGroupCommand.ts rename to clients/client-shield/src/commands/UpdateProtectionGroupCommand.ts diff --git a/clients/client-shield/commands/UpdateSubscriptionCommand.ts b/clients/client-shield/src/commands/UpdateSubscriptionCommand.ts similarity index 100% rename from clients/client-shield/commands/UpdateSubscriptionCommand.ts rename to clients/client-shield/src/commands/UpdateSubscriptionCommand.ts diff --git a/clients/client-shield/endpoints.ts b/clients/client-shield/src/endpoints.ts similarity index 100% rename from clients/client-shield/endpoints.ts rename to clients/client-shield/src/endpoints.ts diff --git a/clients/client-shield/index.ts b/clients/client-shield/src/index.ts similarity index 100% rename from clients/client-shield/index.ts rename to clients/client-shield/src/index.ts diff --git a/clients/client-shield/models/index.ts b/clients/client-shield/src/models/index.ts similarity index 100% rename from clients/client-shield/models/index.ts rename to clients/client-shield/src/models/index.ts diff --git a/clients/client-shield/models/models_0.ts b/clients/client-shield/src/models/models_0.ts similarity index 100% rename from clients/client-shield/models/models_0.ts rename to clients/client-shield/src/models/models_0.ts diff --git a/clients/client-shield/pagination/Interfaces.ts b/clients/client-shield/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-shield/pagination/Interfaces.ts rename to clients/client-shield/src/pagination/Interfaces.ts diff --git a/clients/client-shield/pagination/ListAttacksPaginator.ts b/clients/client-shield/src/pagination/ListAttacksPaginator.ts similarity index 100% rename from clients/client-shield/pagination/ListAttacksPaginator.ts rename to clients/client-shield/src/pagination/ListAttacksPaginator.ts diff --git a/clients/client-shield/pagination/ListProtectionGroupsPaginator.ts b/clients/client-shield/src/pagination/ListProtectionGroupsPaginator.ts similarity index 100% rename from clients/client-shield/pagination/ListProtectionGroupsPaginator.ts rename to clients/client-shield/src/pagination/ListProtectionGroupsPaginator.ts diff --git a/clients/client-shield/pagination/ListProtectionsPaginator.ts b/clients/client-shield/src/pagination/ListProtectionsPaginator.ts similarity index 100% rename from clients/client-shield/pagination/ListProtectionsPaginator.ts rename to clients/client-shield/src/pagination/ListProtectionsPaginator.ts diff --git a/clients/client-shield/pagination/ListResourcesInProtectionGroupPaginator.ts b/clients/client-shield/src/pagination/ListResourcesInProtectionGroupPaginator.ts similarity index 100% rename from clients/client-shield/pagination/ListResourcesInProtectionGroupPaginator.ts rename to clients/client-shield/src/pagination/ListResourcesInProtectionGroupPaginator.ts diff --git a/clients/client-shield/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-shield/protocols/Aws_json1_1.ts rename to clients/client-shield/src/protocols/Aws_json1_1.ts diff --git a/clients/client-shield/src/runtimeConfig.browser.ts b/clients/client-shield/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f43fce005955 --- /dev/null +++ b/clients/client-shield/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { ShieldClientConfig } from "./ShieldClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ShieldClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-shield/runtimeConfig.native.ts b/clients/client-shield/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-shield/runtimeConfig.native.ts rename to clients/client-shield/src/runtimeConfig.native.ts diff --git a/clients/client-shield/runtimeConfig.shared.ts b/clients/client-shield/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-shield/runtimeConfig.shared.ts rename to clients/client-shield/src/runtimeConfig.shared.ts diff --git a/clients/client-shield/src/runtimeConfig.ts b/clients/client-shield/src/runtimeConfig.ts new file mode 100644 index 000000000000..5248457cf261 --- /dev/null +++ b/clients/client-shield/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { ShieldClientConfig } from "./ShieldClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: ShieldClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-shield/tsconfig.es.json b/clients/client-shield/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-shield/tsconfig.es.json +++ b/clients/client-shield/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-shield/tsconfig.json b/clients/client-shield/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-shield/tsconfig.json +++ b/clients/client-shield/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-shield/tsconfig.types.json b/clients/client-shield/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-shield/tsconfig.types.json +++ b/clients/client-shield/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-signer/.gitignore b/clients/client-signer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-signer/.gitignore +++ b/clients/client-signer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-signer/package.json b/clients/client-signer/package.json index 3b0f9d49a620..3b5fd43e7305 100644 --- a/clients/client-signer/package.json +++ b/clients/client-signer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-signer", "repository": { "type": "git", diff --git a/clients/client-signer/runtimeConfig.browser.ts b/clients/client-signer/runtimeConfig.browser.ts deleted file mode 100644 index fecb83f43757..000000000000 --- a/clients/client-signer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SignerClientConfig } from "./SignerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SignerClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-signer/runtimeConfig.ts b/clients/client-signer/runtimeConfig.ts deleted file mode 100644 index 198a60bc56a5..000000000000 --- a/clients/client-signer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SignerClientConfig } from "./SignerClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SignerClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-signer/Signer.ts b/clients/client-signer/src/Signer.ts similarity index 100% rename from clients/client-signer/Signer.ts rename to clients/client-signer/src/Signer.ts diff --git a/clients/client-signer/SignerClient.ts b/clients/client-signer/src/SignerClient.ts similarity index 100% rename from clients/client-signer/SignerClient.ts rename to clients/client-signer/src/SignerClient.ts diff --git a/clients/client-signer/commands/AddProfilePermissionCommand.ts b/clients/client-signer/src/commands/AddProfilePermissionCommand.ts similarity index 100% rename from clients/client-signer/commands/AddProfilePermissionCommand.ts rename to clients/client-signer/src/commands/AddProfilePermissionCommand.ts diff --git a/clients/client-signer/commands/CancelSigningProfileCommand.ts b/clients/client-signer/src/commands/CancelSigningProfileCommand.ts similarity index 100% rename from clients/client-signer/commands/CancelSigningProfileCommand.ts rename to clients/client-signer/src/commands/CancelSigningProfileCommand.ts diff --git a/clients/client-signer/commands/DescribeSigningJobCommand.ts b/clients/client-signer/src/commands/DescribeSigningJobCommand.ts similarity index 100% rename from clients/client-signer/commands/DescribeSigningJobCommand.ts rename to clients/client-signer/src/commands/DescribeSigningJobCommand.ts diff --git a/clients/client-signer/commands/GetSigningPlatformCommand.ts b/clients/client-signer/src/commands/GetSigningPlatformCommand.ts similarity index 100% rename from clients/client-signer/commands/GetSigningPlatformCommand.ts rename to clients/client-signer/src/commands/GetSigningPlatformCommand.ts diff --git a/clients/client-signer/commands/GetSigningProfileCommand.ts b/clients/client-signer/src/commands/GetSigningProfileCommand.ts similarity index 100% rename from clients/client-signer/commands/GetSigningProfileCommand.ts rename to clients/client-signer/src/commands/GetSigningProfileCommand.ts diff --git a/clients/client-signer/commands/ListProfilePermissionsCommand.ts b/clients/client-signer/src/commands/ListProfilePermissionsCommand.ts similarity index 100% rename from clients/client-signer/commands/ListProfilePermissionsCommand.ts rename to clients/client-signer/src/commands/ListProfilePermissionsCommand.ts diff --git a/clients/client-signer/commands/ListSigningJobsCommand.ts b/clients/client-signer/src/commands/ListSigningJobsCommand.ts similarity index 100% rename from clients/client-signer/commands/ListSigningJobsCommand.ts rename to clients/client-signer/src/commands/ListSigningJobsCommand.ts diff --git a/clients/client-signer/commands/ListSigningPlatformsCommand.ts b/clients/client-signer/src/commands/ListSigningPlatformsCommand.ts similarity index 100% rename from clients/client-signer/commands/ListSigningPlatformsCommand.ts rename to clients/client-signer/src/commands/ListSigningPlatformsCommand.ts diff --git a/clients/client-signer/commands/ListSigningProfilesCommand.ts b/clients/client-signer/src/commands/ListSigningProfilesCommand.ts similarity index 100% rename from clients/client-signer/commands/ListSigningProfilesCommand.ts rename to clients/client-signer/src/commands/ListSigningProfilesCommand.ts diff --git a/clients/client-signer/commands/ListTagsForResourceCommand.ts b/clients/client-signer/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-signer/commands/ListTagsForResourceCommand.ts rename to clients/client-signer/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-signer/commands/PutSigningProfileCommand.ts b/clients/client-signer/src/commands/PutSigningProfileCommand.ts similarity index 100% rename from clients/client-signer/commands/PutSigningProfileCommand.ts rename to clients/client-signer/src/commands/PutSigningProfileCommand.ts diff --git a/clients/client-signer/commands/RemoveProfilePermissionCommand.ts b/clients/client-signer/src/commands/RemoveProfilePermissionCommand.ts similarity index 100% rename from clients/client-signer/commands/RemoveProfilePermissionCommand.ts rename to clients/client-signer/src/commands/RemoveProfilePermissionCommand.ts diff --git a/clients/client-signer/commands/RevokeSignatureCommand.ts b/clients/client-signer/src/commands/RevokeSignatureCommand.ts similarity index 100% rename from clients/client-signer/commands/RevokeSignatureCommand.ts rename to clients/client-signer/src/commands/RevokeSignatureCommand.ts diff --git a/clients/client-signer/commands/RevokeSigningProfileCommand.ts b/clients/client-signer/src/commands/RevokeSigningProfileCommand.ts similarity index 100% rename from clients/client-signer/commands/RevokeSigningProfileCommand.ts rename to clients/client-signer/src/commands/RevokeSigningProfileCommand.ts diff --git a/clients/client-signer/commands/StartSigningJobCommand.ts b/clients/client-signer/src/commands/StartSigningJobCommand.ts similarity index 100% rename from clients/client-signer/commands/StartSigningJobCommand.ts rename to clients/client-signer/src/commands/StartSigningJobCommand.ts diff --git a/clients/client-signer/commands/TagResourceCommand.ts b/clients/client-signer/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-signer/commands/TagResourceCommand.ts rename to clients/client-signer/src/commands/TagResourceCommand.ts diff --git a/clients/client-signer/commands/UntagResourceCommand.ts b/clients/client-signer/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-signer/commands/UntagResourceCommand.ts rename to clients/client-signer/src/commands/UntagResourceCommand.ts diff --git a/clients/client-signer/endpoints.ts b/clients/client-signer/src/endpoints.ts similarity index 100% rename from clients/client-signer/endpoints.ts rename to clients/client-signer/src/endpoints.ts diff --git a/clients/client-signer/index.ts b/clients/client-signer/src/index.ts similarity index 100% rename from clients/client-signer/index.ts rename to clients/client-signer/src/index.ts diff --git a/clients/client-signer/models/index.ts b/clients/client-signer/src/models/index.ts similarity index 100% rename from clients/client-signer/models/index.ts rename to clients/client-signer/src/models/index.ts diff --git a/clients/client-signer/models/models_0.ts b/clients/client-signer/src/models/models_0.ts similarity index 100% rename from clients/client-signer/models/models_0.ts rename to clients/client-signer/src/models/models_0.ts diff --git a/clients/client-signer/pagination/Interfaces.ts b/clients/client-signer/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-signer/pagination/Interfaces.ts rename to clients/client-signer/src/pagination/Interfaces.ts diff --git a/clients/client-signer/pagination/ListSigningJobsPaginator.ts b/clients/client-signer/src/pagination/ListSigningJobsPaginator.ts similarity index 100% rename from clients/client-signer/pagination/ListSigningJobsPaginator.ts rename to clients/client-signer/src/pagination/ListSigningJobsPaginator.ts diff --git a/clients/client-signer/pagination/ListSigningPlatformsPaginator.ts b/clients/client-signer/src/pagination/ListSigningPlatformsPaginator.ts similarity index 100% rename from clients/client-signer/pagination/ListSigningPlatformsPaginator.ts rename to clients/client-signer/src/pagination/ListSigningPlatformsPaginator.ts diff --git a/clients/client-signer/pagination/ListSigningProfilesPaginator.ts b/clients/client-signer/src/pagination/ListSigningProfilesPaginator.ts similarity index 100% rename from clients/client-signer/pagination/ListSigningProfilesPaginator.ts rename to clients/client-signer/src/pagination/ListSigningProfilesPaginator.ts diff --git a/clients/client-signer/protocols/Aws_restJson1.ts b/clients/client-signer/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-signer/protocols/Aws_restJson1.ts rename to clients/client-signer/src/protocols/Aws_restJson1.ts diff --git a/clients/client-signer/src/runtimeConfig.browser.ts b/clients/client-signer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a4fa5bec03f2 --- /dev/null +++ b/clients/client-signer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SignerClientConfig } from "./SignerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SignerClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-signer/runtimeConfig.native.ts b/clients/client-signer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-signer/runtimeConfig.native.ts rename to clients/client-signer/src/runtimeConfig.native.ts diff --git a/clients/client-signer/runtimeConfig.shared.ts b/clients/client-signer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-signer/runtimeConfig.shared.ts rename to clients/client-signer/src/runtimeConfig.shared.ts diff --git a/clients/client-signer/src/runtimeConfig.ts b/clients/client-signer/src/runtimeConfig.ts new file mode 100644 index 000000000000..a91d3ead5e84 --- /dev/null +++ b/clients/client-signer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SignerClientConfig } from "./SignerClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SignerClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-signer/waiters/waitForSuccessfulSigningJob.ts b/clients/client-signer/src/waiters/waitForSuccessfulSigningJob.ts similarity index 100% rename from clients/client-signer/waiters/waitForSuccessfulSigningJob.ts rename to clients/client-signer/src/waiters/waitForSuccessfulSigningJob.ts diff --git a/clients/client-signer/tsconfig.es.json b/clients/client-signer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-signer/tsconfig.es.json +++ b/clients/client-signer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-signer/tsconfig.json b/clients/client-signer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-signer/tsconfig.json +++ b/clients/client-signer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-signer/tsconfig.types.json b/clients/client-signer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-signer/tsconfig.types.json +++ b/clients/client-signer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sms/.gitignore b/clients/client-sms/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sms/.gitignore +++ b/clients/client-sms/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sms/package.json b/clients/client-sms/package.json index 6645f94acd29..2aca7f59fef0 100644 --- a/clients/client-sms/package.json +++ b/clients/client-sms/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sms", "repository": { "type": "git", diff --git a/clients/client-sms/runtimeConfig.browser.ts b/clients/client-sms/runtimeConfig.browser.ts deleted file mode 100644 index 8a56fef82b3e..000000000000 --- a/clients/client-sms/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SMSClientConfig } from "./SMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SMSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sms/runtimeConfig.ts b/clients/client-sms/runtimeConfig.ts deleted file mode 100644 index 56e5501ee509..000000000000 --- a/clients/client-sms/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SMSClientConfig } from "./SMSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SMSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sms/SMS.ts b/clients/client-sms/src/SMS.ts similarity index 100% rename from clients/client-sms/SMS.ts rename to clients/client-sms/src/SMS.ts diff --git a/clients/client-sms/SMSClient.ts b/clients/client-sms/src/SMSClient.ts similarity index 100% rename from clients/client-sms/SMSClient.ts rename to clients/client-sms/src/SMSClient.ts diff --git a/clients/client-sms/commands/CreateAppCommand.ts b/clients/client-sms/src/commands/CreateAppCommand.ts similarity index 100% rename from clients/client-sms/commands/CreateAppCommand.ts rename to clients/client-sms/src/commands/CreateAppCommand.ts diff --git a/clients/client-sms/commands/CreateReplicationJobCommand.ts b/clients/client-sms/src/commands/CreateReplicationJobCommand.ts similarity index 100% rename from clients/client-sms/commands/CreateReplicationJobCommand.ts rename to clients/client-sms/src/commands/CreateReplicationJobCommand.ts diff --git a/clients/client-sms/commands/DeleteAppCommand.ts b/clients/client-sms/src/commands/DeleteAppCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteAppCommand.ts rename to clients/client-sms/src/commands/DeleteAppCommand.ts diff --git a/clients/client-sms/commands/DeleteAppLaunchConfigurationCommand.ts b/clients/client-sms/src/commands/DeleteAppLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteAppLaunchConfigurationCommand.ts rename to clients/client-sms/src/commands/DeleteAppLaunchConfigurationCommand.ts diff --git a/clients/client-sms/commands/DeleteAppReplicationConfigurationCommand.ts b/clients/client-sms/src/commands/DeleteAppReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteAppReplicationConfigurationCommand.ts rename to clients/client-sms/src/commands/DeleteAppReplicationConfigurationCommand.ts diff --git a/clients/client-sms/commands/DeleteAppValidationConfigurationCommand.ts b/clients/client-sms/src/commands/DeleteAppValidationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteAppValidationConfigurationCommand.ts rename to clients/client-sms/src/commands/DeleteAppValidationConfigurationCommand.ts diff --git a/clients/client-sms/commands/DeleteReplicationJobCommand.ts b/clients/client-sms/src/commands/DeleteReplicationJobCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteReplicationJobCommand.ts rename to clients/client-sms/src/commands/DeleteReplicationJobCommand.ts diff --git a/clients/client-sms/commands/DeleteServerCatalogCommand.ts b/clients/client-sms/src/commands/DeleteServerCatalogCommand.ts similarity index 100% rename from clients/client-sms/commands/DeleteServerCatalogCommand.ts rename to clients/client-sms/src/commands/DeleteServerCatalogCommand.ts diff --git a/clients/client-sms/commands/DisassociateConnectorCommand.ts b/clients/client-sms/src/commands/DisassociateConnectorCommand.ts similarity index 100% rename from clients/client-sms/commands/DisassociateConnectorCommand.ts rename to clients/client-sms/src/commands/DisassociateConnectorCommand.ts diff --git a/clients/client-sms/commands/GenerateChangeSetCommand.ts b/clients/client-sms/src/commands/GenerateChangeSetCommand.ts similarity index 100% rename from clients/client-sms/commands/GenerateChangeSetCommand.ts rename to clients/client-sms/src/commands/GenerateChangeSetCommand.ts diff --git a/clients/client-sms/commands/GenerateTemplateCommand.ts b/clients/client-sms/src/commands/GenerateTemplateCommand.ts similarity index 100% rename from clients/client-sms/commands/GenerateTemplateCommand.ts rename to clients/client-sms/src/commands/GenerateTemplateCommand.ts diff --git a/clients/client-sms/commands/GetAppCommand.ts b/clients/client-sms/src/commands/GetAppCommand.ts similarity index 100% rename from clients/client-sms/commands/GetAppCommand.ts rename to clients/client-sms/src/commands/GetAppCommand.ts diff --git a/clients/client-sms/commands/GetAppLaunchConfigurationCommand.ts b/clients/client-sms/src/commands/GetAppLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/GetAppLaunchConfigurationCommand.ts rename to clients/client-sms/src/commands/GetAppLaunchConfigurationCommand.ts diff --git a/clients/client-sms/commands/GetAppReplicationConfigurationCommand.ts b/clients/client-sms/src/commands/GetAppReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/GetAppReplicationConfigurationCommand.ts rename to clients/client-sms/src/commands/GetAppReplicationConfigurationCommand.ts diff --git a/clients/client-sms/commands/GetAppValidationConfigurationCommand.ts b/clients/client-sms/src/commands/GetAppValidationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/GetAppValidationConfigurationCommand.ts rename to clients/client-sms/src/commands/GetAppValidationConfigurationCommand.ts diff --git a/clients/client-sms/commands/GetAppValidationOutputCommand.ts b/clients/client-sms/src/commands/GetAppValidationOutputCommand.ts similarity index 100% rename from clients/client-sms/commands/GetAppValidationOutputCommand.ts rename to clients/client-sms/src/commands/GetAppValidationOutputCommand.ts diff --git a/clients/client-sms/commands/GetConnectorsCommand.ts b/clients/client-sms/src/commands/GetConnectorsCommand.ts similarity index 100% rename from clients/client-sms/commands/GetConnectorsCommand.ts rename to clients/client-sms/src/commands/GetConnectorsCommand.ts diff --git a/clients/client-sms/commands/GetReplicationJobsCommand.ts b/clients/client-sms/src/commands/GetReplicationJobsCommand.ts similarity index 100% rename from clients/client-sms/commands/GetReplicationJobsCommand.ts rename to clients/client-sms/src/commands/GetReplicationJobsCommand.ts diff --git a/clients/client-sms/commands/GetReplicationRunsCommand.ts b/clients/client-sms/src/commands/GetReplicationRunsCommand.ts similarity index 100% rename from clients/client-sms/commands/GetReplicationRunsCommand.ts rename to clients/client-sms/src/commands/GetReplicationRunsCommand.ts diff --git a/clients/client-sms/commands/GetServersCommand.ts b/clients/client-sms/src/commands/GetServersCommand.ts similarity index 100% rename from clients/client-sms/commands/GetServersCommand.ts rename to clients/client-sms/src/commands/GetServersCommand.ts diff --git a/clients/client-sms/commands/ImportAppCatalogCommand.ts b/clients/client-sms/src/commands/ImportAppCatalogCommand.ts similarity index 100% rename from clients/client-sms/commands/ImportAppCatalogCommand.ts rename to clients/client-sms/src/commands/ImportAppCatalogCommand.ts diff --git a/clients/client-sms/commands/ImportServerCatalogCommand.ts b/clients/client-sms/src/commands/ImportServerCatalogCommand.ts similarity index 100% rename from clients/client-sms/commands/ImportServerCatalogCommand.ts rename to clients/client-sms/src/commands/ImportServerCatalogCommand.ts diff --git a/clients/client-sms/commands/LaunchAppCommand.ts b/clients/client-sms/src/commands/LaunchAppCommand.ts similarity index 100% rename from clients/client-sms/commands/LaunchAppCommand.ts rename to clients/client-sms/src/commands/LaunchAppCommand.ts diff --git a/clients/client-sms/commands/ListAppsCommand.ts b/clients/client-sms/src/commands/ListAppsCommand.ts similarity index 100% rename from clients/client-sms/commands/ListAppsCommand.ts rename to clients/client-sms/src/commands/ListAppsCommand.ts diff --git a/clients/client-sms/commands/NotifyAppValidationOutputCommand.ts b/clients/client-sms/src/commands/NotifyAppValidationOutputCommand.ts similarity index 100% rename from clients/client-sms/commands/NotifyAppValidationOutputCommand.ts rename to clients/client-sms/src/commands/NotifyAppValidationOutputCommand.ts diff --git a/clients/client-sms/commands/PutAppLaunchConfigurationCommand.ts b/clients/client-sms/src/commands/PutAppLaunchConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/PutAppLaunchConfigurationCommand.ts rename to clients/client-sms/src/commands/PutAppLaunchConfigurationCommand.ts diff --git a/clients/client-sms/commands/PutAppReplicationConfigurationCommand.ts b/clients/client-sms/src/commands/PutAppReplicationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/PutAppReplicationConfigurationCommand.ts rename to clients/client-sms/src/commands/PutAppReplicationConfigurationCommand.ts diff --git a/clients/client-sms/commands/PutAppValidationConfigurationCommand.ts b/clients/client-sms/src/commands/PutAppValidationConfigurationCommand.ts similarity index 100% rename from clients/client-sms/commands/PutAppValidationConfigurationCommand.ts rename to clients/client-sms/src/commands/PutAppValidationConfigurationCommand.ts diff --git a/clients/client-sms/commands/StartAppReplicationCommand.ts b/clients/client-sms/src/commands/StartAppReplicationCommand.ts similarity index 100% rename from clients/client-sms/commands/StartAppReplicationCommand.ts rename to clients/client-sms/src/commands/StartAppReplicationCommand.ts diff --git a/clients/client-sms/commands/StartOnDemandAppReplicationCommand.ts b/clients/client-sms/src/commands/StartOnDemandAppReplicationCommand.ts similarity index 100% rename from clients/client-sms/commands/StartOnDemandAppReplicationCommand.ts rename to clients/client-sms/src/commands/StartOnDemandAppReplicationCommand.ts diff --git a/clients/client-sms/commands/StartOnDemandReplicationRunCommand.ts b/clients/client-sms/src/commands/StartOnDemandReplicationRunCommand.ts similarity index 100% rename from clients/client-sms/commands/StartOnDemandReplicationRunCommand.ts rename to clients/client-sms/src/commands/StartOnDemandReplicationRunCommand.ts diff --git a/clients/client-sms/commands/StopAppReplicationCommand.ts b/clients/client-sms/src/commands/StopAppReplicationCommand.ts similarity index 100% rename from clients/client-sms/commands/StopAppReplicationCommand.ts rename to clients/client-sms/src/commands/StopAppReplicationCommand.ts diff --git a/clients/client-sms/commands/TerminateAppCommand.ts b/clients/client-sms/src/commands/TerminateAppCommand.ts similarity index 100% rename from clients/client-sms/commands/TerminateAppCommand.ts rename to clients/client-sms/src/commands/TerminateAppCommand.ts diff --git a/clients/client-sms/commands/UpdateAppCommand.ts b/clients/client-sms/src/commands/UpdateAppCommand.ts similarity index 100% rename from clients/client-sms/commands/UpdateAppCommand.ts rename to clients/client-sms/src/commands/UpdateAppCommand.ts diff --git a/clients/client-sms/commands/UpdateReplicationJobCommand.ts b/clients/client-sms/src/commands/UpdateReplicationJobCommand.ts similarity index 100% rename from clients/client-sms/commands/UpdateReplicationJobCommand.ts rename to clients/client-sms/src/commands/UpdateReplicationJobCommand.ts diff --git a/clients/client-sms/endpoints.ts b/clients/client-sms/src/endpoints.ts similarity index 100% rename from clients/client-sms/endpoints.ts rename to clients/client-sms/src/endpoints.ts diff --git a/clients/client-sms/index.ts b/clients/client-sms/src/index.ts similarity index 100% rename from clients/client-sms/index.ts rename to clients/client-sms/src/index.ts diff --git a/clients/client-sms/models/index.ts b/clients/client-sms/src/models/index.ts similarity index 100% rename from clients/client-sms/models/index.ts rename to clients/client-sms/src/models/index.ts diff --git a/clients/client-sms/models/models_0.ts b/clients/client-sms/src/models/models_0.ts similarity index 100% rename from clients/client-sms/models/models_0.ts rename to clients/client-sms/src/models/models_0.ts diff --git a/clients/client-sms/pagination/GetConnectorsPaginator.ts b/clients/client-sms/src/pagination/GetConnectorsPaginator.ts similarity index 100% rename from clients/client-sms/pagination/GetConnectorsPaginator.ts rename to clients/client-sms/src/pagination/GetConnectorsPaginator.ts diff --git a/clients/client-sms/pagination/GetReplicationJobsPaginator.ts b/clients/client-sms/src/pagination/GetReplicationJobsPaginator.ts similarity index 100% rename from clients/client-sms/pagination/GetReplicationJobsPaginator.ts rename to clients/client-sms/src/pagination/GetReplicationJobsPaginator.ts diff --git a/clients/client-sms/pagination/GetReplicationRunsPaginator.ts b/clients/client-sms/src/pagination/GetReplicationRunsPaginator.ts similarity index 100% rename from clients/client-sms/pagination/GetReplicationRunsPaginator.ts rename to clients/client-sms/src/pagination/GetReplicationRunsPaginator.ts diff --git a/clients/client-sms/pagination/GetServersPaginator.ts b/clients/client-sms/src/pagination/GetServersPaginator.ts similarity index 100% rename from clients/client-sms/pagination/GetServersPaginator.ts rename to clients/client-sms/src/pagination/GetServersPaginator.ts diff --git a/clients/client-sms/pagination/Interfaces.ts b/clients/client-sms/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sms/pagination/Interfaces.ts rename to clients/client-sms/src/pagination/Interfaces.ts diff --git a/clients/client-sms/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-sms/protocols/Aws_json1_1.ts rename to clients/client-sms/src/protocols/Aws_json1_1.ts diff --git a/clients/client-sms/src/runtimeConfig.browser.ts b/clients/client-sms/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..afb74e3d8ce6 --- /dev/null +++ b/clients/client-sms/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SMSClientConfig } from "./SMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SMSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sms/runtimeConfig.native.ts b/clients/client-sms/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sms/runtimeConfig.native.ts rename to clients/client-sms/src/runtimeConfig.native.ts diff --git a/clients/client-sms/runtimeConfig.shared.ts b/clients/client-sms/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sms/runtimeConfig.shared.ts rename to clients/client-sms/src/runtimeConfig.shared.ts diff --git a/clients/client-sms/src/runtimeConfig.ts b/clients/client-sms/src/runtimeConfig.ts new file mode 100644 index 000000000000..41c3444160e8 --- /dev/null +++ b/clients/client-sms/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SMSClientConfig } from "./SMSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SMSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sms/tsconfig.es.json b/clients/client-sms/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sms/tsconfig.es.json +++ b/clients/client-sms/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sms/tsconfig.json b/clients/client-sms/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sms/tsconfig.json +++ b/clients/client-sms/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sms/tsconfig.types.json b/clients/client-sms/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sms/tsconfig.types.json +++ b/clients/client-sms/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-snow-device-management/.gitignore b/clients/client-snow-device-management/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-snow-device-management/.gitignore +++ b/clients/client-snow-device-management/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-snow-device-management/package.json b/clients/client-snow-device-management/package.json index 1f236618788b..3dc79a0e3987 100644 --- a/clients/client-snow-device-management/package.json +++ b/clients/client-snow-device-management/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-snow-device-management", "repository": { "type": "git", diff --git a/clients/client-snow-device-management/runtimeConfig.browser.ts b/clients/client-snow-device-management/runtimeConfig.browser.ts deleted file mode 100644 index 9a5f85f3c07a..000000000000 --- a/clients/client-snow-device-management/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SnowDeviceManagementClientConfig } from "./SnowDeviceManagementClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-snow-device-management/runtimeConfig.ts b/clients/client-snow-device-management/runtimeConfig.ts deleted file mode 100644 index ac9adb2b12ea..000000000000 --- a/clients/client-snow-device-management/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SnowDeviceManagementClientConfig } from "./SnowDeviceManagementClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-snow-device-management/SnowDeviceManagement.ts b/clients/client-snow-device-management/src/SnowDeviceManagement.ts similarity index 100% rename from clients/client-snow-device-management/SnowDeviceManagement.ts rename to clients/client-snow-device-management/src/SnowDeviceManagement.ts diff --git a/clients/client-snow-device-management/SnowDeviceManagementClient.ts b/clients/client-snow-device-management/src/SnowDeviceManagementClient.ts similarity index 100% rename from clients/client-snow-device-management/SnowDeviceManagementClient.ts rename to clients/client-snow-device-management/src/SnowDeviceManagementClient.ts diff --git a/clients/client-snow-device-management/commands/CancelTaskCommand.ts b/clients/client-snow-device-management/src/commands/CancelTaskCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/CancelTaskCommand.ts rename to clients/client-snow-device-management/src/commands/CancelTaskCommand.ts diff --git a/clients/client-snow-device-management/commands/CreateTaskCommand.ts b/clients/client-snow-device-management/src/commands/CreateTaskCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/CreateTaskCommand.ts rename to clients/client-snow-device-management/src/commands/CreateTaskCommand.ts diff --git a/clients/client-snow-device-management/commands/DescribeDeviceCommand.ts b/clients/client-snow-device-management/src/commands/DescribeDeviceCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/DescribeDeviceCommand.ts rename to clients/client-snow-device-management/src/commands/DescribeDeviceCommand.ts diff --git a/clients/client-snow-device-management/commands/DescribeDeviceEc2InstancesCommand.ts b/clients/client-snow-device-management/src/commands/DescribeDeviceEc2InstancesCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/DescribeDeviceEc2InstancesCommand.ts rename to clients/client-snow-device-management/src/commands/DescribeDeviceEc2InstancesCommand.ts diff --git a/clients/client-snow-device-management/commands/DescribeExecutionCommand.ts b/clients/client-snow-device-management/src/commands/DescribeExecutionCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/DescribeExecutionCommand.ts rename to clients/client-snow-device-management/src/commands/DescribeExecutionCommand.ts diff --git a/clients/client-snow-device-management/commands/DescribeTaskCommand.ts b/clients/client-snow-device-management/src/commands/DescribeTaskCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/DescribeTaskCommand.ts rename to clients/client-snow-device-management/src/commands/DescribeTaskCommand.ts diff --git a/clients/client-snow-device-management/commands/ListDeviceResourcesCommand.ts b/clients/client-snow-device-management/src/commands/ListDeviceResourcesCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/ListDeviceResourcesCommand.ts rename to clients/client-snow-device-management/src/commands/ListDeviceResourcesCommand.ts diff --git a/clients/client-snow-device-management/commands/ListDevicesCommand.ts b/clients/client-snow-device-management/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/ListDevicesCommand.ts rename to clients/client-snow-device-management/src/commands/ListDevicesCommand.ts diff --git a/clients/client-snow-device-management/commands/ListExecutionsCommand.ts b/clients/client-snow-device-management/src/commands/ListExecutionsCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/ListExecutionsCommand.ts rename to clients/client-snow-device-management/src/commands/ListExecutionsCommand.ts diff --git a/clients/client-snow-device-management/commands/ListTagsForResourceCommand.ts b/clients/client-snow-device-management/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/ListTagsForResourceCommand.ts rename to clients/client-snow-device-management/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-snow-device-management/commands/ListTasksCommand.ts b/clients/client-snow-device-management/src/commands/ListTasksCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/ListTasksCommand.ts rename to clients/client-snow-device-management/src/commands/ListTasksCommand.ts diff --git a/clients/client-snow-device-management/commands/TagResourceCommand.ts b/clients/client-snow-device-management/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/TagResourceCommand.ts rename to clients/client-snow-device-management/src/commands/TagResourceCommand.ts diff --git a/clients/client-snow-device-management/commands/UntagResourceCommand.ts b/clients/client-snow-device-management/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-snow-device-management/commands/UntagResourceCommand.ts rename to clients/client-snow-device-management/src/commands/UntagResourceCommand.ts diff --git a/clients/client-snow-device-management/endpoints.ts b/clients/client-snow-device-management/src/endpoints.ts similarity index 100% rename from clients/client-snow-device-management/endpoints.ts rename to clients/client-snow-device-management/src/endpoints.ts diff --git a/clients/client-snow-device-management/index.ts b/clients/client-snow-device-management/src/index.ts similarity index 100% rename from clients/client-snow-device-management/index.ts rename to clients/client-snow-device-management/src/index.ts diff --git a/clients/client-snow-device-management/models/index.ts b/clients/client-snow-device-management/src/models/index.ts similarity index 100% rename from clients/client-snow-device-management/models/index.ts rename to clients/client-snow-device-management/src/models/index.ts diff --git a/clients/client-snow-device-management/models/models_0.ts b/clients/client-snow-device-management/src/models/models_0.ts similarity index 100% rename from clients/client-snow-device-management/models/models_0.ts rename to clients/client-snow-device-management/src/models/models_0.ts diff --git a/clients/client-snow-device-management/pagination/Interfaces.ts b/clients/client-snow-device-management/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-snow-device-management/pagination/Interfaces.ts rename to clients/client-snow-device-management/src/pagination/Interfaces.ts diff --git a/clients/client-snow-device-management/pagination/ListDeviceResourcesPaginator.ts b/clients/client-snow-device-management/src/pagination/ListDeviceResourcesPaginator.ts similarity index 100% rename from clients/client-snow-device-management/pagination/ListDeviceResourcesPaginator.ts rename to clients/client-snow-device-management/src/pagination/ListDeviceResourcesPaginator.ts diff --git a/clients/client-snow-device-management/pagination/ListDevicesPaginator.ts b/clients/client-snow-device-management/src/pagination/ListDevicesPaginator.ts similarity index 100% rename from clients/client-snow-device-management/pagination/ListDevicesPaginator.ts rename to clients/client-snow-device-management/src/pagination/ListDevicesPaginator.ts diff --git a/clients/client-snow-device-management/pagination/ListExecutionsPaginator.ts b/clients/client-snow-device-management/src/pagination/ListExecutionsPaginator.ts similarity index 100% rename from clients/client-snow-device-management/pagination/ListExecutionsPaginator.ts rename to clients/client-snow-device-management/src/pagination/ListExecutionsPaginator.ts diff --git a/clients/client-snow-device-management/pagination/ListTasksPaginator.ts b/clients/client-snow-device-management/src/pagination/ListTasksPaginator.ts similarity index 100% rename from clients/client-snow-device-management/pagination/ListTasksPaginator.ts rename to clients/client-snow-device-management/src/pagination/ListTasksPaginator.ts diff --git a/clients/client-snow-device-management/protocols/Aws_restJson1.ts b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-snow-device-management/protocols/Aws_restJson1.ts rename to clients/client-snow-device-management/src/protocols/Aws_restJson1.ts diff --git a/clients/client-snow-device-management/src/runtimeConfig.browser.ts b/clients/client-snow-device-management/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..9794c5f1794a --- /dev/null +++ b/clients/client-snow-device-management/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SnowDeviceManagementClientConfig } from "./SnowDeviceManagementClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-snow-device-management/runtimeConfig.native.ts b/clients/client-snow-device-management/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-snow-device-management/runtimeConfig.native.ts rename to clients/client-snow-device-management/src/runtimeConfig.native.ts diff --git a/clients/client-snow-device-management/runtimeConfig.shared.ts b/clients/client-snow-device-management/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-snow-device-management/runtimeConfig.shared.ts rename to clients/client-snow-device-management/src/runtimeConfig.shared.ts diff --git a/clients/client-snow-device-management/src/runtimeConfig.ts b/clients/client-snow-device-management/src/runtimeConfig.ts new file mode 100644 index 000000000000..f35f88f85ad8 --- /dev/null +++ b/clients/client-snow-device-management/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SnowDeviceManagementClientConfig } from "./SnowDeviceManagementClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-snow-device-management/tsconfig.es.json b/clients/client-snow-device-management/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-snow-device-management/tsconfig.es.json +++ b/clients/client-snow-device-management/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-snow-device-management/tsconfig.json b/clients/client-snow-device-management/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-snow-device-management/tsconfig.json +++ b/clients/client-snow-device-management/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-snow-device-management/tsconfig.types.json b/clients/client-snow-device-management/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-snow-device-management/tsconfig.types.json +++ b/clients/client-snow-device-management/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-snowball/.gitignore b/clients/client-snowball/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-snowball/.gitignore +++ b/clients/client-snowball/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-snowball/package.json b/clients/client-snowball/package.json index bfccfac2514f..8a60f6f16de9 100644 --- a/clients/client-snowball/package.json +++ b/clients/client-snowball/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-snowball", "repository": { "type": "git", diff --git a/clients/client-snowball/runtimeConfig.browser.ts b/clients/client-snowball/runtimeConfig.browser.ts deleted file mode 100644 index bc3c2c3d6ecf..000000000000 --- a/clients/client-snowball/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SnowballClientConfig } from "./SnowballClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SnowballClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-snowball/runtimeConfig.ts b/clients/client-snowball/runtimeConfig.ts deleted file mode 100644 index cb4b7b562fb2..000000000000 --- a/clients/client-snowball/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SnowballClientConfig } from "./SnowballClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SnowballClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-snowball/Snowball.ts b/clients/client-snowball/src/Snowball.ts similarity index 100% rename from clients/client-snowball/Snowball.ts rename to clients/client-snowball/src/Snowball.ts diff --git a/clients/client-snowball/SnowballClient.ts b/clients/client-snowball/src/SnowballClient.ts similarity index 100% rename from clients/client-snowball/SnowballClient.ts rename to clients/client-snowball/src/SnowballClient.ts diff --git a/clients/client-snowball/commands/CancelClusterCommand.ts b/clients/client-snowball/src/commands/CancelClusterCommand.ts similarity index 100% rename from clients/client-snowball/commands/CancelClusterCommand.ts rename to clients/client-snowball/src/commands/CancelClusterCommand.ts diff --git a/clients/client-snowball/commands/CancelJobCommand.ts b/clients/client-snowball/src/commands/CancelJobCommand.ts similarity index 100% rename from clients/client-snowball/commands/CancelJobCommand.ts rename to clients/client-snowball/src/commands/CancelJobCommand.ts diff --git a/clients/client-snowball/commands/CreateAddressCommand.ts b/clients/client-snowball/src/commands/CreateAddressCommand.ts similarity index 100% rename from clients/client-snowball/commands/CreateAddressCommand.ts rename to clients/client-snowball/src/commands/CreateAddressCommand.ts diff --git a/clients/client-snowball/commands/CreateClusterCommand.ts b/clients/client-snowball/src/commands/CreateClusterCommand.ts similarity index 100% rename from clients/client-snowball/commands/CreateClusterCommand.ts rename to clients/client-snowball/src/commands/CreateClusterCommand.ts diff --git a/clients/client-snowball/commands/CreateJobCommand.ts b/clients/client-snowball/src/commands/CreateJobCommand.ts similarity index 100% rename from clients/client-snowball/commands/CreateJobCommand.ts rename to clients/client-snowball/src/commands/CreateJobCommand.ts diff --git a/clients/client-snowball/commands/CreateLongTermPricingCommand.ts b/clients/client-snowball/src/commands/CreateLongTermPricingCommand.ts similarity index 100% rename from clients/client-snowball/commands/CreateLongTermPricingCommand.ts rename to clients/client-snowball/src/commands/CreateLongTermPricingCommand.ts diff --git a/clients/client-snowball/commands/CreateReturnShippingLabelCommand.ts b/clients/client-snowball/src/commands/CreateReturnShippingLabelCommand.ts similarity index 100% rename from clients/client-snowball/commands/CreateReturnShippingLabelCommand.ts rename to clients/client-snowball/src/commands/CreateReturnShippingLabelCommand.ts diff --git a/clients/client-snowball/commands/DescribeAddressCommand.ts b/clients/client-snowball/src/commands/DescribeAddressCommand.ts similarity index 100% rename from clients/client-snowball/commands/DescribeAddressCommand.ts rename to clients/client-snowball/src/commands/DescribeAddressCommand.ts diff --git a/clients/client-snowball/commands/DescribeAddressesCommand.ts b/clients/client-snowball/src/commands/DescribeAddressesCommand.ts similarity index 100% rename from clients/client-snowball/commands/DescribeAddressesCommand.ts rename to clients/client-snowball/src/commands/DescribeAddressesCommand.ts diff --git a/clients/client-snowball/commands/DescribeClusterCommand.ts b/clients/client-snowball/src/commands/DescribeClusterCommand.ts similarity index 100% rename from clients/client-snowball/commands/DescribeClusterCommand.ts rename to clients/client-snowball/src/commands/DescribeClusterCommand.ts diff --git a/clients/client-snowball/commands/DescribeJobCommand.ts b/clients/client-snowball/src/commands/DescribeJobCommand.ts similarity index 100% rename from clients/client-snowball/commands/DescribeJobCommand.ts rename to clients/client-snowball/src/commands/DescribeJobCommand.ts diff --git a/clients/client-snowball/commands/DescribeReturnShippingLabelCommand.ts b/clients/client-snowball/src/commands/DescribeReturnShippingLabelCommand.ts similarity index 100% rename from clients/client-snowball/commands/DescribeReturnShippingLabelCommand.ts rename to clients/client-snowball/src/commands/DescribeReturnShippingLabelCommand.ts diff --git a/clients/client-snowball/commands/GetJobManifestCommand.ts b/clients/client-snowball/src/commands/GetJobManifestCommand.ts similarity index 100% rename from clients/client-snowball/commands/GetJobManifestCommand.ts rename to clients/client-snowball/src/commands/GetJobManifestCommand.ts diff --git a/clients/client-snowball/commands/GetJobUnlockCodeCommand.ts b/clients/client-snowball/src/commands/GetJobUnlockCodeCommand.ts similarity index 100% rename from clients/client-snowball/commands/GetJobUnlockCodeCommand.ts rename to clients/client-snowball/src/commands/GetJobUnlockCodeCommand.ts diff --git a/clients/client-snowball/commands/GetSnowballUsageCommand.ts b/clients/client-snowball/src/commands/GetSnowballUsageCommand.ts similarity index 100% rename from clients/client-snowball/commands/GetSnowballUsageCommand.ts rename to clients/client-snowball/src/commands/GetSnowballUsageCommand.ts diff --git a/clients/client-snowball/commands/GetSoftwareUpdatesCommand.ts b/clients/client-snowball/src/commands/GetSoftwareUpdatesCommand.ts similarity index 100% rename from clients/client-snowball/commands/GetSoftwareUpdatesCommand.ts rename to clients/client-snowball/src/commands/GetSoftwareUpdatesCommand.ts diff --git a/clients/client-snowball/commands/ListClusterJobsCommand.ts b/clients/client-snowball/src/commands/ListClusterJobsCommand.ts similarity index 100% rename from clients/client-snowball/commands/ListClusterJobsCommand.ts rename to clients/client-snowball/src/commands/ListClusterJobsCommand.ts diff --git a/clients/client-snowball/commands/ListClustersCommand.ts b/clients/client-snowball/src/commands/ListClustersCommand.ts similarity index 100% rename from clients/client-snowball/commands/ListClustersCommand.ts rename to clients/client-snowball/src/commands/ListClustersCommand.ts diff --git a/clients/client-snowball/commands/ListCompatibleImagesCommand.ts b/clients/client-snowball/src/commands/ListCompatibleImagesCommand.ts similarity index 100% rename from clients/client-snowball/commands/ListCompatibleImagesCommand.ts rename to clients/client-snowball/src/commands/ListCompatibleImagesCommand.ts diff --git a/clients/client-snowball/commands/ListJobsCommand.ts b/clients/client-snowball/src/commands/ListJobsCommand.ts similarity index 100% rename from clients/client-snowball/commands/ListJobsCommand.ts rename to clients/client-snowball/src/commands/ListJobsCommand.ts diff --git a/clients/client-snowball/commands/ListLongTermPricingCommand.ts b/clients/client-snowball/src/commands/ListLongTermPricingCommand.ts similarity index 100% rename from clients/client-snowball/commands/ListLongTermPricingCommand.ts rename to clients/client-snowball/src/commands/ListLongTermPricingCommand.ts diff --git a/clients/client-snowball/commands/UpdateClusterCommand.ts b/clients/client-snowball/src/commands/UpdateClusterCommand.ts similarity index 100% rename from clients/client-snowball/commands/UpdateClusterCommand.ts rename to clients/client-snowball/src/commands/UpdateClusterCommand.ts diff --git a/clients/client-snowball/commands/UpdateJobCommand.ts b/clients/client-snowball/src/commands/UpdateJobCommand.ts similarity index 100% rename from clients/client-snowball/commands/UpdateJobCommand.ts rename to clients/client-snowball/src/commands/UpdateJobCommand.ts diff --git a/clients/client-snowball/commands/UpdateJobShipmentStateCommand.ts b/clients/client-snowball/src/commands/UpdateJobShipmentStateCommand.ts similarity index 100% rename from clients/client-snowball/commands/UpdateJobShipmentStateCommand.ts rename to clients/client-snowball/src/commands/UpdateJobShipmentStateCommand.ts diff --git a/clients/client-snowball/commands/UpdateLongTermPricingCommand.ts b/clients/client-snowball/src/commands/UpdateLongTermPricingCommand.ts similarity index 100% rename from clients/client-snowball/commands/UpdateLongTermPricingCommand.ts rename to clients/client-snowball/src/commands/UpdateLongTermPricingCommand.ts diff --git a/clients/client-snowball/endpoints.ts b/clients/client-snowball/src/endpoints.ts similarity index 100% rename from clients/client-snowball/endpoints.ts rename to clients/client-snowball/src/endpoints.ts diff --git a/clients/client-snowball/index.ts b/clients/client-snowball/src/index.ts similarity index 100% rename from clients/client-snowball/index.ts rename to clients/client-snowball/src/index.ts diff --git a/clients/client-snowball/models/index.ts b/clients/client-snowball/src/models/index.ts similarity index 100% rename from clients/client-snowball/models/index.ts rename to clients/client-snowball/src/models/index.ts diff --git a/clients/client-snowball/models/models_0.ts b/clients/client-snowball/src/models/models_0.ts similarity index 100% rename from clients/client-snowball/models/models_0.ts rename to clients/client-snowball/src/models/models_0.ts diff --git a/clients/client-snowball/pagination/DescribeAddressesPaginator.ts b/clients/client-snowball/src/pagination/DescribeAddressesPaginator.ts similarity index 100% rename from clients/client-snowball/pagination/DescribeAddressesPaginator.ts rename to clients/client-snowball/src/pagination/DescribeAddressesPaginator.ts diff --git a/clients/client-snowball/pagination/Interfaces.ts b/clients/client-snowball/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-snowball/pagination/Interfaces.ts rename to clients/client-snowball/src/pagination/Interfaces.ts diff --git a/clients/client-snowball/pagination/ListJobsPaginator.ts b/clients/client-snowball/src/pagination/ListJobsPaginator.ts similarity index 100% rename from clients/client-snowball/pagination/ListJobsPaginator.ts rename to clients/client-snowball/src/pagination/ListJobsPaginator.ts diff --git a/clients/client-snowball/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-snowball/protocols/Aws_json1_1.ts rename to clients/client-snowball/src/protocols/Aws_json1_1.ts diff --git a/clients/client-snowball/src/runtimeConfig.browser.ts b/clients/client-snowball/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bf20358357a0 --- /dev/null +++ b/clients/client-snowball/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SnowballClientConfig } from "./SnowballClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SnowballClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-snowball/runtimeConfig.native.ts b/clients/client-snowball/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-snowball/runtimeConfig.native.ts rename to clients/client-snowball/src/runtimeConfig.native.ts diff --git a/clients/client-snowball/runtimeConfig.shared.ts b/clients/client-snowball/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-snowball/runtimeConfig.shared.ts rename to clients/client-snowball/src/runtimeConfig.shared.ts diff --git a/clients/client-snowball/src/runtimeConfig.ts b/clients/client-snowball/src/runtimeConfig.ts new file mode 100644 index 000000000000..5f12f827a74c --- /dev/null +++ b/clients/client-snowball/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SnowballClientConfig } from "./SnowballClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SnowballClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-snowball/tsconfig.es.json b/clients/client-snowball/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-snowball/tsconfig.es.json +++ b/clients/client-snowball/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-snowball/tsconfig.json b/clients/client-snowball/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-snowball/tsconfig.json +++ b/clients/client-snowball/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-snowball/tsconfig.types.json b/clients/client-snowball/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-snowball/tsconfig.types.json +++ b/clients/client-snowball/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sns/.gitignore b/clients/client-sns/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sns/.gitignore +++ b/clients/client-sns/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sns/package.json b/clients/client-sns/package.json index 80bab8487584..83e40aea6c71 100644 --- a/clients/client-sns/package.json +++ b/clients/client-sns/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sns", "repository": { "type": "git", diff --git a/clients/client-sns/runtimeConfig.browser.ts b/clients/client-sns/runtimeConfig.browser.ts deleted file mode 100644 index 9f75da35e9d2..000000000000 --- a/clients/client-sns/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SNSClientConfig } from "./SNSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SNSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sns/runtimeConfig.ts b/clients/client-sns/runtimeConfig.ts deleted file mode 100644 index 5dfc42134521..000000000000 --- a/clients/client-sns/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SNSClientConfig } from "./SNSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SNSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sns/SNS.ts b/clients/client-sns/src/SNS.ts similarity index 100% rename from clients/client-sns/SNS.ts rename to clients/client-sns/src/SNS.ts diff --git a/clients/client-sns/SNSClient.ts b/clients/client-sns/src/SNSClient.ts similarity index 100% rename from clients/client-sns/SNSClient.ts rename to clients/client-sns/src/SNSClient.ts diff --git a/clients/client-sns/commands/AddPermissionCommand.ts b/clients/client-sns/src/commands/AddPermissionCommand.ts similarity index 100% rename from clients/client-sns/commands/AddPermissionCommand.ts rename to clients/client-sns/src/commands/AddPermissionCommand.ts diff --git a/clients/client-sns/commands/CheckIfPhoneNumberIsOptedOutCommand.ts b/clients/client-sns/src/commands/CheckIfPhoneNumberIsOptedOutCommand.ts similarity index 100% rename from clients/client-sns/commands/CheckIfPhoneNumberIsOptedOutCommand.ts rename to clients/client-sns/src/commands/CheckIfPhoneNumberIsOptedOutCommand.ts diff --git a/clients/client-sns/commands/ConfirmSubscriptionCommand.ts b/clients/client-sns/src/commands/ConfirmSubscriptionCommand.ts similarity index 100% rename from clients/client-sns/commands/ConfirmSubscriptionCommand.ts rename to clients/client-sns/src/commands/ConfirmSubscriptionCommand.ts diff --git a/clients/client-sns/commands/CreatePlatformApplicationCommand.ts b/clients/client-sns/src/commands/CreatePlatformApplicationCommand.ts similarity index 100% rename from clients/client-sns/commands/CreatePlatformApplicationCommand.ts rename to clients/client-sns/src/commands/CreatePlatformApplicationCommand.ts diff --git a/clients/client-sns/commands/CreatePlatformEndpointCommand.ts b/clients/client-sns/src/commands/CreatePlatformEndpointCommand.ts similarity index 100% rename from clients/client-sns/commands/CreatePlatformEndpointCommand.ts rename to clients/client-sns/src/commands/CreatePlatformEndpointCommand.ts diff --git a/clients/client-sns/commands/CreateSMSSandboxPhoneNumberCommand.ts b/clients/client-sns/src/commands/CreateSMSSandboxPhoneNumberCommand.ts similarity index 100% rename from clients/client-sns/commands/CreateSMSSandboxPhoneNumberCommand.ts rename to clients/client-sns/src/commands/CreateSMSSandboxPhoneNumberCommand.ts diff --git a/clients/client-sns/commands/CreateTopicCommand.ts b/clients/client-sns/src/commands/CreateTopicCommand.ts similarity index 100% rename from clients/client-sns/commands/CreateTopicCommand.ts rename to clients/client-sns/src/commands/CreateTopicCommand.ts diff --git a/clients/client-sns/commands/DeleteEndpointCommand.ts b/clients/client-sns/src/commands/DeleteEndpointCommand.ts similarity index 100% rename from clients/client-sns/commands/DeleteEndpointCommand.ts rename to clients/client-sns/src/commands/DeleteEndpointCommand.ts diff --git a/clients/client-sns/commands/DeletePlatformApplicationCommand.ts b/clients/client-sns/src/commands/DeletePlatformApplicationCommand.ts similarity index 100% rename from clients/client-sns/commands/DeletePlatformApplicationCommand.ts rename to clients/client-sns/src/commands/DeletePlatformApplicationCommand.ts diff --git a/clients/client-sns/commands/DeleteSMSSandboxPhoneNumberCommand.ts b/clients/client-sns/src/commands/DeleteSMSSandboxPhoneNumberCommand.ts similarity index 100% rename from clients/client-sns/commands/DeleteSMSSandboxPhoneNumberCommand.ts rename to clients/client-sns/src/commands/DeleteSMSSandboxPhoneNumberCommand.ts diff --git a/clients/client-sns/commands/DeleteTopicCommand.ts b/clients/client-sns/src/commands/DeleteTopicCommand.ts similarity index 100% rename from clients/client-sns/commands/DeleteTopicCommand.ts rename to clients/client-sns/src/commands/DeleteTopicCommand.ts diff --git a/clients/client-sns/commands/GetEndpointAttributesCommand.ts b/clients/client-sns/src/commands/GetEndpointAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/GetEndpointAttributesCommand.ts rename to clients/client-sns/src/commands/GetEndpointAttributesCommand.ts diff --git a/clients/client-sns/commands/GetPlatformApplicationAttributesCommand.ts b/clients/client-sns/src/commands/GetPlatformApplicationAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/GetPlatformApplicationAttributesCommand.ts rename to clients/client-sns/src/commands/GetPlatformApplicationAttributesCommand.ts diff --git a/clients/client-sns/commands/GetSMSAttributesCommand.ts b/clients/client-sns/src/commands/GetSMSAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/GetSMSAttributesCommand.ts rename to clients/client-sns/src/commands/GetSMSAttributesCommand.ts diff --git a/clients/client-sns/commands/GetSMSSandboxAccountStatusCommand.ts b/clients/client-sns/src/commands/GetSMSSandboxAccountStatusCommand.ts similarity index 100% rename from clients/client-sns/commands/GetSMSSandboxAccountStatusCommand.ts rename to clients/client-sns/src/commands/GetSMSSandboxAccountStatusCommand.ts diff --git a/clients/client-sns/commands/GetSubscriptionAttributesCommand.ts b/clients/client-sns/src/commands/GetSubscriptionAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/GetSubscriptionAttributesCommand.ts rename to clients/client-sns/src/commands/GetSubscriptionAttributesCommand.ts diff --git a/clients/client-sns/commands/GetTopicAttributesCommand.ts b/clients/client-sns/src/commands/GetTopicAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/GetTopicAttributesCommand.ts rename to clients/client-sns/src/commands/GetTopicAttributesCommand.ts diff --git a/clients/client-sns/commands/ListEndpointsByPlatformApplicationCommand.ts b/clients/client-sns/src/commands/ListEndpointsByPlatformApplicationCommand.ts similarity index 100% rename from clients/client-sns/commands/ListEndpointsByPlatformApplicationCommand.ts rename to clients/client-sns/src/commands/ListEndpointsByPlatformApplicationCommand.ts diff --git a/clients/client-sns/commands/ListOriginationNumbersCommand.ts b/clients/client-sns/src/commands/ListOriginationNumbersCommand.ts similarity index 100% rename from clients/client-sns/commands/ListOriginationNumbersCommand.ts rename to clients/client-sns/src/commands/ListOriginationNumbersCommand.ts diff --git a/clients/client-sns/commands/ListPhoneNumbersOptedOutCommand.ts b/clients/client-sns/src/commands/ListPhoneNumbersOptedOutCommand.ts similarity index 100% rename from clients/client-sns/commands/ListPhoneNumbersOptedOutCommand.ts rename to clients/client-sns/src/commands/ListPhoneNumbersOptedOutCommand.ts diff --git a/clients/client-sns/commands/ListPlatformApplicationsCommand.ts b/clients/client-sns/src/commands/ListPlatformApplicationsCommand.ts similarity index 100% rename from clients/client-sns/commands/ListPlatformApplicationsCommand.ts rename to clients/client-sns/src/commands/ListPlatformApplicationsCommand.ts diff --git a/clients/client-sns/commands/ListSMSSandboxPhoneNumbersCommand.ts b/clients/client-sns/src/commands/ListSMSSandboxPhoneNumbersCommand.ts similarity index 100% rename from clients/client-sns/commands/ListSMSSandboxPhoneNumbersCommand.ts rename to clients/client-sns/src/commands/ListSMSSandboxPhoneNumbersCommand.ts diff --git a/clients/client-sns/commands/ListSubscriptionsByTopicCommand.ts b/clients/client-sns/src/commands/ListSubscriptionsByTopicCommand.ts similarity index 100% rename from clients/client-sns/commands/ListSubscriptionsByTopicCommand.ts rename to clients/client-sns/src/commands/ListSubscriptionsByTopicCommand.ts diff --git a/clients/client-sns/commands/ListSubscriptionsCommand.ts b/clients/client-sns/src/commands/ListSubscriptionsCommand.ts similarity index 100% rename from clients/client-sns/commands/ListSubscriptionsCommand.ts rename to clients/client-sns/src/commands/ListSubscriptionsCommand.ts diff --git a/clients/client-sns/commands/ListTagsForResourceCommand.ts b/clients/client-sns/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-sns/commands/ListTagsForResourceCommand.ts rename to clients/client-sns/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-sns/commands/ListTopicsCommand.ts b/clients/client-sns/src/commands/ListTopicsCommand.ts similarity index 100% rename from clients/client-sns/commands/ListTopicsCommand.ts rename to clients/client-sns/src/commands/ListTopicsCommand.ts diff --git a/clients/client-sns/commands/OptInPhoneNumberCommand.ts b/clients/client-sns/src/commands/OptInPhoneNumberCommand.ts similarity index 100% rename from clients/client-sns/commands/OptInPhoneNumberCommand.ts rename to clients/client-sns/src/commands/OptInPhoneNumberCommand.ts diff --git a/clients/client-sns/commands/PublishCommand.ts b/clients/client-sns/src/commands/PublishCommand.ts similarity index 100% rename from clients/client-sns/commands/PublishCommand.ts rename to clients/client-sns/src/commands/PublishCommand.ts diff --git a/clients/client-sns/commands/RemovePermissionCommand.ts b/clients/client-sns/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-sns/commands/RemovePermissionCommand.ts rename to clients/client-sns/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-sns/commands/SetEndpointAttributesCommand.ts b/clients/client-sns/src/commands/SetEndpointAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/SetEndpointAttributesCommand.ts rename to clients/client-sns/src/commands/SetEndpointAttributesCommand.ts diff --git a/clients/client-sns/commands/SetPlatformApplicationAttributesCommand.ts b/clients/client-sns/src/commands/SetPlatformApplicationAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/SetPlatformApplicationAttributesCommand.ts rename to clients/client-sns/src/commands/SetPlatformApplicationAttributesCommand.ts diff --git a/clients/client-sns/commands/SetSMSAttributesCommand.ts b/clients/client-sns/src/commands/SetSMSAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/SetSMSAttributesCommand.ts rename to clients/client-sns/src/commands/SetSMSAttributesCommand.ts diff --git a/clients/client-sns/commands/SetSubscriptionAttributesCommand.ts b/clients/client-sns/src/commands/SetSubscriptionAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/SetSubscriptionAttributesCommand.ts rename to clients/client-sns/src/commands/SetSubscriptionAttributesCommand.ts diff --git a/clients/client-sns/commands/SetTopicAttributesCommand.ts b/clients/client-sns/src/commands/SetTopicAttributesCommand.ts similarity index 100% rename from clients/client-sns/commands/SetTopicAttributesCommand.ts rename to clients/client-sns/src/commands/SetTopicAttributesCommand.ts diff --git a/clients/client-sns/commands/SubscribeCommand.ts b/clients/client-sns/src/commands/SubscribeCommand.ts similarity index 100% rename from clients/client-sns/commands/SubscribeCommand.ts rename to clients/client-sns/src/commands/SubscribeCommand.ts diff --git a/clients/client-sns/commands/TagResourceCommand.ts b/clients/client-sns/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-sns/commands/TagResourceCommand.ts rename to clients/client-sns/src/commands/TagResourceCommand.ts diff --git a/clients/client-sns/commands/UnsubscribeCommand.ts b/clients/client-sns/src/commands/UnsubscribeCommand.ts similarity index 100% rename from clients/client-sns/commands/UnsubscribeCommand.ts rename to clients/client-sns/src/commands/UnsubscribeCommand.ts diff --git a/clients/client-sns/commands/UntagResourceCommand.ts b/clients/client-sns/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-sns/commands/UntagResourceCommand.ts rename to clients/client-sns/src/commands/UntagResourceCommand.ts diff --git a/clients/client-sns/commands/VerifySMSSandboxPhoneNumberCommand.ts b/clients/client-sns/src/commands/VerifySMSSandboxPhoneNumberCommand.ts similarity index 100% rename from clients/client-sns/commands/VerifySMSSandboxPhoneNumberCommand.ts rename to clients/client-sns/src/commands/VerifySMSSandboxPhoneNumberCommand.ts diff --git a/clients/client-sns/endpoints.ts b/clients/client-sns/src/endpoints.ts similarity index 100% rename from clients/client-sns/endpoints.ts rename to clients/client-sns/src/endpoints.ts diff --git a/clients/client-sns/index.ts b/clients/client-sns/src/index.ts similarity index 100% rename from clients/client-sns/index.ts rename to clients/client-sns/src/index.ts diff --git a/clients/client-sns/models/index.ts b/clients/client-sns/src/models/index.ts similarity index 100% rename from clients/client-sns/models/index.ts rename to clients/client-sns/src/models/index.ts diff --git a/clients/client-sns/models/models_0.ts b/clients/client-sns/src/models/models_0.ts similarity index 100% rename from clients/client-sns/models/models_0.ts rename to clients/client-sns/src/models/models_0.ts diff --git a/clients/client-sns/pagination/Interfaces.ts b/clients/client-sns/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sns/pagination/Interfaces.ts rename to clients/client-sns/src/pagination/Interfaces.ts diff --git a/clients/client-sns/pagination/ListEndpointsByPlatformApplicationPaginator.ts b/clients/client-sns/src/pagination/ListEndpointsByPlatformApplicationPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListEndpointsByPlatformApplicationPaginator.ts rename to clients/client-sns/src/pagination/ListEndpointsByPlatformApplicationPaginator.ts diff --git a/clients/client-sns/pagination/ListOriginationNumbersPaginator.ts b/clients/client-sns/src/pagination/ListOriginationNumbersPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListOriginationNumbersPaginator.ts rename to clients/client-sns/src/pagination/ListOriginationNumbersPaginator.ts diff --git a/clients/client-sns/pagination/ListPhoneNumbersOptedOutPaginator.ts b/clients/client-sns/src/pagination/ListPhoneNumbersOptedOutPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListPhoneNumbersOptedOutPaginator.ts rename to clients/client-sns/src/pagination/ListPhoneNumbersOptedOutPaginator.ts diff --git a/clients/client-sns/pagination/ListPlatformApplicationsPaginator.ts b/clients/client-sns/src/pagination/ListPlatformApplicationsPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListPlatformApplicationsPaginator.ts rename to clients/client-sns/src/pagination/ListPlatformApplicationsPaginator.ts diff --git a/clients/client-sns/pagination/ListSMSSandboxPhoneNumbersPaginator.ts b/clients/client-sns/src/pagination/ListSMSSandboxPhoneNumbersPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListSMSSandboxPhoneNumbersPaginator.ts rename to clients/client-sns/src/pagination/ListSMSSandboxPhoneNumbersPaginator.ts diff --git a/clients/client-sns/pagination/ListSubscriptionsByTopicPaginator.ts b/clients/client-sns/src/pagination/ListSubscriptionsByTopicPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListSubscriptionsByTopicPaginator.ts rename to clients/client-sns/src/pagination/ListSubscriptionsByTopicPaginator.ts diff --git a/clients/client-sns/pagination/ListSubscriptionsPaginator.ts b/clients/client-sns/src/pagination/ListSubscriptionsPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListSubscriptionsPaginator.ts rename to clients/client-sns/src/pagination/ListSubscriptionsPaginator.ts diff --git a/clients/client-sns/pagination/ListTopicsPaginator.ts b/clients/client-sns/src/pagination/ListTopicsPaginator.ts similarity index 100% rename from clients/client-sns/pagination/ListTopicsPaginator.ts rename to clients/client-sns/src/pagination/ListTopicsPaginator.ts diff --git a/clients/client-sns/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-sns/protocols/Aws_query.ts rename to clients/client-sns/src/protocols/Aws_query.ts diff --git a/clients/client-sns/src/runtimeConfig.browser.ts b/clients/client-sns/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..ac227ddba053 --- /dev/null +++ b/clients/client-sns/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SNSClientConfig } from "./SNSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SNSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sns/runtimeConfig.native.ts b/clients/client-sns/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sns/runtimeConfig.native.ts rename to clients/client-sns/src/runtimeConfig.native.ts diff --git a/clients/client-sns/runtimeConfig.shared.ts b/clients/client-sns/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sns/runtimeConfig.shared.ts rename to clients/client-sns/src/runtimeConfig.shared.ts diff --git a/clients/client-sns/src/runtimeConfig.ts b/clients/client-sns/src/runtimeConfig.ts new file mode 100644 index 000000000000..b3c264d0542c --- /dev/null +++ b/clients/client-sns/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SNSClientConfig } from "./SNSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SNSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sns/tsconfig.es.json b/clients/client-sns/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sns/tsconfig.es.json +++ b/clients/client-sns/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sns/tsconfig.json b/clients/client-sns/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sns/tsconfig.json +++ b/clients/client-sns/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sns/tsconfig.types.json b/clients/client-sns/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sns/tsconfig.types.json +++ b/clients/client-sns/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sqs/.gitignore b/clients/client-sqs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sqs/.gitignore +++ b/clients/client-sqs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sqs/package.json b/clients/client-sqs/package.json index e22ac882fb32..9f46d579b7a0 100644 --- a/clients/client-sqs/package.json +++ b/clients/client-sqs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sqs", "repository": { "type": "git", diff --git a/clients/client-sqs/runtimeConfig.browser.ts b/clients/client-sqs/runtimeConfig.browser.ts deleted file mode 100644 index 315c9dd3c1ff..000000000000 --- a/clients/client-sqs/runtimeConfig.browser.ts +++ /dev/null @@ -1,42 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { Md5 } from "@aws-sdk/md5-js"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SQSClientConfig } from "./SQSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SQSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - md5: config?.md5 ?? Md5, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sqs/runtimeConfig.ts b/clients/client-sqs/runtimeConfig.ts deleted file mode 100644 index da89d3cb83c3..000000000000 --- a/clients/client-sqs/runtimeConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SQSClientConfig } from "./SQSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SQSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sqs/SQS.ts b/clients/client-sqs/src/SQS.ts similarity index 100% rename from clients/client-sqs/SQS.ts rename to clients/client-sqs/src/SQS.ts diff --git a/clients/client-sqs/SQSClient.ts b/clients/client-sqs/src/SQSClient.ts similarity index 100% rename from clients/client-sqs/SQSClient.ts rename to clients/client-sqs/src/SQSClient.ts diff --git a/clients/client-sqs/commands/AddPermissionCommand.ts b/clients/client-sqs/src/commands/AddPermissionCommand.ts similarity index 100% rename from clients/client-sqs/commands/AddPermissionCommand.ts rename to clients/client-sqs/src/commands/AddPermissionCommand.ts diff --git a/clients/client-sqs/commands/ChangeMessageVisibilityBatchCommand.ts b/clients/client-sqs/src/commands/ChangeMessageVisibilityBatchCommand.ts similarity index 100% rename from clients/client-sqs/commands/ChangeMessageVisibilityBatchCommand.ts rename to clients/client-sqs/src/commands/ChangeMessageVisibilityBatchCommand.ts diff --git a/clients/client-sqs/commands/ChangeMessageVisibilityCommand.ts b/clients/client-sqs/src/commands/ChangeMessageVisibilityCommand.ts similarity index 100% rename from clients/client-sqs/commands/ChangeMessageVisibilityCommand.ts rename to clients/client-sqs/src/commands/ChangeMessageVisibilityCommand.ts diff --git a/clients/client-sqs/commands/CreateQueueCommand.ts b/clients/client-sqs/src/commands/CreateQueueCommand.ts similarity index 100% rename from clients/client-sqs/commands/CreateQueueCommand.ts rename to clients/client-sqs/src/commands/CreateQueueCommand.ts diff --git a/clients/client-sqs/commands/DeleteMessageBatchCommand.ts b/clients/client-sqs/src/commands/DeleteMessageBatchCommand.ts similarity index 100% rename from clients/client-sqs/commands/DeleteMessageBatchCommand.ts rename to clients/client-sqs/src/commands/DeleteMessageBatchCommand.ts diff --git a/clients/client-sqs/commands/DeleteMessageCommand.ts b/clients/client-sqs/src/commands/DeleteMessageCommand.ts similarity index 100% rename from clients/client-sqs/commands/DeleteMessageCommand.ts rename to clients/client-sqs/src/commands/DeleteMessageCommand.ts diff --git a/clients/client-sqs/commands/DeleteQueueCommand.ts b/clients/client-sqs/src/commands/DeleteQueueCommand.ts similarity index 100% rename from clients/client-sqs/commands/DeleteQueueCommand.ts rename to clients/client-sqs/src/commands/DeleteQueueCommand.ts diff --git a/clients/client-sqs/commands/GetQueueAttributesCommand.ts b/clients/client-sqs/src/commands/GetQueueAttributesCommand.ts similarity index 100% rename from clients/client-sqs/commands/GetQueueAttributesCommand.ts rename to clients/client-sqs/src/commands/GetQueueAttributesCommand.ts diff --git a/clients/client-sqs/commands/GetQueueUrlCommand.ts b/clients/client-sqs/src/commands/GetQueueUrlCommand.ts similarity index 100% rename from clients/client-sqs/commands/GetQueueUrlCommand.ts rename to clients/client-sqs/src/commands/GetQueueUrlCommand.ts diff --git a/clients/client-sqs/commands/ListDeadLetterSourceQueuesCommand.ts b/clients/client-sqs/src/commands/ListDeadLetterSourceQueuesCommand.ts similarity index 100% rename from clients/client-sqs/commands/ListDeadLetterSourceQueuesCommand.ts rename to clients/client-sqs/src/commands/ListDeadLetterSourceQueuesCommand.ts diff --git a/clients/client-sqs/commands/ListQueueTagsCommand.ts b/clients/client-sqs/src/commands/ListQueueTagsCommand.ts similarity index 100% rename from clients/client-sqs/commands/ListQueueTagsCommand.ts rename to clients/client-sqs/src/commands/ListQueueTagsCommand.ts diff --git a/clients/client-sqs/commands/ListQueuesCommand.ts b/clients/client-sqs/src/commands/ListQueuesCommand.ts similarity index 100% rename from clients/client-sqs/commands/ListQueuesCommand.ts rename to clients/client-sqs/src/commands/ListQueuesCommand.ts diff --git a/clients/client-sqs/commands/PurgeQueueCommand.ts b/clients/client-sqs/src/commands/PurgeQueueCommand.ts similarity index 100% rename from clients/client-sqs/commands/PurgeQueueCommand.ts rename to clients/client-sqs/src/commands/PurgeQueueCommand.ts diff --git a/clients/client-sqs/commands/ReceiveMessageCommand.ts b/clients/client-sqs/src/commands/ReceiveMessageCommand.ts similarity index 100% rename from clients/client-sqs/commands/ReceiveMessageCommand.ts rename to clients/client-sqs/src/commands/ReceiveMessageCommand.ts diff --git a/clients/client-sqs/commands/RemovePermissionCommand.ts b/clients/client-sqs/src/commands/RemovePermissionCommand.ts similarity index 100% rename from clients/client-sqs/commands/RemovePermissionCommand.ts rename to clients/client-sqs/src/commands/RemovePermissionCommand.ts diff --git a/clients/client-sqs/commands/SendMessageBatchCommand.ts b/clients/client-sqs/src/commands/SendMessageBatchCommand.ts similarity index 100% rename from clients/client-sqs/commands/SendMessageBatchCommand.ts rename to clients/client-sqs/src/commands/SendMessageBatchCommand.ts diff --git a/clients/client-sqs/commands/SendMessageCommand.ts b/clients/client-sqs/src/commands/SendMessageCommand.ts similarity index 100% rename from clients/client-sqs/commands/SendMessageCommand.ts rename to clients/client-sqs/src/commands/SendMessageCommand.ts diff --git a/clients/client-sqs/commands/SetQueueAttributesCommand.ts b/clients/client-sqs/src/commands/SetQueueAttributesCommand.ts similarity index 100% rename from clients/client-sqs/commands/SetQueueAttributesCommand.ts rename to clients/client-sqs/src/commands/SetQueueAttributesCommand.ts diff --git a/clients/client-sqs/commands/TagQueueCommand.ts b/clients/client-sqs/src/commands/TagQueueCommand.ts similarity index 100% rename from clients/client-sqs/commands/TagQueueCommand.ts rename to clients/client-sqs/src/commands/TagQueueCommand.ts diff --git a/clients/client-sqs/commands/UntagQueueCommand.ts b/clients/client-sqs/src/commands/UntagQueueCommand.ts similarity index 100% rename from clients/client-sqs/commands/UntagQueueCommand.ts rename to clients/client-sqs/src/commands/UntagQueueCommand.ts diff --git a/clients/client-sqs/endpoints.ts b/clients/client-sqs/src/endpoints.ts similarity index 100% rename from clients/client-sqs/endpoints.ts rename to clients/client-sqs/src/endpoints.ts diff --git a/clients/client-sqs/index.ts b/clients/client-sqs/src/index.ts similarity index 100% rename from clients/client-sqs/index.ts rename to clients/client-sqs/src/index.ts diff --git a/clients/client-sqs/models/index.ts b/clients/client-sqs/src/models/index.ts similarity index 100% rename from clients/client-sqs/models/index.ts rename to clients/client-sqs/src/models/index.ts diff --git a/clients/client-sqs/models/models_0.ts b/clients/client-sqs/src/models/models_0.ts similarity index 100% rename from clients/client-sqs/models/models_0.ts rename to clients/client-sqs/src/models/models_0.ts diff --git a/clients/client-sqs/pagination/Interfaces.ts b/clients/client-sqs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sqs/pagination/Interfaces.ts rename to clients/client-sqs/src/pagination/Interfaces.ts diff --git a/clients/client-sqs/pagination/ListDeadLetterSourceQueuesPaginator.ts b/clients/client-sqs/src/pagination/ListDeadLetterSourceQueuesPaginator.ts similarity index 100% rename from clients/client-sqs/pagination/ListDeadLetterSourceQueuesPaginator.ts rename to clients/client-sqs/src/pagination/ListDeadLetterSourceQueuesPaginator.ts diff --git a/clients/client-sqs/pagination/ListQueuesPaginator.ts b/clients/client-sqs/src/pagination/ListQueuesPaginator.ts similarity index 100% rename from clients/client-sqs/pagination/ListQueuesPaginator.ts rename to clients/client-sqs/src/pagination/ListQueuesPaginator.ts diff --git a/clients/client-sqs/protocols/Aws_query.ts b/clients/client-sqs/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-sqs/protocols/Aws_query.ts rename to clients/client-sqs/src/protocols/Aws_query.ts diff --git a/clients/client-sqs/src/runtimeConfig.browser.ts b/clients/client-sqs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..226addb34f0c --- /dev/null +++ b/clients/client-sqs/src/runtimeConfig.browser.ts @@ -0,0 +1,43 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { Md5 } from "@aws-sdk/md5-js"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SQSClientConfig } from "./SQSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SQSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sqs/runtimeConfig.native.ts b/clients/client-sqs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sqs/runtimeConfig.native.ts rename to clients/client-sqs/src/runtimeConfig.native.ts diff --git a/clients/client-sqs/runtimeConfig.shared.ts b/clients/client-sqs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sqs/runtimeConfig.shared.ts rename to clients/client-sqs/src/runtimeConfig.shared.ts diff --git a/clients/client-sqs/src/runtimeConfig.ts b/clients/client-sqs/src/runtimeConfig.ts new file mode 100644 index 000000000000..153cd007b6ec --- /dev/null +++ b/clients/client-sqs/src/runtimeConfig.ts @@ -0,0 +1,48 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SQSClientConfig } from "./SQSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SQSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + md5: config?.md5 ?? Hash.bind(null, "md5"), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sqs/tsconfig.es.json b/clients/client-sqs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sqs/tsconfig.es.json +++ b/clients/client-sqs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sqs/tsconfig.json b/clients/client-sqs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sqs/tsconfig.json +++ b/clients/client-sqs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sqs/tsconfig.types.json b/clients/client-sqs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sqs/tsconfig.types.json +++ b/clients/client-sqs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ssm-contacts/.gitignore b/clients/client-ssm-contacts/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-ssm-contacts/.gitignore +++ b/clients/client-ssm-contacts/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ssm-contacts/package.json b/clients/client-ssm-contacts/package.json index 0600eb0017d4..6dd05dfe1022 100644 --- a/clients/client-ssm-contacts/package.json +++ b/clients/client-ssm-contacts/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ssm-contacts", "repository": { "type": "git", diff --git a/clients/client-ssm-contacts/runtimeConfig.browser.ts b/clients/client-ssm-contacts/runtimeConfig.browser.ts deleted file mode 100644 index 6a04c115e8cf..000000000000 --- a/clients/client-ssm-contacts/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSMContactsClientConfig } from "./SSMContactsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMContactsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm-contacts/runtimeConfig.ts b/clients/client-ssm-contacts/runtimeConfig.ts deleted file mode 100644 index 45c225c888d8..000000000000 --- a/clients/client-ssm-contacts/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSMContactsClientConfig } from "./SSMContactsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMContactsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm-contacts/SSMContacts.ts b/clients/client-ssm-contacts/src/SSMContacts.ts similarity index 100% rename from clients/client-ssm-contacts/SSMContacts.ts rename to clients/client-ssm-contacts/src/SSMContacts.ts diff --git a/clients/client-ssm-contacts/SSMContactsClient.ts b/clients/client-ssm-contacts/src/SSMContactsClient.ts similarity index 100% rename from clients/client-ssm-contacts/SSMContactsClient.ts rename to clients/client-ssm-contacts/src/SSMContactsClient.ts diff --git a/clients/client-ssm-contacts/commands/AcceptPageCommand.ts b/clients/client-ssm-contacts/src/commands/AcceptPageCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/AcceptPageCommand.ts rename to clients/client-ssm-contacts/src/commands/AcceptPageCommand.ts diff --git a/clients/client-ssm-contacts/commands/ActivateContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/ActivateContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ActivateContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/ActivateContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/CreateContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/CreateContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/CreateContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/CreateContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/CreateContactCommand.ts b/clients/client-ssm-contacts/src/commands/CreateContactCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/CreateContactCommand.ts rename to clients/client-ssm-contacts/src/commands/CreateContactCommand.ts diff --git a/clients/client-ssm-contacts/commands/DeactivateContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/DeactivateContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/DeactivateContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/DeactivateContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/DeleteContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/DeleteContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/DeleteContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/DeleteContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/DeleteContactCommand.ts b/clients/client-ssm-contacts/src/commands/DeleteContactCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/DeleteContactCommand.ts rename to clients/client-ssm-contacts/src/commands/DeleteContactCommand.ts diff --git a/clients/client-ssm-contacts/commands/DescribeEngagementCommand.ts b/clients/client-ssm-contacts/src/commands/DescribeEngagementCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/DescribeEngagementCommand.ts rename to clients/client-ssm-contacts/src/commands/DescribeEngagementCommand.ts diff --git a/clients/client-ssm-contacts/commands/DescribePageCommand.ts b/clients/client-ssm-contacts/src/commands/DescribePageCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/DescribePageCommand.ts rename to clients/client-ssm-contacts/src/commands/DescribePageCommand.ts diff --git a/clients/client-ssm-contacts/commands/GetContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/GetContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/GetContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/GetContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/GetContactCommand.ts b/clients/client-ssm-contacts/src/commands/GetContactCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/GetContactCommand.ts rename to clients/client-ssm-contacts/src/commands/GetContactCommand.ts diff --git a/clients/client-ssm-contacts/commands/GetContactPolicyCommand.ts b/clients/client-ssm-contacts/src/commands/GetContactPolicyCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/GetContactPolicyCommand.ts rename to clients/client-ssm-contacts/src/commands/GetContactPolicyCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListContactChannelsCommand.ts b/clients/client-ssm-contacts/src/commands/ListContactChannelsCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListContactChannelsCommand.ts rename to clients/client-ssm-contacts/src/commands/ListContactChannelsCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListContactsCommand.ts b/clients/client-ssm-contacts/src/commands/ListContactsCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListContactsCommand.ts rename to clients/client-ssm-contacts/src/commands/ListContactsCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListEngagementsCommand.ts b/clients/client-ssm-contacts/src/commands/ListEngagementsCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListEngagementsCommand.ts rename to clients/client-ssm-contacts/src/commands/ListEngagementsCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListPageReceiptsCommand.ts b/clients/client-ssm-contacts/src/commands/ListPageReceiptsCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListPageReceiptsCommand.ts rename to clients/client-ssm-contacts/src/commands/ListPageReceiptsCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListPagesByContactCommand.ts b/clients/client-ssm-contacts/src/commands/ListPagesByContactCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListPagesByContactCommand.ts rename to clients/client-ssm-contacts/src/commands/ListPagesByContactCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListPagesByEngagementCommand.ts b/clients/client-ssm-contacts/src/commands/ListPagesByEngagementCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListPagesByEngagementCommand.ts rename to clients/client-ssm-contacts/src/commands/ListPagesByEngagementCommand.ts diff --git a/clients/client-ssm-contacts/commands/ListTagsForResourceCommand.ts b/clients/client-ssm-contacts/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/ListTagsForResourceCommand.ts rename to clients/client-ssm-contacts/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ssm-contacts/commands/PutContactPolicyCommand.ts b/clients/client-ssm-contacts/src/commands/PutContactPolicyCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/PutContactPolicyCommand.ts rename to clients/client-ssm-contacts/src/commands/PutContactPolicyCommand.ts diff --git a/clients/client-ssm-contacts/commands/SendActivationCodeCommand.ts b/clients/client-ssm-contacts/src/commands/SendActivationCodeCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/SendActivationCodeCommand.ts rename to clients/client-ssm-contacts/src/commands/SendActivationCodeCommand.ts diff --git a/clients/client-ssm-contacts/commands/StartEngagementCommand.ts b/clients/client-ssm-contacts/src/commands/StartEngagementCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/StartEngagementCommand.ts rename to clients/client-ssm-contacts/src/commands/StartEngagementCommand.ts diff --git a/clients/client-ssm-contacts/commands/StopEngagementCommand.ts b/clients/client-ssm-contacts/src/commands/StopEngagementCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/StopEngagementCommand.ts rename to clients/client-ssm-contacts/src/commands/StopEngagementCommand.ts diff --git a/clients/client-ssm-contacts/commands/TagResourceCommand.ts b/clients/client-ssm-contacts/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/TagResourceCommand.ts rename to clients/client-ssm-contacts/src/commands/TagResourceCommand.ts diff --git a/clients/client-ssm-contacts/commands/UntagResourceCommand.ts b/clients/client-ssm-contacts/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/UntagResourceCommand.ts rename to clients/client-ssm-contacts/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ssm-contacts/commands/UpdateContactChannelCommand.ts b/clients/client-ssm-contacts/src/commands/UpdateContactChannelCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/UpdateContactChannelCommand.ts rename to clients/client-ssm-contacts/src/commands/UpdateContactChannelCommand.ts diff --git a/clients/client-ssm-contacts/commands/UpdateContactCommand.ts b/clients/client-ssm-contacts/src/commands/UpdateContactCommand.ts similarity index 100% rename from clients/client-ssm-contacts/commands/UpdateContactCommand.ts rename to clients/client-ssm-contacts/src/commands/UpdateContactCommand.ts diff --git a/clients/client-ssm-contacts/endpoints.ts b/clients/client-ssm-contacts/src/endpoints.ts similarity index 100% rename from clients/client-ssm-contacts/endpoints.ts rename to clients/client-ssm-contacts/src/endpoints.ts diff --git a/clients/client-ssm-contacts/index.ts b/clients/client-ssm-contacts/src/index.ts similarity index 100% rename from clients/client-ssm-contacts/index.ts rename to clients/client-ssm-contacts/src/index.ts diff --git a/clients/client-ssm-contacts/models/index.ts b/clients/client-ssm-contacts/src/models/index.ts similarity index 100% rename from clients/client-ssm-contacts/models/index.ts rename to clients/client-ssm-contacts/src/models/index.ts diff --git a/clients/client-ssm-contacts/models/models_0.ts b/clients/client-ssm-contacts/src/models/models_0.ts similarity index 100% rename from clients/client-ssm-contacts/models/models_0.ts rename to clients/client-ssm-contacts/src/models/models_0.ts diff --git a/clients/client-ssm-contacts/pagination/Interfaces.ts b/clients/client-ssm-contacts/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/Interfaces.ts rename to clients/client-ssm-contacts/src/pagination/Interfaces.ts diff --git a/clients/client-ssm-contacts/pagination/ListContactChannelsPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListContactChannelsPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListContactChannelsPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListContactChannelsPaginator.ts diff --git a/clients/client-ssm-contacts/pagination/ListContactsPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListContactsPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListContactsPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListContactsPaginator.ts diff --git a/clients/client-ssm-contacts/pagination/ListEngagementsPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListEngagementsPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListEngagementsPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListEngagementsPaginator.ts diff --git a/clients/client-ssm-contacts/pagination/ListPageReceiptsPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListPageReceiptsPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListPageReceiptsPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListPageReceiptsPaginator.ts diff --git a/clients/client-ssm-contacts/pagination/ListPagesByContactPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListPagesByContactPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListPagesByContactPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListPagesByContactPaginator.ts diff --git a/clients/client-ssm-contacts/pagination/ListPagesByEngagementPaginator.ts b/clients/client-ssm-contacts/src/pagination/ListPagesByEngagementPaginator.ts similarity index 100% rename from clients/client-ssm-contacts/pagination/ListPagesByEngagementPaginator.ts rename to clients/client-ssm-contacts/src/pagination/ListPagesByEngagementPaginator.ts diff --git a/clients/client-ssm-contacts/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ssm-contacts/protocols/Aws_json1_1.ts rename to clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ssm-contacts/src/runtimeConfig.browser.ts b/clients/client-ssm-contacts/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3d2cef7abb06 --- /dev/null +++ b/clients/client-ssm-contacts/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSMContactsClientConfig } from "./SSMContactsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMContactsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm-contacts/runtimeConfig.native.ts b/clients/client-ssm-contacts/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ssm-contacts/runtimeConfig.native.ts rename to clients/client-ssm-contacts/src/runtimeConfig.native.ts diff --git a/clients/client-ssm-contacts/runtimeConfig.shared.ts b/clients/client-ssm-contacts/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ssm-contacts/runtimeConfig.shared.ts rename to clients/client-ssm-contacts/src/runtimeConfig.shared.ts diff --git a/clients/client-ssm-contacts/src/runtimeConfig.ts b/clients/client-ssm-contacts/src/runtimeConfig.ts new file mode 100644 index 000000000000..acfbdf80cec7 --- /dev/null +++ b/clients/client-ssm-contacts/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSMContactsClientConfig } from "./SSMContactsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMContactsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm-contacts/tsconfig.es.json b/clients/client-ssm-contacts/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ssm-contacts/tsconfig.es.json +++ b/clients/client-ssm-contacts/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ssm-contacts/tsconfig.json b/clients/client-ssm-contacts/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ssm-contacts/tsconfig.json +++ b/clients/client-ssm-contacts/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ssm-contacts/tsconfig.types.json b/clients/client-ssm-contacts/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ssm-contacts/tsconfig.types.json +++ b/clients/client-ssm-contacts/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ssm-incidents/.gitignore b/clients/client-ssm-incidents/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-ssm-incidents/.gitignore +++ b/clients/client-ssm-incidents/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ssm-incidents/package.json b/clients/client-ssm-incidents/package.json index c51e88e4e992..cd0cf10907bd 100644 --- a/clients/client-ssm-incidents/package.json +++ b/clients/client-ssm-incidents/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ssm-incidents", "repository": { "type": "git", diff --git a/clients/client-ssm-incidents/runtimeConfig.browser.ts b/clients/client-ssm-incidents/runtimeConfig.browser.ts deleted file mode 100644 index 98a6613181e4..000000000000 --- a/clients/client-ssm-incidents/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSMIncidentsClientConfig } from "./SSMIncidentsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm-incidents/runtimeConfig.ts b/clients/client-ssm-incidents/runtimeConfig.ts deleted file mode 100644 index e290b6c2f7a7..000000000000 --- a/clients/client-ssm-incidents/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSMIncidentsClientConfig } from "./SSMIncidentsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm-incidents/SSMIncidents.ts b/clients/client-ssm-incidents/src/SSMIncidents.ts similarity index 100% rename from clients/client-ssm-incidents/SSMIncidents.ts rename to clients/client-ssm-incidents/src/SSMIncidents.ts diff --git a/clients/client-ssm-incidents/SSMIncidentsClient.ts b/clients/client-ssm-incidents/src/SSMIncidentsClient.ts similarity index 100% rename from clients/client-ssm-incidents/SSMIncidentsClient.ts rename to clients/client-ssm-incidents/src/SSMIncidentsClient.ts diff --git a/clients/client-ssm-incidents/commands/CreateReplicationSetCommand.ts b/clients/client-ssm-incidents/src/commands/CreateReplicationSetCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/CreateReplicationSetCommand.ts rename to clients/client-ssm-incidents/src/commands/CreateReplicationSetCommand.ts diff --git a/clients/client-ssm-incidents/commands/CreateResponsePlanCommand.ts b/clients/client-ssm-incidents/src/commands/CreateResponsePlanCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/CreateResponsePlanCommand.ts rename to clients/client-ssm-incidents/src/commands/CreateResponsePlanCommand.ts diff --git a/clients/client-ssm-incidents/commands/CreateTimelineEventCommand.ts b/clients/client-ssm-incidents/src/commands/CreateTimelineEventCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/CreateTimelineEventCommand.ts rename to clients/client-ssm-incidents/src/commands/CreateTimelineEventCommand.ts diff --git a/clients/client-ssm-incidents/commands/DeleteIncidentRecordCommand.ts b/clients/client-ssm-incidents/src/commands/DeleteIncidentRecordCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/DeleteIncidentRecordCommand.ts rename to clients/client-ssm-incidents/src/commands/DeleteIncidentRecordCommand.ts diff --git a/clients/client-ssm-incidents/commands/DeleteReplicationSetCommand.ts b/clients/client-ssm-incidents/src/commands/DeleteReplicationSetCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/DeleteReplicationSetCommand.ts rename to clients/client-ssm-incidents/src/commands/DeleteReplicationSetCommand.ts diff --git a/clients/client-ssm-incidents/commands/DeleteResourcePolicyCommand.ts b/clients/client-ssm-incidents/src/commands/DeleteResourcePolicyCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/DeleteResourcePolicyCommand.ts rename to clients/client-ssm-incidents/src/commands/DeleteResourcePolicyCommand.ts diff --git a/clients/client-ssm-incidents/commands/DeleteResponsePlanCommand.ts b/clients/client-ssm-incidents/src/commands/DeleteResponsePlanCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/DeleteResponsePlanCommand.ts rename to clients/client-ssm-incidents/src/commands/DeleteResponsePlanCommand.ts diff --git a/clients/client-ssm-incidents/commands/DeleteTimelineEventCommand.ts b/clients/client-ssm-incidents/src/commands/DeleteTimelineEventCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/DeleteTimelineEventCommand.ts rename to clients/client-ssm-incidents/src/commands/DeleteTimelineEventCommand.ts diff --git a/clients/client-ssm-incidents/commands/GetIncidentRecordCommand.ts b/clients/client-ssm-incidents/src/commands/GetIncidentRecordCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/GetIncidentRecordCommand.ts rename to clients/client-ssm-incidents/src/commands/GetIncidentRecordCommand.ts diff --git a/clients/client-ssm-incidents/commands/GetReplicationSetCommand.ts b/clients/client-ssm-incidents/src/commands/GetReplicationSetCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/GetReplicationSetCommand.ts rename to clients/client-ssm-incidents/src/commands/GetReplicationSetCommand.ts diff --git a/clients/client-ssm-incidents/commands/GetResourcePoliciesCommand.ts b/clients/client-ssm-incidents/src/commands/GetResourcePoliciesCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/GetResourcePoliciesCommand.ts rename to clients/client-ssm-incidents/src/commands/GetResourcePoliciesCommand.ts diff --git a/clients/client-ssm-incidents/commands/GetResponsePlanCommand.ts b/clients/client-ssm-incidents/src/commands/GetResponsePlanCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/GetResponsePlanCommand.ts rename to clients/client-ssm-incidents/src/commands/GetResponsePlanCommand.ts diff --git a/clients/client-ssm-incidents/commands/GetTimelineEventCommand.ts b/clients/client-ssm-incidents/src/commands/GetTimelineEventCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/GetTimelineEventCommand.ts rename to clients/client-ssm-incidents/src/commands/GetTimelineEventCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListIncidentRecordsCommand.ts b/clients/client-ssm-incidents/src/commands/ListIncidentRecordsCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListIncidentRecordsCommand.ts rename to clients/client-ssm-incidents/src/commands/ListIncidentRecordsCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListRelatedItemsCommand.ts b/clients/client-ssm-incidents/src/commands/ListRelatedItemsCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListRelatedItemsCommand.ts rename to clients/client-ssm-incidents/src/commands/ListRelatedItemsCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListReplicationSetsCommand.ts b/clients/client-ssm-incidents/src/commands/ListReplicationSetsCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListReplicationSetsCommand.ts rename to clients/client-ssm-incidents/src/commands/ListReplicationSetsCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListResponsePlansCommand.ts b/clients/client-ssm-incidents/src/commands/ListResponsePlansCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListResponsePlansCommand.ts rename to clients/client-ssm-incidents/src/commands/ListResponsePlansCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListTagsForResourceCommand.ts b/clients/client-ssm-incidents/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListTagsForResourceCommand.ts rename to clients/client-ssm-incidents/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ssm-incidents/commands/ListTimelineEventsCommand.ts b/clients/client-ssm-incidents/src/commands/ListTimelineEventsCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/ListTimelineEventsCommand.ts rename to clients/client-ssm-incidents/src/commands/ListTimelineEventsCommand.ts diff --git a/clients/client-ssm-incidents/commands/PutResourcePolicyCommand.ts b/clients/client-ssm-incidents/src/commands/PutResourcePolicyCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/PutResourcePolicyCommand.ts rename to clients/client-ssm-incidents/src/commands/PutResourcePolicyCommand.ts diff --git a/clients/client-ssm-incidents/commands/StartIncidentCommand.ts b/clients/client-ssm-incidents/src/commands/StartIncidentCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/StartIncidentCommand.ts rename to clients/client-ssm-incidents/src/commands/StartIncidentCommand.ts diff --git a/clients/client-ssm-incidents/commands/TagResourceCommand.ts b/clients/client-ssm-incidents/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/TagResourceCommand.ts rename to clients/client-ssm-incidents/src/commands/TagResourceCommand.ts diff --git a/clients/client-ssm-incidents/commands/UntagResourceCommand.ts b/clients/client-ssm-incidents/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UntagResourceCommand.ts rename to clients/client-ssm-incidents/src/commands/UntagResourceCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateDeletionProtectionCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateDeletionProtectionCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateDeletionProtectionCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateDeletionProtectionCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateIncidentRecordCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateIncidentRecordCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateIncidentRecordCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateIncidentRecordCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateRelatedItemsCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateRelatedItemsCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateRelatedItemsCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateRelatedItemsCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateReplicationSetCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateReplicationSetCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateReplicationSetCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateReplicationSetCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateResponsePlanCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateResponsePlanCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateResponsePlanCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateResponsePlanCommand.ts diff --git a/clients/client-ssm-incidents/commands/UpdateTimelineEventCommand.ts b/clients/client-ssm-incidents/src/commands/UpdateTimelineEventCommand.ts similarity index 100% rename from clients/client-ssm-incidents/commands/UpdateTimelineEventCommand.ts rename to clients/client-ssm-incidents/src/commands/UpdateTimelineEventCommand.ts diff --git a/clients/client-ssm-incidents/endpoints.ts b/clients/client-ssm-incidents/src/endpoints.ts similarity index 100% rename from clients/client-ssm-incidents/endpoints.ts rename to clients/client-ssm-incidents/src/endpoints.ts diff --git a/clients/client-ssm-incidents/index.ts b/clients/client-ssm-incidents/src/index.ts similarity index 100% rename from clients/client-ssm-incidents/index.ts rename to clients/client-ssm-incidents/src/index.ts diff --git a/clients/client-ssm-incidents/models/index.ts b/clients/client-ssm-incidents/src/models/index.ts similarity index 100% rename from clients/client-ssm-incidents/models/index.ts rename to clients/client-ssm-incidents/src/models/index.ts diff --git a/clients/client-ssm-incidents/models/models_0.ts b/clients/client-ssm-incidents/src/models/models_0.ts similarity index 100% rename from clients/client-ssm-incidents/models/models_0.ts rename to clients/client-ssm-incidents/src/models/models_0.ts diff --git a/clients/client-ssm-incidents/pagination/GetResourcePoliciesPaginator.ts b/clients/client-ssm-incidents/src/pagination/GetResourcePoliciesPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/GetResourcePoliciesPaginator.ts rename to clients/client-ssm-incidents/src/pagination/GetResourcePoliciesPaginator.ts diff --git a/clients/client-ssm-incidents/pagination/Interfaces.ts b/clients/client-ssm-incidents/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/Interfaces.ts rename to clients/client-ssm-incidents/src/pagination/Interfaces.ts diff --git a/clients/client-ssm-incidents/pagination/ListIncidentRecordsPaginator.ts b/clients/client-ssm-incidents/src/pagination/ListIncidentRecordsPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/ListIncidentRecordsPaginator.ts rename to clients/client-ssm-incidents/src/pagination/ListIncidentRecordsPaginator.ts diff --git a/clients/client-ssm-incidents/pagination/ListRelatedItemsPaginator.ts b/clients/client-ssm-incidents/src/pagination/ListRelatedItemsPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/ListRelatedItemsPaginator.ts rename to clients/client-ssm-incidents/src/pagination/ListRelatedItemsPaginator.ts diff --git a/clients/client-ssm-incidents/pagination/ListReplicationSetsPaginator.ts b/clients/client-ssm-incidents/src/pagination/ListReplicationSetsPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/ListReplicationSetsPaginator.ts rename to clients/client-ssm-incidents/src/pagination/ListReplicationSetsPaginator.ts diff --git a/clients/client-ssm-incidents/pagination/ListResponsePlansPaginator.ts b/clients/client-ssm-incidents/src/pagination/ListResponsePlansPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/ListResponsePlansPaginator.ts rename to clients/client-ssm-incidents/src/pagination/ListResponsePlansPaginator.ts diff --git a/clients/client-ssm-incidents/pagination/ListTimelineEventsPaginator.ts b/clients/client-ssm-incidents/src/pagination/ListTimelineEventsPaginator.ts similarity index 100% rename from clients/client-ssm-incidents/pagination/ListTimelineEventsPaginator.ts rename to clients/client-ssm-incidents/src/pagination/ListTimelineEventsPaginator.ts diff --git a/clients/client-ssm-incidents/protocols/Aws_restJson1.ts b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-ssm-incidents/protocols/Aws_restJson1.ts rename to clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts diff --git a/clients/client-ssm-incidents/src/runtimeConfig.browser.ts b/clients/client-ssm-incidents/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..e4046d0a8d3c --- /dev/null +++ b/clients/client-ssm-incidents/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSMIncidentsClientConfig } from "./SSMIncidentsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm-incidents/runtimeConfig.native.ts b/clients/client-ssm-incidents/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ssm-incidents/runtimeConfig.native.ts rename to clients/client-ssm-incidents/src/runtimeConfig.native.ts diff --git a/clients/client-ssm-incidents/runtimeConfig.shared.ts b/clients/client-ssm-incidents/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ssm-incidents/runtimeConfig.shared.ts rename to clients/client-ssm-incidents/src/runtimeConfig.shared.ts diff --git a/clients/client-ssm-incidents/src/runtimeConfig.ts b/clients/client-ssm-incidents/src/runtimeConfig.ts new file mode 100644 index 000000000000..641a3738a03e --- /dev/null +++ b/clients/client-ssm-incidents/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSMIncidentsClientConfig } from "./SSMIncidentsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm-incidents/waiters/waitForWaitForReplicationSetActive.ts b/clients/client-ssm-incidents/src/waiters/waitForWaitForReplicationSetActive.ts similarity index 100% rename from clients/client-ssm-incidents/waiters/waitForWaitForReplicationSetActive.ts rename to clients/client-ssm-incidents/src/waiters/waitForWaitForReplicationSetActive.ts diff --git a/clients/client-ssm-incidents/waiters/waitForWaitForReplicationSetDeleted.ts b/clients/client-ssm-incidents/src/waiters/waitForWaitForReplicationSetDeleted.ts similarity index 100% rename from clients/client-ssm-incidents/waiters/waitForWaitForReplicationSetDeleted.ts rename to clients/client-ssm-incidents/src/waiters/waitForWaitForReplicationSetDeleted.ts diff --git a/clients/client-ssm-incidents/tsconfig.es.json b/clients/client-ssm-incidents/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ssm-incidents/tsconfig.es.json +++ b/clients/client-ssm-incidents/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ssm-incidents/tsconfig.json b/clients/client-ssm-incidents/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ssm-incidents/tsconfig.json +++ b/clients/client-ssm-incidents/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ssm-incidents/tsconfig.types.json b/clients/client-ssm-incidents/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ssm-incidents/tsconfig.types.json +++ b/clients/client-ssm-incidents/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-ssm/.gitignore b/clients/client-ssm/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-ssm/.gitignore +++ b/clients/client-ssm/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-ssm/package.json b/clients/client-ssm/package.json index 91872cb18b9a..36015c5d5ded 100644 --- a/clients/client-ssm/package.json +++ b/clients/client-ssm/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ssm", "repository": { "type": "git", diff --git a/clients/client-ssm/runtimeConfig.browser.ts b/clients/client-ssm/runtimeConfig.browser.ts deleted file mode 100644 index 417953b0f0e1..000000000000 --- a/clients/client-ssm/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSMClientConfig } from "./SSMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm/runtimeConfig.ts b/clients/client-ssm/runtimeConfig.ts deleted file mode 100644 index 67f79da3851b..000000000000 --- a/clients/client-ssm/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSMClientConfig } from "./SSMClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSMClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-ssm/SSM.ts b/clients/client-ssm/src/SSM.ts similarity index 100% rename from clients/client-ssm/SSM.ts rename to clients/client-ssm/src/SSM.ts diff --git a/clients/client-ssm/SSMClient.ts b/clients/client-ssm/src/SSMClient.ts similarity index 100% rename from clients/client-ssm/SSMClient.ts rename to clients/client-ssm/src/SSMClient.ts diff --git a/clients/client-ssm/commands/AddTagsToResourceCommand.ts b/clients/client-ssm/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-ssm/commands/AddTagsToResourceCommand.ts rename to clients/client-ssm/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-ssm/commands/AssociateOpsItemRelatedItemCommand.ts b/clients/client-ssm/src/commands/AssociateOpsItemRelatedItemCommand.ts similarity index 100% rename from clients/client-ssm/commands/AssociateOpsItemRelatedItemCommand.ts rename to clients/client-ssm/src/commands/AssociateOpsItemRelatedItemCommand.ts diff --git a/clients/client-ssm/commands/CancelCommandCommand.ts b/clients/client-ssm/src/commands/CancelCommandCommand.ts similarity index 100% rename from clients/client-ssm/commands/CancelCommandCommand.ts rename to clients/client-ssm/src/commands/CancelCommandCommand.ts diff --git a/clients/client-ssm/commands/CancelMaintenanceWindowExecutionCommand.ts b/clients/client-ssm/src/commands/CancelMaintenanceWindowExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/CancelMaintenanceWindowExecutionCommand.ts rename to clients/client-ssm/src/commands/CancelMaintenanceWindowExecutionCommand.ts diff --git a/clients/client-ssm/commands/CreateActivationCommand.ts b/clients/client-ssm/src/commands/CreateActivationCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateActivationCommand.ts rename to clients/client-ssm/src/commands/CreateActivationCommand.ts diff --git a/clients/client-ssm/commands/CreateAssociationBatchCommand.ts b/clients/client-ssm/src/commands/CreateAssociationBatchCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateAssociationBatchCommand.ts rename to clients/client-ssm/src/commands/CreateAssociationBatchCommand.ts diff --git a/clients/client-ssm/commands/CreateAssociationCommand.ts b/clients/client-ssm/src/commands/CreateAssociationCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateAssociationCommand.ts rename to clients/client-ssm/src/commands/CreateAssociationCommand.ts diff --git a/clients/client-ssm/commands/CreateDocumentCommand.ts b/clients/client-ssm/src/commands/CreateDocumentCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateDocumentCommand.ts rename to clients/client-ssm/src/commands/CreateDocumentCommand.ts diff --git a/clients/client-ssm/commands/CreateMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/CreateMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/CreateMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/CreateOpsItemCommand.ts b/clients/client-ssm/src/commands/CreateOpsItemCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateOpsItemCommand.ts rename to clients/client-ssm/src/commands/CreateOpsItemCommand.ts diff --git a/clients/client-ssm/commands/CreateOpsMetadataCommand.ts b/clients/client-ssm/src/commands/CreateOpsMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateOpsMetadataCommand.ts rename to clients/client-ssm/src/commands/CreateOpsMetadataCommand.ts diff --git a/clients/client-ssm/commands/CreatePatchBaselineCommand.ts b/clients/client-ssm/src/commands/CreatePatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreatePatchBaselineCommand.ts rename to clients/client-ssm/src/commands/CreatePatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/CreateResourceDataSyncCommand.ts b/clients/client-ssm/src/commands/CreateResourceDataSyncCommand.ts similarity index 100% rename from clients/client-ssm/commands/CreateResourceDataSyncCommand.ts rename to clients/client-ssm/src/commands/CreateResourceDataSyncCommand.ts diff --git a/clients/client-ssm/commands/DeleteActivationCommand.ts b/clients/client-ssm/src/commands/DeleteActivationCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteActivationCommand.ts rename to clients/client-ssm/src/commands/DeleteActivationCommand.ts diff --git a/clients/client-ssm/commands/DeleteAssociationCommand.ts b/clients/client-ssm/src/commands/DeleteAssociationCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteAssociationCommand.ts rename to clients/client-ssm/src/commands/DeleteAssociationCommand.ts diff --git a/clients/client-ssm/commands/DeleteDocumentCommand.ts b/clients/client-ssm/src/commands/DeleteDocumentCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteDocumentCommand.ts rename to clients/client-ssm/src/commands/DeleteDocumentCommand.ts diff --git a/clients/client-ssm/commands/DeleteInventoryCommand.ts b/clients/client-ssm/src/commands/DeleteInventoryCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteInventoryCommand.ts rename to clients/client-ssm/src/commands/DeleteInventoryCommand.ts diff --git a/clients/client-ssm/commands/DeleteMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/DeleteMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/DeleteMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/DeleteOpsMetadataCommand.ts b/clients/client-ssm/src/commands/DeleteOpsMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteOpsMetadataCommand.ts rename to clients/client-ssm/src/commands/DeleteOpsMetadataCommand.ts diff --git a/clients/client-ssm/commands/DeleteParameterCommand.ts b/clients/client-ssm/src/commands/DeleteParameterCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteParameterCommand.ts rename to clients/client-ssm/src/commands/DeleteParameterCommand.ts diff --git a/clients/client-ssm/commands/DeleteParametersCommand.ts b/clients/client-ssm/src/commands/DeleteParametersCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteParametersCommand.ts rename to clients/client-ssm/src/commands/DeleteParametersCommand.ts diff --git a/clients/client-ssm/commands/DeletePatchBaselineCommand.ts b/clients/client-ssm/src/commands/DeletePatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeletePatchBaselineCommand.ts rename to clients/client-ssm/src/commands/DeletePatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/DeleteResourceDataSyncCommand.ts b/clients/client-ssm/src/commands/DeleteResourceDataSyncCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeleteResourceDataSyncCommand.ts rename to clients/client-ssm/src/commands/DeleteResourceDataSyncCommand.ts diff --git a/clients/client-ssm/commands/DeregisterManagedInstanceCommand.ts b/clients/client-ssm/src/commands/DeregisterManagedInstanceCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeregisterManagedInstanceCommand.ts rename to clients/client-ssm/src/commands/DeregisterManagedInstanceCommand.ts diff --git a/clients/client-ssm/commands/DeregisterPatchBaselineForPatchGroupCommand.ts b/clients/client-ssm/src/commands/DeregisterPatchBaselineForPatchGroupCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeregisterPatchBaselineForPatchGroupCommand.ts rename to clients/client-ssm/src/commands/DeregisterPatchBaselineForPatchGroupCommand.ts diff --git a/clients/client-ssm/commands/DeregisterTargetFromMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/DeregisterTargetFromMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeregisterTargetFromMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/DeregisterTargetFromMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/DeregisterTaskFromMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/DeregisterTaskFromMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/DeregisterTaskFromMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/DeregisterTaskFromMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/DescribeActivationsCommand.ts b/clients/client-ssm/src/commands/DescribeActivationsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeActivationsCommand.ts rename to clients/client-ssm/src/commands/DescribeActivationsCommand.ts diff --git a/clients/client-ssm/commands/DescribeAssociationCommand.ts b/clients/client-ssm/src/commands/DescribeAssociationCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAssociationCommand.ts rename to clients/client-ssm/src/commands/DescribeAssociationCommand.ts diff --git a/clients/client-ssm/commands/DescribeAssociationExecutionTargetsCommand.ts b/clients/client-ssm/src/commands/DescribeAssociationExecutionTargetsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAssociationExecutionTargetsCommand.ts rename to clients/client-ssm/src/commands/DescribeAssociationExecutionTargetsCommand.ts diff --git a/clients/client-ssm/commands/DescribeAssociationExecutionsCommand.ts b/clients/client-ssm/src/commands/DescribeAssociationExecutionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAssociationExecutionsCommand.ts rename to clients/client-ssm/src/commands/DescribeAssociationExecutionsCommand.ts diff --git a/clients/client-ssm/commands/DescribeAutomationExecutionsCommand.ts b/clients/client-ssm/src/commands/DescribeAutomationExecutionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAutomationExecutionsCommand.ts rename to clients/client-ssm/src/commands/DescribeAutomationExecutionsCommand.ts diff --git a/clients/client-ssm/commands/DescribeAutomationStepExecutionsCommand.ts b/clients/client-ssm/src/commands/DescribeAutomationStepExecutionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAutomationStepExecutionsCommand.ts rename to clients/client-ssm/src/commands/DescribeAutomationStepExecutionsCommand.ts diff --git a/clients/client-ssm/commands/DescribeAvailablePatchesCommand.ts b/clients/client-ssm/src/commands/DescribeAvailablePatchesCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeAvailablePatchesCommand.ts rename to clients/client-ssm/src/commands/DescribeAvailablePatchesCommand.ts diff --git a/clients/client-ssm/commands/DescribeDocumentCommand.ts b/clients/client-ssm/src/commands/DescribeDocumentCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeDocumentCommand.ts rename to clients/client-ssm/src/commands/DescribeDocumentCommand.ts diff --git a/clients/client-ssm/commands/DescribeDocumentPermissionCommand.ts b/clients/client-ssm/src/commands/DescribeDocumentPermissionCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeDocumentPermissionCommand.ts rename to clients/client-ssm/src/commands/DescribeDocumentPermissionCommand.ts diff --git a/clients/client-ssm/commands/DescribeEffectiveInstanceAssociationsCommand.ts b/clients/client-ssm/src/commands/DescribeEffectiveInstanceAssociationsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeEffectiveInstanceAssociationsCommand.ts rename to clients/client-ssm/src/commands/DescribeEffectiveInstanceAssociationsCommand.ts diff --git a/clients/client-ssm/commands/DescribeEffectivePatchesForPatchBaselineCommand.ts b/clients/client-ssm/src/commands/DescribeEffectivePatchesForPatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeEffectivePatchesForPatchBaselineCommand.ts rename to clients/client-ssm/src/commands/DescribeEffectivePatchesForPatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/DescribeInstanceAssociationsStatusCommand.ts b/clients/client-ssm/src/commands/DescribeInstanceAssociationsStatusCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInstanceAssociationsStatusCommand.ts rename to clients/client-ssm/src/commands/DescribeInstanceAssociationsStatusCommand.ts diff --git a/clients/client-ssm/commands/DescribeInstanceInformationCommand.ts b/clients/client-ssm/src/commands/DescribeInstanceInformationCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInstanceInformationCommand.ts rename to clients/client-ssm/src/commands/DescribeInstanceInformationCommand.ts diff --git a/clients/client-ssm/commands/DescribeInstancePatchStatesCommand.ts b/clients/client-ssm/src/commands/DescribeInstancePatchStatesCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInstancePatchStatesCommand.ts rename to clients/client-ssm/src/commands/DescribeInstancePatchStatesCommand.ts diff --git a/clients/client-ssm/commands/DescribeInstancePatchStatesForPatchGroupCommand.ts b/clients/client-ssm/src/commands/DescribeInstancePatchStatesForPatchGroupCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInstancePatchStatesForPatchGroupCommand.ts rename to clients/client-ssm/src/commands/DescribeInstancePatchStatesForPatchGroupCommand.ts diff --git a/clients/client-ssm/commands/DescribeInstancePatchesCommand.ts b/clients/client-ssm/src/commands/DescribeInstancePatchesCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInstancePatchesCommand.ts rename to clients/client-ssm/src/commands/DescribeInstancePatchesCommand.ts diff --git a/clients/client-ssm/commands/DescribeInventoryDeletionsCommand.ts b/clients/client-ssm/src/commands/DescribeInventoryDeletionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeInventoryDeletionsCommand.ts rename to clients/client-ssm/src/commands/DescribeInventoryDeletionsCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowExecutionTaskInvocationsCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionTaskInvocationsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowExecutionTaskInvocationsCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionTaskInvocationsCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowExecutionTasksCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionTasksCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowExecutionTasksCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionTasksCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowExecutionsCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowExecutionsCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowExecutionsCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowScheduleCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowScheduleCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowScheduleCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowScheduleCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowTargetsCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowTargetsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowTargetsCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowTargetsCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowTasksCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowTasksCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowTasksCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowTasksCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowsCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowsCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowsCommand.ts diff --git a/clients/client-ssm/commands/DescribeMaintenanceWindowsForTargetCommand.ts b/clients/client-ssm/src/commands/DescribeMaintenanceWindowsForTargetCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeMaintenanceWindowsForTargetCommand.ts rename to clients/client-ssm/src/commands/DescribeMaintenanceWindowsForTargetCommand.ts diff --git a/clients/client-ssm/commands/DescribeOpsItemsCommand.ts b/clients/client-ssm/src/commands/DescribeOpsItemsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeOpsItemsCommand.ts rename to clients/client-ssm/src/commands/DescribeOpsItemsCommand.ts diff --git a/clients/client-ssm/commands/DescribeParametersCommand.ts b/clients/client-ssm/src/commands/DescribeParametersCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeParametersCommand.ts rename to clients/client-ssm/src/commands/DescribeParametersCommand.ts diff --git a/clients/client-ssm/commands/DescribePatchBaselinesCommand.ts b/clients/client-ssm/src/commands/DescribePatchBaselinesCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribePatchBaselinesCommand.ts rename to clients/client-ssm/src/commands/DescribePatchBaselinesCommand.ts diff --git a/clients/client-ssm/commands/DescribePatchGroupStateCommand.ts b/clients/client-ssm/src/commands/DescribePatchGroupStateCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribePatchGroupStateCommand.ts rename to clients/client-ssm/src/commands/DescribePatchGroupStateCommand.ts diff --git a/clients/client-ssm/commands/DescribePatchGroupsCommand.ts b/clients/client-ssm/src/commands/DescribePatchGroupsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribePatchGroupsCommand.ts rename to clients/client-ssm/src/commands/DescribePatchGroupsCommand.ts diff --git a/clients/client-ssm/commands/DescribePatchPropertiesCommand.ts b/clients/client-ssm/src/commands/DescribePatchPropertiesCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribePatchPropertiesCommand.ts rename to clients/client-ssm/src/commands/DescribePatchPropertiesCommand.ts diff --git a/clients/client-ssm/commands/DescribeSessionsCommand.ts b/clients/client-ssm/src/commands/DescribeSessionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/DescribeSessionsCommand.ts rename to clients/client-ssm/src/commands/DescribeSessionsCommand.ts diff --git a/clients/client-ssm/commands/DisassociateOpsItemRelatedItemCommand.ts b/clients/client-ssm/src/commands/DisassociateOpsItemRelatedItemCommand.ts similarity index 100% rename from clients/client-ssm/commands/DisassociateOpsItemRelatedItemCommand.ts rename to clients/client-ssm/src/commands/DisassociateOpsItemRelatedItemCommand.ts diff --git a/clients/client-ssm/commands/GetAutomationExecutionCommand.ts b/clients/client-ssm/src/commands/GetAutomationExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetAutomationExecutionCommand.ts rename to clients/client-ssm/src/commands/GetAutomationExecutionCommand.ts diff --git a/clients/client-ssm/commands/GetCalendarStateCommand.ts b/clients/client-ssm/src/commands/GetCalendarStateCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetCalendarStateCommand.ts rename to clients/client-ssm/src/commands/GetCalendarStateCommand.ts diff --git a/clients/client-ssm/commands/GetCommandInvocationCommand.ts b/clients/client-ssm/src/commands/GetCommandInvocationCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetCommandInvocationCommand.ts rename to clients/client-ssm/src/commands/GetCommandInvocationCommand.ts diff --git a/clients/client-ssm/commands/GetConnectionStatusCommand.ts b/clients/client-ssm/src/commands/GetConnectionStatusCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetConnectionStatusCommand.ts rename to clients/client-ssm/src/commands/GetConnectionStatusCommand.ts diff --git a/clients/client-ssm/commands/GetDefaultPatchBaselineCommand.ts b/clients/client-ssm/src/commands/GetDefaultPatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetDefaultPatchBaselineCommand.ts rename to clients/client-ssm/src/commands/GetDefaultPatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/GetDeployablePatchSnapshotForInstanceCommand.ts b/clients/client-ssm/src/commands/GetDeployablePatchSnapshotForInstanceCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetDeployablePatchSnapshotForInstanceCommand.ts rename to clients/client-ssm/src/commands/GetDeployablePatchSnapshotForInstanceCommand.ts diff --git a/clients/client-ssm/commands/GetDocumentCommand.ts b/clients/client-ssm/src/commands/GetDocumentCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetDocumentCommand.ts rename to clients/client-ssm/src/commands/GetDocumentCommand.ts diff --git a/clients/client-ssm/commands/GetInventoryCommand.ts b/clients/client-ssm/src/commands/GetInventoryCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetInventoryCommand.ts rename to clients/client-ssm/src/commands/GetInventoryCommand.ts diff --git a/clients/client-ssm/commands/GetInventorySchemaCommand.ts b/clients/client-ssm/src/commands/GetInventorySchemaCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetInventorySchemaCommand.ts rename to clients/client-ssm/src/commands/GetInventorySchemaCommand.ts diff --git a/clients/client-ssm/commands/GetMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/GetMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/GetMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/GetMaintenanceWindowExecutionCommand.ts b/clients/client-ssm/src/commands/GetMaintenanceWindowExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetMaintenanceWindowExecutionCommand.ts rename to clients/client-ssm/src/commands/GetMaintenanceWindowExecutionCommand.ts diff --git a/clients/client-ssm/commands/GetMaintenanceWindowExecutionTaskCommand.ts b/clients/client-ssm/src/commands/GetMaintenanceWindowExecutionTaskCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetMaintenanceWindowExecutionTaskCommand.ts rename to clients/client-ssm/src/commands/GetMaintenanceWindowExecutionTaskCommand.ts diff --git a/clients/client-ssm/commands/GetMaintenanceWindowExecutionTaskInvocationCommand.ts b/clients/client-ssm/src/commands/GetMaintenanceWindowExecutionTaskInvocationCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetMaintenanceWindowExecutionTaskInvocationCommand.ts rename to clients/client-ssm/src/commands/GetMaintenanceWindowExecutionTaskInvocationCommand.ts diff --git a/clients/client-ssm/commands/GetMaintenanceWindowTaskCommand.ts b/clients/client-ssm/src/commands/GetMaintenanceWindowTaskCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetMaintenanceWindowTaskCommand.ts rename to clients/client-ssm/src/commands/GetMaintenanceWindowTaskCommand.ts diff --git a/clients/client-ssm/commands/GetOpsItemCommand.ts b/clients/client-ssm/src/commands/GetOpsItemCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetOpsItemCommand.ts rename to clients/client-ssm/src/commands/GetOpsItemCommand.ts diff --git a/clients/client-ssm/commands/GetOpsMetadataCommand.ts b/clients/client-ssm/src/commands/GetOpsMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetOpsMetadataCommand.ts rename to clients/client-ssm/src/commands/GetOpsMetadataCommand.ts diff --git a/clients/client-ssm/commands/GetOpsSummaryCommand.ts b/clients/client-ssm/src/commands/GetOpsSummaryCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetOpsSummaryCommand.ts rename to clients/client-ssm/src/commands/GetOpsSummaryCommand.ts diff --git a/clients/client-ssm/commands/GetParameterCommand.ts b/clients/client-ssm/src/commands/GetParameterCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetParameterCommand.ts rename to clients/client-ssm/src/commands/GetParameterCommand.ts diff --git a/clients/client-ssm/commands/GetParameterHistoryCommand.ts b/clients/client-ssm/src/commands/GetParameterHistoryCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetParameterHistoryCommand.ts rename to clients/client-ssm/src/commands/GetParameterHistoryCommand.ts diff --git a/clients/client-ssm/commands/GetParametersByPathCommand.ts b/clients/client-ssm/src/commands/GetParametersByPathCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetParametersByPathCommand.ts rename to clients/client-ssm/src/commands/GetParametersByPathCommand.ts diff --git a/clients/client-ssm/commands/GetParametersCommand.ts b/clients/client-ssm/src/commands/GetParametersCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetParametersCommand.ts rename to clients/client-ssm/src/commands/GetParametersCommand.ts diff --git a/clients/client-ssm/commands/GetPatchBaselineCommand.ts b/clients/client-ssm/src/commands/GetPatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetPatchBaselineCommand.ts rename to clients/client-ssm/src/commands/GetPatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/GetPatchBaselineForPatchGroupCommand.ts b/clients/client-ssm/src/commands/GetPatchBaselineForPatchGroupCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetPatchBaselineForPatchGroupCommand.ts rename to clients/client-ssm/src/commands/GetPatchBaselineForPatchGroupCommand.ts diff --git a/clients/client-ssm/commands/GetServiceSettingCommand.ts b/clients/client-ssm/src/commands/GetServiceSettingCommand.ts similarity index 100% rename from clients/client-ssm/commands/GetServiceSettingCommand.ts rename to clients/client-ssm/src/commands/GetServiceSettingCommand.ts diff --git a/clients/client-ssm/commands/LabelParameterVersionCommand.ts b/clients/client-ssm/src/commands/LabelParameterVersionCommand.ts similarity index 100% rename from clients/client-ssm/commands/LabelParameterVersionCommand.ts rename to clients/client-ssm/src/commands/LabelParameterVersionCommand.ts diff --git a/clients/client-ssm/commands/ListAssociationVersionsCommand.ts b/clients/client-ssm/src/commands/ListAssociationVersionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListAssociationVersionsCommand.ts rename to clients/client-ssm/src/commands/ListAssociationVersionsCommand.ts diff --git a/clients/client-ssm/commands/ListAssociationsCommand.ts b/clients/client-ssm/src/commands/ListAssociationsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListAssociationsCommand.ts rename to clients/client-ssm/src/commands/ListAssociationsCommand.ts diff --git a/clients/client-ssm/commands/ListCommandInvocationsCommand.ts b/clients/client-ssm/src/commands/ListCommandInvocationsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListCommandInvocationsCommand.ts rename to clients/client-ssm/src/commands/ListCommandInvocationsCommand.ts diff --git a/clients/client-ssm/commands/ListCommandsCommand.ts b/clients/client-ssm/src/commands/ListCommandsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListCommandsCommand.ts rename to clients/client-ssm/src/commands/ListCommandsCommand.ts diff --git a/clients/client-ssm/commands/ListComplianceItemsCommand.ts b/clients/client-ssm/src/commands/ListComplianceItemsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListComplianceItemsCommand.ts rename to clients/client-ssm/src/commands/ListComplianceItemsCommand.ts diff --git a/clients/client-ssm/commands/ListComplianceSummariesCommand.ts b/clients/client-ssm/src/commands/ListComplianceSummariesCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListComplianceSummariesCommand.ts rename to clients/client-ssm/src/commands/ListComplianceSummariesCommand.ts diff --git a/clients/client-ssm/commands/ListDocumentMetadataHistoryCommand.ts b/clients/client-ssm/src/commands/ListDocumentMetadataHistoryCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListDocumentMetadataHistoryCommand.ts rename to clients/client-ssm/src/commands/ListDocumentMetadataHistoryCommand.ts diff --git a/clients/client-ssm/commands/ListDocumentVersionsCommand.ts b/clients/client-ssm/src/commands/ListDocumentVersionsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListDocumentVersionsCommand.ts rename to clients/client-ssm/src/commands/ListDocumentVersionsCommand.ts diff --git a/clients/client-ssm/commands/ListDocumentsCommand.ts b/clients/client-ssm/src/commands/ListDocumentsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListDocumentsCommand.ts rename to clients/client-ssm/src/commands/ListDocumentsCommand.ts diff --git a/clients/client-ssm/commands/ListInventoryEntriesCommand.ts b/clients/client-ssm/src/commands/ListInventoryEntriesCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListInventoryEntriesCommand.ts rename to clients/client-ssm/src/commands/ListInventoryEntriesCommand.ts diff --git a/clients/client-ssm/commands/ListOpsItemEventsCommand.ts b/clients/client-ssm/src/commands/ListOpsItemEventsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListOpsItemEventsCommand.ts rename to clients/client-ssm/src/commands/ListOpsItemEventsCommand.ts diff --git a/clients/client-ssm/commands/ListOpsItemRelatedItemsCommand.ts b/clients/client-ssm/src/commands/ListOpsItemRelatedItemsCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListOpsItemRelatedItemsCommand.ts rename to clients/client-ssm/src/commands/ListOpsItemRelatedItemsCommand.ts diff --git a/clients/client-ssm/commands/ListOpsMetadataCommand.ts b/clients/client-ssm/src/commands/ListOpsMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListOpsMetadataCommand.ts rename to clients/client-ssm/src/commands/ListOpsMetadataCommand.ts diff --git a/clients/client-ssm/commands/ListResourceComplianceSummariesCommand.ts b/clients/client-ssm/src/commands/ListResourceComplianceSummariesCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListResourceComplianceSummariesCommand.ts rename to clients/client-ssm/src/commands/ListResourceComplianceSummariesCommand.ts diff --git a/clients/client-ssm/commands/ListResourceDataSyncCommand.ts b/clients/client-ssm/src/commands/ListResourceDataSyncCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListResourceDataSyncCommand.ts rename to clients/client-ssm/src/commands/ListResourceDataSyncCommand.ts diff --git a/clients/client-ssm/commands/ListTagsForResourceCommand.ts b/clients/client-ssm/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-ssm/commands/ListTagsForResourceCommand.ts rename to clients/client-ssm/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-ssm/commands/ModifyDocumentPermissionCommand.ts b/clients/client-ssm/src/commands/ModifyDocumentPermissionCommand.ts similarity index 100% rename from clients/client-ssm/commands/ModifyDocumentPermissionCommand.ts rename to clients/client-ssm/src/commands/ModifyDocumentPermissionCommand.ts diff --git a/clients/client-ssm/commands/PutComplianceItemsCommand.ts b/clients/client-ssm/src/commands/PutComplianceItemsCommand.ts similarity index 100% rename from clients/client-ssm/commands/PutComplianceItemsCommand.ts rename to clients/client-ssm/src/commands/PutComplianceItemsCommand.ts diff --git a/clients/client-ssm/commands/PutInventoryCommand.ts b/clients/client-ssm/src/commands/PutInventoryCommand.ts similarity index 100% rename from clients/client-ssm/commands/PutInventoryCommand.ts rename to clients/client-ssm/src/commands/PutInventoryCommand.ts diff --git a/clients/client-ssm/commands/PutParameterCommand.ts b/clients/client-ssm/src/commands/PutParameterCommand.ts similarity index 100% rename from clients/client-ssm/commands/PutParameterCommand.ts rename to clients/client-ssm/src/commands/PutParameterCommand.ts diff --git a/clients/client-ssm/commands/RegisterDefaultPatchBaselineCommand.ts b/clients/client-ssm/src/commands/RegisterDefaultPatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/RegisterDefaultPatchBaselineCommand.ts rename to clients/client-ssm/src/commands/RegisterDefaultPatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/RegisterPatchBaselineForPatchGroupCommand.ts b/clients/client-ssm/src/commands/RegisterPatchBaselineForPatchGroupCommand.ts similarity index 100% rename from clients/client-ssm/commands/RegisterPatchBaselineForPatchGroupCommand.ts rename to clients/client-ssm/src/commands/RegisterPatchBaselineForPatchGroupCommand.ts diff --git a/clients/client-ssm/commands/RegisterTargetWithMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/RegisterTargetWithMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/RegisterTargetWithMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/RegisterTargetWithMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/RegisterTaskWithMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/RegisterTaskWithMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/RegisterTaskWithMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/RegisterTaskWithMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/RemoveTagsFromResourceCommand.ts b/clients/client-ssm/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-ssm/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-ssm/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-ssm/commands/ResetServiceSettingCommand.ts b/clients/client-ssm/src/commands/ResetServiceSettingCommand.ts similarity index 100% rename from clients/client-ssm/commands/ResetServiceSettingCommand.ts rename to clients/client-ssm/src/commands/ResetServiceSettingCommand.ts diff --git a/clients/client-ssm/commands/ResumeSessionCommand.ts b/clients/client-ssm/src/commands/ResumeSessionCommand.ts similarity index 100% rename from clients/client-ssm/commands/ResumeSessionCommand.ts rename to clients/client-ssm/src/commands/ResumeSessionCommand.ts diff --git a/clients/client-ssm/commands/SendAutomationSignalCommand.ts b/clients/client-ssm/src/commands/SendAutomationSignalCommand.ts similarity index 100% rename from clients/client-ssm/commands/SendAutomationSignalCommand.ts rename to clients/client-ssm/src/commands/SendAutomationSignalCommand.ts diff --git a/clients/client-ssm/commands/SendCommandCommand.ts b/clients/client-ssm/src/commands/SendCommandCommand.ts similarity index 100% rename from clients/client-ssm/commands/SendCommandCommand.ts rename to clients/client-ssm/src/commands/SendCommandCommand.ts diff --git a/clients/client-ssm/commands/StartAssociationsOnceCommand.ts b/clients/client-ssm/src/commands/StartAssociationsOnceCommand.ts similarity index 100% rename from clients/client-ssm/commands/StartAssociationsOnceCommand.ts rename to clients/client-ssm/src/commands/StartAssociationsOnceCommand.ts diff --git a/clients/client-ssm/commands/StartAutomationExecutionCommand.ts b/clients/client-ssm/src/commands/StartAutomationExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/StartAutomationExecutionCommand.ts rename to clients/client-ssm/src/commands/StartAutomationExecutionCommand.ts diff --git a/clients/client-ssm/commands/StartChangeRequestExecutionCommand.ts b/clients/client-ssm/src/commands/StartChangeRequestExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/StartChangeRequestExecutionCommand.ts rename to clients/client-ssm/src/commands/StartChangeRequestExecutionCommand.ts diff --git a/clients/client-ssm/commands/StartSessionCommand.ts b/clients/client-ssm/src/commands/StartSessionCommand.ts similarity index 100% rename from clients/client-ssm/commands/StartSessionCommand.ts rename to clients/client-ssm/src/commands/StartSessionCommand.ts diff --git a/clients/client-ssm/commands/StopAutomationExecutionCommand.ts b/clients/client-ssm/src/commands/StopAutomationExecutionCommand.ts similarity index 100% rename from clients/client-ssm/commands/StopAutomationExecutionCommand.ts rename to clients/client-ssm/src/commands/StopAutomationExecutionCommand.ts diff --git a/clients/client-ssm/commands/TerminateSessionCommand.ts b/clients/client-ssm/src/commands/TerminateSessionCommand.ts similarity index 100% rename from clients/client-ssm/commands/TerminateSessionCommand.ts rename to clients/client-ssm/src/commands/TerminateSessionCommand.ts diff --git a/clients/client-ssm/commands/UnlabelParameterVersionCommand.ts b/clients/client-ssm/src/commands/UnlabelParameterVersionCommand.ts similarity index 100% rename from clients/client-ssm/commands/UnlabelParameterVersionCommand.ts rename to clients/client-ssm/src/commands/UnlabelParameterVersionCommand.ts diff --git a/clients/client-ssm/commands/UpdateAssociationCommand.ts b/clients/client-ssm/src/commands/UpdateAssociationCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateAssociationCommand.ts rename to clients/client-ssm/src/commands/UpdateAssociationCommand.ts diff --git a/clients/client-ssm/commands/UpdateAssociationStatusCommand.ts b/clients/client-ssm/src/commands/UpdateAssociationStatusCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateAssociationStatusCommand.ts rename to clients/client-ssm/src/commands/UpdateAssociationStatusCommand.ts diff --git a/clients/client-ssm/commands/UpdateDocumentCommand.ts b/clients/client-ssm/src/commands/UpdateDocumentCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateDocumentCommand.ts rename to clients/client-ssm/src/commands/UpdateDocumentCommand.ts diff --git a/clients/client-ssm/commands/UpdateDocumentDefaultVersionCommand.ts b/clients/client-ssm/src/commands/UpdateDocumentDefaultVersionCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateDocumentDefaultVersionCommand.ts rename to clients/client-ssm/src/commands/UpdateDocumentDefaultVersionCommand.ts diff --git a/clients/client-ssm/commands/UpdateDocumentMetadataCommand.ts b/clients/client-ssm/src/commands/UpdateDocumentMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateDocumentMetadataCommand.ts rename to clients/client-ssm/src/commands/UpdateDocumentMetadataCommand.ts diff --git a/clients/client-ssm/commands/UpdateMaintenanceWindowCommand.ts b/clients/client-ssm/src/commands/UpdateMaintenanceWindowCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateMaintenanceWindowCommand.ts rename to clients/client-ssm/src/commands/UpdateMaintenanceWindowCommand.ts diff --git a/clients/client-ssm/commands/UpdateMaintenanceWindowTargetCommand.ts b/clients/client-ssm/src/commands/UpdateMaintenanceWindowTargetCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateMaintenanceWindowTargetCommand.ts rename to clients/client-ssm/src/commands/UpdateMaintenanceWindowTargetCommand.ts diff --git a/clients/client-ssm/commands/UpdateMaintenanceWindowTaskCommand.ts b/clients/client-ssm/src/commands/UpdateMaintenanceWindowTaskCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateMaintenanceWindowTaskCommand.ts rename to clients/client-ssm/src/commands/UpdateMaintenanceWindowTaskCommand.ts diff --git a/clients/client-ssm/commands/UpdateManagedInstanceRoleCommand.ts b/clients/client-ssm/src/commands/UpdateManagedInstanceRoleCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateManagedInstanceRoleCommand.ts rename to clients/client-ssm/src/commands/UpdateManagedInstanceRoleCommand.ts diff --git a/clients/client-ssm/commands/UpdateOpsItemCommand.ts b/clients/client-ssm/src/commands/UpdateOpsItemCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateOpsItemCommand.ts rename to clients/client-ssm/src/commands/UpdateOpsItemCommand.ts diff --git a/clients/client-ssm/commands/UpdateOpsMetadataCommand.ts b/clients/client-ssm/src/commands/UpdateOpsMetadataCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateOpsMetadataCommand.ts rename to clients/client-ssm/src/commands/UpdateOpsMetadataCommand.ts diff --git a/clients/client-ssm/commands/UpdatePatchBaselineCommand.ts b/clients/client-ssm/src/commands/UpdatePatchBaselineCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdatePatchBaselineCommand.ts rename to clients/client-ssm/src/commands/UpdatePatchBaselineCommand.ts diff --git a/clients/client-ssm/commands/UpdateResourceDataSyncCommand.ts b/clients/client-ssm/src/commands/UpdateResourceDataSyncCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateResourceDataSyncCommand.ts rename to clients/client-ssm/src/commands/UpdateResourceDataSyncCommand.ts diff --git a/clients/client-ssm/commands/UpdateServiceSettingCommand.ts b/clients/client-ssm/src/commands/UpdateServiceSettingCommand.ts similarity index 100% rename from clients/client-ssm/commands/UpdateServiceSettingCommand.ts rename to clients/client-ssm/src/commands/UpdateServiceSettingCommand.ts diff --git a/clients/client-ssm/endpoints.ts b/clients/client-ssm/src/endpoints.ts similarity index 100% rename from clients/client-ssm/endpoints.ts rename to clients/client-ssm/src/endpoints.ts diff --git a/clients/client-ssm/index.ts b/clients/client-ssm/src/index.ts similarity index 100% rename from clients/client-ssm/index.ts rename to clients/client-ssm/src/index.ts diff --git a/clients/client-ssm/models/index.ts b/clients/client-ssm/src/models/index.ts similarity index 100% rename from clients/client-ssm/models/index.ts rename to clients/client-ssm/src/models/index.ts diff --git a/clients/client-ssm/models/models_0.ts b/clients/client-ssm/src/models/models_0.ts similarity index 100% rename from clients/client-ssm/models/models_0.ts rename to clients/client-ssm/src/models/models_0.ts diff --git a/clients/client-ssm/models/models_1.ts b/clients/client-ssm/src/models/models_1.ts similarity index 100% rename from clients/client-ssm/models/models_1.ts rename to clients/client-ssm/src/models/models_1.ts diff --git a/clients/client-ssm/models/models_2.ts b/clients/client-ssm/src/models/models_2.ts similarity index 100% rename from clients/client-ssm/models/models_2.ts rename to clients/client-ssm/src/models/models_2.ts diff --git a/clients/client-ssm/pagination/DescribeActivationsPaginator.ts b/clients/client-ssm/src/pagination/DescribeActivationsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeActivationsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeActivationsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeAssociationExecutionTargetsPaginator.ts b/clients/client-ssm/src/pagination/DescribeAssociationExecutionTargetsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeAssociationExecutionTargetsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeAssociationExecutionTargetsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeAssociationExecutionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeAssociationExecutionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeAssociationExecutionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeAssociationExecutionsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeAutomationExecutionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeAutomationExecutionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeAutomationExecutionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeAutomationExecutionsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeAutomationStepExecutionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeAutomationStepExecutionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeAutomationStepExecutionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeAutomationStepExecutionsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeAvailablePatchesPaginator.ts b/clients/client-ssm/src/pagination/DescribeAvailablePatchesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeAvailablePatchesPaginator.ts rename to clients/client-ssm/src/pagination/DescribeAvailablePatchesPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeEffectiveInstanceAssociationsPaginator.ts b/clients/client-ssm/src/pagination/DescribeEffectiveInstanceAssociationsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeEffectiveInstanceAssociationsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeEffectiveInstanceAssociationsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeEffectivePatchesForPatchBaselinePaginator.ts b/clients/client-ssm/src/pagination/DescribeEffectivePatchesForPatchBaselinePaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeEffectivePatchesForPatchBaselinePaginator.ts rename to clients/client-ssm/src/pagination/DescribeEffectivePatchesForPatchBaselinePaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInstanceAssociationsStatusPaginator.ts b/clients/client-ssm/src/pagination/DescribeInstanceAssociationsStatusPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInstanceAssociationsStatusPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInstanceAssociationsStatusPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInstanceInformationPaginator.ts b/clients/client-ssm/src/pagination/DescribeInstanceInformationPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInstanceInformationPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInstanceInformationPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInstancePatchStatesForPatchGroupPaginator.ts b/clients/client-ssm/src/pagination/DescribeInstancePatchStatesForPatchGroupPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInstancePatchStatesForPatchGroupPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInstancePatchStatesForPatchGroupPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInstancePatchStatesPaginator.ts b/clients/client-ssm/src/pagination/DescribeInstancePatchStatesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInstancePatchStatesPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInstancePatchStatesPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInstancePatchesPaginator.ts b/clients/client-ssm/src/pagination/DescribeInstancePatchesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInstancePatchesPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInstancePatchesPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeInventoryDeletionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeInventoryDeletionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeInventoryDeletionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeInventoryDeletionsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionTaskInvocationsPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionTaskInvocationsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionTaskInvocationsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionTaskInvocationsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionTasksPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionTasksPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionTasksPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionTasksPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowExecutionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowExecutionsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowSchedulePaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowSchedulePaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowSchedulePaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowSchedulePaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowTargetsPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowTargetsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowTargetsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowTargetsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowTasksPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowTasksPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowTasksPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowTasksPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowsForTargetPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowsForTargetPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowsForTargetPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowsForTargetPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeMaintenanceWindowsPaginator.ts b/clients/client-ssm/src/pagination/DescribeMaintenanceWindowsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeMaintenanceWindowsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeMaintenanceWindowsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeOpsItemsPaginator.ts b/clients/client-ssm/src/pagination/DescribeOpsItemsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeOpsItemsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeOpsItemsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeParametersPaginator.ts b/clients/client-ssm/src/pagination/DescribeParametersPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeParametersPaginator.ts rename to clients/client-ssm/src/pagination/DescribeParametersPaginator.ts diff --git a/clients/client-ssm/pagination/DescribePatchBaselinesPaginator.ts b/clients/client-ssm/src/pagination/DescribePatchBaselinesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribePatchBaselinesPaginator.ts rename to clients/client-ssm/src/pagination/DescribePatchBaselinesPaginator.ts diff --git a/clients/client-ssm/pagination/DescribePatchGroupsPaginator.ts b/clients/client-ssm/src/pagination/DescribePatchGroupsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribePatchGroupsPaginator.ts rename to clients/client-ssm/src/pagination/DescribePatchGroupsPaginator.ts diff --git a/clients/client-ssm/pagination/DescribePatchPropertiesPaginator.ts b/clients/client-ssm/src/pagination/DescribePatchPropertiesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribePatchPropertiesPaginator.ts rename to clients/client-ssm/src/pagination/DescribePatchPropertiesPaginator.ts diff --git a/clients/client-ssm/pagination/DescribeSessionsPaginator.ts b/clients/client-ssm/src/pagination/DescribeSessionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/DescribeSessionsPaginator.ts rename to clients/client-ssm/src/pagination/DescribeSessionsPaginator.ts diff --git a/clients/client-ssm/pagination/GetInventoryPaginator.ts b/clients/client-ssm/src/pagination/GetInventoryPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/GetInventoryPaginator.ts rename to clients/client-ssm/src/pagination/GetInventoryPaginator.ts diff --git a/clients/client-ssm/pagination/GetInventorySchemaPaginator.ts b/clients/client-ssm/src/pagination/GetInventorySchemaPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/GetInventorySchemaPaginator.ts rename to clients/client-ssm/src/pagination/GetInventorySchemaPaginator.ts diff --git a/clients/client-ssm/pagination/GetOpsSummaryPaginator.ts b/clients/client-ssm/src/pagination/GetOpsSummaryPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/GetOpsSummaryPaginator.ts rename to clients/client-ssm/src/pagination/GetOpsSummaryPaginator.ts diff --git a/clients/client-ssm/pagination/GetParameterHistoryPaginator.ts b/clients/client-ssm/src/pagination/GetParameterHistoryPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/GetParameterHistoryPaginator.ts rename to clients/client-ssm/src/pagination/GetParameterHistoryPaginator.ts diff --git a/clients/client-ssm/pagination/GetParametersByPathPaginator.ts b/clients/client-ssm/src/pagination/GetParametersByPathPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/GetParametersByPathPaginator.ts rename to clients/client-ssm/src/pagination/GetParametersByPathPaginator.ts diff --git a/clients/client-ssm/pagination/Interfaces.ts b/clients/client-ssm/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-ssm/pagination/Interfaces.ts rename to clients/client-ssm/src/pagination/Interfaces.ts diff --git a/clients/client-ssm/pagination/ListAssociationVersionsPaginator.ts b/clients/client-ssm/src/pagination/ListAssociationVersionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListAssociationVersionsPaginator.ts rename to clients/client-ssm/src/pagination/ListAssociationVersionsPaginator.ts diff --git a/clients/client-ssm/pagination/ListAssociationsPaginator.ts b/clients/client-ssm/src/pagination/ListAssociationsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListAssociationsPaginator.ts rename to clients/client-ssm/src/pagination/ListAssociationsPaginator.ts diff --git a/clients/client-ssm/pagination/ListCommandInvocationsPaginator.ts b/clients/client-ssm/src/pagination/ListCommandInvocationsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListCommandInvocationsPaginator.ts rename to clients/client-ssm/src/pagination/ListCommandInvocationsPaginator.ts diff --git a/clients/client-ssm/pagination/ListCommandsPaginator.ts b/clients/client-ssm/src/pagination/ListCommandsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListCommandsPaginator.ts rename to clients/client-ssm/src/pagination/ListCommandsPaginator.ts diff --git a/clients/client-ssm/pagination/ListComplianceItemsPaginator.ts b/clients/client-ssm/src/pagination/ListComplianceItemsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListComplianceItemsPaginator.ts rename to clients/client-ssm/src/pagination/ListComplianceItemsPaginator.ts diff --git a/clients/client-ssm/pagination/ListComplianceSummariesPaginator.ts b/clients/client-ssm/src/pagination/ListComplianceSummariesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListComplianceSummariesPaginator.ts rename to clients/client-ssm/src/pagination/ListComplianceSummariesPaginator.ts diff --git a/clients/client-ssm/pagination/ListDocumentVersionsPaginator.ts b/clients/client-ssm/src/pagination/ListDocumentVersionsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListDocumentVersionsPaginator.ts rename to clients/client-ssm/src/pagination/ListDocumentVersionsPaginator.ts diff --git a/clients/client-ssm/pagination/ListDocumentsPaginator.ts b/clients/client-ssm/src/pagination/ListDocumentsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListDocumentsPaginator.ts rename to clients/client-ssm/src/pagination/ListDocumentsPaginator.ts diff --git a/clients/client-ssm/pagination/ListOpsItemEventsPaginator.ts b/clients/client-ssm/src/pagination/ListOpsItemEventsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListOpsItemEventsPaginator.ts rename to clients/client-ssm/src/pagination/ListOpsItemEventsPaginator.ts diff --git a/clients/client-ssm/pagination/ListOpsItemRelatedItemsPaginator.ts b/clients/client-ssm/src/pagination/ListOpsItemRelatedItemsPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListOpsItemRelatedItemsPaginator.ts rename to clients/client-ssm/src/pagination/ListOpsItemRelatedItemsPaginator.ts diff --git a/clients/client-ssm/pagination/ListOpsMetadataPaginator.ts b/clients/client-ssm/src/pagination/ListOpsMetadataPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListOpsMetadataPaginator.ts rename to clients/client-ssm/src/pagination/ListOpsMetadataPaginator.ts diff --git a/clients/client-ssm/pagination/ListResourceComplianceSummariesPaginator.ts b/clients/client-ssm/src/pagination/ListResourceComplianceSummariesPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListResourceComplianceSummariesPaginator.ts rename to clients/client-ssm/src/pagination/ListResourceComplianceSummariesPaginator.ts diff --git a/clients/client-ssm/pagination/ListResourceDataSyncPaginator.ts b/clients/client-ssm/src/pagination/ListResourceDataSyncPaginator.ts similarity index 100% rename from clients/client-ssm/pagination/ListResourceDataSyncPaginator.ts rename to clients/client-ssm/src/pagination/ListResourceDataSyncPaginator.ts diff --git a/clients/client-ssm/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-ssm/protocols/Aws_json1_1.ts rename to clients/client-ssm/src/protocols/Aws_json1_1.ts diff --git a/clients/client-ssm/src/runtimeConfig.browser.ts b/clients/client-ssm/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a1fc73311a0a --- /dev/null +++ b/clients/client-ssm/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSMClientConfig } from "./SSMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm/runtimeConfig.native.ts b/clients/client-ssm/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-ssm/runtimeConfig.native.ts rename to clients/client-ssm/src/runtimeConfig.native.ts diff --git a/clients/client-ssm/runtimeConfig.shared.ts b/clients/client-ssm/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-ssm/runtimeConfig.shared.ts rename to clients/client-ssm/src/runtimeConfig.shared.ts diff --git a/clients/client-ssm/src/runtimeConfig.ts b/clients/client-ssm/src/runtimeConfig.ts new file mode 100644 index 000000000000..b04c4aff9dff --- /dev/null +++ b/clients/client-ssm/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSMClientConfig } from "./SSMClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSMClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-ssm/waiters/waitForCommandExecuted.ts b/clients/client-ssm/src/waiters/waitForCommandExecuted.ts similarity index 100% rename from clients/client-ssm/waiters/waitForCommandExecuted.ts rename to clients/client-ssm/src/waiters/waitForCommandExecuted.ts diff --git a/clients/client-ssm/tsconfig.es.json b/clients/client-ssm/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-ssm/tsconfig.es.json +++ b/clients/client-ssm/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-ssm/tsconfig.json b/clients/client-ssm/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-ssm/tsconfig.json +++ b/clients/client-ssm/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-ssm/tsconfig.types.json b/clients/client-ssm/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-ssm/tsconfig.types.json +++ b/clients/client-ssm/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sso-admin/.gitignore b/clients/client-sso-admin/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sso-admin/.gitignore +++ b/clients/client-sso-admin/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sso-admin/package.json b/clients/client-sso-admin/package.json index ac7208876a7f..6ed2ef00382f 100644 --- a/clients/client-sso-admin/package.json +++ b/clients/client-sso-admin/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-admin", "repository": { "type": "git", diff --git a/clients/client-sso-admin/runtimeConfig.browser.ts b/clients/client-sso-admin/runtimeConfig.browser.ts deleted file mode 100644 index b51b4cf7dfcb..000000000000 --- a/clients/client-sso-admin/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSOAdminClientConfig } from "./SSOAdminClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOAdminClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso-admin/runtimeConfig.ts b/clients/client-sso-admin/runtimeConfig.ts deleted file mode 100644 index 7446ea34654a..000000000000 --- a/clients/client-sso-admin/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSOAdminClientConfig } from "./SSOAdminClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOAdminClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso-admin/SSOAdmin.ts b/clients/client-sso-admin/src/SSOAdmin.ts similarity index 100% rename from clients/client-sso-admin/SSOAdmin.ts rename to clients/client-sso-admin/src/SSOAdmin.ts diff --git a/clients/client-sso-admin/SSOAdminClient.ts b/clients/client-sso-admin/src/SSOAdminClient.ts similarity index 100% rename from clients/client-sso-admin/SSOAdminClient.ts rename to clients/client-sso-admin/src/SSOAdminClient.ts diff --git a/clients/client-sso-admin/commands/AttachManagedPolicyToPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/AttachManagedPolicyToPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/AttachManagedPolicyToPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/AttachManagedPolicyToPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/CreateAccountAssignmentCommand.ts b/clients/client-sso-admin/src/commands/CreateAccountAssignmentCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/CreateAccountAssignmentCommand.ts rename to clients/client-sso-admin/src/commands/CreateAccountAssignmentCommand.ts diff --git a/clients/client-sso-admin/commands/CreateInstanceAccessControlAttributeConfigurationCommand.ts b/clients/client-sso-admin/src/commands/CreateInstanceAccessControlAttributeConfigurationCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/CreateInstanceAccessControlAttributeConfigurationCommand.ts rename to clients/client-sso-admin/src/commands/CreateInstanceAccessControlAttributeConfigurationCommand.ts diff --git a/clients/client-sso-admin/commands/CreatePermissionSetCommand.ts b/clients/client-sso-admin/src/commands/CreatePermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/CreatePermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/CreatePermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/DeleteAccountAssignmentCommand.ts b/clients/client-sso-admin/src/commands/DeleteAccountAssignmentCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DeleteAccountAssignmentCommand.ts rename to clients/client-sso-admin/src/commands/DeleteAccountAssignmentCommand.ts diff --git a/clients/client-sso-admin/commands/DeleteInlinePolicyFromPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/DeleteInlinePolicyFromPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DeleteInlinePolicyFromPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/DeleteInlinePolicyFromPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/DeleteInstanceAccessControlAttributeConfigurationCommand.ts b/clients/client-sso-admin/src/commands/DeleteInstanceAccessControlAttributeConfigurationCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DeleteInstanceAccessControlAttributeConfigurationCommand.ts rename to clients/client-sso-admin/src/commands/DeleteInstanceAccessControlAttributeConfigurationCommand.ts diff --git a/clients/client-sso-admin/commands/DeletePermissionSetCommand.ts b/clients/client-sso-admin/src/commands/DeletePermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DeletePermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/DeletePermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/DescribeAccountAssignmentCreationStatusCommand.ts b/clients/client-sso-admin/src/commands/DescribeAccountAssignmentCreationStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DescribeAccountAssignmentCreationStatusCommand.ts rename to clients/client-sso-admin/src/commands/DescribeAccountAssignmentCreationStatusCommand.ts diff --git a/clients/client-sso-admin/commands/DescribeAccountAssignmentDeletionStatusCommand.ts b/clients/client-sso-admin/src/commands/DescribeAccountAssignmentDeletionStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DescribeAccountAssignmentDeletionStatusCommand.ts rename to clients/client-sso-admin/src/commands/DescribeAccountAssignmentDeletionStatusCommand.ts diff --git a/clients/client-sso-admin/commands/DescribeInstanceAccessControlAttributeConfigurationCommand.ts b/clients/client-sso-admin/src/commands/DescribeInstanceAccessControlAttributeConfigurationCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DescribeInstanceAccessControlAttributeConfigurationCommand.ts rename to clients/client-sso-admin/src/commands/DescribeInstanceAccessControlAttributeConfigurationCommand.ts diff --git a/clients/client-sso-admin/commands/DescribePermissionSetCommand.ts b/clients/client-sso-admin/src/commands/DescribePermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DescribePermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/DescribePermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/DescribePermissionSetProvisioningStatusCommand.ts b/clients/client-sso-admin/src/commands/DescribePermissionSetProvisioningStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DescribePermissionSetProvisioningStatusCommand.ts rename to clients/client-sso-admin/src/commands/DescribePermissionSetProvisioningStatusCommand.ts diff --git a/clients/client-sso-admin/commands/DetachManagedPolicyFromPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/DetachManagedPolicyFromPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/DetachManagedPolicyFromPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/DetachManagedPolicyFromPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/GetInlinePolicyForPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/GetInlinePolicyForPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/GetInlinePolicyForPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/GetInlinePolicyForPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/ListAccountAssignmentCreationStatusCommand.ts b/clients/client-sso-admin/src/commands/ListAccountAssignmentCreationStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListAccountAssignmentCreationStatusCommand.ts rename to clients/client-sso-admin/src/commands/ListAccountAssignmentCreationStatusCommand.ts diff --git a/clients/client-sso-admin/commands/ListAccountAssignmentDeletionStatusCommand.ts b/clients/client-sso-admin/src/commands/ListAccountAssignmentDeletionStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListAccountAssignmentDeletionStatusCommand.ts rename to clients/client-sso-admin/src/commands/ListAccountAssignmentDeletionStatusCommand.ts diff --git a/clients/client-sso-admin/commands/ListAccountAssignmentsCommand.ts b/clients/client-sso-admin/src/commands/ListAccountAssignmentsCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListAccountAssignmentsCommand.ts rename to clients/client-sso-admin/src/commands/ListAccountAssignmentsCommand.ts diff --git a/clients/client-sso-admin/commands/ListAccountsForProvisionedPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/ListAccountsForProvisionedPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListAccountsForProvisionedPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/ListAccountsForProvisionedPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/ListInstancesCommand.ts b/clients/client-sso-admin/src/commands/ListInstancesCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListInstancesCommand.ts rename to clients/client-sso-admin/src/commands/ListInstancesCommand.ts diff --git a/clients/client-sso-admin/commands/ListManagedPoliciesInPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/ListManagedPoliciesInPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListManagedPoliciesInPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/ListManagedPoliciesInPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/ListPermissionSetProvisioningStatusCommand.ts b/clients/client-sso-admin/src/commands/ListPermissionSetProvisioningStatusCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListPermissionSetProvisioningStatusCommand.ts rename to clients/client-sso-admin/src/commands/ListPermissionSetProvisioningStatusCommand.ts diff --git a/clients/client-sso-admin/commands/ListPermissionSetsCommand.ts b/clients/client-sso-admin/src/commands/ListPermissionSetsCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListPermissionSetsCommand.ts rename to clients/client-sso-admin/src/commands/ListPermissionSetsCommand.ts diff --git a/clients/client-sso-admin/commands/ListPermissionSetsProvisionedToAccountCommand.ts b/clients/client-sso-admin/src/commands/ListPermissionSetsProvisionedToAccountCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListPermissionSetsProvisionedToAccountCommand.ts rename to clients/client-sso-admin/src/commands/ListPermissionSetsProvisionedToAccountCommand.ts diff --git a/clients/client-sso-admin/commands/ListTagsForResourceCommand.ts b/clients/client-sso-admin/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ListTagsForResourceCommand.ts rename to clients/client-sso-admin/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-sso-admin/commands/ProvisionPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/ProvisionPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/ProvisionPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/ProvisionPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/PutInlinePolicyToPermissionSetCommand.ts b/clients/client-sso-admin/src/commands/PutInlinePolicyToPermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/PutInlinePolicyToPermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/PutInlinePolicyToPermissionSetCommand.ts diff --git a/clients/client-sso-admin/commands/TagResourceCommand.ts b/clients/client-sso-admin/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/TagResourceCommand.ts rename to clients/client-sso-admin/src/commands/TagResourceCommand.ts diff --git a/clients/client-sso-admin/commands/UntagResourceCommand.ts b/clients/client-sso-admin/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/UntagResourceCommand.ts rename to clients/client-sso-admin/src/commands/UntagResourceCommand.ts diff --git a/clients/client-sso-admin/commands/UpdateInstanceAccessControlAttributeConfigurationCommand.ts b/clients/client-sso-admin/src/commands/UpdateInstanceAccessControlAttributeConfigurationCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/UpdateInstanceAccessControlAttributeConfigurationCommand.ts rename to clients/client-sso-admin/src/commands/UpdateInstanceAccessControlAttributeConfigurationCommand.ts diff --git a/clients/client-sso-admin/commands/UpdatePermissionSetCommand.ts b/clients/client-sso-admin/src/commands/UpdatePermissionSetCommand.ts similarity index 100% rename from clients/client-sso-admin/commands/UpdatePermissionSetCommand.ts rename to clients/client-sso-admin/src/commands/UpdatePermissionSetCommand.ts diff --git a/clients/client-sso-admin/endpoints.ts b/clients/client-sso-admin/src/endpoints.ts similarity index 100% rename from clients/client-sso-admin/endpoints.ts rename to clients/client-sso-admin/src/endpoints.ts diff --git a/clients/client-sso-admin/index.ts b/clients/client-sso-admin/src/index.ts similarity index 100% rename from clients/client-sso-admin/index.ts rename to clients/client-sso-admin/src/index.ts diff --git a/clients/client-sso-admin/models/index.ts b/clients/client-sso-admin/src/models/index.ts similarity index 100% rename from clients/client-sso-admin/models/index.ts rename to clients/client-sso-admin/src/models/index.ts diff --git a/clients/client-sso-admin/models/models_0.ts b/clients/client-sso-admin/src/models/models_0.ts similarity index 100% rename from clients/client-sso-admin/models/models_0.ts rename to clients/client-sso-admin/src/models/models_0.ts diff --git a/clients/client-sso-admin/pagination/Interfaces.ts b/clients/client-sso-admin/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sso-admin/pagination/Interfaces.ts rename to clients/client-sso-admin/src/pagination/Interfaces.ts diff --git a/clients/client-sso-admin/pagination/ListAccountAssignmentCreationStatusPaginator.ts b/clients/client-sso-admin/src/pagination/ListAccountAssignmentCreationStatusPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListAccountAssignmentCreationStatusPaginator.ts rename to clients/client-sso-admin/src/pagination/ListAccountAssignmentCreationStatusPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListAccountAssignmentDeletionStatusPaginator.ts b/clients/client-sso-admin/src/pagination/ListAccountAssignmentDeletionStatusPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListAccountAssignmentDeletionStatusPaginator.ts rename to clients/client-sso-admin/src/pagination/ListAccountAssignmentDeletionStatusPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListAccountAssignmentsPaginator.ts b/clients/client-sso-admin/src/pagination/ListAccountAssignmentsPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListAccountAssignmentsPaginator.ts rename to clients/client-sso-admin/src/pagination/ListAccountAssignmentsPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListAccountsForProvisionedPermissionSetPaginator.ts b/clients/client-sso-admin/src/pagination/ListAccountsForProvisionedPermissionSetPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListAccountsForProvisionedPermissionSetPaginator.ts rename to clients/client-sso-admin/src/pagination/ListAccountsForProvisionedPermissionSetPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListInstancesPaginator.ts b/clients/client-sso-admin/src/pagination/ListInstancesPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListInstancesPaginator.ts rename to clients/client-sso-admin/src/pagination/ListInstancesPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListManagedPoliciesInPermissionSetPaginator.ts b/clients/client-sso-admin/src/pagination/ListManagedPoliciesInPermissionSetPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListManagedPoliciesInPermissionSetPaginator.ts rename to clients/client-sso-admin/src/pagination/ListManagedPoliciesInPermissionSetPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListPermissionSetProvisioningStatusPaginator.ts b/clients/client-sso-admin/src/pagination/ListPermissionSetProvisioningStatusPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListPermissionSetProvisioningStatusPaginator.ts rename to clients/client-sso-admin/src/pagination/ListPermissionSetProvisioningStatusPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListPermissionSetsPaginator.ts b/clients/client-sso-admin/src/pagination/ListPermissionSetsPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListPermissionSetsPaginator.ts rename to clients/client-sso-admin/src/pagination/ListPermissionSetsPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListPermissionSetsProvisionedToAccountPaginator.ts b/clients/client-sso-admin/src/pagination/ListPermissionSetsProvisionedToAccountPaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListPermissionSetsProvisionedToAccountPaginator.ts rename to clients/client-sso-admin/src/pagination/ListPermissionSetsProvisionedToAccountPaginator.ts diff --git a/clients/client-sso-admin/pagination/ListTagsForResourcePaginator.ts b/clients/client-sso-admin/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-sso-admin/pagination/ListTagsForResourcePaginator.ts rename to clients/client-sso-admin/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-sso-admin/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-sso-admin/protocols/Aws_json1_1.ts rename to clients/client-sso-admin/src/protocols/Aws_json1_1.ts diff --git a/clients/client-sso-admin/src/runtimeConfig.browser.ts b/clients/client-sso-admin/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..35c4cac1d89f --- /dev/null +++ b/clients/client-sso-admin/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSOAdminClientConfig } from "./SSOAdminClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOAdminClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso-admin/runtimeConfig.native.ts b/clients/client-sso-admin/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sso-admin/runtimeConfig.native.ts rename to clients/client-sso-admin/src/runtimeConfig.native.ts diff --git a/clients/client-sso-admin/runtimeConfig.shared.ts b/clients/client-sso-admin/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sso-admin/runtimeConfig.shared.ts rename to clients/client-sso-admin/src/runtimeConfig.shared.ts diff --git a/clients/client-sso-admin/src/runtimeConfig.ts b/clients/client-sso-admin/src/runtimeConfig.ts new file mode 100644 index 000000000000..f55daed7b47f --- /dev/null +++ b/clients/client-sso-admin/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSOAdminClientConfig } from "./SSOAdminClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOAdminClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso-admin/tsconfig.es.json b/clients/client-sso-admin/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sso-admin/tsconfig.es.json +++ b/clients/client-sso-admin/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sso-admin/tsconfig.json b/clients/client-sso-admin/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sso-admin/tsconfig.json +++ b/clients/client-sso-admin/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sso-admin/tsconfig.types.json b/clients/client-sso-admin/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sso-admin/tsconfig.types.json +++ b/clients/client-sso-admin/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sso-oidc/.gitignore b/clients/client-sso-oidc/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sso-oidc/.gitignore +++ b/clients/client-sso-oidc/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sso-oidc/package.json b/clients/client-sso-oidc/package.json index c06d31f89842..cc5b2016e71d 100644 --- a/clients/client-sso-oidc/package.json +++ b/clients/client-sso-oidc/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -69,8 +63,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -79,6 +73,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc", "repository": { "type": "git", diff --git a/clients/client-sso-oidc/runtimeConfig.browser.ts b/clients/client-sso-oidc/runtimeConfig.browser.ts deleted file mode 100644 index 6f100381beee..000000000000 --- a/clients/client-sso-oidc/runtimeConfig.browser.ts +++ /dev/null @@ -1,38 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSOOIDCClientConfig } from "./SSOOIDCClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso-oidc/runtimeConfig.ts b/clients/client-sso-oidc/runtimeConfig.ts deleted file mode 100644 index f2c581c3c426..000000000000 --- a/clients/client-sso-oidc/runtimeConfig.ts +++ /dev/null @@ -1,41 +0,0 @@ -import packageInfo from "./package.json"; - -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSOOIDCClientConfig } from "./SSOOIDCClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso-oidc/SSOOIDC.ts b/clients/client-sso-oidc/src/SSOOIDC.ts similarity index 100% rename from clients/client-sso-oidc/SSOOIDC.ts rename to clients/client-sso-oidc/src/SSOOIDC.ts diff --git a/clients/client-sso-oidc/SSOOIDCClient.ts b/clients/client-sso-oidc/src/SSOOIDCClient.ts similarity index 100% rename from clients/client-sso-oidc/SSOOIDCClient.ts rename to clients/client-sso-oidc/src/SSOOIDCClient.ts diff --git a/clients/client-sso-oidc/commands/CreateTokenCommand.ts b/clients/client-sso-oidc/src/commands/CreateTokenCommand.ts similarity index 100% rename from clients/client-sso-oidc/commands/CreateTokenCommand.ts rename to clients/client-sso-oidc/src/commands/CreateTokenCommand.ts diff --git a/clients/client-sso-oidc/commands/RegisterClientCommand.ts b/clients/client-sso-oidc/src/commands/RegisterClientCommand.ts similarity index 100% rename from clients/client-sso-oidc/commands/RegisterClientCommand.ts rename to clients/client-sso-oidc/src/commands/RegisterClientCommand.ts diff --git a/clients/client-sso-oidc/commands/StartDeviceAuthorizationCommand.ts b/clients/client-sso-oidc/src/commands/StartDeviceAuthorizationCommand.ts similarity index 100% rename from clients/client-sso-oidc/commands/StartDeviceAuthorizationCommand.ts rename to clients/client-sso-oidc/src/commands/StartDeviceAuthorizationCommand.ts diff --git a/clients/client-sso-oidc/endpoints.ts b/clients/client-sso-oidc/src/endpoints.ts similarity index 100% rename from clients/client-sso-oidc/endpoints.ts rename to clients/client-sso-oidc/src/endpoints.ts diff --git a/clients/client-sso-oidc/index.ts b/clients/client-sso-oidc/src/index.ts similarity index 100% rename from clients/client-sso-oidc/index.ts rename to clients/client-sso-oidc/src/index.ts diff --git a/clients/client-sso-oidc/models/index.ts b/clients/client-sso-oidc/src/models/index.ts similarity index 100% rename from clients/client-sso-oidc/models/index.ts rename to clients/client-sso-oidc/src/models/index.ts diff --git a/clients/client-sso-oidc/models/models_0.ts b/clients/client-sso-oidc/src/models/models_0.ts similarity index 100% rename from clients/client-sso-oidc/models/models_0.ts rename to clients/client-sso-oidc/src/models/models_0.ts diff --git a/clients/client-sso-oidc/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sso-oidc/protocols/Aws_restJson1.ts rename to clients/client-sso-oidc/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sso-oidc/src/runtimeConfig.browser.ts b/clients/client-sso-oidc/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..8e798b6981e5 --- /dev/null +++ b/clients/client-sso-oidc/src/runtimeConfig.browser.ts @@ -0,0 +1,39 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso-oidc/runtimeConfig.native.ts b/clients/client-sso-oidc/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sso-oidc/runtimeConfig.native.ts rename to clients/client-sso-oidc/src/runtimeConfig.native.ts diff --git a/clients/client-sso-oidc/runtimeConfig.shared.ts b/clients/client-sso-oidc/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sso-oidc/runtimeConfig.shared.ts rename to clients/client-sso-oidc/src/runtimeConfig.shared.ts diff --git a/clients/client-sso-oidc/src/runtimeConfig.ts b/clients/client-sso-oidc/src/runtimeConfig.ts new file mode 100644 index 000000000000..202d1a160379 --- /dev/null +++ b/clients/client-sso-oidc/src/runtimeConfig.ts @@ -0,0 +1,42 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSOOIDCClientConfig } from "./SSOOIDCClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso-oidc/tsconfig.es.json b/clients/client-sso-oidc/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sso-oidc/tsconfig.es.json +++ b/clients/client-sso-oidc/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sso-oidc/tsconfig.json b/clients/client-sso-oidc/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sso-oidc/tsconfig.json +++ b/clients/client-sso-oidc/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sso-oidc/tsconfig.types.json b/clients/client-sso-oidc/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sso-oidc/tsconfig.types.json +++ b/clients/client-sso-oidc/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sso/.gitignore b/clients/client-sso/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sso/.gitignore +++ b/clients/client-sso/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sso/package.json b/clients/client-sso/package.json index 8c2d094f05c1..a0741b8ab036 100644 --- a/clients/client-sso/package.json +++ b/clients/client-sso/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -69,8 +63,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -79,6 +73,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", "repository": { "type": "git", diff --git a/clients/client-sso/runtimeConfig.browser.ts b/clients/client-sso/runtimeConfig.browser.ts deleted file mode 100644 index cea09bac060d..000000000000 --- a/clients/client-sso/runtimeConfig.browser.ts +++ /dev/null @@ -1,38 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SSOClientConfig } from "./SSOClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso/runtimeConfig.ts b/clients/client-sso/runtimeConfig.ts deleted file mode 100644 index 5401c3260dfa..000000000000 --- a/clients/client-sso/runtimeConfig.ts +++ /dev/null @@ -1,41 +0,0 @@ -import packageInfo from "./package.json"; - -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SSOClientConfig } from "./SSOClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SSOClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sso/SSO.ts b/clients/client-sso/src/SSO.ts similarity index 100% rename from clients/client-sso/SSO.ts rename to clients/client-sso/src/SSO.ts diff --git a/clients/client-sso/SSOClient.ts b/clients/client-sso/src/SSOClient.ts similarity index 100% rename from clients/client-sso/SSOClient.ts rename to clients/client-sso/src/SSOClient.ts diff --git a/clients/client-sso/commands/GetRoleCredentialsCommand.ts b/clients/client-sso/src/commands/GetRoleCredentialsCommand.ts similarity index 100% rename from clients/client-sso/commands/GetRoleCredentialsCommand.ts rename to clients/client-sso/src/commands/GetRoleCredentialsCommand.ts diff --git a/clients/client-sso/commands/ListAccountRolesCommand.ts b/clients/client-sso/src/commands/ListAccountRolesCommand.ts similarity index 100% rename from clients/client-sso/commands/ListAccountRolesCommand.ts rename to clients/client-sso/src/commands/ListAccountRolesCommand.ts diff --git a/clients/client-sso/commands/ListAccountsCommand.ts b/clients/client-sso/src/commands/ListAccountsCommand.ts similarity index 100% rename from clients/client-sso/commands/ListAccountsCommand.ts rename to clients/client-sso/src/commands/ListAccountsCommand.ts diff --git a/clients/client-sso/commands/LogoutCommand.ts b/clients/client-sso/src/commands/LogoutCommand.ts similarity index 100% rename from clients/client-sso/commands/LogoutCommand.ts rename to clients/client-sso/src/commands/LogoutCommand.ts diff --git a/clients/client-sso/endpoints.ts b/clients/client-sso/src/endpoints.ts similarity index 100% rename from clients/client-sso/endpoints.ts rename to clients/client-sso/src/endpoints.ts diff --git a/clients/client-sso/index.ts b/clients/client-sso/src/index.ts similarity index 100% rename from clients/client-sso/index.ts rename to clients/client-sso/src/index.ts diff --git a/clients/client-sso/models/index.ts b/clients/client-sso/src/models/index.ts similarity index 100% rename from clients/client-sso/models/index.ts rename to clients/client-sso/src/models/index.ts diff --git a/clients/client-sso/models/models_0.ts b/clients/client-sso/src/models/models_0.ts similarity index 100% rename from clients/client-sso/models/models_0.ts rename to clients/client-sso/src/models/models_0.ts diff --git a/clients/client-sso/pagination/Interfaces.ts b/clients/client-sso/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-sso/pagination/Interfaces.ts rename to clients/client-sso/src/pagination/Interfaces.ts diff --git a/clients/client-sso/pagination/ListAccountRolesPaginator.ts b/clients/client-sso/src/pagination/ListAccountRolesPaginator.ts similarity index 100% rename from clients/client-sso/pagination/ListAccountRolesPaginator.ts rename to clients/client-sso/src/pagination/ListAccountRolesPaginator.ts diff --git a/clients/client-sso/pagination/ListAccountsPaginator.ts b/clients/client-sso/src/pagination/ListAccountsPaginator.ts similarity index 100% rename from clients/client-sso/pagination/ListAccountsPaginator.ts rename to clients/client-sso/src/pagination/ListAccountsPaginator.ts diff --git a/clients/client-sso/protocols/Aws_restJson1.ts b/clients/client-sso/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-sso/protocols/Aws_restJson1.ts rename to clients/client-sso/src/protocols/Aws_restJson1.ts diff --git a/clients/client-sso/src/runtimeConfig.browser.ts b/clients/client-sso/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..246c434c4ab3 --- /dev/null +++ b/clients/client-sso/src/runtimeConfig.browser.ts @@ -0,0 +1,39 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SSOClientConfig } from "./SSOClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso/runtimeConfig.native.ts b/clients/client-sso/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sso/runtimeConfig.native.ts rename to clients/client-sso/src/runtimeConfig.native.ts diff --git a/clients/client-sso/runtimeConfig.shared.ts b/clients/client-sso/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sso/runtimeConfig.shared.ts rename to clients/client-sso/src/runtimeConfig.shared.ts diff --git a/clients/client-sso/src/runtimeConfig.ts b/clients/client-sso/src/runtimeConfig.ts new file mode 100644 index 000000000000..3c34a8c49749 --- /dev/null +++ b/clients/client-sso/src/runtimeConfig.ts @@ -0,0 +1,42 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SSOClientConfig } from "./SSOClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SSOClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sso/tsconfig.es.json b/clients/client-sso/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sso/tsconfig.es.json +++ b/clients/client-sso/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sso/tsconfig.json b/clients/client-sso/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sso/tsconfig.json +++ b/clients/client-sso/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sso/tsconfig.types.json b/clients/client-sso/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sso/tsconfig.types.json +++ b/clients/client-sso/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-storage-gateway/.gitignore b/clients/client-storage-gateway/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-storage-gateway/.gitignore +++ b/clients/client-storage-gateway/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-storage-gateway/package.json b/clients/client-storage-gateway/package.json index 6d183e06968e..dec7367d5d90 100644 --- a/clients/client-storage-gateway/package.json +++ b/clients/client-storage-gateway/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-storage-gateway", "repository": { "type": "git", diff --git a/clients/client-storage-gateway/runtimeConfig.browser.ts b/clients/client-storage-gateway/runtimeConfig.browser.ts deleted file mode 100644 index c6595a98c0b4..000000000000 --- a/clients/client-storage-gateway/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { StorageGatewayClientConfig } from "./StorageGatewayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-storage-gateway/runtimeConfig.ts b/clients/client-storage-gateway/runtimeConfig.ts deleted file mode 100644 index 18194208f191..000000000000 --- a/clients/client-storage-gateway/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { StorageGatewayClientConfig } from "./StorageGatewayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-storage-gateway/StorageGateway.ts b/clients/client-storage-gateway/src/StorageGateway.ts similarity index 100% rename from clients/client-storage-gateway/StorageGateway.ts rename to clients/client-storage-gateway/src/StorageGateway.ts diff --git a/clients/client-storage-gateway/StorageGatewayClient.ts b/clients/client-storage-gateway/src/StorageGatewayClient.ts similarity index 100% rename from clients/client-storage-gateway/StorageGatewayClient.ts rename to clients/client-storage-gateway/src/StorageGatewayClient.ts diff --git a/clients/client-storage-gateway/commands/ActivateGatewayCommand.ts b/clients/client-storage-gateway/src/commands/ActivateGatewayCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ActivateGatewayCommand.ts rename to clients/client-storage-gateway/src/commands/ActivateGatewayCommand.ts diff --git a/clients/client-storage-gateway/commands/AddCacheCommand.ts b/clients/client-storage-gateway/src/commands/AddCacheCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AddCacheCommand.ts rename to clients/client-storage-gateway/src/commands/AddCacheCommand.ts diff --git a/clients/client-storage-gateway/commands/AddTagsToResourceCommand.ts b/clients/client-storage-gateway/src/commands/AddTagsToResourceCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AddTagsToResourceCommand.ts rename to clients/client-storage-gateway/src/commands/AddTagsToResourceCommand.ts diff --git a/clients/client-storage-gateway/commands/AddUploadBufferCommand.ts b/clients/client-storage-gateway/src/commands/AddUploadBufferCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AddUploadBufferCommand.ts rename to clients/client-storage-gateway/src/commands/AddUploadBufferCommand.ts diff --git a/clients/client-storage-gateway/commands/AddWorkingStorageCommand.ts b/clients/client-storage-gateway/src/commands/AddWorkingStorageCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AddWorkingStorageCommand.ts rename to clients/client-storage-gateway/src/commands/AddWorkingStorageCommand.ts diff --git a/clients/client-storage-gateway/commands/AssignTapePoolCommand.ts b/clients/client-storage-gateway/src/commands/AssignTapePoolCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AssignTapePoolCommand.ts rename to clients/client-storage-gateway/src/commands/AssignTapePoolCommand.ts diff --git a/clients/client-storage-gateway/commands/AssociateFileSystemCommand.ts b/clients/client-storage-gateway/src/commands/AssociateFileSystemCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AssociateFileSystemCommand.ts rename to clients/client-storage-gateway/src/commands/AssociateFileSystemCommand.ts diff --git a/clients/client-storage-gateway/commands/AttachVolumeCommand.ts b/clients/client-storage-gateway/src/commands/AttachVolumeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/AttachVolumeCommand.ts rename to clients/client-storage-gateway/src/commands/AttachVolumeCommand.ts diff --git a/clients/client-storage-gateway/commands/CancelArchivalCommand.ts b/clients/client-storage-gateway/src/commands/CancelArchivalCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CancelArchivalCommand.ts rename to clients/client-storage-gateway/src/commands/CancelArchivalCommand.ts diff --git a/clients/client-storage-gateway/commands/CancelRetrievalCommand.ts b/clients/client-storage-gateway/src/commands/CancelRetrievalCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CancelRetrievalCommand.ts rename to clients/client-storage-gateway/src/commands/CancelRetrievalCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateCachediSCSIVolumeCommand.ts b/clients/client-storage-gateway/src/commands/CreateCachediSCSIVolumeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateCachediSCSIVolumeCommand.ts rename to clients/client-storage-gateway/src/commands/CreateCachediSCSIVolumeCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateNFSFileShareCommand.ts b/clients/client-storage-gateway/src/commands/CreateNFSFileShareCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateNFSFileShareCommand.ts rename to clients/client-storage-gateway/src/commands/CreateNFSFileShareCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateSMBFileShareCommand.ts b/clients/client-storage-gateway/src/commands/CreateSMBFileShareCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateSMBFileShareCommand.ts rename to clients/client-storage-gateway/src/commands/CreateSMBFileShareCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateSnapshotCommand.ts b/clients/client-storage-gateway/src/commands/CreateSnapshotCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateSnapshotCommand.ts rename to clients/client-storage-gateway/src/commands/CreateSnapshotCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateSnapshotFromVolumeRecoveryPointCommand.ts b/clients/client-storage-gateway/src/commands/CreateSnapshotFromVolumeRecoveryPointCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateSnapshotFromVolumeRecoveryPointCommand.ts rename to clients/client-storage-gateway/src/commands/CreateSnapshotFromVolumeRecoveryPointCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateStorediSCSIVolumeCommand.ts b/clients/client-storage-gateway/src/commands/CreateStorediSCSIVolumeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateStorediSCSIVolumeCommand.ts rename to clients/client-storage-gateway/src/commands/CreateStorediSCSIVolumeCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateTapePoolCommand.ts b/clients/client-storage-gateway/src/commands/CreateTapePoolCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateTapePoolCommand.ts rename to clients/client-storage-gateway/src/commands/CreateTapePoolCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateTapeWithBarcodeCommand.ts b/clients/client-storage-gateway/src/commands/CreateTapeWithBarcodeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateTapeWithBarcodeCommand.ts rename to clients/client-storage-gateway/src/commands/CreateTapeWithBarcodeCommand.ts diff --git a/clients/client-storage-gateway/commands/CreateTapesCommand.ts b/clients/client-storage-gateway/src/commands/CreateTapesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/CreateTapesCommand.ts rename to clients/client-storage-gateway/src/commands/CreateTapesCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteAutomaticTapeCreationPolicyCommand.ts b/clients/client-storage-gateway/src/commands/DeleteAutomaticTapeCreationPolicyCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteAutomaticTapeCreationPolicyCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteAutomaticTapeCreationPolicyCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteBandwidthRateLimitCommand.ts b/clients/client-storage-gateway/src/commands/DeleteBandwidthRateLimitCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteBandwidthRateLimitCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteBandwidthRateLimitCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteChapCredentialsCommand.ts b/clients/client-storage-gateway/src/commands/DeleteChapCredentialsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteChapCredentialsCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteChapCredentialsCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteFileShareCommand.ts b/clients/client-storage-gateway/src/commands/DeleteFileShareCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteFileShareCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteFileShareCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteGatewayCommand.ts b/clients/client-storage-gateway/src/commands/DeleteGatewayCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteGatewayCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteGatewayCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteSnapshotScheduleCommand.ts b/clients/client-storage-gateway/src/commands/DeleteSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteSnapshotScheduleCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteSnapshotScheduleCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteTapeArchiveCommand.ts b/clients/client-storage-gateway/src/commands/DeleteTapeArchiveCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteTapeArchiveCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteTapeArchiveCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteTapeCommand.ts b/clients/client-storage-gateway/src/commands/DeleteTapeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteTapeCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteTapeCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteTapePoolCommand.ts b/clients/client-storage-gateway/src/commands/DeleteTapePoolCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteTapePoolCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteTapePoolCommand.ts diff --git a/clients/client-storage-gateway/commands/DeleteVolumeCommand.ts b/clients/client-storage-gateway/src/commands/DeleteVolumeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DeleteVolumeCommand.ts rename to clients/client-storage-gateway/src/commands/DeleteVolumeCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeAvailabilityMonitorTestCommand.ts b/clients/client-storage-gateway/src/commands/DescribeAvailabilityMonitorTestCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeAvailabilityMonitorTestCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeAvailabilityMonitorTestCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeBandwidthRateLimitCommand.ts b/clients/client-storage-gateway/src/commands/DescribeBandwidthRateLimitCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeBandwidthRateLimitCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeBandwidthRateLimitCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeBandwidthRateLimitScheduleCommand.ts b/clients/client-storage-gateway/src/commands/DescribeBandwidthRateLimitScheduleCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeBandwidthRateLimitScheduleCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeBandwidthRateLimitScheduleCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeCacheCommand.ts b/clients/client-storage-gateway/src/commands/DescribeCacheCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeCacheCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeCacheCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeCachediSCSIVolumesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeCachediSCSIVolumesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeCachediSCSIVolumesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeCachediSCSIVolumesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeChapCredentialsCommand.ts b/clients/client-storage-gateway/src/commands/DescribeChapCredentialsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeChapCredentialsCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeChapCredentialsCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeFileSystemAssociationsCommand.ts b/clients/client-storage-gateway/src/commands/DescribeFileSystemAssociationsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeFileSystemAssociationsCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeFileSystemAssociationsCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeGatewayInformationCommand.ts b/clients/client-storage-gateway/src/commands/DescribeGatewayInformationCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeGatewayInformationCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeGatewayInformationCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeMaintenanceStartTimeCommand.ts b/clients/client-storage-gateway/src/commands/DescribeMaintenanceStartTimeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeMaintenanceStartTimeCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeMaintenanceStartTimeCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeNFSFileSharesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeNFSFileSharesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeNFSFileSharesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeNFSFileSharesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeSMBFileSharesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeSMBFileSharesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeSMBFileSharesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeSMBFileSharesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeSMBSettingsCommand.ts b/clients/client-storage-gateway/src/commands/DescribeSMBSettingsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeSMBSettingsCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeSMBSettingsCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeSnapshotScheduleCommand.ts b/clients/client-storage-gateway/src/commands/DescribeSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeSnapshotScheduleCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeSnapshotScheduleCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeStorediSCSIVolumesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeStorediSCSIVolumesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeStorediSCSIVolumesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeStorediSCSIVolumesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeTapeArchivesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeTapeArchivesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeTapeArchivesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeTapeArchivesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeTapeRecoveryPointsCommand.ts b/clients/client-storage-gateway/src/commands/DescribeTapeRecoveryPointsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeTapeRecoveryPointsCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeTapeRecoveryPointsCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeTapesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeTapesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeTapesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeTapesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeUploadBufferCommand.ts b/clients/client-storage-gateway/src/commands/DescribeUploadBufferCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeUploadBufferCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeUploadBufferCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeVTLDevicesCommand.ts b/clients/client-storage-gateway/src/commands/DescribeVTLDevicesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeVTLDevicesCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeVTLDevicesCommand.ts diff --git a/clients/client-storage-gateway/commands/DescribeWorkingStorageCommand.ts b/clients/client-storage-gateway/src/commands/DescribeWorkingStorageCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DescribeWorkingStorageCommand.ts rename to clients/client-storage-gateway/src/commands/DescribeWorkingStorageCommand.ts diff --git a/clients/client-storage-gateway/commands/DetachVolumeCommand.ts b/clients/client-storage-gateway/src/commands/DetachVolumeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DetachVolumeCommand.ts rename to clients/client-storage-gateway/src/commands/DetachVolumeCommand.ts diff --git a/clients/client-storage-gateway/commands/DisableGatewayCommand.ts b/clients/client-storage-gateway/src/commands/DisableGatewayCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DisableGatewayCommand.ts rename to clients/client-storage-gateway/src/commands/DisableGatewayCommand.ts diff --git a/clients/client-storage-gateway/commands/DisassociateFileSystemCommand.ts b/clients/client-storage-gateway/src/commands/DisassociateFileSystemCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/DisassociateFileSystemCommand.ts rename to clients/client-storage-gateway/src/commands/DisassociateFileSystemCommand.ts diff --git a/clients/client-storage-gateway/commands/JoinDomainCommand.ts b/clients/client-storage-gateway/src/commands/JoinDomainCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/JoinDomainCommand.ts rename to clients/client-storage-gateway/src/commands/JoinDomainCommand.ts diff --git a/clients/client-storage-gateway/commands/ListAutomaticTapeCreationPoliciesCommand.ts b/clients/client-storage-gateway/src/commands/ListAutomaticTapeCreationPoliciesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListAutomaticTapeCreationPoliciesCommand.ts rename to clients/client-storage-gateway/src/commands/ListAutomaticTapeCreationPoliciesCommand.ts diff --git a/clients/client-storage-gateway/commands/ListFileSharesCommand.ts b/clients/client-storage-gateway/src/commands/ListFileSharesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListFileSharesCommand.ts rename to clients/client-storage-gateway/src/commands/ListFileSharesCommand.ts diff --git a/clients/client-storage-gateway/commands/ListFileSystemAssociationsCommand.ts b/clients/client-storage-gateway/src/commands/ListFileSystemAssociationsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListFileSystemAssociationsCommand.ts rename to clients/client-storage-gateway/src/commands/ListFileSystemAssociationsCommand.ts diff --git a/clients/client-storage-gateway/commands/ListGatewaysCommand.ts b/clients/client-storage-gateway/src/commands/ListGatewaysCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListGatewaysCommand.ts rename to clients/client-storage-gateway/src/commands/ListGatewaysCommand.ts diff --git a/clients/client-storage-gateway/commands/ListLocalDisksCommand.ts b/clients/client-storage-gateway/src/commands/ListLocalDisksCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListLocalDisksCommand.ts rename to clients/client-storage-gateway/src/commands/ListLocalDisksCommand.ts diff --git a/clients/client-storage-gateway/commands/ListTagsForResourceCommand.ts b/clients/client-storage-gateway/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListTagsForResourceCommand.ts rename to clients/client-storage-gateway/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-storage-gateway/commands/ListTapePoolsCommand.ts b/clients/client-storage-gateway/src/commands/ListTapePoolsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListTapePoolsCommand.ts rename to clients/client-storage-gateway/src/commands/ListTapePoolsCommand.ts diff --git a/clients/client-storage-gateway/commands/ListTapesCommand.ts b/clients/client-storage-gateway/src/commands/ListTapesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListTapesCommand.ts rename to clients/client-storage-gateway/src/commands/ListTapesCommand.ts diff --git a/clients/client-storage-gateway/commands/ListVolumeInitiatorsCommand.ts b/clients/client-storage-gateway/src/commands/ListVolumeInitiatorsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListVolumeInitiatorsCommand.ts rename to clients/client-storage-gateway/src/commands/ListVolumeInitiatorsCommand.ts diff --git a/clients/client-storage-gateway/commands/ListVolumeRecoveryPointsCommand.ts b/clients/client-storage-gateway/src/commands/ListVolumeRecoveryPointsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListVolumeRecoveryPointsCommand.ts rename to clients/client-storage-gateway/src/commands/ListVolumeRecoveryPointsCommand.ts diff --git a/clients/client-storage-gateway/commands/ListVolumesCommand.ts b/clients/client-storage-gateway/src/commands/ListVolumesCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ListVolumesCommand.ts rename to clients/client-storage-gateway/src/commands/ListVolumesCommand.ts diff --git a/clients/client-storage-gateway/commands/NotifyWhenUploadedCommand.ts b/clients/client-storage-gateway/src/commands/NotifyWhenUploadedCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/NotifyWhenUploadedCommand.ts rename to clients/client-storage-gateway/src/commands/NotifyWhenUploadedCommand.ts diff --git a/clients/client-storage-gateway/commands/RefreshCacheCommand.ts b/clients/client-storage-gateway/src/commands/RefreshCacheCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/RefreshCacheCommand.ts rename to clients/client-storage-gateway/src/commands/RefreshCacheCommand.ts diff --git a/clients/client-storage-gateway/commands/RemoveTagsFromResourceCommand.ts b/clients/client-storage-gateway/src/commands/RemoveTagsFromResourceCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/RemoveTagsFromResourceCommand.ts rename to clients/client-storage-gateway/src/commands/RemoveTagsFromResourceCommand.ts diff --git a/clients/client-storage-gateway/commands/ResetCacheCommand.ts b/clients/client-storage-gateway/src/commands/ResetCacheCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ResetCacheCommand.ts rename to clients/client-storage-gateway/src/commands/ResetCacheCommand.ts diff --git a/clients/client-storage-gateway/commands/RetrieveTapeArchiveCommand.ts b/clients/client-storage-gateway/src/commands/RetrieveTapeArchiveCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/RetrieveTapeArchiveCommand.ts rename to clients/client-storage-gateway/src/commands/RetrieveTapeArchiveCommand.ts diff --git a/clients/client-storage-gateway/commands/RetrieveTapeRecoveryPointCommand.ts b/clients/client-storage-gateway/src/commands/RetrieveTapeRecoveryPointCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/RetrieveTapeRecoveryPointCommand.ts rename to clients/client-storage-gateway/src/commands/RetrieveTapeRecoveryPointCommand.ts diff --git a/clients/client-storage-gateway/commands/SetLocalConsolePasswordCommand.ts b/clients/client-storage-gateway/src/commands/SetLocalConsolePasswordCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/SetLocalConsolePasswordCommand.ts rename to clients/client-storage-gateway/src/commands/SetLocalConsolePasswordCommand.ts diff --git a/clients/client-storage-gateway/commands/SetSMBGuestPasswordCommand.ts b/clients/client-storage-gateway/src/commands/SetSMBGuestPasswordCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/SetSMBGuestPasswordCommand.ts rename to clients/client-storage-gateway/src/commands/SetSMBGuestPasswordCommand.ts diff --git a/clients/client-storage-gateway/commands/ShutdownGatewayCommand.ts b/clients/client-storage-gateway/src/commands/ShutdownGatewayCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/ShutdownGatewayCommand.ts rename to clients/client-storage-gateway/src/commands/ShutdownGatewayCommand.ts diff --git a/clients/client-storage-gateway/commands/StartAvailabilityMonitorTestCommand.ts b/clients/client-storage-gateway/src/commands/StartAvailabilityMonitorTestCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/StartAvailabilityMonitorTestCommand.ts rename to clients/client-storage-gateway/src/commands/StartAvailabilityMonitorTestCommand.ts diff --git a/clients/client-storage-gateway/commands/StartGatewayCommand.ts b/clients/client-storage-gateway/src/commands/StartGatewayCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/StartGatewayCommand.ts rename to clients/client-storage-gateway/src/commands/StartGatewayCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateAutomaticTapeCreationPolicyCommand.ts b/clients/client-storage-gateway/src/commands/UpdateAutomaticTapeCreationPolicyCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateAutomaticTapeCreationPolicyCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateAutomaticTapeCreationPolicyCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateBandwidthRateLimitCommand.ts b/clients/client-storage-gateway/src/commands/UpdateBandwidthRateLimitCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateBandwidthRateLimitCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateBandwidthRateLimitCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateBandwidthRateLimitScheduleCommand.ts b/clients/client-storage-gateway/src/commands/UpdateBandwidthRateLimitScheduleCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateBandwidthRateLimitScheduleCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateBandwidthRateLimitScheduleCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateChapCredentialsCommand.ts b/clients/client-storage-gateway/src/commands/UpdateChapCredentialsCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateChapCredentialsCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateChapCredentialsCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateFileSystemAssociationCommand.ts b/clients/client-storage-gateway/src/commands/UpdateFileSystemAssociationCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateFileSystemAssociationCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateFileSystemAssociationCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateGatewayInformationCommand.ts b/clients/client-storage-gateway/src/commands/UpdateGatewayInformationCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateGatewayInformationCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateGatewayInformationCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateGatewaySoftwareNowCommand.ts b/clients/client-storage-gateway/src/commands/UpdateGatewaySoftwareNowCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateGatewaySoftwareNowCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateGatewaySoftwareNowCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateMaintenanceStartTimeCommand.ts b/clients/client-storage-gateway/src/commands/UpdateMaintenanceStartTimeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateMaintenanceStartTimeCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateMaintenanceStartTimeCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateNFSFileShareCommand.ts b/clients/client-storage-gateway/src/commands/UpdateNFSFileShareCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateNFSFileShareCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateNFSFileShareCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateSMBFileShareCommand.ts b/clients/client-storage-gateway/src/commands/UpdateSMBFileShareCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateSMBFileShareCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateSMBFileShareCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateSMBFileShareVisibilityCommand.ts b/clients/client-storage-gateway/src/commands/UpdateSMBFileShareVisibilityCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateSMBFileShareVisibilityCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateSMBFileShareVisibilityCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateSMBSecurityStrategyCommand.ts b/clients/client-storage-gateway/src/commands/UpdateSMBSecurityStrategyCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateSMBSecurityStrategyCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateSMBSecurityStrategyCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateSnapshotScheduleCommand.ts b/clients/client-storage-gateway/src/commands/UpdateSnapshotScheduleCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateSnapshotScheduleCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateSnapshotScheduleCommand.ts diff --git a/clients/client-storage-gateway/commands/UpdateVTLDeviceTypeCommand.ts b/clients/client-storage-gateway/src/commands/UpdateVTLDeviceTypeCommand.ts similarity index 100% rename from clients/client-storage-gateway/commands/UpdateVTLDeviceTypeCommand.ts rename to clients/client-storage-gateway/src/commands/UpdateVTLDeviceTypeCommand.ts diff --git a/clients/client-storage-gateway/endpoints.ts b/clients/client-storage-gateway/src/endpoints.ts similarity index 100% rename from clients/client-storage-gateway/endpoints.ts rename to clients/client-storage-gateway/src/endpoints.ts diff --git a/clients/client-storage-gateway/index.ts b/clients/client-storage-gateway/src/index.ts similarity index 100% rename from clients/client-storage-gateway/index.ts rename to clients/client-storage-gateway/src/index.ts diff --git a/clients/client-storage-gateway/models/index.ts b/clients/client-storage-gateway/src/models/index.ts similarity index 100% rename from clients/client-storage-gateway/models/index.ts rename to clients/client-storage-gateway/src/models/index.ts diff --git a/clients/client-storage-gateway/models/models_0.ts b/clients/client-storage-gateway/src/models/models_0.ts similarity index 100% rename from clients/client-storage-gateway/models/models_0.ts rename to clients/client-storage-gateway/src/models/models_0.ts diff --git a/clients/client-storage-gateway/pagination/DescribeTapeArchivesPaginator.ts b/clients/client-storage-gateway/src/pagination/DescribeTapeArchivesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/DescribeTapeArchivesPaginator.ts rename to clients/client-storage-gateway/src/pagination/DescribeTapeArchivesPaginator.ts diff --git a/clients/client-storage-gateway/pagination/DescribeTapeRecoveryPointsPaginator.ts b/clients/client-storage-gateway/src/pagination/DescribeTapeRecoveryPointsPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/DescribeTapeRecoveryPointsPaginator.ts rename to clients/client-storage-gateway/src/pagination/DescribeTapeRecoveryPointsPaginator.ts diff --git a/clients/client-storage-gateway/pagination/DescribeTapesPaginator.ts b/clients/client-storage-gateway/src/pagination/DescribeTapesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/DescribeTapesPaginator.ts rename to clients/client-storage-gateway/src/pagination/DescribeTapesPaginator.ts diff --git a/clients/client-storage-gateway/pagination/DescribeVTLDevicesPaginator.ts b/clients/client-storage-gateway/src/pagination/DescribeVTLDevicesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/DescribeVTLDevicesPaginator.ts rename to clients/client-storage-gateway/src/pagination/DescribeVTLDevicesPaginator.ts diff --git a/clients/client-storage-gateway/pagination/Interfaces.ts b/clients/client-storage-gateway/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-storage-gateway/pagination/Interfaces.ts rename to clients/client-storage-gateway/src/pagination/Interfaces.ts diff --git a/clients/client-storage-gateway/pagination/ListFileSharesPaginator.ts b/clients/client-storage-gateway/src/pagination/ListFileSharesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListFileSharesPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListFileSharesPaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListFileSystemAssociationsPaginator.ts b/clients/client-storage-gateway/src/pagination/ListFileSystemAssociationsPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListFileSystemAssociationsPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListFileSystemAssociationsPaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListGatewaysPaginator.ts b/clients/client-storage-gateway/src/pagination/ListGatewaysPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListGatewaysPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListGatewaysPaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListTagsForResourcePaginator.ts b/clients/client-storage-gateway/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListTagsForResourcePaginator.ts rename to clients/client-storage-gateway/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListTapePoolsPaginator.ts b/clients/client-storage-gateway/src/pagination/ListTapePoolsPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListTapePoolsPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListTapePoolsPaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListTapesPaginator.ts b/clients/client-storage-gateway/src/pagination/ListTapesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListTapesPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListTapesPaginator.ts diff --git a/clients/client-storage-gateway/pagination/ListVolumesPaginator.ts b/clients/client-storage-gateway/src/pagination/ListVolumesPaginator.ts similarity index 100% rename from clients/client-storage-gateway/pagination/ListVolumesPaginator.ts rename to clients/client-storage-gateway/src/pagination/ListVolumesPaginator.ts diff --git a/clients/client-storage-gateway/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-storage-gateway/protocols/Aws_json1_1.ts rename to clients/client-storage-gateway/src/protocols/Aws_json1_1.ts diff --git a/clients/client-storage-gateway/src/runtimeConfig.browser.ts b/clients/client-storage-gateway/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c1534734c892 --- /dev/null +++ b/clients/client-storage-gateway/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { StorageGatewayClientConfig } from "./StorageGatewayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-storage-gateway/runtimeConfig.native.ts b/clients/client-storage-gateway/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-storage-gateway/runtimeConfig.native.ts rename to clients/client-storage-gateway/src/runtimeConfig.native.ts diff --git a/clients/client-storage-gateway/runtimeConfig.shared.ts b/clients/client-storage-gateway/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-storage-gateway/runtimeConfig.shared.ts rename to clients/client-storage-gateway/src/runtimeConfig.shared.ts diff --git a/clients/client-storage-gateway/src/runtimeConfig.ts b/clients/client-storage-gateway/src/runtimeConfig.ts new file mode 100644 index 000000000000..89cf04e6fb2b --- /dev/null +++ b/clients/client-storage-gateway/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { StorageGatewayClientConfig } from "./StorageGatewayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-storage-gateway/tsconfig.es.json b/clients/client-storage-gateway/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-storage-gateway/tsconfig.es.json +++ b/clients/client-storage-gateway/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-storage-gateway/tsconfig.json b/clients/client-storage-gateway/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-storage-gateway/tsconfig.json +++ b/clients/client-storage-gateway/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-storage-gateway/tsconfig.types.json b/clients/client-storage-gateway/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-storage-gateway/tsconfig.types.json +++ b/clients/client-storage-gateway/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-sts/.gitignore b/clients/client-sts/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-sts/.gitignore +++ b/clients/client-sts/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-sts/package.json b/clients/client-sts/package.json index 173a1b750116..e286ba8aec2e 100644 --- a/clients/client-sts/package.json +++ b/clients/client-sts/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts", "repository": { "type": "git", diff --git a/clients/client-sts/runtimeConfig.browser.ts b/clients/client-sts/runtimeConfig.browser.ts deleted file mode 100644 index 0948f1eefdbf..000000000000 --- a/clients/client-sts/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { STSClientConfig } from "./STSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: STSClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sts/runtimeConfig.ts b/clients/client-sts/runtimeConfig.ts deleted file mode 100644 index b42095f5bd50..000000000000 --- a/clients/client-sts/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "./defaultStsRoleAssumers"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { STSClientConfig } from "./STSClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: STSClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-sts/STS.ts b/clients/client-sts/src/STS.ts similarity index 100% rename from clients/client-sts/STS.ts rename to clients/client-sts/src/STS.ts diff --git a/clients/client-sts/STSClient.ts b/clients/client-sts/src/STSClient.ts similarity index 100% rename from clients/client-sts/STSClient.ts rename to clients/client-sts/src/STSClient.ts diff --git a/clients/client-sts/commands/AssumeRoleCommand.ts b/clients/client-sts/src/commands/AssumeRoleCommand.ts similarity index 100% rename from clients/client-sts/commands/AssumeRoleCommand.ts rename to clients/client-sts/src/commands/AssumeRoleCommand.ts diff --git a/clients/client-sts/commands/AssumeRoleWithSAMLCommand.ts b/clients/client-sts/src/commands/AssumeRoleWithSAMLCommand.ts similarity index 100% rename from clients/client-sts/commands/AssumeRoleWithSAMLCommand.ts rename to clients/client-sts/src/commands/AssumeRoleWithSAMLCommand.ts diff --git a/clients/client-sts/commands/AssumeRoleWithWebIdentityCommand.ts b/clients/client-sts/src/commands/AssumeRoleWithWebIdentityCommand.ts similarity index 100% rename from clients/client-sts/commands/AssumeRoleWithWebIdentityCommand.ts rename to clients/client-sts/src/commands/AssumeRoleWithWebIdentityCommand.ts diff --git a/clients/client-sts/commands/DecodeAuthorizationMessageCommand.ts b/clients/client-sts/src/commands/DecodeAuthorizationMessageCommand.ts similarity index 100% rename from clients/client-sts/commands/DecodeAuthorizationMessageCommand.ts rename to clients/client-sts/src/commands/DecodeAuthorizationMessageCommand.ts diff --git a/clients/client-sts/commands/GetAccessKeyInfoCommand.ts b/clients/client-sts/src/commands/GetAccessKeyInfoCommand.ts similarity index 100% rename from clients/client-sts/commands/GetAccessKeyInfoCommand.ts rename to clients/client-sts/src/commands/GetAccessKeyInfoCommand.ts diff --git a/clients/client-sts/commands/GetCallerIdentityCommand.ts b/clients/client-sts/src/commands/GetCallerIdentityCommand.ts similarity index 100% rename from clients/client-sts/commands/GetCallerIdentityCommand.ts rename to clients/client-sts/src/commands/GetCallerIdentityCommand.ts diff --git a/clients/client-sts/commands/GetFederationTokenCommand.ts b/clients/client-sts/src/commands/GetFederationTokenCommand.ts similarity index 100% rename from clients/client-sts/commands/GetFederationTokenCommand.ts rename to clients/client-sts/src/commands/GetFederationTokenCommand.ts diff --git a/clients/client-sts/commands/GetSessionTokenCommand.ts b/clients/client-sts/src/commands/GetSessionTokenCommand.ts similarity index 100% rename from clients/client-sts/commands/GetSessionTokenCommand.ts rename to clients/client-sts/src/commands/GetSessionTokenCommand.ts diff --git a/clients/client-sts/defaultRoleAssumers.ts b/clients/client-sts/src/defaultRoleAssumers.ts similarity index 100% rename from clients/client-sts/defaultRoleAssumers.ts rename to clients/client-sts/src/defaultRoleAssumers.ts diff --git a/clients/client-sts/defaultStsRoleAssumers.ts b/clients/client-sts/src/defaultStsRoleAssumers.ts similarity index 100% rename from clients/client-sts/defaultStsRoleAssumers.ts rename to clients/client-sts/src/defaultStsRoleAssumers.ts diff --git a/clients/client-sts/endpoints.ts b/clients/client-sts/src/endpoints.ts similarity index 100% rename from clients/client-sts/endpoints.ts rename to clients/client-sts/src/endpoints.ts diff --git a/clients/client-sts/index.ts b/clients/client-sts/src/index.ts similarity index 100% rename from clients/client-sts/index.ts rename to clients/client-sts/src/index.ts diff --git a/clients/client-sts/models/index.ts b/clients/client-sts/src/models/index.ts similarity index 100% rename from clients/client-sts/models/index.ts rename to clients/client-sts/src/models/index.ts diff --git a/clients/client-sts/models/models_0.ts b/clients/client-sts/src/models/models_0.ts similarity index 100% rename from clients/client-sts/models/models_0.ts rename to clients/client-sts/src/models/models_0.ts diff --git a/clients/client-sts/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts similarity index 100% rename from clients/client-sts/protocols/Aws_query.ts rename to clients/client-sts/src/protocols/Aws_query.ts diff --git a/clients/client-sts/src/runtimeConfig.browser.ts b/clients/client-sts/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b9cedd811eff --- /dev/null +++ b/clients/client-sts/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { STSClientConfig } from "./STSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: STSClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sts/runtimeConfig.native.ts b/clients/client-sts/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-sts/runtimeConfig.native.ts rename to clients/client-sts/src/runtimeConfig.native.ts diff --git a/clients/client-sts/runtimeConfig.shared.ts b/clients/client-sts/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-sts/runtimeConfig.shared.ts rename to clients/client-sts/src/runtimeConfig.shared.ts diff --git a/clients/client-sts/src/runtimeConfig.ts b/clients/client-sts/src/runtimeConfig.ts new file mode 100644 index 000000000000..566301865778 --- /dev/null +++ b/clients/client-sts/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "./defaultStsRoleAssumers"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { STSClientConfig } from "./STSClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: STSClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-sts/defaultRoleAssumers.spec.ts b/clients/client-sts/test/defaultRoleAssumers.spec.ts similarity index 93% rename from clients/client-sts/defaultRoleAssumers.spec.ts rename to clients/client-sts/test/defaultRoleAssumers.spec.ts index d3eb987f9fcc..c3030e83803a 100644 --- a/clients/client-sts/defaultRoleAssumers.spec.ts +++ b/clients/client-sts/test/defaultRoleAssumers.spec.ts @@ -17,16 +17,17 @@ jest.mock("@aws-sdk/node-http-handler", () => ({ streamCollector: jest.fn(), })); -import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "./defaultRoleAssumers"; -import type { AssumeRoleCommandInput } from "./commands/AssumeRoleCommand"; import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { AssumeRoleWithWebIdentityCommandInput } from "./commands/AssumeRoleWithWebIdentityCommand"; + +import type { AssumeRoleCommandInput } from "../src/commands/AssumeRoleCommand"; +import { AssumeRoleWithWebIdentityCommandInput } from "../src/commands/AssumeRoleWithWebIdentityCommand"; +import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "../src/defaultRoleAssumers"; const mockConstructorInput = jest.fn(); -jest.mock("./STSClient", () => ({ +jest.mock("../src/STSClient", () => ({ STSClient: function (params: any) { mockConstructorInput(params); //@ts-ignore - return new (jest.requireActual("./STSClient").STSClient)(params); + return new (jest.requireActual("../src/STSClient").STSClient)(params); }, })); diff --git a/clients/client-sts/tsconfig.es.json b/clients/client-sts/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-sts/tsconfig.es.json +++ b/clients/client-sts/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-sts/tsconfig.json b/clients/client-sts/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-sts/tsconfig.json +++ b/clients/client-sts/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-sts/tsconfig.types.json b/clients/client-sts/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-sts/tsconfig.types.json +++ b/clients/client-sts/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-support/.gitignore b/clients/client-support/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-support/.gitignore +++ b/clients/client-support/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-support/package.json b/clients/client-support/package.json index 55011f13ed7a..52854ef3e7bd 100644 --- a/clients/client-support/package.json +++ b/clients/client-support/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-support", "repository": { "type": "git", diff --git a/clients/client-support/runtimeConfig.browser.ts b/clients/client-support/runtimeConfig.browser.ts deleted file mode 100644 index 3fb79ff16ff4..000000000000 --- a/clients/client-support/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SupportClientConfig } from "./SupportClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SupportClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-support/runtimeConfig.ts b/clients/client-support/runtimeConfig.ts deleted file mode 100644 index 7f955e3f519f..000000000000 --- a/clients/client-support/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SupportClientConfig } from "./SupportClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SupportClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-support/Support.ts b/clients/client-support/src/Support.ts similarity index 100% rename from clients/client-support/Support.ts rename to clients/client-support/src/Support.ts diff --git a/clients/client-support/SupportClient.ts b/clients/client-support/src/SupportClient.ts similarity index 100% rename from clients/client-support/SupportClient.ts rename to clients/client-support/src/SupportClient.ts diff --git a/clients/client-support/commands/AddAttachmentsToSetCommand.ts b/clients/client-support/src/commands/AddAttachmentsToSetCommand.ts similarity index 100% rename from clients/client-support/commands/AddAttachmentsToSetCommand.ts rename to clients/client-support/src/commands/AddAttachmentsToSetCommand.ts diff --git a/clients/client-support/commands/AddCommunicationToCaseCommand.ts b/clients/client-support/src/commands/AddCommunicationToCaseCommand.ts similarity index 100% rename from clients/client-support/commands/AddCommunicationToCaseCommand.ts rename to clients/client-support/src/commands/AddCommunicationToCaseCommand.ts diff --git a/clients/client-support/commands/CreateCaseCommand.ts b/clients/client-support/src/commands/CreateCaseCommand.ts similarity index 100% rename from clients/client-support/commands/CreateCaseCommand.ts rename to clients/client-support/src/commands/CreateCaseCommand.ts diff --git a/clients/client-support/commands/DescribeAttachmentCommand.ts b/clients/client-support/src/commands/DescribeAttachmentCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeAttachmentCommand.ts rename to clients/client-support/src/commands/DescribeAttachmentCommand.ts diff --git a/clients/client-support/commands/DescribeCasesCommand.ts b/clients/client-support/src/commands/DescribeCasesCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeCasesCommand.ts rename to clients/client-support/src/commands/DescribeCasesCommand.ts diff --git a/clients/client-support/commands/DescribeCommunicationsCommand.ts b/clients/client-support/src/commands/DescribeCommunicationsCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeCommunicationsCommand.ts rename to clients/client-support/src/commands/DescribeCommunicationsCommand.ts diff --git a/clients/client-support/commands/DescribeServicesCommand.ts b/clients/client-support/src/commands/DescribeServicesCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeServicesCommand.ts rename to clients/client-support/src/commands/DescribeServicesCommand.ts diff --git a/clients/client-support/commands/DescribeSeverityLevelsCommand.ts b/clients/client-support/src/commands/DescribeSeverityLevelsCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeSeverityLevelsCommand.ts rename to clients/client-support/src/commands/DescribeSeverityLevelsCommand.ts diff --git a/clients/client-support/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.ts b/clients/client-support/src/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.ts rename to clients/client-support/src/commands/DescribeTrustedAdvisorCheckRefreshStatusesCommand.ts diff --git a/clients/client-support/commands/DescribeTrustedAdvisorCheckResultCommand.ts b/clients/client-support/src/commands/DescribeTrustedAdvisorCheckResultCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeTrustedAdvisorCheckResultCommand.ts rename to clients/client-support/src/commands/DescribeTrustedAdvisorCheckResultCommand.ts diff --git a/clients/client-support/commands/DescribeTrustedAdvisorCheckSummariesCommand.ts b/clients/client-support/src/commands/DescribeTrustedAdvisorCheckSummariesCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeTrustedAdvisorCheckSummariesCommand.ts rename to clients/client-support/src/commands/DescribeTrustedAdvisorCheckSummariesCommand.ts diff --git a/clients/client-support/commands/DescribeTrustedAdvisorChecksCommand.ts b/clients/client-support/src/commands/DescribeTrustedAdvisorChecksCommand.ts similarity index 100% rename from clients/client-support/commands/DescribeTrustedAdvisorChecksCommand.ts rename to clients/client-support/src/commands/DescribeTrustedAdvisorChecksCommand.ts diff --git a/clients/client-support/commands/RefreshTrustedAdvisorCheckCommand.ts b/clients/client-support/src/commands/RefreshTrustedAdvisorCheckCommand.ts similarity index 100% rename from clients/client-support/commands/RefreshTrustedAdvisorCheckCommand.ts rename to clients/client-support/src/commands/RefreshTrustedAdvisorCheckCommand.ts diff --git a/clients/client-support/commands/ResolveCaseCommand.ts b/clients/client-support/src/commands/ResolveCaseCommand.ts similarity index 100% rename from clients/client-support/commands/ResolveCaseCommand.ts rename to clients/client-support/src/commands/ResolveCaseCommand.ts diff --git a/clients/client-support/endpoints.ts b/clients/client-support/src/endpoints.ts similarity index 100% rename from clients/client-support/endpoints.ts rename to clients/client-support/src/endpoints.ts diff --git a/clients/client-support/index.ts b/clients/client-support/src/index.ts similarity index 100% rename from clients/client-support/index.ts rename to clients/client-support/src/index.ts diff --git a/clients/client-support/models/index.ts b/clients/client-support/src/models/index.ts similarity index 100% rename from clients/client-support/models/index.ts rename to clients/client-support/src/models/index.ts diff --git a/clients/client-support/models/models_0.ts b/clients/client-support/src/models/models_0.ts similarity index 100% rename from clients/client-support/models/models_0.ts rename to clients/client-support/src/models/models_0.ts diff --git a/clients/client-support/pagination/DescribeCasesPaginator.ts b/clients/client-support/src/pagination/DescribeCasesPaginator.ts similarity index 100% rename from clients/client-support/pagination/DescribeCasesPaginator.ts rename to clients/client-support/src/pagination/DescribeCasesPaginator.ts diff --git a/clients/client-support/pagination/DescribeCommunicationsPaginator.ts b/clients/client-support/src/pagination/DescribeCommunicationsPaginator.ts similarity index 100% rename from clients/client-support/pagination/DescribeCommunicationsPaginator.ts rename to clients/client-support/src/pagination/DescribeCommunicationsPaginator.ts diff --git a/clients/client-support/pagination/Interfaces.ts b/clients/client-support/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-support/pagination/Interfaces.ts rename to clients/client-support/src/pagination/Interfaces.ts diff --git a/clients/client-support/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-support/protocols/Aws_json1_1.ts rename to clients/client-support/src/protocols/Aws_json1_1.ts diff --git a/clients/client-support/src/runtimeConfig.browser.ts b/clients/client-support/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d311e0dc3a76 --- /dev/null +++ b/clients/client-support/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SupportClientConfig } from "./SupportClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SupportClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-support/runtimeConfig.native.ts b/clients/client-support/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-support/runtimeConfig.native.ts rename to clients/client-support/src/runtimeConfig.native.ts diff --git a/clients/client-support/runtimeConfig.shared.ts b/clients/client-support/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-support/runtimeConfig.shared.ts rename to clients/client-support/src/runtimeConfig.shared.ts diff --git a/clients/client-support/src/runtimeConfig.ts b/clients/client-support/src/runtimeConfig.ts new file mode 100644 index 000000000000..4e7cea3ea9b9 --- /dev/null +++ b/clients/client-support/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SupportClientConfig } from "./SupportClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SupportClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-support/tsconfig.es.json b/clients/client-support/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-support/tsconfig.es.json +++ b/clients/client-support/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-support/tsconfig.json b/clients/client-support/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-support/tsconfig.json +++ b/clients/client-support/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-support/tsconfig.types.json b/clients/client-support/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-support/tsconfig.types.json +++ b/clients/client-support/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-swf/.gitignore b/clients/client-swf/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-swf/.gitignore +++ b/clients/client-swf/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-swf/package.json b/clients/client-swf/package.json index 39c3b5d1a66e..76e604ea7b2c 100644 --- a/clients/client-swf/package.json +++ b/clients/client-swf/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-swf", "repository": { "type": "git", diff --git a/clients/client-swf/runtimeConfig.browser.ts b/clients/client-swf/runtimeConfig.browser.ts deleted file mode 100644 index f22ffab8798f..000000000000 --- a/clients/client-swf/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SWFClientConfig } from "./SWFClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SWFClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-swf/runtimeConfig.ts b/clients/client-swf/runtimeConfig.ts deleted file mode 100644 index dd7ed70eefaa..000000000000 --- a/clients/client-swf/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SWFClientConfig } from "./SWFClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SWFClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-swf/SWF.ts b/clients/client-swf/src/SWF.ts similarity index 100% rename from clients/client-swf/SWF.ts rename to clients/client-swf/src/SWF.ts diff --git a/clients/client-swf/SWFClient.ts b/clients/client-swf/src/SWFClient.ts similarity index 100% rename from clients/client-swf/SWFClient.ts rename to clients/client-swf/src/SWFClient.ts diff --git a/clients/client-swf/commands/CountClosedWorkflowExecutionsCommand.ts b/clients/client-swf/src/commands/CountClosedWorkflowExecutionsCommand.ts similarity index 100% rename from clients/client-swf/commands/CountClosedWorkflowExecutionsCommand.ts rename to clients/client-swf/src/commands/CountClosedWorkflowExecutionsCommand.ts diff --git a/clients/client-swf/commands/CountOpenWorkflowExecutionsCommand.ts b/clients/client-swf/src/commands/CountOpenWorkflowExecutionsCommand.ts similarity index 100% rename from clients/client-swf/commands/CountOpenWorkflowExecutionsCommand.ts rename to clients/client-swf/src/commands/CountOpenWorkflowExecutionsCommand.ts diff --git a/clients/client-swf/commands/CountPendingActivityTasksCommand.ts b/clients/client-swf/src/commands/CountPendingActivityTasksCommand.ts similarity index 100% rename from clients/client-swf/commands/CountPendingActivityTasksCommand.ts rename to clients/client-swf/src/commands/CountPendingActivityTasksCommand.ts diff --git a/clients/client-swf/commands/CountPendingDecisionTasksCommand.ts b/clients/client-swf/src/commands/CountPendingDecisionTasksCommand.ts similarity index 100% rename from clients/client-swf/commands/CountPendingDecisionTasksCommand.ts rename to clients/client-swf/src/commands/CountPendingDecisionTasksCommand.ts diff --git a/clients/client-swf/commands/DeprecateActivityTypeCommand.ts b/clients/client-swf/src/commands/DeprecateActivityTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/DeprecateActivityTypeCommand.ts rename to clients/client-swf/src/commands/DeprecateActivityTypeCommand.ts diff --git a/clients/client-swf/commands/DeprecateDomainCommand.ts b/clients/client-swf/src/commands/DeprecateDomainCommand.ts similarity index 100% rename from clients/client-swf/commands/DeprecateDomainCommand.ts rename to clients/client-swf/src/commands/DeprecateDomainCommand.ts diff --git a/clients/client-swf/commands/DeprecateWorkflowTypeCommand.ts b/clients/client-swf/src/commands/DeprecateWorkflowTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/DeprecateWorkflowTypeCommand.ts rename to clients/client-swf/src/commands/DeprecateWorkflowTypeCommand.ts diff --git a/clients/client-swf/commands/DescribeActivityTypeCommand.ts b/clients/client-swf/src/commands/DescribeActivityTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/DescribeActivityTypeCommand.ts rename to clients/client-swf/src/commands/DescribeActivityTypeCommand.ts diff --git a/clients/client-swf/commands/DescribeDomainCommand.ts b/clients/client-swf/src/commands/DescribeDomainCommand.ts similarity index 100% rename from clients/client-swf/commands/DescribeDomainCommand.ts rename to clients/client-swf/src/commands/DescribeDomainCommand.ts diff --git a/clients/client-swf/commands/DescribeWorkflowExecutionCommand.ts b/clients/client-swf/src/commands/DescribeWorkflowExecutionCommand.ts similarity index 100% rename from clients/client-swf/commands/DescribeWorkflowExecutionCommand.ts rename to clients/client-swf/src/commands/DescribeWorkflowExecutionCommand.ts diff --git a/clients/client-swf/commands/DescribeWorkflowTypeCommand.ts b/clients/client-swf/src/commands/DescribeWorkflowTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/DescribeWorkflowTypeCommand.ts rename to clients/client-swf/src/commands/DescribeWorkflowTypeCommand.ts diff --git a/clients/client-swf/commands/GetWorkflowExecutionHistoryCommand.ts b/clients/client-swf/src/commands/GetWorkflowExecutionHistoryCommand.ts similarity index 100% rename from clients/client-swf/commands/GetWorkflowExecutionHistoryCommand.ts rename to clients/client-swf/src/commands/GetWorkflowExecutionHistoryCommand.ts diff --git a/clients/client-swf/commands/ListActivityTypesCommand.ts b/clients/client-swf/src/commands/ListActivityTypesCommand.ts similarity index 100% rename from clients/client-swf/commands/ListActivityTypesCommand.ts rename to clients/client-swf/src/commands/ListActivityTypesCommand.ts diff --git a/clients/client-swf/commands/ListClosedWorkflowExecutionsCommand.ts b/clients/client-swf/src/commands/ListClosedWorkflowExecutionsCommand.ts similarity index 100% rename from clients/client-swf/commands/ListClosedWorkflowExecutionsCommand.ts rename to clients/client-swf/src/commands/ListClosedWorkflowExecutionsCommand.ts diff --git a/clients/client-swf/commands/ListDomainsCommand.ts b/clients/client-swf/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-swf/commands/ListDomainsCommand.ts rename to clients/client-swf/src/commands/ListDomainsCommand.ts diff --git a/clients/client-swf/commands/ListOpenWorkflowExecutionsCommand.ts b/clients/client-swf/src/commands/ListOpenWorkflowExecutionsCommand.ts similarity index 100% rename from clients/client-swf/commands/ListOpenWorkflowExecutionsCommand.ts rename to clients/client-swf/src/commands/ListOpenWorkflowExecutionsCommand.ts diff --git a/clients/client-swf/commands/ListTagsForResourceCommand.ts b/clients/client-swf/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-swf/commands/ListTagsForResourceCommand.ts rename to clients/client-swf/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-swf/commands/ListWorkflowTypesCommand.ts b/clients/client-swf/src/commands/ListWorkflowTypesCommand.ts similarity index 100% rename from clients/client-swf/commands/ListWorkflowTypesCommand.ts rename to clients/client-swf/src/commands/ListWorkflowTypesCommand.ts diff --git a/clients/client-swf/commands/PollForActivityTaskCommand.ts b/clients/client-swf/src/commands/PollForActivityTaskCommand.ts similarity index 100% rename from clients/client-swf/commands/PollForActivityTaskCommand.ts rename to clients/client-swf/src/commands/PollForActivityTaskCommand.ts diff --git a/clients/client-swf/commands/PollForDecisionTaskCommand.ts b/clients/client-swf/src/commands/PollForDecisionTaskCommand.ts similarity index 100% rename from clients/client-swf/commands/PollForDecisionTaskCommand.ts rename to clients/client-swf/src/commands/PollForDecisionTaskCommand.ts diff --git a/clients/client-swf/commands/RecordActivityTaskHeartbeatCommand.ts b/clients/client-swf/src/commands/RecordActivityTaskHeartbeatCommand.ts similarity index 100% rename from clients/client-swf/commands/RecordActivityTaskHeartbeatCommand.ts rename to clients/client-swf/src/commands/RecordActivityTaskHeartbeatCommand.ts diff --git a/clients/client-swf/commands/RegisterActivityTypeCommand.ts b/clients/client-swf/src/commands/RegisterActivityTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/RegisterActivityTypeCommand.ts rename to clients/client-swf/src/commands/RegisterActivityTypeCommand.ts diff --git a/clients/client-swf/commands/RegisterDomainCommand.ts b/clients/client-swf/src/commands/RegisterDomainCommand.ts similarity index 100% rename from clients/client-swf/commands/RegisterDomainCommand.ts rename to clients/client-swf/src/commands/RegisterDomainCommand.ts diff --git a/clients/client-swf/commands/RegisterWorkflowTypeCommand.ts b/clients/client-swf/src/commands/RegisterWorkflowTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/RegisterWorkflowTypeCommand.ts rename to clients/client-swf/src/commands/RegisterWorkflowTypeCommand.ts diff --git a/clients/client-swf/commands/RequestCancelWorkflowExecutionCommand.ts b/clients/client-swf/src/commands/RequestCancelWorkflowExecutionCommand.ts similarity index 100% rename from clients/client-swf/commands/RequestCancelWorkflowExecutionCommand.ts rename to clients/client-swf/src/commands/RequestCancelWorkflowExecutionCommand.ts diff --git a/clients/client-swf/commands/RespondActivityTaskCanceledCommand.ts b/clients/client-swf/src/commands/RespondActivityTaskCanceledCommand.ts similarity index 100% rename from clients/client-swf/commands/RespondActivityTaskCanceledCommand.ts rename to clients/client-swf/src/commands/RespondActivityTaskCanceledCommand.ts diff --git a/clients/client-swf/commands/RespondActivityTaskCompletedCommand.ts b/clients/client-swf/src/commands/RespondActivityTaskCompletedCommand.ts similarity index 100% rename from clients/client-swf/commands/RespondActivityTaskCompletedCommand.ts rename to clients/client-swf/src/commands/RespondActivityTaskCompletedCommand.ts diff --git a/clients/client-swf/commands/RespondActivityTaskFailedCommand.ts b/clients/client-swf/src/commands/RespondActivityTaskFailedCommand.ts similarity index 100% rename from clients/client-swf/commands/RespondActivityTaskFailedCommand.ts rename to clients/client-swf/src/commands/RespondActivityTaskFailedCommand.ts diff --git a/clients/client-swf/commands/RespondDecisionTaskCompletedCommand.ts b/clients/client-swf/src/commands/RespondDecisionTaskCompletedCommand.ts similarity index 100% rename from clients/client-swf/commands/RespondDecisionTaskCompletedCommand.ts rename to clients/client-swf/src/commands/RespondDecisionTaskCompletedCommand.ts diff --git a/clients/client-swf/commands/SignalWorkflowExecutionCommand.ts b/clients/client-swf/src/commands/SignalWorkflowExecutionCommand.ts similarity index 100% rename from clients/client-swf/commands/SignalWorkflowExecutionCommand.ts rename to clients/client-swf/src/commands/SignalWorkflowExecutionCommand.ts diff --git a/clients/client-swf/commands/StartWorkflowExecutionCommand.ts b/clients/client-swf/src/commands/StartWorkflowExecutionCommand.ts similarity index 100% rename from clients/client-swf/commands/StartWorkflowExecutionCommand.ts rename to clients/client-swf/src/commands/StartWorkflowExecutionCommand.ts diff --git a/clients/client-swf/commands/TagResourceCommand.ts b/clients/client-swf/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-swf/commands/TagResourceCommand.ts rename to clients/client-swf/src/commands/TagResourceCommand.ts diff --git a/clients/client-swf/commands/TerminateWorkflowExecutionCommand.ts b/clients/client-swf/src/commands/TerminateWorkflowExecutionCommand.ts similarity index 100% rename from clients/client-swf/commands/TerminateWorkflowExecutionCommand.ts rename to clients/client-swf/src/commands/TerminateWorkflowExecutionCommand.ts diff --git a/clients/client-swf/commands/UndeprecateActivityTypeCommand.ts b/clients/client-swf/src/commands/UndeprecateActivityTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/UndeprecateActivityTypeCommand.ts rename to clients/client-swf/src/commands/UndeprecateActivityTypeCommand.ts diff --git a/clients/client-swf/commands/UndeprecateDomainCommand.ts b/clients/client-swf/src/commands/UndeprecateDomainCommand.ts similarity index 100% rename from clients/client-swf/commands/UndeprecateDomainCommand.ts rename to clients/client-swf/src/commands/UndeprecateDomainCommand.ts diff --git a/clients/client-swf/commands/UndeprecateWorkflowTypeCommand.ts b/clients/client-swf/src/commands/UndeprecateWorkflowTypeCommand.ts similarity index 100% rename from clients/client-swf/commands/UndeprecateWorkflowTypeCommand.ts rename to clients/client-swf/src/commands/UndeprecateWorkflowTypeCommand.ts diff --git a/clients/client-swf/commands/UntagResourceCommand.ts b/clients/client-swf/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-swf/commands/UntagResourceCommand.ts rename to clients/client-swf/src/commands/UntagResourceCommand.ts diff --git a/clients/client-swf/endpoints.ts b/clients/client-swf/src/endpoints.ts similarity index 100% rename from clients/client-swf/endpoints.ts rename to clients/client-swf/src/endpoints.ts diff --git a/clients/client-swf/index.ts b/clients/client-swf/src/index.ts similarity index 100% rename from clients/client-swf/index.ts rename to clients/client-swf/src/index.ts diff --git a/clients/client-swf/models/index.ts b/clients/client-swf/src/models/index.ts similarity index 100% rename from clients/client-swf/models/index.ts rename to clients/client-swf/src/models/index.ts diff --git a/clients/client-swf/models/models_0.ts b/clients/client-swf/src/models/models_0.ts similarity index 100% rename from clients/client-swf/models/models_0.ts rename to clients/client-swf/src/models/models_0.ts diff --git a/clients/client-swf/pagination/GetWorkflowExecutionHistoryPaginator.ts b/clients/client-swf/src/pagination/GetWorkflowExecutionHistoryPaginator.ts similarity index 100% rename from clients/client-swf/pagination/GetWorkflowExecutionHistoryPaginator.ts rename to clients/client-swf/src/pagination/GetWorkflowExecutionHistoryPaginator.ts diff --git a/clients/client-swf/pagination/Interfaces.ts b/clients/client-swf/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-swf/pagination/Interfaces.ts rename to clients/client-swf/src/pagination/Interfaces.ts diff --git a/clients/client-swf/pagination/ListActivityTypesPaginator.ts b/clients/client-swf/src/pagination/ListActivityTypesPaginator.ts similarity index 100% rename from clients/client-swf/pagination/ListActivityTypesPaginator.ts rename to clients/client-swf/src/pagination/ListActivityTypesPaginator.ts diff --git a/clients/client-swf/pagination/ListClosedWorkflowExecutionsPaginator.ts b/clients/client-swf/src/pagination/ListClosedWorkflowExecutionsPaginator.ts similarity index 100% rename from clients/client-swf/pagination/ListClosedWorkflowExecutionsPaginator.ts rename to clients/client-swf/src/pagination/ListClosedWorkflowExecutionsPaginator.ts diff --git a/clients/client-swf/pagination/ListDomainsPaginator.ts b/clients/client-swf/src/pagination/ListDomainsPaginator.ts similarity index 100% rename from clients/client-swf/pagination/ListDomainsPaginator.ts rename to clients/client-swf/src/pagination/ListDomainsPaginator.ts diff --git a/clients/client-swf/pagination/ListOpenWorkflowExecutionsPaginator.ts b/clients/client-swf/src/pagination/ListOpenWorkflowExecutionsPaginator.ts similarity index 100% rename from clients/client-swf/pagination/ListOpenWorkflowExecutionsPaginator.ts rename to clients/client-swf/src/pagination/ListOpenWorkflowExecutionsPaginator.ts diff --git a/clients/client-swf/pagination/ListWorkflowTypesPaginator.ts b/clients/client-swf/src/pagination/ListWorkflowTypesPaginator.ts similarity index 100% rename from clients/client-swf/pagination/ListWorkflowTypesPaginator.ts rename to clients/client-swf/src/pagination/ListWorkflowTypesPaginator.ts diff --git a/clients/client-swf/pagination/PollForDecisionTaskPaginator.ts b/clients/client-swf/src/pagination/PollForDecisionTaskPaginator.ts similarity index 100% rename from clients/client-swf/pagination/PollForDecisionTaskPaginator.ts rename to clients/client-swf/src/pagination/PollForDecisionTaskPaginator.ts diff --git a/clients/client-swf/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-swf/protocols/Aws_json1_0.ts rename to clients/client-swf/src/protocols/Aws_json1_0.ts diff --git a/clients/client-swf/src/runtimeConfig.browser.ts b/clients/client-swf/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..d353b1a242f1 --- /dev/null +++ b/clients/client-swf/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SWFClientConfig } from "./SWFClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SWFClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-swf/runtimeConfig.native.ts b/clients/client-swf/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-swf/runtimeConfig.native.ts rename to clients/client-swf/src/runtimeConfig.native.ts diff --git a/clients/client-swf/runtimeConfig.shared.ts b/clients/client-swf/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-swf/runtimeConfig.shared.ts rename to clients/client-swf/src/runtimeConfig.shared.ts diff --git a/clients/client-swf/src/runtimeConfig.ts b/clients/client-swf/src/runtimeConfig.ts new file mode 100644 index 000000000000..474ddda7fec5 --- /dev/null +++ b/clients/client-swf/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SWFClientConfig } from "./SWFClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SWFClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-swf/tsconfig.es.json b/clients/client-swf/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-swf/tsconfig.es.json +++ b/clients/client-swf/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-swf/tsconfig.json b/clients/client-swf/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-swf/tsconfig.json +++ b/clients/client-swf/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-swf/tsconfig.types.json b/clients/client-swf/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-swf/tsconfig.types.json +++ b/clients/client-swf/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-synthetics/.gitignore b/clients/client-synthetics/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-synthetics/.gitignore +++ b/clients/client-synthetics/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-synthetics/package.json b/clients/client-synthetics/package.json index 0edcb5bb7504..2282f7b118e3 100644 --- a/clients/client-synthetics/package.json +++ b/clients/client-synthetics/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-synthetics", "repository": { "type": "git", diff --git a/clients/client-synthetics/runtimeConfig.browser.ts b/clients/client-synthetics/runtimeConfig.browser.ts deleted file mode 100644 index 1d21a412d4de..000000000000 --- a/clients/client-synthetics/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { SyntheticsClientConfig } from "./SyntheticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SyntheticsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-synthetics/runtimeConfig.ts b/clients/client-synthetics/runtimeConfig.ts deleted file mode 100644 index ca0eed7262a0..000000000000 --- a/clients/client-synthetics/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { SyntheticsClientConfig } from "./SyntheticsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: SyntheticsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-synthetics/Synthetics.ts b/clients/client-synthetics/src/Synthetics.ts similarity index 100% rename from clients/client-synthetics/Synthetics.ts rename to clients/client-synthetics/src/Synthetics.ts diff --git a/clients/client-synthetics/SyntheticsClient.ts b/clients/client-synthetics/src/SyntheticsClient.ts similarity index 100% rename from clients/client-synthetics/SyntheticsClient.ts rename to clients/client-synthetics/src/SyntheticsClient.ts diff --git a/clients/client-synthetics/commands/CreateCanaryCommand.ts b/clients/client-synthetics/src/commands/CreateCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/CreateCanaryCommand.ts rename to clients/client-synthetics/src/commands/CreateCanaryCommand.ts diff --git a/clients/client-synthetics/commands/DeleteCanaryCommand.ts b/clients/client-synthetics/src/commands/DeleteCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/DeleteCanaryCommand.ts rename to clients/client-synthetics/src/commands/DeleteCanaryCommand.ts diff --git a/clients/client-synthetics/commands/DescribeCanariesCommand.ts b/clients/client-synthetics/src/commands/DescribeCanariesCommand.ts similarity index 100% rename from clients/client-synthetics/commands/DescribeCanariesCommand.ts rename to clients/client-synthetics/src/commands/DescribeCanariesCommand.ts diff --git a/clients/client-synthetics/commands/DescribeCanariesLastRunCommand.ts b/clients/client-synthetics/src/commands/DescribeCanariesLastRunCommand.ts similarity index 100% rename from clients/client-synthetics/commands/DescribeCanariesLastRunCommand.ts rename to clients/client-synthetics/src/commands/DescribeCanariesLastRunCommand.ts diff --git a/clients/client-synthetics/commands/DescribeRuntimeVersionsCommand.ts b/clients/client-synthetics/src/commands/DescribeRuntimeVersionsCommand.ts similarity index 100% rename from clients/client-synthetics/commands/DescribeRuntimeVersionsCommand.ts rename to clients/client-synthetics/src/commands/DescribeRuntimeVersionsCommand.ts diff --git a/clients/client-synthetics/commands/GetCanaryCommand.ts b/clients/client-synthetics/src/commands/GetCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/GetCanaryCommand.ts rename to clients/client-synthetics/src/commands/GetCanaryCommand.ts diff --git a/clients/client-synthetics/commands/GetCanaryRunsCommand.ts b/clients/client-synthetics/src/commands/GetCanaryRunsCommand.ts similarity index 100% rename from clients/client-synthetics/commands/GetCanaryRunsCommand.ts rename to clients/client-synthetics/src/commands/GetCanaryRunsCommand.ts diff --git a/clients/client-synthetics/commands/ListTagsForResourceCommand.ts b/clients/client-synthetics/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-synthetics/commands/ListTagsForResourceCommand.ts rename to clients/client-synthetics/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-synthetics/commands/StartCanaryCommand.ts b/clients/client-synthetics/src/commands/StartCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/StartCanaryCommand.ts rename to clients/client-synthetics/src/commands/StartCanaryCommand.ts diff --git a/clients/client-synthetics/commands/StopCanaryCommand.ts b/clients/client-synthetics/src/commands/StopCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/StopCanaryCommand.ts rename to clients/client-synthetics/src/commands/StopCanaryCommand.ts diff --git a/clients/client-synthetics/commands/TagResourceCommand.ts b/clients/client-synthetics/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-synthetics/commands/TagResourceCommand.ts rename to clients/client-synthetics/src/commands/TagResourceCommand.ts diff --git a/clients/client-synthetics/commands/UntagResourceCommand.ts b/clients/client-synthetics/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-synthetics/commands/UntagResourceCommand.ts rename to clients/client-synthetics/src/commands/UntagResourceCommand.ts diff --git a/clients/client-synthetics/commands/UpdateCanaryCommand.ts b/clients/client-synthetics/src/commands/UpdateCanaryCommand.ts similarity index 100% rename from clients/client-synthetics/commands/UpdateCanaryCommand.ts rename to clients/client-synthetics/src/commands/UpdateCanaryCommand.ts diff --git a/clients/client-synthetics/endpoints.ts b/clients/client-synthetics/src/endpoints.ts similarity index 100% rename from clients/client-synthetics/endpoints.ts rename to clients/client-synthetics/src/endpoints.ts diff --git a/clients/client-synthetics/index.ts b/clients/client-synthetics/src/index.ts similarity index 100% rename from clients/client-synthetics/index.ts rename to clients/client-synthetics/src/index.ts diff --git a/clients/client-synthetics/models/index.ts b/clients/client-synthetics/src/models/index.ts similarity index 100% rename from clients/client-synthetics/models/index.ts rename to clients/client-synthetics/src/models/index.ts diff --git a/clients/client-synthetics/models/models_0.ts b/clients/client-synthetics/src/models/models_0.ts similarity index 100% rename from clients/client-synthetics/models/models_0.ts rename to clients/client-synthetics/src/models/models_0.ts diff --git a/clients/client-synthetics/pagination/DescribeCanariesLastRunPaginator.ts b/clients/client-synthetics/src/pagination/DescribeCanariesLastRunPaginator.ts similarity index 100% rename from clients/client-synthetics/pagination/DescribeCanariesLastRunPaginator.ts rename to clients/client-synthetics/src/pagination/DescribeCanariesLastRunPaginator.ts diff --git a/clients/client-synthetics/pagination/DescribeCanariesPaginator.ts b/clients/client-synthetics/src/pagination/DescribeCanariesPaginator.ts similarity index 100% rename from clients/client-synthetics/pagination/DescribeCanariesPaginator.ts rename to clients/client-synthetics/src/pagination/DescribeCanariesPaginator.ts diff --git a/clients/client-synthetics/pagination/DescribeRuntimeVersionsPaginator.ts b/clients/client-synthetics/src/pagination/DescribeRuntimeVersionsPaginator.ts similarity index 100% rename from clients/client-synthetics/pagination/DescribeRuntimeVersionsPaginator.ts rename to clients/client-synthetics/src/pagination/DescribeRuntimeVersionsPaginator.ts diff --git a/clients/client-synthetics/pagination/GetCanaryRunsPaginator.ts b/clients/client-synthetics/src/pagination/GetCanaryRunsPaginator.ts similarity index 100% rename from clients/client-synthetics/pagination/GetCanaryRunsPaginator.ts rename to clients/client-synthetics/src/pagination/GetCanaryRunsPaginator.ts diff --git a/clients/client-synthetics/pagination/Interfaces.ts b/clients/client-synthetics/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-synthetics/pagination/Interfaces.ts rename to clients/client-synthetics/src/pagination/Interfaces.ts diff --git a/clients/client-synthetics/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-synthetics/protocols/Aws_restJson1.ts rename to clients/client-synthetics/src/protocols/Aws_restJson1.ts diff --git a/clients/client-synthetics/src/runtimeConfig.browser.ts b/clients/client-synthetics/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..231118b1e2fe --- /dev/null +++ b/clients/client-synthetics/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { SyntheticsClientConfig } from "./SyntheticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SyntheticsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-synthetics/runtimeConfig.native.ts b/clients/client-synthetics/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-synthetics/runtimeConfig.native.ts rename to clients/client-synthetics/src/runtimeConfig.native.ts diff --git a/clients/client-synthetics/runtimeConfig.shared.ts b/clients/client-synthetics/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-synthetics/runtimeConfig.shared.ts rename to clients/client-synthetics/src/runtimeConfig.shared.ts diff --git a/clients/client-synthetics/src/runtimeConfig.ts b/clients/client-synthetics/src/runtimeConfig.ts new file mode 100644 index 000000000000..cbfce8ec6093 --- /dev/null +++ b/clients/client-synthetics/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { SyntheticsClientConfig } from "./SyntheticsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: SyntheticsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-synthetics/tsconfig.es.json b/clients/client-synthetics/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-synthetics/tsconfig.es.json +++ b/clients/client-synthetics/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-synthetics/tsconfig.json b/clients/client-synthetics/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-synthetics/tsconfig.json +++ b/clients/client-synthetics/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-synthetics/tsconfig.types.json b/clients/client-synthetics/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-synthetics/tsconfig.types.json +++ b/clients/client-synthetics/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-textract/.gitignore b/clients/client-textract/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-textract/.gitignore +++ b/clients/client-textract/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-textract/package.json b/clients/client-textract/package.json index 9bb3ecdaf861..374c14f849d9 100644 --- a/clients/client-textract/package.json +++ b/clients/client-textract/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-textract", "repository": { "type": "git", diff --git a/clients/client-textract/runtimeConfig.browser.ts b/clients/client-textract/runtimeConfig.browser.ts deleted file mode 100644 index 9ba58d8d55e5..000000000000 --- a/clients/client-textract/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TextractClientConfig } from "./TextractClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TextractClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-textract/runtimeConfig.ts b/clients/client-textract/runtimeConfig.ts deleted file mode 100644 index 79f1199b2bc5..000000000000 --- a/clients/client-textract/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TextractClientConfig } from "./TextractClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TextractClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-textract/Textract.ts b/clients/client-textract/src/Textract.ts similarity index 100% rename from clients/client-textract/Textract.ts rename to clients/client-textract/src/Textract.ts diff --git a/clients/client-textract/TextractClient.ts b/clients/client-textract/src/TextractClient.ts similarity index 100% rename from clients/client-textract/TextractClient.ts rename to clients/client-textract/src/TextractClient.ts diff --git a/clients/client-textract/commands/AnalyzeDocumentCommand.ts b/clients/client-textract/src/commands/AnalyzeDocumentCommand.ts similarity index 100% rename from clients/client-textract/commands/AnalyzeDocumentCommand.ts rename to clients/client-textract/src/commands/AnalyzeDocumentCommand.ts diff --git a/clients/client-textract/commands/AnalyzeExpenseCommand.ts b/clients/client-textract/src/commands/AnalyzeExpenseCommand.ts similarity index 100% rename from clients/client-textract/commands/AnalyzeExpenseCommand.ts rename to clients/client-textract/src/commands/AnalyzeExpenseCommand.ts diff --git a/clients/client-textract/commands/DetectDocumentTextCommand.ts b/clients/client-textract/src/commands/DetectDocumentTextCommand.ts similarity index 100% rename from clients/client-textract/commands/DetectDocumentTextCommand.ts rename to clients/client-textract/src/commands/DetectDocumentTextCommand.ts diff --git a/clients/client-textract/commands/GetDocumentAnalysisCommand.ts b/clients/client-textract/src/commands/GetDocumentAnalysisCommand.ts similarity index 100% rename from clients/client-textract/commands/GetDocumentAnalysisCommand.ts rename to clients/client-textract/src/commands/GetDocumentAnalysisCommand.ts diff --git a/clients/client-textract/commands/GetDocumentTextDetectionCommand.ts b/clients/client-textract/src/commands/GetDocumentTextDetectionCommand.ts similarity index 100% rename from clients/client-textract/commands/GetDocumentTextDetectionCommand.ts rename to clients/client-textract/src/commands/GetDocumentTextDetectionCommand.ts diff --git a/clients/client-textract/commands/StartDocumentAnalysisCommand.ts b/clients/client-textract/src/commands/StartDocumentAnalysisCommand.ts similarity index 100% rename from clients/client-textract/commands/StartDocumentAnalysisCommand.ts rename to clients/client-textract/src/commands/StartDocumentAnalysisCommand.ts diff --git a/clients/client-textract/commands/StartDocumentTextDetectionCommand.ts b/clients/client-textract/src/commands/StartDocumentTextDetectionCommand.ts similarity index 100% rename from clients/client-textract/commands/StartDocumentTextDetectionCommand.ts rename to clients/client-textract/src/commands/StartDocumentTextDetectionCommand.ts diff --git a/clients/client-textract/endpoints.ts b/clients/client-textract/src/endpoints.ts similarity index 100% rename from clients/client-textract/endpoints.ts rename to clients/client-textract/src/endpoints.ts diff --git a/clients/client-textract/index.ts b/clients/client-textract/src/index.ts similarity index 100% rename from clients/client-textract/index.ts rename to clients/client-textract/src/index.ts diff --git a/clients/client-textract/models/index.ts b/clients/client-textract/src/models/index.ts similarity index 100% rename from clients/client-textract/models/index.ts rename to clients/client-textract/src/models/index.ts diff --git a/clients/client-textract/models/models_0.ts b/clients/client-textract/src/models/models_0.ts similarity index 100% rename from clients/client-textract/models/models_0.ts rename to clients/client-textract/src/models/models_0.ts diff --git a/clients/client-textract/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-textract/protocols/Aws_json1_1.ts rename to clients/client-textract/src/protocols/Aws_json1_1.ts diff --git a/clients/client-textract/src/runtimeConfig.browser.ts b/clients/client-textract/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..808426cef80f --- /dev/null +++ b/clients/client-textract/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TextractClientConfig } from "./TextractClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TextractClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-textract/runtimeConfig.native.ts b/clients/client-textract/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-textract/runtimeConfig.native.ts rename to clients/client-textract/src/runtimeConfig.native.ts diff --git a/clients/client-textract/runtimeConfig.shared.ts b/clients/client-textract/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-textract/runtimeConfig.shared.ts rename to clients/client-textract/src/runtimeConfig.shared.ts diff --git a/clients/client-textract/src/runtimeConfig.ts b/clients/client-textract/src/runtimeConfig.ts new file mode 100644 index 000000000000..9fe66900e809 --- /dev/null +++ b/clients/client-textract/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TextractClientConfig } from "./TextractClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TextractClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-textract/tsconfig.es.json b/clients/client-textract/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-textract/tsconfig.es.json +++ b/clients/client-textract/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-textract/tsconfig.json b/clients/client-textract/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-textract/tsconfig.json +++ b/clients/client-textract/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-textract/tsconfig.types.json b/clients/client-textract/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-textract/tsconfig.types.json +++ b/clients/client-textract/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-timestream-query/.gitignore b/clients/client-timestream-query/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-timestream-query/.gitignore +++ b/clients/client-timestream-query/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-timestream-query/package.json b/clients/client-timestream-query/package.json index c0c981d0f5e1..2b867f10a605 100644 --- a/clients/client-timestream-query/package.json +++ b/clients/client-timestream-query/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-timestream-query", "repository": { "type": "git", diff --git a/clients/client-timestream-query/runtimeConfig.browser.ts b/clients/client-timestream-query/runtimeConfig.browser.ts deleted file mode 100644 index 0f8937581e2a..000000000000 --- a/clients/client-timestream-query/runtimeConfig.browser.ts +++ /dev/null @@ -1,41 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TimestreamQueryClientConfig } from "./TimestreamQueryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-timestream-query/runtimeConfig.ts b/clients/client-timestream-query/runtimeConfig.ts deleted file mode 100644 index ea956091b173..000000000000 --- a/clients/client-timestream-query/runtimeConfig.ts +++ /dev/null @@ -1,48 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TimestreamQueryClientConfig } from "./TimestreamQueryClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-timestream-query/TimestreamQuery.ts b/clients/client-timestream-query/src/TimestreamQuery.ts similarity index 100% rename from clients/client-timestream-query/TimestreamQuery.ts rename to clients/client-timestream-query/src/TimestreamQuery.ts diff --git a/clients/client-timestream-query/TimestreamQueryClient.ts b/clients/client-timestream-query/src/TimestreamQueryClient.ts similarity index 100% rename from clients/client-timestream-query/TimestreamQueryClient.ts rename to clients/client-timestream-query/src/TimestreamQueryClient.ts diff --git a/clients/client-timestream-query/commands/CancelQueryCommand.ts b/clients/client-timestream-query/src/commands/CancelQueryCommand.ts similarity index 100% rename from clients/client-timestream-query/commands/CancelQueryCommand.ts rename to clients/client-timestream-query/src/commands/CancelQueryCommand.ts diff --git a/clients/client-timestream-query/commands/DescribeEndpointsCommand.ts b/clients/client-timestream-query/src/commands/DescribeEndpointsCommand.ts similarity index 100% rename from clients/client-timestream-query/commands/DescribeEndpointsCommand.ts rename to clients/client-timestream-query/src/commands/DescribeEndpointsCommand.ts diff --git a/clients/client-timestream-query/commands/QueryCommand.ts b/clients/client-timestream-query/src/commands/QueryCommand.ts similarity index 100% rename from clients/client-timestream-query/commands/QueryCommand.ts rename to clients/client-timestream-query/src/commands/QueryCommand.ts diff --git a/clients/client-timestream-query/endpoints.ts b/clients/client-timestream-query/src/endpoints.ts similarity index 100% rename from clients/client-timestream-query/endpoints.ts rename to clients/client-timestream-query/src/endpoints.ts diff --git a/clients/client-timestream-query/index.ts b/clients/client-timestream-query/src/index.ts similarity index 100% rename from clients/client-timestream-query/index.ts rename to clients/client-timestream-query/src/index.ts diff --git a/clients/client-timestream-query/models/index.ts b/clients/client-timestream-query/src/models/index.ts similarity index 100% rename from clients/client-timestream-query/models/index.ts rename to clients/client-timestream-query/src/models/index.ts diff --git a/clients/client-timestream-query/models/models_0.ts b/clients/client-timestream-query/src/models/models_0.ts similarity index 100% rename from clients/client-timestream-query/models/models_0.ts rename to clients/client-timestream-query/src/models/models_0.ts diff --git a/clients/client-timestream-query/pagination/Interfaces.ts b/clients/client-timestream-query/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-timestream-query/pagination/Interfaces.ts rename to clients/client-timestream-query/src/pagination/Interfaces.ts diff --git a/clients/client-timestream-query/pagination/QueryPaginator.ts b/clients/client-timestream-query/src/pagination/QueryPaginator.ts similarity index 100% rename from clients/client-timestream-query/pagination/QueryPaginator.ts rename to clients/client-timestream-query/src/pagination/QueryPaginator.ts diff --git a/clients/client-timestream-query/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-timestream-query/protocols/Aws_json1_0.ts rename to clients/client-timestream-query/src/protocols/Aws_json1_0.ts diff --git a/clients/client-timestream-query/src/runtimeConfig.browser.ts b/clients/client-timestream-query/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..2194f3900895 --- /dev/null +++ b/clients/client-timestream-query/src/runtimeConfig.browser.ts @@ -0,0 +1,42 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TimestreamQueryClientConfig } from "./TimestreamQueryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-timestream-query/runtimeConfig.native.ts b/clients/client-timestream-query/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-timestream-query/runtimeConfig.native.ts rename to clients/client-timestream-query/src/runtimeConfig.native.ts diff --git a/clients/client-timestream-query/runtimeConfig.shared.ts b/clients/client-timestream-query/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-timestream-query/runtimeConfig.shared.ts rename to clients/client-timestream-query/src/runtimeConfig.shared.ts diff --git a/clients/client-timestream-query/src/runtimeConfig.ts b/clients/client-timestream-query/src/runtimeConfig.ts new file mode 100644 index 000000000000..68eabadeefd7 --- /dev/null +++ b/clients/client-timestream-query/src/runtimeConfig.ts @@ -0,0 +1,49 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TimestreamQueryClientConfig } from "./TimestreamQueryClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-timestream-query/tsconfig.es.json b/clients/client-timestream-query/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-timestream-query/tsconfig.es.json +++ b/clients/client-timestream-query/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-timestream-query/tsconfig.json b/clients/client-timestream-query/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-timestream-query/tsconfig.json +++ b/clients/client-timestream-query/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-timestream-query/tsconfig.types.json b/clients/client-timestream-query/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-timestream-query/tsconfig.types.json +++ b/clients/client-timestream-query/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-timestream-write/.gitignore b/clients/client-timestream-write/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-timestream-write/.gitignore +++ b/clients/client-timestream-write/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-timestream-write/package.json b/clients/client-timestream-write/package.json index 3b08b2c16586..2a7a8992c795 100644 --- a/clients/client-timestream-write/package.json +++ b/clients/client-timestream-write/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-timestream-write", "repository": { "type": "git", diff --git a/clients/client-timestream-write/runtimeConfig.browser.ts b/clients/client-timestream-write/runtimeConfig.browser.ts deleted file mode 100644 index e498daea3c7b..000000000000 --- a/clients/client-timestream-write/runtimeConfig.browser.ts +++ /dev/null @@ -1,41 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TimestreamWriteClientConfig } from "./TimestreamWriteClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-timestream-write/runtimeConfig.ts b/clients/client-timestream-write/runtimeConfig.ts deleted file mode 100644 index b71ffb6c1771..000000000000 --- a/clients/client-timestream-write/runtimeConfig.ts +++ /dev/null @@ -1,48 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TimestreamWriteClientConfig } from "./TimestreamWriteClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-timestream-write/TimestreamWrite.ts b/clients/client-timestream-write/src/TimestreamWrite.ts similarity index 100% rename from clients/client-timestream-write/TimestreamWrite.ts rename to clients/client-timestream-write/src/TimestreamWrite.ts diff --git a/clients/client-timestream-write/TimestreamWriteClient.ts b/clients/client-timestream-write/src/TimestreamWriteClient.ts similarity index 100% rename from clients/client-timestream-write/TimestreamWriteClient.ts rename to clients/client-timestream-write/src/TimestreamWriteClient.ts diff --git a/clients/client-timestream-write/commands/CreateDatabaseCommand.ts b/clients/client-timestream-write/src/commands/CreateDatabaseCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/CreateDatabaseCommand.ts rename to clients/client-timestream-write/src/commands/CreateDatabaseCommand.ts diff --git a/clients/client-timestream-write/commands/CreateTableCommand.ts b/clients/client-timestream-write/src/commands/CreateTableCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/CreateTableCommand.ts rename to clients/client-timestream-write/src/commands/CreateTableCommand.ts diff --git a/clients/client-timestream-write/commands/DeleteDatabaseCommand.ts b/clients/client-timestream-write/src/commands/DeleteDatabaseCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/DeleteDatabaseCommand.ts rename to clients/client-timestream-write/src/commands/DeleteDatabaseCommand.ts diff --git a/clients/client-timestream-write/commands/DeleteTableCommand.ts b/clients/client-timestream-write/src/commands/DeleteTableCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/DeleteTableCommand.ts rename to clients/client-timestream-write/src/commands/DeleteTableCommand.ts diff --git a/clients/client-timestream-write/commands/DescribeDatabaseCommand.ts b/clients/client-timestream-write/src/commands/DescribeDatabaseCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/DescribeDatabaseCommand.ts rename to clients/client-timestream-write/src/commands/DescribeDatabaseCommand.ts diff --git a/clients/client-timestream-write/commands/DescribeEndpointsCommand.ts b/clients/client-timestream-write/src/commands/DescribeEndpointsCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/DescribeEndpointsCommand.ts rename to clients/client-timestream-write/src/commands/DescribeEndpointsCommand.ts diff --git a/clients/client-timestream-write/commands/DescribeTableCommand.ts b/clients/client-timestream-write/src/commands/DescribeTableCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/DescribeTableCommand.ts rename to clients/client-timestream-write/src/commands/DescribeTableCommand.ts diff --git a/clients/client-timestream-write/commands/ListDatabasesCommand.ts b/clients/client-timestream-write/src/commands/ListDatabasesCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/ListDatabasesCommand.ts rename to clients/client-timestream-write/src/commands/ListDatabasesCommand.ts diff --git a/clients/client-timestream-write/commands/ListTablesCommand.ts b/clients/client-timestream-write/src/commands/ListTablesCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/ListTablesCommand.ts rename to clients/client-timestream-write/src/commands/ListTablesCommand.ts diff --git a/clients/client-timestream-write/commands/ListTagsForResourceCommand.ts b/clients/client-timestream-write/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/ListTagsForResourceCommand.ts rename to clients/client-timestream-write/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-timestream-write/commands/TagResourceCommand.ts b/clients/client-timestream-write/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/TagResourceCommand.ts rename to clients/client-timestream-write/src/commands/TagResourceCommand.ts diff --git a/clients/client-timestream-write/commands/UntagResourceCommand.ts b/clients/client-timestream-write/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/UntagResourceCommand.ts rename to clients/client-timestream-write/src/commands/UntagResourceCommand.ts diff --git a/clients/client-timestream-write/commands/UpdateDatabaseCommand.ts b/clients/client-timestream-write/src/commands/UpdateDatabaseCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/UpdateDatabaseCommand.ts rename to clients/client-timestream-write/src/commands/UpdateDatabaseCommand.ts diff --git a/clients/client-timestream-write/commands/UpdateTableCommand.ts b/clients/client-timestream-write/src/commands/UpdateTableCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/UpdateTableCommand.ts rename to clients/client-timestream-write/src/commands/UpdateTableCommand.ts diff --git a/clients/client-timestream-write/commands/WriteRecordsCommand.ts b/clients/client-timestream-write/src/commands/WriteRecordsCommand.ts similarity index 100% rename from clients/client-timestream-write/commands/WriteRecordsCommand.ts rename to clients/client-timestream-write/src/commands/WriteRecordsCommand.ts diff --git a/clients/client-timestream-write/endpoints.ts b/clients/client-timestream-write/src/endpoints.ts similarity index 100% rename from clients/client-timestream-write/endpoints.ts rename to clients/client-timestream-write/src/endpoints.ts diff --git a/clients/client-timestream-write/index.ts b/clients/client-timestream-write/src/index.ts similarity index 100% rename from clients/client-timestream-write/index.ts rename to clients/client-timestream-write/src/index.ts diff --git a/clients/client-timestream-write/models/index.ts b/clients/client-timestream-write/src/models/index.ts similarity index 100% rename from clients/client-timestream-write/models/index.ts rename to clients/client-timestream-write/src/models/index.ts diff --git a/clients/client-timestream-write/models/models_0.ts b/clients/client-timestream-write/src/models/models_0.ts similarity index 100% rename from clients/client-timestream-write/models/models_0.ts rename to clients/client-timestream-write/src/models/models_0.ts diff --git a/clients/client-timestream-write/pagination/Interfaces.ts b/clients/client-timestream-write/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-timestream-write/pagination/Interfaces.ts rename to clients/client-timestream-write/src/pagination/Interfaces.ts diff --git a/clients/client-timestream-write/pagination/ListDatabasesPaginator.ts b/clients/client-timestream-write/src/pagination/ListDatabasesPaginator.ts similarity index 100% rename from clients/client-timestream-write/pagination/ListDatabasesPaginator.ts rename to clients/client-timestream-write/src/pagination/ListDatabasesPaginator.ts diff --git a/clients/client-timestream-write/pagination/ListTablesPaginator.ts b/clients/client-timestream-write/src/pagination/ListTablesPaginator.ts similarity index 100% rename from clients/client-timestream-write/pagination/ListTablesPaginator.ts rename to clients/client-timestream-write/src/pagination/ListTablesPaginator.ts diff --git a/clients/client-timestream-write/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts similarity index 100% rename from clients/client-timestream-write/protocols/Aws_json1_0.ts rename to clients/client-timestream-write/src/protocols/Aws_json1_0.ts diff --git a/clients/client-timestream-write/src/runtimeConfig.browser.ts b/clients/client-timestream-write/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..bc07dad050b2 --- /dev/null +++ b/clients/client-timestream-write/src/runtimeConfig.browser.ts @@ -0,0 +1,42 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TimestreamWriteClientConfig } from "./TimestreamWriteClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: config?.endpointDiscoveryEnabledProvider ?? (() => Promise.resolve(undefined)), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-timestream-write/runtimeConfig.native.ts b/clients/client-timestream-write/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-timestream-write/runtimeConfig.native.ts rename to clients/client-timestream-write/src/runtimeConfig.native.ts diff --git a/clients/client-timestream-write/runtimeConfig.shared.ts b/clients/client-timestream-write/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-timestream-write/runtimeConfig.shared.ts rename to clients/client-timestream-write/src/runtimeConfig.shared.ts diff --git a/clients/client-timestream-write/src/runtimeConfig.ts b/clients/client-timestream-write/src/runtimeConfig.ts new file mode 100644 index 000000000000..eb8091c181ad --- /dev/null +++ b/clients/client-timestream-write/src/runtimeConfig.ts @@ -0,0 +1,49 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS } from "@aws-sdk/middleware-endpoint-discovery"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TimestreamWriteClientConfig } from "./TimestreamWriteClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + endpointDiscoveryEnabledProvider: + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-timestream-write/tsconfig.es.json b/clients/client-timestream-write/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-timestream-write/tsconfig.es.json +++ b/clients/client-timestream-write/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-timestream-write/tsconfig.json b/clients/client-timestream-write/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-timestream-write/tsconfig.json +++ b/clients/client-timestream-write/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-timestream-write/tsconfig.types.json b/clients/client-timestream-write/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-timestream-write/tsconfig.types.json +++ b/clients/client-timestream-write/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-transcribe-streaming/.gitignore b/clients/client-transcribe-streaming/.gitignore index 16a8d46239fd..08d359af39e7 100644 --- a/clients/client-transcribe-streaming/.gitignore +++ b/clients/client-transcribe-streaming/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-transcribe-streaming/package.json b/clients/client-transcribe-streaming/package.json index 3753fae8801c..3573f5f56f9b 100644 --- a/clients/client-transcribe-streaming/package.json +++ b/clients/client-transcribe-streaming/package.json @@ -11,21 +11,14 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", - "postbuild": "cp test/speech.wav dist/cjs/test", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "pretest": "yarn build", "test": "jest --coverage --passWithNoTests", "test:integration": "jest --config jest.integ.config.js" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -81,8 +74,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -91,6 +84,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-transcribe-streaming", "repository": { "type": "git", diff --git a/clients/client-transcribe-streaming/runtimeConfig.browser.ts b/clients/client-transcribe-streaming/runtimeConfig.browser.ts deleted file mode 100644 index 5543fb6f78c8..000000000000 --- a/clients/client-transcribe-streaming/runtimeConfig.browser.ts +++ /dev/null @@ -1,44 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; -import { streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { WebSocketHandler, eventStreamPayloadHandler } from "@aws-sdk/middleware-sdk-transcribe-streaming"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TranscribeStreamingClientConfig } from "./TranscribeStreamingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? (() => eventStreamPayloadHandler), - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new WebSocketHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transcribe-streaming/runtimeConfig.ts b/clients/client-transcribe-streaming/runtimeConfig.ts deleted file mode 100644 index 409e06913123..000000000000 --- a/clients/client-transcribe-streaming/runtimeConfig.ts +++ /dev/null @@ -1,49 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; -import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TranscribeStreamingClientConfig } from "./TranscribeStreamingClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, - eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttp2Handler({ disableConcurrentStreams: true }), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transcribe-streaming/TranscribeStreaming.ts b/clients/client-transcribe-streaming/src/TranscribeStreaming.ts similarity index 100% rename from clients/client-transcribe-streaming/TranscribeStreaming.ts rename to clients/client-transcribe-streaming/src/TranscribeStreaming.ts diff --git a/clients/client-transcribe-streaming/TranscribeStreamingClient.ts b/clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts similarity index 100% rename from clients/client-transcribe-streaming/TranscribeStreamingClient.ts rename to clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts diff --git a/clients/client-transcribe-streaming/commands/StartMedicalStreamTranscriptionCommand.ts b/clients/client-transcribe-streaming/src/commands/StartMedicalStreamTranscriptionCommand.ts similarity index 100% rename from clients/client-transcribe-streaming/commands/StartMedicalStreamTranscriptionCommand.ts rename to clients/client-transcribe-streaming/src/commands/StartMedicalStreamTranscriptionCommand.ts diff --git a/clients/client-transcribe-streaming/commands/StartStreamTranscriptionCommand.ts b/clients/client-transcribe-streaming/src/commands/StartStreamTranscriptionCommand.ts similarity index 100% rename from clients/client-transcribe-streaming/commands/StartStreamTranscriptionCommand.ts rename to clients/client-transcribe-streaming/src/commands/StartStreamTranscriptionCommand.ts diff --git a/clients/client-transcribe-streaming/endpoints.ts b/clients/client-transcribe-streaming/src/endpoints.ts similarity index 100% rename from clients/client-transcribe-streaming/endpoints.ts rename to clients/client-transcribe-streaming/src/endpoints.ts diff --git a/clients/client-transcribe-streaming/index.ts b/clients/client-transcribe-streaming/src/index.ts similarity index 100% rename from clients/client-transcribe-streaming/index.ts rename to clients/client-transcribe-streaming/src/index.ts diff --git a/clients/client-transcribe-streaming/models/index.ts b/clients/client-transcribe-streaming/src/models/index.ts similarity index 100% rename from clients/client-transcribe-streaming/models/index.ts rename to clients/client-transcribe-streaming/src/models/index.ts diff --git a/clients/client-transcribe-streaming/models/models_0.ts b/clients/client-transcribe-streaming/src/models/models_0.ts similarity index 100% rename from clients/client-transcribe-streaming/models/models_0.ts rename to clients/client-transcribe-streaming/src/models/models_0.ts diff --git a/clients/client-transcribe-streaming/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-transcribe-streaming/protocols/Aws_restJson1.ts rename to clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts diff --git a/clients/client-transcribe-streaming/src/runtimeConfig.browser.ts b/clients/client-transcribe-streaming/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..473ea10dc97b --- /dev/null +++ b/clients/client-transcribe-streaming/src/runtimeConfig.browser.ts @@ -0,0 +1,45 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-browser"; +import { streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { WebSocketHandler, eventStreamPayloadHandler } from "@aws-sdk/middleware-sdk-transcribe-streaming"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TranscribeStreamingClientConfig } from "./TranscribeStreamingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? (() => eventStreamPayloadHandler), + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new WebSocketHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transcribe-streaming/runtimeConfig.native.ts b/clients/client-transcribe-streaming/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-transcribe-streaming/runtimeConfig.native.ts rename to clients/client-transcribe-streaming/src/runtimeConfig.native.ts diff --git a/clients/client-transcribe-streaming/runtimeConfig.shared.ts b/clients/client-transcribe-streaming/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-transcribe-streaming/runtimeConfig.shared.ts rename to clients/client-transcribe-streaming/src/runtimeConfig.shared.ts diff --git a/clients/client-transcribe-streaming/src/runtimeConfig.ts b/clients/client-transcribe-streaming/src/runtimeConfig.ts new file mode 100644 index 000000000000..7f2d6c063c3d --- /dev/null +++ b/clients/client-transcribe-streaming/src/runtimeConfig.ts @@ -0,0 +1,50 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node"; +import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TranscribeStreamingClientConfig } from "./TranscribeStreamingClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, + eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttp2Handler({ disableConcurrentStreams: true }), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transcribe-streaming/test/index.integ.spec.ts b/clients/client-transcribe-streaming/test/index.integ.spec.ts index 6fcab9f771aa..5362dc2b8e4b 100644 --- a/clients/client-transcribe-streaming/test/index.integ.spec.ts +++ b/clients/client-transcribe-streaming/test/index.integ.spec.ts @@ -1,6 +1,7 @@ -import { TranscribeStreaming } from "../index"; import { createReadStream } from "fs"; import { join } from "path"; + +import { TranscribeStreaming } from "../src/index"; const audio = createReadStream(join(__dirname, "speech.wav")); describe("TranscribeStream client", () => { diff --git a/clients/client-transcribe-streaming/tsconfig.es.json b/clients/client-transcribe-streaming/tsconfig.es.json index c7ed02163f3a..0750b3e36e92 100644 --- a/clients/client-transcribe-streaming/tsconfig.es.json +++ b/clients/client-transcribe-streaming/tsconfig.es.json @@ -5,7 +5,7 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" }, "exclude": ["test"] } diff --git a/clients/client-transcribe-streaming/tsconfig.json b/clients/client-transcribe-streaming/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-transcribe-streaming/tsconfig.json +++ b/clients/client-transcribe-streaming/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-transcribe-streaming/tsconfig.types.json b/clients/client-transcribe-streaming/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-transcribe-streaming/tsconfig.types.json +++ b/clients/client-transcribe-streaming/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-transcribe/.gitignore b/clients/client-transcribe/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-transcribe/.gitignore +++ b/clients/client-transcribe/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-transcribe/package.json b/clients/client-transcribe/package.json index 2342fbadde2e..2ffcc46d9163 100644 --- a/clients/client-transcribe/package.json +++ b/clients/client-transcribe/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-transcribe", "repository": { "type": "git", diff --git a/clients/client-transcribe/runtimeConfig.browser.ts b/clients/client-transcribe/runtimeConfig.browser.ts deleted file mode 100644 index 74632d0d882b..000000000000 --- a/clients/client-transcribe/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TranscribeClientConfig } from "./TranscribeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranscribeClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transcribe/runtimeConfig.ts b/clients/client-transcribe/runtimeConfig.ts deleted file mode 100644 index 4258f862db96..000000000000 --- a/clients/client-transcribe/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TranscribeClientConfig } from "./TranscribeClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranscribeClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transcribe/Transcribe.ts b/clients/client-transcribe/src/Transcribe.ts similarity index 100% rename from clients/client-transcribe/Transcribe.ts rename to clients/client-transcribe/src/Transcribe.ts diff --git a/clients/client-transcribe/TranscribeClient.ts b/clients/client-transcribe/src/TranscribeClient.ts similarity index 100% rename from clients/client-transcribe/TranscribeClient.ts rename to clients/client-transcribe/src/TranscribeClient.ts diff --git a/clients/client-transcribe/commands/CreateCallAnalyticsCategoryCommand.ts b/clients/client-transcribe/src/commands/CreateCallAnalyticsCategoryCommand.ts similarity index 100% rename from clients/client-transcribe/commands/CreateCallAnalyticsCategoryCommand.ts rename to clients/client-transcribe/src/commands/CreateCallAnalyticsCategoryCommand.ts diff --git a/clients/client-transcribe/commands/CreateLanguageModelCommand.ts b/clients/client-transcribe/src/commands/CreateLanguageModelCommand.ts similarity index 100% rename from clients/client-transcribe/commands/CreateLanguageModelCommand.ts rename to clients/client-transcribe/src/commands/CreateLanguageModelCommand.ts diff --git a/clients/client-transcribe/commands/CreateMedicalVocabularyCommand.ts b/clients/client-transcribe/src/commands/CreateMedicalVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/CreateMedicalVocabularyCommand.ts rename to clients/client-transcribe/src/commands/CreateMedicalVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/CreateVocabularyCommand.ts b/clients/client-transcribe/src/commands/CreateVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/CreateVocabularyCommand.ts rename to clients/client-transcribe/src/commands/CreateVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/CreateVocabularyFilterCommand.ts b/clients/client-transcribe/src/commands/CreateVocabularyFilterCommand.ts similarity index 100% rename from clients/client-transcribe/commands/CreateVocabularyFilterCommand.ts rename to clients/client-transcribe/src/commands/CreateVocabularyFilterCommand.ts diff --git a/clients/client-transcribe/commands/DeleteCallAnalyticsCategoryCommand.ts b/clients/client-transcribe/src/commands/DeleteCallAnalyticsCategoryCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteCallAnalyticsCategoryCommand.ts rename to clients/client-transcribe/src/commands/DeleteCallAnalyticsCategoryCommand.ts diff --git a/clients/client-transcribe/commands/DeleteCallAnalyticsJobCommand.ts b/clients/client-transcribe/src/commands/DeleteCallAnalyticsJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteCallAnalyticsJobCommand.ts rename to clients/client-transcribe/src/commands/DeleteCallAnalyticsJobCommand.ts diff --git a/clients/client-transcribe/commands/DeleteLanguageModelCommand.ts b/clients/client-transcribe/src/commands/DeleteLanguageModelCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteLanguageModelCommand.ts rename to clients/client-transcribe/src/commands/DeleteLanguageModelCommand.ts diff --git a/clients/client-transcribe/commands/DeleteMedicalTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/DeleteMedicalTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteMedicalTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/DeleteMedicalTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/DeleteMedicalVocabularyCommand.ts b/clients/client-transcribe/src/commands/DeleteMedicalVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteMedicalVocabularyCommand.ts rename to clients/client-transcribe/src/commands/DeleteMedicalVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/DeleteTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/DeleteTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/DeleteTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/DeleteVocabularyCommand.ts b/clients/client-transcribe/src/commands/DeleteVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteVocabularyCommand.ts rename to clients/client-transcribe/src/commands/DeleteVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/DeleteVocabularyFilterCommand.ts b/clients/client-transcribe/src/commands/DeleteVocabularyFilterCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DeleteVocabularyFilterCommand.ts rename to clients/client-transcribe/src/commands/DeleteVocabularyFilterCommand.ts diff --git a/clients/client-transcribe/commands/DescribeLanguageModelCommand.ts b/clients/client-transcribe/src/commands/DescribeLanguageModelCommand.ts similarity index 100% rename from clients/client-transcribe/commands/DescribeLanguageModelCommand.ts rename to clients/client-transcribe/src/commands/DescribeLanguageModelCommand.ts diff --git a/clients/client-transcribe/commands/GetCallAnalyticsCategoryCommand.ts b/clients/client-transcribe/src/commands/GetCallAnalyticsCategoryCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetCallAnalyticsCategoryCommand.ts rename to clients/client-transcribe/src/commands/GetCallAnalyticsCategoryCommand.ts diff --git a/clients/client-transcribe/commands/GetCallAnalyticsJobCommand.ts b/clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetCallAnalyticsJobCommand.ts rename to clients/client-transcribe/src/commands/GetCallAnalyticsJobCommand.ts diff --git a/clients/client-transcribe/commands/GetMedicalTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/GetMedicalTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetMedicalTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/GetMedicalTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/GetMedicalVocabularyCommand.ts b/clients/client-transcribe/src/commands/GetMedicalVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetMedicalVocabularyCommand.ts rename to clients/client-transcribe/src/commands/GetMedicalVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/GetTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/GetTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/GetTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/GetVocabularyCommand.ts b/clients/client-transcribe/src/commands/GetVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetVocabularyCommand.ts rename to clients/client-transcribe/src/commands/GetVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/GetVocabularyFilterCommand.ts b/clients/client-transcribe/src/commands/GetVocabularyFilterCommand.ts similarity index 100% rename from clients/client-transcribe/commands/GetVocabularyFilterCommand.ts rename to clients/client-transcribe/src/commands/GetVocabularyFilterCommand.ts diff --git a/clients/client-transcribe/commands/ListCallAnalyticsCategoriesCommand.ts b/clients/client-transcribe/src/commands/ListCallAnalyticsCategoriesCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListCallAnalyticsCategoriesCommand.ts rename to clients/client-transcribe/src/commands/ListCallAnalyticsCategoriesCommand.ts diff --git a/clients/client-transcribe/commands/ListCallAnalyticsJobsCommand.ts b/clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListCallAnalyticsJobsCommand.ts rename to clients/client-transcribe/src/commands/ListCallAnalyticsJobsCommand.ts diff --git a/clients/client-transcribe/commands/ListLanguageModelsCommand.ts b/clients/client-transcribe/src/commands/ListLanguageModelsCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListLanguageModelsCommand.ts rename to clients/client-transcribe/src/commands/ListLanguageModelsCommand.ts diff --git a/clients/client-transcribe/commands/ListMedicalTranscriptionJobsCommand.ts b/clients/client-transcribe/src/commands/ListMedicalTranscriptionJobsCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListMedicalTranscriptionJobsCommand.ts rename to clients/client-transcribe/src/commands/ListMedicalTranscriptionJobsCommand.ts diff --git a/clients/client-transcribe/commands/ListMedicalVocabulariesCommand.ts b/clients/client-transcribe/src/commands/ListMedicalVocabulariesCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListMedicalVocabulariesCommand.ts rename to clients/client-transcribe/src/commands/ListMedicalVocabulariesCommand.ts diff --git a/clients/client-transcribe/commands/ListTagsForResourceCommand.ts b/clients/client-transcribe/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListTagsForResourceCommand.ts rename to clients/client-transcribe/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-transcribe/commands/ListTranscriptionJobsCommand.ts b/clients/client-transcribe/src/commands/ListTranscriptionJobsCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListTranscriptionJobsCommand.ts rename to clients/client-transcribe/src/commands/ListTranscriptionJobsCommand.ts diff --git a/clients/client-transcribe/commands/ListVocabulariesCommand.ts b/clients/client-transcribe/src/commands/ListVocabulariesCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListVocabulariesCommand.ts rename to clients/client-transcribe/src/commands/ListVocabulariesCommand.ts diff --git a/clients/client-transcribe/commands/ListVocabularyFiltersCommand.ts b/clients/client-transcribe/src/commands/ListVocabularyFiltersCommand.ts similarity index 100% rename from clients/client-transcribe/commands/ListVocabularyFiltersCommand.ts rename to clients/client-transcribe/src/commands/ListVocabularyFiltersCommand.ts diff --git a/clients/client-transcribe/commands/StartCallAnalyticsJobCommand.ts b/clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/StartCallAnalyticsJobCommand.ts rename to clients/client-transcribe/src/commands/StartCallAnalyticsJobCommand.ts diff --git a/clients/client-transcribe/commands/StartMedicalTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/StartMedicalTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/StartMedicalTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/StartMedicalTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/StartTranscriptionJobCommand.ts b/clients/client-transcribe/src/commands/StartTranscriptionJobCommand.ts similarity index 100% rename from clients/client-transcribe/commands/StartTranscriptionJobCommand.ts rename to clients/client-transcribe/src/commands/StartTranscriptionJobCommand.ts diff --git a/clients/client-transcribe/commands/TagResourceCommand.ts b/clients/client-transcribe/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-transcribe/commands/TagResourceCommand.ts rename to clients/client-transcribe/src/commands/TagResourceCommand.ts diff --git a/clients/client-transcribe/commands/UntagResourceCommand.ts b/clients/client-transcribe/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-transcribe/commands/UntagResourceCommand.ts rename to clients/client-transcribe/src/commands/UntagResourceCommand.ts diff --git a/clients/client-transcribe/commands/UpdateCallAnalyticsCategoryCommand.ts b/clients/client-transcribe/src/commands/UpdateCallAnalyticsCategoryCommand.ts similarity index 100% rename from clients/client-transcribe/commands/UpdateCallAnalyticsCategoryCommand.ts rename to clients/client-transcribe/src/commands/UpdateCallAnalyticsCategoryCommand.ts diff --git a/clients/client-transcribe/commands/UpdateMedicalVocabularyCommand.ts b/clients/client-transcribe/src/commands/UpdateMedicalVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/UpdateMedicalVocabularyCommand.ts rename to clients/client-transcribe/src/commands/UpdateMedicalVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/UpdateVocabularyCommand.ts b/clients/client-transcribe/src/commands/UpdateVocabularyCommand.ts similarity index 100% rename from clients/client-transcribe/commands/UpdateVocabularyCommand.ts rename to clients/client-transcribe/src/commands/UpdateVocabularyCommand.ts diff --git a/clients/client-transcribe/commands/UpdateVocabularyFilterCommand.ts b/clients/client-transcribe/src/commands/UpdateVocabularyFilterCommand.ts similarity index 100% rename from clients/client-transcribe/commands/UpdateVocabularyFilterCommand.ts rename to clients/client-transcribe/src/commands/UpdateVocabularyFilterCommand.ts diff --git a/clients/client-transcribe/endpoints.ts b/clients/client-transcribe/src/endpoints.ts similarity index 100% rename from clients/client-transcribe/endpoints.ts rename to clients/client-transcribe/src/endpoints.ts diff --git a/clients/client-transcribe/index.ts b/clients/client-transcribe/src/index.ts similarity index 100% rename from clients/client-transcribe/index.ts rename to clients/client-transcribe/src/index.ts diff --git a/clients/client-transcribe/models/index.ts b/clients/client-transcribe/src/models/index.ts similarity index 100% rename from clients/client-transcribe/models/index.ts rename to clients/client-transcribe/src/models/index.ts diff --git a/clients/client-transcribe/models/models_0.ts b/clients/client-transcribe/src/models/models_0.ts similarity index 100% rename from clients/client-transcribe/models/models_0.ts rename to clients/client-transcribe/src/models/models_0.ts diff --git a/clients/client-transcribe/pagination/Interfaces.ts b/clients/client-transcribe/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-transcribe/pagination/Interfaces.ts rename to clients/client-transcribe/src/pagination/Interfaces.ts diff --git a/clients/client-transcribe/pagination/ListCallAnalyticsCategoriesPaginator.ts b/clients/client-transcribe/src/pagination/ListCallAnalyticsCategoriesPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListCallAnalyticsCategoriesPaginator.ts rename to clients/client-transcribe/src/pagination/ListCallAnalyticsCategoriesPaginator.ts diff --git a/clients/client-transcribe/pagination/ListCallAnalyticsJobsPaginator.ts b/clients/client-transcribe/src/pagination/ListCallAnalyticsJobsPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListCallAnalyticsJobsPaginator.ts rename to clients/client-transcribe/src/pagination/ListCallAnalyticsJobsPaginator.ts diff --git a/clients/client-transcribe/pagination/ListLanguageModelsPaginator.ts b/clients/client-transcribe/src/pagination/ListLanguageModelsPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListLanguageModelsPaginator.ts rename to clients/client-transcribe/src/pagination/ListLanguageModelsPaginator.ts diff --git a/clients/client-transcribe/pagination/ListMedicalTranscriptionJobsPaginator.ts b/clients/client-transcribe/src/pagination/ListMedicalTranscriptionJobsPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListMedicalTranscriptionJobsPaginator.ts rename to clients/client-transcribe/src/pagination/ListMedicalTranscriptionJobsPaginator.ts diff --git a/clients/client-transcribe/pagination/ListMedicalVocabulariesPaginator.ts b/clients/client-transcribe/src/pagination/ListMedicalVocabulariesPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListMedicalVocabulariesPaginator.ts rename to clients/client-transcribe/src/pagination/ListMedicalVocabulariesPaginator.ts diff --git a/clients/client-transcribe/pagination/ListTranscriptionJobsPaginator.ts b/clients/client-transcribe/src/pagination/ListTranscriptionJobsPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListTranscriptionJobsPaginator.ts rename to clients/client-transcribe/src/pagination/ListTranscriptionJobsPaginator.ts diff --git a/clients/client-transcribe/pagination/ListVocabulariesPaginator.ts b/clients/client-transcribe/src/pagination/ListVocabulariesPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListVocabulariesPaginator.ts rename to clients/client-transcribe/src/pagination/ListVocabulariesPaginator.ts diff --git a/clients/client-transcribe/pagination/ListVocabularyFiltersPaginator.ts b/clients/client-transcribe/src/pagination/ListVocabularyFiltersPaginator.ts similarity index 100% rename from clients/client-transcribe/pagination/ListVocabularyFiltersPaginator.ts rename to clients/client-transcribe/src/pagination/ListVocabularyFiltersPaginator.ts diff --git a/clients/client-transcribe/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-transcribe/protocols/Aws_json1_1.ts rename to clients/client-transcribe/src/protocols/Aws_json1_1.ts diff --git a/clients/client-transcribe/src/runtimeConfig.browser.ts b/clients/client-transcribe/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..49a1690b1937 --- /dev/null +++ b/clients/client-transcribe/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TranscribeClientConfig } from "./TranscribeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranscribeClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transcribe/runtimeConfig.native.ts b/clients/client-transcribe/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-transcribe/runtimeConfig.native.ts rename to clients/client-transcribe/src/runtimeConfig.native.ts diff --git a/clients/client-transcribe/runtimeConfig.shared.ts b/clients/client-transcribe/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-transcribe/runtimeConfig.shared.ts rename to clients/client-transcribe/src/runtimeConfig.shared.ts diff --git a/clients/client-transcribe/src/runtimeConfig.ts b/clients/client-transcribe/src/runtimeConfig.ts new file mode 100644 index 000000000000..fcc9072d750d --- /dev/null +++ b/clients/client-transcribe/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TranscribeClientConfig } from "./TranscribeClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranscribeClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transcribe/tsconfig.es.json b/clients/client-transcribe/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-transcribe/tsconfig.es.json +++ b/clients/client-transcribe/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-transcribe/tsconfig.json b/clients/client-transcribe/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-transcribe/tsconfig.json +++ b/clients/client-transcribe/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-transcribe/tsconfig.types.json b/clients/client-transcribe/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-transcribe/tsconfig.types.json +++ b/clients/client-transcribe/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-transfer/.gitignore b/clients/client-transfer/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-transfer/.gitignore +++ b/clients/client-transfer/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-transfer/package.json b/clients/client-transfer/package.json index 21da5d005184..bf7bd438f27e 100644 --- a/clients/client-transfer/package.json +++ b/clients/client-transfer/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-transfer", "repository": { "type": "git", diff --git a/clients/client-transfer/runtimeConfig.browser.ts b/clients/client-transfer/runtimeConfig.browser.ts deleted file mode 100644 index 4b84a5074ec1..000000000000 --- a/clients/client-transfer/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TransferClientConfig } from "./TransferClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TransferClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transfer/runtimeConfig.ts b/clients/client-transfer/runtimeConfig.ts deleted file mode 100644 index 2bf14b9ce9a8..000000000000 --- a/clients/client-transfer/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TransferClientConfig } from "./TransferClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TransferClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-transfer/Transfer.ts b/clients/client-transfer/src/Transfer.ts similarity index 100% rename from clients/client-transfer/Transfer.ts rename to clients/client-transfer/src/Transfer.ts diff --git a/clients/client-transfer/TransferClient.ts b/clients/client-transfer/src/TransferClient.ts similarity index 100% rename from clients/client-transfer/TransferClient.ts rename to clients/client-transfer/src/TransferClient.ts diff --git a/clients/client-transfer/commands/CreateAccessCommand.ts b/clients/client-transfer/src/commands/CreateAccessCommand.ts similarity index 100% rename from clients/client-transfer/commands/CreateAccessCommand.ts rename to clients/client-transfer/src/commands/CreateAccessCommand.ts diff --git a/clients/client-transfer/commands/CreateServerCommand.ts b/clients/client-transfer/src/commands/CreateServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/CreateServerCommand.ts rename to clients/client-transfer/src/commands/CreateServerCommand.ts diff --git a/clients/client-transfer/commands/CreateUserCommand.ts b/clients/client-transfer/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-transfer/commands/CreateUserCommand.ts rename to clients/client-transfer/src/commands/CreateUserCommand.ts diff --git a/clients/client-transfer/commands/CreateWorkflowCommand.ts b/clients/client-transfer/src/commands/CreateWorkflowCommand.ts similarity index 100% rename from clients/client-transfer/commands/CreateWorkflowCommand.ts rename to clients/client-transfer/src/commands/CreateWorkflowCommand.ts diff --git a/clients/client-transfer/commands/DeleteAccessCommand.ts b/clients/client-transfer/src/commands/DeleteAccessCommand.ts similarity index 100% rename from clients/client-transfer/commands/DeleteAccessCommand.ts rename to clients/client-transfer/src/commands/DeleteAccessCommand.ts diff --git a/clients/client-transfer/commands/DeleteServerCommand.ts b/clients/client-transfer/src/commands/DeleteServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/DeleteServerCommand.ts rename to clients/client-transfer/src/commands/DeleteServerCommand.ts diff --git a/clients/client-transfer/commands/DeleteSshPublicKeyCommand.ts b/clients/client-transfer/src/commands/DeleteSshPublicKeyCommand.ts similarity index 100% rename from clients/client-transfer/commands/DeleteSshPublicKeyCommand.ts rename to clients/client-transfer/src/commands/DeleteSshPublicKeyCommand.ts diff --git a/clients/client-transfer/commands/DeleteUserCommand.ts b/clients/client-transfer/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-transfer/commands/DeleteUserCommand.ts rename to clients/client-transfer/src/commands/DeleteUserCommand.ts diff --git a/clients/client-transfer/commands/DeleteWorkflowCommand.ts b/clients/client-transfer/src/commands/DeleteWorkflowCommand.ts similarity index 100% rename from clients/client-transfer/commands/DeleteWorkflowCommand.ts rename to clients/client-transfer/src/commands/DeleteWorkflowCommand.ts diff --git a/clients/client-transfer/commands/DescribeAccessCommand.ts b/clients/client-transfer/src/commands/DescribeAccessCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeAccessCommand.ts rename to clients/client-transfer/src/commands/DescribeAccessCommand.ts diff --git a/clients/client-transfer/commands/DescribeExecutionCommand.ts b/clients/client-transfer/src/commands/DescribeExecutionCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeExecutionCommand.ts rename to clients/client-transfer/src/commands/DescribeExecutionCommand.ts diff --git a/clients/client-transfer/commands/DescribeSecurityPolicyCommand.ts b/clients/client-transfer/src/commands/DescribeSecurityPolicyCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeSecurityPolicyCommand.ts rename to clients/client-transfer/src/commands/DescribeSecurityPolicyCommand.ts diff --git a/clients/client-transfer/commands/DescribeServerCommand.ts b/clients/client-transfer/src/commands/DescribeServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeServerCommand.ts rename to clients/client-transfer/src/commands/DescribeServerCommand.ts diff --git a/clients/client-transfer/commands/DescribeUserCommand.ts b/clients/client-transfer/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeUserCommand.ts rename to clients/client-transfer/src/commands/DescribeUserCommand.ts diff --git a/clients/client-transfer/commands/DescribeWorkflowCommand.ts b/clients/client-transfer/src/commands/DescribeWorkflowCommand.ts similarity index 100% rename from clients/client-transfer/commands/DescribeWorkflowCommand.ts rename to clients/client-transfer/src/commands/DescribeWorkflowCommand.ts diff --git a/clients/client-transfer/commands/ImportSshPublicKeyCommand.ts b/clients/client-transfer/src/commands/ImportSshPublicKeyCommand.ts similarity index 100% rename from clients/client-transfer/commands/ImportSshPublicKeyCommand.ts rename to clients/client-transfer/src/commands/ImportSshPublicKeyCommand.ts diff --git a/clients/client-transfer/commands/ListAccessesCommand.ts b/clients/client-transfer/src/commands/ListAccessesCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListAccessesCommand.ts rename to clients/client-transfer/src/commands/ListAccessesCommand.ts diff --git a/clients/client-transfer/commands/ListExecutionsCommand.ts b/clients/client-transfer/src/commands/ListExecutionsCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListExecutionsCommand.ts rename to clients/client-transfer/src/commands/ListExecutionsCommand.ts diff --git a/clients/client-transfer/commands/ListSecurityPoliciesCommand.ts b/clients/client-transfer/src/commands/ListSecurityPoliciesCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListSecurityPoliciesCommand.ts rename to clients/client-transfer/src/commands/ListSecurityPoliciesCommand.ts diff --git a/clients/client-transfer/commands/ListServersCommand.ts b/clients/client-transfer/src/commands/ListServersCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListServersCommand.ts rename to clients/client-transfer/src/commands/ListServersCommand.ts diff --git a/clients/client-transfer/commands/ListTagsForResourceCommand.ts b/clients/client-transfer/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListTagsForResourceCommand.ts rename to clients/client-transfer/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-transfer/commands/ListUsersCommand.ts b/clients/client-transfer/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListUsersCommand.ts rename to clients/client-transfer/src/commands/ListUsersCommand.ts diff --git a/clients/client-transfer/commands/ListWorkflowsCommand.ts b/clients/client-transfer/src/commands/ListWorkflowsCommand.ts similarity index 100% rename from clients/client-transfer/commands/ListWorkflowsCommand.ts rename to clients/client-transfer/src/commands/ListWorkflowsCommand.ts diff --git a/clients/client-transfer/commands/SendWorkflowStepStateCommand.ts b/clients/client-transfer/src/commands/SendWorkflowStepStateCommand.ts similarity index 100% rename from clients/client-transfer/commands/SendWorkflowStepStateCommand.ts rename to clients/client-transfer/src/commands/SendWorkflowStepStateCommand.ts diff --git a/clients/client-transfer/commands/StartServerCommand.ts b/clients/client-transfer/src/commands/StartServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/StartServerCommand.ts rename to clients/client-transfer/src/commands/StartServerCommand.ts diff --git a/clients/client-transfer/commands/StopServerCommand.ts b/clients/client-transfer/src/commands/StopServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/StopServerCommand.ts rename to clients/client-transfer/src/commands/StopServerCommand.ts diff --git a/clients/client-transfer/commands/TagResourceCommand.ts b/clients/client-transfer/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-transfer/commands/TagResourceCommand.ts rename to clients/client-transfer/src/commands/TagResourceCommand.ts diff --git a/clients/client-transfer/commands/TestIdentityProviderCommand.ts b/clients/client-transfer/src/commands/TestIdentityProviderCommand.ts similarity index 100% rename from clients/client-transfer/commands/TestIdentityProviderCommand.ts rename to clients/client-transfer/src/commands/TestIdentityProviderCommand.ts diff --git a/clients/client-transfer/commands/UntagResourceCommand.ts b/clients/client-transfer/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-transfer/commands/UntagResourceCommand.ts rename to clients/client-transfer/src/commands/UntagResourceCommand.ts diff --git a/clients/client-transfer/commands/UpdateAccessCommand.ts b/clients/client-transfer/src/commands/UpdateAccessCommand.ts similarity index 100% rename from clients/client-transfer/commands/UpdateAccessCommand.ts rename to clients/client-transfer/src/commands/UpdateAccessCommand.ts diff --git a/clients/client-transfer/commands/UpdateServerCommand.ts b/clients/client-transfer/src/commands/UpdateServerCommand.ts similarity index 100% rename from clients/client-transfer/commands/UpdateServerCommand.ts rename to clients/client-transfer/src/commands/UpdateServerCommand.ts diff --git a/clients/client-transfer/commands/UpdateUserCommand.ts b/clients/client-transfer/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-transfer/commands/UpdateUserCommand.ts rename to clients/client-transfer/src/commands/UpdateUserCommand.ts diff --git a/clients/client-transfer/endpoints.ts b/clients/client-transfer/src/endpoints.ts similarity index 100% rename from clients/client-transfer/endpoints.ts rename to clients/client-transfer/src/endpoints.ts diff --git a/clients/client-transfer/index.ts b/clients/client-transfer/src/index.ts similarity index 100% rename from clients/client-transfer/index.ts rename to clients/client-transfer/src/index.ts diff --git a/clients/client-transfer/models/index.ts b/clients/client-transfer/src/models/index.ts similarity index 100% rename from clients/client-transfer/models/index.ts rename to clients/client-transfer/src/models/index.ts diff --git a/clients/client-transfer/models/models_0.ts b/clients/client-transfer/src/models/models_0.ts similarity index 100% rename from clients/client-transfer/models/models_0.ts rename to clients/client-transfer/src/models/models_0.ts diff --git a/clients/client-transfer/pagination/Interfaces.ts b/clients/client-transfer/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-transfer/pagination/Interfaces.ts rename to clients/client-transfer/src/pagination/Interfaces.ts diff --git a/clients/client-transfer/pagination/ListAccessesPaginator.ts b/clients/client-transfer/src/pagination/ListAccessesPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListAccessesPaginator.ts rename to clients/client-transfer/src/pagination/ListAccessesPaginator.ts diff --git a/clients/client-transfer/pagination/ListExecutionsPaginator.ts b/clients/client-transfer/src/pagination/ListExecutionsPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListExecutionsPaginator.ts rename to clients/client-transfer/src/pagination/ListExecutionsPaginator.ts diff --git a/clients/client-transfer/pagination/ListSecurityPoliciesPaginator.ts b/clients/client-transfer/src/pagination/ListSecurityPoliciesPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListSecurityPoliciesPaginator.ts rename to clients/client-transfer/src/pagination/ListSecurityPoliciesPaginator.ts diff --git a/clients/client-transfer/pagination/ListServersPaginator.ts b/clients/client-transfer/src/pagination/ListServersPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListServersPaginator.ts rename to clients/client-transfer/src/pagination/ListServersPaginator.ts diff --git a/clients/client-transfer/pagination/ListTagsForResourcePaginator.ts b/clients/client-transfer/src/pagination/ListTagsForResourcePaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListTagsForResourcePaginator.ts rename to clients/client-transfer/src/pagination/ListTagsForResourcePaginator.ts diff --git a/clients/client-transfer/pagination/ListUsersPaginator.ts b/clients/client-transfer/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListUsersPaginator.ts rename to clients/client-transfer/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-transfer/pagination/ListWorkflowsPaginator.ts b/clients/client-transfer/src/pagination/ListWorkflowsPaginator.ts similarity index 100% rename from clients/client-transfer/pagination/ListWorkflowsPaginator.ts rename to clients/client-transfer/src/pagination/ListWorkflowsPaginator.ts diff --git a/clients/client-transfer/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-transfer/protocols/Aws_json1_1.ts rename to clients/client-transfer/src/protocols/Aws_json1_1.ts diff --git a/clients/client-transfer/src/runtimeConfig.browser.ts b/clients/client-transfer/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..db7f4f143ac6 --- /dev/null +++ b/clients/client-transfer/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TransferClientConfig } from "./TransferClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TransferClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transfer/runtimeConfig.native.ts b/clients/client-transfer/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-transfer/runtimeConfig.native.ts rename to clients/client-transfer/src/runtimeConfig.native.ts diff --git a/clients/client-transfer/runtimeConfig.shared.ts b/clients/client-transfer/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-transfer/runtimeConfig.shared.ts rename to clients/client-transfer/src/runtimeConfig.shared.ts diff --git a/clients/client-transfer/src/runtimeConfig.ts b/clients/client-transfer/src/runtimeConfig.ts new file mode 100644 index 000000000000..ff405b541d9a --- /dev/null +++ b/clients/client-transfer/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TransferClientConfig } from "./TransferClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TransferClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-transfer/tsconfig.es.json b/clients/client-transfer/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-transfer/tsconfig.es.json +++ b/clients/client-transfer/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-transfer/tsconfig.json b/clients/client-transfer/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-transfer/tsconfig.json +++ b/clients/client-transfer/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-transfer/tsconfig.types.json b/clients/client-transfer/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-transfer/tsconfig.types.json +++ b/clients/client-transfer/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-translate/.gitignore b/clients/client-translate/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-translate/.gitignore +++ b/clients/client-translate/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-translate/package.json b/clients/client-translate/package.json index 485a977b9079..d0540820f3b1 100644 --- a/clients/client-translate/package.json +++ b/clients/client-translate/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-translate", "repository": { "type": "git", diff --git a/clients/client-translate/runtimeConfig.browser.ts b/clients/client-translate/runtimeConfig.browser.ts deleted file mode 100644 index a5efe123f9ac..000000000000 --- a/clients/client-translate/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { TranslateClientConfig } from "./TranslateClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranslateClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-translate/runtimeConfig.ts b/clients/client-translate/runtimeConfig.ts deleted file mode 100644 index 0de9dbcf37c1..000000000000 --- a/clients/client-translate/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { TranslateClientConfig } from "./TranslateClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: TranslateClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-translate/Translate.ts b/clients/client-translate/src/Translate.ts similarity index 100% rename from clients/client-translate/Translate.ts rename to clients/client-translate/src/Translate.ts diff --git a/clients/client-translate/TranslateClient.ts b/clients/client-translate/src/TranslateClient.ts similarity index 100% rename from clients/client-translate/TranslateClient.ts rename to clients/client-translate/src/TranslateClient.ts diff --git a/clients/client-translate/commands/CreateParallelDataCommand.ts b/clients/client-translate/src/commands/CreateParallelDataCommand.ts similarity index 100% rename from clients/client-translate/commands/CreateParallelDataCommand.ts rename to clients/client-translate/src/commands/CreateParallelDataCommand.ts diff --git a/clients/client-translate/commands/DeleteParallelDataCommand.ts b/clients/client-translate/src/commands/DeleteParallelDataCommand.ts similarity index 100% rename from clients/client-translate/commands/DeleteParallelDataCommand.ts rename to clients/client-translate/src/commands/DeleteParallelDataCommand.ts diff --git a/clients/client-translate/commands/DeleteTerminologyCommand.ts b/clients/client-translate/src/commands/DeleteTerminologyCommand.ts similarity index 100% rename from clients/client-translate/commands/DeleteTerminologyCommand.ts rename to clients/client-translate/src/commands/DeleteTerminologyCommand.ts diff --git a/clients/client-translate/commands/DescribeTextTranslationJobCommand.ts b/clients/client-translate/src/commands/DescribeTextTranslationJobCommand.ts similarity index 100% rename from clients/client-translate/commands/DescribeTextTranslationJobCommand.ts rename to clients/client-translate/src/commands/DescribeTextTranslationJobCommand.ts diff --git a/clients/client-translate/commands/GetParallelDataCommand.ts b/clients/client-translate/src/commands/GetParallelDataCommand.ts similarity index 100% rename from clients/client-translate/commands/GetParallelDataCommand.ts rename to clients/client-translate/src/commands/GetParallelDataCommand.ts diff --git a/clients/client-translate/commands/GetTerminologyCommand.ts b/clients/client-translate/src/commands/GetTerminologyCommand.ts similarity index 100% rename from clients/client-translate/commands/GetTerminologyCommand.ts rename to clients/client-translate/src/commands/GetTerminologyCommand.ts diff --git a/clients/client-translate/commands/ImportTerminologyCommand.ts b/clients/client-translate/src/commands/ImportTerminologyCommand.ts similarity index 100% rename from clients/client-translate/commands/ImportTerminologyCommand.ts rename to clients/client-translate/src/commands/ImportTerminologyCommand.ts diff --git a/clients/client-translate/commands/ListParallelDataCommand.ts b/clients/client-translate/src/commands/ListParallelDataCommand.ts similarity index 100% rename from clients/client-translate/commands/ListParallelDataCommand.ts rename to clients/client-translate/src/commands/ListParallelDataCommand.ts diff --git a/clients/client-translate/commands/ListTerminologiesCommand.ts b/clients/client-translate/src/commands/ListTerminologiesCommand.ts similarity index 100% rename from clients/client-translate/commands/ListTerminologiesCommand.ts rename to clients/client-translate/src/commands/ListTerminologiesCommand.ts diff --git a/clients/client-translate/commands/ListTextTranslationJobsCommand.ts b/clients/client-translate/src/commands/ListTextTranslationJobsCommand.ts similarity index 100% rename from clients/client-translate/commands/ListTextTranslationJobsCommand.ts rename to clients/client-translate/src/commands/ListTextTranslationJobsCommand.ts diff --git a/clients/client-translate/commands/StartTextTranslationJobCommand.ts b/clients/client-translate/src/commands/StartTextTranslationJobCommand.ts similarity index 100% rename from clients/client-translate/commands/StartTextTranslationJobCommand.ts rename to clients/client-translate/src/commands/StartTextTranslationJobCommand.ts diff --git a/clients/client-translate/commands/StopTextTranslationJobCommand.ts b/clients/client-translate/src/commands/StopTextTranslationJobCommand.ts similarity index 100% rename from clients/client-translate/commands/StopTextTranslationJobCommand.ts rename to clients/client-translate/src/commands/StopTextTranslationJobCommand.ts diff --git a/clients/client-translate/commands/TranslateTextCommand.ts b/clients/client-translate/src/commands/TranslateTextCommand.ts similarity index 100% rename from clients/client-translate/commands/TranslateTextCommand.ts rename to clients/client-translate/src/commands/TranslateTextCommand.ts diff --git a/clients/client-translate/commands/UpdateParallelDataCommand.ts b/clients/client-translate/src/commands/UpdateParallelDataCommand.ts similarity index 100% rename from clients/client-translate/commands/UpdateParallelDataCommand.ts rename to clients/client-translate/src/commands/UpdateParallelDataCommand.ts diff --git a/clients/client-translate/endpoints.ts b/clients/client-translate/src/endpoints.ts similarity index 100% rename from clients/client-translate/endpoints.ts rename to clients/client-translate/src/endpoints.ts diff --git a/clients/client-translate/index.ts b/clients/client-translate/src/index.ts similarity index 100% rename from clients/client-translate/index.ts rename to clients/client-translate/src/index.ts diff --git a/clients/client-translate/models/index.ts b/clients/client-translate/src/models/index.ts similarity index 100% rename from clients/client-translate/models/index.ts rename to clients/client-translate/src/models/index.ts diff --git a/clients/client-translate/models/models_0.ts b/clients/client-translate/src/models/models_0.ts similarity index 100% rename from clients/client-translate/models/models_0.ts rename to clients/client-translate/src/models/models_0.ts diff --git a/clients/client-translate/pagination/Interfaces.ts b/clients/client-translate/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-translate/pagination/Interfaces.ts rename to clients/client-translate/src/pagination/Interfaces.ts diff --git a/clients/client-translate/pagination/ListParallelDataPaginator.ts b/clients/client-translate/src/pagination/ListParallelDataPaginator.ts similarity index 100% rename from clients/client-translate/pagination/ListParallelDataPaginator.ts rename to clients/client-translate/src/pagination/ListParallelDataPaginator.ts diff --git a/clients/client-translate/pagination/ListTerminologiesPaginator.ts b/clients/client-translate/src/pagination/ListTerminologiesPaginator.ts similarity index 100% rename from clients/client-translate/pagination/ListTerminologiesPaginator.ts rename to clients/client-translate/src/pagination/ListTerminologiesPaginator.ts diff --git a/clients/client-translate/pagination/ListTextTranslationJobsPaginator.ts b/clients/client-translate/src/pagination/ListTextTranslationJobsPaginator.ts similarity index 100% rename from clients/client-translate/pagination/ListTextTranslationJobsPaginator.ts rename to clients/client-translate/src/pagination/ListTextTranslationJobsPaginator.ts diff --git a/clients/client-translate/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-translate/protocols/Aws_json1_1.ts rename to clients/client-translate/src/protocols/Aws_json1_1.ts diff --git a/clients/client-translate/src/runtimeConfig.browser.ts b/clients/client-translate/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4c303ec3a4ae --- /dev/null +++ b/clients/client-translate/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { TranslateClientConfig } from "./TranslateClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranslateClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-translate/runtimeConfig.native.ts b/clients/client-translate/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-translate/runtimeConfig.native.ts rename to clients/client-translate/src/runtimeConfig.native.ts diff --git a/clients/client-translate/runtimeConfig.shared.ts b/clients/client-translate/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-translate/runtimeConfig.shared.ts rename to clients/client-translate/src/runtimeConfig.shared.ts diff --git a/clients/client-translate/src/runtimeConfig.ts b/clients/client-translate/src/runtimeConfig.ts new file mode 100644 index 000000000000..a92afbf7ec85 --- /dev/null +++ b/clients/client-translate/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { TranslateClientConfig } from "./TranslateClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TranslateClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-translate/tsconfig.es.json b/clients/client-translate/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-translate/tsconfig.es.json +++ b/clients/client-translate/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-translate/tsconfig.json b/clients/client-translate/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-translate/tsconfig.json +++ b/clients/client-translate/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-translate/tsconfig.types.json b/clients/client-translate/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-translate/tsconfig.types.json +++ b/clients/client-translate/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-waf-regional/.gitignore b/clients/client-waf-regional/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-waf-regional/.gitignore +++ b/clients/client-waf-regional/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-waf-regional/package.json b/clients/client-waf-regional/package.json index 7e113a596513..e4c3ac7db0e7 100644 --- a/clients/client-waf-regional/package.json +++ b/clients/client-waf-regional/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-waf-regional", "repository": { "type": "git", diff --git a/clients/client-waf-regional/runtimeConfig.browser.ts b/clients/client-waf-regional/runtimeConfig.browser.ts deleted file mode 100644 index 5d4689fb5046..000000000000 --- a/clients/client-waf-regional/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WAFRegionalClientConfig } from "./WAFRegionalClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-waf-regional/runtimeConfig.ts b/clients/client-waf-regional/runtimeConfig.ts deleted file mode 100644 index 95687327fadc..000000000000 --- a/clients/client-waf-regional/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WAFRegionalClientConfig } from "./WAFRegionalClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-waf-regional/WAFRegional.ts b/clients/client-waf-regional/src/WAFRegional.ts similarity index 100% rename from clients/client-waf-regional/WAFRegional.ts rename to clients/client-waf-regional/src/WAFRegional.ts diff --git a/clients/client-waf-regional/WAFRegionalClient.ts b/clients/client-waf-regional/src/WAFRegionalClient.ts similarity index 100% rename from clients/client-waf-regional/WAFRegionalClient.ts rename to clients/client-waf-regional/src/WAFRegionalClient.ts diff --git a/clients/client-waf-regional/commands/AssociateWebACLCommand.ts b/clients/client-waf-regional/src/commands/AssociateWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/AssociateWebACLCommand.ts rename to clients/client-waf-regional/src/commands/AssociateWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/CreateByteMatchSetCommand.ts b/clients/client-waf-regional/src/commands/CreateByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateByteMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateByteMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateGeoMatchSetCommand.ts b/clients/client-waf-regional/src/commands/CreateGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateGeoMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateGeoMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateIPSetCommand.ts b/clients/client-waf-regional/src/commands/CreateIPSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateIPSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateIPSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateRateBasedRuleCommand.ts b/clients/client-waf-regional/src/commands/CreateRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateRateBasedRuleCommand.ts rename to clients/client-waf-regional/src/commands/CreateRateBasedRuleCommand.ts diff --git a/clients/client-waf-regional/commands/CreateRegexMatchSetCommand.ts b/clients/client-waf-regional/src/commands/CreateRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateRegexMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateRegexMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateRegexPatternSetCommand.ts b/clients/client-waf-regional/src/commands/CreateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateRegexPatternSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateRegexPatternSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateRuleCommand.ts b/clients/client-waf-regional/src/commands/CreateRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateRuleCommand.ts rename to clients/client-waf-regional/src/commands/CreateRuleCommand.ts diff --git a/clients/client-waf-regional/commands/CreateRuleGroupCommand.ts b/clients/client-waf-regional/src/commands/CreateRuleGroupCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateRuleGroupCommand.ts rename to clients/client-waf-regional/src/commands/CreateRuleGroupCommand.ts diff --git a/clients/client-waf-regional/commands/CreateSizeConstraintSetCommand.ts b/clients/client-waf-regional/src/commands/CreateSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateSizeConstraintSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateSizeConstraintSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateSqlInjectionMatchSetCommand.ts b/clients/client-waf-regional/src/commands/CreateSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateSqlInjectionMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/CreateWebACLCommand.ts b/clients/client-waf-regional/src/commands/CreateWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateWebACLCommand.ts rename to clients/client-waf-regional/src/commands/CreateWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/CreateWebACLMigrationStackCommand.ts b/clients/client-waf-regional/src/commands/CreateWebACLMigrationStackCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateWebACLMigrationStackCommand.ts rename to clients/client-waf-regional/src/commands/CreateWebACLMigrationStackCommand.ts diff --git a/clients/client-waf-regional/commands/CreateXssMatchSetCommand.ts b/clients/client-waf-regional/src/commands/CreateXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/CreateXssMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/CreateXssMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteByteMatchSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteByteMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteByteMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteGeoMatchSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteGeoMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteGeoMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteIPSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteIPSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteIPSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteIPSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteLoggingConfigurationCommand.ts b/clients/client-waf-regional/src/commands/DeleteLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteLoggingConfigurationCommand.ts rename to clients/client-waf-regional/src/commands/DeleteLoggingConfigurationCommand.ts diff --git a/clients/client-waf-regional/commands/DeletePermissionPolicyCommand.ts b/clients/client-waf-regional/src/commands/DeletePermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeletePermissionPolicyCommand.ts rename to clients/client-waf-regional/src/commands/DeletePermissionPolicyCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteRateBasedRuleCommand.ts b/clients/client-waf-regional/src/commands/DeleteRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteRateBasedRuleCommand.ts rename to clients/client-waf-regional/src/commands/DeleteRateBasedRuleCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteRegexMatchSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteRegexMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteRegexMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteRegexPatternSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteRegexPatternSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteRegexPatternSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteRuleCommand.ts b/clients/client-waf-regional/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteRuleCommand.ts rename to clients/client-waf-regional/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteRuleGroupCommand.ts b/clients/client-waf-regional/src/commands/DeleteRuleGroupCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteRuleGroupCommand.ts rename to clients/client-waf-regional/src/commands/DeleteRuleGroupCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteSizeConstraintSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteSizeConstraintSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteSizeConstraintSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteSqlInjectionMatchSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteSqlInjectionMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteWebACLCommand.ts b/clients/client-waf-regional/src/commands/DeleteWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteWebACLCommand.ts rename to clients/client-waf-regional/src/commands/DeleteWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/DeleteXssMatchSetCommand.ts b/clients/client-waf-regional/src/commands/DeleteXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DeleteXssMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/DeleteXssMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/DisassociateWebACLCommand.ts b/clients/client-waf-regional/src/commands/DisassociateWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/DisassociateWebACLCommand.ts rename to clients/client-waf-regional/src/commands/DisassociateWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/GetByteMatchSetCommand.ts b/clients/client-waf-regional/src/commands/GetByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetByteMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/GetByteMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetChangeTokenCommand.ts b/clients/client-waf-regional/src/commands/GetChangeTokenCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetChangeTokenCommand.ts rename to clients/client-waf-regional/src/commands/GetChangeTokenCommand.ts diff --git a/clients/client-waf-regional/commands/GetChangeTokenStatusCommand.ts b/clients/client-waf-regional/src/commands/GetChangeTokenStatusCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetChangeTokenStatusCommand.ts rename to clients/client-waf-regional/src/commands/GetChangeTokenStatusCommand.ts diff --git a/clients/client-waf-regional/commands/GetGeoMatchSetCommand.ts b/clients/client-waf-regional/src/commands/GetGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetGeoMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/GetGeoMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetIPSetCommand.ts b/clients/client-waf-regional/src/commands/GetIPSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetIPSetCommand.ts rename to clients/client-waf-regional/src/commands/GetIPSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetLoggingConfigurationCommand.ts b/clients/client-waf-regional/src/commands/GetLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetLoggingConfigurationCommand.ts rename to clients/client-waf-regional/src/commands/GetLoggingConfigurationCommand.ts diff --git a/clients/client-waf-regional/commands/GetPermissionPolicyCommand.ts b/clients/client-waf-regional/src/commands/GetPermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetPermissionPolicyCommand.ts rename to clients/client-waf-regional/src/commands/GetPermissionPolicyCommand.ts diff --git a/clients/client-waf-regional/commands/GetRateBasedRuleCommand.ts b/clients/client-waf-regional/src/commands/GetRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRateBasedRuleCommand.ts rename to clients/client-waf-regional/src/commands/GetRateBasedRuleCommand.ts diff --git a/clients/client-waf-regional/commands/GetRateBasedRuleManagedKeysCommand.ts b/clients/client-waf-regional/src/commands/GetRateBasedRuleManagedKeysCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRateBasedRuleManagedKeysCommand.ts rename to clients/client-waf-regional/src/commands/GetRateBasedRuleManagedKeysCommand.ts diff --git a/clients/client-waf-regional/commands/GetRegexMatchSetCommand.ts b/clients/client-waf-regional/src/commands/GetRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRegexMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/GetRegexMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetRegexPatternSetCommand.ts b/clients/client-waf-regional/src/commands/GetRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRegexPatternSetCommand.ts rename to clients/client-waf-regional/src/commands/GetRegexPatternSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetRuleCommand.ts b/clients/client-waf-regional/src/commands/GetRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRuleCommand.ts rename to clients/client-waf-regional/src/commands/GetRuleCommand.ts diff --git a/clients/client-waf-regional/commands/GetRuleGroupCommand.ts b/clients/client-waf-regional/src/commands/GetRuleGroupCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetRuleGroupCommand.ts rename to clients/client-waf-regional/src/commands/GetRuleGroupCommand.ts diff --git a/clients/client-waf-regional/commands/GetSampledRequestsCommand.ts b/clients/client-waf-regional/src/commands/GetSampledRequestsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetSampledRequestsCommand.ts rename to clients/client-waf-regional/src/commands/GetSampledRequestsCommand.ts diff --git a/clients/client-waf-regional/commands/GetSizeConstraintSetCommand.ts b/clients/client-waf-regional/src/commands/GetSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetSizeConstraintSetCommand.ts rename to clients/client-waf-regional/src/commands/GetSizeConstraintSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetSqlInjectionMatchSetCommand.ts b/clients/client-waf-regional/src/commands/GetSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetSqlInjectionMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/GetSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/GetWebACLCommand.ts b/clients/client-waf-regional/src/commands/GetWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetWebACLCommand.ts rename to clients/client-waf-regional/src/commands/GetWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/GetWebACLForResourceCommand.ts b/clients/client-waf-regional/src/commands/GetWebACLForResourceCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetWebACLForResourceCommand.ts rename to clients/client-waf-regional/src/commands/GetWebACLForResourceCommand.ts diff --git a/clients/client-waf-regional/commands/GetXssMatchSetCommand.ts b/clients/client-waf-regional/src/commands/GetXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/GetXssMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/GetXssMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/ListActivatedRulesInRuleGroupCommand.ts b/clients/client-waf-regional/src/commands/ListActivatedRulesInRuleGroupCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListActivatedRulesInRuleGroupCommand.ts rename to clients/client-waf-regional/src/commands/ListActivatedRulesInRuleGroupCommand.ts diff --git a/clients/client-waf-regional/commands/ListByteMatchSetsCommand.ts b/clients/client-waf-regional/src/commands/ListByteMatchSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListByteMatchSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListByteMatchSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListGeoMatchSetsCommand.ts b/clients/client-waf-regional/src/commands/ListGeoMatchSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListGeoMatchSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListGeoMatchSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListIPSetsCommand.ts b/clients/client-waf-regional/src/commands/ListIPSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListIPSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListIPSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListLoggingConfigurationsCommand.ts b/clients/client-waf-regional/src/commands/ListLoggingConfigurationsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListLoggingConfigurationsCommand.ts rename to clients/client-waf-regional/src/commands/ListLoggingConfigurationsCommand.ts diff --git a/clients/client-waf-regional/commands/ListRateBasedRulesCommand.ts b/clients/client-waf-regional/src/commands/ListRateBasedRulesCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListRateBasedRulesCommand.ts rename to clients/client-waf-regional/src/commands/ListRateBasedRulesCommand.ts diff --git a/clients/client-waf-regional/commands/ListRegexMatchSetsCommand.ts b/clients/client-waf-regional/src/commands/ListRegexMatchSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListRegexMatchSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListRegexMatchSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListRegexPatternSetsCommand.ts b/clients/client-waf-regional/src/commands/ListRegexPatternSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListRegexPatternSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListRegexPatternSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListResourcesForWebACLCommand.ts b/clients/client-waf-regional/src/commands/ListResourcesForWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListResourcesForWebACLCommand.ts rename to clients/client-waf-regional/src/commands/ListResourcesForWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/ListRuleGroupsCommand.ts b/clients/client-waf-regional/src/commands/ListRuleGroupsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListRuleGroupsCommand.ts rename to clients/client-waf-regional/src/commands/ListRuleGroupsCommand.ts diff --git a/clients/client-waf-regional/commands/ListRulesCommand.ts b/clients/client-waf-regional/src/commands/ListRulesCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListRulesCommand.ts rename to clients/client-waf-regional/src/commands/ListRulesCommand.ts diff --git a/clients/client-waf-regional/commands/ListSizeConstraintSetsCommand.ts b/clients/client-waf-regional/src/commands/ListSizeConstraintSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListSizeConstraintSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListSizeConstraintSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListSqlInjectionMatchSetsCommand.ts b/clients/client-waf-regional/src/commands/ListSqlInjectionMatchSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListSqlInjectionMatchSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListSqlInjectionMatchSetsCommand.ts diff --git a/clients/client-waf-regional/commands/ListSubscribedRuleGroupsCommand.ts b/clients/client-waf-regional/src/commands/ListSubscribedRuleGroupsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListSubscribedRuleGroupsCommand.ts rename to clients/client-waf-regional/src/commands/ListSubscribedRuleGroupsCommand.ts diff --git a/clients/client-waf-regional/commands/ListTagsForResourceCommand.ts b/clients/client-waf-regional/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListTagsForResourceCommand.ts rename to clients/client-waf-regional/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-waf-regional/commands/ListWebACLsCommand.ts b/clients/client-waf-regional/src/commands/ListWebACLsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListWebACLsCommand.ts rename to clients/client-waf-regional/src/commands/ListWebACLsCommand.ts diff --git a/clients/client-waf-regional/commands/ListXssMatchSetsCommand.ts b/clients/client-waf-regional/src/commands/ListXssMatchSetsCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/ListXssMatchSetsCommand.ts rename to clients/client-waf-regional/src/commands/ListXssMatchSetsCommand.ts diff --git a/clients/client-waf-regional/commands/PutLoggingConfigurationCommand.ts b/clients/client-waf-regional/src/commands/PutLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/PutLoggingConfigurationCommand.ts rename to clients/client-waf-regional/src/commands/PutLoggingConfigurationCommand.ts diff --git a/clients/client-waf-regional/commands/PutPermissionPolicyCommand.ts b/clients/client-waf-regional/src/commands/PutPermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/PutPermissionPolicyCommand.ts rename to clients/client-waf-regional/src/commands/PutPermissionPolicyCommand.ts diff --git a/clients/client-waf-regional/commands/TagResourceCommand.ts b/clients/client-waf-regional/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/TagResourceCommand.ts rename to clients/client-waf-regional/src/commands/TagResourceCommand.ts diff --git a/clients/client-waf-regional/commands/UntagResourceCommand.ts b/clients/client-waf-regional/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UntagResourceCommand.ts rename to clients/client-waf-regional/src/commands/UntagResourceCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateByteMatchSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateByteMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateByteMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateGeoMatchSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateGeoMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateGeoMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateIPSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateIPSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateIPSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateIPSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateRateBasedRuleCommand.ts b/clients/client-waf-regional/src/commands/UpdateRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateRateBasedRuleCommand.ts rename to clients/client-waf-regional/src/commands/UpdateRateBasedRuleCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateRegexMatchSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateRegexMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateRegexMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateRegexPatternSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateRegexPatternSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateRegexPatternSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateRuleCommand.ts b/clients/client-waf-regional/src/commands/UpdateRuleCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateRuleCommand.ts rename to clients/client-waf-regional/src/commands/UpdateRuleCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateRuleGroupCommand.ts b/clients/client-waf-regional/src/commands/UpdateRuleGroupCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateRuleGroupCommand.ts rename to clients/client-waf-regional/src/commands/UpdateRuleGroupCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateSizeConstraintSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateSizeConstraintSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateSizeConstraintSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateSqlInjectionMatchSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateSqlInjectionMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateWebACLCommand.ts b/clients/client-waf-regional/src/commands/UpdateWebACLCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateWebACLCommand.ts rename to clients/client-waf-regional/src/commands/UpdateWebACLCommand.ts diff --git a/clients/client-waf-regional/commands/UpdateXssMatchSetCommand.ts b/clients/client-waf-regional/src/commands/UpdateXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf-regional/commands/UpdateXssMatchSetCommand.ts rename to clients/client-waf-regional/src/commands/UpdateXssMatchSetCommand.ts diff --git a/clients/client-waf-regional/endpoints.ts b/clients/client-waf-regional/src/endpoints.ts similarity index 100% rename from clients/client-waf-regional/endpoints.ts rename to clients/client-waf-regional/src/endpoints.ts diff --git a/clients/client-waf-regional/index.ts b/clients/client-waf-regional/src/index.ts similarity index 100% rename from clients/client-waf-regional/index.ts rename to clients/client-waf-regional/src/index.ts diff --git a/clients/client-waf-regional/models/index.ts b/clients/client-waf-regional/src/models/index.ts similarity index 100% rename from clients/client-waf-regional/models/index.ts rename to clients/client-waf-regional/src/models/index.ts diff --git a/clients/client-waf-regional/models/models_0.ts b/clients/client-waf-regional/src/models/models_0.ts similarity index 100% rename from clients/client-waf-regional/models/models_0.ts rename to clients/client-waf-regional/src/models/models_0.ts diff --git a/clients/client-waf-regional/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-waf-regional/protocols/Aws_json1_1.ts rename to clients/client-waf-regional/src/protocols/Aws_json1_1.ts diff --git a/clients/client-waf-regional/src/runtimeConfig.browser.ts b/clients/client-waf-regional/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..0458e63a153c --- /dev/null +++ b/clients/client-waf-regional/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WAFRegionalClientConfig } from "./WAFRegionalClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-waf-regional/runtimeConfig.native.ts b/clients/client-waf-regional/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-waf-regional/runtimeConfig.native.ts rename to clients/client-waf-regional/src/runtimeConfig.native.ts diff --git a/clients/client-waf-regional/runtimeConfig.shared.ts b/clients/client-waf-regional/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-waf-regional/runtimeConfig.shared.ts rename to clients/client-waf-regional/src/runtimeConfig.shared.ts diff --git a/clients/client-waf-regional/src/runtimeConfig.ts b/clients/client-waf-regional/src/runtimeConfig.ts new file mode 100644 index 000000000000..97686e5c6e08 --- /dev/null +++ b/clients/client-waf-regional/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WAFRegionalClientConfig } from "./WAFRegionalClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-waf-regional/tsconfig.es.json b/clients/client-waf-regional/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-waf-regional/tsconfig.es.json +++ b/clients/client-waf-regional/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-waf-regional/tsconfig.json b/clients/client-waf-regional/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-waf-regional/tsconfig.json +++ b/clients/client-waf-regional/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-waf-regional/tsconfig.types.json b/clients/client-waf-regional/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-waf-regional/tsconfig.types.json +++ b/clients/client-waf-regional/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-waf/.gitignore b/clients/client-waf/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-waf/.gitignore +++ b/clients/client-waf/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-waf/package.json b/clients/client-waf/package.json index 6cd9469c75fe..f3583cc01be7 100644 --- a/clients/client-waf/package.json +++ b/clients/client-waf/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-waf", "repository": { "type": "git", diff --git a/clients/client-waf/runtimeConfig.browser.ts b/clients/client-waf/runtimeConfig.browser.ts deleted file mode 100644 index 1a045acc23fd..000000000000 --- a/clients/client-waf/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WAFClientConfig } from "./WAFClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-waf/runtimeConfig.ts b/clients/client-waf/runtimeConfig.ts deleted file mode 100644 index c3d107724f32..000000000000 --- a/clients/client-waf/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WAFClientConfig } from "./WAFClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-waf/WAF.ts b/clients/client-waf/src/WAF.ts similarity index 100% rename from clients/client-waf/WAF.ts rename to clients/client-waf/src/WAF.ts diff --git a/clients/client-waf/WAFClient.ts b/clients/client-waf/src/WAFClient.ts similarity index 100% rename from clients/client-waf/WAFClient.ts rename to clients/client-waf/src/WAFClient.ts diff --git a/clients/client-waf/commands/CreateByteMatchSetCommand.ts b/clients/client-waf/src/commands/CreateByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateByteMatchSetCommand.ts rename to clients/client-waf/src/commands/CreateByteMatchSetCommand.ts diff --git a/clients/client-waf/commands/CreateGeoMatchSetCommand.ts b/clients/client-waf/src/commands/CreateGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateGeoMatchSetCommand.ts rename to clients/client-waf/src/commands/CreateGeoMatchSetCommand.ts diff --git a/clients/client-waf/commands/CreateIPSetCommand.ts b/clients/client-waf/src/commands/CreateIPSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateIPSetCommand.ts rename to clients/client-waf/src/commands/CreateIPSetCommand.ts diff --git a/clients/client-waf/commands/CreateRateBasedRuleCommand.ts b/clients/client-waf/src/commands/CreateRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateRateBasedRuleCommand.ts rename to clients/client-waf/src/commands/CreateRateBasedRuleCommand.ts diff --git a/clients/client-waf/commands/CreateRegexMatchSetCommand.ts b/clients/client-waf/src/commands/CreateRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateRegexMatchSetCommand.ts rename to clients/client-waf/src/commands/CreateRegexMatchSetCommand.ts diff --git a/clients/client-waf/commands/CreateRegexPatternSetCommand.ts b/clients/client-waf/src/commands/CreateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateRegexPatternSetCommand.ts rename to clients/client-waf/src/commands/CreateRegexPatternSetCommand.ts diff --git a/clients/client-waf/commands/CreateRuleCommand.ts b/clients/client-waf/src/commands/CreateRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateRuleCommand.ts rename to clients/client-waf/src/commands/CreateRuleCommand.ts diff --git a/clients/client-waf/commands/CreateRuleGroupCommand.ts b/clients/client-waf/src/commands/CreateRuleGroupCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateRuleGroupCommand.ts rename to clients/client-waf/src/commands/CreateRuleGroupCommand.ts diff --git a/clients/client-waf/commands/CreateSizeConstraintSetCommand.ts b/clients/client-waf/src/commands/CreateSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateSizeConstraintSetCommand.ts rename to clients/client-waf/src/commands/CreateSizeConstraintSetCommand.ts diff --git a/clients/client-waf/commands/CreateSqlInjectionMatchSetCommand.ts b/clients/client-waf/src/commands/CreateSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateSqlInjectionMatchSetCommand.ts rename to clients/client-waf/src/commands/CreateSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf/commands/CreateWebACLCommand.ts b/clients/client-waf/src/commands/CreateWebACLCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateWebACLCommand.ts rename to clients/client-waf/src/commands/CreateWebACLCommand.ts diff --git a/clients/client-waf/commands/CreateWebACLMigrationStackCommand.ts b/clients/client-waf/src/commands/CreateWebACLMigrationStackCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateWebACLMigrationStackCommand.ts rename to clients/client-waf/src/commands/CreateWebACLMigrationStackCommand.ts diff --git a/clients/client-waf/commands/CreateXssMatchSetCommand.ts b/clients/client-waf/src/commands/CreateXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/CreateXssMatchSetCommand.ts rename to clients/client-waf/src/commands/CreateXssMatchSetCommand.ts diff --git a/clients/client-waf/commands/DeleteByteMatchSetCommand.ts b/clients/client-waf/src/commands/DeleteByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteByteMatchSetCommand.ts rename to clients/client-waf/src/commands/DeleteByteMatchSetCommand.ts diff --git a/clients/client-waf/commands/DeleteGeoMatchSetCommand.ts b/clients/client-waf/src/commands/DeleteGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteGeoMatchSetCommand.ts rename to clients/client-waf/src/commands/DeleteGeoMatchSetCommand.ts diff --git a/clients/client-waf/commands/DeleteIPSetCommand.ts b/clients/client-waf/src/commands/DeleteIPSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteIPSetCommand.ts rename to clients/client-waf/src/commands/DeleteIPSetCommand.ts diff --git a/clients/client-waf/commands/DeleteLoggingConfigurationCommand.ts b/clients/client-waf/src/commands/DeleteLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteLoggingConfigurationCommand.ts rename to clients/client-waf/src/commands/DeleteLoggingConfigurationCommand.ts diff --git a/clients/client-waf/commands/DeletePermissionPolicyCommand.ts b/clients/client-waf/src/commands/DeletePermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf/commands/DeletePermissionPolicyCommand.ts rename to clients/client-waf/src/commands/DeletePermissionPolicyCommand.ts diff --git a/clients/client-waf/commands/DeleteRateBasedRuleCommand.ts b/clients/client-waf/src/commands/DeleteRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteRateBasedRuleCommand.ts rename to clients/client-waf/src/commands/DeleteRateBasedRuleCommand.ts diff --git a/clients/client-waf/commands/DeleteRegexMatchSetCommand.ts b/clients/client-waf/src/commands/DeleteRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteRegexMatchSetCommand.ts rename to clients/client-waf/src/commands/DeleteRegexMatchSetCommand.ts diff --git a/clients/client-waf/commands/DeleteRegexPatternSetCommand.ts b/clients/client-waf/src/commands/DeleteRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteRegexPatternSetCommand.ts rename to clients/client-waf/src/commands/DeleteRegexPatternSetCommand.ts diff --git a/clients/client-waf/commands/DeleteRuleCommand.ts b/clients/client-waf/src/commands/DeleteRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteRuleCommand.ts rename to clients/client-waf/src/commands/DeleteRuleCommand.ts diff --git a/clients/client-waf/commands/DeleteRuleGroupCommand.ts b/clients/client-waf/src/commands/DeleteRuleGroupCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteRuleGroupCommand.ts rename to clients/client-waf/src/commands/DeleteRuleGroupCommand.ts diff --git a/clients/client-waf/commands/DeleteSizeConstraintSetCommand.ts b/clients/client-waf/src/commands/DeleteSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteSizeConstraintSetCommand.ts rename to clients/client-waf/src/commands/DeleteSizeConstraintSetCommand.ts diff --git a/clients/client-waf/commands/DeleteSqlInjectionMatchSetCommand.ts b/clients/client-waf/src/commands/DeleteSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteSqlInjectionMatchSetCommand.ts rename to clients/client-waf/src/commands/DeleteSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf/commands/DeleteWebACLCommand.ts b/clients/client-waf/src/commands/DeleteWebACLCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteWebACLCommand.ts rename to clients/client-waf/src/commands/DeleteWebACLCommand.ts diff --git a/clients/client-waf/commands/DeleteXssMatchSetCommand.ts b/clients/client-waf/src/commands/DeleteXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/DeleteXssMatchSetCommand.ts rename to clients/client-waf/src/commands/DeleteXssMatchSetCommand.ts diff --git a/clients/client-waf/commands/GetByteMatchSetCommand.ts b/clients/client-waf/src/commands/GetByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetByteMatchSetCommand.ts rename to clients/client-waf/src/commands/GetByteMatchSetCommand.ts diff --git a/clients/client-waf/commands/GetChangeTokenCommand.ts b/clients/client-waf/src/commands/GetChangeTokenCommand.ts similarity index 100% rename from clients/client-waf/commands/GetChangeTokenCommand.ts rename to clients/client-waf/src/commands/GetChangeTokenCommand.ts diff --git a/clients/client-waf/commands/GetChangeTokenStatusCommand.ts b/clients/client-waf/src/commands/GetChangeTokenStatusCommand.ts similarity index 100% rename from clients/client-waf/commands/GetChangeTokenStatusCommand.ts rename to clients/client-waf/src/commands/GetChangeTokenStatusCommand.ts diff --git a/clients/client-waf/commands/GetGeoMatchSetCommand.ts b/clients/client-waf/src/commands/GetGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetGeoMatchSetCommand.ts rename to clients/client-waf/src/commands/GetGeoMatchSetCommand.ts diff --git a/clients/client-waf/commands/GetIPSetCommand.ts b/clients/client-waf/src/commands/GetIPSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetIPSetCommand.ts rename to clients/client-waf/src/commands/GetIPSetCommand.ts diff --git a/clients/client-waf/commands/GetLoggingConfigurationCommand.ts b/clients/client-waf/src/commands/GetLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf/commands/GetLoggingConfigurationCommand.ts rename to clients/client-waf/src/commands/GetLoggingConfigurationCommand.ts diff --git a/clients/client-waf/commands/GetPermissionPolicyCommand.ts b/clients/client-waf/src/commands/GetPermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf/commands/GetPermissionPolicyCommand.ts rename to clients/client-waf/src/commands/GetPermissionPolicyCommand.ts diff --git a/clients/client-waf/commands/GetRateBasedRuleCommand.ts b/clients/client-waf/src/commands/GetRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRateBasedRuleCommand.ts rename to clients/client-waf/src/commands/GetRateBasedRuleCommand.ts diff --git a/clients/client-waf/commands/GetRateBasedRuleManagedKeysCommand.ts b/clients/client-waf/src/commands/GetRateBasedRuleManagedKeysCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRateBasedRuleManagedKeysCommand.ts rename to clients/client-waf/src/commands/GetRateBasedRuleManagedKeysCommand.ts diff --git a/clients/client-waf/commands/GetRegexMatchSetCommand.ts b/clients/client-waf/src/commands/GetRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRegexMatchSetCommand.ts rename to clients/client-waf/src/commands/GetRegexMatchSetCommand.ts diff --git a/clients/client-waf/commands/GetRegexPatternSetCommand.ts b/clients/client-waf/src/commands/GetRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRegexPatternSetCommand.ts rename to clients/client-waf/src/commands/GetRegexPatternSetCommand.ts diff --git a/clients/client-waf/commands/GetRuleCommand.ts b/clients/client-waf/src/commands/GetRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRuleCommand.ts rename to clients/client-waf/src/commands/GetRuleCommand.ts diff --git a/clients/client-waf/commands/GetRuleGroupCommand.ts b/clients/client-waf/src/commands/GetRuleGroupCommand.ts similarity index 100% rename from clients/client-waf/commands/GetRuleGroupCommand.ts rename to clients/client-waf/src/commands/GetRuleGroupCommand.ts diff --git a/clients/client-waf/commands/GetSampledRequestsCommand.ts b/clients/client-waf/src/commands/GetSampledRequestsCommand.ts similarity index 100% rename from clients/client-waf/commands/GetSampledRequestsCommand.ts rename to clients/client-waf/src/commands/GetSampledRequestsCommand.ts diff --git a/clients/client-waf/commands/GetSizeConstraintSetCommand.ts b/clients/client-waf/src/commands/GetSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetSizeConstraintSetCommand.ts rename to clients/client-waf/src/commands/GetSizeConstraintSetCommand.ts diff --git a/clients/client-waf/commands/GetSqlInjectionMatchSetCommand.ts b/clients/client-waf/src/commands/GetSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetSqlInjectionMatchSetCommand.ts rename to clients/client-waf/src/commands/GetSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf/commands/GetWebACLCommand.ts b/clients/client-waf/src/commands/GetWebACLCommand.ts similarity index 100% rename from clients/client-waf/commands/GetWebACLCommand.ts rename to clients/client-waf/src/commands/GetWebACLCommand.ts diff --git a/clients/client-waf/commands/GetXssMatchSetCommand.ts b/clients/client-waf/src/commands/GetXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/GetXssMatchSetCommand.ts rename to clients/client-waf/src/commands/GetXssMatchSetCommand.ts diff --git a/clients/client-waf/commands/ListActivatedRulesInRuleGroupCommand.ts b/clients/client-waf/src/commands/ListActivatedRulesInRuleGroupCommand.ts similarity index 100% rename from clients/client-waf/commands/ListActivatedRulesInRuleGroupCommand.ts rename to clients/client-waf/src/commands/ListActivatedRulesInRuleGroupCommand.ts diff --git a/clients/client-waf/commands/ListByteMatchSetsCommand.ts b/clients/client-waf/src/commands/ListByteMatchSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListByteMatchSetsCommand.ts rename to clients/client-waf/src/commands/ListByteMatchSetsCommand.ts diff --git a/clients/client-waf/commands/ListGeoMatchSetsCommand.ts b/clients/client-waf/src/commands/ListGeoMatchSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListGeoMatchSetsCommand.ts rename to clients/client-waf/src/commands/ListGeoMatchSetsCommand.ts diff --git a/clients/client-waf/commands/ListIPSetsCommand.ts b/clients/client-waf/src/commands/ListIPSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListIPSetsCommand.ts rename to clients/client-waf/src/commands/ListIPSetsCommand.ts diff --git a/clients/client-waf/commands/ListLoggingConfigurationsCommand.ts b/clients/client-waf/src/commands/ListLoggingConfigurationsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListLoggingConfigurationsCommand.ts rename to clients/client-waf/src/commands/ListLoggingConfigurationsCommand.ts diff --git a/clients/client-waf/commands/ListRateBasedRulesCommand.ts b/clients/client-waf/src/commands/ListRateBasedRulesCommand.ts similarity index 100% rename from clients/client-waf/commands/ListRateBasedRulesCommand.ts rename to clients/client-waf/src/commands/ListRateBasedRulesCommand.ts diff --git a/clients/client-waf/commands/ListRegexMatchSetsCommand.ts b/clients/client-waf/src/commands/ListRegexMatchSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListRegexMatchSetsCommand.ts rename to clients/client-waf/src/commands/ListRegexMatchSetsCommand.ts diff --git a/clients/client-waf/commands/ListRegexPatternSetsCommand.ts b/clients/client-waf/src/commands/ListRegexPatternSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListRegexPatternSetsCommand.ts rename to clients/client-waf/src/commands/ListRegexPatternSetsCommand.ts diff --git a/clients/client-waf/commands/ListRuleGroupsCommand.ts b/clients/client-waf/src/commands/ListRuleGroupsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListRuleGroupsCommand.ts rename to clients/client-waf/src/commands/ListRuleGroupsCommand.ts diff --git a/clients/client-waf/commands/ListRulesCommand.ts b/clients/client-waf/src/commands/ListRulesCommand.ts similarity index 100% rename from clients/client-waf/commands/ListRulesCommand.ts rename to clients/client-waf/src/commands/ListRulesCommand.ts diff --git a/clients/client-waf/commands/ListSizeConstraintSetsCommand.ts b/clients/client-waf/src/commands/ListSizeConstraintSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListSizeConstraintSetsCommand.ts rename to clients/client-waf/src/commands/ListSizeConstraintSetsCommand.ts diff --git a/clients/client-waf/commands/ListSqlInjectionMatchSetsCommand.ts b/clients/client-waf/src/commands/ListSqlInjectionMatchSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListSqlInjectionMatchSetsCommand.ts rename to clients/client-waf/src/commands/ListSqlInjectionMatchSetsCommand.ts diff --git a/clients/client-waf/commands/ListSubscribedRuleGroupsCommand.ts b/clients/client-waf/src/commands/ListSubscribedRuleGroupsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListSubscribedRuleGroupsCommand.ts rename to clients/client-waf/src/commands/ListSubscribedRuleGroupsCommand.ts diff --git a/clients/client-waf/commands/ListTagsForResourceCommand.ts b/clients/client-waf/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-waf/commands/ListTagsForResourceCommand.ts rename to clients/client-waf/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-waf/commands/ListWebACLsCommand.ts b/clients/client-waf/src/commands/ListWebACLsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListWebACLsCommand.ts rename to clients/client-waf/src/commands/ListWebACLsCommand.ts diff --git a/clients/client-waf/commands/ListXssMatchSetsCommand.ts b/clients/client-waf/src/commands/ListXssMatchSetsCommand.ts similarity index 100% rename from clients/client-waf/commands/ListXssMatchSetsCommand.ts rename to clients/client-waf/src/commands/ListXssMatchSetsCommand.ts diff --git a/clients/client-waf/commands/PutLoggingConfigurationCommand.ts b/clients/client-waf/src/commands/PutLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-waf/commands/PutLoggingConfigurationCommand.ts rename to clients/client-waf/src/commands/PutLoggingConfigurationCommand.ts diff --git a/clients/client-waf/commands/PutPermissionPolicyCommand.ts b/clients/client-waf/src/commands/PutPermissionPolicyCommand.ts similarity index 100% rename from clients/client-waf/commands/PutPermissionPolicyCommand.ts rename to clients/client-waf/src/commands/PutPermissionPolicyCommand.ts diff --git a/clients/client-waf/commands/TagResourceCommand.ts b/clients/client-waf/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-waf/commands/TagResourceCommand.ts rename to clients/client-waf/src/commands/TagResourceCommand.ts diff --git a/clients/client-waf/commands/UntagResourceCommand.ts b/clients/client-waf/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-waf/commands/UntagResourceCommand.ts rename to clients/client-waf/src/commands/UntagResourceCommand.ts diff --git a/clients/client-waf/commands/UpdateByteMatchSetCommand.ts b/clients/client-waf/src/commands/UpdateByteMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateByteMatchSetCommand.ts rename to clients/client-waf/src/commands/UpdateByteMatchSetCommand.ts diff --git a/clients/client-waf/commands/UpdateGeoMatchSetCommand.ts b/clients/client-waf/src/commands/UpdateGeoMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateGeoMatchSetCommand.ts rename to clients/client-waf/src/commands/UpdateGeoMatchSetCommand.ts diff --git a/clients/client-waf/commands/UpdateIPSetCommand.ts b/clients/client-waf/src/commands/UpdateIPSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateIPSetCommand.ts rename to clients/client-waf/src/commands/UpdateIPSetCommand.ts diff --git a/clients/client-waf/commands/UpdateRateBasedRuleCommand.ts b/clients/client-waf/src/commands/UpdateRateBasedRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateRateBasedRuleCommand.ts rename to clients/client-waf/src/commands/UpdateRateBasedRuleCommand.ts diff --git a/clients/client-waf/commands/UpdateRegexMatchSetCommand.ts b/clients/client-waf/src/commands/UpdateRegexMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateRegexMatchSetCommand.ts rename to clients/client-waf/src/commands/UpdateRegexMatchSetCommand.ts diff --git a/clients/client-waf/commands/UpdateRegexPatternSetCommand.ts b/clients/client-waf/src/commands/UpdateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateRegexPatternSetCommand.ts rename to clients/client-waf/src/commands/UpdateRegexPatternSetCommand.ts diff --git a/clients/client-waf/commands/UpdateRuleCommand.ts b/clients/client-waf/src/commands/UpdateRuleCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateRuleCommand.ts rename to clients/client-waf/src/commands/UpdateRuleCommand.ts diff --git a/clients/client-waf/commands/UpdateRuleGroupCommand.ts b/clients/client-waf/src/commands/UpdateRuleGroupCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateRuleGroupCommand.ts rename to clients/client-waf/src/commands/UpdateRuleGroupCommand.ts diff --git a/clients/client-waf/commands/UpdateSizeConstraintSetCommand.ts b/clients/client-waf/src/commands/UpdateSizeConstraintSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateSizeConstraintSetCommand.ts rename to clients/client-waf/src/commands/UpdateSizeConstraintSetCommand.ts diff --git a/clients/client-waf/commands/UpdateSqlInjectionMatchSetCommand.ts b/clients/client-waf/src/commands/UpdateSqlInjectionMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateSqlInjectionMatchSetCommand.ts rename to clients/client-waf/src/commands/UpdateSqlInjectionMatchSetCommand.ts diff --git a/clients/client-waf/commands/UpdateWebACLCommand.ts b/clients/client-waf/src/commands/UpdateWebACLCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateWebACLCommand.ts rename to clients/client-waf/src/commands/UpdateWebACLCommand.ts diff --git a/clients/client-waf/commands/UpdateXssMatchSetCommand.ts b/clients/client-waf/src/commands/UpdateXssMatchSetCommand.ts similarity index 100% rename from clients/client-waf/commands/UpdateXssMatchSetCommand.ts rename to clients/client-waf/src/commands/UpdateXssMatchSetCommand.ts diff --git a/clients/client-waf/endpoints.ts b/clients/client-waf/src/endpoints.ts similarity index 100% rename from clients/client-waf/endpoints.ts rename to clients/client-waf/src/endpoints.ts diff --git a/clients/client-waf/index.ts b/clients/client-waf/src/index.ts similarity index 100% rename from clients/client-waf/index.ts rename to clients/client-waf/src/index.ts diff --git a/clients/client-waf/models/index.ts b/clients/client-waf/src/models/index.ts similarity index 100% rename from clients/client-waf/models/index.ts rename to clients/client-waf/src/models/index.ts diff --git a/clients/client-waf/models/models_0.ts b/clients/client-waf/src/models/models_0.ts similarity index 100% rename from clients/client-waf/models/models_0.ts rename to clients/client-waf/src/models/models_0.ts diff --git a/clients/client-waf/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-waf/protocols/Aws_json1_1.ts rename to clients/client-waf/src/protocols/Aws_json1_1.ts diff --git a/clients/client-waf/src/runtimeConfig.browser.ts b/clients/client-waf/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c2b74d2da807 --- /dev/null +++ b/clients/client-waf/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WAFClientConfig } from "./WAFClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-waf/runtimeConfig.native.ts b/clients/client-waf/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-waf/runtimeConfig.native.ts rename to clients/client-waf/src/runtimeConfig.native.ts diff --git a/clients/client-waf/runtimeConfig.shared.ts b/clients/client-waf/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-waf/runtimeConfig.shared.ts rename to clients/client-waf/src/runtimeConfig.shared.ts diff --git a/clients/client-waf/src/runtimeConfig.ts b/clients/client-waf/src/runtimeConfig.ts new file mode 100644 index 000000000000..681d741cf2e4 --- /dev/null +++ b/clients/client-waf/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WAFClientConfig } from "./WAFClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-waf/tsconfig.es.json b/clients/client-waf/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-waf/tsconfig.es.json +++ b/clients/client-waf/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-waf/tsconfig.json b/clients/client-waf/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-waf/tsconfig.json +++ b/clients/client-waf/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-waf/tsconfig.types.json b/clients/client-waf/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-waf/tsconfig.types.json +++ b/clients/client-waf/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-wafv2/.gitignore b/clients/client-wafv2/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-wafv2/.gitignore +++ b/clients/client-wafv2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-wafv2/package.json b/clients/client-wafv2/package.json index 9f52b67385f5..876183bcfc31 100644 --- a/clients/client-wafv2/package.json +++ b/clients/client-wafv2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-wafv2", "repository": { "type": "git", diff --git a/clients/client-wafv2/runtimeConfig.browser.ts b/clients/client-wafv2/runtimeConfig.browser.ts deleted file mode 100644 index 3dc30ad16a85..000000000000 --- a/clients/client-wafv2/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WAFV2ClientConfig } from "./WAFV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFV2ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-wafv2/runtimeConfig.ts b/clients/client-wafv2/runtimeConfig.ts deleted file mode 100644 index 6f967c91a896..000000000000 --- a/clients/client-wafv2/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WAFV2ClientConfig } from "./WAFV2Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WAFV2ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-wafv2/WAFV2.ts b/clients/client-wafv2/src/WAFV2.ts similarity index 100% rename from clients/client-wafv2/WAFV2.ts rename to clients/client-wafv2/src/WAFV2.ts diff --git a/clients/client-wafv2/WAFV2Client.ts b/clients/client-wafv2/src/WAFV2Client.ts similarity index 100% rename from clients/client-wafv2/WAFV2Client.ts rename to clients/client-wafv2/src/WAFV2Client.ts diff --git a/clients/client-wafv2/commands/AssociateWebACLCommand.ts b/clients/client-wafv2/src/commands/AssociateWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/AssociateWebACLCommand.ts rename to clients/client-wafv2/src/commands/AssociateWebACLCommand.ts diff --git a/clients/client-wafv2/commands/CheckCapacityCommand.ts b/clients/client-wafv2/src/commands/CheckCapacityCommand.ts similarity index 100% rename from clients/client-wafv2/commands/CheckCapacityCommand.ts rename to clients/client-wafv2/src/commands/CheckCapacityCommand.ts diff --git a/clients/client-wafv2/commands/CreateIPSetCommand.ts b/clients/client-wafv2/src/commands/CreateIPSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/CreateIPSetCommand.ts rename to clients/client-wafv2/src/commands/CreateIPSetCommand.ts diff --git a/clients/client-wafv2/commands/CreateRegexPatternSetCommand.ts b/clients/client-wafv2/src/commands/CreateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/CreateRegexPatternSetCommand.ts rename to clients/client-wafv2/src/commands/CreateRegexPatternSetCommand.ts diff --git a/clients/client-wafv2/commands/CreateRuleGroupCommand.ts b/clients/client-wafv2/src/commands/CreateRuleGroupCommand.ts similarity index 100% rename from clients/client-wafv2/commands/CreateRuleGroupCommand.ts rename to clients/client-wafv2/src/commands/CreateRuleGroupCommand.ts diff --git a/clients/client-wafv2/commands/CreateWebACLCommand.ts b/clients/client-wafv2/src/commands/CreateWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/CreateWebACLCommand.ts rename to clients/client-wafv2/src/commands/CreateWebACLCommand.ts diff --git a/clients/client-wafv2/commands/DeleteFirewallManagerRuleGroupsCommand.ts b/clients/client-wafv2/src/commands/DeleteFirewallManagerRuleGroupsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteFirewallManagerRuleGroupsCommand.ts rename to clients/client-wafv2/src/commands/DeleteFirewallManagerRuleGroupsCommand.ts diff --git a/clients/client-wafv2/commands/DeleteIPSetCommand.ts b/clients/client-wafv2/src/commands/DeleteIPSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteIPSetCommand.ts rename to clients/client-wafv2/src/commands/DeleteIPSetCommand.ts diff --git a/clients/client-wafv2/commands/DeleteLoggingConfigurationCommand.ts b/clients/client-wafv2/src/commands/DeleteLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteLoggingConfigurationCommand.ts rename to clients/client-wafv2/src/commands/DeleteLoggingConfigurationCommand.ts diff --git a/clients/client-wafv2/commands/DeletePermissionPolicyCommand.ts b/clients/client-wafv2/src/commands/DeletePermissionPolicyCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeletePermissionPolicyCommand.ts rename to clients/client-wafv2/src/commands/DeletePermissionPolicyCommand.ts diff --git a/clients/client-wafv2/commands/DeleteRegexPatternSetCommand.ts b/clients/client-wafv2/src/commands/DeleteRegexPatternSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteRegexPatternSetCommand.ts rename to clients/client-wafv2/src/commands/DeleteRegexPatternSetCommand.ts diff --git a/clients/client-wafv2/commands/DeleteRuleGroupCommand.ts b/clients/client-wafv2/src/commands/DeleteRuleGroupCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteRuleGroupCommand.ts rename to clients/client-wafv2/src/commands/DeleteRuleGroupCommand.ts diff --git a/clients/client-wafv2/commands/DeleteWebACLCommand.ts b/clients/client-wafv2/src/commands/DeleteWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DeleteWebACLCommand.ts rename to clients/client-wafv2/src/commands/DeleteWebACLCommand.ts diff --git a/clients/client-wafv2/commands/DescribeManagedRuleGroupCommand.ts b/clients/client-wafv2/src/commands/DescribeManagedRuleGroupCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DescribeManagedRuleGroupCommand.ts rename to clients/client-wafv2/src/commands/DescribeManagedRuleGroupCommand.ts diff --git a/clients/client-wafv2/commands/DisassociateWebACLCommand.ts b/clients/client-wafv2/src/commands/DisassociateWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/DisassociateWebACLCommand.ts rename to clients/client-wafv2/src/commands/DisassociateWebACLCommand.ts diff --git a/clients/client-wafv2/commands/GetIPSetCommand.ts b/clients/client-wafv2/src/commands/GetIPSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetIPSetCommand.ts rename to clients/client-wafv2/src/commands/GetIPSetCommand.ts diff --git a/clients/client-wafv2/commands/GetLoggingConfigurationCommand.ts b/clients/client-wafv2/src/commands/GetLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetLoggingConfigurationCommand.ts rename to clients/client-wafv2/src/commands/GetLoggingConfigurationCommand.ts diff --git a/clients/client-wafv2/commands/GetManagedRuleSetCommand.ts b/clients/client-wafv2/src/commands/GetManagedRuleSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetManagedRuleSetCommand.ts rename to clients/client-wafv2/src/commands/GetManagedRuleSetCommand.ts diff --git a/clients/client-wafv2/commands/GetPermissionPolicyCommand.ts b/clients/client-wafv2/src/commands/GetPermissionPolicyCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetPermissionPolicyCommand.ts rename to clients/client-wafv2/src/commands/GetPermissionPolicyCommand.ts diff --git a/clients/client-wafv2/commands/GetRateBasedStatementManagedKeysCommand.ts b/clients/client-wafv2/src/commands/GetRateBasedStatementManagedKeysCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetRateBasedStatementManagedKeysCommand.ts rename to clients/client-wafv2/src/commands/GetRateBasedStatementManagedKeysCommand.ts diff --git a/clients/client-wafv2/commands/GetRegexPatternSetCommand.ts b/clients/client-wafv2/src/commands/GetRegexPatternSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetRegexPatternSetCommand.ts rename to clients/client-wafv2/src/commands/GetRegexPatternSetCommand.ts diff --git a/clients/client-wafv2/commands/GetRuleGroupCommand.ts b/clients/client-wafv2/src/commands/GetRuleGroupCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetRuleGroupCommand.ts rename to clients/client-wafv2/src/commands/GetRuleGroupCommand.ts diff --git a/clients/client-wafv2/commands/GetSampledRequestsCommand.ts b/clients/client-wafv2/src/commands/GetSampledRequestsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetSampledRequestsCommand.ts rename to clients/client-wafv2/src/commands/GetSampledRequestsCommand.ts diff --git a/clients/client-wafv2/commands/GetWebACLCommand.ts b/clients/client-wafv2/src/commands/GetWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetWebACLCommand.ts rename to clients/client-wafv2/src/commands/GetWebACLCommand.ts diff --git a/clients/client-wafv2/commands/GetWebACLForResourceCommand.ts b/clients/client-wafv2/src/commands/GetWebACLForResourceCommand.ts similarity index 100% rename from clients/client-wafv2/commands/GetWebACLForResourceCommand.ts rename to clients/client-wafv2/src/commands/GetWebACLForResourceCommand.ts diff --git a/clients/client-wafv2/commands/ListAvailableManagedRuleGroupVersionsCommand.ts b/clients/client-wafv2/src/commands/ListAvailableManagedRuleGroupVersionsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListAvailableManagedRuleGroupVersionsCommand.ts rename to clients/client-wafv2/src/commands/ListAvailableManagedRuleGroupVersionsCommand.ts diff --git a/clients/client-wafv2/commands/ListAvailableManagedRuleGroupsCommand.ts b/clients/client-wafv2/src/commands/ListAvailableManagedRuleGroupsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListAvailableManagedRuleGroupsCommand.ts rename to clients/client-wafv2/src/commands/ListAvailableManagedRuleGroupsCommand.ts diff --git a/clients/client-wafv2/commands/ListIPSetsCommand.ts b/clients/client-wafv2/src/commands/ListIPSetsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListIPSetsCommand.ts rename to clients/client-wafv2/src/commands/ListIPSetsCommand.ts diff --git a/clients/client-wafv2/commands/ListLoggingConfigurationsCommand.ts b/clients/client-wafv2/src/commands/ListLoggingConfigurationsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListLoggingConfigurationsCommand.ts rename to clients/client-wafv2/src/commands/ListLoggingConfigurationsCommand.ts diff --git a/clients/client-wafv2/commands/ListManagedRuleSetsCommand.ts b/clients/client-wafv2/src/commands/ListManagedRuleSetsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListManagedRuleSetsCommand.ts rename to clients/client-wafv2/src/commands/ListManagedRuleSetsCommand.ts diff --git a/clients/client-wafv2/commands/ListRegexPatternSetsCommand.ts b/clients/client-wafv2/src/commands/ListRegexPatternSetsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListRegexPatternSetsCommand.ts rename to clients/client-wafv2/src/commands/ListRegexPatternSetsCommand.ts diff --git a/clients/client-wafv2/commands/ListResourcesForWebACLCommand.ts b/clients/client-wafv2/src/commands/ListResourcesForWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListResourcesForWebACLCommand.ts rename to clients/client-wafv2/src/commands/ListResourcesForWebACLCommand.ts diff --git a/clients/client-wafv2/commands/ListRuleGroupsCommand.ts b/clients/client-wafv2/src/commands/ListRuleGroupsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListRuleGroupsCommand.ts rename to clients/client-wafv2/src/commands/ListRuleGroupsCommand.ts diff --git a/clients/client-wafv2/commands/ListTagsForResourceCommand.ts b/clients/client-wafv2/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListTagsForResourceCommand.ts rename to clients/client-wafv2/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-wafv2/commands/ListWebACLsCommand.ts b/clients/client-wafv2/src/commands/ListWebACLsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/ListWebACLsCommand.ts rename to clients/client-wafv2/src/commands/ListWebACLsCommand.ts diff --git a/clients/client-wafv2/commands/PutLoggingConfigurationCommand.ts b/clients/client-wafv2/src/commands/PutLoggingConfigurationCommand.ts similarity index 100% rename from clients/client-wafv2/commands/PutLoggingConfigurationCommand.ts rename to clients/client-wafv2/src/commands/PutLoggingConfigurationCommand.ts diff --git a/clients/client-wafv2/commands/PutManagedRuleSetVersionsCommand.ts b/clients/client-wafv2/src/commands/PutManagedRuleSetVersionsCommand.ts similarity index 100% rename from clients/client-wafv2/commands/PutManagedRuleSetVersionsCommand.ts rename to clients/client-wafv2/src/commands/PutManagedRuleSetVersionsCommand.ts diff --git a/clients/client-wafv2/commands/PutPermissionPolicyCommand.ts b/clients/client-wafv2/src/commands/PutPermissionPolicyCommand.ts similarity index 100% rename from clients/client-wafv2/commands/PutPermissionPolicyCommand.ts rename to clients/client-wafv2/src/commands/PutPermissionPolicyCommand.ts diff --git a/clients/client-wafv2/commands/TagResourceCommand.ts b/clients/client-wafv2/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-wafv2/commands/TagResourceCommand.ts rename to clients/client-wafv2/src/commands/TagResourceCommand.ts diff --git a/clients/client-wafv2/commands/UntagResourceCommand.ts b/clients/client-wafv2/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UntagResourceCommand.ts rename to clients/client-wafv2/src/commands/UntagResourceCommand.ts diff --git a/clients/client-wafv2/commands/UpdateIPSetCommand.ts b/clients/client-wafv2/src/commands/UpdateIPSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UpdateIPSetCommand.ts rename to clients/client-wafv2/src/commands/UpdateIPSetCommand.ts diff --git a/clients/client-wafv2/commands/UpdateManagedRuleSetVersionExpiryDateCommand.ts b/clients/client-wafv2/src/commands/UpdateManagedRuleSetVersionExpiryDateCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UpdateManagedRuleSetVersionExpiryDateCommand.ts rename to clients/client-wafv2/src/commands/UpdateManagedRuleSetVersionExpiryDateCommand.ts diff --git a/clients/client-wafv2/commands/UpdateRegexPatternSetCommand.ts b/clients/client-wafv2/src/commands/UpdateRegexPatternSetCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UpdateRegexPatternSetCommand.ts rename to clients/client-wafv2/src/commands/UpdateRegexPatternSetCommand.ts diff --git a/clients/client-wafv2/commands/UpdateRuleGroupCommand.ts b/clients/client-wafv2/src/commands/UpdateRuleGroupCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UpdateRuleGroupCommand.ts rename to clients/client-wafv2/src/commands/UpdateRuleGroupCommand.ts diff --git a/clients/client-wafv2/commands/UpdateWebACLCommand.ts b/clients/client-wafv2/src/commands/UpdateWebACLCommand.ts similarity index 100% rename from clients/client-wafv2/commands/UpdateWebACLCommand.ts rename to clients/client-wafv2/src/commands/UpdateWebACLCommand.ts diff --git a/clients/client-wafv2/endpoints.ts b/clients/client-wafv2/src/endpoints.ts similarity index 100% rename from clients/client-wafv2/endpoints.ts rename to clients/client-wafv2/src/endpoints.ts diff --git a/clients/client-wafv2/index.ts b/clients/client-wafv2/src/index.ts similarity index 100% rename from clients/client-wafv2/index.ts rename to clients/client-wafv2/src/index.ts diff --git a/clients/client-wafv2/models/index.ts b/clients/client-wafv2/src/models/index.ts similarity index 100% rename from clients/client-wafv2/models/index.ts rename to clients/client-wafv2/src/models/index.ts diff --git a/clients/client-wafv2/models/models_0.ts b/clients/client-wafv2/src/models/models_0.ts similarity index 100% rename from clients/client-wafv2/models/models_0.ts rename to clients/client-wafv2/src/models/models_0.ts diff --git a/clients/client-wafv2/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-wafv2/protocols/Aws_json1_1.ts rename to clients/client-wafv2/src/protocols/Aws_json1_1.ts diff --git a/clients/client-wafv2/src/runtimeConfig.browser.ts b/clients/client-wafv2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a3139d903198 --- /dev/null +++ b/clients/client-wafv2/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WAFV2ClientConfig } from "./WAFV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFV2ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-wafv2/runtimeConfig.native.ts b/clients/client-wafv2/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-wafv2/runtimeConfig.native.ts rename to clients/client-wafv2/src/runtimeConfig.native.ts diff --git a/clients/client-wafv2/runtimeConfig.shared.ts b/clients/client-wafv2/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-wafv2/runtimeConfig.shared.ts rename to clients/client-wafv2/src/runtimeConfig.shared.ts diff --git a/clients/client-wafv2/src/runtimeConfig.ts b/clients/client-wafv2/src/runtimeConfig.ts new file mode 100644 index 000000000000..a20def597087 --- /dev/null +++ b/clients/client-wafv2/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WAFV2ClientConfig } from "./WAFV2Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WAFV2ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-wafv2/tsconfig.es.json b/clients/client-wafv2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-wafv2/tsconfig.es.json +++ b/clients/client-wafv2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-wafv2/tsconfig.json b/clients/client-wafv2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-wafv2/tsconfig.json +++ b/clients/client-wafv2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-wafv2/tsconfig.types.json b/clients/client-wafv2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-wafv2/tsconfig.types.json +++ b/clients/client-wafv2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-wellarchitected/.gitignore b/clients/client-wellarchitected/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/clients/client-wellarchitected/.gitignore +++ b/clients/client-wellarchitected/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-wellarchitected/package.json b/clients/client-wellarchitected/package.json index 7a24cf089342..664728ff5b7f 100644 --- a/clients/client-wellarchitected/package.json +++ b/clients/client-wellarchitected/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-wellarchitected", "repository": { "type": "git", diff --git a/clients/client-wellarchitected/runtimeConfig.browser.ts b/clients/client-wellarchitected/runtimeConfig.browser.ts deleted file mode 100644 index 540387c4384f..000000000000 --- a/clients/client-wellarchitected/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WellArchitectedClientConfig } from "./WellArchitectedClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-wellarchitected/runtimeConfig.ts b/clients/client-wellarchitected/runtimeConfig.ts deleted file mode 100644 index c4d92f80298d..000000000000 --- a/clients/client-wellarchitected/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WellArchitectedClientConfig } from "./WellArchitectedClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-wellarchitected/WellArchitected.ts b/clients/client-wellarchitected/src/WellArchitected.ts similarity index 100% rename from clients/client-wellarchitected/WellArchitected.ts rename to clients/client-wellarchitected/src/WellArchitected.ts diff --git a/clients/client-wellarchitected/WellArchitectedClient.ts b/clients/client-wellarchitected/src/WellArchitectedClient.ts similarity index 100% rename from clients/client-wellarchitected/WellArchitectedClient.ts rename to clients/client-wellarchitected/src/WellArchitectedClient.ts diff --git a/clients/client-wellarchitected/commands/AssociateLensesCommand.ts b/clients/client-wellarchitected/src/commands/AssociateLensesCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/AssociateLensesCommand.ts rename to clients/client-wellarchitected/src/commands/AssociateLensesCommand.ts diff --git a/clients/client-wellarchitected/commands/CreateMilestoneCommand.ts b/clients/client-wellarchitected/src/commands/CreateMilestoneCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/CreateMilestoneCommand.ts rename to clients/client-wellarchitected/src/commands/CreateMilestoneCommand.ts diff --git a/clients/client-wellarchitected/commands/CreateWorkloadCommand.ts b/clients/client-wellarchitected/src/commands/CreateWorkloadCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/CreateWorkloadCommand.ts rename to clients/client-wellarchitected/src/commands/CreateWorkloadCommand.ts diff --git a/clients/client-wellarchitected/commands/CreateWorkloadShareCommand.ts b/clients/client-wellarchitected/src/commands/CreateWorkloadShareCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/CreateWorkloadShareCommand.ts rename to clients/client-wellarchitected/src/commands/CreateWorkloadShareCommand.ts diff --git a/clients/client-wellarchitected/commands/DeleteWorkloadCommand.ts b/clients/client-wellarchitected/src/commands/DeleteWorkloadCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/DeleteWorkloadCommand.ts rename to clients/client-wellarchitected/src/commands/DeleteWorkloadCommand.ts diff --git a/clients/client-wellarchitected/commands/DeleteWorkloadShareCommand.ts b/clients/client-wellarchitected/src/commands/DeleteWorkloadShareCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/DeleteWorkloadShareCommand.ts rename to clients/client-wellarchitected/src/commands/DeleteWorkloadShareCommand.ts diff --git a/clients/client-wellarchitected/commands/DisassociateLensesCommand.ts b/clients/client-wellarchitected/src/commands/DisassociateLensesCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/DisassociateLensesCommand.ts rename to clients/client-wellarchitected/src/commands/DisassociateLensesCommand.ts diff --git a/clients/client-wellarchitected/commands/GetAnswerCommand.ts b/clients/client-wellarchitected/src/commands/GetAnswerCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetAnswerCommand.ts rename to clients/client-wellarchitected/src/commands/GetAnswerCommand.ts diff --git a/clients/client-wellarchitected/commands/GetLensReviewCommand.ts b/clients/client-wellarchitected/src/commands/GetLensReviewCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetLensReviewCommand.ts rename to clients/client-wellarchitected/src/commands/GetLensReviewCommand.ts diff --git a/clients/client-wellarchitected/commands/GetLensReviewReportCommand.ts b/clients/client-wellarchitected/src/commands/GetLensReviewReportCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetLensReviewReportCommand.ts rename to clients/client-wellarchitected/src/commands/GetLensReviewReportCommand.ts diff --git a/clients/client-wellarchitected/commands/GetLensVersionDifferenceCommand.ts b/clients/client-wellarchitected/src/commands/GetLensVersionDifferenceCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetLensVersionDifferenceCommand.ts rename to clients/client-wellarchitected/src/commands/GetLensVersionDifferenceCommand.ts diff --git a/clients/client-wellarchitected/commands/GetMilestoneCommand.ts b/clients/client-wellarchitected/src/commands/GetMilestoneCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetMilestoneCommand.ts rename to clients/client-wellarchitected/src/commands/GetMilestoneCommand.ts diff --git a/clients/client-wellarchitected/commands/GetWorkloadCommand.ts b/clients/client-wellarchitected/src/commands/GetWorkloadCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/GetWorkloadCommand.ts rename to clients/client-wellarchitected/src/commands/GetWorkloadCommand.ts diff --git a/clients/client-wellarchitected/commands/ListAnswersCommand.ts b/clients/client-wellarchitected/src/commands/ListAnswersCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListAnswersCommand.ts rename to clients/client-wellarchitected/src/commands/ListAnswersCommand.ts diff --git a/clients/client-wellarchitected/commands/ListLensReviewImprovementsCommand.ts b/clients/client-wellarchitected/src/commands/ListLensReviewImprovementsCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListLensReviewImprovementsCommand.ts rename to clients/client-wellarchitected/src/commands/ListLensReviewImprovementsCommand.ts diff --git a/clients/client-wellarchitected/commands/ListLensReviewsCommand.ts b/clients/client-wellarchitected/src/commands/ListLensReviewsCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListLensReviewsCommand.ts rename to clients/client-wellarchitected/src/commands/ListLensReviewsCommand.ts diff --git a/clients/client-wellarchitected/commands/ListLensesCommand.ts b/clients/client-wellarchitected/src/commands/ListLensesCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListLensesCommand.ts rename to clients/client-wellarchitected/src/commands/ListLensesCommand.ts diff --git a/clients/client-wellarchitected/commands/ListMilestonesCommand.ts b/clients/client-wellarchitected/src/commands/ListMilestonesCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListMilestonesCommand.ts rename to clients/client-wellarchitected/src/commands/ListMilestonesCommand.ts diff --git a/clients/client-wellarchitected/commands/ListNotificationsCommand.ts b/clients/client-wellarchitected/src/commands/ListNotificationsCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListNotificationsCommand.ts rename to clients/client-wellarchitected/src/commands/ListNotificationsCommand.ts diff --git a/clients/client-wellarchitected/commands/ListShareInvitationsCommand.ts b/clients/client-wellarchitected/src/commands/ListShareInvitationsCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListShareInvitationsCommand.ts rename to clients/client-wellarchitected/src/commands/ListShareInvitationsCommand.ts diff --git a/clients/client-wellarchitected/commands/ListTagsForResourceCommand.ts b/clients/client-wellarchitected/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListTagsForResourceCommand.ts rename to clients/client-wellarchitected/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-wellarchitected/commands/ListWorkloadSharesCommand.ts b/clients/client-wellarchitected/src/commands/ListWorkloadSharesCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListWorkloadSharesCommand.ts rename to clients/client-wellarchitected/src/commands/ListWorkloadSharesCommand.ts diff --git a/clients/client-wellarchitected/commands/ListWorkloadsCommand.ts b/clients/client-wellarchitected/src/commands/ListWorkloadsCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/ListWorkloadsCommand.ts rename to clients/client-wellarchitected/src/commands/ListWorkloadsCommand.ts diff --git a/clients/client-wellarchitected/commands/TagResourceCommand.ts b/clients/client-wellarchitected/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/TagResourceCommand.ts rename to clients/client-wellarchitected/src/commands/TagResourceCommand.ts diff --git a/clients/client-wellarchitected/commands/UntagResourceCommand.ts b/clients/client-wellarchitected/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UntagResourceCommand.ts rename to clients/client-wellarchitected/src/commands/UntagResourceCommand.ts diff --git a/clients/client-wellarchitected/commands/UpdateAnswerCommand.ts b/clients/client-wellarchitected/src/commands/UpdateAnswerCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpdateAnswerCommand.ts rename to clients/client-wellarchitected/src/commands/UpdateAnswerCommand.ts diff --git a/clients/client-wellarchitected/commands/UpdateLensReviewCommand.ts b/clients/client-wellarchitected/src/commands/UpdateLensReviewCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpdateLensReviewCommand.ts rename to clients/client-wellarchitected/src/commands/UpdateLensReviewCommand.ts diff --git a/clients/client-wellarchitected/commands/UpdateShareInvitationCommand.ts b/clients/client-wellarchitected/src/commands/UpdateShareInvitationCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpdateShareInvitationCommand.ts rename to clients/client-wellarchitected/src/commands/UpdateShareInvitationCommand.ts diff --git a/clients/client-wellarchitected/commands/UpdateWorkloadCommand.ts b/clients/client-wellarchitected/src/commands/UpdateWorkloadCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpdateWorkloadCommand.ts rename to clients/client-wellarchitected/src/commands/UpdateWorkloadCommand.ts diff --git a/clients/client-wellarchitected/commands/UpdateWorkloadShareCommand.ts b/clients/client-wellarchitected/src/commands/UpdateWorkloadShareCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpdateWorkloadShareCommand.ts rename to clients/client-wellarchitected/src/commands/UpdateWorkloadShareCommand.ts diff --git a/clients/client-wellarchitected/commands/UpgradeLensReviewCommand.ts b/clients/client-wellarchitected/src/commands/UpgradeLensReviewCommand.ts similarity index 100% rename from clients/client-wellarchitected/commands/UpgradeLensReviewCommand.ts rename to clients/client-wellarchitected/src/commands/UpgradeLensReviewCommand.ts diff --git a/clients/client-wellarchitected/endpoints.ts b/clients/client-wellarchitected/src/endpoints.ts similarity index 100% rename from clients/client-wellarchitected/endpoints.ts rename to clients/client-wellarchitected/src/endpoints.ts diff --git a/clients/client-wellarchitected/index.ts b/clients/client-wellarchitected/src/index.ts similarity index 100% rename from clients/client-wellarchitected/index.ts rename to clients/client-wellarchitected/src/index.ts diff --git a/clients/client-wellarchitected/models/index.ts b/clients/client-wellarchitected/src/models/index.ts similarity index 100% rename from clients/client-wellarchitected/models/index.ts rename to clients/client-wellarchitected/src/models/index.ts diff --git a/clients/client-wellarchitected/models/models_0.ts b/clients/client-wellarchitected/src/models/models_0.ts similarity index 100% rename from clients/client-wellarchitected/models/models_0.ts rename to clients/client-wellarchitected/src/models/models_0.ts diff --git a/clients/client-wellarchitected/pagination/Interfaces.ts b/clients/client-wellarchitected/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-wellarchitected/pagination/Interfaces.ts rename to clients/client-wellarchitected/src/pagination/Interfaces.ts diff --git a/clients/client-wellarchitected/pagination/ListAnswersPaginator.ts b/clients/client-wellarchitected/src/pagination/ListAnswersPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListAnswersPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListAnswersPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListLensReviewImprovementsPaginator.ts b/clients/client-wellarchitected/src/pagination/ListLensReviewImprovementsPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListLensReviewImprovementsPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListLensReviewImprovementsPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListLensReviewsPaginator.ts b/clients/client-wellarchitected/src/pagination/ListLensReviewsPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListLensReviewsPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListLensReviewsPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListLensesPaginator.ts b/clients/client-wellarchitected/src/pagination/ListLensesPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListLensesPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListLensesPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListMilestonesPaginator.ts b/clients/client-wellarchitected/src/pagination/ListMilestonesPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListMilestonesPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListMilestonesPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListNotificationsPaginator.ts b/clients/client-wellarchitected/src/pagination/ListNotificationsPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListNotificationsPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListNotificationsPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListShareInvitationsPaginator.ts b/clients/client-wellarchitected/src/pagination/ListShareInvitationsPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListShareInvitationsPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListShareInvitationsPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListWorkloadSharesPaginator.ts b/clients/client-wellarchitected/src/pagination/ListWorkloadSharesPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListWorkloadSharesPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListWorkloadSharesPaginator.ts diff --git a/clients/client-wellarchitected/pagination/ListWorkloadsPaginator.ts b/clients/client-wellarchitected/src/pagination/ListWorkloadsPaginator.ts similarity index 100% rename from clients/client-wellarchitected/pagination/ListWorkloadsPaginator.ts rename to clients/client-wellarchitected/src/pagination/ListWorkloadsPaginator.ts diff --git a/clients/client-wellarchitected/protocols/Aws_restJson1.ts b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-wellarchitected/protocols/Aws_restJson1.ts rename to clients/client-wellarchitected/src/protocols/Aws_restJson1.ts diff --git a/clients/client-wellarchitected/src/runtimeConfig.browser.ts b/clients/client-wellarchitected/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..70449539657f --- /dev/null +++ b/clients/client-wellarchitected/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WellArchitectedClientConfig } from "./WellArchitectedClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-wellarchitected/runtimeConfig.native.ts b/clients/client-wellarchitected/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-wellarchitected/runtimeConfig.native.ts rename to clients/client-wellarchitected/src/runtimeConfig.native.ts diff --git a/clients/client-wellarchitected/runtimeConfig.shared.ts b/clients/client-wellarchitected/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-wellarchitected/runtimeConfig.shared.ts rename to clients/client-wellarchitected/src/runtimeConfig.shared.ts diff --git a/clients/client-wellarchitected/src/runtimeConfig.ts b/clients/client-wellarchitected/src/runtimeConfig.ts new file mode 100644 index 000000000000..7e558927a593 --- /dev/null +++ b/clients/client-wellarchitected/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WellArchitectedClientConfig } from "./WellArchitectedClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-wellarchitected/tsconfig.es.json b/clients/client-wellarchitected/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-wellarchitected/tsconfig.es.json +++ b/clients/client-wellarchitected/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-wellarchitected/tsconfig.json b/clients/client-wellarchitected/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-wellarchitected/tsconfig.json +++ b/clients/client-wellarchitected/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-wellarchitected/tsconfig.types.json b/clients/client-wellarchitected/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-wellarchitected/tsconfig.types.json +++ b/clients/client-wellarchitected/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-workdocs/.gitignore b/clients/client-workdocs/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-workdocs/.gitignore +++ b/clients/client-workdocs/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-workdocs/package.json b/clients/client-workdocs/package.json index c3a39ba041a7..39af4714cda9 100644 --- a/clients/client-workdocs/package.json +++ b/clients/client-workdocs/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-workdocs", "repository": { "type": "git", diff --git a/clients/client-workdocs/runtimeConfig.browser.ts b/clients/client-workdocs/runtimeConfig.browser.ts deleted file mode 100644 index b7696c4e1c08..000000000000 --- a/clients/client-workdocs/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WorkDocsClientConfig } from "./WorkDocsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkDocsClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workdocs/runtimeConfig.ts b/clients/client-workdocs/runtimeConfig.ts deleted file mode 100644 index cfed91aed6bd..000000000000 --- a/clients/client-workdocs/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WorkDocsClientConfig } from "./WorkDocsClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkDocsClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workdocs/WorkDocs.ts b/clients/client-workdocs/src/WorkDocs.ts similarity index 100% rename from clients/client-workdocs/WorkDocs.ts rename to clients/client-workdocs/src/WorkDocs.ts diff --git a/clients/client-workdocs/WorkDocsClient.ts b/clients/client-workdocs/src/WorkDocsClient.ts similarity index 100% rename from clients/client-workdocs/WorkDocsClient.ts rename to clients/client-workdocs/src/WorkDocsClient.ts diff --git a/clients/client-workdocs/commands/AbortDocumentVersionUploadCommand.ts b/clients/client-workdocs/src/commands/AbortDocumentVersionUploadCommand.ts similarity index 100% rename from clients/client-workdocs/commands/AbortDocumentVersionUploadCommand.ts rename to clients/client-workdocs/src/commands/AbortDocumentVersionUploadCommand.ts diff --git a/clients/client-workdocs/commands/ActivateUserCommand.ts b/clients/client-workdocs/src/commands/ActivateUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/ActivateUserCommand.ts rename to clients/client-workdocs/src/commands/ActivateUserCommand.ts diff --git a/clients/client-workdocs/commands/AddResourcePermissionsCommand.ts b/clients/client-workdocs/src/commands/AddResourcePermissionsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/AddResourcePermissionsCommand.ts rename to clients/client-workdocs/src/commands/AddResourcePermissionsCommand.ts diff --git a/clients/client-workdocs/commands/CreateCommentCommand.ts b/clients/client-workdocs/src/commands/CreateCommentCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateCommentCommand.ts rename to clients/client-workdocs/src/commands/CreateCommentCommand.ts diff --git a/clients/client-workdocs/commands/CreateCustomMetadataCommand.ts b/clients/client-workdocs/src/commands/CreateCustomMetadataCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateCustomMetadataCommand.ts rename to clients/client-workdocs/src/commands/CreateCustomMetadataCommand.ts diff --git a/clients/client-workdocs/commands/CreateFolderCommand.ts b/clients/client-workdocs/src/commands/CreateFolderCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateFolderCommand.ts rename to clients/client-workdocs/src/commands/CreateFolderCommand.ts diff --git a/clients/client-workdocs/commands/CreateLabelsCommand.ts b/clients/client-workdocs/src/commands/CreateLabelsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateLabelsCommand.ts rename to clients/client-workdocs/src/commands/CreateLabelsCommand.ts diff --git a/clients/client-workdocs/commands/CreateNotificationSubscriptionCommand.ts b/clients/client-workdocs/src/commands/CreateNotificationSubscriptionCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateNotificationSubscriptionCommand.ts rename to clients/client-workdocs/src/commands/CreateNotificationSubscriptionCommand.ts diff --git a/clients/client-workdocs/commands/CreateUserCommand.ts b/clients/client-workdocs/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/CreateUserCommand.ts rename to clients/client-workdocs/src/commands/CreateUserCommand.ts diff --git a/clients/client-workdocs/commands/DeactivateUserCommand.ts b/clients/client-workdocs/src/commands/DeactivateUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeactivateUserCommand.ts rename to clients/client-workdocs/src/commands/DeactivateUserCommand.ts diff --git a/clients/client-workdocs/commands/DeleteCommentCommand.ts b/clients/client-workdocs/src/commands/DeleteCommentCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteCommentCommand.ts rename to clients/client-workdocs/src/commands/DeleteCommentCommand.ts diff --git a/clients/client-workdocs/commands/DeleteCustomMetadataCommand.ts b/clients/client-workdocs/src/commands/DeleteCustomMetadataCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteCustomMetadataCommand.ts rename to clients/client-workdocs/src/commands/DeleteCustomMetadataCommand.ts diff --git a/clients/client-workdocs/commands/DeleteDocumentCommand.ts b/clients/client-workdocs/src/commands/DeleteDocumentCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteDocumentCommand.ts rename to clients/client-workdocs/src/commands/DeleteDocumentCommand.ts diff --git a/clients/client-workdocs/commands/DeleteFolderCommand.ts b/clients/client-workdocs/src/commands/DeleteFolderCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteFolderCommand.ts rename to clients/client-workdocs/src/commands/DeleteFolderCommand.ts diff --git a/clients/client-workdocs/commands/DeleteFolderContentsCommand.ts b/clients/client-workdocs/src/commands/DeleteFolderContentsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteFolderContentsCommand.ts rename to clients/client-workdocs/src/commands/DeleteFolderContentsCommand.ts diff --git a/clients/client-workdocs/commands/DeleteLabelsCommand.ts b/clients/client-workdocs/src/commands/DeleteLabelsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteLabelsCommand.ts rename to clients/client-workdocs/src/commands/DeleteLabelsCommand.ts diff --git a/clients/client-workdocs/commands/DeleteNotificationSubscriptionCommand.ts b/clients/client-workdocs/src/commands/DeleteNotificationSubscriptionCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteNotificationSubscriptionCommand.ts rename to clients/client-workdocs/src/commands/DeleteNotificationSubscriptionCommand.ts diff --git a/clients/client-workdocs/commands/DeleteUserCommand.ts b/clients/client-workdocs/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DeleteUserCommand.ts rename to clients/client-workdocs/src/commands/DeleteUserCommand.ts diff --git a/clients/client-workdocs/commands/DescribeActivitiesCommand.ts b/clients/client-workdocs/src/commands/DescribeActivitiesCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeActivitiesCommand.ts rename to clients/client-workdocs/src/commands/DescribeActivitiesCommand.ts diff --git a/clients/client-workdocs/commands/DescribeCommentsCommand.ts b/clients/client-workdocs/src/commands/DescribeCommentsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeCommentsCommand.ts rename to clients/client-workdocs/src/commands/DescribeCommentsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeDocumentVersionsCommand.ts b/clients/client-workdocs/src/commands/DescribeDocumentVersionsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeDocumentVersionsCommand.ts rename to clients/client-workdocs/src/commands/DescribeDocumentVersionsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeFolderContentsCommand.ts b/clients/client-workdocs/src/commands/DescribeFolderContentsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeFolderContentsCommand.ts rename to clients/client-workdocs/src/commands/DescribeFolderContentsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeGroupsCommand.ts b/clients/client-workdocs/src/commands/DescribeGroupsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeGroupsCommand.ts rename to clients/client-workdocs/src/commands/DescribeGroupsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeNotificationSubscriptionsCommand.ts b/clients/client-workdocs/src/commands/DescribeNotificationSubscriptionsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeNotificationSubscriptionsCommand.ts rename to clients/client-workdocs/src/commands/DescribeNotificationSubscriptionsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeResourcePermissionsCommand.ts b/clients/client-workdocs/src/commands/DescribeResourcePermissionsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeResourcePermissionsCommand.ts rename to clients/client-workdocs/src/commands/DescribeResourcePermissionsCommand.ts diff --git a/clients/client-workdocs/commands/DescribeRootFoldersCommand.ts b/clients/client-workdocs/src/commands/DescribeRootFoldersCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeRootFoldersCommand.ts rename to clients/client-workdocs/src/commands/DescribeRootFoldersCommand.ts diff --git a/clients/client-workdocs/commands/DescribeUsersCommand.ts b/clients/client-workdocs/src/commands/DescribeUsersCommand.ts similarity index 100% rename from clients/client-workdocs/commands/DescribeUsersCommand.ts rename to clients/client-workdocs/src/commands/DescribeUsersCommand.ts diff --git a/clients/client-workdocs/commands/GetCurrentUserCommand.ts b/clients/client-workdocs/src/commands/GetCurrentUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetCurrentUserCommand.ts rename to clients/client-workdocs/src/commands/GetCurrentUserCommand.ts diff --git a/clients/client-workdocs/commands/GetDocumentCommand.ts b/clients/client-workdocs/src/commands/GetDocumentCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetDocumentCommand.ts rename to clients/client-workdocs/src/commands/GetDocumentCommand.ts diff --git a/clients/client-workdocs/commands/GetDocumentPathCommand.ts b/clients/client-workdocs/src/commands/GetDocumentPathCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetDocumentPathCommand.ts rename to clients/client-workdocs/src/commands/GetDocumentPathCommand.ts diff --git a/clients/client-workdocs/commands/GetDocumentVersionCommand.ts b/clients/client-workdocs/src/commands/GetDocumentVersionCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetDocumentVersionCommand.ts rename to clients/client-workdocs/src/commands/GetDocumentVersionCommand.ts diff --git a/clients/client-workdocs/commands/GetFolderCommand.ts b/clients/client-workdocs/src/commands/GetFolderCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetFolderCommand.ts rename to clients/client-workdocs/src/commands/GetFolderCommand.ts diff --git a/clients/client-workdocs/commands/GetFolderPathCommand.ts b/clients/client-workdocs/src/commands/GetFolderPathCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetFolderPathCommand.ts rename to clients/client-workdocs/src/commands/GetFolderPathCommand.ts diff --git a/clients/client-workdocs/commands/GetResourcesCommand.ts b/clients/client-workdocs/src/commands/GetResourcesCommand.ts similarity index 100% rename from clients/client-workdocs/commands/GetResourcesCommand.ts rename to clients/client-workdocs/src/commands/GetResourcesCommand.ts diff --git a/clients/client-workdocs/commands/InitiateDocumentVersionUploadCommand.ts b/clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts similarity index 100% rename from clients/client-workdocs/commands/InitiateDocumentVersionUploadCommand.ts rename to clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts diff --git a/clients/client-workdocs/commands/RemoveAllResourcePermissionsCommand.ts b/clients/client-workdocs/src/commands/RemoveAllResourcePermissionsCommand.ts similarity index 100% rename from clients/client-workdocs/commands/RemoveAllResourcePermissionsCommand.ts rename to clients/client-workdocs/src/commands/RemoveAllResourcePermissionsCommand.ts diff --git a/clients/client-workdocs/commands/RemoveResourcePermissionCommand.ts b/clients/client-workdocs/src/commands/RemoveResourcePermissionCommand.ts similarity index 100% rename from clients/client-workdocs/commands/RemoveResourcePermissionCommand.ts rename to clients/client-workdocs/src/commands/RemoveResourcePermissionCommand.ts diff --git a/clients/client-workdocs/commands/UpdateDocumentCommand.ts b/clients/client-workdocs/src/commands/UpdateDocumentCommand.ts similarity index 100% rename from clients/client-workdocs/commands/UpdateDocumentCommand.ts rename to clients/client-workdocs/src/commands/UpdateDocumentCommand.ts diff --git a/clients/client-workdocs/commands/UpdateDocumentVersionCommand.ts b/clients/client-workdocs/src/commands/UpdateDocumentVersionCommand.ts similarity index 100% rename from clients/client-workdocs/commands/UpdateDocumentVersionCommand.ts rename to clients/client-workdocs/src/commands/UpdateDocumentVersionCommand.ts diff --git a/clients/client-workdocs/commands/UpdateFolderCommand.ts b/clients/client-workdocs/src/commands/UpdateFolderCommand.ts similarity index 100% rename from clients/client-workdocs/commands/UpdateFolderCommand.ts rename to clients/client-workdocs/src/commands/UpdateFolderCommand.ts diff --git a/clients/client-workdocs/commands/UpdateUserCommand.ts b/clients/client-workdocs/src/commands/UpdateUserCommand.ts similarity index 100% rename from clients/client-workdocs/commands/UpdateUserCommand.ts rename to clients/client-workdocs/src/commands/UpdateUserCommand.ts diff --git a/clients/client-workdocs/endpoints.ts b/clients/client-workdocs/src/endpoints.ts similarity index 100% rename from clients/client-workdocs/endpoints.ts rename to clients/client-workdocs/src/endpoints.ts diff --git a/clients/client-workdocs/index.ts b/clients/client-workdocs/src/index.ts similarity index 100% rename from clients/client-workdocs/index.ts rename to clients/client-workdocs/src/index.ts diff --git a/clients/client-workdocs/models/index.ts b/clients/client-workdocs/src/models/index.ts similarity index 100% rename from clients/client-workdocs/models/index.ts rename to clients/client-workdocs/src/models/index.ts diff --git a/clients/client-workdocs/models/models_0.ts b/clients/client-workdocs/src/models/models_0.ts similarity index 100% rename from clients/client-workdocs/models/models_0.ts rename to clients/client-workdocs/src/models/models_0.ts diff --git a/clients/client-workdocs/pagination/DescribeDocumentVersionsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeDocumentVersionsPaginator.ts similarity index 100% rename from clients/client-workdocs/pagination/DescribeDocumentVersionsPaginator.ts rename to clients/client-workdocs/src/pagination/DescribeDocumentVersionsPaginator.ts diff --git a/clients/client-workdocs/pagination/DescribeFolderContentsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeFolderContentsPaginator.ts similarity index 100% rename from clients/client-workdocs/pagination/DescribeFolderContentsPaginator.ts rename to clients/client-workdocs/src/pagination/DescribeFolderContentsPaginator.ts diff --git a/clients/client-workdocs/pagination/DescribeUsersPaginator.ts b/clients/client-workdocs/src/pagination/DescribeUsersPaginator.ts similarity index 100% rename from clients/client-workdocs/pagination/DescribeUsersPaginator.ts rename to clients/client-workdocs/src/pagination/DescribeUsersPaginator.ts diff --git a/clients/client-workdocs/pagination/Interfaces.ts b/clients/client-workdocs/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-workdocs/pagination/Interfaces.ts rename to clients/client-workdocs/src/pagination/Interfaces.ts diff --git a/clients/client-workdocs/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-workdocs/protocols/Aws_restJson1.ts rename to clients/client-workdocs/src/protocols/Aws_restJson1.ts diff --git a/clients/client-workdocs/src/runtimeConfig.browser.ts b/clients/client-workdocs/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..f836208f3909 --- /dev/null +++ b/clients/client-workdocs/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WorkDocsClientConfig } from "./WorkDocsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkDocsClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workdocs/runtimeConfig.native.ts b/clients/client-workdocs/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-workdocs/runtimeConfig.native.ts rename to clients/client-workdocs/src/runtimeConfig.native.ts diff --git a/clients/client-workdocs/runtimeConfig.shared.ts b/clients/client-workdocs/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-workdocs/runtimeConfig.shared.ts rename to clients/client-workdocs/src/runtimeConfig.shared.ts diff --git a/clients/client-workdocs/src/runtimeConfig.ts b/clients/client-workdocs/src/runtimeConfig.ts new file mode 100644 index 000000000000..22bd3919a668 --- /dev/null +++ b/clients/client-workdocs/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WorkDocsClientConfig } from "./WorkDocsClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkDocsClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workdocs/tsconfig.es.json b/clients/client-workdocs/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-workdocs/tsconfig.es.json +++ b/clients/client-workdocs/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-workdocs/tsconfig.json b/clients/client-workdocs/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-workdocs/tsconfig.json +++ b/clients/client-workdocs/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-workdocs/tsconfig.types.json b/clients/client-workdocs/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-workdocs/tsconfig.types.json +++ b/clients/client-workdocs/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-worklink/.gitignore b/clients/client-worklink/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-worklink/.gitignore +++ b/clients/client-worklink/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-worklink/package.json b/clients/client-worklink/package.json index 6869fed7eeea..f3df81682865 100644 --- a/clients/client-worklink/package.json +++ b/clients/client-worklink/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-worklink", "repository": { "type": "git", diff --git a/clients/client-worklink/runtimeConfig.browser.ts b/clients/client-worklink/runtimeConfig.browser.ts deleted file mode 100644 index 62aaa49380aa..000000000000 --- a/clients/client-worklink/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WorkLinkClientConfig } from "./WorkLinkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkLinkClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-worklink/runtimeConfig.ts b/clients/client-worklink/runtimeConfig.ts deleted file mode 100644 index aaec7be44f16..000000000000 --- a/clients/client-worklink/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WorkLinkClientConfig } from "./WorkLinkClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkLinkClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-worklink/WorkLink.ts b/clients/client-worklink/src/WorkLink.ts similarity index 100% rename from clients/client-worklink/WorkLink.ts rename to clients/client-worklink/src/WorkLink.ts diff --git a/clients/client-worklink/WorkLinkClient.ts b/clients/client-worklink/src/WorkLinkClient.ts similarity index 100% rename from clients/client-worklink/WorkLinkClient.ts rename to clients/client-worklink/src/WorkLinkClient.ts diff --git a/clients/client-worklink/commands/AssociateDomainCommand.ts b/clients/client-worklink/src/commands/AssociateDomainCommand.ts similarity index 100% rename from clients/client-worklink/commands/AssociateDomainCommand.ts rename to clients/client-worklink/src/commands/AssociateDomainCommand.ts diff --git a/clients/client-worklink/commands/AssociateWebsiteAuthorizationProviderCommand.ts b/clients/client-worklink/src/commands/AssociateWebsiteAuthorizationProviderCommand.ts similarity index 100% rename from clients/client-worklink/commands/AssociateWebsiteAuthorizationProviderCommand.ts rename to clients/client-worklink/src/commands/AssociateWebsiteAuthorizationProviderCommand.ts diff --git a/clients/client-worklink/commands/AssociateWebsiteCertificateAuthorityCommand.ts b/clients/client-worklink/src/commands/AssociateWebsiteCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-worklink/commands/AssociateWebsiteCertificateAuthorityCommand.ts rename to clients/client-worklink/src/commands/AssociateWebsiteCertificateAuthorityCommand.ts diff --git a/clients/client-worklink/commands/CreateFleetCommand.ts b/clients/client-worklink/src/commands/CreateFleetCommand.ts similarity index 100% rename from clients/client-worklink/commands/CreateFleetCommand.ts rename to clients/client-worklink/src/commands/CreateFleetCommand.ts diff --git a/clients/client-worklink/commands/DeleteFleetCommand.ts b/clients/client-worklink/src/commands/DeleteFleetCommand.ts similarity index 100% rename from clients/client-worklink/commands/DeleteFleetCommand.ts rename to clients/client-worklink/src/commands/DeleteFleetCommand.ts diff --git a/clients/client-worklink/commands/DescribeAuditStreamConfigurationCommand.ts b/clients/client-worklink/src/commands/DescribeAuditStreamConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeAuditStreamConfigurationCommand.ts rename to clients/client-worklink/src/commands/DescribeAuditStreamConfigurationCommand.ts diff --git a/clients/client-worklink/commands/DescribeCompanyNetworkConfigurationCommand.ts b/clients/client-worklink/src/commands/DescribeCompanyNetworkConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeCompanyNetworkConfigurationCommand.ts rename to clients/client-worklink/src/commands/DescribeCompanyNetworkConfigurationCommand.ts diff --git a/clients/client-worklink/commands/DescribeDeviceCommand.ts b/clients/client-worklink/src/commands/DescribeDeviceCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeDeviceCommand.ts rename to clients/client-worklink/src/commands/DescribeDeviceCommand.ts diff --git a/clients/client-worklink/commands/DescribeDevicePolicyConfigurationCommand.ts b/clients/client-worklink/src/commands/DescribeDevicePolicyConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeDevicePolicyConfigurationCommand.ts rename to clients/client-worklink/src/commands/DescribeDevicePolicyConfigurationCommand.ts diff --git a/clients/client-worklink/commands/DescribeDomainCommand.ts b/clients/client-worklink/src/commands/DescribeDomainCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeDomainCommand.ts rename to clients/client-worklink/src/commands/DescribeDomainCommand.ts diff --git a/clients/client-worklink/commands/DescribeFleetMetadataCommand.ts b/clients/client-worklink/src/commands/DescribeFleetMetadataCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeFleetMetadataCommand.ts rename to clients/client-worklink/src/commands/DescribeFleetMetadataCommand.ts diff --git a/clients/client-worklink/commands/DescribeIdentityProviderConfigurationCommand.ts b/clients/client-worklink/src/commands/DescribeIdentityProviderConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeIdentityProviderConfigurationCommand.ts rename to clients/client-worklink/src/commands/DescribeIdentityProviderConfigurationCommand.ts diff --git a/clients/client-worklink/commands/DescribeWebsiteCertificateAuthorityCommand.ts b/clients/client-worklink/src/commands/DescribeWebsiteCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-worklink/commands/DescribeWebsiteCertificateAuthorityCommand.ts rename to clients/client-worklink/src/commands/DescribeWebsiteCertificateAuthorityCommand.ts diff --git a/clients/client-worklink/commands/DisassociateDomainCommand.ts b/clients/client-worklink/src/commands/DisassociateDomainCommand.ts similarity index 100% rename from clients/client-worklink/commands/DisassociateDomainCommand.ts rename to clients/client-worklink/src/commands/DisassociateDomainCommand.ts diff --git a/clients/client-worklink/commands/DisassociateWebsiteAuthorizationProviderCommand.ts b/clients/client-worklink/src/commands/DisassociateWebsiteAuthorizationProviderCommand.ts similarity index 100% rename from clients/client-worklink/commands/DisassociateWebsiteAuthorizationProviderCommand.ts rename to clients/client-worklink/src/commands/DisassociateWebsiteAuthorizationProviderCommand.ts diff --git a/clients/client-worklink/commands/DisassociateWebsiteCertificateAuthorityCommand.ts b/clients/client-worklink/src/commands/DisassociateWebsiteCertificateAuthorityCommand.ts similarity index 100% rename from clients/client-worklink/commands/DisassociateWebsiteCertificateAuthorityCommand.ts rename to clients/client-worklink/src/commands/DisassociateWebsiteCertificateAuthorityCommand.ts diff --git a/clients/client-worklink/commands/ListDevicesCommand.ts b/clients/client-worklink/src/commands/ListDevicesCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListDevicesCommand.ts rename to clients/client-worklink/src/commands/ListDevicesCommand.ts diff --git a/clients/client-worklink/commands/ListDomainsCommand.ts b/clients/client-worklink/src/commands/ListDomainsCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListDomainsCommand.ts rename to clients/client-worklink/src/commands/ListDomainsCommand.ts diff --git a/clients/client-worklink/commands/ListFleetsCommand.ts b/clients/client-worklink/src/commands/ListFleetsCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListFleetsCommand.ts rename to clients/client-worklink/src/commands/ListFleetsCommand.ts diff --git a/clients/client-worklink/commands/ListTagsForResourceCommand.ts b/clients/client-worklink/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListTagsForResourceCommand.ts rename to clients/client-worklink/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-worklink/commands/ListWebsiteAuthorizationProvidersCommand.ts b/clients/client-worklink/src/commands/ListWebsiteAuthorizationProvidersCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListWebsiteAuthorizationProvidersCommand.ts rename to clients/client-worklink/src/commands/ListWebsiteAuthorizationProvidersCommand.ts diff --git a/clients/client-worklink/commands/ListWebsiteCertificateAuthoritiesCommand.ts b/clients/client-worklink/src/commands/ListWebsiteCertificateAuthoritiesCommand.ts similarity index 100% rename from clients/client-worklink/commands/ListWebsiteCertificateAuthoritiesCommand.ts rename to clients/client-worklink/src/commands/ListWebsiteCertificateAuthoritiesCommand.ts diff --git a/clients/client-worklink/commands/RestoreDomainAccessCommand.ts b/clients/client-worklink/src/commands/RestoreDomainAccessCommand.ts similarity index 100% rename from clients/client-worklink/commands/RestoreDomainAccessCommand.ts rename to clients/client-worklink/src/commands/RestoreDomainAccessCommand.ts diff --git a/clients/client-worklink/commands/RevokeDomainAccessCommand.ts b/clients/client-worklink/src/commands/RevokeDomainAccessCommand.ts similarity index 100% rename from clients/client-worklink/commands/RevokeDomainAccessCommand.ts rename to clients/client-worklink/src/commands/RevokeDomainAccessCommand.ts diff --git a/clients/client-worklink/commands/SignOutUserCommand.ts b/clients/client-worklink/src/commands/SignOutUserCommand.ts similarity index 100% rename from clients/client-worklink/commands/SignOutUserCommand.ts rename to clients/client-worklink/src/commands/SignOutUserCommand.ts diff --git a/clients/client-worklink/commands/TagResourceCommand.ts b/clients/client-worklink/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-worklink/commands/TagResourceCommand.ts rename to clients/client-worklink/src/commands/TagResourceCommand.ts diff --git a/clients/client-worklink/commands/UntagResourceCommand.ts b/clients/client-worklink/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-worklink/commands/UntagResourceCommand.ts rename to clients/client-worklink/src/commands/UntagResourceCommand.ts diff --git a/clients/client-worklink/commands/UpdateAuditStreamConfigurationCommand.ts b/clients/client-worklink/src/commands/UpdateAuditStreamConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateAuditStreamConfigurationCommand.ts rename to clients/client-worklink/src/commands/UpdateAuditStreamConfigurationCommand.ts diff --git a/clients/client-worklink/commands/UpdateCompanyNetworkConfigurationCommand.ts b/clients/client-worklink/src/commands/UpdateCompanyNetworkConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateCompanyNetworkConfigurationCommand.ts rename to clients/client-worklink/src/commands/UpdateCompanyNetworkConfigurationCommand.ts diff --git a/clients/client-worklink/commands/UpdateDevicePolicyConfigurationCommand.ts b/clients/client-worklink/src/commands/UpdateDevicePolicyConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateDevicePolicyConfigurationCommand.ts rename to clients/client-worklink/src/commands/UpdateDevicePolicyConfigurationCommand.ts diff --git a/clients/client-worklink/commands/UpdateDomainMetadataCommand.ts b/clients/client-worklink/src/commands/UpdateDomainMetadataCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateDomainMetadataCommand.ts rename to clients/client-worklink/src/commands/UpdateDomainMetadataCommand.ts diff --git a/clients/client-worklink/commands/UpdateFleetMetadataCommand.ts b/clients/client-worklink/src/commands/UpdateFleetMetadataCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateFleetMetadataCommand.ts rename to clients/client-worklink/src/commands/UpdateFleetMetadataCommand.ts diff --git a/clients/client-worklink/commands/UpdateIdentityProviderConfigurationCommand.ts b/clients/client-worklink/src/commands/UpdateIdentityProviderConfigurationCommand.ts similarity index 100% rename from clients/client-worklink/commands/UpdateIdentityProviderConfigurationCommand.ts rename to clients/client-worklink/src/commands/UpdateIdentityProviderConfigurationCommand.ts diff --git a/clients/client-worklink/endpoints.ts b/clients/client-worklink/src/endpoints.ts similarity index 100% rename from clients/client-worklink/endpoints.ts rename to clients/client-worklink/src/endpoints.ts diff --git a/clients/client-worklink/index.ts b/clients/client-worklink/src/index.ts similarity index 100% rename from clients/client-worklink/index.ts rename to clients/client-worklink/src/index.ts diff --git a/clients/client-worklink/models/index.ts b/clients/client-worklink/src/models/index.ts similarity index 100% rename from clients/client-worklink/models/index.ts rename to clients/client-worklink/src/models/index.ts diff --git a/clients/client-worklink/models/models_0.ts b/clients/client-worklink/src/models/models_0.ts similarity index 100% rename from clients/client-worklink/models/models_0.ts rename to clients/client-worklink/src/models/models_0.ts diff --git a/clients/client-worklink/pagination/Interfaces.ts b/clients/client-worklink/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-worklink/pagination/Interfaces.ts rename to clients/client-worklink/src/pagination/Interfaces.ts diff --git a/clients/client-worklink/pagination/ListDevicesPaginator.ts b/clients/client-worklink/src/pagination/ListDevicesPaginator.ts similarity index 100% rename from clients/client-worklink/pagination/ListDevicesPaginator.ts rename to clients/client-worklink/src/pagination/ListDevicesPaginator.ts diff --git a/clients/client-worklink/pagination/ListDomainsPaginator.ts b/clients/client-worklink/src/pagination/ListDomainsPaginator.ts similarity index 100% rename from clients/client-worklink/pagination/ListDomainsPaginator.ts rename to clients/client-worklink/src/pagination/ListDomainsPaginator.ts diff --git a/clients/client-worklink/pagination/ListFleetsPaginator.ts b/clients/client-worklink/src/pagination/ListFleetsPaginator.ts similarity index 100% rename from clients/client-worklink/pagination/ListFleetsPaginator.ts rename to clients/client-worklink/src/pagination/ListFleetsPaginator.ts diff --git a/clients/client-worklink/pagination/ListWebsiteAuthorizationProvidersPaginator.ts b/clients/client-worklink/src/pagination/ListWebsiteAuthorizationProvidersPaginator.ts similarity index 100% rename from clients/client-worklink/pagination/ListWebsiteAuthorizationProvidersPaginator.ts rename to clients/client-worklink/src/pagination/ListWebsiteAuthorizationProvidersPaginator.ts diff --git a/clients/client-worklink/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts b/clients/client-worklink/src/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts similarity index 100% rename from clients/client-worklink/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts rename to clients/client-worklink/src/pagination/ListWebsiteCertificateAuthoritiesPaginator.ts diff --git a/clients/client-worklink/protocols/Aws_restJson1.ts b/clients/client-worklink/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-worklink/protocols/Aws_restJson1.ts rename to clients/client-worklink/src/protocols/Aws_restJson1.ts diff --git a/clients/client-worklink/src/runtimeConfig.browser.ts b/clients/client-worklink/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..110837388976 --- /dev/null +++ b/clients/client-worklink/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WorkLinkClientConfig } from "./WorkLinkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkLinkClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-worklink/runtimeConfig.native.ts b/clients/client-worklink/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-worklink/runtimeConfig.native.ts rename to clients/client-worklink/src/runtimeConfig.native.ts diff --git a/clients/client-worklink/runtimeConfig.shared.ts b/clients/client-worklink/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-worklink/runtimeConfig.shared.ts rename to clients/client-worklink/src/runtimeConfig.shared.ts diff --git a/clients/client-worklink/src/runtimeConfig.ts b/clients/client-worklink/src/runtimeConfig.ts new file mode 100644 index 000000000000..01ea97da63e9 --- /dev/null +++ b/clients/client-worklink/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WorkLinkClientConfig } from "./WorkLinkClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkLinkClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-worklink/tsconfig.es.json b/clients/client-worklink/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-worklink/tsconfig.es.json +++ b/clients/client-worklink/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-worklink/tsconfig.json b/clients/client-worklink/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-worklink/tsconfig.json +++ b/clients/client-worklink/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-worklink/tsconfig.types.json b/clients/client-worklink/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-worklink/tsconfig.types.json +++ b/clients/client-worklink/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-workmail/.gitignore b/clients/client-workmail/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-workmail/.gitignore +++ b/clients/client-workmail/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-workmail/package.json b/clients/client-workmail/package.json index 67994c5b0fd6..632379f5ebc9 100644 --- a/clients/client-workmail/package.json +++ b/clients/client-workmail/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-workmail", "repository": { "type": "git", diff --git a/clients/client-workmail/runtimeConfig.browser.ts b/clients/client-workmail/runtimeConfig.browser.ts deleted file mode 100644 index 5188331daaad..000000000000 --- a/clients/client-workmail/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WorkMailClientConfig } from "./WorkMailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkMailClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workmail/runtimeConfig.ts b/clients/client-workmail/runtimeConfig.ts deleted file mode 100644 index e72441533bc6..000000000000 --- a/clients/client-workmail/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WorkMailClientConfig } from "./WorkMailClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkMailClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workmail/WorkMail.ts b/clients/client-workmail/src/WorkMail.ts similarity index 100% rename from clients/client-workmail/WorkMail.ts rename to clients/client-workmail/src/WorkMail.ts diff --git a/clients/client-workmail/WorkMailClient.ts b/clients/client-workmail/src/WorkMailClient.ts similarity index 100% rename from clients/client-workmail/WorkMailClient.ts rename to clients/client-workmail/src/WorkMailClient.ts diff --git a/clients/client-workmail/commands/AssociateDelegateToResourceCommand.ts b/clients/client-workmail/src/commands/AssociateDelegateToResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/AssociateDelegateToResourceCommand.ts rename to clients/client-workmail/src/commands/AssociateDelegateToResourceCommand.ts diff --git a/clients/client-workmail/commands/AssociateMemberToGroupCommand.ts b/clients/client-workmail/src/commands/AssociateMemberToGroupCommand.ts similarity index 100% rename from clients/client-workmail/commands/AssociateMemberToGroupCommand.ts rename to clients/client-workmail/src/commands/AssociateMemberToGroupCommand.ts diff --git a/clients/client-workmail/commands/CancelMailboxExportJobCommand.ts b/clients/client-workmail/src/commands/CancelMailboxExportJobCommand.ts similarity index 100% rename from clients/client-workmail/commands/CancelMailboxExportJobCommand.ts rename to clients/client-workmail/src/commands/CancelMailboxExportJobCommand.ts diff --git a/clients/client-workmail/commands/CreateAliasCommand.ts b/clients/client-workmail/src/commands/CreateAliasCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateAliasCommand.ts rename to clients/client-workmail/src/commands/CreateAliasCommand.ts diff --git a/clients/client-workmail/commands/CreateGroupCommand.ts b/clients/client-workmail/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateGroupCommand.ts rename to clients/client-workmail/src/commands/CreateGroupCommand.ts diff --git a/clients/client-workmail/commands/CreateMobileDeviceAccessRuleCommand.ts b/clients/client-workmail/src/commands/CreateMobileDeviceAccessRuleCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateMobileDeviceAccessRuleCommand.ts rename to clients/client-workmail/src/commands/CreateMobileDeviceAccessRuleCommand.ts diff --git a/clients/client-workmail/commands/CreateOrganizationCommand.ts b/clients/client-workmail/src/commands/CreateOrganizationCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateOrganizationCommand.ts rename to clients/client-workmail/src/commands/CreateOrganizationCommand.ts diff --git a/clients/client-workmail/commands/CreateResourceCommand.ts b/clients/client-workmail/src/commands/CreateResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateResourceCommand.ts rename to clients/client-workmail/src/commands/CreateResourceCommand.ts diff --git a/clients/client-workmail/commands/CreateUserCommand.ts b/clients/client-workmail/src/commands/CreateUserCommand.ts similarity index 100% rename from clients/client-workmail/commands/CreateUserCommand.ts rename to clients/client-workmail/src/commands/CreateUserCommand.ts diff --git a/clients/client-workmail/commands/DeleteAccessControlRuleCommand.ts b/clients/client-workmail/src/commands/DeleteAccessControlRuleCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteAccessControlRuleCommand.ts rename to clients/client-workmail/src/commands/DeleteAccessControlRuleCommand.ts diff --git a/clients/client-workmail/commands/DeleteAliasCommand.ts b/clients/client-workmail/src/commands/DeleteAliasCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteAliasCommand.ts rename to clients/client-workmail/src/commands/DeleteAliasCommand.ts diff --git a/clients/client-workmail/commands/DeleteGroupCommand.ts b/clients/client-workmail/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteGroupCommand.ts rename to clients/client-workmail/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-workmail/commands/DeleteMailboxPermissionsCommand.ts b/clients/client-workmail/src/commands/DeleteMailboxPermissionsCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteMailboxPermissionsCommand.ts rename to clients/client-workmail/src/commands/DeleteMailboxPermissionsCommand.ts diff --git a/clients/client-workmail/commands/DeleteMobileDeviceAccessRuleCommand.ts b/clients/client-workmail/src/commands/DeleteMobileDeviceAccessRuleCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteMobileDeviceAccessRuleCommand.ts rename to clients/client-workmail/src/commands/DeleteMobileDeviceAccessRuleCommand.ts diff --git a/clients/client-workmail/commands/DeleteOrganizationCommand.ts b/clients/client-workmail/src/commands/DeleteOrganizationCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteOrganizationCommand.ts rename to clients/client-workmail/src/commands/DeleteOrganizationCommand.ts diff --git a/clients/client-workmail/commands/DeleteResourceCommand.ts b/clients/client-workmail/src/commands/DeleteResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteResourceCommand.ts rename to clients/client-workmail/src/commands/DeleteResourceCommand.ts diff --git a/clients/client-workmail/commands/DeleteRetentionPolicyCommand.ts b/clients/client-workmail/src/commands/DeleteRetentionPolicyCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteRetentionPolicyCommand.ts rename to clients/client-workmail/src/commands/DeleteRetentionPolicyCommand.ts diff --git a/clients/client-workmail/commands/DeleteUserCommand.ts b/clients/client-workmail/src/commands/DeleteUserCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeleteUserCommand.ts rename to clients/client-workmail/src/commands/DeleteUserCommand.ts diff --git a/clients/client-workmail/commands/DeregisterFromWorkMailCommand.ts b/clients/client-workmail/src/commands/DeregisterFromWorkMailCommand.ts similarity index 100% rename from clients/client-workmail/commands/DeregisterFromWorkMailCommand.ts rename to clients/client-workmail/src/commands/DeregisterFromWorkMailCommand.ts diff --git a/clients/client-workmail/commands/DescribeGroupCommand.ts b/clients/client-workmail/src/commands/DescribeGroupCommand.ts similarity index 100% rename from clients/client-workmail/commands/DescribeGroupCommand.ts rename to clients/client-workmail/src/commands/DescribeGroupCommand.ts diff --git a/clients/client-workmail/commands/DescribeMailboxExportJobCommand.ts b/clients/client-workmail/src/commands/DescribeMailboxExportJobCommand.ts similarity index 100% rename from clients/client-workmail/commands/DescribeMailboxExportJobCommand.ts rename to clients/client-workmail/src/commands/DescribeMailboxExportJobCommand.ts diff --git a/clients/client-workmail/commands/DescribeOrganizationCommand.ts b/clients/client-workmail/src/commands/DescribeOrganizationCommand.ts similarity index 100% rename from clients/client-workmail/commands/DescribeOrganizationCommand.ts rename to clients/client-workmail/src/commands/DescribeOrganizationCommand.ts diff --git a/clients/client-workmail/commands/DescribeResourceCommand.ts b/clients/client-workmail/src/commands/DescribeResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/DescribeResourceCommand.ts rename to clients/client-workmail/src/commands/DescribeResourceCommand.ts diff --git a/clients/client-workmail/commands/DescribeUserCommand.ts b/clients/client-workmail/src/commands/DescribeUserCommand.ts similarity index 100% rename from clients/client-workmail/commands/DescribeUserCommand.ts rename to clients/client-workmail/src/commands/DescribeUserCommand.ts diff --git a/clients/client-workmail/commands/DisassociateDelegateFromResourceCommand.ts b/clients/client-workmail/src/commands/DisassociateDelegateFromResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/DisassociateDelegateFromResourceCommand.ts rename to clients/client-workmail/src/commands/DisassociateDelegateFromResourceCommand.ts diff --git a/clients/client-workmail/commands/DisassociateMemberFromGroupCommand.ts b/clients/client-workmail/src/commands/DisassociateMemberFromGroupCommand.ts similarity index 100% rename from clients/client-workmail/commands/DisassociateMemberFromGroupCommand.ts rename to clients/client-workmail/src/commands/DisassociateMemberFromGroupCommand.ts diff --git a/clients/client-workmail/commands/GetAccessControlEffectCommand.ts b/clients/client-workmail/src/commands/GetAccessControlEffectCommand.ts similarity index 100% rename from clients/client-workmail/commands/GetAccessControlEffectCommand.ts rename to clients/client-workmail/src/commands/GetAccessControlEffectCommand.ts diff --git a/clients/client-workmail/commands/GetDefaultRetentionPolicyCommand.ts b/clients/client-workmail/src/commands/GetDefaultRetentionPolicyCommand.ts similarity index 100% rename from clients/client-workmail/commands/GetDefaultRetentionPolicyCommand.ts rename to clients/client-workmail/src/commands/GetDefaultRetentionPolicyCommand.ts diff --git a/clients/client-workmail/commands/GetMailboxDetailsCommand.ts b/clients/client-workmail/src/commands/GetMailboxDetailsCommand.ts similarity index 100% rename from clients/client-workmail/commands/GetMailboxDetailsCommand.ts rename to clients/client-workmail/src/commands/GetMailboxDetailsCommand.ts diff --git a/clients/client-workmail/commands/GetMobileDeviceAccessEffectCommand.ts b/clients/client-workmail/src/commands/GetMobileDeviceAccessEffectCommand.ts similarity index 100% rename from clients/client-workmail/commands/GetMobileDeviceAccessEffectCommand.ts rename to clients/client-workmail/src/commands/GetMobileDeviceAccessEffectCommand.ts diff --git a/clients/client-workmail/commands/ListAccessControlRulesCommand.ts b/clients/client-workmail/src/commands/ListAccessControlRulesCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListAccessControlRulesCommand.ts rename to clients/client-workmail/src/commands/ListAccessControlRulesCommand.ts diff --git a/clients/client-workmail/commands/ListAliasesCommand.ts b/clients/client-workmail/src/commands/ListAliasesCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListAliasesCommand.ts rename to clients/client-workmail/src/commands/ListAliasesCommand.ts diff --git a/clients/client-workmail/commands/ListGroupMembersCommand.ts b/clients/client-workmail/src/commands/ListGroupMembersCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListGroupMembersCommand.ts rename to clients/client-workmail/src/commands/ListGroupMembersCommand.ts diff --git a/clients/client-workmail/commands/ListGroupsCommand.ts b/clients/client-workmail/src/commands/ListGroupsCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListGroupsCommand.ts rename to clients/client-workmail/src/commands/ListGroupsCommand.ts diff --git a/clients/client-workmail/commands/ListMailboxExportJobsCommand.ts b/clients/client-workmail/src/commands/ListMailboxExportJobsCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListMailboxExportJobsCommand.ts rename to clients/client-workmail/src/commands/ListMailboxExportJobsCommand.ts diff --git a/clients/client-workmail/commands/ListMailboxPermissionsCommand.ts b/clients/client-workmail/src/commands/ListMailboxPermissionsCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListMailboxPermissionsCommand.ts rename to clients/client-workmail/src/commands/ListMailboxPermissionsCommand.ts diff --git a/clients/client-workmail/commands/ListMobileDeviceAccessRulesCommand.ts b/clients/client-workmail/src/commands/ListMobileDeviceAccessRulesCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListMobileDeviceAccessRulesCommand.ts rename to clients/client-workmail/src/commands/ListMobileDeviceAccessRulesCommand.ts diff --git a/clients/client-workmail/commands/ListOrganizationsCommand.ts b/clients/client-workmail/src/commands/ListOrganizationsCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListOrganizationsCommand.ts rename to clients/client-workmail/src/commands/ListOrganizationsCommand.ts diff --git a/clients/client-workmail/commands/ListResourceDelegatesCommand.ts b/clients/client-workmail/src/commands/ListResourceDelegatesCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListResourceDelegatesCommand.ts rename to clients/client-workmail/src/commands/ListResourceDelegatesCommand.ts diff --git a/clients/client-workmail/commands/ListResourcesCommand.ts b/clients/client-workmail/src/commands/ListResourcesCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListResourcesCommand.ts rename to clients/client-workmail/src/commands/ListResourcesCommand.ts diff --git a/clients/client-workmail/commands/ListTagsForResourceCommand.ts b/clients/client-workmail/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListTagsForResourceCommand.ts rename to clients/client-workmail/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-workmail/commands/ListUsersCommand.ts b/clients/client-workmail/src/commands/ListUsersCommand.ts similarity index 100% rename from clients/client-workmail/commands/ListUsersCommand.ts rename to clients/client-workmail/src/commands/ListUsersCommand.ts diff --git a/clients/client-workmail/commands/PutAccessControlRuleCommand.ts b/clients/client-workmail/src/commands/PutAccessControlRuleCommand.ts similarity index 100% rename from clients/client-workmail/commands/PutAccessControlRuleCommand.ts rename to clients/client-workmail/src/commands/PutAccessControlRuleCommand.ts diff --git a/clients/client-workmail/commands/PutMailboxPermissionsCommand.ts b/clients/client-workmail/src/commands/PutMailboxPermissionsCommand.ts similarity index 100% rename from clients/client-workmail/commands/PutMailboxPermissionsCommand.ts rename to clients/client-workmail/src/commands/PutMailboxPermissionsCommand.ts diff --git a/clients/client-workmail/commands/PutRetentionPolicyCommand.ts b/clients/client-workmail/src/commands/PutRetentionPolicyCommand.ts similarity index 100% rename from clients/client-workmail/commands/PutRetentionPolicyCommand.ts rename to clients/client-workmail/src/commands/PutRetentionPolicyCommand.ts diff --git a/clients/client-workmail/commands/RegisterToWorkMailCommand.ts b/clients/client-workmail/src/commands/RegisterToWorkMailCommand.ts similarity index 100% rename from clients/client-workmail/commands/RegisterToWorkMailCommand.ts rename to clients/client-workmail/src/commands/RegisterToWorkMailCommand.ts diff --git a/clients/client-workmail/commands/ResetPasswordCommand.ts b/clients/client-workmail/src/commands/ResetPasswordCommand.ts similarity index 100% rename from clients/client-workmail/commands/ResetPasswordCommand.ts rename to clients/client-workmail/src/commands/ResetPasswordCommand.ts diff --git a/clients/client-workmail/commands/StartMailboxExportJobCommand.ts b/clients/client-workmail/src/commands/StartMailboxExportJobCommand.ts similarity index 100% rename from clients/client-workmail/commands/StartMailboxExportJobCommand.ts rename to clients/client-workmail/src/commands/StartMailboxExportJobCommand.ts diff --git a/clients/client-workmail/commands/TagResourceCommand.ts b/clients/client-workmail/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/TagResourceCommand.ts rename to clients/client-workmail/src/commands/TagResourceCommand.ts diff --git a/clients/client-workmail/commands/UntagResourceCommand.ts b/clients/client-workmail/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/UntagResourceCommand.ts rename to clients/client-workmail/src/commands/UntagResourceCommand.ts diff --git a/clients/client-workmail/commands/UpdateMailboxQuotaCommand.ts b/clients/client-workmail/src/commands/UpdateMailboxQuotaCommand.ts similarity index 100% rename from clients/client-workmail/commands/UpdateMailboxQuotaCommand.ts rename to clients/client-workmail/src/commands/UpdateMailboxQuotaCommand.ts diff --git a/clients/client-workmail/commands/UpdateMobileDeviceAccessRuleCommand.ts b/clients/client-workmail/src/commands/UpdateMobileDeviceAccessRuleCommand.ts similarity index 100% rename from clients/client-workmail/commands/UpdateMobileDeviceAccessRuleCommand.ts rename to clients/client-workmail/src/commands/UpdateMobileDeviceAccessRuleCommand.ts diff --git a/clients/client-workmail/commands/UpdatePrimaryEmailAddressCommand.ts b/clients/client-workmail/src/commands/UpdatePrimaryEmailAddressCommand.ts similarity index 100% rename from clients/client-workmail/commands/UpdatePrimaryEmailAddressCommand.ts rename to clients/client-workmail/src/commands/UpdatePrimaryEmailAddressCommand.ts diff --git a/clients/client-workmail/commands/UpdateResourceCommand.ts b/clients/client-workmail/src/commands/UpdateResourceCommand.ts similarity index 100% rename from clients/client-workmail/commands/UpdateResourceCommand.ts rename to clients/client-workmail/src/commands/UpdateResourceCommand.ts diff --git a/clients/client-workmail/endpoints.ts b/clients/client-workmail/src/endpoints.ts similarity index 100% rename from clients/client-workmail/endpoints.ts rename to clients/client-workmail/src/endpoints.ts diff --git a/clients/client-workmail/index.ts b/clients/client-workmail/src/index.ts similarity index 100% rename from clients/client-workmail/index.ts rename to clients/client-workmail/src/index.ts diff --git a/clients/client-workmail/models/index.ts b/clients/client-workmail/src/models/index.ts similarity index 100% rename from clients/client-workmail/models/index.ts rename to clients/client-workmail/src/models/index.ts diff --git a/clients/client-workmail/models/models_0.ts b/clients/client-workmail/src/models/models_0.ts similarity index 100% rename from clients/client-workmail/models/models_0.ts rename to clients/client-workmail/src/models/models_0.ts diff --git a/clients/client-workmail/pagination/Interfaces.ts b/clients/client-workmail/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-workmail/pagination/Interfaces.ts rename to clients/client-workmail/src/pagination/Interfaces.ts diff --git a/clients/client-workmail/pagination/ListAliasesPaginator.ts b/clients/client-workmail/src/pagination/ListAliasesPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListAliasesPaginator.ts rename to clients/client-workmail/src/pagination/ListAliasesPaginator.ts diff --git a/clients/client-workmail/pagination/ListGroupMembersPaginator.ts b/clients/client-workmail/src/pagination/ListGroupMembersPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListGroupMembersPaginator.ts rename to clients/client-workmail/src/pagination/ListGroupMembersPaginator.ts diff --git a/clients/client-workmail/pagination/ListGroupsPaginator.ts b/clients/client-workmail/src/pagination/ListGroupsPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListGroupsPaginator.ts rename to clients/client-workmail/src/pagination/ListGroupsPaginator.ts diff --git a/clients/client-workmail/pagination/ListMailboxExportJobsPaginator.ts b/clients/client-workmail/src/pagination/ListMailboxExportJobsPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListMailboxExportJobsPaginator.ts rename to clients/client-workmail/src/pagination/ListMailboxExportJobsPaginator.ts diff --git a/clients/client-workmail/pagination/ListMailboxPermissionsPaginator.ts b/clients/client-workmail/src/pagination/ListMailboxPermissionsPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListMailboxPermissionsPaginator.ts rename to clients/client-workmail/src/pagination/ListMailboxPermissionsPaginator.ts diff --git a/clients/client-workmail/pagination/ListOrganizationsPaginator.ts b/clients/client-workmail/src/pagination/ListOrganizationsPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListOrganizationsPaginator.ts rename to clients/client-workmail/src/pagination/ListOrganizationsPaginator.ts diff --git a/clients/client-workmail/pagination/ListResourceDelegatesPaginator.ts b/clients/client-workmail/src/pagination/ListResourceDelegatesPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListResourceDelegatesPaginator.ts rename to clients/client-workmail/src/pagination/ListResourceDelegatesPaginator.ts diff --git a/clients/client-workmail/pagination/ListResourcesPaginator.ts b/clients/client-workmail/src/pagination/ListResourcesPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListResourcesPaginator.ts rename to clients/client-workmail/src/pagination/ListResourcesPaginator.ts diff --git a/clients/client-workmail/pagination/ListUsersPaginator.ts b/clients/client-workmail/src/pagination/ListUsersPaginator.ts similarity index 100% rename from clients/client-workmail/pagination/ListUsersPaginator.ts rename to clients/client-workmail/src/pagination/ListUsersPaginator.ts diff --git a/clients/client-workmail/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-workmail/protocols/Aws_json1_1.ts rename to clients/client-workmail/src/protocols/Aws_json1_1.ts diff --git a/clients/client-workmail/src/runtimeConfig.browser.ts b/clients/client-workmail/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..082ba35eb1f5 --- /dev/null +++ b/clients/client-workmail/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WorkMailClientConfig } from "./WorkMailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkMailClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workmail/runtimeConfig.native.ts b/clients/client-workmail/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-workmail/runtimeConfig.native.ts rename to clients/client-workmail/src/runtimeConfig.native.ts diff --git a/clients/client-workmail/runtimeConfig.shared.ts b/clients/client-workmail/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-workmail/runtimeConfig.shared.ts rename to clients/client-workmail/src/runtimeConfig.shared.ts diff --git a/clients/client-workmail/src/runtimeConfig.ts b/clients/client-workmail/src/runtimeConfig.ts new file mode 100644 index 000000000000..baa61bcfb3d1 --- /dev/null +++ b/clients/client-workmail/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WorkMailClientConfig } from "./WorkMailClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkMailClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workmail/tsconfig.es.json b/clients/client-workmail/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-workmail/tsconfig.es.json +++ b/clients/client-workmail/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-workmail/tsconfig.json b/clients/client-workmail/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-workmail/tsconfig.json +++ b/clients/client-workmail/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-workmail/tsconfig.types.json b/clients/client-workmail/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-workmail/tsconfig.types.json +++ b/clients/client-workmail/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-workmailmessageflow/.gitignore b/clients/client-workmailmessageflow/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-workmailmessageflow/.gitignore +++ b/clients/client-workmailmessageflow/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-workmailmessageflow/package.json b/clients/client-workmailmessageflow/package.json index af8e7a65f6cb..ce6dcc78da47 100644 --- a/clients/client-workmailmessageflow/package.json +++ b/clients/client-workmailmessageflow/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-workmailmessageflow", "repository": { "type": "git", diff --git a/clients/client-workmailmessageflow/runtimeConfig.browser.ts b/clients/client-workmailmessageflow/runtimeConfig.browser.ts deleted file mode 100644 index 80604316c902..000000000000 --- a/clients/client-workmailmessageflow/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workmailmessageflow/runtimeConfig.ts b/clients/client-workmailmessageflow/runtimeConfig.ts deleted file mode 100644 index f1bfaa127421..000000000000 --- a/clients/client-workmailmessageflow/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workmailmessageflow/WorkMailMessageFlow.ts b/clients/client-workmailmessageflow/src/WorkMailMessageFlow.ts similarity index 100% rename from clients/client-workmailmessageflow/WorkMailMessageFlow.ts rename to clients/client-workmailmessageflow/src/WorkMailMessageFlow.ts diff --git a/clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts b/clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts similarity index 100% rename from clients/client-workmailmessageflow/WorkMailMessageFlowClient.ts rename to clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts diff --git a/clients/client-workmailmessageflow/commands/GetRawMessageContentCommand.ts b/clients/client-workmailmessageflow/src/commands/GetRawMessageContentCommand.ts similarity index 100% rename from clients/client-workmailmessageflow/commands/GetRawMessageContentCommand.ts rename to clients/client-workmailmessageflow/src/commands/GetRawMessageContentCommand.ts diff --git a/clients/client-workmailmessageflow/commands/PutRawMessageContentCommand.ts b/clients/client-workmailmessageflow/src/commands/PutRawMessageContentCommand.ts similarity index 100% rename from clients/client-workmailmessageflow/commands/PutRawMessageContentCommand.ts rename to clients/client-workmailmessageflow/src/commands/PutRawMessageContentCommand.ts diff --git a/clients/client-workmailmessageflow/endpoints.ts b/clients/client-workmailmessageflow/src/endpoints.ts similarity index 100% rename from clients/client-workmailmessageflow/endpoints.ts rename to clients/client-workmailmessageflow/src/endpoints.ts diff --git a/clients/client-workmailmessageflow/index.ts b/clients/client-workmailmessageflow/src/index.ts similarity index 100% rename from clients/client-workmailmessageflow/index.ts rename to clients/client-workmailmessageflow/src/index.ts diff --git a/clients/client-workmailmessageflow/models/index.ts b/clients/client-workmailmessageflow/src/models/index.ts similarity index 100% rename from clients/client-workmailmessageflow/models/index.ts rename to clients/client-workmailmessageflow/src/models/index.ts diff --git a/clients/client-workmailmessageflow/models/models_0.ts b/clients/client-workmailmessageflow/src/models/models_0.ts similarity index 100% rename from clients/client-workmailmessageflow/models/models_0.ts rename to clients/client-workmailmessageflow/src/models/models_0.ts diff --git a/clients/client-workmailmessageflow/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-workmailmessageflow/protocols/Aws_restJson1.ts rename to clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts diff --git a/clients/client-workmailmessageflow/src/runtimeConfig.browser.ts b/clients/client-workmailmessageflow/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3d9098eeb1c0 --- /dev/null +++ b/clients/client-workmailmessageflow/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workmailmessageflow/runtimeConfig.native.ts b/clients/client-workmailmessageflow/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-workmailmessageflow/runtimeConfig.native.ts rename to clients/client-workmailmessageflow/src/runtimeConfig.native.ts diff --git a/clients/client-workmailmessageflow/runtimeConfig.shared.ts b/clients/client-workmailmessageflow/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-workmailmessageflow/runtimeConfig.shared.ts rename to clients/client-workmailmessageflow/src/runtimeConfig.shared.ts diff --git a/clients/client-workmailmessageflow/src/runtimeConfig.ts b/clients/client-workmailmessageflow/src/runtimeConfig.ts new file mode 100644 index 000000000000..c3ed7c7f8bdd --- /dev/null +++ b/clients/client-workmailmessageflow/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workmailmessageflow/tsconfig.es.json b/clients/client-workmailmessageflow/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-workmailmessageflow/tsconfig.es.json +++ b/clients/client-workmailmessageflow/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-workmailmessageflow/tsconfig.json b/clients/client-workmailmessageflow/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-workmailmessageflow/tsconfig.json +++ b/clients/client-workmailmessageflow/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-workmailmessageflow/tsconfig.types.json b/clients/client-workmailmessageflow/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-workmailmessageflow/tsconfig.types.json +++ b/clients/client-workmailmessageflow/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-workspaces/.gitignore b/clients/client-workspaces/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-workspaces/.gitignore +++ b/clients/client-workspaces/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-workspaces/package.json b/clients/client-workspaces/package.json index 537569c1e31e..28a931a9491f 100644 --- a/clients/client-workspaces/package.json +++ b/clients/client-workspaces/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-workspaces", "repository": { "type": "git", diff --git a/clients/client-workspaces/runtimeConfig.browser.ts b/clients/client-workspaces/runtimeConfig.browser.ts deleted file mode 100644 index e4ef1783d6ec..000000000000 --- a/clients/client-workspaces/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { WorkSpacesClientConfig } from "./WorkSpacesClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workspaces/runtimeConfig.ts b/clients/client-workspaces/runtimeConfig.ts deleted file mode 100644 index e95c125a6bc5..000000000000 --- a/clients/client-workspaces/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { WorkSpacesClientConfig } from "./WorkSpacesClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-workspaces/WorkSpaces.ts b/clients/client-workspaces/src/WorkSpaces.ts similarity index 100% rename from clients/client-workspaces/WorkSpaces.ts rename to clients/client-workspaces/src/WorkSpaces.ts diff --git a/clients/client-workspaces/WorkSpacesClient.ts b/clients/client-workspaces/src/WorkSpacesClient.ts similarity index 100% rename from clients/client-workspaces/WorkSpacesClient.ts rename to clients/client-workspaces/src/WorkSpacesClient.ts diff --git a/clients/client-workspaces/commands/AssociateConnectionAliasCommand.ts b/clients/client-workspaces/src/commands/AssociateConnectionAliasCommand.ts similarity index 100% rename from clients/client-workspaces/commands/AssociateConnectionAliasCommand.ts rename to clients/client-workspaces/src/commands/AssociateConnectionAliasCommand.ts diff --git a/clients/client-workspaces/commands/AssociateIpGroupsCommand.ts b/clients/client-workspaces/src/commands/AssociateIpGroupsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/AssociateIpGroupsCommand.ts rename to clients/client-workspaces/src/commands/AssociateIpGroupsCommand.ts diff --git a/clients/client-workspaces/commands/AuthorizeIpRulesCommand.ts b/clients/client-workspaces/src/commands/AuthorizeIpRulesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/AuthorizeIpRulesCommand.ts rename to clients/client-workspaces/src/commands/AuthorizeIpRulesCommand.ts diff --git a/clients/client-workspaces/commands/CopyWorkspaceImageCommand.ts b/clients/client-workspaces/src/commands/CopyWorkspaceImageCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CopyWorkspaceImageCommand.ts rename to clients/client-workspaces/src/commands/CopyWorkspaceImageCommand.ts diff --git a/clients/client-workspaces/commands/CreateConnectionAliasCommand.ts b/clients/client-workspaces/src/commands/CreateConnectionAliasCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CreateConnectionAliasCommand.ts rename to clients/client-workspaces/src/commands/CreateConnectionAliasCommand.ts diff --git a/clients/client-workspaces/commands/CreateIpGroupCommand.ts b/clients/client-workspaces/src/commands/CreateIpGroupCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CreateIpGroupCommand.ts rename to clients/client-workspaces/src/commands/CreateIpGroupCommand.ts diff --git a/clients/client-workspaces/commands/CreateTagsCommand.ts b/clients/client-workspaces/src/commands/CreateTagsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CreateTagsCommand.ts rename to clients/client-workspaces/src/commands/CreateTagsCommand.ts diff --git a/clients/client-workspaces/commands/CreateWorkspaceBundleCommand.ts b/clients/client-workspaces/src/commands/CreateWorkspaceBundleCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CreateWorkspaceBundleCommand.ts rename to clients/client-workspaces/src/commands/CreateWorkspaceBundleCommand.ts diff --git a/clients/client-workspaces/commands/CreateWorkspacesCommand.ts b/clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/CreateWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/DeleteConnectionAliasCommand.ts b/clients/client-workspaces/src/commands/DeleteConnectionAliasCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeleteConnectionAliasCommand.ts rename to clients/client-workspaces/src/commands/DeleteConnectionAliasCommand.ts diff --git a/clients/client-workspaces/commands/DeleteIpGroupCommand.ts b/clients/client-workspaces/src/commands/DeleteIpGroupCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeleteIpGroupCommand.ts rename to clients/client-workspaces/src/commands/DeleteIpGroupCommand.ts diff --git a/clients/client-workspaces/commands/DeleteTagsCommand.ts b/clients/client-workspaces/src/commands/DeleteTagsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeleteTagsCommand.ts rename to clients/client-workspaces/src/commands/DeleteTagsCommand.ts diff --git a/clients/client-workspaces/commands/DeleteWorkspaceBundleCommand.ts b/clients/client-workspaces/src/commands/DeleteWorkspaceBundleCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeleteWorkspaceBundleCommand.ts rename to clients/client-workspaces/src/commands/DeleteWorkspaceBundleCommand.ts diff --git a/clients/client-workspaces/commands/DeleteWorkspaceImageCommand.ts b/clients/client-workspaces/src/commands/DeleteWorkspaceImageCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeleteWorkspaceImageCommand.ts rename to clients/client-workspaces/src/commands/DeleteWorkspaceImageCommand.ts diff --git a/clients/client-workspaces/commands/DeregisterWorkspaceDirectoryCommand.ts b/clients/client-workspaces/src/commands/DeregisterWorkspaceDirectoryCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DeregisterWorkspaceDirectoryCommand.ts rename to clients/client-workspaces/src/commands/DeregisterWorkspaceDirectoryCommand.ts diff --git a/clients/client-workspaces/commands/DescribeAccountCommand.ts b/clients/client-workspaces/src/commands/DescribeAccountCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeAccountCommand.ts rename to clients/client-workspaces/src/commands/DescribeAccountCommand.ts diff --git a/clients/client-workspaces/commands/DescribeAccountModificationsCommand.ts b/clients/client-workspaces/src/commands/DescribeAccountModificationsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeAccountModificationsCommand.ts rename to clients/client-workspaces/src/commands/DescribeAccountModificationsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeClientPropertiesCommand.ts b/clients/client-workspaces/src/commands/DescribeClientPropertiesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeClientPropertiesCommand.ts rename to clients/client-workspaces/src/commands/DescribeClientPropertiesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeConnectionAliasPermissionsCommand.ts b/clients/client-workspaces/src/commands/DescribeConnectionAliasPermissionsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeConnectionAliasPermissionsCommand.ts rename to clients/client-workspaces/src/commands/DescribeConnectionAliasPermissionsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeConnectionAliasesCommand.ts b/clients/client-workspaces/src/commands/DescribeConnectionAliasesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeConnectionAliasesCommand.ts rename to clients/client-workspaces/src/commands/DescribeConnectionAliasesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeIpGroupsCommand.ts b/clients/client-workspaces/src/commands/DescribeIpGroupsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeIpGroupsCommand.ts rename to clients/client-workspaces/src/commands/DescribeIpGroupsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeTagsCommand.ts b/clients/client-workspaces/src/commands/DescribeTagsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeTagsCommand.ts rename to clients/client-workspaces/src/commands/DescribeTagsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspaceBundlesCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspaceBundlesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspaceBundlesCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspaceBundlesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspaceDirectoriesCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspaceDirectoriesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspaceDirectoriesCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspaceDirectoriesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspaceImagePermissionsCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspaceImagePermissionsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspaceImagePermissionsCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspaceImagePermissionsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspaceImagesCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspaceImagesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspaceImagesCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspaceImagesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspaceSnapshotsCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspaceSnapshotsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspaceSnapshotsCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspaceSnapshotsCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspacesCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/DescribeWorkspacesConnectionStatusCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspacesConnectionStatusCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DescribeWorkspacesConnectionStatusCommand.ts rename to clients/client-workspaces/src/commands/DescribeWorkspacesConnectionStatusCommand.ts diff --git a/clients/client-workspaces/commands/DisassociateConnectionAliasCommand.ts b/clients/client-workspaces/src/commands/DisassociateConnectionAliasCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DisassociateConnectionAliasCommand.ts rename to clients/client-workspaces/src/commands/DisassociateConnectionAliasCommand.ts diff --git a/clients/client-workspaces/commands/DisassociateIpGroupsCommand.ts b/clients/client-workspaces/src/commands/DisassociateIpGroupsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/DisassociateIpGroupsCommand.ts rename to clients/client-workspaces/src/commands/DisassociateIpGroupsCommand.ts diff --git a/clients/client-workspaces/commands/ImportWorkspaceImageCommand.ts b/clients/client-workspaces/src/commands/ImportWorkspaceImageCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ImportWorkspaceImageCommand.ts rename to clients/client-workspaces/src/commands/ImportWorkspaceImageCommand.ts diff --git a/clients/client-workspaces/commands/ListAvailableManagementCidrRangesCommand.ts b/clients/client-workspaces/src/commands/ListAvailableManagementCidrRangesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ListAvailableManagementCidrRangesCommand.ts rename to clients/client-workspaces/src/commands/ListAvailableManagementCidrRangesCommand.ts diff --git a/clients/client-workspaces/commands/MigrateWorkspaceCommand.ts b/clients/client-workspaces/src/commands/MigrateWorkspaceCommand.ts similarity index 100% rename from clients/client-workspaces/commands/MigrateWorkspaceCommand.ts rename to clients/client-workspaces/src/commands/MigrateWorkspaceCommand.ts diff --git a/clients/client-workspaces/commands/ModifyAccountCommand.ts b/clients/client-workspaces/src/commands/ModifyAccountCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyAccountCommand.ts rename to clients/client-workspaces/src/commands/ModifyAccountCommand.ts diff --git a/clients/client-workspaces/commands/ModifyClientPropertiesCommand.ts b/clients/client-workspaces/src/commands/ModifyClientPropertiesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyClientPropertiesCommand.ts rename to clients/client-workspaces/src/commands/ModifyClientPropertiesCommand.ts diff --git a/clients/client-workspaces/commands/ModifySelfservicePermissionsCommand.ts b/clients/client-workspaces/src/commands/ModifySelfservicePermissionsCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifySelfservicePermissionsCommand.ts rename to clients/client-workspaces/src/commands/ModifySelfservicePermissionsCommand.ts diff --git a/clients/client-workspaces/commands/ModifyWorkspaceAccessPropertiesCommand.ts b/clients/client-workspaces/src/commands/ModifyWorkspaceAccessPropertiesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyWorkspaceAccessPropertiesCommand.ts rename to clients/client-workspaces/src/commands/ModifyWorkspaceAccessPropertiesCommand.ts diff --git a/clients/client-workspaces/commands/ModifyWorkspaceCreationPropertiesCommand.ts b/clients/client-workspaces/src/commands/ModifyWorkspaceCreationPropertiesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyWorkspaceCreationPropertiesCommand.ts rename to clients/client-workspaces/src/commands/ModifyWorkspaceCreationPropertiesCommand.ts diff --git a/clients/client-workspaces/commands/ModifyWorkspacePropertiesCommand.ts b/clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyWorkspacePropertiesCommand.ts rename to clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts diff --git a/clients/client-workspaces/commands/ModifyWorkspaceStateCommand.ts b/clients/client-workspaces/src/commands/ModifyWorkspaceStateCommand.ts similarity index 100% rename from clients/client-workspaces/commands/ModifyWorkspaceStateCommand.ts rename to clients/client-workspaces/src/commands/ModifyWorkspaceStateCommand.ts diff --git a/clients/client-workspaces/commands/RebootWorkspacesCommand.ts b/clients/client-workspaces/src/commands/RebootWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/RebootWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/RebootWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/RebuildWorkspacesCommand.ts b/clients/client-workspaces/src/commands/RebuildWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/RebuildWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/RebuildWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/RegisterWorkspaceDirectoryCommand.ts b/clients/client-workspaces/src/commands/RegisterWorkspaceDirectoryCommand.ts similarity index 100% rename from clients/client-workspaces/commands/RegisterWorkspaceDirectoryCommand.ts rename to clients/client-workspaces/src/commands/RegisterWorkspaceDirectoryCommand.ts diff --git a/clients/client-workspaces/commands/RestoreWorkspaceCommand.ts b/clients/client-workspaces/src/commands/RestoreWorkspaceCommand.ts similarity index 100% rename from clients/client-workspaces/commands/RestoreWorkspaceCommand.ts rename to clients/client-workspaces/src/commands/RestoreWorkspaceCommand.ts diff --git a/clients/client-workspaces/commands/RevokeIpRulesCommand.ts b/clients/client-workspaces/src/commands/RevokeIpRulesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/RevokeIpRulesCommand.ts rename to clients/client-workspaces/src/commands/RevokeIpRulesCommand.ts diff --git a/clients/client-workspaces/commands/StartWorkspacesCommand.ts b/clients/client-workspaces/src/commands/StartWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/StartWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/StartWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/StopWorkspacesCommand.ts b/clients/client-workspaces/src/commands/StopWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/StopWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/StopWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/TerminateWorkspacesCommand.ts b/clients/client-workspaces/src/commands/TerminateWorkspacesCommand.ts similarity index 100% rename from clients/client-workspaces/commands/TerminateWorkspacesCommand.ts rename to clients/client-workspaces/src/commands/TerminateWorkspacesCommand.ts diff --git a/clients/client-workspaces/commands/UpdateConnectionAliasPermissionCommand.ts b/clients/client-workspaces/src/commands/UpdateConnectionAliasPermissionCommand.ts similarity index 100% rename from clients/client-workspaces/commands/UpdateConnectionAliasPermissionCommand.ts rename to clients/client-workspaces/src/commands/UpdateConnectionAliasPermissionCommand.ts diff --git a/clients/client-workspaces/commands/UpdateRulesOfIpGroupCommand.ts b/clients/client-workspaces/src/commands/UpdateRulesOfIpGroupCommand.ts similarity index 100% rename from clients/client-workspaces/commands/UpdateRulesOfIpGroupCommand.ts rename to clients/client-workspaces/src/commands/UpdateRulesOfIpGroupCommand.ts diff --git a/clients/client-workspaces/commands/UpdateWorkspaceBundleCommand.ts b/clients/client-workspaces/src/commands/UpdateWorkspaceBundleCommand.ts similarity index 100% rename from clients/client-workspaces/commands/UpdateWorkspaceBundleCommand.ts rename to clients/client-workspaces/src/commands/UpdateWorkspaceBundleCommand.ts diff --git a/clients/client-workspaces/commands/UpdateWorkspaceImagePermissionCommand.ts b/clients/client-workspaces/src/commands/UpdateWorkspaceImagePermissionCommand.ts similarity index 100% rename from clients/client-workspaces/commands/UpdateWorkspaceImagePermissionCommand.ts rename to clients/client-workspaces/src/commands/UpdateWorkspaceImagePermissionCommand.ts diff --git a/clients/client-workspaces/endpoints.ts b/clients/client-workspaces/src/endpoints.ts similarity index 100% rename from clients/client-workspaces/endpoints.ts rename to clients/client-workspaces/src/endpoints.ts diff --git a/clients/client-workspaces/index.ts b/clients/client-workspaces/src/index.ts similarity index 100% rename from clients/client-workspaces/index.ts rename to clients/client-workspaces/src/index.ts diff --git a/clients/client-workspaces/models/index.ts b/clients/client-workspaces/src/models/index.ts similarity index 100% rename from clients/client-workspaces/models/index.ts rename to clients/client-workspaces/src/models/index.ts diff --git a/clients/client-workspaces/models/models_0.ts b/clients/client-workspaces/src/models/models_0.ts similarity index 100% rename from clients/client-workspaces/models/models_0.ts rename to clients/client-workspaces/src/models/models_0.ts diff --git a/clients/client-workspaces/pagination/DescribeWorkspaceBundlesPaginator.ts b/clients/client-workspaces/src/pagination/DescribeWorkspaceBundlesPaginator.ts similarity index 100% rename from clients/client-workspaces/pagination/DescribeWorkspaceBundlesPaginator.ts rename to clients/client-workspaces/src/pagination/DescribeWorkspaceBundlesPaginator.ts diff --git a/clients/client-workspaces/pagination/DescribeWorkspaceDirectoriesPaginator.ts b/clients/client-workspaces/src/pagination/DescribeWorkspaceDirectoriesPaginator.ts similarity index 100% rename from clients/client-workspaces/pagination/DescribeWorkspaceDirectoriesPaginator.ts rename to clients/client-workspaces/src/pagination/DescribeWorkspaceDirectoriesPaginator.ts diff --git a/clients/client-workspaces/pagination/DescribeWorkspacesPaginator.ts b/clients/client-workspaces/src/pagination/DescribeWorkspacesPaginator.ts similarity index 100% rename from clients/client-workspaces/pagination/DescribeWorkspacesPaginator.ts rename to clients/client-workspaces/src/pagination/DescribeWorkspacesPaginator.ts diff --git a/clients/client-workspaces/pagination/Interfaces.ts b/clients/client-workspaces/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-workspaces/pagination/Interfaces.ts rename to clients/client-workspaces/src/pagination/Interfaces.ts diff --git a/clients/client-workspaces/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts similarity index 100% rename from clients/client-workspaces/protocols/Aws_json1_1.ts rename to clients/client-workspaces/src/protocols/Aws_json1_1.ts diff --git a/clients/client-workspaces/src/runtimeConfig.browser.ts b/clients/client-workspaces/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a0676dbbd513 --- /dev/null +++ b/clients/client-workspaces/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { WorkSpacesClientConfig } from "./WorkSpacesClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workspaces/runtimeConfig.native.ts b/clients/client-workspaces/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-workspaces/runtimeConfig.native.ts rename to clients/client-workspaces/src/runtimeConfig.native.ts diff --git a/clients/client-workspaces/runtimeConfig.shared.ts b/clients/client-workspaces/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-workspaces/runtimeConfig.shared.ts rename to clients/client-workspaces/src/runtimeConfig.shared.ts diff --git a/clients/client-workspaces/src/runtimeConfig.ts b/clients/client-workspaces/src/runtimeConfig.ts new file mode 100644 index 000000000000..0f157d20d1be --- /dev/null +++ b/clients/client-workspaces/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { WorkSpacesClientConfig } from "./WorkSpacesClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-workspaces/tsconfig.es.json b/clients/client-workspaces/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-workspaces/tsconfig.es.json +++ b/clients/client-workspaces/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-workspaces/tsconfig.json b/clients/client-workspaces/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-workspaces/tsconfig.json +++ b/clients/client-workspaces/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-workspaces/tsconfig.types.json b/clients/client-workspaces/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-workspaces/tsconfig.types.json +++ b/clients/client-workspaces/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/clients/client-xray/.gitignore b/clients/client-xray/.gitignore index 243d61024162..1a76554918be 100644 --- a/clients/client-xray/.gitignore +++ b/clients/client-xray/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/clients/client-xray/package.json b/clients/client-xray/package.json index 4f413422b124..d3abb41b32fb 100644 --- a/clients/client-xray/package.json +++ b/clients/client-xray/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "exit 0" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -72,8 +66,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -82,6 +76,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-xray", "repository": { "type": "git", diff --git a/clients/client-xray/runtimeConfig.browser.ts b/clients/client-xray/runtimeConfig.browser.ts deleted file mode 100644 index 541b9a7eb487..000000000000 --- a/clients/client-xray/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { XRayClientConfig } from "./XRayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: XRayClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-xray/runtimeConfig.ts b/clients/client-xray/runtimeConfig.ts deleted file mode 100644 index 4d8f3acd67c0..000000000000 --- a/clients/client-xray/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { XRayClientConfig } from "./XRayClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: XRayClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/clients/client-xray/XRay.ts b/clients/client-xray/src/XRay.ts similarity index 100% rename from clients/client-xray/XRay.ts rename to clients/client-xray/src/XRay.ts diff --git a/clients/client-xray/XRayClient.ts b/clients/client-xray/src/XRayClient.ts similarity index 100% rename from clients/client-xray/XRayClient.ts rename to clients/client-xray/src/XRayClient.ts diff --git a/clients/client-xray/commands/BatchGetTracesCommand.ts b/clients/client-xray/src/commands/BatchGetTracesCommand.ts similarity index 100% rename from clients/client-xray/commands/BatchGetTracesCommand.ts rename to clients/client-xray/src/commands/BatchGetTracesCommand.ts diff --git a/clients/client-xray/commands/CreateGroupCommand.ts b/clients/client-xray/src/commands/CreateGroupCommand.ts similarity index 100% rename from clients/client-xray/commands/CreateGroupCommand.ts rename to clients/client-xray/src/commands/CreateGroupCommand.ts diff --git a/clients/client-xray/commands/CreateSamplingRuleCommand.ts b/clients/client-xray/src/commands/CreateSamplingRuleCommand.ts similarity index 100% rename from clients/client-xray/commands/CreateSamplingRuleCommand.ts rename to clients/client-xray/src/commands/CreateSamplingRuleCommand.ts diff --git a/clients/client-xray/commands/DeleteGroupCommand.ts b/clients/client-xray/src/commands/DeleteGroupCommand.ts similarity index 100% rename from clients/client-xray/commands/DeleteGroupCommand.ts rename to clients/client-xray/src/commands/DeleteGroupCommand.ts diff --git a/clients/client-xray/commands/DeleteSamplingRuleCommand.ts b/clients/client-xray/src/commands/DeleteSamplingRuleCommand.ts similarity index 100% rename from clients/client-xray/commands/DeleteSamplingRuleCommand.ts rename to clients/client-xray/src/commands/DeleteSamplingRuleCommand.ts diff --git a/clients/client-xray/commands/GetEncryptionConfigCommand.ts b/clients/client-xray/src/commands/GetEncryptionConfigCommand.ts similarity index 100% rename from clients/client-xray/commands/GetEncryptionConfigCommand.ts rename to clients/client-xray/src/commands/GetEncryptionConfigCommand.ts diff --git a/clients/client-xray/commands/GetGroupCommand.ts b/clients/client-xray/src/commands/GetGroupCommand.ts similarity index 100% rename from clients/client-xray/commands/GetGroupCommand.ts rename to clients/client-xray/src/commands/GetGroupCommand.ts diff --git a/clients/client-xray/commands/GetGroupsCommand.ts b/clients/client-xray/src/commands/GetGroupsCommand.ts similarity index 100% rename from clients/client-xray/commands/GetGroupsCommand.ts rename to clients/client-xray/src/commands/GetGroupsCommand.ts diff --git a/clients/client-xray/commands/GetInsightCommand.ts b/clients/client-xray/src/commands/GetInsightCommand.ts similarity index 100% rename from clients/client-xray/commands/GetInsightCommand.ts rename to clients/client-xray/src/commands/GetInsightCommand.ts diff --git a/clients/client-xray/commands/GetInsightEventsCommand.ts b/clients/client-xray/src/commands/GetInsightEventsCommand.ts similarity index 100% rename from clients/client-xray/commands/GetInsightEventsCommand.ts rename to clients/client-xray/src/commands/GetInsightEventsCommand.ts diff --git a/clients/client-xray/commands/GetInsightImpactGraphCommand.ts b/clients/client-xray/src/commands/GetInsightImpactGraphCommand.ts similarity index 100% rename from clients/client-xray/commands/GetInsightImpactGraphCommand.ts rename to clients/client-xray/src/commands/GetInsightImpactGraphCommand.ts diff --git a/clients/client-xray/commands/GetInsightSummariesCommand.ts b/clients/client-xray/src/commands/GetInsightSummariesCommand.ts similarity index 100% rename from clients/client-xray/commands/GetInsightSummariesCommand.ts rename to clients/client-xray/src/commands/GetInsightSummariesCommand.ts diff --git a/clients/client-xray/commands/GetSamplingRulesCommand.ts b/clients/client-xray/src/commands/GetSamplingRulesCommand.ts similarity index 100% rename from clients/client-xray/commands/GetSamplingRulesCommand.ts rename to clients/client-xray/src/commands/GetSamplingRulesCommand.ts diff --git a/clients/client-xray/commands/GetSamplingStatisticSummariesCommand.ts b/clients/client-xray/src/commands/GetSamplingStatisticSummariesCommand.ts similarity index 100% rename from clients/client-xray/commands/GetSamplingStatisticSummariesCommand.ts rename to clients/client-xray/src/commands/GetSamplingStatisticSummariesCommand.ts diff --git a/clients/client-xray/commands/GetSamplingTargetsCommand.ts b/clients/client-xray/src/commands/GetSamplingTargetsCommand.ts similarity index 100% rename from clients/client-xray/commands/GetSamplingTargetsCommand.ts rename to clients/client-xray/src/commands/GetSamplingTargetsCommand.ts diff --git a/clients/client-xray/commands/GetServiceGraphCommand.ts b/clients/client-xray/src/commands/GetServiceGraphCommand.ts similarity index 100% rename from clients/client-xray/commands/GetServiceGraphCommand.ts rename to clients/client-xray/src/commands/GetServiceGraphCommand.ts diff --git a/clients/client-xray/commands/GetTimeSeriesServiceStatisticsCommand.ts b/clients/client-xray/src/commands/GetTimeSeriesServiceStatisticsCommand.ts similarity index 100% rename from clients/client-xray/commands/GetTimeSeriesServiceStatisticsCommand.ts rename to clients/client-xray/src/commands/GetTimeSeriesServiceStatisticsCommand.ts diff --git a/clients/client-xray/commands/GetTraceGraphCommand.ts b/clients/client-xray/src/commands/GetTraceGraphCommand.ts similarity index 100% rename from clients/client-xray/commands/GetTraceGraphCommand.ts rename to clients/client-xray/src/commands/GetTraceGraphCommand.ts diff --git a/clients/client-xray/commands/GetTraceSummariesCommand.ts b/clients/client-xray/src/commands/GetTraceSummariesCommand.ts similarity index 100% rename from clients/client-xray/commands/GetTraceSummariesCommand.ts rename to clients/client-xray/src/commands/GetTraceSummariesCommand.ts diff --git a/clients/client-xray/commands/ListTagsForResourceCommand.ts b/clients/client-xray/src/commands/ListTagsForResourceCommand.ts similarity index 100% rename from clients/client-xray/commands/ListTagsForResourceCommand.ts rename to clients/client-xray/src/commands/ListTagsForResourceCommand.ts diff --git a/clients/client-xray/commands/PutEncryptionConfigCommand.ts b/clients/client-xray/src/commands/PutEncryptionConfigCommand.ts similarity index 100% rename from clients/client-xray/commands/PutEncryptionConfigCommand.ts rename to clients/client-xray/src/commands/PutEncryptionConfigCommand.ts diff --git a/clients/client-xray/commands/PutTelemetryRecordsCommand.ts b/clients/client-xray/src/commands/PutTelemetryRecordsCommand.ts similarity index 100% rename from clients/client-xray/commands/PutTelemetryRecordsCommand.ts rename to clients/client-xray/src/commands/PutTelemetryRecordsCommand.ts diff --git a/clients/client-xray/commands/PutTraceSegmentsCommand.ts b/clients/client-xray/src/commands/PutTraceSegmentsCommand.ts similarity index 100% rename from clients/client-xray/commands/PutTraceSegmentsCommand.ts rename to clients/client-xray/src/commands/PutTraceSegmentsCommand.ts diff --git a/clients/client-xray/commands/TagResourceCommand.ts b/clients/client-xray/src/commands/TagResourceCommand.ts similarity index 100% rename from clients/client-xray/commands/TagResourceCommand.ts rename to clients/client-xray/src/commands/TagResourceCommand.ts diff --git a/clients/client-xray/commands/UntagResourceCommand.ts b/clients/client-xray/src/commands/UntagResourceCommand.ts similarity index 100% rename from clients/client-xray/commands/UntagResourceCommand.ts rename to clients/client-xray/src/commands/UntagResourceCommand.ts diff --git a/clients/client-xray/commands/UpdateGroupCommand.ts b/clients/client-xray/src/commands/UpdateGroupCommand.ts similarity index 100% rename from clients/client-xray/commands/UpdateGroupCommand.ts rename to clients/client-xray/src/commands/UpdateGroupCommand.ts diff --git a/clients/client-xray/commands/UpdateSamplingRuleCommand.ts b/clients/client-xray/src/commands/UpdateSamplingRuleCommand.ts similarity index 100% rename from clients/client-xray/commands/UpdateSamplingRuleCommand.ts rename to clients/client-xray/src/commands/UpdateSamplingRuleCommand.ts diff --git a/clients/client-xray/endpoints.ts b/clients/client-xray/src/endpoints.ts similarity index 100% rename from clients/client-xray/endpoints.ts rename to clients/client-xray/src/endpoints.ts diff --git a/clients/client-xray/index.ts b/clients/client-xray/src/index.ts similarity index 100% rename from clients/client-xray/index.ts rename to clients/client-xray/src/index.ts diff --git a/clients/client-xray/models/index.ts b/clients/client-xray/src/models/index.ts similarity index 100% rename from clients/client-xray/models/index.ts rename to clients/client-xray/src/models/index.ts diff --git a/clients/client-xray/models/models_0.ts b/clients/client-xray/src/models/models_0.ts similarity index 100% rename from clients/client-xray/models/models_0.ts rename to clients/client-xray/src/models/models_0.ts diff --git a/clients/client-xray/pagination/BatchGetTracesPaginator.ts b/clients/client-xray/src/pagination/BatchGetTracesPaginator.ts similarity index 100% rename from clients/client-xray/pagination/BatchGetTracesPaginator.ts rename to clients/client-xray/src/pagination/BatchGetTracesPaginator.ts diff --git a/clients/client-xray/pagination/GetGroupsPaginator.ts b/clients/client-xray/src/pagination/GetGroupsPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetGroupsPaginator.ts rename to clients/client-xray/src/pagination/GetGroupsPaginator.ts diff --git a/clients/client-xray/pagination/GetInsightEventsPaginator.ts b/clients/client-xray/src/pagination/GetInsightEventsPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetInsightEventsPaginator.ts rename to clients/client-xray/src/pagination/GetInsightEventsPaginator.ts diff --git a/clients/client-xray/pagination/GetInsightSummariesPaginator.ts b/clients/client-xray/src/pagination/GetInsightSummariesPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetInsightSummariesPaginator.ts rename to clients/client-xray/src/pagination/GetInsightSummariesPaginator.ts diff --git a/clients/client-xray/pagination/GetSamplingRulesPaginator.ts b/clients/client-xray/src/pagination/GetSamplingRulesPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetSamplingRulesPaginator.ts rename to clients/client-xray/src/pagination/GetSamplingRulesPaginator.ts diff --git a/clients/client-xray/pagination/GetSamplingStatisticSummariesPaginator.ts b/clients/client-xray/src/pagination/GetSamplingStatisticSummariesPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetSamplingStatisticSummariesPaginator.ts rename to clients/client-xray/src/pagination/GetSamplingStatisticSummariesPaginator.ts diff --git a/clients/client-xray/pagination/GetServiceGraphPaginator.ts b/clients/client-xray/src/pagination/GetServiceGraphPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetServiceGraphPaginator.ts rename to clients/client-xray/src/pagination/GetServiceGraphPaginator.ts diff --git a/clients/client-xray/pagination/GetTimeSeriesServiceStatisticsPaginator.ts b/clients/client-xray/src/pagination/GetTimeSeriesServiceStatisticsPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetTimeSeriesServiceStatisticsPaginator.ts rename to clients/client-xray/src/pagination/GetTimeSeriesServiceStatisticsPaginator.ts diff --git a/clients/client-xray/pagination/GetTraceGraphPaginator.ts b/clients/client-xray/src/pagination/GetTraceGraphPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetTraceGraphPaginator.ts rename to clients/client-xray/src/pagination/GetTraceGraphPaginator.ts diff --git a/clients/client-xray/pagination/GetTraceSummariesPaginator.ts b/clients/client-xray/src/pagination/GetTraceSummariesPaginator.ts similarity index 100% rename from clients/client-xray/pagination/GetTraceSummariesPaginator.ts rename to clients/client-xray/src/pagination/GetTraceSummariesPaginator.ts diff --git a/clients/client-xray/pagination/Interfaces.ts b/clients/client-xray/src/pagination/Interfaces.ts similarity index 100% rename from clients/client-xray/pagination/Interfaces.ts rename to clients/client-xray/src/pagination/Interfaces.ts diff --git a/clients/client-xray/protocols/Aws_restJson1.ts b/clients/client-xray/src/protocols/Aws_restJson1.ts similarity index 100% rename from clients/client-xray/protocols/Aws_restJson1.ts rename to clients/client-xray/src/protocols/Aws_restJson1.ts diff --git a/clients/client-xray/src/runtimeConfig.browser.ts b/clients/client-xray/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..3890fe91be15 --- /dev/null +++ b/clients/client-xray/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { XRayClientConfig } from "./XRayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: XRayClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-xray/runtimeConfig.native.ts b/clients/client-xray/src/runtimeConfig.native.ts similarity index 100% rename from clients/client-xray/runtimeConfig.native.ts rename to clients/client-xray/src/runtimeConfig.native.ts diff --git a/clients/client-xray/runtimeConfig.shared.ts b/clients/client-xray/src/runtimeConfig.shared.ts similarity index 100% rename from clients/client-xray/runtimeConfig.shared.ts rename to clients/client-xray/src/runtimeConfig.shared.ts diff --git a/clients/client-xray/src/runtimeConfig.ts b/clients/client-xray/src/runtimeConfig.ts new file mode 100644 index 000000000000..4ec858585cdb --- /dev/null +++ b/clients/client-xray/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { XRayClientConfig } from "./XRayClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: XRayClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-xray/tsconfig.es.json b/clients/client-xray/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/clients/client-xray/tsconfig.es.json +++ b/clients/client-xray/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/clients/client-xray/tsconfig.json b/clients/client-xray/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/clients/client-xray/tsconfig.json +++ b/clients/client-xray/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/clients/client-xray/tsconfig.types.json b/clients/client-xray/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/clients/client-xray/tsconfig.types.json +++ b/clients/client-xray/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts index 57903474ed56..79298c457739 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.spec.ts @@ -21,11 +21,11 @@ import type { AssumeRoleCommandInput } from "../src/commands/AssumeRoleCommand"; import { AssumeRoleWithWebIdentityCommandInput } from "../src/commands/AssumeRoleWithWebIdentityCommand"; import { getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity } from "../src/defaultRoleAssumers"; const mockConstructorInput = jest.fn(); -jest.mock("./STSClient", () => ({ +jest.mock("../src/STSClient", () => ({ STSClient: function (params: any) { mockConstructorInput(params); //@ts-ignore - return new (jest.requireActual("./STSClient").STSClient)(params); + return new (jest.requireActual("../src/STSClient").STSClient)(params); }, })); diff --git a/package.json b/package.json index 8c7a9c1e9a6c..8545973cf4ca 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "strip-comments": "2.0.1", "ts-jest": "^26.4.1", "ts-loader": "^7.0.5", + "ts-mocha": "8.0.0", "typedoc-plugin-lerna-packages": "^0.3.1", "typescript": "~4.3.5", "verdaccio": "^4.7.2", diff --git a/protocol_tests/aws-ec2/.gitignore b/protocol_tests/aws-ec2/.gitignore index 1e9d1ff41af8..619adfbf932a 100644 --- a/protocol_tests/aws-ec2/.gitignore +++ b/protocol_tests/aws-ec2/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-ec2/package.json b/protocol_tests/aws-ec2/package.json index 4d0ba54e5214..9b0c6a76d2df 100644 --- a/protocol_tests/aws-ec2/package.json +++ b/protocol_tests/aws-ec2/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-ec2", "repository": { diff --git a/protocol_tests/aws-ec2/runtimeConfig.browser.ts b/protocol_tests/aws-ec2/runtimeConfig.browser.ts deleted file mode 100644 index 71c05870f8d1..000000000000 --- a/protocol_tests/aws-ec2/runtimeConfig.browser.ts +++ /dev/null @@ -1,36 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-ec2/runtimeConfig.ts b/protocol_tests/aws-ec2/runtimeConfig.ts deleted file mode 100644 index 55635bfa60b6..000000000000 --- a/protocol_tests/aws-ec2/runtimeConfig.ts +++ /dev/null @@ -1,39 +0,0 @@ -import packageInfo from "./package.json"; - -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-ec2/EC2Protocol.ts b/protocol_tests/aws-ec2/src/EC2Protocol.ts similarity index 100% rename from protocol_tests/aws-ec2/EC2Protocol.ts rename to protocol_tests/aws-ec2/src/EC2Protocol.ts diff --git a/protocol_tests/aws-ec2/EC2ProtocolClient.ts b/protocol_tests/aws-ec2/src/EC2ProtocolClient.ts similarity index 100% rename from protocol_tests/aws-ec2/EC2ProtocolClient.ts rename to protocol_tests/aws-ec2/src/EC2ProtocolClient.ts diff --git a/protocol_tests/aws-ec2/commands/EmptyInputAndEmptyOutputCommand.ts b/protocol_tests/aws-ec2/src/commands/EmptyInputAndEmptyOutputCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/EmptyInputAndEmptyOutputCommand.ts rename to protocol_tests/aws-ec2/src/commands/EmptyInputAndEmptyOutputCommand.ts diff --git a/protocol_tests/aws-ec2/commands/EndpointOperationCommand.ts b/protocol_tests/aws-ec2/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-ec2/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-ec2/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-ec2/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-ec2/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-ec2/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-ec2/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-ec2/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/IgnoresWrappingXmlNameCommand.ts b/protocol_tests/aws-ec2/src/commands/IgnoresWrappingXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/IgnoresWrappingXmlNameCommand.ts rename to protocol_tests/aws-ec2/src/commands/IgnoresWrappingXmlNameCommand.ts diff --git a/protocol_tests/aws-ec2/commands/NestedStructuresCommand.ts b/protocol_tests/aws-ec2/src/commands/NestedStructuresCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/NestedStructuresCommand.ts rename to protocol_tests/aws-ec2/src/commands/NestedStructuresCommand.ts diff --git a/protocol_tests/aws-ec2/commands/NoInputAndOutputCommand.ts b/protocol_tests/aws-ec2/src/commands/NoInputAndOutputCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/NoInputAndOutputCommand.ts rename to protocol_tests/aws-ec2/src/commands/NoInputAndOutputCommand.ts diff --git a/protocol_tests/aws-ec2/commands/QueryIdempotencyTokenAutoFillCommand.ts b/protocol_tests/aws-ec2/src/commands/QueryIdempotencyTokenAutoFillCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/QueryIdempotencyTokenAutoFillCommand.ts rename to protocol_tests/aws-ec2/src/commands/QueryIdempotencyTokenAutoFillCommand.ts diff --git a/protocol_tests/aws-ec2/commands/QueryListsCommand.ts b/protocol_tests/aws-ec2/src/commands/QueryListsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/QueryListsCommand.ts rename to protocol_tests/aws-ec2/src/commands/QueryListsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/QueryTimestampsCommand.ts b/protocol_tests/aws-ec2/src/commands/QueryTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/QueryTimestampsCommand.ts rename to protocol_tests/aws-ec2/src/commands/QueryTimestampsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/RecursiveXmlShapesCommand.ts b/protocol_tests/aws-ec2/src/commands/RecursiveXmlShapesCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/RecursiveXmlShapesCommand.ts rename to protocol_tests/aws-ec2/src/commands/RecursiveXmlShapesCommand.ts diff --git a/protocol_tests/aws-ec2/commands/SimpleInputParamsCommand.ts b/protocol_tests/aws-ec2/src/commands/SimpleInputParamsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/SimpleInputParamsCommand.ts rename to protocol_tests/aws-ec2/src/commands/SimpleInputParamsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/SimpleScalarXmlPropertiesCommand.ts b/protocol_tests/aws-ec2/src/commands/SimpleScalarXmlPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/SimpleScalarXmlPropertiesCommand.ts rename to protocol_tests/aws-ec2/src/commands/SimpleScalarXmlPropertiesCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlBlobsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlBlobsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlBlobsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlEmptyBlobsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlEmptyBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlEmptyBlobsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlEmptyBlobsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlEmptyListsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlEmptyListsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlEmptyListsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlEmptyListsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlEnumsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlEnumsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlEnumsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlEnumsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlListsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlListsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlListsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlListsCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlNamespacesCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlNamespacesCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlNamespacesCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlNamespacesCommand.ts diff --git a/protocol_tests/aws-ec2/commands/XmlTimestampsCommand.ts b/protocol_tests/aws-ec2/src/commands/XmlTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-ec2/commands/XmlTimestampsCommand.ts rename to protocol_tests/aws-ec2/src/commands/XmlTimestampsCommand.ts diff --git a/protocol_tests/aws-ec2/endpoints.ts b/protocol_tests/aws-ec2/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-ec2/endpoints.ts rename to protocol_tests/aws-ec2/src/endpoints.ts diff --git a/protocol_tests/aws-ec2/index.ts b/protocol_tests/aws-ec2/src/index.ts similarity index 100% rename from protocol_tests/aws-ec2/index.ts rename to protocol_tests/aws-ec2/src/index.ts diff --git a/protocol_tests/aws-ec2/models/index.ts b/protocol_tests/aws-ec2/src/models/index.ts similarity index 100% rename from protocol_tests/aws-ec2/models/index.ts rename to protocol_tests/aws-ec2/src/models/index.ts diff --git a/protocol_tests/aws-ec2/models/models_0.ts b/protocol_tests/aws-ec2/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-ec2/models/models_0.ts rename to protocol_tests/aws-ec2/src/models/models_0.ts diff --git a/protocol_tests/aws-ec2/protocols/Aws_ec2.ts b/protocol_tests/aws-ec2/src/protocols/Aws_ec2.ts similarity index 100% rename from protocol_tests/aws-ec2/protocols/Aws_ec2.ts rename to protocol_tests/aws-ec2/src/protocols/Aws_ec2.ts diff --git a/protocol_tests/aws-ec2/src/runtimeConfig.browser.ts b/protocol_tests/aws-ec2/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..be84df94ae6b --- /dev/null +++ b/protocol_tests/aws-ec2/src/runtimeConfig.browser.ts @@ -0,0 +1,37 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-ec2/runtimeConfig.native.ts b/protocol_tests/aws-ec2/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-ec2/runtimeConfig.native.ts rename to protocol_tests/aws-ec2/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-ec2/runtimeConfig.shared.ts b/protocol_tests/aws-ec2/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-ec2/runtimeConfig.shared.ts rename to protocol_tests/aws-ec2/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-ec2/src/runtimeConfig.ts b/protocol_tests/aws-ec2/src/runtimeConfig.ts new file mode 100644 index 000000000000..9ef40ef7dfe0 --- /dev/null +++ b/protocol_tests/aws-ec2/src/runtimeConfig.ts @@ -0,0 +1,40 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { EC2ProtocolClientConfig } from "./EC2ProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-ec2/tests/functional/ec2query.spec.ts b/protocol_tests/aws-ec2/test/functional/ec2query.spec.ts similarity index 97% rename from protocol_tests/aws-ec2/tests/functional/ec2query.spec.ts rename to protocol_tests/aws-ec2/test/functional/ec2query.spec.ts index aa3d80b56544..2551006d953d 100644 --- a/protocol_tests/aws-ec2/tests/functional/ec2query.spec.ts +++ b/protocol_tests/aws-ec2/test/functional/ec2query.spec.ts @@ -1,25 +1,25 @@ -import { EC2ProtocolClient } from "../../EC2ProtocolClient"; -import { EmptyInputAndEmptyOutputCommand } from "../../commands/EmptyInputAndEmptyOutputCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { IgnoresWrappingXmlNameCommand } from "../../commands/IgnoresWrappingXmlNameCommand"; -import { NestedStructuresCommand } from "../../commands/NestedStructuresCommand"; -import { NoInputAndOutputCommand } from "../../commands/NoInputAndOutputCommand"; -import { QueryIdempotencyTokenAutoFillCommand } from "../../commands/QueryIdempotencyTokenAutoFillCommand"; -import { QueryListsCommand } from "../../commands/QueryListsCommand"; -import { QueryTimestampsCommand } from "../../commands/QueryTimestampsCommand"; -import { RecursiveXmlShapesCommand } from "../../commands/RecursiveXmlShapesCommand"; -import { SimpleInputParamsCommand } from "../../commands/SimpleInputParamsCommand"; -import { SimpleScalarXmlPropertiesCommand } from "../../commands/SimpleScalarXmlPropertiesCommand"; -import { XmlBlobsCommand } from "../../commands/XmlBlobsCommand"; -import { XmlEmptyBlobsCommand } from "../../commands/XmlEmptyBlobsCommand"; -import { XmlEmptyListsCommand } from "../../commands/XmlEmptyListsCommand"; -import { XmlEnumsCommand } from "../../commands/XmlEnumsCommand"; -import { XmlListsCommand } from "../../commands/XmlListsCommand"; -import { XmlNamespacesCommand } from "../../commands/XmlNamespacesCommand"; -import { XmlTimestampsCommand } from "../../commands/XmlTimestampsCommand"; -import { ComplexError, InvalidGreeting } from "../../models/models_0"; +import { EC2ProtocolClient } from "../../src/EC2ProtocolClient"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { IgnoresWrappingXmlNameCommand } from "../../src/commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommand } from "../../src/commands/NestedStructuresCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand } from "../../src/commands/QueryListsCommand"; +import { QueryTimestampsCommand } from "../../src/commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommand } from "../../src/commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommand } from "../../src/commands/SimpleInputParamsCommand"; +import { SimpleScalarXmlPropertiesCommand } from "../../src/commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { ComplexError, InvalidGreeting } from "../../src/models/models_0"; import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types"; import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; import { Readable } from "stream"; diff --git a/protocol_tests/aws-ec2/tsconfig.es.json b/protocol_tests/aws-ec2/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-ec2/tsconfig.es.json +++ b/protocol_tests/aws-ec2/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-ec2/tsconfig.json b/protocol_tests/aws-ec2/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-ec2/tsconfig.json +++ b/protocol_tests/aws-ec2/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-ec2/tsconfig.types.json b/protocol_tests/aws-ec2/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-ec2/tsconfig.types.json +++ b/protocol_tests/aws-ec2/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/protocol_tests/aws-json-10/.gitignore b/protocol_tests/aws-json-10/.gitignore index 5f8b6ab5eab2..54f14c9aef25 100644 --- a/protocol_tests/aws-json-10/.gitignore +++ b/protocol_tests/aws-json-10/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-json-10/package.json b/protocol_tests/aws-json-10/package.json index 719bdec55781..bfbf38458d04 100644 --- a/protocol_tests/aws-json-10/package.json +++ b/protocol_tests/aws-json-10/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.1.0", @@ -71,8 +65,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -81,6 +75,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-json-10", "repository": { diff --git a/protocol_tests/aws-json-10/runtimeConfig.browser.ts b/protocol_tests/aws-json-10/runtimeConfig.browser.ts deleted file mode 100644 index baaf1d36e7b1..000000000000 --- a/protocol_tests/aws-json-10/runtimeConfig.browser.ts +++ /dev/null @@ -1,36 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-json-10/runtimeConfig.ts b/protocol_tests/aws-json-10/runtimeConfig.ts deleted file mode 100644 index 69b1c6f5a72f..000000000000 --- a/protocol_tests/aws-json-10/runtimeConfig.ts +++ /dev/null @@ -1,39 +0,0 @@ -import packageInfo from "./package.json"; - -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-json-10/JSONRPC10.ts b/protocol_tests/aws-json-10/src/JSONRPC10.ts similarity index 100% rename from protocol_tests/aws-json-10/JSONRPC10.ts rename to protocol_tests/aws-json-10/src/JSONRPC10.ts diff --git a/protocol_tests/aws-json-10/JSONRPC10Client.ts b/protocol_tests/aws-json-10/src/JSONRPC10Client.ts similarity index 100% rename from protocol_tests/aws-json-10/JSONRPC10Client.ts rename to protocol_tests/aws-json-10/src/JSONRPC10Client.ts diff --git a/protocol_tests/aws-json-10/commands/EmptyInputAndEmptyOutputCommand.ts b/protocol_tests/aws-json-10/src/commands/EmptyInputAndEmptyOutputCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/EmptyInputAndEmptyOutputCommand.ts rename to protocol_tests/aws-json-10/src/commands/EmptyInputAndEmptyOutputCommand.ts diff --git a/protocol_tests/aws-json-10/commands/EndpointOperationCommand.ts b/protocol_tests/aws-json-10/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-json-10/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-json-10/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-json-10/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-json-10/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-json-10/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-json-10/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-json-10/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-json-10/commands/JsonUnionsCommand.ts b/protocol_tests/aws-json-10/src/commands/JsonUnionsCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/JsonUnionsCommand.ts rename to protocol_tests/aws-json-10/src/commands/JsonUnionsCommand.ts diff --git a/protocol_tests/aws-json-10/commands/NoInputAndNoOutputCommand.ts b/protocol_tests/aws-json-10/src/commands/NoInputAndNoOutputCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/NoInputAndNoOutputCommand.ts rename to protocol_tests/aws-json-10/src/commands/NoInputAndNoOutputCommand.ts diff --git a/protocol_tests/aws-json-10/commands/NoInputAndOutputCommand.ts b/protocol_tests/aws-json-10/src/commands/NoInputAndOutputCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/NoInputAndOutputCommand.ts rename to protocol_tests/aws-json-10/src/commands/NoInputAndOutputCommand.ts diff --git a/protocol_tests/aws-json-10/commands/SimpleScalarPropertiesCommand.ts b/protocol_tests/aws-json-10/src/commands/SimpleScalarPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-json-10/commands/SimpleScalarPropertiesCommand.ts rename to protocol_tests/aws-json-10/src/commands/SimpleScalarPropertiesCommand.ts diff --git a/protocol_tests/aws-json-10/endpoints.ts b/protocol_tests/aws-json-10/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-json-10/endpoints.ts rename to protocol_tests/aws-json-10/src/endpoints.ts diff --git a/protocol_tests/aws-json-10/index.ts b/protocol_tests/aws-json-10/src/index.ts similarity index 100% rename from protocol_tests/aws-json-10/index.ts rename to protocol_tests/aws-json-10/src/index.ts diff --git a/protocol_tests/aws-json-10/models/index.ts b/protocol_tests/aws-json-10/src/models/index.ts similarity index 100% rename from protocol_tests/aws-json-10/models/index.ts rename to protocol_tests/aws-json-10/src/models/index.ts diff --git a/protocol_tests/aws-json-10/models/models_0.ts b/protocol_tests/aws-json-10/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-json-10/models/models_0.ts rename to protocol_tests/aws-json-10/src/models/models_0.ts diff --git a/protocol_tests/aws-json-10/protocols/Aws_json1_0.ts b/protocol_tests/aws-json-10/src/protocols/Aws_json1_0.ts similarity index 100% rename from protocol_tests/aws-json-10/protocols/Aws_json1_0.ts rename to protocol_tests/aws-json-10/src/protocols/Aws_json1_0.ts diff --git a/protocol_tests/aws-json-10/src/runtimeConfig.browser.ts b/protocol_tests/aws-json-10/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..b7da05c257d2 --- /dev/null +++ b/protocol_tests/aws-json-10/src/runtimeConfig.browser.ts @@ -0,0 +1,37 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-json-10/runtimeConfig.native.ts b/protocol_tests/aws-json-10/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-json-10/runtimeConfig.native.ts rename to protocol_tests/aws-json-10/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-json-10/runtimeConfig.shared.ts b/protocol_tests/aws-json-10/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-json-10/runtimeConfig.shared.ts rename to protocol_tests/aws-json-10/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-json-10/src/runtimeConfig.ts b/protocol_tests/aws-json-10/src/runtimeConfig.ts new file mode 100644 index 000000000000..572ed8d0c887 --- /dev/null +++ b/protocol_tests/aws-json-10/src/runtimeConfig.ts @@ -0,0 +1,40 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { JSONRPC10ClientConfig } from "./JSONRPC10Client"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-json-10/tests/functional/awsjson1_0.spec.ts b/protocol_tests/aws-json-10/test/functional/awsjson1_0.spec.ts similarity index 98% rename from protocol_tests/aws-json-10/tests/functional/awsjson1_0.spec.ts rename to protocol_tests/aws-json-10/test/functional/awsjson1_0.spec.ts index 17b306a5a718..0a254d6a4e32 100644 --- a/protocol_tests/aws-json-10/tests/functional/awsjson1_0.spec.ts +++ b/protocol_tests/aws-json-10/test/functional/awsjson1_0.spec.ts @@ -1,13 +1,13 @@ -import { JSONRPC10Client } from "../../JSONRPC10Client"; -import { EmptyInputAndEmptyOutputCommand } from "../../commands/EmptyInputAndEmptyOutputCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { JsonUnionsCommand } from "../../commands/JsonUnionsCommand"; -import { NoInputAndNoOutputCommand } from "../../commands/NoInputAndNoOutputCommand"; -import { NoInputAndOutputCommand } from "../../commands/NoInputAndOutputCommand"; -import { SimpleScalarPropertiesCommand } from "../../commands/SimpleScalarPropertiesCommand"; -import { ComplexError, FooError, InvalidGreeting } from "../../models/models_0"; +import { JSONRPC10Client } from "../../src/JSONRPC10Client"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0"; import { Encoder as __Encoder } from "@aws-sdk/types"; import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types"; import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; diff --git a/protocol_tests/aws-json-10/tsconfig.es.json b/protocol_tests/aws-json-10/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-json-10/tsconfig.es.json +++ b/protocol_tests/aws-json-10/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-json-10/tsconfig.json b/protocol_tests/aws-json-10/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-json-10/tsconfig.json +++ b/protocol_tests/aws-json-10/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-json-10/tsconfig.types.json b/protocol_tests/aws-json-10/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-json-10/tsconfig.types.json +++ b/protocol_tests/aws-json-10/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/protocol_tests/aws-json/.gitignore b/protocol_tests/aws-json/.gitignore index 1e9d1ff41af8..619adfbf932a 100644 --- a/protocol_tests/aws-json/.gitignore +++ b/protocol_tests/aws-json/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-json/package.json b/protocol_tests/aws-json/package.json index 8710467a5b04..f7193a11b54c 100644 --- a/protocol_tests/aws-json/package.json +++ b/protocol_tests/aws-json/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -74,8 +68,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -84,6 +78,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-json", "repository": { diff --git a/protocol_tests/aws-json/runtimeConfig.browser.ts b/protocol_tests/aws-json/runtimeConfig.browser.ts deleted file mode 100644 index 6b630c709c5d..000000000000 --- a/protocol_tests/aws-json/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { invalidProvider } from "@aws-sdk/invalid-dependency"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { JsonProtocolClientConfig } from "./JsonProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - region: config?.region ?? invalidProvider("Region is missing"), - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-json/runtimeConfig.ts b/protocol_tests/aws-json/runtimeConfig.ts deleted file mode 100644 index 55e674f35efb..000000000000 --- a/protocol_tests/aws-json/runtimeConfig.ts +++ /dev/null @@ -1,45 +0,0 @@ -import packageInfo from "./package.json"; - -import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; -import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; -import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { JsonProtocolClientConfig } from "./JsonProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - credentialDefaultProvider: - config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-json/JsonProtocol.ts b/protocol_tests/aws-json/src/JsonProtocol.ts similarity index 100% rename from protocol_tests/aws-json/JsonProtocol.ts rename to protocol_tests/aws-json/src/JsonProtocol.ts diff --git a/protocol_tests/aws-json/JsonProtocolClient.ts b/protocol_tests/aws-json/src/JsonProtocolClient.ts similarity index 100% rename from protocol_tests/aws-json/JsonProtocolClient.ts rename to protocol_tests/aws-json/src/JsonProtocolClient.ts diff --git a/protocol_tests/aws-json/commands/EmptyOperationCommand.ts b/protocol_tests/aws-json/src/commands/EmptyOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/EmptyOperationCommand.ts rename to protocol_tests/aws-json/src/commands/EmptyOperationCommand.ts diff --git a/protocol_tests/aws-json/commands/EndpointOperationCommand.ts b/protocol_tests/aws-json/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-json/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-json/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-json/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-json/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-json/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-json/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-json/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-json/commands/JsonEnumsCommand.ts b/protocol_tests/aws-json/src/commands/JsonEnumsCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/JsonEnumsCommand.ts rename to protocol_tests/aws-json/src/commands/JsonEnumsCommand.ts diff --git a/protocol_tests/aws-json/commands/JsonUnionsCommand.ts b/protocol_tests/aws-json/src/commands/JsonUnionsCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/JsonUnionsCommand.ts rename to protocol_tests/aws-json/src/commands/JsonUnionsCommand.ts diff --git a/protocol_tests/aws-json/commands/KitchenSinkOperationCommand.ts b/protocol_tests/aws-json/src/commands/KitchenSinkOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/KitchenSinkOperationCommand.ts rename to protocol_tests/aws-json/src/commands/KitchenSinkOperationCommand.ts diff --git a/protocol_tests/aws-json/commands/NullOperationCommand.ts b/protocol_tests/aws-json/src/commands/NullOperationCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/NullOperationCommand.ts rename to protocol_tests/aws-json/src/commands/NullOperationCommand.ts diff --git a/protocol_tests/aws-json/commands/OperationWithOptionalInputOutputCommand.ts b/protocol_tests/aws-json/src/commands/OperationWithOptionalInputOutputCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/OperationWithOptionalInputOutputCommand.ts rename to protocol_tests/aws-json/src/commands/OperationWithOptionalInputOutputCommand.ts diff --git a/protocol_tests/aws-json/commands/PutAndGetInlineDocumentsCommand.ts b/protocol_tests/aws-json/src/commands/PutAndGetInlineDocumentsCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/PutAndGetInlineDocumentsCommand.ts rename to protocol_tests/aws-json/src/commands/PutAndGetInlineDocumentsCommand.ts diff --git a/protocol_tests/aws-json/commands/SimpleScalarPropertiesCommand.ts b/protocol_tests/aws-json/src/commands/SimpleScalarPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-json/commands/SimpleScalarPropertiesCommand.ts rename to protocol_tests/aws-json/src/commands/SimpleScalarPropertiesCommand.ts diff --git a/protocol_tests/aws-json/endpoints.ts b/protocol_tests/aws-json/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-json/endpoints.ts rename to protocol_tests/aws-json/src/endpoints.ts diff --git a/protocol_tests/aws-json/index.ts b/protocol_tests/aws-json/src/index.ts similarity index 100% rename from protocol_tests/aws-json/index.ts rename to protocol_tests/aws-json/src/index.ts diff --git a/protocol_tests/aws-json/models/index.ts b/protocol_tests/aws-json/src/models/index.ts similarity index 100% rename from protocol_tests/aws-json/models/index.ts rename to protocol_tests/aws-json/src/models/index.ts diff --git a/protocol_tests/aws-json/models/models_0.ts b/protocol_tests/aws-json/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-json/models/models_0.ts rename to protocol_tests/aws-json/src/models/models_0.ts diff --git a/protocol_tests/aws-json/protocols/Aws_json1_1.ts b/protocol_tests/aws-json/src/protocols/Aws_json1_1.ts similarity index 100% rename from protocol_tests/aws-json/protocols/Aws_json1_1.ts rename to protocol_tests/aws-json/src/protocols/Aws_json1_1.ts diff --git a/protocol_tests/aws-json/src/runtimeConfig.browser.ts b/protocol_tests/aws-json/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a85fc45c1a92 --- /dev/null +++ b/protocol_tests/aws-json/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { invalidProvider } from "@aws-sdk/invalid-dependency"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-json/runtimeConfig.native.ts b/protocol_tests/aws-json/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-json/runtimeConfig.native.ts rename to protocol_tests/aws-json/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-json/runtimeConfig.shared.ts b/protocol_tests/aws-json/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-json/runtimeConfig.shared.ts rename to protocol_tests/aws-json/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-json/src/runtimeConfig.ts b/protocol_tests/aws-json/src/runtimeConfig.ts new file mode 100644 index 000000000000..4ec0407b3d29 --- /dev/null +++ b/protocol_tests/aws-json/src/runtimeConfig.ts @@ -0,0 +1,46 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { JsonProtocolClientConfig } from "./JsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-json/tests/functional/awsjson1_1.spec.ts b/protocol_tests/aws-json/test/functional/awsjson1_1.spec.ts similarity index 99% rename from protocol_tests/aws-json/tests/functional/awsjson1_1.spec.ts rename to protocol_tests/aws-json/test/functional/awsjson1_1.spec.ts index 9ad6232fc0b9..3b799941ce49 100644 --- a/protocol_tests/aws-json/tests/functional/awsjson1_1.spec.ts +++ b/protocol_tests/aws-json/test/functional/awsjson1_1.spec.ts @@ -1,16 +1,16 @@ -import { JsonProtocolClient } from "../../JsonProtocolClient"; -import { EmptyOperationCommand } from "../../commands/EmptyOperationCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { JsonEnumsCommand } from "../../commands/JsonEnumsCommand"; -import { JsonUnionsCommand } from "../../commands/JsonUnionsCommand"; -import { KitchenSinkOperationCommand } from "../../commands/KitchenSinkOperationCommand"; -import { NullOperationCommand } from "../../commands/NullOperationCommand"; -import { OperationWithOptionalInputOutputCommand } from "../../commands/OperationWithOptionalInputOutputCommand"; -import { PutAndGetInlineDocumentsCommand } from "../../commands/PutAndGetInlineDocumentsCommand"; -import { SimpleScalarPropertiesCommand } from "../../commands/SimpleScalarPropertiesCommand"; -import { ComplexError, FooError, InvalidGreeting } from "../../models/models_0"; +import { JsonProtocolClient } from "../../src/JsonProtocolClient"; +import { EmptyOperationCommand } from "../../src/commands/EmptyOperationCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { JsonEnumsCommand } from "../../src/commands/JsonEnumsCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { KitchenSinkOperationCommand } from "../../src/commands/KitchenSinkOperationCommand"; +import { NullOperationCommand } from "../../src/commands/NullOperationCommand"; +import { OperationWithOptionalInputOutputCommand } from "../../src/commands/OperationWithOptionalInputOutputCommand"; +import { PutAndGetInlineDocumentsCommand } from "../../src/commands/PutAndGetInlineDocumentsCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0"; import { Encoder as __Encoder } from "@aws-sdk/types"; import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types"; import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; diff --git a/protocol_tests/aws-json/tsconfig.es.json b/protocol_tests/aws-json/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-json/tsconfig.es.json +++ b/protocol_tests/aws-json/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-json/tsconfig.json b/protocol_tests/aws-json/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-json/tsconfig.json +++ b/protocol_tests/aws-json/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-json/tsconfig.types.json b/protocol_tests/aws-json/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-json/tsconfig.types.json +++ b/protocol_tests/aws-json/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/protocol_tests/aws-query/.gitignore b/protocol_tests/aws-query/.gitignore index 1e9d1ff41af8..619adfbf932a 100644 --- a/protocol_tests/aws-query/.gitignore +++ b/protocol_tests/aws-query/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-query/package.json b/protocol_tests/aws-query/package.json index f5e94f948f3c..c17ac00addbf 100644 --- a/protocol_tests/aws-query/package.json +++ b/protocol_tests/aws-query/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -73,8 +67,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -83,6 +77,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-query", "repository": { diff --git a/protocol_tests/aws-query/runtimeConfig.browser.ts b/protocol_tests/aws-query/runtimeConfig.browser.ts deleted file mode 100644 index d83ae1207c57..000000000000 --- a/protocol_tests/aws-query/runtimeConfig.browser.ts +++ /dev/null @@ -1,36 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { QueryProtocolClientConfig } from "./QueryProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-query/runtimeConfig.ts b/protocol_tests/aws-query/runtimeConfig.ts deleted file mode 100644 index 4f14089ebdca..000000000000 --- a/protocol_tests/aws-query/runtimeConfig.ts +++ /dev/null @@ -1,39 +0,0 @@ -import packageInfo from "./package.json"; - -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { QueryProtocolClientConfig } from "./QueryProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-query/QueryProtocol.ts b/protocol_tests/aws-query/src/QueryProtocol.ts similarity index 100% rename from protocol_tests/aws-query/QueryProtocol.ts rename to protocol_tests/aws-query/src/QueryProtocol.ts diff --git a/protocol_tests/aws-query/QueryProtocolClient.ts b/protocol_tests/aws-query/src/QueryProtocolClient.ts similarity index 100% rename from protocol_tests/aws-query/QueryProtocolClient.ts rename to protocol_tests/aws-query/src/QueryProtocolClient.ts diff --git a/protocol_tests/aws-query/commands/EmptyInputAndEmptyOutputCommand.ts b/protocol_tests/aws-query/src/commands/EmptyInputAndEmptyOutputCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/EmptyInputAndEmptyOutputCommand.ts rename to protocol_tests/aws-query/src/commands/EmptyInputAndEmptyOutputCommand.ts diff --git a/protocol_tests/aws-query/commands/EndpointOperationCommand.ts b/protocol_tests/aws-query/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-query/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-query/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-query/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-query/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-query/commands/FlattenedXmlMapCommand.ts b/protocol_tests/aws-query/src/commands/FlattenedXmlMapCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/FlattenedXmlMapCommand.ts rename to protocol_tests/aws-query/src/commands/FlattenedXmlMapCommand.ts diff --git a/protocol_tests/aws-query/commands/FlattenedXmlMapWithXmlNameCommand.ts b/protocol_tests/aws-query/src/commands/FlattenedXmlMapWithXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/FlattenedXmlMapWithXmlNameCommand.ts rename to protocol_tests/aws-query/src/commands/FlattenedXmlMapWithXmlNameCommand.ts diff --git a/protocol_tests/aws-query/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts b/protocol_tests/aws-query/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts rename to protocol_tests/aws-query/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts diff --git a/protocol_tests/aws-query/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-query/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-query/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-query/commands/IgnoresWrappingXmlNameCommand.ts b/protocol_tests/aws-query/src/commands/IgnoresWrappingXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/IgnoresWrappingXmlNameCommand.ts rename to protocol_tests/aws-query/src/commands/IgnoresWrappingXmlNameCommand.ts diff --git a/protocol_tests/aws-query/commands/NestedStructuresCommand.ts b/protocol_tests/aws-query/src/commands/NestedStructuresCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/NestedStructuresCommand.ts rename to protocol_tests/aws-query/src/commands/NestedStructuresCommand.ts diff --git a/protocol_tests/aws-query/commands/NoInputAndNoOutputCommand.ts b/protocol_tests/aws-query/src/commands/NoInputAndNoOutputCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/NoInputAndNoOutputCommand.ts rename to protocol_tests/aws-query/src/commands/NoInputAndNoOutputCommand.ts diff --git a/protocol_tests/aws-query/commands/NoInputAndOutputCommand.ts b/protocol_tests/aws-query/src/commands/NoInputAndOutputCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/NoInputAndOutputCommand.ts rename to protocol_tests/aws-query/src/commands/NoInputAndOutputCommand.ts diff --git a/protocol_tests/aws-query/commands/QueryIdempotencyTokenAutoFillCommand.ts b/protocol_tests/aws-query/src/commands/QueryIdempotencyTokenAutoFillCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/QueryIdempotencyTokenAutoFillCommand.ts rename to protocol_tests/aws-query/src/commands/QueryIdempotencyTokenAutoFillCommand.ts diff --git a/protocol_tests/aws-query/commands/QueryListsCommand.ts b/protocol_tests/aws-query/src/commands/QueryListsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/QueryListsCommand.ts rename to protocol_tests/aws-query/src/commands/QueryListsCommand.ts diff --git a/protocol_tests/aws-query/commands/QueryMapsCommand.ts b/protocol_tests/aws-query/src/commands/QueryMapsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/QueryMapsCommand.ts rename to protocol_tests/aws-query/src/commands/QueryMapsCommand.ts diff --git a/protocol_tests/aws-query/commands/QueryTimestampsCommand.ts b/protocol_tests/aws-query/src/commands/QueryTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/QueryTimestampsCommand.ts rename to protocol_tests/aws-query/src/commands/QueryTimestampsCommand.ts diff --git a/protocol_tests/aws-query/commands/RecursiveXmlShapesCommand.ts b/protocol_tests/aws-query/src/commands/RecursiveXmlShapesCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/RecursiveXmlShapesCommand.ts rename to protocol_tests/aws-query/src/commands/RecursiveXmlShapesCommand.ts diff --git a/protocol_tests/aws-query/commands/SimpleInputParamsCommand.ts b/protocol_tests/aws-query/src/commands/SimpleInputParamsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/SimpleInputParamsCommand.ts rename to protocol_tests/aws-query/src/commands/SimpleInputParamsCommand.ts diff --git a/protocol_tests/aws-query/commands/SimpleScalarXmlPropertiesCommand.ts b/protocol_tests/aws-query/src/commands/SimpleScalarXmlPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/SimpleScalarXmlPropertiesCommand.ts rename to protocol_tests/aws-query/src/commands/SimpleScalarXmlPropertiesCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlBlobsCommand.ts b/protocol_tests/aws-query/src/commands/XmlBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlBlobsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlBlobsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlEmptyBlobsCommand.ts b/protocol_tests/aws-query/src/commands/XmlEmptyBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlEmptyBlobsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlEmptyBlobsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlEmptyListsCommand.ts b/protocol_tests/aws-query/src/commands/XmlEmptyListsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlEmptyListsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlEmptyListsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlEmptyMapsCommand.ts b/protocol_tests/aws-query/src/commands/XmlEmptyMapsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlEmptyMapsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlEmptyMapsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlEnumsCommand.ts b/protocol_tests/aws-query/src/commands/XmlEnumsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlEnumsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlEnumsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlListsCommand.ts b/protocol_tests/aws-query/src/commands/XmlListsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlListsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlListsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlMapsCommand.ts b/protocol_tests/aws-query/src/commands/XmlMapsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlMapsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlMapsCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlMapsXmlNameCommand.ts b/protocol_tests/aws-query/src/commands/XmlMapsXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlMapsXmlNameCommand.ts rename to protocol_tests/aws-query/src/commands/XmlMapsXmlNameCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlNamespacesCommand.ts b/protocol_tests/aws-query/src/commands/XmlNamespacesCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlNamespacesCommand.ts rename to protocol_tests/aws-query/src/commands/XmlNamespacesCommand.ts diff --git a/protocol_tests/aws-query/commands/XmlTimestampsCommand.ts b/protocol_tests/aws-query/src/commands/XmlTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-query/commands/XmlTimestampsCommand.ts rename to protocol_tests/aws-query/src/commands/XmlTimestampsCommand.ts diff --git a/protocol_tests/aws-query/endpoints.ts b/protocol_tests/aws-query/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-query/endpoints.ts rename to protocol_tests/aws-query/src/endpoints.ts diff --git a/protocol_tests/aws-query/index.ts b/protocol_tests/aws-query/src/index.ts similarity index 100% rename from protocol_tests/aws-query/index.ts rename to protocol_tests/aws-query/src/index.ts diff --git a/protocol_tests/aws-query/models/index.ts b/protocol_tests/aws-query/src/models/index.ts similarity index 100% rename from protocol_tests/aws-query/models/index.ts rename to protocol_tests/aws-query/src/models/index.ts diff --git a/protocol_tests/aws-query/models/models_0.ts b/protocol_tests/aws-query/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-query/models/models_0.ts rename to protocol_tests/aws-query/src/models/models_0.ts diff --git a/protocol_tests/aws-query/protocols/Aws_query.ts b/protocol_tests/aws-query/src/protocols/Aws_query.ts similarity index 100% rename from protocol_tests/aws-query/protocols/Aws_query.ts rename to protocol_tests/aws-query/src/protocols/Aws_query.ts diff --git a/protocol_tests/aws-query/src/runtimeConfig.browser.ts b/protocol_tests/aws-query/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c38b336478bf --- /dev/null +++ b/protocol_tests/aws-query/src/runtimeConfig.browser.ts @@ -0,0 +1,37 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-query/runtimeConfig.native.ts b/protocol_tests/aws-query/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-query/runtimeConfig.native.ts rename to protocol_tests/aws-query/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-query/runtimeConfig.shared.ts b/protocol_tests/aws-query/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-query/runtimeConfig.shared.ts rename to protocol_tests/aws-query/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-query/src/runtimeConfig.ts b/protocol_tests/aws-query/src/runtimeConfig.ts new file mode 100644 index 000000000000..1dba06880784 --- /dev/null +++ b/protocol_tests/aws-query/src/runtimeConfig.ts @@ -0,0 +1,40 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { QueryProtocolClientConfig } from "./QueryProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-query/tests/functional/awsquery.spec.ts b/protocol_tests/aws-query/test/functional/awsquery.spec.ts similarity index 97% rename from protocol_tests/aws-query/tests/functional/awsquery.spec.ts rename to protocol_tests/aws-query/test/functional/awsquery.spec.ts index 9da18f01a1a7..194f427644a8 100644 --- a/protocol_tests/aws-query/tests/functional/awsquery.spec.ts +++ b/protocol_tests/aws-query/test/functional/awsquery.spec.ts @@ -1,33 +1,33 @@ -import { QueryProtocolClient } from "../../QueryProtocolClient"; -import { EmptyInputAndEmptyOutputCommand } from "../../commands/EmptyInputAndEmptyOutputCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { FlattenedXmlMapCommand } from "../../commands/FlattenedXmlMapCommand"; -import { FlattenedXmlMapWithXmlNameCommand } from "../../commands/FlattenedXmlMapWithXmlNameCommand"; -import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../commands/FlattenedXmlMapWithXmlNamespaceCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { IgnoresWrappingXmlNameCommand } from "../../commands/IgnoresWrappingXmlNameCommand"; -import { NestedStructuresCommand } from "../../commands/NestedStructuresCommand"; -import { NoInputAndNoOutputCommand } from "../../commands/NoInputAndNoOutputCommand"; -import { NoInputAndOutputCommand } from "../../commands/NoInputAndOutputCommand"; -import { QueryIdempotencyTokenAutoFillCommand } from "../../commands/QueryIdempotencyTokenAutoFillCommand"; -import { QueryListsCommand } from "../../commands/QueryListsCommand"; -import { QueryMapsCommand } from "../../commands/QueryMapsCommand"; -import { QueryTimestampsCommand } from "../../commands/QueryTimestampsCommand"; -import { RecursiveXmlShapesCommand } from "../../commands/RecursiveXmlShapesCommand"; -import { SimpleInputParamsCommand } from "../../commands/SimpleInputParamsCommand"; -import { SimpleScalarXmlPropertiesCommand } from "../../commands/SimpleScalarXmlPropertiesCommand"; -import { XmlBlobsCommand } from "../../commands/XmlBlobsCommand"; -import { XmlEmptyBlobsCommand } from "../../commands/XmlEmptyBlobsCommand"; -import { XmlEmptyListsCommand } from "../../commands/XmlEmptyListsCommand"; -import { XmlEmptyMapsCommand } from "../../commands/XmlEmptyMapsCommand"; -import { XmlEnumsCommand } from "../../commands/XmlEnumsCommand"; -import { XmlListsCommand } from "../../commands/XmlListsCommand"; -import { XmlMapsCommand } from "../../commands/XmlMapsCommand"; -import { XmlMapsXmlNameCommand } from "../../commands/XmlMapsXmlNameCommand"; -import { XmlNamespacesCommand } from "../../commands/XmlNamespacesCommand"; -import { XmlTimestampsCommand } from "../../commands/XmlTimestampsCommand"; -import { ComplexError, CustomCodeError, InvalidGreeting } from "../../models/models_0"; +import { QueryProtocolClient } from "../../src/QueryProtocolClient"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommand } from "../../src/commands/FlattenedXmlMapCommand"; +import { FlattenedXmlMapWithXmlNameCommand } from "../../src/commands/FlattenedXmlMapWithXmlNameCommand"; +import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../src/commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { IgnoresWrappingXmlNameCommand } from "../../src/commands/IgnoresWrappingXmlNameCommand"; +import { NestedStructuresCommand } from "../../src/commands/NestedStructuresCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryListsCommand } from "../../src/commands/QueryListsCommand"; +import { QueryMapsCommand } from "../../src/commands/QueryMapsCommand"; +import { QueryTimestampsCommand } from "../../src/commands/QueryTimestampsCommand"; +import { RecursiveXmlShapesCommand } from "../../src/commands/RecursiveXmlShapesCommand"; +import { SimpleInputParamsCommand } from "../../src/commands/SimpleInputParamsCommand"; +import { SimpleScalarXmlPropertiesCommand } from "../../src/commands/SimpleScalarXmlPropertiesCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommand } from "../../src/commands/XmlEmptyMapsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlMapsCommand } from "../../src/commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommand } from "../../src/commands/XmlMapsXmlNameCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { ComplexError, CustomCodeError, InvalidGreeting } from "../../src/models/models_0"; import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types"; import { HttpHandler, HttpRequest, HttpResponse } from "@aws-sdk/protocol-http"; import { Readable } from "stream"; diff --git a/protocol_tests/aws-query/tsconfig.es.json b/protocol_tests/aws-query/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-query/tsconfig.es.json +++ b/protocol_tests/aws-query/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-query/tsconfig.json b/protocol_tests/aws-query/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-query/tsconfig.json +++ b/protocol_tests/aws-query/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-query/tsconfig.types.json b/protocol_tests/aws-query/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-query/tsconfig.types.json +++ b/protocol_tests/aws-query/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/protocol_tests/aws-restjson/.gitignore b/protocol_tests/aws-restjson/.gitignore index 1e9d1ff41af8..619adfbf932a 100644 --- a/protocol_tests/aws-restjson/.gitignore +++ b/protocol_tests/aws-restjson/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-restjson/package.json b/protocol_tests/aws-restjson/package.json index bb479967f385..18f288712021 100644 --- a/protocol_tests/aws-restjson/package.json +++ b/protocol_tests/aws-restjson/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -76,8 +70,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -86,6 +80,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-restjson", "repository": { diff --git a/protocol_tests/aws-restjson/runtimeConfig.browser.ts b/protocol_tests/aws-restjson/runtimeConfig.browser.ts deleted file mode 100644 index 7100b10d7771..000000000000 --- a/protocol_tests/aws-restjson/runtimeConfig.browser.ts +++ /dev/null @@ -1,40 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; -import { Md5 } from "@aws-sdk/md5-js"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - md5: config?.md5 ?? Md5, - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-restjson/runtimeConfig.ts b/protocol_tests/aws-restjson/runtimeConfig.ts deleted file mode 100644 index 7441921a7cd0..000000000000 --- a/protocol_tests/aws-restjson/runtimeConfig.ts +++ /dev/null @@ -1,43 +0,0 @@ -import packageInfo from "./package.json"; - -import { Hash } from "@aws-sdk/hash-node"; -import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - md5: config?.md5 ?? Hash.bind(null, "md5"), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - streamHasher: config?.streamHasher ?? streamHasher, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-restjson/RestJsonProtocol.ts b/protocol_tests/aws-restjson/src/RestJsonProtocol.ts similarity index 100% rename from protocol_tests/aws-restjson/RestJsonProtocol.ts rename to protocol_tests/aws-restjson/src/RestJsonProtocol.ts diff --git a/protocol_tests/aws-restjson/RestJsonProtocolClient.ts b/protocol_tests/aws-restjson/src/RestJsonProtocolClient.ts similarity index 100% rename from protocol_tests/aws-restjson/RestJsonProtocolClient.ts rename to protocol_tests/aws-restjson/src/RestJsonProtocolClient.ts diff --git a/protocol_tests/aws-restjson/commands/AllQueryStringTypesCommand.ts b/protocol_tests/aws-restjson/src/commands/AllQueryStringTypesCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/AllQueryStringTypesCommand.ts rename to protocol_tests/aws-restjson/src/commands/AllQueryStringTypesCommand.ts diff --git a/protocol_tests/aws-restjson/commands/ConstantAndVariableQueryStringCommand.ts b/protocol_tests/aws-restjson/src/commands/ConstantAndVariableQueryStringCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/ConstantAndVariableQueryStringCommand.ts rename to protocol_tests/aws-restjson/src/commands/ConstantAndVariableQueryStringCommand.ts diff --git a/protocol_tests/aws-restjson/commands/ConstantQueryStringCommand.ts b/protocol_tests/aws-restjson/src/commands/ConstantQueryStringCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/ConstantQueryStringCommand.ts rename to protocol_tests/aws-restjson/src/commands/ConstantQueryStringCommand.ts diff --git a/protocol_tests/aws-restjson/commands/DocumentTypeAsPayloadCommand.ts b/protocol_tests/aws-restjson/src/commands/DocumentTypeAsPayloadCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/DocumentTypeAsPayloadCommand.ts rename to protocol_tests/aws-restjson/src/commands/DocumentTypeAsPayloadCommand.ts diff --git a/protocol_tests/aws-restjson/commands/DocumentTypeCommand.ts b/protocol_tests/aws-restjson/src/commands/DocumentTypeCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/DocumentTypeCommand.ts rename to protocol_tests/aws-restjson/src/commands/DocumentTypeCommand.ts diff --git a/protocol_tests/aws-restjson/commands/EmptyInputAndEmptyOutputCommand.ts b/protocol_tests/aws-restjson/src/commands/EmptyInputAndEmptyOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/EmptyInputAndEmptyOutputCommand.ts rename to protocol_tests/aws-restjson/src/commands/EmptyInputAndEmptyOutputCommand.ts diff --git a/protocol_tests/aws-restjson/commands/EndpointOperationCommand.ts b/protocol_tests/aws-restjson/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-restjson/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-restjson/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-restjson/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-restjson/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-restjson/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-restjson/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-restjson/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HostWithPathOperationCommand.ts b/protocol_tests/aws-restjson/src/commands/HostWithPathOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HostWithPathOperationCommand.ts rename to protocol_tests/aws-restjson/src/commands/HostWithPathOperationCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpChecksumRequiredCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpChecksumRequiredCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpChecksumRequiredCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpChecksumRequiredCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpEnumPayloadCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpEnumPayloadCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpEnumPayloadCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpEnumPayloadCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpPayloadTraitsCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpPayloadTraitsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpPayloadTraitsCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpPayloadTraitsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpPayloadTraitsWithMediaTypeCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpPayloadWithStructureCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpPayloadWithStructureCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpPayloadWithStructureCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpPayloadWithStructureCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpPrefixHeadersCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpPrefixHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpPrefixHeadersCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpPrefixHeadersCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpPrefixHeadersResponseCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpPrefixHeadersResponseCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpPrefixHeadersResponseCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpPrefixHeadersResponseCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpRequestWithFloatLabelsCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpRequestWithFloatLabelsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpRequestWithFloatLabelsCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpRequestWithFloatLabelsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpRequestWithGreedyLabelInPathCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpRequestWithGreedyLabelInPathCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpRequestWithLabelsCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpRequestWithLabelsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpRequestWithLabelsCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpRequestWithLabelsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpResponseCodeCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpResponseCodeCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpResponseCodeCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpResponseCodeCommand.ts diff --git a/protocol_tests/aws-restjson/commands/HttpStringPayloadCommand.ts b/protocol_tests/aws-restjson/src/commands/HttpStringPayloadCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/HttpStringPayloadCommand.ts rename to protocol_tests/aws-restjson/src/commands/HttpStringPayloadCommand.ts diff --git a/protocol_tests/aws-restjson/commands/IgnoreQueryParamsInResponseCommand.ts b/protocol_tests/aws-restjson/src/commands/IgnoreQueryParamsInResponseCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/IgnoreQueryParamsInResponseCommand.ts rename to protocol_tests/aws-restjson/src/commands/IgnoreQueryParamsInResponseCommand.ts diff --git a/protocol_tests/aws-restjson/commands/InputAndOutputWithHeadersCommand.ts b/protocol_tests/aws-restjson/src/commands/InputAndOutputWithHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/InputAndOutputWithHeadersCommand.ts rename to protocol_tests/aws-restjson/src/commands/InputAndOutputWithHeadersCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonBlobsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonBlobsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonBlobsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonEnumsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonEnumsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonEnumsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonEnumsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonListsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonListsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonListsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonListsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonMapsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonMapsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonMapsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonMapsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonTimestampsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonTimestampsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonTimestampsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/JsonUnionsCommand.ts b/protocol_tests/aws-restjson/src/commands/JsonUnionsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/JsonUnionsCommand.ts rename to protocol_tests/aws-restjson/src/commands/JsonUnionsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/MediaTypeHeaderCommand.ts b/protocol_tests/aws-restjson/src/commands/MediaTypeHeaderCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/MediaTypeHeaderCommand.ts rename to protocol_tests/aws-restjson/src/commands/MediaTypeHeaderCommand.ts diff --git a/protocol_tests/aws-restjson/commands/NoInputAndNoOutputCommand.ts b/protocol_tests/aws-restjson/src/commands/NoInputAndNoOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/NoInputAndNoOutputCommand.ts rename to protocol_tests/aws-restjson/src/commands/NoInputAndNoOutputCommand.ts diff --git a/protocol_tests/aws-restjson/commands/NoInputAndOutputCommand.ts b/protocol_tests/aws-restjson/src/commands/NoInputAndOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/NoInputAndOutputCommand.ts rename to protocol_tests/aws-restjson/src/commands/NoInputAndOutputCommand.ts diff --git a/protocol_tests/aws-restjson/commands/NullAndEmptyHeadersClientCommand.ts b/protocol_tests/aws-restjson/src/commands/NullAndEmptyHeadersClientCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/NullAndEmptyHeadersClientCommand.ts rename to protocol_tests/aws-restjson/src/commands/NullAndEmptyHeadersClientCommand.ts diff --git a/protocol_tests/aws-restjson/commands/NullAndEmptyHeadersServerCommand.ts b/protocol_tests/aws-restjson/src/commands/NullAndEmptyHeadersServerCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/NullAndEmptyHeadersServerCommand.ts rename to protocol_tests/aws-restjson/src/commands/NullAndEmptyHeadersServerCommand.ts diff --git a/protocol_tests/aws-restjson/commands/OmitsNullSerializesEmptyStringCommand.ts b/protocol_tests/aws-restjson/src/commands/OmitsNullSerializesEmptyStringCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/OmitsNullSerializesEmptyStringCommand.ts rename to protocol_tests/aws-restjson/src/commands/OmitsNullSerializesEmptyStringCommand.ts diff --git a/protocol_tests/aws-restjson/commands/QueryIdempotencyTokenAutoFillCommand.ts b/protocol_tests/aws-restjson/src/commands/QueryIdempotencyTokenAutoFillCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/QueryIdempotencyTokenAutoFillCommand.ts rename to protocol_tests/aws-restjson/src/commands/QueryIdempotencyTokenAutoFillCommand.ts diff --git a/protocol_tests/aws-restjson/commands/QueryParamsAsStringListMapCommand.ts b/protocol_tests/aws-restjson/src/commands/QueryParamsAsStringListMapCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/QueryParamsAsStringListMapCommand.ts rename to protocol_tests/aws-restjson/src/commands/QueryParamsAsStringListMapCommand.ts diff --git a/protocol_tests/aws-restjson/commands/QueryPrecedenceCommand.ts b/protocol_tests/aws-restjson/src/commands/QueryPrecedenceCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/QueryPrecedenceCommand.ts rename to protocol_tests/aws-restjson/src/commands/QueryPrecedenceCommand.ts diff --git a/protocol_tests/aws-restjson/commands/RecursiveShapesCommand.ts b/protocol_tests/aws-restjson/src/commands/RecursiveShapesCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/RecursiveShapesCommand.ts rename to protocol_tests/aws-restjson/src/commands/RecursiveShapesCommand.ts diff --git a/protocol_tests/aws-restjson/commands/SimpleScalarPropertiesCommand.ts b/protocol_tests/aws-restjson/src/commands/SimpleScalarPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/SimpleScalarPropertiesCommand.ts rename to protocol_tests/aws-restjson/src/commands/SimpleScalarPropertiesCommand.ts diff --git a/protocol_tests/aws-restjson/commands/StreamingTraitsCommand.ts b/protocol_tests/aws-restjson/src/commands/StreamingTraitsCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/StreamingTraitsCommand.ts rename to protocol_tests/aws-restjson/src/commands/StreamingTraitsCommand.ts diff --git a/protocol_tests/aws-restjson/commands/StreamingTraitsRequireLengthCommand.ts b/protocol_tests/aws-restjson/src/commands/StreamingTraitsRequireLengthCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/StreamingTraitsRequireLengthCommand.ts rename to protocol_tests/aws-restjson/src/commands/StreamingTraitsRequireLengthCommand.ts diff --git a/protocol_tests/aws-restjson/commands/StreamingTraitsWithMediaTypeCommand.ts b/protocol_tests/aws-restjson/src/commands/StreamingTraitsWithMediaTypeCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/StreamingTraitsWithMediaTypeCommand.ts rename to protocol_tests/aws-restjson/src/commands/StreamingTraitsWithMediaTypeCommand.ts diff --git a/protocol_tests/aws-restjson/commands/TimestampFormatHeadersCommand.ts b/protocol_tests/aws-restjson/src/commands/TimestampFormatHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restjson/commands/TimestampFormatHeadersCommand.ts rename to protocol_tests/aws-restjson/src/commands/TimestampFormatHeadersCommand.ts diff --git a/protocol_tests/aws-restjson/endpoints.ts b/protocol_tests/aws-restjson/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-restjson/endpoints.ts rename to protocol_tests/aws-restjson/src/endpoints.ts diff --git a/protocol_tests/aws-restjson/index.ts b/protocol_tests/aws-restjson/src/index.ts similarity index 100% rename from protocol_tests/aws-restjson/index.ts rename to protocol_tests/aws-restjson/src/index.ts diff --git a/protocol_tests/aws-restjson/models/index.ts b/protocol_tests/aws-restjson/src/models/index.ts similarity index 100% rename from protocol_tests/aws-restjson/models/index.ts rename to protocol_tests/aws-restjson/src/models/index.ts diff --git a/protocol_tests/aws-restjson/models/models_0.ts b/protocol_tests/aws-restjson/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-restjson/models/models_0.ts rename to protocol_tests/aws-restjson/src/models/models_0.ts diff --git a/protocol_tests/aws-restjson/protocols/Aws_restJson1.ts b/protocol_tests/aws-restjson/src/protocols/Aws_restJson1.ts similarity index 100% rename from protocol_tests/aws-restjson/protocols/Aws_restJson1.ts rename to protocol_tests/aws-restjson/src/protocols/Aws_restJson1.ts diff --git a/protocol_tests/aws-restjson/src/runtimeConfig.browser.ts b/protocol_tests/aws-restjson/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..57a0abc28270 --- /dev/null +++ b/protocol_tests/aws-restjson/src/runtimeConfig.browser.ts @@ -0,0 +1,41 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { blobHasher as streamHasher } from "@aws-sdk/hash-blob-browser"; +import { Md5 } from "@aws-sdk/md5-js"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + md5: config?.md5 ?? Md5, + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-restjson/runtimeConfig.native.ts b/protocol_tests/aws-restjson/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-restjson/runtimeConfig.native.ts rename to protocol_tests/aws-restjson/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-restjson/runtimeConfig.shared.ts b/protocol_tests/aws-restjson/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-restjson/runtimeConfig.shared.ts rename to protocol_tests/aws-restjson/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-restjson/src/runtimeConfig.ts b/protocol_tests/aws-restjson/src/runtimeConfig.ts new file mode 100644 index 000000000000..110066c64723 --- /dev/null +++ b/protocol_tests/aws-restjson/src/runtimeConfig.ts @@ -0,0 +1,44 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Hash } from "@aws-sdk/hash-node"; +import { fileStreamHasher as streamHasher } from "@aws-sdk/hash-stream-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { HashConstructor as __HashConstructor } from "@aws-sdk/types"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RestJsonProtocolClientConfig } from "./RestJsonProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + md5: config?.md5 ?? Hash.bind(null, "md5"), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + streamHasher: config?.streamHasher ?? streamHasher, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-restjson/tests/functional/restjson1.spec.ts b/protocol_tests/aws-restjson/test/functional/restjson1.spec.ts similarity index 97% rename from protocol_tests/aws-restjson/tests/functional/restjson1.spec.ts rename to protocol_tests/aws-restjson/test/functional/restjson1.spec.ts index 8044c576b59b..48401ac0f74a 100644 --- a/protocol_tests/aws-restjson/tests/functional/restjson1.spec.ts +++ b/protocol_tests/aws-restjson/test/functional/restjson1.spec.ts @@ -1,50 +1,50 @@ -import { RestJsonProtocolClient } from "../../RestJsonProtocolClient"; -import { AllQueryStringTypesCommand } from "../../commands/AllQueryStringTypesCommand"; -import { ConstantAndVariableQueryStringCommand } from "../../commands/ConstantAndVariableQueryStringCommand"; -import { ConstantQueryStringCommand } from "../../commands/ConstantQueryStringCommand"; -import { DocumentTypeAsPayloadCommand } from "../../commands/DocumentTypeAsPayloadCommand"; -import { DocumentTypeCommand } from "../../commands/DocumentTypeCommand"; -import { EmptyInputAndEmptyOutputCommand } from "../../commands/EmptyInputAndEmptyOutputCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { HostWithPathOperationCommand } from "../../commands/HostWithPathOperationCommand"; -import { HttpChecksumRequiredCommand } from "../../commands/HttpChecksumRequiredCommand"; -import { HttpEnumPayloadCommand } from "../../commands/HttpEnumPayloadCommand"; -import { HttpPayloadTraitsCommand } from "../../commands/HttpPayloadTraitsCommand"; -import { HttpPayloadTraitsWithMediaTypeCommand } from "../../commands/HttpPayloadTraitsWithMediaTypeCommand"; -import { HttpPayloadWithStructureCommand } from "../../commands/HttpPayloadWithStructureCommand"; -import { HttpPrefixHeadersCommand } from "../../commands/HttpPrefixHeadersCommand"; -import { HttpPrefixHeadersResponseCommand } from "../../commands/HttpPrefixHeadersResponseCommand"; -import { HttpRequestWithFloatLabelsCommand } from "../../commands/HttpRequestWithFloatLabelsCommand"; -import { HttpRequestWithGreedyLabelInPathCommand } from "../../commands/HttpRequestWithGreedyLabelInPathCommand"; -import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../commands/HttpRequestWithLabelsAndTimestampFormatCommand"; -import { HttpRequestWithLabelsCommand } from "../../commands/HttpRequestWithLabelsCommand"; -import { HttpResponseCodeCommand } from "../../commands/HttpResponseCodeCommand"; -import { HttpStringPayloadCommand } from "../../commands/HttpStringPayloadCommand"; -import { IgnoreQueryParamsInResponseCommand } from "../../commands/IgnoreQueryParamsInResponseCommand"; -import { InputAndOutputWithHeadersCommand } from "../../commands/InputAndOutputWithHeadersCommand"; -import { JsonBlobsCommand } from "../../commands/JsonBlobsCommand"; -import { JsonEnumsCommand } from "../../commands/JsonEnumsCommand"; -import { JsonListsCommand } from "../../commands/JsonListsCommand"; -import { JsonMapsCommand } from "../../commands/JsonMapsCommand"; -import { JsonTimestampsCommand } from "../../commands/JsonTimestampsCommand"; -import { JsonUnionsCommand } from "../../commands/JsonUnionsCommand"; -import { MediaTypeHeaderCommand } from "../../commands/MediaTypeHeaderCommand"; -import { NoInputAndNoOutputCommand } from "../../commands/NoInputAndNoOutputCommand"; -import { NoInputAndOutputCommand } from "../../commands/NoInputAndOutputCommand"; -import { NullAndEmptyHeadersClientCommand } from "../../commands/NullAndEmptyHeadersClientCommand"; -import { OmitsNullSerializesEmptyStringCommand } from "../../commands/OmitsNullSerializesEmptyStringCommand"; -import { QueryIdempotencyTokenAutoFillCommand } from "../../commands/QueryIdempotencyTokenAutoFillCommand"; -import { QueryParamsAsStringListMapCommand } from "../../commands/QueryParamsAsStringListMapCommand"; -import { QueryPrecedenceCommand } from "../../commands/QueryPrecedenceCommand"; -import { RecursiveShapesCommand } from "../../commands/RecursiveShapesCommand"; -import { SimpleScalarPropertiesCommand } from "../../commands/SimpleScalarPropertiesCommand"; -import { StreamingTraitsCommand } from "../../commands/StreamingTraitsCommand"; -import { StreamingTraitsRequireLengthCommand } from "../../commands/StreamingTraitsRequireLengthCommand"; -import { StreamingTraitsWithMediaTypeCommand } from "../../commands/StreamingTraitsWithMediaTypeCommand"; -import { TimestampFormatHeadersCommand } from "../../commands/TimestampFormatHeadersCommand"; -import { ComplexError, FooError, InvalidGreeting } from "../../models/models_0"; +import { RestJsonProtocolClient } from "../../src/RestJsonProtocolClient"; +import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; +import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand"; +import { ConstantQueryStringCommand } from "../../src/commands/ConstantQueryStringCommand"; +import { DocumentTypeAsPayloadCommand } from "../../src/commands/DocumentTypeAsPayloadCommand"; +import { DocumentTypeCommand } from "../../src/commands/DocumentTypeCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HostWithPathOperationCommand } from "../../src/commands/HostWithPathOperationCommand"; +import { HttpChecksumRequiredCommand } from "../../src/commands/HttpChecksumRequiredCommand"; +import { HttpEnumPayloadCommand } from "../../src/commands/HttpEnumPayloadCommand"; +import { HttpPayloadTraitsCommand } from "../../src/commands/HttpPayloadTraitsCommand"; +import { HttpPayloadTraitsWithMediaTypeCommand } from "../../src/commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadWithStructureCommand"; +import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; +import { HttpPrefixHeadersResponseCommand } from "../../src/commands/HttpPrefixHeadersResponseCommand"; +import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; +import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; +import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { HttpRequestWithLabelsCommand } from "../../src/commands/HttpRequestWithLabelsCommand"; +import { HttpResponseCodeCommand } from "../../src/commands/HttpResponseCodeCommand"; +import { HttpStringPayloadCommand } from "../../src/commands/HttpStringPayloadCommand"; +import { IgnoreQueryParamsInResponseCommand } from "../../src/commands/IgnoreQueryParamsInResponseCommand"; +import { InputAndOutputWithHeadersCommand } from "../../src/commands/InputAndOutputWithHeadersCommand"; +import { JsonBlobsCommand } from "../../src/commands/JsonBlobsCommand"; +import { JsonEnumsCommand } from "../../src/commands/JsonEnumsCommand"; +import { JsonListsCommand } from "../../src/commands/JsonListsCommand"; +import { JsonMapsCommand } from "../../src/commands/JsonMapsCommand"; +import { JsonTimestampsCommand } from "../../src/commands/JsonTimestampsCommand"; +import { JsonUnionsCommand } from "../../src/commands/JsonUnionsCommand"; +import { MediaTypeHeaderCommand } from "../../src/commands/MediaTypeHeaderCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { NullAndEmptyHeadersClientCommand } from "../../src/commands/NullAndEmptyHeadersClientCommand"; +import { OmitsNullSerializesEmptyStringCommand } from "../../src/commands/OmitsNullSerializesEmptyStringCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryParamsAsStringListMapCommand } from "../../src/commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommand } from "../../src/commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommand } from "../../src/commands/RecursiveShapesCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { StreamingTraitsCommand } from "../../src/commands/StreamingTraitsCommand"; +import { StreamingTraitsRequireLengthCommand } from "../../src/commands/StreamingTraitsRequireLengthCommand"; +import { StreamingTraitsWithMediaTypeCommand } from "../../src/commands/StreamingTraitsWithMediaTypeCommand"; +import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand"; +import { ComplexError, FooError, InvalidGreeting } from "../../src/models/models_0"; import { buildQueryString } from "@aws-sdk/querystring-builder"; import { Encoder as __Encoder } from "@aws-sdk/types"; import { HttpHandlerOptions, HeaderBag } from "@aws-sdk/types"; diff --git a/protocol_tests/aws-restjson/tsconfig.es.json b/protocol_tests/aws-restjson/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-restjson/tsconfig.es.json +++ b/protocol_tests/aws-restjson/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-restjson/tsconfig.json b/protocol_tests/aws-restjson/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-restjson/tsconfig.json +++ b/protocol_tests/aws-restjson/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-restjson/tsconfig.types.json b/protocol_tests/aws-restjson/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-restjson/tsconfig.types.json +++ b/protocol_tests/aws-restjson/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/protocol_tests/aws-restxml/.gitignore b/protocol_tests/aws-restxml/.gitignore index 1e9d1ff41af8..619adfbf932a 100644 --- a/protocol_tests/aws-restxml/.gitignore +++ b/protocol_tests/aws-restxml/.gitignore @@ -2,7 +2,7 @@ /build/ /coverage/ /docs/ -/dist/ +/dist-* *.tsbuildinfo *.tgz *.log diff --git a/protocol_tests/aws-restxml/package.json b/protocol_tests/aws-restxml/package.json index 6978bf86279f..7842a3c327b3 100644 --- a/protocol_tests/aws-restxml/package.json +++ b/protocol_tests/aws-restxml/package.json @@ -11,18 +11,12 @@ "clean": "yarn clean:dist && yarn clean:docs", "clean:dist": "rimraf ./dist", "clean:docs": "rimraf ./docs", - "downlevel-dts": "downlevel-dts dist/types dist/types/ts3.4", + "downlevel-dts": "downlevel-dts dist-types dist-types/ts3.4", "test": "jest --coverage --passWithNoTests" }, - "main": "./dist/cjs/index.js", - "types": "./dist/types/index.d.ts", - "module": "./dist/es/index.js", - "browser": { - "./runtimeConfig": "./runtimeConfig.browser" - }, - "react-native": { - "./runtimeConfig": "./runtimeConfig.native" - }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", "sideEffects": false, "dependencies": { "@aws-crypto/sha256-browser": "^1.0.0", @@ -75,8 +69,8 @@ }, "typesVersions": { "<4.0": { - "dist/types/*": [ - "dist/types/ts3.4/*" + "dist-types/*": [ + "dist-types/ts3.4/*" ] } }, @@ -85,6 +79,12 @@ "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, "private": true, "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/aws-restxml", "repository": { diff --git a/protocol_tests/aws-restxml/runtimeConfig.browser.ts b/protocol_tests/aws-restxml/runtimeConfig.browser.ts deleted file mode 100644 index 2a084f1e0490..000000000000 --- a/protocol_tests/aws-restxml/runtimeConfig.browser.ts +++ /dev/null @@ -1,36 +0,0 @@ -import packageInfo from "./package.json"; - -import { Sha256 } from "@aws-crypto/sha256-browser"; -import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; -import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; -import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "browser", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, - requestHandler: config?.requestHandler ?? new FetchHttpHandler(), - retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), - sha256: config?.sha256 ?? Sha256, - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-restxml/runtimeConfig.ts b/protocol_tests/aws-restxml/runtimeConfig.ts deleted file mode 100644 index 2e9be34209eb..000000000000 --- a/protocol_tests/aws-restxml/runtimeConfig.ts +++ /dev/null @@ -1,39 +0,0 @@ -import packageInfo from "./package.json"; - -import { Hash } from "@aws-sdk/hash-node"; -import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; -import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; -import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; -import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; -import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; -import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; -import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; -import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; -import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; -import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; - -/** - * @internal - */ -export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { - emitWarningIfUnsupportedVersion(process.version); - const clientSharedValues = getSharedRuntimeConfig(config); - return { - ...clientSharedValues, - ...config, - runtime: "node", - base64Decoder: config?.base64Decoder ?? fromBase64, - base64Encoder: config?.base64Encoder ?? toBase64, - bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, - defaultUserAgentProvider: - config?.defaultUserAgentProvider ?? - defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - requestHandler: config?.requestHandler ?? new NodeHttpHandler(), - retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), - sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - streamCollector: config?.streamCollector ?? streamCollector, - utf8Decoder: config?.utf8Decoder ?? fromUtf8, - utf8Encoder: config?.utf8Encoder ?? toUtf8, - }; -}; diff --git a/protocol_tests/aws-restxml/RestXmlProtocol.ts b/protocol_tests/aws-restxml/src/RestXmlProtocol.ts similarity index 100% rename from protocol_tests/aws-restxml/RestXmlProtocol.ts rename to protocol_tests/aws-restxml/src/RestXmlProtocol.ts diff --git a/protocol_tests/aws-restxml/RestXmlProtocolClient.ts b/protocol_tests/aws-restxml/src/RestXmlProtocolClient.ts similarity index 100% rename from protocol_tests/aws-restxml/RestXmlProtocolClient.ts rename to protocol_tests/aws-restxml/src/RestXmlProtocolClient.ts diff --git a/protocol_tests/aws-restxml/commands/AllQueryStringTypesCommand.ts b/protocol_tests/aws-restxml/src/commands/AllQueryStringTypesCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/AllQueryStringTypesCommand.ts rename to protocol_tests/aws-restxml/src/commands/AllQueryStringTypesCommand.ts diff --git a/protocol_tests/aws-restxml/commands/BodyWithXmlNameCommand.ts b/protocol_tests/aws-restxml/src/commands/BodyWithXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/BodyWithXmlNameCommand.ts rename to protocol_tests/aws-restxml/src/commands/BodyWithXmlNameCommand.ts diff --git a/protocol_tests/aws-restxml/commands/ConstantAndVariableQueryStringCommand.ts b/protocol_tests/aws-restxml/src/commands/ConstantAndVariableQueryStringCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/ConstantAndVariableQueryStringCommand.ts rename to protocol_tests/aws-restxml/src/commands/ConstantAndVariableQueryStringCommand.ts diff --git a/protocol_tests/aws-restxml/commands/ConstantQueryStringCommand.ts b/protocol_tests/aws-restxml/src/commands/ConstantQueryStringCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/ConstantQueryStringCommand.ts rename to protocol_tests/aws-restxml/src/commands/ConstantQueryStringCommand.ts diff --git a/protocol_tests/aws-restxml/commands/EmptyInputAndEmptyOutputCommand.ts b/protocol_tests/aws-restxml/src/commands/EmptyInputAndEmptyOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/EmptyInputAndEmptyOutputCommand.ts rename to protocol_tests/aws-restxml/src/commands/EmptyInputAndEmptyOutputCommand.ts diff --git a/protocol_tests/aws-restxml/commands/EndpointOperationCommand.ts b/protocol_tests/aws-restxml/src/commands/EndpointOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/EndpointOperationCommand.ts rename to protocol_tests/aws-restxml/src/commands/EndpointOperationCommand.ts diff --git a/protocol_tests/aws-restxml/commands/EndpointWithHostLabelHeaderOperationCommand.ts b/protocol_tests/aws-restxml/src/commands/EndpointWithHostLabelHeaderOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/EndpointWithHostLabelHeaderOperationCommand.ts rename to protocol_tests/aws-restxml/src/commands/EndpointWithHostLabelHeaderOperationCommand.ts diff --git a/protocol_tests/aws-restxml/commands/EndpointWithHostLabelOperationCommand.ts b/protocol_tests/aws-restxml/src/commands/EndpointWithHostLabelOperationCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/EndpointWithHostLabelOperationCommand.ts rename to protocol_tests/aws-restxml/src/commands/EndpointWithHostLabelOperationCommand.ts diff --git a/protocol_tests/aws-restxml/commands/FlattenedXmlMapCommand.ts b/protocol_tests/aws-restxml/src/commands/FlattenedXmlMapCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/FlattenedXmlMapCommand.ts rename to protocol_tests/aws-restxml/src/commands/FlattenedXmlMapCommand.ts diff --git a/protocol_tests/aws-restxml/commands/FlattenedXmlMapWithXmlNameCommand.ts b/protocol_tests/aws-restxml/src/commands/FlattenedXmlMapWithXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/FlattenedXmlMapWithXmlNameCommand.ts rename to protocol_tests/aws-restxml/src/commands/FlattenedXmlMapWithXmlNameCommand.ts diff --git a/protocol_tests/aws-restxml/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts b/protocol_tests/aws-restxml/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts rename to protocol_tests/aws-restxml/src/commands/FlattenedXmlMapWithXmlNamespaceCommand.ts diff --git a/protocol_tests/aws-restxml/commands/GreetingWithErrorsCommand.ts b/protocol_tests/aws-restxml/src/commands/GreetingWithErrorsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/GreetingWithErrorsCommand.ts rename to protocol_tests/aws-restxml/src/commands/GreetingWithErrorsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadTraitsCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadTraitsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadTraitsCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadTraitsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadTraitsWithMediaTypeCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadTraitsWithMediaTypeCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadTraitsWithMediaTypeCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadWithMemberXmlNameCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadWithMemberXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadWithMemberXmlNameCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadWithMemberXmlNameCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadWithStructureCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadWithStructureCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadWithStructureCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadWithStructureCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNameCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNameCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNameCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNamespaceCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNamespaceCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPayloadWithXmlNamespaceCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPayloadWithXmlNamespaceCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpPrefixHeadersCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpPrefixHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpPrefixHeadersCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpPrefixHeadersCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpRequestWithFloatLabelsCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpRequestWithFloatLabelsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpRequestWithFloatLabelsCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpRequestWithFloatLabelsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpRequestWithGreedyLabelInPathCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpRequestWithGreedyLabelInPathCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpRequestWithGreedyLabelInPathCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpRequestWithLabelsAndTimestampFormatCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpRequestWithLabelsCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpRequestWithLabelsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpRequestWithLabelsCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpRequestWithLabelsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/HttpResponseCodeCommand.ts b/protocol_tests/aws-restxml/src/commands/HttpResponseCodeCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/HttpResponseCodeCommand.ts rename to protocol_tests/aws-restxml/src/commands/HttpResponseCodeCommand.ts diff --git a/protocol_tests/aws-restxml/commands/IgnoreQueryParamsInResponseCommand.ts b/protocol_tests/aws-restxml/src/commands/IgnoreQueryParamsInResponseCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/IgnoreQueryParamsInResponseCommand.ts rename to protocol_tests/aws-restxml/src/commands/IgnoreQueryParamsInResponseCommand.ts diff --git a/protocol_tests/aws-restxml/commands/InputAndOutputWithHeadersCommand.ts b/protocol_tests/aws-restxml/src/commands/InputAndOutputWithHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/InputAndOutputWithHeadersCommand.ts rename to protocol_tests/aws-restxml/src/commands/InputAndOutputWithHeadersCommand.ts diff --git a/protocol_tests/aws-restxml/commands/NestedXmlMapsCommand.ts b/protocol_tests/aws-restxml/src/commands/NestedXmlMapsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/NestedXmlMapsCommand.ts rename to protocol_tests/aws-restxml/src/commands/NestedXmlMapsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/NoInputAndNoOutputCommand.ts b/protocol_tests/aws-restxml/src/commands/NoInputAndNoOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/NoInputAndNoOutputCommand.ts rename to protocol_tests/aws-restxml/src/commands/NoInputAndNoOutputCommand.ts diff --git a/protocol_tests/aws-restxml/commands/NoInputAndOutputCommand.ts b/protocol_tests/aws-restxml/src/commands/NoInputAndOutputCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/NoInputAndOutputCommand.ts rename to protocol_tests/aws-restxml/src/commands/NoInputAndOutputCommand.ts diff --git a/protocol_tests/aws-restxml/commands/NullAndEmptyHeadersClientCommand.ts b/protocol_tests/aws-restxml/src/commands/NullAndEmptyHeadersClientCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/NullAndEmptyHeadersClientCommand.ts rename to protocol_tests/aws-restxml/src/commands/NullAndEmptyHeadersClientCommand.ts diff --git a/protocol_tests/aws-restxml/commands/NullAndEmptyHeadersServerCommand.ts b/protocol_tests/aws-restxml/src/commands/NullAndEmptyHeadersServerCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/NullAndEmptyHeadersServerCommand.ts rename to protocol_tests/aws-restxml/src/commands/NullAndEmptyHeadersServerCommand.ts diff --git a/protocol_tests/aws-restxml/commands/OmitsNullSerializesEmptyStringCommand.ts b/protocol_tests/aws-restxml/src/commands/OmitsNullSerializesEmptyStringCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/OmitsNullSerializesEmptyStringCommand.ts rename to protocol_tests/aws-restxml/src/commands/OmitsNullSerializesEmptyStringCommand.ts diff --git a/protocol_tests/aws-restxml/commands/QueryIdempotencyTokenAutoFillCommand.ts b/protocol_tests/aws-restxml/src/commands/QueryIdempotencyTokenAutoFillCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/QueryIdempotencyTokenAutoFillCommand.ts rename to protocol_tests/aws-restxml/src/commands/QueryIdempotencyTokenAutoFillCommand.ts diff --git a/protocol_tests/aws-restxml/commands/QueryParamsAsStringListMapCommand.ts b/protocol_tests/aws-restxml/src/commands/QueryParamsAsStringListMapCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/QueryParamsAsStringListMapCommand.ts rename to protocol_tests/aws-restxml/src/commands/QueryParamsAsStringListMapCommand.ts diff --git a/protocol_tests/aws-restxml/commands/QueryPrecedenceCommand.ts b/protocol_tests/aws-restxml/src/commands/QueryPrecedenceCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/QueryPrecedenceCommand.ts rename to protocol_tests/aws-restxml/src/commands/QueryPrecedenceCommand.ts diff --git a/protocol_tests/aws-restxml/commands/RecursiveShapesCommand.ts b/protocol_tests/aws-restxml/src/commands/RecursiveShapesCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/RecursiveShapesCommand.ts rename to protocol_tests/aws-restxml/src/commands/RecursiveShapesCommand.ts diff --git a/protocol_tests/aws-restxml/commands/SimpleScalarPropertiesCommand.ts b/protocol_tests/aws-restxml/src/commands/SimpleScalarPropertiesCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/SimpleScalarPropertiesCommand.ts rename to protocol_tests/aws-restxml/src/commands/SimpleScalarPropertiesCommand.ts diff --git a/protocol_tests/aws-restxml/commands/TimestampFormatHeadersCommand.ts b/protocol_tests/aws-restxml/src/commands/TimestampFormatHeadersCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/TimestampFormatHeadersCommand.ts rename to protocol_tests/aws-restxml/src/commands/TimestampFormatHeadersCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlAttributesCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlAttributesCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlAttributesCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlAttributesCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlAttributesOnPayloadCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlAttributesOnPayloadCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlAttributesOnPayloadCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlAttributesOnPayloadCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlBlobsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlBlobsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlBlobsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlEmptyBlobsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlEmptyBlobsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlEmptyBlobsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlEmptyBlobsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlEmptyListsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlEmptyListsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlEmptyListsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlEmptyListsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlEmptyMapsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlEmptyMapsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlEmptyMapsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlEmptyMapsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlEmptyStringsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlEmptyStringsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlEmptyStringsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlEmptyStringsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlEnumsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlEnumsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlEnumsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlEnumsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlListsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlListsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlListsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlListsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlMapsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlMapsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlMapsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlMapsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlMapsXmlNameCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlMapsXmlNameCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlMapsXmlNameCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlMapsXmlNameCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlNamespacesCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlNamespacesCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlNamespacesCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlNamespacesCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlTimestampsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlTimestampsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlTimestampsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlTimestampsCommand.ts diff --git a/protocol_tests/aws-restxml/commands/XmlUnionsCommand.ts b/protocol_tests/aws-restxml/src/commands/XmlUnionsCommand.ts similarity index 100% rename from protocol_tests/aws-restxml/commands/XmlUnionsCommand.ts rename to protocol_tests/aws-restxml/src/commands/XmlUnionsCommand.ts diff --git a/protocol_tests/aws-restxml/endpoints.ts b/protocol_tests/aws-restxml/src/endpoints.ts similarity index 100% rename from protocol_tests/aws-restxml/endpoints.ts rename to protocol_tests/aws-restxml/src/endpoints.ts diff --git a/protocol_tests/aws-restxml/index.ts b/protocol_tests/aws-restxml/src/index.ts similarity index 100% rename from protocol_tests/aws-restxml/index.ts rename to protocol_tests/aws-restxml/src/index.ts diff --git a/protocol_tests/aws-restxml/models/index.ts b/protocol_tests/aws-restxml/src/models/index.ts similarity index 100% rename from protocol_tests/aws-restxml/models/index.ts rename to protocol_tests/aws-restxml/src/models/index.ts diff --git a/protocol_tests/aws-restxml/models/models_0.ts b/protocol_tests/aws-restxml/src/models/models_0.ts similarity index 100% rename from protocol_tests/aws-restxml/models/models_0.ts rename to protocol_tests/aws-restxml/src/models/models_0.ts diff --git a/protocol_tests/aws-restxml/protocols/Aws_restXml.ts b/protocol_tests/aws-restxml/src/protocols/Aws_restXml.ts similarity index 100% rename from protocol_tests/aws-restxml/protocols/Aws_restXml.ts rename to protocol_tests/aws-restxml/src/protocols/Aws_restXml.ts diff --git a/protocol_tests/aws-restxml/src/runtimeConfig.browser.ts b/protocol_tests/aws-restxml/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..a1ce6a696bb2 --- /dev/null +++ b/protocol_tests/aws-restxml/src/runtimeConfig.browser.ts @@ -0,0 +1,37 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + requestHandler: config?.requestHandler ?? new FetchHttpHandler(), + retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-restxml/runtimeConfig.native.ts b/protocol_tests/aws-restxml/src/runtimeConfig.native.ts similarity index 100% rename from protocol_tests/aws-restxml/runtimeConfig.native.ts rename to protocol_tests/aws-restxml/src/runtimeConfig.native.ts diff --git a/protocol_tests/aws-restxml/runtimeConfig.shared.ts b/protocol_tests/aws-restxml/src/runtimeConfig.shared.ts similarity index 100% rename from protocol_tests/aws-restxml/runtimeConfig.shared.ts rename to protocol_tests/aws-restxml/src/runtimeConfig.shared.ts diff --git a/protocol_tests/aws-restxml/src/runtimeConfig.ts b/protocol_tests/aws-restxml/src/runtimeConfig.ts new file mode 100644 index 000000000000..fa72056c5d89 --- /dev/null +++ b/protocol_tests/aws-restxml/src/runtimeConfig.ts @@ -0,0 +1,40 @@ +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; + +import { Hash } from "@aws-sdk/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; +import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { RestXmlProtocolClientConfig } from "./RestXmlProtocolClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "node", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + requestHandler: config?.requestHandler ?? new NodeHttpHandler(), + retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/protocol_tests/aws-restxml/tests/functional/restxml.spec.ts b/protocol_tests/aws-restxml/test/functional/restxml.spec.ts similarity index 97% rename from protocol_tests/aws-restxml/tests/functional/restxml.spec.ts rename to protocol_tests/aws-restxml/test/functional/restxml.spec.ts index 6ac2e91586e4..dd8b0d0083b1 100644 --- a/protocol_tests/aws-restxml/tests/functional/restxml.spec.ts +++ b/protocol_tests/aws-restxml/test/functional/restxml.spec.ts @@ -1,57 +1,57 @@ -import { RestXmlProtocolClient } from "../../RestXmlProtocolClient"; -import { AllQueryStringTypesCommand } from "../../commands/AllQueryStringTypesCommand"; -import { BodyWithXmlNameCommand } from "../../commands/BodyWithXmlNameCommand"; -import { ConstantAndVariableQueryStringCommand } from "../../commands/ConstantAndVariableQueryStringCommand"; -import { ConstantQueryStringCommand } from "../../commands/ConstantQueryStringCommand"; -import { EmptyInputAndEmptyOutputCommand } from "../../commands/EmptyInputAndEmptyOutputCommand"; -import { EndpointOperationCommand } from "../../commands/EndpointOperationCommand"; -import { EndpointWithHostLabelHeaderOperationCommand } from "../../commands/EndpointWithHostLabelHeaderOperationCommand"; -import { EndpointWithHostLabelOperationCommand } from "../../commands/EndpointWithHostLabelOperationCommand"; -import { FlattenedXmlMapCommand } from "../../commands/FlattenedXmlMapCommand"; -import { FlattenedXmlMapWithXmlNameCommand } from "../../commands/FlattenedXmlMapWithXmlNameCommand"; -import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../commands/FlattenedXmlMapWithXmlNamespaceCommand"; -import { GreetingWithErrorsCommand } from "../../commands/GreetingWithErrorsCommand"; -import { HttpPayloadTraitsCommand } from "../../commands/HttpPayloadTraitsCommand"; -import { HttpPayloadTraitsWithMediaTypeCommand } from "../../commands/HttpPayloadTraitsWithMediaTypeCommand"; -import { HttpPayloadWithMemberXmlNameCommand } from "../../commands/HttpPayloadWithMemberXmlNameCommand"; -import { HttpPayloadWithStructureCommand } from "../../commands/HttpPayloadWithStructureCommand"; -import { HttpPayloadWithXmlNameCommand } from "../../commands/HttpPayloadWithXmlNameCommand"; -import { HttpPayloadWithXmlNamespaceAndPrefixCommand } from "../../commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; -import { HttpPayloadWithXmlNamespaceCommand } from "../../commands/HttpPayloadWithXmlNamespaceCommand"; -import { HttpPrefixHeadersCommand } from "../../commands/HttpPrefixHeadersCommand"; -import { HttpRequestWithFloatLabelsCommand } from "../../commands/HttpRequestWithFloatLabelsCommand"; -import { HttpRequestWithGreedyLabelInPathCommand } from "../../commands/HttpRequestWithGreedyLabelInPathCommand"; -import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../commands/HttpRequestWithLabelsAndTimestampFormatCommand"; -import { HttpRequestWithLabelsCommand } from "../../commands/HttpRequestWithLabelsCommand"; -import { HttpResponseCodeCommand } from "../../commands/HttpResponseCodeCommand"; -import { IgnoreQueryParamsInResponseCommand } from "../../commands/IgnoreQueryParamsInResponseCommand"; -import { InputAndOutputWithHeadersCommand } from "../../commands/InputAndOutputWithHeadersCommand"; -import { NestedXmlMapsCommand } from "../../commands/NestedXmlMapsCommand"; -import { NoInputAndNoOutputCommand } from "../../commands/NoInputAndNoOutputCommand"; -import { NoInputAndOutputCommand } from "../../commands/NoInputAndOutputCommand"; -import { NullAndEmptyHeadersClientCommand } from "../../commands/NullAndEmptyHeadersClientCommand"; -import { OmitsNullSerializesEmptyStringCommand } from "../../commands/OmitsNullSerializesEmptyStringCommand"; -import { QueryIdempotencyTokenAutoFillCommand } from "../../commands/QueryIdempotencyTokenAutoFillCommand"; -import { QueryParamsAsStringListMapCommand } from "../../commands/QueryParamsAsStringListMapCommand"; -import { QueryPrecedenceCommand } from "../../commands/QueryPrecedenceCommand"; -import { RecursiveShapesCommand } from "../../commands/RecursiveShapesCommand"; -import { SimpleScalarPropertiesCommand } from "../../commands/SimpleScalarPropertiesCommand"; -import { TimestampFormatHeadersCommand } from "../../commands/TimestampFormatHeadersCommand"; -import { XmlAttributesCommand } from "../../commands/XmlAttributesCommand"; -import { XmlAttributesOnPayloadCommand } from "../../commands/XmlAttributesOnPayloadCommand"; -import { XmlBlobsCommand } from "../../commands/XmlBlobsCommand"; -import { XmlEmptyBlobsCommand } from "../../commands/XmlEmptyBlobsCommand"; -import { XmlEmptyListsCommand } from "../../commands/XmlEmptyListsCommand"; -import { XmlEmptyMapsCommand } from "../../commands/XmlEmptyMapsCommand"; -import { XmlEmptyStringsCommand } from "../../commands/XmlEmptyStringsCommand"; -import { XmlEnumsCommand } from "../../commands/XmlEnumsCommand"; -import { XmlListsCommand } from "../../commands/XmlListsCommand"; -import { XmlMapsCommand } from "../../commands/XmlMapsCommand"; -import { XmlMapsXmlNameCommand } from "../../commands/XmlMapsXmlNameCommand"; -import { XmlNamespacesCommand } from "../../commands/XmlNamespacesCommand"; -import { XmlTimestampsCommand } from "../../commands/XmlTimestampsCommand"; -import { XmlUnionsCommand } from "../../commands/XmlUnionsCommand"; -import { ComplexError, InvalidGreeting } from "../../models/models_0"; +import { RestXmlProtocolClient } from "../../src/RestXmlProtocolClient"; +import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; +import { BodyWithXmlNameCommand } from "../../src/commands/BodyWithXmlNameCommand"; +import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand"; +import { ConstantQueryStringCommand } from "../../src/commands/ConstantQueryStringCommand"; +import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; +import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; +import { EndpointWithHostLabelHeaderOperationCommand } from "../../src/commands/EndpointWithHostLabelHeaderOperationCommand"; +import { EndpointWithHostLabelOperationCommand } from "../../src/commands/EndpointWithHostLabelOperationCommand"; +import { FlattenedXmlMapCommand } from "../../src/commands/FlattenedXmlMapCommand"; +import { FlattenedXmlMapWithXmlNameCommand } from "../../src/commands/FlattenedXmlMapWithXmlNameCommand"; +import { FlattenedXmlMapWithXmlNamespaceCommand } from "../../src/commands/FlattenedXmlMapWithXmlNamespaceCommand"; +import { GreetingWithErrorsCommand } from "../../src/commands/GreetingWithErrorsCommand"; +import { HttpPayloadTraitsCommand } from "../../src/commands/HttpPayloadTraitsCommand"; +import { HttpPayloadTraitsWithMediaTypeCommand } from "../../src/commands/HttpPayloadTraitsWithMediaTypeCommand"; +import { HttpPayloadWithMemberXmlNameCommand } from "../../src/commands/HttpPayloadWithMemberXmlNameCommand"; +import { HttpPayloadWithStructureCommand } from "../../src/commands/HttpPayloadWithStructureCommand"; +import { HttpPayloadWithXmlNameCommand } from "../../src/commands/HttpPayloadWithXmlNameCommand"; +import { HttpPayloadWithXmlNamespaceAndPrefixCommand } from "../../src/commands/HttpPayloadWithXmlNamespaceAndPrefixCommand"; +import { HttpPayloadWithXmlNamespaceCommand } from "../../src/commands/HttpPayloadWithXmlNamespaceCommand"; +import { HttpPrefixHeadersCommand } from "../../src/commands/HttpPrefixHeadersCommand"; +import { HttpRequestWithFloatLabelsCommand } from "../../src/commands/HttpRequestWithFloatLabelsCommand"; +import { HttpRequestWithGreedyLabelInPathCommand } from "../../src/commands/HttpRequestWithGreedyLabelInPathCommand"; +import { HttpRequestWithLabelsAndTimestampFormatCommand } from "../../src/commands/HttpRequestWithLabelsAndTimestampFormatCommand"; +import { HttpRequestWithLabelsCommand } from "../../src/commands/HttpRequestWithLabelsCommand"; +import { HttpResponseCodeCommand } from "../../src/commands/HttpResponseCodeCommand"; +import { IgnoreQueryParamsInResponseCommand } from "../../src/commands/IgnoreQueryParamsInResponseCommand"; +import { InputAndOutputWithHeadersCommand } from "../../src/commands/InputAndOutputWithHeadersCommand"; +import { NestedXmlMapsCommand } from "../../src/commands/NestedXmlMapsCommand"; +import { NoInputAndNoOutputCommand } from "../../src/commands/NoInputAndNoOutputCommand"; +import { NoInputAndOutputCommand } from "../../src/commands/NoInputAndOutputCommand"; +import { NullAndEmptyHeadersClientCommand } from "../../src/commands/NullAndEmptyHeadersClientCommand"; +import { OmitsNullSerializesEmptyStringCommand } from "../../src/commands/OmitsNullSerializesEmptyStringCommand"; +import { QueryIdempotencyTokenAutoFillCommand } from "../../src/commands/QueryIdempotencyTokenAutoFillCommand"; +import { QueryParamsAsStringListMapCommand } from "../../src/commands/QueryParamsAsStringListMapCommand"; +import { QueryPrecedenceCommand } from "../../src/commands/QueryPrecedenceCommand"; +import { RecursiveShapesCommand } from "../../src/commands/RecursiveShapesCommand"; +import { SimpleScalarPropertiesCommand } from "../../src/commands/SimpleScalarPropertiesCommand"; +import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand"; +import { XmlAttributesCommand } from "../../src/commands/XmlAttributesCommand"; +import { XmlAttributesOnPayloadCommand } from "../../src/commands/XmlAttributesOnPayloadCommand"; +import { XmlBlobsCommand } from "../../src/commands/XmlBlobsCommand"; +import { XmlEmptyBlobsCommand } from "../../src/commands/XmlEmptyBlobsCommand"; +import { XmlEmptyListsCommand } from "../../src/commands/XmlEmptyListsCommand"; +import { XmlEmptyMapsCommand } from "../../src/commands/XmlEmptyMapsCommand"; +import { XmlEmptyStringsCommand } from "../../src/commands/XmlEmptyStringsCommand"; +import { XmlEnumsCommand } from "../../src/commands/XmlEnumsCommand"; +import { XmlListsCommand } from "../../src/commands/XmlListsCommand"; +import { XmlMapsCommand } from "../../src/commands/XmlMapsCommand"; +import { XmlMapsXmlNameCommand } from "../../src/commands/XmlMapsXmlNameCommand"; +import { XmlNamespacesCommand } from "../../src/commands/XmlNamespacesCommand"; +import { XmlTimestampsCommand } from "../../src/commands/XmlTimestampsCommand"; +import { XmlUnionsCommand } from "../../src/commands/XmlUnionsCommand"; +import { ComplexError, InvalidGreeting } from "../../src/models/models_0"; import { buildQueryString } from "@aws-sdk/querystring-builder"; import { Encoder as __Encoder } from "@aws-sdk/types"; import { decodeHTML } from "entities"; diff --git a/protocol_tests/aws-restxml/tsconfig.es.json b/protocol_tests/aws-restxml/tsconfig.es.json index 9a4663842204..4c72364cd1a0 100644 --- a/protocol_tests/aws-restxml/tsconfig.es.json +++ b/protocol_tests/aws-restxml/tsconfig.es.json @@ -5,6 +5,6 @@ "module": "esnext", "moduleResolution": "node", "lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"], - "outDir": "dist/es" + "outDir": "dist-es" } } diff --git a/protocol_tests/aws-restxml/tsconfig.json b/protocol_tests/aws-restxml/tsconfig.json index f802cf188dc4..4dd6413bb0d1 100644 --- a/protocol_tests/aws-restxml/tsconfig.json +++ b/protocol_tests/aws-restxml/tsconfig.json @@ -11,7 +11,8 @@ "incremental": true, "resolveJsonModule": true, "esModuleInterop": true, - "outDir": "dist/cjs", + "rootDir": "src", + "outDir": "dist-cjs", "removeComments": true }, "typedocOptions": { @@ -27,5 +28,6 @@ "out": "docs", "theme": "minimal", "plugin": ["@aws-sdk/client-documentation-generator"] - } + }, + "exclude": ["test/**/*"] } diff --git a/protocol_tests/aws-restxml/tsconfig.types.json b/protocol_tests/aws-restxml/tsconfig.types.json index 717d516f1b87..b7018298d8ae 100644 --- a/protocol_tests/aws-restxml/tsconfig.types.json +++ b/protocol_tests/aws-restxml/tsconfig.types.json @@ -3,6 +3,7 @@ "compilerOptions": { "removeComments": false, "declaration": true, - "declarationDir": "dist/types" - } + "declarationDir": "dist-types" + }, + "exclude": ["test/**/*", "dist-types/**/*"] } diff --git a/tests/functional/util/regioninfo-provider.js b/tests/functional/util/regioninfo-provider.js index 056e074391b1..2d15dcf95608 100644 --- a/tests/functional/util/regioninfo-provider.js +++ b/tests/functional/util/regioninfo-provider.js @@ -1,5 +1,5 @@ const { join } = require("path"); module.exports.getRegionInfoProvider = (fromService) => { - const path = join("..", "..", "..", "clients", `client-${fromService}`, "dist", "cjs", "endpoints"); + const path = join("..", "..", "..", "clients", `client-${fromService}`, "dist-cjs", "endpoints"); return require(path).defaultRegionInfoProvider; }; diff --git a/yarn.lock b/yarn.lock index 6e53404cc19b..3807ed0f0ffb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1763,6 +1763,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + "@types/minimatch@*": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" @@ -2512,7 +2517,7 @@ arraybuffer.slice@~0.0.7: resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" integrity sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog== -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= @@ -3033,6 +3038,11 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +buffer-from@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + buffer-indexof-polyfill@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz#d2732135c5999c64b277fcf9b1abe3498254729c" @@ -4381,6 +4391,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^3.1.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" @@ -8244,7 +8259,7 @@ make-dir@^3.0.0: dependencies: semver "^6.0.0" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -11789,6 +11804,39 @@ ts-loader@^7.0.5: micromatch "^4.0.0" semver "^6.0.0" +ts-mocha@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" + integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== + dependencies: + ts-node "7.0.1" + optionalDependencies: + tsconfig-paths "^3.5.0" + +ts-node@7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-7.0.1.tgz#9562dc2d1e6d248d24bc55f773e3f614337d9baf" + integrity sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw== + dependencies: + arrify "^1.0.0" + buffer-from "^1.1.0" + diff "^3.1.0" + make-error "^1.1.1" + minimist "^1.2.0" + mkdirp "^0.5.1" + source-map-support "^0.5.6" + yn "^2.0.0" + +tsconfig-paths@^3.5.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" + integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + tslib@^1.11.1, tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -12890,6 +12938,11 @@ yeast@0.1.2: resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= +yn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" + integrity sha1-5a2ryKz0CPY4X8dklWhMiOavaJo= + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"