Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use util-stream package #775

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ public enum TypeScriptDependency implements SymbolDependencyContainer {
HTML_ENTITIES("dependencies", "entities", "2.2.0", false),

// Conditionally added when streaming blob response payload exists.
UTIL_STREAM_NODE("dependencies", "@aws-sdk/util-stream-node", false),
UTIL_STREAM_BROWSER("dependencies", "@aws-sdk/util-stream-browser", false),
@Deprecated UTIL_STREAM_NODE("dependencies", "@aws-sdk/util-stream-node", false),
@Deprecated UTIL_STREAM_BROWSER("dependencies", "@aws-sdk/util-stream-browser", false),
UTIL_STREAM("dependencies", "@aws-sdk/util-stream", false),

// Server dependency for SSDKs
SERVER_COMMON("dependencies", "@aws-smithy/server-common", "1.0.0-alpha.10", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,15 @@ public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(
if (!hasStreamingBlobDeser(settings, model)) {
return Collections.emptyMap();
}
switch (target) {
case NODE:
return MapUtils.of("sdkStreamMixin", writer -> {
writer.addDependency(TypeScriptDependency.UTIL_STREAM_NODE);
writer.addImport("sdkStreamMixin", "sdkStreamMixin",
TypeScriptDependency.UTIL_STREAM_NODE.packageName);
writer.write("sdkStreamMixin");
});
case BROWSER:
return MapUtils.of("sdkStreamMixin", writer -> {
writer.addDependency(TypeScriptDependency.UTIL_STREAM_BROWSER);
writer.addImport("sdkStreamMixin", "sdkStreamMixin",
TypeScriptDependency.UTIL_STREAM_BROWSER.packageName);
writer.write("sdkStreamMixin");
});
default:
return Collections.emptyMap();

if (target == LanguageTarget.SHARED) {
return MapUtils.of("sdkStreamMixin", writer -> {
writer.addDependency(TypeScriptDependency.UTIL_STREAM);
writer.addImport("sdkStreamMixin", "sdkStreamMixin", TypeScriptDependency.UTIL_STREAM);
writer.write("sdkStreamMixin");
});
} else {
return Collections.emptyMap();
}
}

Expand Down