Skip to content
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Smithy Typescript Codegen Changelog

## 0.38.0 (2025-11-20)

### Features

- Upgraded to smithy version 1.64.0 ([#1784](https://github.com/smithy-lang/smithy-typescript/pull/1784))
- Divided codegen models folder into enums, errors, and other interfaces ([#1770](https://github.com/smithy-lang/smithy-typescript/pull/1770))

## 0.37.0 (2025-11-04)

### Features
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ generate-protocol-tests:
npx prettier --write ./private/my-local-model
npx prettier --write ./private/my-local-model-schema
yarn
(cd ./private/smithy-rpcv2-cbor && npm run build)
(cd ./private/smithy-rpcv2-cbor-schema && npm run build)
(cd ./private/my-local-model && npm run build)
yarn turbo run build -F="./private/*" --only

test-protocols:
(cd ./private/smithy-rpcv2-cbor && npx vitest run --globals)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ To add a minimal `typescript-client-codegen` plugin, add the following to `smith
"sources": ["models"],
// Add the Smithy TypeScript code generator dependency
"maven": {
"dependencies": ["software.amazon.smithy.typescript:smithy-typescript-codegen:0.37.0"]
"dependencies": ["software.amazon.smithy.typescript:smithy-typescript-codegen:0.38.0"]
},
"plugins": {
// Add the Smithy TypeScript client plugin
Expand Down Expand Up @@ -139,7 +139,7 @@ dependencies {
smithyCli("software.amazon.smithy:smithy-cli:$smithyVersion")

// Add the Smithy TypeScript code generator dependency
implementation("software.amazon.smithy.typescript:smithy-typescript-codegen:0.37.0")
implementation("software.amazon.smithy.typescript:smithy-typescript-codegen:0.38.0")

// Uncomment below to add various smithy dependencies (see full list of smithy dependencies in https://github.com/awslabs/smithy)
// implementation("software.amazon.smithy:smithy-model:$smithyVersion")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {

allprojects {
group = "software.amazon.smithy.typescript"
version = "0.37.0"
version = "0.38.0"
}

// The root project doesn't produce a JAR.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
smithyVersion=1.63.0
smithyVersion=1.64.0
smithyGradleVersion=1.3.0
org.gradle.configuration-cache=true
org.gradle.configuration-cache.inputs.unsafe.ignore.file-system-checks=build/jreleaser/marker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,166 +15,166 @@
import software.amazon.smithy.model.traits.SensitiveTrait;

public class SensitiveDataFinderTest {
StringShape sensitiveString = StringShape.builder()
.addTrait(new SensitiveTrait())
.id("foo.bar#sensitiveString")
.build();

StringShape dullString = StringShape.builder()
.id("foo.bar#dullString")
.build();

MemberShape memberWithSensitiveData = MemberShape.builder()
.id("foo.bar#sensitive$member")
.target(sensitiveString.getId())
.build();

MemberShape memberWithDullData = MemberShape.builder()
.id("foo.bar#dull$member")
.target(dullString.getId())
.build();

MemberShape listMemberWithSensitiveData = MemberShape.builder()
.id("foo.bar#listSensitive$member")
.target(sensitiveString.getId())
.build();

MemberShape listMemberWithDullData = MemberShape.builder()
.id("foo.bar#listDull$member")
.target(dullString.getId())
.build();

MemberShape mapMemberWithSensitiveKeyData = MemberShape.builder()
.id("foo.bar#mapSensitiveKey$member")
.target(sensitiveString.getId())
.build();

MemberShape mapMemberWithSensitiveValueData = MemberShape.builder()
.id("foo.bar#mapSensitiveValue$member")
.target(sensitiveString.getId())
.build();

StructureShape structureShapeSensitive = StructureShape.builder()
.id("foo.bar#sensitive")
.members(
Collections.singleton(memberWithSensitiveData))
.build();

StructureShape structureShapeDull = StructureShape.builder()
.id("foo.bar#dull")
.members(
Collections.singleton(memberWithDullData))
.build();

CollectionShape collectionSensitive = ListShape.builder()
.id("foo.bar#listSensitive")
.addMember(listMemberWithSensitiveData)
.build();

CollectionShape collectionDull = ListShape.builder()
.id("foo.bar#listDull")
.addMember(listMemberWithDullData)
.build();

MapShape mapSensitiveKey = MapShape.builder()
.id("foo.bar#mapSensitiveKey")
.key(mapMemberWithSensitiveKeyData)
.value(MemberShape.builder()
.id("foo.bar#mapSensitiveKey$member")
.target(dullString.getId())
.build())
.build();

MapShape mapSensitiveValue = MapShape.builder()
.id("foo.bar#mapSensitiveValue")
.key(MemberShape.builder()
.id("foo.bar#mapSensitiveValue$member")
.target(dullString.getId())
.build())
.value(mapMemberWithSensitiveValueData)
.build();

MapShape mapDull = MapShape.builder()
.id("foo.bar#mapDull")
.key(MemberShape.builder()
.id("foo.bar#mapDull$member")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapDull$member")
.target(dullString.getId())
.build())
.build();

MapShape nested2 = MapShape.builder()
.id("foo.bar#mapNested2")
.key(MemberShape.builder()
.id("foo.bar#mapNested2$member")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapNested2$member")
.target(mapSensitiveValue)
.build())
.build();

MapShape nested = MapShape.builder()
.id("foo.bar#mapNested")
.key(MemberShape.builder()
.id("foo.bar#mapNested$member")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapNested$member")
.target(nested2)
.build())
.build();

private Model model = Model.builder()
.addShapes(
sensitiveString, dullString,
memberWithSensitiveData, memberWithDullData,
structureShapeSensitive, structureShapeDull,
collectionSensitive, collectionDull,
mapSensitiveKey, mapSensitiveValue, mapDull,
nested, nested2)
.build();

private SensitiveDataFinder sensitiveDataFinder = new SensitiveDataFinder(model);

@Test
public void findsSensitiveData_inShapes() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(sensitiveString), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(dullString), equalTo(false));
}

@Test
public void findsSensitiveData_inTargetShapes() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithSensitiveData), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithDullData), equalTo(false));
}

@Test
public void findsSensitiveData_inStructures() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeSensitive), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeDull), equalTo(false));
}

@Test
public void findsSensitiveData_inCollections() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionSensitive), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionDull), equalTo(false));
}

@Test
public void findsSensitiveData_inMaps() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveKey), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveValue), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapDull), equalTo(false));
}

@Test
public void findsSensitiveData_deeplyNested() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(nested), equalTo(true));
}
StringShape sensitiveString = StringShape.builder()
.addTrait(new SensitiveTrait())
.id("foo.bar#sensitiveString")
.build();

StringShape dullString = StringShape.builder()
.id("foo.bar#dullString")
.build();

MemberShape memberWithSensitiveData = MemberShape.builder()
.id("foo.bar#sensitive$member")
.target(sensitiveString.getId())
.build();

MemberShape memberWithDullData = MemberShape.builder()
.id("foo.bar#dull$member")
.target(dullString.getId())
.build();

MemberShape listMemberWithSensitiveData = MemberShape.builder()
.id("foo.bar#listSensitive$member")
.target(sensitiveString.getId())
.build();

MemberShape listMemberWithDullData = MemberShape.builder()
.id("foo.bar#listDull$member")
.target(dullString.getId())
.build();

MemberShape mapMemberWithSensitiveKeyData = MemberShape.builder()
.id("foo.bar#mapSensitiveKey$member")
.target(sensitiveString.getId())
.build();

MemberShape mapMemberWithSensitiveValueData = MemberShape.builder()
.id("foo.bar#mapSensitiveValue$member")
.target(sensitiveString.getId())
.build();

StructureShape structureShapeSensitive = StructureShape.builder()
.id("foo.bar#sensitive")
.members(
Collections.singleton(memberWithSensitiveData))
.build();

StructureShape structureShapeDull = StructureShape.builder()
.id("foo.bar#dull")
.members(
Collections.singleton(memberWithDullData))
.build();

CollectionShape collectionSensitive = ListShape.builder()
.id("foo.bar#listSensitive")
.addMember(listMemberWithSensitiveData)
.build();

CollectionShape collectionDull = ListShape.builder()
.id("foo.bar#listDull")
.addMember(listMemberWithDullData)
.build();

MapShape mapSensitiveKey = MapShape.builder()
.id("foo.bar#mapSensitiveKey")
.key(mapMemberWithSensitiveKeyData)
.value(MemberShape.builder()
.id("foo.bar#mapSensitiveKey$key")
.target(dullString.getId())
.build())
.build();

MapShape mapSensitiveValue = MapShape.builder()
.id("foo.bar#mapSensitiveValue")
.key(MemberShape.builder()
.id("foo.bar#mapSensitiveValue$key")
.target(dullString.getId())
.build())
.value(mapMemberWithSensitiveValueData)
.build();

MapShape mapDull = MapShape.builder()
.id("foo.bar#mapDull")
.key(MemberShape.builder()
.id("foo.bar#mapDull$key")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapDull$value")
.target(dullString.getId())
.build())
.build();

MapShape nested2 = MapShape.builder()
.id("foo.bar#mapNested2")
.key(MemberShape.builder()
.id("foo.bar#mapNested2$key")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapNested2$value")
.target(mapSensitiveValue)
.build())
.build();

MapShape nested = MapShape.builder()
.id("foo.bar#mapNested")
.key(MemberShape.builder()
.id("foo.bar#mapNested$key")
.target(dullString.getId())
.build())
.value(MemberShape.builder()
.id("foo.bar#mapNested$value")
.target(nested2)
.build())
.build();

private Model model = Model.builder()
.addShapes(
sensitiveString, dullString,
memberWithSensitiveData, memberWithDullData,
structureShapeSensitive, structureShapeDull,
collectionSensitive, collectionDull,
mapSensitiveKey, mapSensitiveValue, mapDull,
nested, nested2)
.build();

private SensitiveDataFinder sensitiveDataFinder = new SensitiveDataFinder(model);

@Test
public void findsSensitiveData_inShapes() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(sensitiveString), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(dullString), equalTo(false));
}

@Test
public void findsSensitiveData_inTargetShapes() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithSensitiveData), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(memberWithDullData), equalTo(false));
}

@Test
public void findsSensitiveData_inStructures() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeSensitive), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(structureShapeDull), equalTo(false));
}

@Test
public void findsSensitiveData_inCollections() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionSensitive), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(collectionDull), equalTo(false));
}

@Test
public void findsSensitiveData_inMaps() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveKey), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapSensitiveValue), equalTo(true));
assertThat(sensitiveDataFinder.findsSensitiveDataIn(mapDull), equalTo(false));
}

@Test
public void findsSensitiveData_deeplyNested() {
assertThat(sensitiveDataFinder.findsSensitiveDataIn(nested), equalTo(true));
}
}
Loading