@aws-amplify/interactions

  • Version 5.1.0
  • Published
  • 171 kB
  • 7 dependencies
  • Apache-2.0 license

Install

npm i @aws-amplify/interactions
yarn add @aws-amplify/interactions
pnpm add @aws-amplify/interactions

Overview

Interactions category of aws-amplify

Index

Variables

variable Interactions

const Interactions: InteractionsClass;

    Classes

    class AbstractInteractionsProvider

    abstract class AbstractInteractionsProvider implements InteractionsProvider {}

      constructor

      constructor(options?: InteractionsOptions);

        property options

        readonly options: InteractionsOptions;

          method configure

          configure: (config?: InteractionsOptions) => InteractionsOptions;

            method getCategory

            getCategory: () => string;

              method getProviderName

              abstract getProviderName: () => string;

                method onComplete

                abstract onComplete: (
                botname: string,
                callback: (err: any, confirmation: InteractionsResponse) => void
                ) => any;

                  method sendMessage

                  abstract sendMessage: (
                  botname: string,
                  message: string | Object
                  ) => Promise<object>;

                    class AWSLexProvider

                    class AWSLexProvider extends AbstractInteractionsProvider {}

                      constructor

                      constructor(options?: InteractionsOptions);

                        method configure

                        configure: (config?: AWSLexProviderOptions) => AWSLexProviderOptions;

                          method getProviderName

                          getProviderName: () => string;

                            method onComplete

                            onComplete: (
                            botname: string,
                            callback: (err: any, confirmation: any) => void
                            ) => void;

                              method reportBotStatus

                              reportBotStatus: (data: AWSLexProviderSendResponse, botname: string) => void;
                              • Deprecated

                                This is used internally by 'sendMessage' to call onComplete callback for a bot if configured

                              method sendMessage

                              sendMessage: (
                              botname: string,
                              message: string | InteractionsMessage
                              ) => Promise<InteractionsResponse>;

                                class AWSLexV2Provider

                                class AWSLexV2Provider extends AbstractInteractionsProvider {}

                                  constructor

                                  constructor(options?: InteractionsOptions);
                                  • Initialize Interactions with AWS configurations

                                    Parameter options

                                    Configuration object for Interactions

                                  method configure

                                  configure: (config?: AWSLexV2ProviderOptions) => AWSLexV2ProviderOptions;
                                  • Configure Interactions part with aws configuration

                                    Parameter config

                                    Configuration of the Interactions {AWSLexV2ProviderOptions} - Current configuration

                                  method getProviderName

                                  getProviderName: () => string;
                                  • get provider name of the plugin

                                    Returns

                                    {string} name of the provider

                                  method onComplete

                                  onComplete: (
                                  botname: string,
                                  callback: (err: Error | null, confirmation: InteractionsResponse) => void
                                  ) => void;
                                  • Attach a onComplete callback function to a bot. The callback is called once the bot's intent is fulfilled

                                    Parameter botname

                                    Bot name to attach the onComplete callback

                                    Parameter callback

                                    called when Intent Fulfilled

                                  method sendMessage

                                  sendMessage: (
                                  botname: string,
                                  message: string | InteractionsMessage
                                  ) => Promise<InteractionsResponse>;
                                  • Send a message to a bot

                                    Parameter botname

                                    Bot name to send the message

                                    Parameter message

                                    message to send to the bot {Promise} A promise resolves to the response from the bot

                                  Interfaces

                                  interface AWSLexProviderOption

                                  interface AWSLexProviderOption {}

                                    property alias

                                    alias: string;

                                      property name

                                      name: string;

                                        property providerName

                                        providerName?: string;

                                          property region

                                          region: string;

                                            method onComplete

                                            onComplete: (
                                            botname: string,
                                            callback: (err: any, confirmation: any) => void
                                            ) => void;

                                              interface AWSLexProviderOptions

                                              interface AWSLexProviderOptions {}

                                                index signature

                                                [key: string]: AWSLexProviderOption;

                                                  interface AWSLexV2ProviderOption

                                                  interface AWSLexV2ProviderOption {}

                                                    property aliasId

                                                    aliasId: string;

                                                      property botId

                                                      botId: string;

                                                        property localeId

                                                        localeId: string;

                                                          property name

                                                          name: string;

                                                            property providerName

                                                            providerName: string;

                                                              property region

                                                              region: string;

                                                                method onComplete

                                                                onComplete: (
                                                                botname: string,
                                                                callback: (err: any, confirmation: any) => void
                                                                ) => void;

                                                                  interface AWSLexV2ProviderOptions

                                                                  interface AWSLexV2ProviderOptions {}

                                                                    index signature

                                                                    [key: string]: AWSLexV2ProviderOption;

                                                                      interface InteractionsOptions

                                                                      interface InteractionsOptions {}

                                                                        index signature

                                                                        [key: string]: any;

                                                                          interface InteractionsProvider

                                                                          interface InteractionsProvider {}

                                                                            method configure

                                                                            configure: (config: InteractionsOptions) => InteractionsOptions;

                                                                              method getCategory

                                                                              getCategory: () => string;

                                                                                method getProviderName

                                                                                getProviderName: () => string;

                                                                                  method onComplete

                                                                                  onComplete: (
                                                                                  botname: string,
                                                                                  callback: (err: any, confirmation: InteractionsResponse) => void
                                                                                  ) => any;

                                                                                    method sendMessage

                                                                                    sendMessage: (botname: string, message: string | Object) => Promise<object>;

                                                                                      interface InteractionsProviders

                                                                                      interface InteractionsProviders {}

                                                                                        index signature

                                                                                        [key: string]: InteractionsProvider;

                                                                                          Type Aliases

                                                                                          type InteractionsMessage

                                                                                          type InteractionsMessage = InteractionsTextMessage | InteractionsVoiceMessage;

                                                                                            type InteractionsResponse

                                                                                            type InteractionsResponse = {
                                                                                            [key: string]: any;
                                                                                            };

                                                                                              type InteractionsTextMessage

                                                                                              type InteractionsTextMessage = {
                                                                                              content: string;
                                                                                              options: {
                                                                                              messageType: 'text';
                                                                                              };
                                                                                              };

                                                                                                type InteractionsVoiceMessage

                                                                                                type InteractionsVoiceMessage = {
                                                                                                content: object;
                                                                                                options: {
                                                                                                messageType: 'voice';
                                                                                                };
                                                                                                };

                                                                                                  Package Files (10)

                                                                                                  Dependencies (7)

                                                                                                  Dev Dependencies (0)

                                                                                                  No dev dependencies.

                                                                                                  Peer Dependencies (0)

                                                                                                  No peer dependencies.

                                                                                                  Badge

                                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-amplify/interactions.

                                                                                                  • Markdown
                                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@aws-amplify/interactions)
                                                                                                  • HTML
                                                                                                    <a href="https://www.jsdocs.io/package/@aws-amplify/interactions"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>