Skip to content

Commit e7ae112

Browse files
committed
chore: ssdk compatibility fixes
1 parent 1020623 commit e7ae112

File tree

7 files changed

+46
-22
lines changed

7 files changed

+46
-22
lines changed

private/aws-protocoltests-restjson/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@aws-sdk/util-user-agent-node": "*",
3636
"@smithy/config-resolver": "^4.4.3",
3737
"@smithy/core": "^3.18.5",
38+
"@smithy/eventstream-codec": "^4.2.5",
3839
"@smithy/eventstream-serde-browser": "^4.2.5",
3940
"@smithy/eventstream-serde-config-resolver": "^4.3.5",
4041
"@smithy/eventstream-serde-node": "^4.2.5",

private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
parseJsonErrorBody as parseErrorBody,
77
} from "@aws-sdk/core";
88
import { requestBuilder as rb } from "@smithy/core";
9+
import { Int64 as __Int64 } from "@smithy/eventstream-codec";
910
import {
1011
HttpRequest as __HttpRequest,
1112
HttpResponse as __HttpResponse,
@@ -5290,7 +5291,7 @@ const se_HeadersEvent_event = (input: HeadersEvent, context: __SerdeContext): __
52905291
headers["intHeader"] = { type: "integer", value: input.intHeader };
52915292
}
52925293
if (input.longHeader != null) {
5293-
headers["longHeader"] = { type: "long", value: input.longHeader };
5294+
headers["longHeader"] = { type: "long", value: __Int64.fromNumber(input.longHeader) };
52945295
}
52955296
if (input.blobHeader != null) {
52965297
headers["blobHeader"] = { type: "binary", value: input.blobHeader };

private/aws-restjson-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@aws-sdk/types": "*",
2525
"@aws-smithy/server-common": "1.0.0-alpha.10",
2626
"@smithy/config-resolver": "^4.4.3",
27+
"@smithy/eventstream-codec": "^4.2.5",
2728
"@smithy/fetch-http-handler": "^5.3.6",
2829
"@smithy/hash-node": "^4.2.5",
2930
"@smithy/invalid-dependency": "^4.2.5",

private/aws-restjson-server/src/models/models_0.ts

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,10 +1537,9 @@ export namespace EventStream {
15371537
break;
15381538
}
15391539
case "error": {
1540-
memberValidators["error"] = new __CompositeStructureValidator<ErrorEvent>(
1541-
new __NoOpValidator(),
1542-
ErrorEvent.validate
1543-
);
1540+
memberValidators["error"] = new __CompositeStructureValidator<ErrorEvent>(new __NoOpValidator(), () => [
1541+
/*Error validator unsupported*/
1542+
]);
15441543
break;
15451544
}
15461545
}
@@ -1618,7 +1617,10 @@ export namespace DuplexStreamInput {
16181617
}
16191618
return memberValidators[member]!;
16201619
}
1621-
return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)];
1620+
return [
1621+
// unsupported event stream validation
1622+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
1623+
];
16221624
};
16231625
}
16241626

@@ -1660,7 +1662,10 @@ export namespace DuplexStreamOutput {
16601662
}
16611663
return memberValidators[member]!;
16621664
}
1663-
return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)];
1665+
return [
1666+
// unsupported event stream validation
1667+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
1668+
];
16641669
};
16651670
}
16661671

@@ -1704,7 +1709,10 @@ export namespace DuplexStreamWithDistinctStreamsInput {
17041709
}
17051710
return memberValidators[member]!;
17061711
}
1707-
return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)];
1712+
return [
1713+
// unsupported event stream validation
1714+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
1715+
];
17081716
};
17091717
}
17101718

@@ -1882,7 +1890,8 @@ export namespace DuplexStreamWithInitialMessagesInput {
18821890
}
18831891
return [
18841892
...getMemberValidator("initialRequestMember").validate(obj.initialRequestMember, `${path}/initialRequestMember`),
1885-
...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
1893+
// unsupported event stream validation
1894+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
18861895
];
18871896
};
18881897
}
@@ -1938,7 +1947,8 @@ export namespace DuplexStreamWithInitialMessagesOutput {
19381947
obj.initialResponseMember,
19391948
`${path}/initialResponseMember`
19401949
),
1941-
...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
1950+
// unsupported event stream validation
1951+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
19421952
];
19431953
};
19441954
}
@@ -3277,7 +3287,10 @@ export namespace InputStreamInput {
32773287
}
32783288
return memberValidators[member]!;
32793289
}
3280-
return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)];
3290+
return [
3291+
// unsupported event stream validation
3292+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
3293+
];
32813294
};
32823295
}
32833296

@@ -3327,7 +3340,8 @@ export namespace InputStreamWithInitialRequestInput {
33273340
}
33283341
return [
33293342
...getMemberValidator("initialRequestMember").validate(obj.initialRequestMember, `${path}/initialRequestMember`),
3330-
...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
3343+
// unsupported event stream validation
3344+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
33313345
];
33323346
};
33333347
}
@@ -6229,7 +6243,10 @@ export namespace OutputStreamOutput {
62296243
}
62306244
return memberValidators[member]!;
62316245
}
6232-
return [...getMemberValidator("stream").validate(obj.stream, `${path}/stream`)];
6246+
return [
6247+
// unsupported event stream validation
6248+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
6249+
];
62336250
};
62346251
}
62356252

@@ -6284,7 +6301,8 @@ export namespace OutputStreamWithInitialResponseOutput {
62846301
obj.initialResponseMember,
62856302
`${path}/initialResponseMember`
62866303
),
6287-
...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
6304+
// unsupported event stream validation
6305+
// ...getMemberValidator("stream").validate(obj.stream, `${path}/stream`),
62886306
];
62896307
};
62906308
}

private/aws-restjson-server/src/protocols/Aws_restJson1.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
SmithyFrameworkException as __SmithyFrameworkException,
1515
UnsupportedMediaTypeException as __UnsupportedMediaTypeException,
1616
} from "@aws-smithy/server-common";
17+
import { Int64 as __Int64 } from "@smithy/eventstream-codec";
1718
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
1819
import {
1920
_json,
@@ -4547,7 +4548,7 @@ export const serializeDuplexStreamResponse = async (
45474548
input: DuplexStreamServerOutput,
45484549
ctx: ServerSerdeContext
45494550
): Promise<__HttpResponse> => {
4550-
const context: __SerdeContext = {
4551+
const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = {
45514552
...ctx,
45524553
endpoint: () =>
45534554
Promise.resolve({
@@ -4629,7 +4630,7 @@ export const serializeDuplexStreamWithInitialMessagesResponse = async (
46294630
input: DuplexStreamWithInitialMessagesServerOutput,
46304631
ctx: ServerSerdeContext
46314632
): Promise<__HttpResponse> => {
4632-
const context: __SerdeContext = {
4633+
const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = {
46334634
...ctx,
46344635
endpoint: () =>
46354636
Promise.resolve({
@@ -7551,7 +7552,7 @@ export const serializeOutputStreamResponse = async (
75517552
input: OutputStreamServerOutput,
75527553
ctx: ServerSerdeContext
75537554
): Promise<__HttpResponse> => {
7554-
const context: __SerdeContext = {
7555+
const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = {
75557556
...ctx,
75567557
endpoint: () =>
75577558
Promise.resolve({
@@ -7590,7 +7591,7 @@ export const serializeOutputStreamWithInitialResponseResponse = async (
75907591
input: OutputStreamWithInitialResponseServerOutput,
75917592
ctx: ServerSerdeContext
75927593
): Promise<__HttpResponse> => {
7593-
const context: __SerdeContext = {
7594+
const context: __SerdeContext & any /*event stream context unsupported in ssdk*/ = {
75947595
...ctx,
75957596
endpoint: () =>
75967597
Promise.resolve({
@@ -8871,7 +8872,7 @@ const se_HeadersEvent_event = (input: HeadersEvent, context: __SerdeContext): __
88718872
headers["intHeader"] = { type: "integer", value: input.intHeader };
88728873
}
88738874
if (input.longHeader != null) {
8874-
headers["longHeader"] = { type: "long", value: input.longHeader };
8875+
headers["longHeader"] = { type: "long", value: __Int64.fromNumber(input.longHeader) };
88758876
}
88768877
if (input.blobHeader != null) {
88778878
headers["blobHeader"] = { type: "binary", value: input.blobHeader };
@@ -9093,7 +9094,7 @@ const de_ErrorEventRes = async (parsedOutput: any, context: __SerdeContext): Pro
90939094
message: __expectString,
90949095
});
90959096
Object.assign(contents, doc);
9096-
const exception = new ErrorEvent({
9097+
const exception: any /* $metadata unsupported on ssdk error */ = new ErrorEvent({
90979098
$metadata: deserializeMetadata(parsedOutput),
90989099
...contents,
90999100
});

scripts/generate-clients/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
module.exports = {
33
// Use full commit hash as we explicitly fetch it.
44
// Comparison link (update with previous hash):
5-
// https://github.com/smithy-lang/smithy-typescript/compare/7be577c4d67a62cb304470718cc11222c991bcbf...080031a1ab842acf8e9683ffedd394cdf23bd0ce
6-
SMITHY_TS_COMMIT: "080031a1ab842acf8e9683ffedd394cdf23bd0ce",
5+
// https://github.com/smithy-lang/smithy-typescript/compare/7be577c4d67a62cb304470718cc11222c991bcbf...775cd5b119247e544cfa1c51feb89b9e18805725
6+
SMITHY_TS_COMMIT: "775cd5b119247e544cfa1c51feb89b9e18805725",
77
};
88

99
if (module.exports.SMITHY_TS_COMMIT.length < 40) {

yarn.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ __metadata:
10721072
"@aws-sdk/util-user-agent-node": "npm:*"
10731073
"@smithy/config-resolver": "npm:^4.4.3"
10741074
"@smithy/core": "npm:^3.18.5"
1075+
"@smithy/eventstream-codec": "npm:^4.2.5"
10751076
"@smithy/eventstream-serde-browser": "npm:^4.2.5"
10761077
"@smithy/eventstream-serde-config-resolver": "npm:^4.3.5"
10771078
"@smithy/eventstream-serde-node": "npm:^4.2.5"
@@ -1344,6 +1345,7 @@ __metadata:
13441345
"@aws-sdk/types": "npm:*"
13451346
"@aws-smithy/server-common": "npm:1.0.0-alpha.10"
13461347
"@smithy/config-resolver": "npm:^4.4.3"
1348+
"@smithy/eventstream-codec": "npm:^4.2.5"
13471349
"@smithy/fetch-http-handler": "npm:^5.3.6"
13481350
"@smithy/hash-node": "npm:^4.2.5"
13491351
"@smithy/invalid-dependency": "npm:^4.2.5"

0 commit comments

Comments
 (0)