@aws-amplify/interactions 4.1.5 → 4.1.6-unstable.10
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 +3 -3
- package/lib/Interactions.d.ts +0 -24
- package/lib/Providers/AWSLexProvider.d.ts +0 -24
- package/lib/Providers/AWSLexProviderHelper/commonUtils.d.ts +0 -1
- package/lib/Providers/AWSLexProviderHelper/utils.d.ts +0 -3
- package/lib/Providers/AWSLexProviderHelper/utils.native.d.ts +0 -3
- package/lib/Providers/AWSLexV2Provider.d.ts +0 -58
- package/lib/Providers/InteractionsProvider.d.ts +0 -11
- package/lib/Providers/index.d.ts +0 -3
- package/lib/index.d.ts +0 -10
- package/lib/types/Interactions.d.ts +0 -16
- package/lib/types/Provider.d.ts +0 -12
- package/lib/types/Providers/AWSLexProvider.d.ts +0 -10
- package/lib/types/Providers/AWSLexV2Provider.d.ts +0 -12
- package/lib/types/Response.d.ts +0 -3
- package/lib/types/index.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/interactions",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6-unstable.10+7a2f3ecf0",
|
|
4
4
|
"description": "Interactions category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://aws-amplify.github.io/",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@aws-amplify/core": "4.7.
|
|
44
|
+
"@aws-amplify/core": "4.7.9-unstable.10+7a2f3ecf0",
|
|
45
45
|
"@aws-sdk/client-lex-runtime-service": "3.186.0",
|
|
46
46
|
"@aws-sdk/client-lex-runtime-v2": "3.186.0",
|
|
47
47
|
"base-64": "1.0.0",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"lib-esm"
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "7a2f3ecf0fda83f087b1c2ce650f4b5f00214dbe"
|
|
96
96
|
}
|
package/lib/Interactions.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InteractionsOptions, InteractionsProvider, InteractionsMessage, InteractionsResponse } from './types';
|
|
2
|
-
export declare class InteractionsClass {
|
|
3
|
-
private _options;
|
|
4
|
-
private _pluggables;
|
|
5
|
-
/**
|
|
6
|
-
* Initialize PubSub with AWS configurations
|
|
7
|
-
*
|
|
8
|
-
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
9
|
-
*/
|
|
10
|
-
constructor(options?: InteractionsOptions);
|
|
11
|
-
getModuleName(): string;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
15
|
-
* @return {InteractionsOptions} - The current configuration
|
|
16
|
-
*/
|
|
17
|
-
configure(options: InteractionsOptions): InteractionsOptions;
|
|
18
|
-
addPluggable(pluggable: InteractionsProvider): void;
|
|
19
|
-
send(botname: string, message: string): Promise<InteractionsResponse>;
|
|
20
|
-
send(botname: string, message: InteractionsMessage): Promise<InteractionsResponse>;
|
|
21
|
-
send(botname: string, message: object): Promise<InteractionsResponse>;
|
|
22
|
-
onComplete(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
23
|
-
}
|
|
24
|
-
export declare const Interactions: InteractionsClass;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AbstractInteractionsProvider } from './InteractionsProvider';
|
|
2
|
-
import { InteractionsOptions, AWSLexProviderOptions, InteractionsResponse, InteractionsMessage } from '../types';
|
|
3
|
-
import { PostTextCommandOutput, PostContentCommandOutput } from '@aws-sdk/client-lex-runtime-service';
|
|
4
|
-
interface PostContentCommandOutputFormatted extends Omit<PostContentCommandOutput, 'audioStream'> {
|
|
5
|
-
audioStream?: Uint8Array;
|
|
6
|
-
}
|
|
7
|
-
declare type AWSLexProviderSendResponse = PostTextCommandOutput | PostContentCommandOutputFormatted;
|
|
8
|
-
export declare class AWSLexProvider extends AbstractInteractionsProvider {
|
|
9
|
-
private lexRuntimeServiceClient;
|
|
10
|
-
private _botsCompleteCallback;
|
|
11
|
-
constructor(options?: InteractionsOptions);
|
|
12
|
-
getProviderName(): string;
|
|
13
|
-
configure(config?: AWSLexProviderOptions): AWSLexProviderOptions;
|
|
14
|
-
/**
|
|
15
|
-
* @private
|
|
16
|
-
* @deprecated
|
|
17
|
-
* This is used internally by 'sendMessage' to call onComplete callback
|
|
18
|
-
* for a bot if configured
|
|
19
|
-
*/
|
|
20
|
-
reportBotStatus(data: AWSLexProviderSendResponse, botname: string): void;
|
|
21
|
-
sendMessage(botname: string, message: string | InteractionsMessage): Promise<InteractionsResponse>;
|
|
22
|
-
onComplete(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const unGzipBase64AsJson: (gzipBase64: string) => Promise<any>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { AbstractInteractionsProvider } from './InteractionsProvider';
|
|
2
|
-
import { InteractionsOptions, AWSLexV2ProviderOptions, InteractionsResponse, InteractionsMessage } from '../types';
|
|
3
|
-
export declare class AWSLexV2Provider extends AbstractInteractionsProvider {
|
|
4
|
-
private _lexRuntimeServiceV2Client;
|
|
5
|
-
private _botsCompleteCallback;
|
|
6
|
-
/**
|
|
7
|
-
* Initialize Interactions with AWS configurations
|
|
8
|
-
* @param {InteractionsOptions} options - Configuration object for Interactions
|
|
9
|
-
*/
|
|
10
|
-
constructor(options?: InteractionsOptions);
|
|
11
|
-
/**
|
|
12
|
-
* get provider name of the plugin
|
|
13
|
-
* @returns {string} name of the provider
|
|
14
|
-
*/
|
|
15
|
-
getProviderName(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Configure Interactions part with aws configuration
|
|
18
|
-
* @param {AWSLexV2ProviderOptions} config - Configuration of the Interactions
|
|
19
|
-
* @return {AWSLexV2ProviderOptions} - Current configuration
|
|
20
|
-
*/
|
|
21
|
-
configure(config?: AWSLexV2ProviderOptions): AWSLexV2ProviderOptions;
|
|
22
|
-
/**
|
|
23
|
-
* Send a message to a bot
|
|
24
|
-
* @async
|
|
25
|
-
* @param {string} botname - Bot name to send the message
|
|
26
|
-
* @param {string | InteractionsMessage} message - message to send to the bot
|
|
27
|
-
* @return {Promise<InteractionsResponse>} A promise resolves to the response from the bot
|
|
28
|
-
*/
|
|
29
|
-
sendMessage(botname: string, message: string | InteractionsMessage): Promise<InteractionsResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Attach a onComplete callback function to a bot.
|
|
32
|
-
* The callback is called once the bot's intent is fulfilled
|
|
33
|
-
* @param {string} botname - Bot name to attach the onComplete callback
|
|
34
|
-
* @param {(err: Error | null, confirmation: InteractionsResponse) => void} callback - called when Intent Fulfilled
|
|
35
|
-
*/
|
|
36
|
-
onComplete(botname: string, callback: (err: Error | null, confirmation: InteractionsResponse) => void): void;
|
|
37
|
-
/**
|
|
38
|
-
* @private
|
|
39
|
-
* call onComplete callback for a bot if configured
|
|
40
|
-
*/
|
|
41
|
-
private _reportBotStatus;
|
|
42
|
-
/**
|
|
43
|
-
* Format UtteranceCommandOutput's response
|
|
44
|
-
* decompress attributes
|
|
45
|
-
* update audioStream format
|
|
46
|
-
*/
|
|
47
|
-
private _formatUtteranceCommandOutput;
|
|
48
|
-
/**
|
|
49
|
-
* handle client's `RecognizeTextCommand`
|
|
50
|
-
* used for sending simple text message
|
|
51
|
-
*/
|
|
52
|
-
private _handleRecognizeTextCommand;
|
|
53
|
-
/**
|
|
54
|
-
* handle client's `RecognizeUtteranceCommand`
|
|
55
|
-
* used for obj text or obj voice message
|
|
56
|
-
*/
|
|
57
|
-
private _handleRecognizeUtteranceCommand;
|
|
58
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InteractionsProvider, InteractionsOptions, InteractionsResponse } from '../types';
|
|
2
|
-
export declare abstract class AbstractInteractionsProvider implements InteractionsProvider {
|
|
3
|
-
protected _config: InteractionsOptions;
|
|
4
|
-
constructor(options?: InteractionsOptions);
|
|
5
|
-
configure(config?: InteractionsOptions): InteractionsOptions;
|
|
6
|
-
getCategory(): string;
|
|
7
|
-
abstract getProviderName(): string;
|
|
8
|
-
protected get options(): InteractionsOptions;
|
|
9
|
-
abstract sendMessage(botname: string, message: string | Object): Promise<object>;
|
|
10
|
-
abstract onComplete(botname: string, callback: (err: any, confirmation: InteractionsResponse) => void): any;
|
|
11
|
-
}
|
package/lib/Providers/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Interactions } from './Interactions';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use named import
|
|
4
|
-
*/
|
|
5
|
-
export default Interactions;
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './Providers/InteractionsProvider';
|
|
8
|
-
export * from './Providers/AWSLexProvider';
|
|
9
|
-
export * from './Providers/AWSLexV2Provider';
|
|
10
|
-
export { Interactions };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface InteractionsOptions {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
}
|
|
4
|
-
export declare type InteractionsTextMessage = {
|
|
5
|
-
content: string;
|
|
6
|
-
options: {
|
|
7
|
-
messageType: 'text';
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare type InteractionsVoiceMessage = {
|
|
11
|
-
content: object;
|
|
12
|
-
options: {
|
|
13
|
-
messageType: 'voice';
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare type InteractionsMessage = InteractionsTextMessage | InteractionsVoiceMessage;
|
package/lib/types/Provider.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { InteractionsOptions } from './Interactions';
|
|
2
|
-
import { InteractionsResponse } from './Response';
|
|
3
|
-
export interface InteractionsProvider {
|
|
4
|
-
configure(config: InteractionsOptions): InteractionsOptions;
|
|
5
|
-
getCategory(): string;
|
|
6
|
-
getProviderName(): string;
|
|
7
|
-
sendMessage(botname: string, message: string | Object): Promise<object>;
|
|
8
|
-
onComplete(botname: string, callback: (err: any, confirmation: InteractionsResponse) => void): any;
|
|
9
|
-
}
|
|
10
|
-
export interface InteractionsProviders {
|
|
11
|
-
[key: string]: InteractionsProvider;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface AWSLexProviderOption {
|
|
2
|
-
name: string;
|
|
3
|
-
alias: string;
|
|
4
|
-
region: string;
|
|
5
|
-
providerName?: string;
|
|
6
|
-
onComplete?(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
7
|
-
}
|
|
8
|
-
export interface AWSLexProviderOptions {
|
|
9
|
-
[key: string]: AWSLexProviderOption;
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface AWSLexV2ProviderOption {
|
|
2
|
-
name: string;
|
|
3
|
-
botId: string;
|
|
4
|
-
aliasId: string;
|
|
5
|
-
localeId: string;
|
|
6
|
-
region: string;
|
|
7
|
-
providerName: string;
|
|
8
|
-
onComplete?(botname: string, callback: (err: any, confirmation: any) => void): void;
|
|
9
|
-
}
|
|
10
|
-
export interface AWSLexV2ProviderOptions {
|
|
11
|
-
[key: string]: AWSLexV2ProviderOption;
|
|
12
|
-
}
|
package/lib/types/Response.d.ts
DELETED