From b91e61a6c36d1a8eb75bc92e96cf6ebe36b1402a Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Thu, 22 Jul 2021 20:39:16 +0000 Subject: [PATCH] fix: support undefinned client config --- .../smithy/typescript/codegen/runtimeConfig.browser.ts.template | 2 +- .../smithy/typescript/codegen/runtimeConfig.native.ts.template | 2 +- .../smithy/typescript/codegen/runtimeConfig.shared.ts.template | 2 +- .../amazon/smithy/typescript/codegen/runtimeConfig.ts.template | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template index 43ba05ed972..fab8b334c58 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.browser.ts.template @@ -4,7 +4,7 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar /** * @internal */ -export const getRuntimeConfig = (config: ${clientConfigName}) => { +export const getRuntimeConfig = (config: ${clientConfigName} = {}) => { const clientSharedValues = getSharedRuntimeConfig(config); return { ...clientSharedValues, diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.native.ts.template b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.native.ts.template index 705735d7203..117f122384d 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.native.ts.template +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.native.ts.template @@ -4,7 +4,7 @@ import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.bro /** * @internal */ -export const getRuntimeConfig = (config: ${clientConfigName}) => { +export const getRuntimeConfig = (config: ${clientConfigName} = {}) => { const browserDefaults = getBrowserRuntimeConfig(config); return { ...browserDefaults, diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.shared.ts.template b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.shared.ts.template index 5ec08befe15..67141d8c19c 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.shared.ts.template +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.shared.ts.template @@ -3,7 +3,7 @@ import { ${clientConfigName} } from "${clientModuleName}"; /** * @internal */ -export const getRuntimeConfig = (config: ${clientConfigName}) => ({ +export const getRuntimeConfig = (config: ${clientConfigName} = {}) => ({ apiVersion: "${apiVersion}", ${customizations} }); diff --git a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template index 532d4ca44a3..30034a8b99b 100644 --- a/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template +++ b/smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/runtimeConfig.ts.template @@ -4,7 +4,7 @@ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shar /** * @internal */ -export const getRuntimeConfig = (config: ${clientConfigName}) => { +export const getRuntimeConfig = (config: ${clientConfigName} = {}) => { const clientSharedValues = getSharedRuntimeConfig(config); return { ...clientSharedValues,