Skip to content

Commit

Permalink
Import fromUtf8 and toUtf8 from util-base64
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 2, 2022
1 parent 20949f2 commit 0ea90cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ final class RuntimeConfigGenerator {
TypeScriptDependency.AWS_SDK_NODE_HTTP_HANDLER.packageName);
writer.write("streamCollector");
},
"base64Decoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64_NODE);
writer.addImport("fromBase64", "fromBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64_NODE.packageName);
writer.write("fromBase64");
},
"base64Encoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64_NODE);
writer.addImport("toBase64", "toBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64_NODE.packageName);
writer.write("toBase64");
},
"utf8Decoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_UTF8_NODE);
writer.addImport("fromUtf8", "fromUtf8",
Expand Down Expand Up @@ -116,18 +104,6 @@ final class RuntimeConfigGenerator {
TypeScriptDependency.AWS_SDK_FETCH_HTTP_HANDLER.packageName);
writer.write("streamCollector");
},
"base64Decoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64_BROWSER);
writer.addImport("fromBase64", "fromBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64_BROWSER.packageName);
writer.write("fromBase64");
},
"base64Encoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64_BROWSER);
writer.addImport("toBase64", "toBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64_BROWSER.packageName);
writer.write("toBase64");
},
"utf8Decoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_UTF8_BROWSER);
writer.addImport("fromUtf8", "fromUtf8",
Expand All @@ -149,7 +125,19 @@ final class RuntimeConfigGenerator {
writer.write("Sha256");
}
);
private final Map<String, Consumer<TypeScriptWriter>> sharedRuntimeConfigDefaults = MapUtils.of(
private final Map<String, Consumer<TypeScriptWriter>> sharedRuntimeConfigDefaults = MapUtils.of(
"base64Decoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64);
writer.addImport("fromBase64", "fromBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64.packageName);
writer.write("fromBase64");
},
"base64Encoder", writer -> {
writer.addDependency(TypeScriptDependency.AWS_SDK_UTIL_BASE64);
writer.addImport("toBase64", "toBase64",
TypeScriptDependency.AWS_SDK_UTIL_BASE64.packageName);
writer.write("toBase64");
},
"disableHostPrefix", writer -> {
writer.write("false");
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public enum TypeScriptDependency implements SymbolDependencyContainer {

AWS_SDK_UTIL_BASE64_BROWSER("dependencies", "@aws-sdk/util-base64-browser", true),
AWS_SDK_UTIL_BASE64_NODE("dependencies", "@aws-sdk/util-base64-node", true),

AWS_SDK_UTIL_BASE64("dependencies", "@aws-sdk/util-base64", true),

AWS_SDK_UTIL_BODY_LENGTH_BROWSER("dependencies", "@aws-sdk/util-body-length-browser", true),
AWS_SDK_UTIL_BODY_LENGTH_NODE("dependencies", "@aws-sdk/util-body-length-node", true),

Expand Down

0 comments on commit 0ea90cc

Please sign in to comment.