Skip to content

Commit

Permalink
chore(codegen): update smithy-typescript commit (#5510)
Browse files Browse the repository at this point in the history
* chore(codegen): revert 03d6230

This reverts commit 03d6230.

* chore(codegen): update smithy-typescript commit

* feat(experimentalIdentityAndAuth): update STS customizations

* chore(codegen): generate clients
  • Loading branch information
Steven Yuan authored Dec 13, 2023
1 parent 03d6230 commit 7759481
Show file tree
Hide file tree
Showing 24 changed files with 4,980 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ export class InvokeAgentCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonBedrockAgentRunTimeService",
operation: "InvokeAgent",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ export class InvokeModelWithResponseStreamCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonBedrockFrontendService",
operation: "InvokeModelWithResponseStream",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ export class StartLiveTailCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "Logs_20140328",
operation: "StartLiveTail",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
2 changes: 1 addition & 1 deletion clients/client-codecatalyst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@smithy/config-resolver": "^2.0.21",
"@smithy/core": "^1.0.5",
"@smithy/core": "^1.1.0",
"@smithy/fetch-http-handler": "^2.3.1",
"@smithy/hash-node": "^2.0.17",
"@smithy/invalid-dependency": "^2.0.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ export class SubscribeToShardCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "Kinesis_20131202",
operation: "SubscribeToShard",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ export class InvokeWithResponseStreamCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSGirApiService",
operation: "InvokeWithResponseStream",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ export class StartConversationCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AWSDeepSenseRunTimeServiceApi2_0",
operation: "StartConversation",
/**
* @internal
*/
eventStream: {
input: true,
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ export class StartFaceLivenessSessionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "RekognitionStreamingService",
operation: "StartFaceLivenessSession",
/**
* @internal
*/
eventStream: {
input: true,
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
6 changes: 6 additions & 0 deletions clients/client-s3/src/commands/SelectObjectContentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ export class SelectObjectContentCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "SelectObjectContent",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ export class InvokeEndpointWithResponseStreamCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "AmazonSageMakerRuntime",
operation: "InvokeEndpointWithResponseStream",
/**
* @internal
*/
eventStream: {
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
7 changes: 5 additions & 2 deletions clients/client-sts/src/defaultStsRoleAssumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ export const decorateDefaultCredentialProvider =
(provider: DefaultCredentialProvider): DefaultCredentialProvider =>
(input: STSClientResolvedConfig) =>
provider({
roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor),
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor),
roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor as new (options: STSClientConfig) => STSClient),
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(
input,
input.stsClientCtor as new (options: STSClientConfig) => STSClient
),
...input,
});
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ export class StartCallAnalyticsStreamTranscriptionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "Transcribe",
operation: "StartCallAnalyticsStreamTranscription",
/**
* @internal
*/
eventStream: {
input: true,
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ export class StartMedicalStreamTranscriptionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "Transcribe",
operation: "StartMedicalStreamTranscription",
/**
* @internal
*/
eventStream: {
input: true,
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ export class StartStreamTranscriptionCommand extends $Command<
[SMITHY_CONTEXT_KEY]: {
service: "Transcribe",
operation: "StartStreamTranscription",
/**
* @internal
*/
eventStream: {
input: true,
output: true,
},
},
};
const { requestHandler } = configuration;
Expand Down
1 change: 0 additions & 1 deletion codegen/generic-client-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ plugins {
dependencies {
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
implementation("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
implementation("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
implementation(project(":smithy-aws-typescript-codegen"))
}

Expand Down
29 changes: 0 additions & 29 deletions codegen/generic-client-test-codegen/model/weather.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ $version: "2.0"
namespace example.weather

use aws.auth#sigv4
use aws.api#service

@authDefinition
@trait
Expand All @@ -13,7 +12,6 @@ structure customAuth {}
@protocolDefinition
structure fakeProtocol {}

@service(sdkId: "weather")
@fakeProtocol
@httpApiKeyAuth(name: "X-Api-Key", in: "header")
@httpBearerAuth
Expand Down Expand Up @@ -88,30 +86,3 @@ operation SameAsService {
service: String
}
}

apply Weather @smithy.rules#endpointRuleSet({
"version": "1.3",
"parameters": {
"Region": {
"required": true,
"type": "String",
"documentation": "docs"
}
},
"rules": [
{
"conditions": [],
"documentation": "base rule",
"endpoint": {
"url": "https://{Region}.amazonaws.com",
"properties": {},
"headers": {}
},
"type": "endpoint"
}
]
})

apply Weather @smithy.rules#clientContextParams(
Region: {type: "string", documentation: "docs"}
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import software.amazon.smithy.typescript.codegen.CodegenUtils;
import software.amazon.smithy.typescript.codegen.LanguageTarget;
import software.amazon.smithy.typescript.codegen.TypeScriptCodegenContext;
import software.amazon.smithy.typescript.codegen.TypeScriptDependency;
import software.amazon.smithy.typescript.codegen.TypeScriptSettings;
import software.amazon.smithy.typescript.codegen.TypeScriptWriter;
import software.amazon.smithy.typescript.codegen.auth.AuthUtils;
Expand Down Expand Up @@ -78,27 +79,6 @@ public List<String> runAfter() {
AwsSdkCustomizeSigV4Auth.class.getCanonicalName());
}

// @Override
// public List<RuntimeClientPlugin> getClientPlugins() {
// return ListUtils.of(
// RuntimeClientPlugin.builder()
// .inputConfig(Symbol.builder()
// .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, "/")
// .name("StsAuthInputConfig")
// .build())
// .resolvedConfig(Symbol.builder()
// .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, "/")
// .name("StsAuthResolvedConfig")
// .build())
// .resolveFunction(Symbol.builder()
// .namespace(AuthUtils.HTTP_AUTH_SCHEME_PROVIDER_MODULE, "/")
// .name("resolveStsAuthConfig")
// .build())
// .servicePredicate((m, s) -> isSTSService(s.toShapeId()))
// .build()
// );
// }

@Override
public Model preprocessModel(Model model, TypeScriptSettings settings) {
return backfillOptionalAuthOperations(model, settings);
Expand Down Expand Up @@ -208,12 +188,13 @@ public void customize(TypeScriptCodegenContext codegenContext) {
w.addRelativeImport(serviceSymbol.getName() + "Config", null,
Paths.get(".", serviceSymbol.getNamespace()));
w.write("export interface StsAuthInputConfig {}\n");
w.openBlock("export interface StsAuthResolvedConfig {", "}\n", () -> {
w.writeDocs("""
w.openBlock("export interface StsAuthResolvedConfig {", "}\n", () -> w
.writeDocs("""
Reference to STSClient class constructor.
@internal""")
.write("stsClientCtor: new (config: STSClientConfig) => STSClient");
});
.addDependency(TypeScriptDependency.SMITHY_TYPES)
.addImport("Client", null, TypeScriptDependency.SMITHY_TYPES)
.write("stsClientCtor: new (clientConfig: any) => Client<any, any, any>;"));
w.openBlock("""
export const resolveStsAuthConfig = <T>(
input: T & StsAuthInputConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const decorateDefaultCredentialProvider =
(provider: DefaultCredentialProvider): DefaultCredentialProvider =>
(input: STSClientResolvedConfig) =>
provider({
roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor),
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor),
roleAssumer: getDefaultRoleAssumer(input, input.stsClientCtor as new (options: STSClientConfig) => STSClient),
roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity(input, input.stsClientCtor as new (options: STSClientConfig) => STSClient),
...input,
});
Loading

0 comments on commit 7759481

Please sign in to comment.