Skip to content

Commit 26df312

Browse files
committed
new client
1 parent e6c3101 commit 26df312

35 files changed

+7198
-3910
lines changed

src.gen/@amzn/codewhisperer-streaming/LICENSE renamed to src.gen/@amzn/amazon-codewhisperer-streaming/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
189+
Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

src.gen/@amzn/amazon-codewhisperer-streaming/README.md

Lines changed: 765 additions & 0 deletions
Large diffs are not rendered by default.

src.gen/@amzn/amazon-codewhisperer-streaming/package-lock.json

Lines changed: 2696 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"name": "@amzn/amazon-codewhisperer-streaming",
3+
"description": "@amzn/amazon-codewhisperer-streaming client",
4+
"version": "1.0.0",
5+
"scripts": {
6+
"build": "concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
9+
"build:types": "tsc -p tsconfig.types.json",
10+
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11+
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12+
"prepack": "npm run clean && npm run build"
13+
},
14+
"main": "./dist-cjs/index.js",
15+
"types": "./dist-types/index.d.ts",
16+
"module": "./dist-es/index.js",
17+
"sideEffects": false,
18+
"dependencies": {
19+
"tslib": "^2.6.2",
20+
"@aws-crypto/sha256-browser": "5.2.0",
21+
"@aws-crypto/sha256-js": "5.2.0",
22+
"@aws-sdk/core": "3.658.1",
23+
"@aws-sdk/middleware-host-header": "3.654.0",
24+
"@aws-sdk/middleware-logger": "3.654.0",
25+
"@aws-sdk/middleware-recursion-detection": "3.654.0",
26+
"@aws-sdk/middleware-user-agent": "3.654.0",
27+
"@aws-sdk/region-config-resolver": "3.654.0",
28+
"@aws-sdk/token-providers": "3.654.0",
29+
"@aws-sdk/types": "3.654.0",
30+
"@aws-sdk/util-user-agent-browser": "3.654.0",
31+
"@aws-sdk/util-user-agent-node": "3.654.0",
32+
"@smithy/config-resolver": "^3.0.8",
33+
"@smithy/core": "^2.4.6",
34+
"@smithy/eventstream-serde-browser": "^3.0.9",
35+
"@smithy/eventstream-serde-config-resolver": "^3.0.6",
36+
"@smithy/eventstream-serde-node": "^3.0.8",
37+
"@smithy/fetch-http-handler": "^3.2.8",
38+
"@smithy/hash-node": "^3.0.6",
39+
"@smithy/invalid-dependency": "^3.0.6",
40+
"@smithy/middleware-content-length": "^3.0.8",
41+
"@smithy/middleware-retry": "^3.0.21",
42+
"@smithy/middleware-serde": "^3.0.6",
43+
"@smithy/middleware-stack": "^3.0.6",
44+
"@smithy/node-config-provider": "^3.1.7",
45+
"@smithy/node-http-handler": "^3.2.3",
46+
"@smithy/protocol-http": "^4.1.3",
47+
"@smithy/smithy-client": "^3.3.5",
48+
"@smithy/types": "^3.4.2",
49+
"@smithy/url-parser": "^3.0.6",
50+
"@smithy/util-base64": "^3.0.0",
51+
"@smithy/util-body-length-browser": "^3.0.0",
52+
"@smithy/util-body-length-node": "^3.0.0",
53+
"@smithy/util-defaults-mode-browser": "^3.0.21",
54+
"@smithy/util-defaults-mode-node": "^3.0.21",
55+
"@smithy/util-middleware": "^3.0.6",
56+
"@smithy/util-retry": "^3.0.6",
57+
"@smithy/util-utf8": "^3.0.0",
58+
"uuid": "^9.0.1"
59+
},
60+
"devDependencies": {
61+
"@tsconfig/node16": "16.1.3",
62+
"concurrently": "7.0.0",
63+
"downlevel-dts": "0.10.1",
64+
"rimraf": "^3.0.0",
65+
"typescript": "~4.9.5",
66+
"@types/node": "^16.18.96",
67+
"@types/uuid": "^9.0.4"
68+
},
69+
"engines": {
70+
"node": ">=16.0.0"
71+
},
72+
"typesVersions": {
73+
"<4.0": {
74+
"dist-types/*": [
75+
"dist-types/ts3.4/*"
76+
]
77+
}
78+
},
79+
"files": [
80+
"dist-*/**"
81+
],
82+
"browser": {
83+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
84+
},
85+
"react-native": {
86+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
87+
}
88+
}

src.gen/@amzn/codewhisperer-streaming/src/CodeWhispererStreaming.ts renamed to src.gen/@amzn/amazon-codewhisperer-streaming/src/CodeWhispererStreaming.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import {
33
CodeWhispererStreamingClient,
44
CodeWhispererStreamingClientConfig,
55
} from "./CodeWhispererStreamingClient";
6-
import {
7-
ConverseStreamCommand,
8-
ConverseStreamCommandInput,
9-
ConverseStreamCommandOutput,
10-
} from "./commands/ConverseStreamCommand";
116
import {
127
ExportResultArchiveCommand,
138
ExportResultArchiveCommandInput,
@@ -23,14 +18,19 @@ import {
2318
GenerateTaskAssistPlanCommandInput,
2419
GenerateTaskAssistPlanCommandOutput,
2520
} from "./commands/GenerateTaskAssistPlanCommand";
21+
import {
22+
SendMessageCommand,
23+
SendMessageCommandInput,
24+
SendMessageCommandOutput,
25+
} from "./commands/SendMessageCommand";
2626
import { createAggregatedClient } from "@smithy/smithy-client";
2727
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2828

2929
const commands = {
3030
ExportResultArchiveCommand,
3131
GenerateAssistantResponseCommand,
3232
GenerateTaskAssistPlanCommand,
33-
ConverseStreamCommand,
33+
SendMessageCommand,
3434
}
3535

3636
export interface CodeWhispererStreaming {
@@ -86,20 +86,20 @@ export interface CodeWhispererStreaming {
8686
): void;
8787

8888
/**
89-
* @see {@link ConverseStreamCommand}
89+
* @see {@link SendMessageCommand}
9090
*/
91-
converseStream(
92-
args: ConverseStreamCommandInput,
91+
sendMessage(
92+
args: SendMessageCommandInput,
9393
options?: __HttpHandlerOptions,
94-
): Promise<ConverseStreamCommandOutput>;
95-
converseStream(
96-
args: ConverseStreamCommandInput,
97-
cb: (err: any, data?: ConverseStreamCommandOutput) => void
94+
): Promise<SendMessageCommandOutput>;
95+
sendMessage(
96+
args: SendMessageCommandInput,
97+
cb: (err: any, data?: SendMessageCommandOutput) => void
9898
): void;
99-
converseStream(
100-
args: ConverseStreamCommandInput,
99+
sendMessage(
100+
args: SendMessageCommandInput,
101101
options: __HttpHandlerOptions,
102-
cb: (err: any, data?: ConverseStreamCommandOutput) => void
102+
cb: (err: any, data?: SendMessageCommandOutput) => void
103103
): void;
104104

105105
}

src.gen/@amzn/codewhisperer-streaming/src/CodeWhispererStreamingClient.ts renamed to src.gen/@amzn/amazon-codewhisperer-streaming/src/CodeWhispererStreamingClient.ts

Lines changed: 60 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// smithy-typescript generated code
22
import {
3-
ConverseStreamCommandInput,
4-
ConverseStreamCommandOutput,
5-
} from "./commands/ConverseStreamCommand";
3+
HttpAuthSchemeInputConfig,
4+
HttpAuthSchemeResolvedConfig,
5+
defaultCodeWhispererStreamingHttpAuthSchemeParametersProvider,
6+
resolveHttpAuthSchemeConfig,
7+
} from "./auth/httpAuthSchemeProvider";
68
import {
79
ExportResultArchiveCommandInput,
810
ExportResultArchiveCommandOutput,
@@ -15,6 +17,10 @@ import {
1517
GenerateTaskAssistPlanCommandInput,
1618
GenerateTaskAssistPlanCommandOutput,
1719
} from "./commands/GenerateTaskAssistPlanCommand";
20+
import {
21+
SendMessageCommandInput,
22+
SendMessageCommandOutput,
23+
} from "./commands/SendMessageCommand";
1824
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
1925
import {
2026
RuntimeExtension,
@@ -29,12 +35,6 @@ import {
2935
} from "@aws-sdk/middleware-host-header";
3036
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3137
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
32-
import {
33-
TokenInputConfig,
34-
TokenResolvedConfig,
35-
getTokenPlugin,
36-
resolveTokenConfig,
37-
} from "@aws-sdk/middleware-token";
3838
import {
3939
UserAgentInputConfig,
4040
UserAgentResolvedConfig,
@@ -49,6 +49,11 @@ import {
4949
resolveEndpointsConfig,
5050
resolveRegionConfig,
5151
} from "@smithy/config-resolver";
52+
import {
53+
DefaultIdentityProviderConfig,
54+
getHttpAuthSchemePlugin,
55+
getHttpSigningPlugin,
56+
} from "@smithy/core";
5257
import {
5358
EventStreamSerdeInputConfig,
5459
EventStreamSerdeResolvedConfig,
@@ -61,7 +66,7 @@ import {
6166
getRetryPlugin,
6267
resolveRetryConfig,
6368
} from "@smithy/middleware-retry";
64-
import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
69+
import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
6570
import {
6671
Client as __Client,
6772
DefaultsMode as __DefaultsMode,
@@ -73,12 +78,10 @@ import {
7378
RegionInfoProvider,
7479
BodyLengthCalculator as __BodyLengthCalculator,
7580
CheckOptionalClientConfig as __CheckOptionalClientConfig,
76-
Checksum as __Checksum,
7781
ChecksumConstructor as __ChecksumConstructor,
7882
Decoder as __Decoder,
7983
Encoder as __Encoder,
8084
EventStreamSerdeProvider as __EventStreamSerdeProvider,
81-
Hash as __Hash,
8285
HashConstructor as __HashConstructor,
8386
HttpHandlerOptions as __HttpHandlerOptions,
8487
Logger as __Logger,
@@ -94,29 +97,29 @@ export { __Client }
9497
* @public
9598
*/
9699
export type ServiceInputTypes =
97-
| ConverseStreamCommandInput
98100
| ExportResultArchiveCommandInput
99101
| GenerateAssistantResponseCommandInput
100-
| GenerateTaskAssistPlanCommandInput;
102+
| GenerateTaskAssistPlanCommandInput
103+
| SendMessageCommandInput;
101104

102105
/**
103106
* @public
104107
*/
105108
export type ServiceOutputTypes =
106-
| ConverseStreamCommandOutput
107109
| ExportResultArchiveCommandOutput
108110
| GenerateAssistantResponseCommandOutput
109-
| GenerateTaskAssistPlanCommandOutput;
111+
| GenerateTaskAssistPlanCommandOutput
112+
| SendMessageCommandOutput;
110113

111114
/**
112115
* @public
113116
*/
114117
export interface ClientDefaults
115-
extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
118+
extends Partial<__SmithyConfiguration<__HttpHandlerOptions>> {
116119
/**
117-
* The HTTP handler to use. Fetch in browser and Https in Nodejs.
120+
* The HTTP handler to use or its constructor options. Fetch in browser and Https in Nodejs.
118121
*/
119-
requestHandler?: __HttpHandler;
122+
requestHandler?: __HttpHandlerUserInput;
120123

121124
/**
122125
* A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface
@@ -195,6 +198,11 @@ export interface ClientDefaults
195198
*/
196199
useFipsEndpoint?: boolean | __Provider<boolean>;
197200

201+
/**
202+
* The AWS region to which this client will send requests
203+
*/
204+
region?: string | __Provider<string>;
205+
198206
/**
199207
* Fetch related hostname, signing name or signing region with given region.
200208
* @internal
@@ -246,13 +254,13 @@ export interface ClientDefaults
246254
*/
247255
export type CodeWhispererStreamingClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>>
248256
& ClientDefaults
249-
& RegionInputConfig
250-
& EndpointsInputConfig
257+
& UserAgentInputConfig
251258
& RetryInputConfig
259+
& RegionInputConfig
252260
& HostHeaderInputConfig
253-
& TokenInputConfig
254-
& UserAgentInputConfig
261+
& EndpointsInputConfig
255262
& EventStreamSerdeInputConfig
263+
& HttpAuthSchemeInputConfig
256264
/**
257265
* @public
258266
*
@@ -266,13 +274,13 @@ export interface CodeWhispererStreamingClientConfig extends CodeWhispererStreami
266274
export type CodeWhispererStreamingClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions>
267275
& Required<ClientDefaults>
268276
& RuntimeExtensionsConfig
269-
& RegionResolvedConfig
270-
& EndpointsResolvedConfig
277+
& UserAgentResolvedConfig
271278
& RetryResolvedConfig
279+
& RegionResolvedConfig
272280
& HostHeaderResolvedConfig
273-
& TokenResolvedConfig
274-
& UserAgentResolvedConfig
281+
& EndpointsResolvedConfig
275282
& EventStreamSerdeResolvedConfig
283+
& HttpAuthSchemeResolvedConfig
276284
/**
277285
* @public
278286
*
@@ -296,23 +304,35 @@ export class CodeWhispererStreamingClient extends __Client<
296304

297305
constructor(...[configuration]: __CheckOptionalClientConfig<CodeWhispererStreamingClientConfig>) {
298306
let _config_0 = __getRuntimeConfig(configuration || {});
299-
let _config_1 = resolveRegionConfig(_config_0);
300-
let _config_2 = resolveEndpointsConfig(_config_1);
301-
let _config_3 = resolveRetryConfig(_config_2);
307+
let _config_1 = resolveUserAgentConfig(_config_0);
308+
let _config_2 = resolveRetryConfig(_config_1);
309+
let _config_3 = resolveRegionConfig(_config_2);
302310
let _config_4 = resolveHostHeaderConfig(_config_3);
303-
let _config_5 = resolveTokenConfig(_config_4);
304-
let _config_6 = resolveUserAgentConfig(_config_5);
305-
let _config_7 = resolveEventStreamSerdeConfig(_config_6);
311+
let _config_5 = resolveEndpointsConfig(_config_4);
312+
let _config_6 = resolveEventStreamSerdeConfig(_config_5);
313+
let _config_7 = resolveHttpAuthSchemeConfig(_config_6);
306314
let _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
307315
super(_config_8);
308316
this.config = _config_8;
309-
this.middlewareStack.use(getRetryPlugin(this.config));
310-
this.middlewareStack.use(getContentLengthPlugin(this.config));
311-
this.middlewareStack.use(getHostHeaderPlugin(this.config));
312-
this.middlewareStack.use(getLoggerPlugin(this.config));
313-
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
314-
this.middlewareStack.use(getTokenPlugin(this.config));
315-
this.middlewareStack.use(getUserAgentPlugin(this.config));
317+
this.middlewareStack.use(getUserAgentPlugin(this.config
318+
));
319+
this.middlewareStack.use(getRetryPlugin(this.config
320+
));
321+
this.middlewareStack.use(getContentLengthPlugin(this.config
322+
));
323+
this.middlewareStack.use(getHostHeaderPlugin(this.config
324+
));
325+
this.middlewareStack.use(getLoggerPlugin(this.config
326+
));
327+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config
328+
));
329+
this.middlewareStack.use(getHttpAuthSchemePlugin(this.config
330+
, {
331+
httpAuthSchemeParametersProvider: defaultCodeWhispererStreamingHttpAuthSchemeParametersProvider,identityProviderConfigProvider: async (config: CodeWhispererStreamingClientResolvedConfig) => new DefaultIdentityProviderConfig({
332+
"smithy.api#httpBearerAuth": config.token,}), }
333+
));
334+
this.middlewareStack.use(getHttpSigningPlugin(this.config
335+
));
316336
}
317337

318338
/**

0 commit comments

Comments
 (0)