Skip to content

Commit cbb3a21

Browse files
committed
feat(codegen): support type import statements
1 parent ca0ee3f commit cbb3a21

File tree

123 files changed

+5260
-4007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+5260
-4007
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ generate-protocol-tests:
1818
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model
1919
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model-schema/typescript-client-codegen/ ./private/my-local-model-schema
2020
node ./scripts/post-protocol-test-codegen
21-
npx prettier --write ./private/smithy-rpcv2-cbor
22-
npx prettier --write ./private/smithy-rpcv2-cbor-schema
21+
# npx prettier --write ./private/smithy-rpcv2-cbor
22+
# npx prettier --write ./private/smithy-rpcv2-cbor-schema
2323
npx prettier --write ./private/my-local-model
2424
npx prettier --write ./private/my-local-model-schema
2525
yarn

private/my-local-model-schema/src/XYZService.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// smithy-typescript generated code
2-
import { XYZServiceClient, XYZServiceClientConfig } from "./XYZServiceClient";
2+
import { createAggregatedClient } from "@smithy/smithy-client";
3+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
4+
35
import { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
46
import {
57
TradeEventStreamCommand,
68
TradeEventStreamCommandInput,
79
TradeEventStreamCommandOutput,
810
} from "./commands/TradeEventStreamCommand";
9-
import { createAggregatedClient } from "@smithy/smithy-client";
10-
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
11+
import { XYZServiceClient, XYZServiceClientConfig } from "./XYZServiceClient";
1112

1213
const commands = {
1314
GetNumbersCommand,

private/my-local-model-schema/src/XYZServiceClient.ts

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
// smithy-typescript generated code
2-
import {
3-
HttpAuthSchemeInputConfig,
4-
HttpAuthSchemeResolvedConfig,
5-
defaultXYZServiceHttpAuthSchemeParametersProvider,
6-
resolveHttpAuthSchemeConfig,
7-
} from "./auth/httpAuthSchemeProvider";
8-
import { GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
9-
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "./commands/TradeEventStreamCommand";
10-
import {
11-
ClientInputEndpointParameters,
12-
ClientResolvedEndpointParameters,
13-
EndpointParameters,
14-
resolveClientEndpointParameters,
15-
} from "./endpoint/EndpointParameters";
16-
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
17-
import { RuntimeExtension, RuntimeExtensionsConfig, resolveRuntimeExtensions } from "./runtimeExtensions";
182
import {
193
DefaultIdentityProviderConfig,
204
getHttpAuthSchemeEndpointRuleSetPlugin,
@@ -44,23 +28,40 @@ import {
4428
SmithyResolvedConfiguration as __SmithyResolvedConfiguration,
4529
} from "@smithy/smithy-client";
4630
import {
47-
ClientProtocol,
48-
HttpRequest,
49-
HttpResponse,
50-
BodyLengthCalculator as __BodyLengthCalculator,
51-
CheckOptionalClientConfig as __CheckOptionalClientConfig,
52-
ChecksumConstructor as __ChecksumConstructor,
53-
Decoder as __Decoder,
54-
Encoder as __Encoder,
55-
EventStreamSerdeProvider as __EventStreamSerdeProvider,
56-
HashConstructor as __HashConstructor,
31+
type BodyLengthCalculator as __BodyLengthCalculator,
32+
type CheckOptionalClientConfig as __CheckOptionalClientConfig,
33+
type ChecksumConstructor as __ChecksumConstructor,
34+
type ClientProtocol,
35+
type Decoder as __Decoder,
36+
type Encoder as __Encoder,
37+
type EventStreamSerdeProvider as __EventStreamSerdeProvider,
38+
type HashConstructor as __HashConstructor,
5739
HttpHandlerOptions as __HttpHandlerOptions,
58-
Logger as __Logger,
59-
Provider as __Provider,
60-
StreamCollector as __StreamCollector,
61-
UrlParser as __UrlParser,
40+
type HttpRequest,
41+
type HttpResponse,
42+
type Logger as __Logger,
43+
type Provider as __Provider,
44+
type StreamCollector as __StreamCollector,
45+
type UrlParser as __UrlParser,
6246
} from "@smithy/types";
6347

48+
import {
49+
HttpAuthSchemeInputConfig,
50+
HttpAuthSchemeResolvedConfig,
51+
defaultXYZServiceHttpAuthSchemeParametersProvider,
52+
resolveHttpAuthSchemeConfig,
53+
} from "./auth/httpAuthSchemeProvider";
54+
import { GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
55+
import { TradeEventStreamCommandInput, TradeEventStreamCommandOutput } from "./commands/TradeEventStreamCommand";
56+
import {
57+
ClientInputEndpointParameters,
58+
ClientResolvedEndpointParameters,
59+
EndpointParameters,
60+
resolveClientEndpointParameters,
61+
} from "./endpoint/EndpointParameters";
62+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
63+
import { RuntimeExtension, RuntimeExtensionsConfig, resolveRuntimeExtensions } from "./runtimeExtensions";
64+
6465
export { __Client };
6566

6667
/**

private/my-local-model-schema/src/auth/httpAuthExtensionConfiguration.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// smithy-typescript generated code
2-
import { XYZServiceHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
3-
import { HttpAuthScheme } from "@smithy/types";
2+
import type { HttpAuthScheme } from "@smithy/types";
3+
4+
import type { XYZServiceHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
45

56
/**
67
* @internal

private/my-local-model-schema/src/auth/httpAuthSchemeProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// smithy-typescript generated code
2-
import { XYZServiceClientResolvedConfig } from "../XYZServiceClient";
3-
import {
2+
import type {
43
HandlerExecutionContext,
54
HttpAuthOption,
65
HttpAuthScheme,
@@ -11,6 +10,8 @@ import {
1110
} from "@smithy/types";
1211
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
1312

13+
import type { XYZServiceClientResolvedConfig } from "../XYZServiceClient";
14+
1415
/**
1516
* @internal
1617
*/

private/my-local-model-schema/src/commands/GetNumbersCommand.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// smithy-typescript generated code
2-
import { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
3-
import { commonParams } from "../endpoint/EndpointParameters";
4-
import { GetNumbersRequest, GetNumbersResponse } from "../models/models_0";
5-
import { GetNumbers } from "../schemas/schemas_0";
62
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
73
import { Command as $Command } from "@smithy/smithy-client";
8-
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
4+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
5+
6+
import { commonParams } from "../endpoint/EndpointParameters";
7+
import type { GetNumbersRequest, GetNumbersResponse } from "../models/models_0";
8+
import { GetNumbers } from "../schemas/schemas_0";
9+
import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
910

1011
/**
1112
* @public

private/my-local-model-schema/src/commands/TradeEventStreamCommand.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
// smithy-typescript generated code
2-
import { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
3-
import { commonParams } from "../endpoint/EndpointParameters";
4-
import { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0";
5-
import { TradeEventStream } from "../schemas/schemas_0";
62
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
73
import { Command as $Command } from "@smithy/smithy-client";
8-
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
4+
import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
5+
6+
import { commonParams } from "../endpoint/EndpointParameters";
7+
import type { TradeEventStreamRequest, TradeEventStreamResponse } from "../models/models_0";
8+
import { TradeEventStream } from "../schemas/schemas_0";
9+
import type { ServiceInputTypes, ServiceOutputTypes, XYZServiceClientResolvedConfig } from "../XYZServiceClient";
910

1011
/**
1112
* @public
@@ -84,15 +85,7 @@ export class TradeEventStreamCommand extends $Command
8485
.m(function (this: any, Command: any, cs: any, config: XYZServiceClientResolvedConfig, o: any) {
8586
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions())];
8687
})
87-
.s("XYZService", "TradeEventStream", {
88-
/**
89-
* @internal
90-
*/
91-
eventStream: {
92-
input: true,
93-
output: true,
94-
},
95-
})
88+
.s("XYZService", "TradeEventStream", {})
9689
.n("XYZServiceClient", "TradeEventStreamCommand")
9790
.sc(TradeEventStream)
9891
.build() {

private/my-local-model-schema/src/endpoint/EndpointParameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// smithy-typescript generated code
2-
import { Endpoint, EndpointV2, Provider, EndpointParameters as __EndpointParameters } from "@smithy/types";
2+
import type { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types";
33

44
/**
55
* @public

private/my-local-model-schema/src/endpoint/endpointResolver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// smithy-typescript generated code
2+
import type { EndpointV2, Logger } from "@smithy/types";
3+
import { EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";
4+
25
import { EndpointParameters } from "./EndpointParameters";
36
import { ruleSet } from "./ruleset";
4-
import { EndpointV2, Logger } from "@smithy/types";
5-
import { EndpointCache, EndpointParams, resolveEndpoint } from "@smithy/util-endpoints";
67

78
const cache = new EndpointCache({
89
size: 50,

private/my-local-model-schema/src/endpoint/ruleset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// smithy-typescript generated code
2-
import { RuleSetObject } from "@smithy/types";
2+
import type { RuleSetObject } from "@smithy/types";
33

44
export const ruleSet: RuleSetObject = {
55
version: "1.0",

0 commit comments

Comments
 (0)