@aws-amplify/interactions 6.0.16 → 6.0.17-unstable.0d2aa5d.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/interactions",
3
- "version": "6.0.16",
3
+ "version": "6.0.17-unstable.0d2aa5d.0+0d2aa5d",
4
4
  "description": "Interactions category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -80,7 +80,7 @@
80
80
  "uuid": "^9.0.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@aws-amplify/core": "6.0.16",
83
+ "@aws-amplify/core": "6.0.17-unstable.0d2aa5d.0+0d2aa5d",
84
84
  "typescript": "^5.0.2"
85
85
  },
86
86
  "size-limit": [
@@ -103,5 +103,5 @@
103
103
  "limit": "47.00 kB"
104
104
  }
105
105
  ],
106
- "gitHead": "0e919f6e759cb94d03e119162b530b32d48f1357"
106
+ "gitHead": "0d2aa5d71a6b995e302c7404becd8345763eae43"
107
107
  }
@@ -10,7 +10,7 @@ import { InteractionsError } from './InteractionsError';
10
10
  export function assertValidationError(
11
11
  assertion: boolean,
12
12
  name: InteractionsValidationErrorCode,
13
- message?: string
13
+ message?: string,
14
14
  ): asserts assertion {
15
15
  if (!assertion) {
16
16
  const { message: defaultMessage, recoverySuggestion } =
@@ -44,7 +44,7 @@ class AWSLexProvider {
44
44
  */
45
45
  reportBotStatus(
46
46
  data: AWSLexProviderSendResponse,
47
- { name }: AWSLexProviderOption
47
+ { name }: AWSLexProviderOption,
48
48
  ) {
49
49
  const callback = this._botsCompleteCallback[name];
50
50
  if (!callback) {
@@ -68,7 +68,7 @@ class AWSLexProvider {
68
68
 
69
69
  async sendMessage(
70
70
  botConfig: AWSLexProviderOption,
71
- message: string | InteractionsMessage
71
+ message: string | InteractionsMessage,
72
72
  ): Promise<InteractionsResponse> {
73
73
  // check if credentials are present
74
74
  let session;
@@ -158,7 +158,7 @@ class AWSLexProvider {
158
158
 
159
159
  onComplete(
160
160
  { name }: AWSLexProviderOption,
161
- callback: InteractionsOnCompleteCallback
161
+ callback: InteractionsOnCompleteCallback,
162
162
  ) {
163
163
  this._botsCompleteCallback[name] = callback;
164
164
  }
@@ -15,7 +15,7 @@ export const onComplete = (input: OnCompleteInput): void => {
15
15
  assertValidationError(
16
16
  !!botConfig,
17
17
  InteractionsValidationErrorCode.NoBotConfig,
18
- `Bot ${botName} does not exist.`
18
+ `Bot ${botName} does not exist.`,
19
19
  );
20
20
  lexProvider.onComplete(botConfig, callback);
21
21
  };
@@ -15,7 +15,7 @@ export const send = async (input: SendInput): Promise<SendOutput> => {
15
15
  assertValidationError(
16
16
  !!botConfig,
17
17
  InteractionsValidationErrorCode.NoBotConfig,
18
- `Bot ${botName} does not exist.`
18
+ `Bot ${botName} does not exist.`,
19
19
  );
20
20
  return lexProvider.sendMessage(botConfig, message);
21
21
  };
@@ -5,7 +5,7 @@ import { AWSLexProviderOption } from '../types';
5
5
  import { Amplify } from '@aws-amplify/core';
6
6
 
7
7
  export const resolveBotConfig = (
8
- botName: string
8
+ botName: string,
9
9
  ): AWSLexProviderOption | undefined => {
10
10
  const { [botName]: botConfig = undefined } =
11
11
  Amplify.getConfig().Interactions?.LexV1 ?? {};
@@ -66,7 +66,7 @@ class AWSLexV2Provider {
66
66
  */
67
67
  public async sendMessage(
68
68
  botConfig: AWSLexV2ProviderOption,
69
- message: string | InteractionsMessage
69
+ message: string | InteractionsMessage,
70
70
  ): Promise<InteractionsResponse> {
71
71
  // check if credentials are present
72
72
  let session;
@@ -98,14 +98,14 @@ class AWSLexV2Provider {
98
98
  botConfig,
99
99
  message,
100
100
  reqBaseParams,
101
- client
101
+ client,
102
102
  );
103
103
  } else {
104
104
  response = await this._handleRecognizeUtteranceCommand(
105
105
  botConfig,
106
106
  message,
107
107
  reqBaseParams,
108
- client
108
+ client,
109
109
  );
110
110
  }
111
111
  return response;
@@ -119,7 +119,7 @@ class AWSLexV2Provider {
119
119
  */
120
120
  public onComplete(
121
121
  { name }: AWSLexV2ProviderOption,
122
- callback: InteractionsOnCompleteCallback
122
+ callback: InteractionsOnCompleteCallback,
123
123
  ) {
124
124
  this._botsCompleteCallback[name] = callback;
125
125
  }
@@ -129,7 +129,7 @@ class AWSLexV2Provider {
129
129
  */
130
130
  _reportBotStatus(
131
131
  data: AWSLexV2ProviderSendResponse,
132
- { name }: AWSLexV2ProviderOption
132
+ { name }: AWSLexV2ProviderOption,
133
133
  ) {
134
134
  const sessionState = data?.sessionState;
135
135
 
@@ -159,7 +159,7 @@ class AWSLexV2Provider {
159
159
  * update audioStream format
160
160
  */
161
161
  private async _formatUtteranceCommandOutput(
162
- data: RecognizeUtteranceCommandOutput
162
+ data: RecognizeUtteranceCommandOutput,
163
163
  ): Promise<RecognizeUtteranceCommandOutputFormatted> {
164
164
  return {
165
165
  ...data,
@@ -182,7 +182,7 @@ class AWSLexV2Provider {
182
182
  botConfig: AWSLexV2ProviderOption,
183
183
  data: string,
184
184
  baseParams: lexV2BaseReqParams,
185
- client: LexRuntimeV2Client
185
+ client: LexRuntimeV2Client,
186
186
  ) {
187
187
  logger.debug('postText to lex2', data);
188
188
 
@@ -210,7 +210,7 @@ class AWSLexV2Provider {
210
210
  botConfig: AWSLexV2ProviderOption,
211
211
  data: InteractionsMessage,
212
212
  baseParams: lexV2BaseReqParams,
213
- client: LexRuntimeV2Client
213
+ client: LexRuntimeV2Client,
214
214
  ) {
215
215
  const {
216
216
  content,
@@ -15,7 +15,7 @@ export const onComplete = (input: OnCompleteInput): void => {
15
15
  assertValidationError(
16
16
  !!botConfig,
17
17
  InteractionsValidationErrorCode.NoBotConfig,
18
- `Bot ${botName} does not exist.`
18
+ `Bot ${botName} does not exist.`,
19
19
  );
20
20
  lexProvider.onComplete(botConfig, callback);
21
21
  };
@@ -15,7 +15,7 @@ export const send = async (input: SendInput): Promise<SendOutput> => {
15
15
  assertValidationError(
16
16
  !!botConfig,
17
17
  InteractionsValidationErrorCode.NoBotConfig,
18
- `Bot ${botName} does not exist.`
18
+ `Bot ${botName} does not exist.`,
19
19
  );
20
20
  return lexProvider.sendMessage(botConfig, message);
21
21
  };
@@ -5,7 +5,7 @@ import { AWSLexV2ProviderOption } from '../types';
5
5
  import { Amplify } from '@aws-amplify/core';
6
6
 
7
7
  export const resolveBotConfig = (
8
- botName: string
8
+ botName: string,
9
9
  ): AWSLexV2ProviderOption | undefined => {
10
10
  const { [botName]: botConfig = undefined } =
11
11
  Amplify.getConfig().Interactions?.LexV2 ?? {};
@@ -21,7 +21,7 @@ export type InteractionsMessage =
21
21
 
22
22
  export type InteractionsOnCompleteCallback = (
23
23
  error?: Error,
24
- completion?: InteractionsResponse
24
+ completion?: InteractionsResponse,
25
25
  ) => void;
26
26
 
27
27
  export type InteractionsResponse = {
@@ -33,7 +33,7 @@ export const base64ToArrayBuffer = (base64: string): Uint8Array => {
33
33
  };
34
34
 
35
35
  export const gzipDecompressToString = async (
36
- data: Uint8Array
36
+ data: Uint8Array,
37
37
  ): Promise<string> => {
38
38
  return new Promise((resolve, reject) => {
39
39
  try {
@@ -18,7 +18,7 @@ export const base64ToArrayBuffer = (base64: string): Uint8Array => {
18
18
  };
19
19
 
20
20
  export const gzipDecompressToString = async (
21
- data: Uint8Array
21
+ data: Uint8Array,
22
22
  ): Promise<string> => {
23
23
  return await new Promise((resolve, reject) => {
24
24
  gunzip(data, (err, resp) => {