@xapp/chat-widget 1.49.5 → 1.50.2

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.
@@ -2,4 +2,13 @@ import { IntentRequest, LaunchRequest, OptionSelectRequest, PermissionRequest }
2
2
  export declare const TIMEOUT_FB_MS = 20000;
3
3
  export declare const TIMEOUT_STENTOR_MS = 20000;
4
4
  export declare type StentorRequest = IntentRequest | LaunchRequest | OptionSelectRequest | PermissionRequest;
5
+ /**
6
+ * Sends a POST to your STENTOR based server.
7
+ *
8
+ * @param data
9
+ * @param url
10
+ * @param key
11
+ * @param signal
12
+ * @returns
13
+ */
5
14
  export declare function postMessageToStentor<TResponse>(data: StentorRequest, url: string, key: string, signal?: AbortSignal): Promise<TResponse>;
@@ -1,4 +1,4 @@
1
- import { UserInfo, WidgetConfigurableMessagesConfig } from "@xapp/stentor-chat-widget";
1
+ import { UserInfo, WidgetConfigurableMessagesConfig, WidgetHooks } from "@xapp/stentor-chat-widget";
2
2
  import { ActionType } from "../store/ChatAction";
3
3
  import { ChatMessageRequest, ChatServerMessage } from "./ChatServerMessage";
4
4
  export interface ChatServer {
@@ -6,6 +6,10 @@ export interface ChatServer {
6
6
  sendOfflineMsg(message: OfflineMessage, cb: (error?: Error) => void): void;
7
7
  sendChatMsg(message: ChatServerMessage, cb: (err?: Error) => void): void;
8
8
  sendChatMsgRequest(message: ChatMessageRequest, cb: (err?: Error) => void): void;
9
+ /**
10
+ * Sets if the bot is typing or not. A typing indicator will appear in the UI.
11
+ * @param isTyping True if typing, false if not.
12
+ */
9
13
  sendTyping(isTyping: boolean): void;
10
14
  /**
11
15
  * Sets who the visitor is (userId, accessToken, attributes)
@@ -27,6 +31,7 @@ export interface ChatServer {
27
31
  export interface ChatServerOptions {
28
32
  readonly token?: string;
29
33
  readonly bot?: UserInfo;
34
+ readonly hooks?: WidgetHooks;
30
35
  readonly configurableMessages?: WidgetConfigurableMessagesConfig;
31
36
  }
32
37
  export interface OfflineMessage {
@@ -16,6 +16,7 @@ export declare class StentorDirectChat implements ChatServer {
16
16
  private readonly configurableMessages;
17
17
  private readonly config;
18
18
  private readonly options;
19
+ private readonly hooks?;
19
20
  constructor(config: StentorDirectChatConfig, options?: ChatServerOptions);
20
21
  init(dispatch: (action: ActionType) => void): void;
21
22
  private setConnectionStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xapp/chat-widget",
3
- "version": "1.49.5",
3
+ "version": "1.50.2",
4
4
  "description": "XAPP Chat Widget",
5
5
  "scripts": {
6
6
  "clean": "rm -rf ./lib/* && rm -rf ./dist/*",
@@ -102,13 +102,13 @@
102
102
  },
103
103
  "dependencies": {
104
104
  "@rollup/plugin-replace": "^4.0.0",
105
- "@xapp/chat-widget-core": "1.49.5",
106
- "@xapp/stentor-chat-widget": "1.49.5",
105
+ "@xapp/chat-widget-core": "1.50.0",
106
+ "@xapp/stentor-chat-widget": "1.50.0",
107
107
  "date-fns": "2.28.0",
108
108
  "react-transition-group": "4.4.5",
109
109
  "socket.io-client": "4.5.1",
110
110
  "store": "2.0.12",
111
111
  "tslib": "2.4.0"
112
112
  },
113
- "gitHead": "737dcd08d0a289b006a41825a9016eb4c19f1f2e"
113
+ "gitHead": "a4ee3849ef82fa008ecaa1c5e8aabaa2aa0450b5"
114
114
  }