@aws-sdk/client-lex-runtime-service 3.315.0 → 3.316.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LexRuntimeService = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const DeleteSessionCommand_1 = require("./commands/DeleteSessionCommand");
5
6
  const GetSessionCommand_1 = require("./commands/GetSessionCommand");
6
7
  const PostContentCommand_1 = require("./commands/PostContentCommand");
7
8
  const PostTextCommand_1 = require("./commands/PostTextCommand");
8
9
  const PutSessionCommand_1 = require("./commands/PutSessionCommand");
9
10
  const LexRuntimeServiceClient_1 = require("./LexRuntimeServiceClient");
11
+ const commands = {
12
+ DeleteSessionCommand: DeleteSessionCommand_1.DeleteSessionCommand,
13
+ GetSessionCommand: GetSessionCommand_1.GetSessionCommand,
14
+ PostContentCommand: PostContentCommand_1.PostContentCommand,
15
+ PostTextCommand: PostTextCommand_1.PostTextCommand,
16
+ PutSessionCommand: PutSessionCommand_1.PutSessionCommand,
17
+ };
10
18
  class LexRuntimeService extends LexRuntimeServiceClient_1.LexRuntimeServiceClient {
11
- deleteSession(args, optionsOrCb, cb) {
12
- const command = new DeleteSessionCommand_1.DeleteSessionCommand(args);
13
- if (typeof optionsOrCb === "function") {
14
- this.send(command, optionsOrCb);
15
- }
16
- else if (typeof cb === "function") {
17
- if (typeof optionsOrCb !== "object")
18
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
19
- this.send(command, optionsOrCb || {}, cb);
20
- }
21
- else {
22
- return this.send(command, optionsOrCb);
23
- }
24
- }
25
- getSession(args, optionsOrCb, cb) {
26
- const command = new GetSessionCommand_1.GetSessionCommand(args);
27
- if (typeof optionsOrCb === "function") {
28
- this.send(command, optionsOrCb);
29
- }
30
- else if (typeof cb === "function") {
31
- if (typeof optionsOrCb !== "object")
32
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
33
- this.send(command, optionsOrCb || {}, cb);
34
- }
35
- else {
36
- return this.send(command, optionsOrCb);
37
- }
38
- }
39
- postContent(args, optionsOrCb, cb) {
40
- const command = new PostContentCommand_1.PostContentCommand(args);
41
- if (typeof optionsOrCb === "function") {
42
- this.send(command, optionsOrCb);
43
- }
44
- else if (typeof cb === "function") {
45
- if (typeof optionsOrCb !== "object")
46
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
47
- this.send(command, optionsOrCb || {}, cb);
48
- }
49
- else {
50
- return this.send(command, optionsOrCb);
51
- }
52
- }
53
- postText(args, optionsOrCb, cb) {
54
- const command = new PostTextCommand_1.PostTextCommand(args);
55
- if (typeof optionsOrCb === "function") {
56
- this.send(command, optionsOrCb);
57
- }
58
- else if (typeof cb === "function") {
59
- if (typeof optionsOrCb !== "object")
60
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
61
- this.send(command, optionsOrCb || {}, cb);
62
- }
63
- else {
64
- return this.send(command, optionsOrCb);
65
- }
66
- }
67
- putSession(args, optionsOrCb, cb) {
68
- const command = new PutSessionCommand_1.PutSessionCommand(args);
69
- if (typeof optionsOrCb === "function") {
70
- this.send(command, optionsOrCb);
71
- }
72
- else if (typeof cb === "function") {
73
- if (typeof optionsOrCb !== "object")
74
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
75
- this.send(command, optionsOrCb || {}, cb);
76
- }
77
- else {
78
- return this.send(command, optionsOrCb);
79
- }
80
- }
81
19
  }
82
20
  exports.LexRuntimeService = LexRuntimeService;
21
+ (0, smithy_client_1.createAggregatedClient)(commands, LexRuntimeService);
@@ -1,78 +1,17 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { DeleteSessionCommand, } from "./commands/DeleteSessionCommand";
2
3
  import { GetSessionCommand } from "./commands/GetSessionCommand";
3
4
  import { PostContentCommand } from "./commands/PostContentCommand";
4
5
  import { PostTextCommand } from "./commands/PostTextCommand";
5
6
  import { PutSessionCommand } from "./commands/PutSessionCommand";
6
7
  import { LexRuntimeServiceClient } from "./LexRuntimeServiceClient";
8
+ const commands = {
9
+ DeleteSessionCommand,
10
+ GetSessionCommand,
11
+ PostContentCommand,
12
+ PostTextCommand,
13
+ PutSessionCommand,
14
+ };
7
15
  export class LexRuntimeService extends LexRuntimeServiceClient {
8
- deleteSession(args, optionsOrCb, cb) {
9
- const command = new DeleteSessionCommand(args);
10
- if (typeof optionsOrCb === "function") {
11
- this.send(command, optionsOrCb);
12
- }
13
- else if (typeof cb === "function") {
14
- if (typeof optionsOrCb !== "object")
15
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
16
- this.send(command, optionsOrCb || {}, cb);
17
- }
18
- else {
19
- return this.send(command, optionsOrCb);
20
- }
21
- }
22
- getSession(args, optionsOrCb, cb) {
23
- const command = new GetSessionCommand(args);
24
- if (typeof optionsOrCb === "function") {
25
- this.send(command, optionsOrCb);
26
- }
27
- else if (typeof cb === "function") {
28
- if (typeof optionsOrCb !== "object")
29
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
30
- this.send(command, optionsOrCb || {}, cb);
31
- }
32
- else {
33
- return this.send(command, optionsOrCb);
34
- }
35
- }
36
- postContent(args, optionsOrCb, cb) {
37
- const command = new PostContentCommand(args);
38
- if (typeof optionsOrCb === "function") {
39
- this.send(command, optionsOrCb);
40
- }
41
- else if (typeof cb === "function") {
42
- if (typeof optionsOrCb !== "object")
43
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
44
- this.send(command, optionsOrCb || {}, cb);
45
- }
46
- else {
47
- return this.send(command, optionsOrCb);
48
- }
49
- }
50
- postText(args, optionsOrCb, cb) {
51
- const command = new PostTextCommand(args);
52
- if (typeof optionsOrCb === "function") {
53
- this.send(command, optionsOrCb);
54
- }
55
- else if (typeof cb === "function") {
56
- if (typeof optionsOrCb !== "object")
57
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
58
- this.send(command, optionsOrCb || {}, cb);
59
- }
60
- else {
61
- return this.send(command, optionsOrCb);
62
- }
63
- }
64
- putSession(args, optionsOrCb, cb) {
65
- const command = new PutSessionCommand(args);
66
- if (typeof optionsOrCb === "function") {
67
- this.send(command, optionsOrCb);
68
- }
69
- else if (typeof cb === "function") {
70
- if (typeof optionsOrCb !== "object")
71
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
72
- this.send(command, optionsOrCb || {}, cb);
73
- }
74
- else {
75
- return this.send(command, optionsOrCb);
76
- }
77
- }
78
16
  }
17
+ createAggregatedClient(commands, LexRuntimeService);
@@ -5,212 +5,52 @@ import { PostContentCommandInput, PostContentCommandOutput } from "./commands/Po
5
5
  import { PostTextCommandInput, PostTextCommandOutput } from "./commands/PostTextCommand";
6
6
  import { PutSessionCommandInput, PutSessionCommandOutput } from "./commands/PutSessionCommand";
7
7
  import { LexRuntimeServiceClient } from "./LexRuntimeServiceClient";
8
- /**
9
- * @public
10
- * <p>Amazon Lex provides both build and runtime endpoints. Each endpoint
11
- * provides a set of operations (API). Your conversational bot uses the
12
- * runtime API to understand user utterances (user input text or voice). For
13
- * example, suppose a user says "I want pizza", your bot sends this input to
14
- * Amazon Lex using the runtime API. Amazon Lex recognizes that the user
15
- * request is for the OrderPizza intent (one of the intents defined in the
16
- * bot). Then Amazon Lex engages in user conversation on behalf of the bot to
17
- * elicit required information (slot values, such as pizza size and crust
18
- * type), and then performs fulfillment activity (that you configured when
19
- * you created the bot). You use the build-time API to create and manage your
20
- * Amazon Lex bot. For a list of build-time operations, see the build-time
21
- * API, . </p>
22
- */
23
- export declare class LexRuntimeService extends LexRuntimeServiceClient {
8
+ export interface LexRuntimeService {
24
9
  /**
25
- * @public
26
- * <p>Removes session information for a specified bot, alias, and user ID.
27
- * </p>
10
+ * @see {@link DeleteSessionCommand}
28
11
  */
29
12
  deleteSession(args: DeleteSessionCommandInput, options?: __HttpHandlerOptions): Promise<DeleteSessionCommandOutput>;
30
13
  deleteSession(args: DeleteSessionCommandInput, cb: (err: any, data?: DeleteSessionCommandOutput) => void): void;
31
14
  deleteSession(args: DeleteSessionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteSessionCommandOutput) => void): void;
32
15
  /**
33
- * @public
34
- * <p>Returns session information for a specified bot, alias, and user
35
- * ID.</p>
16
+ * @see {@link GetSessionCommand}
36
17
  */
37
18
  getSession(args: GetSessionCommandInput, options?: __HttpHandlerOptions): Promise<GetSessionCommandOutput>;
38
19
  getSession(args: GetSessionCommandInput, cb: (err: any, data?: GetSessionCommandOutput) => void): void;
39
20
  getSession(args: GetSessionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetSessionCommandOutput) => void): void;
40
21
  /**
41
- * @public
42
- * <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to
43
- * send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the
44
- * user input using the machine learning model that it built for the bot. </p>
45
- * <p>The <code>PostContent</code> operation supports audio input at 8kHz
46
- * and 16kHz. You can use 8kHz audio to achieve higher speech recognition
47
- * accuracy in telephone audio applications. </p>
48
- * <p> In response, Amazon Lex returns the next message to convey to the user.
49
- * Consider the following example messages: </p>
50
- * <ul>
51
- * <li>
52
- * <p> For a user input "I would like a pizza," Amazon Lex might return a
53
- * response with a message eliciting slot data (for example,
54
- * <code>PizzaSize</code>): "What size pizza would you like?". </p>
55
- * </li>
56
- * <li>
57
- * <p> After the user provides all of the pizza order information, Amazon Lex
58
- * might return a response with a message to get user confirmation:
59
- * "Order the pizza?". </p>
60
- * </li>
61
- * <li>
62
- * <p> After the user replies "Yes" to the confirmation prompt, Amazon Lex
63
- * might return a conclusion statement: "Thank you, your cheese pizza has
64
- * been ordered.". </p>
65
- * </li>
66
- * </ul>
67
- * <p> Not all Amazon Lex messages require a response from the user. For example,
68
- * conclusion statements do not require a response. Some messages require
69
- * only a yes or no response. In addition to the <code>message</code>, Amazon Lex
70
- * provides additional context about the message in the response that you can
71
- * use to enhance client behavior, such as displaying the appropriate client
72
- * user interface. Consider the following examples: </p>
73
- * <ul>
74
- * <li>
75
- * <p> If the message is to elicit slot data, Amazon Lex returns the
76
- * following context information: </p>
77
- * <ul>
78
- * <li>
79
- * <p>
80
- * <code>x-amz-lex-dialog-state</code> header set to
81
- * <code>ElicitSlot</code>
82
- * </p>
83
- * </li>
84
- * <li>
85
- * <p>
86
- * <code>x-amz-lex-intent-name</code> header set to the intent name
87
- * in the current context </p>
88
- * </li>
89
- * <li>
90
- * <p>
91
- * <code>x-amz-lex-slot-to-elicit</code> header set to the slot name
92
- * for which the <code>message</code> is eliciting information
93
- * </p>
94
- * </li>
95
- * <li>
96
- * <p>
97
- * <code>x-amz-lex-slots</code> header set to a map of slots
98
- * configured for the intent with their current values </p>
99
- * </li>
100
- * </ul>
101
- * </li>
102
- * <li>
103
- * <p> If the message is a confirmation prompt, the
104
- * <code>x-amz-lex-dialog-state</code> header is set to
105
- * <code>Confirmation</code> and the
106
- * <code>x-amz-lex-slot-to-elicit</code> header is omitted. </p>
107
- * </li>
108
- * <li>
109
- * <p> If the message is a clarification prompt configured for the
110
- * intent, indicating that the user intent is not understood, the
111
- * <code>x-amz-dialog-state</code> header is set to
112
- * <code>ElicitIntent</code> and the <code>x-amz-slot-to-elicit</code>
113
- * header is omitted. </p>
114
- * </li>
115
- * </ul>
116
- * <p> In addition, Amazon Lex also returns your application-specific
117
- * <code>sessionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing
118
- * Conversation Context</a>. </p>
22
+ * @see {@link PostContentCommand}
119
23
  */
120
24
  postContent(args: PostContentCommandInput, options?: __HttpHandlerOptions): Promise<PostContentCommandOutput>;
121
25
  postContent(args: PostContentCommandInput, cb: (err: any, data?: PostContentCommandOutput) => void): void;
122
26
  postContent(args: PostContentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PostContentCommandOutput) => void): void;
123
27
  /**
124
- * @public
125
- * <p>Sends user input to Amazon Lex. Client applications can use this API to
126
- * send requests to Amazon Lex at runtime. Amazon Lex then interprets the user input
127
- * using the machine learning model it built for the bot. </p>
128
- * <p> In response, Amazon Lex returns the next <code>message</code> to convey to
129
- * the user an optional <code>responseCard</code> to display. Consider the
130
- * following example messages: </p>
131
- * <ul>
132
- * <li>
133
- * <p> For a user input "I would like a pizza", Amazon Lex might return a
134
- * response with a message eliciting slot data (for example, PizzaSize):
135
- * "What size pizza would you like?" </p>
136
- * </li>
137
- * <li>
138
- * <p> After the user provides all of the pizza order information,
139
- * Amazon Lex might return a response with a message to obtain user
140
- * confirmation "Proceed with the pizza order?". </p>
141
- * </li>
142
- * <li>
143
- * <p> After the user replies to a confirmation prompt with a "yes",
144
- * Amazon Lex might return a conclusion statement: "Thank you, your cheese
145
- * pizza has been ordered.". </p>
146
- * </li>
147
- * </ul>
148
- *
149
- * <p> Not all Amazon Lex messages require a user response. For example, a
150
- * conclusion statement does not require a response. Some messages require
151
- * only a "yes" or "no" user response. In addition to the
152
- * <code>message</code>, Amazon Lex provides additional context about the
153
- * message in the response that you might use to enhance client behavior, for
154
- * example, to display the appropriate client user interface. These are the
155
- * <code>slotToElicit</code>, <code>dialogState</code>,
156
- * <code>intentName</code>, and <code>slots</code> fields in the response.
157
- * Consider the following examples: </p>
158
- *
159
- * <ul>
160
- * <li>
161
- * <p>If the message is to elicit slot data, Amazon Lex returns the
162
- * following context information:</p>
163
- * <ul>
164
- * <li>
165
- * <p>
166
- * <code>dialogState</code> set to ElicitSlot </p>
167
- * </li>
168
- * <li>
169
- * <p>
170
- * <code>intentName</code> set to the intent name in the current
171
- * context </p>
172
- * </li>
173
- * <li>
174
- * <p>
175
- * <code>slotToElicit</code> set to the slot name for which the
176
- * <code>message</code> is eliciting information </p>
177
- * </li>
178
- * <li>
179
- * <p>
180
- * <code>slots</code> set to a map of slots, configured for the
181
- * intent, with currently known values </p>
182
- * </li>
183
- * </ul>
184
- * </li>
185
- * <li>
186
- * <p> If the message is a confirmation prompt, the
187
- * <code>dialogState</code> is set to ConfirmIntent and
188
- * <code>SlotToElicit</code> is set to null. </p>
189
- * </li>
190
- * <li>
191
- * <p>If the message is a clarification prompt (configured for the
192
- * intent) that indicates that user intent is not understood, the
193
- * <code>dialogState</code> is set to ElicitIntent and
194
- * <code>slotToElicit</code> is set to null. </p>
195
- * </li>
196
- * </ul>
197
- *
198
- * <p> In addition, Amazon Lex also returns your application-specific
199
- * <code>sessionAttributes</code>. For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing
200
- * Conversation Context</a>. </p>
28
+ * @see {@link PostTextCommand}
201
29
  */
202
30
  postText(args: PostTextCommandInput, options?: __HttpHandlerOptions): Promise<PostTextCommandOutput>;
203
31
  postText(args: PostTextCommandInput, cb: (err: any, data?: PostTextCommandOutput) => void): void;
204
32
  postText(args: PostTextCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PostTextCommandOutput) => void): void;
205
33
  /**
206
- * @public
207
- * <p>Creates a new session or modifies an existing session with an Amazon Lex
208
- * bot. Use this operation to enable your application to set the state of the
209
- * bot.</p>
210
- * <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html">Managing
211
- * Sessions</a>.</p>
34
+ * @see {@link PutSessionCommand}
212
35
  */
213
36
  putSession(args: PutSessionCommandInput, options?: __HttpHandlerOptions): Promise<PutSessionCommandOutput>;
214
37
  putSession(args: PutSessionCommandInput, cb: (err: any, data?: PutSessionCommandOutput) => void): void;
215
38
  putSession(args: PutSessionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutSessionCommandOutput) => void): void;
216
39
  }
40
+ /**
41
+ * @public
42
+ * <p>Amazon Lex provides both build and runtime endpoints. Each endpoint
43
+ * provides a set of operations (API). Your conversational bot uses the
44
+ * runtime API to understand user utterances (user input text or voice). For
45
+ * example, suppose a user says "I want pizza", your bot sends this input to
46
+ * Amazon Lex using the runtime API. Amazon Lex recognizes that the user
47
+ * request is for the OrderPizza intent (one of the intents defined in the
48
+ * bot). Then Amazon Lex engages in user conversation on behalf of the bot to
49
+ * elicit required information (slot values, such as pizza size and crust
50
+ * type), and then performs fulfillment activity (that you configured when
51
+ * you created the bot). You use the build-time API to create and manage your
52
+ * Amazon Lex bot. For a list of build-time operations, see the build-time
53
+ * API, . </p>
54
+ */
55
+ export declare class LexRuntimeService extends LexRuntimeServiceClient implements LexRuntimeService {
56
+ }
@@ -20,7 +20,7 @@ import {
20
20
  PutSessionCommandOutput,
21
21
  } from "./commands/PutSessionCommand";
22
22
  import { LexRuntimeServiceClient } from "./LexRuntimeServiceClient";
23
- export declare class LexRuntimeService extends LexRuntimeServiceClient {
23
+ export interface LexRuntimeService {
24
24
  deleteSession(
25
25
  args: DeleteSessionCommandInput,
26
26
  options?: __HttpHandlerOptions
@@ -87,3 +87,6 @@ export declare class LexRuntimeService extends LexRuntimeServiceClient {
87
87
  cb: (err: any, data?: PutSessionCommandOutput) => void
88
88
  ): void;
89
89
  }
90
+ export declare class LexRuntimeService
91
+ extends LexRuntimeServiceClient
92
+ implements LexRuntimeService {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-lex-runtime-service",
3
3
  "description": "AWS SDK for JavaScript Lex Runtime Service Client for Node.js, Browser and React Native",
4
- "version": "3.315.0",
4
+ "version": "3.316.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -23,9 +23,9 @@
23
23
  "dependencies": {
24
24
  "@aws-crypto/sha256-browser": "3.0.0",
25
25
  "@aws-crypto/sha256-js": "3.0.0",
26
- "@aws-sdk/client-sts": "3.315.0",
26
+ "@aws-sdk/client-sts": "3.316.0",
27
27
  "@aws-sdk/config-resolver": "3.310.0",
28
- "@aws-sdk/credential-provider-node": "3.315.0",
28
+ "@aws-sdk/credential-provider-node": "3.316.0",
29
29
  "@aws-sdk/fetch-http-handler": "3.310.0",
30
30
  "@aws-sdk/hash-node": "3.310.0",
31
31
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -42,14 +42,14 @@
42
42
  "@aws-sdk/node-config-provider": "3.310.0",
43
43
  "@aws-sdk/node-http-handler": "3.310.0",
44
44
  "@aws-sdk/protocol-http": "3.310.0",
45
- "@aws-sdk/smithy-client": "3.315.0",
45
+ "@aws-sdk/smithy-client": "3.316.0",
46
46
  "@aws-sdk/types": "3.310.0",
47
47
  "@aws-sdk/url-parser": "3.310.0",
48
48
  "@aws-sdk/util-base64": "3.310.0",
49
49
  "@aws-sdk/util-body-length-browser": "3.310.0",
50
50
  "@aws-sdk/util-body-length-node": "3.310.0",
51
- "@aws-sdk/util-defaults-mode-browser": "3.315.0",
52
- "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
+ "@aws-sdk/util-defaults-mode-browser": "3.316.0",
52
+ "@aws-sdk/util-defaults-mode-node": "3.316.0",
53
53
  "@aws-sdk/util-endpoints": "3.310.0",
54
54
  "@aws-sdk/util-retry": "3.310.0",
55
55
  "@aws-sdk/util-stream-browser": "3.310.0",