Skip to content

Commit

Permalink
Import fromBase64 and toBase64 from util-base64 (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Nov 3, 2022
1 parent 20949f2 commit b9ee252
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 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 @@ -150,6 +126,18 @@ final class RuntimeConfigGenerator {
}
);
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,6 +61,7 @@ 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 b9ee252

Please sign in to comment.