@developer.notchatbot/webchat 1.1.8 → 1.2.1
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/dist/components/ConversationRating.d.ts +7 -0
- package/dist/config/endpoints.d.ts +5 -0
- package/dist/types.d.ts +6 -0
- package/dist/utils/ably.d.ts +2 -1
- package/dist/utils/messaging.d.ts +4 -2
- package/dist/webchat-bundle.min.js +4915 -4781
- package/dist/webchat-bundle.min.umd.cjs +43 -43
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ export interface EndpointConfig {
|
|
|
3
3
|
chatEndpoint: string;
|
|
4
4
|
conversationEndpoint: string;
|
|
5
5
|
uploadEndpoint: string;
|
|
6
|
+
rateEndpoint: string;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Detecta si estamos en ambiente de desarrollo
|
|
@@ -24,6 +25,10 @@ export declare function getConversationEndpoint(): string;
|
|
|
24
25
|
* Obtiene el endpoint de upload
|
|
25
26
|
*/
|
|
26
27
|
export declare function getUploadEndpoint(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Obtiene el endpoint de rating
|
|
30
|
+
*/
|
|
31
|
+
export declare function getRateEndpoint(): string;
|
|
27
32
|
/**
|
|
28
33
|
* Obtiene la URL base según el ambiente
|
|
29
34
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export interface EmbedChatWindowProps {
|
|
|
71
71
|
onSendMessage: (message: string, files?: FileWithBlobUrl[]) => void;
|
|
72
72
|
isLoading?: boolean;
|
|
73
73
|
isAiTyping?: boolean;
|
|
74
|
+
chatbotActivated?: boolean;
|
|
74
75
|
}
|
|
75
76
|
export interface EmbedChatHeaderProps {
|
|
76
77
|
title: string;
|
|
@@ -122,6 +123,10 @@ export interface ChatWindowProps {
|
|
|
122
123
|
marginBottom?: number;
|
|
123
124
|
marginSide?: number;
|
|
124
125
|
isMobile?: boolean;
|
|
126
|
+
chatbotActivated?: boolean;
|
|
127
|
+
isRated?: boolean;
|
|
128
|
+
onRatingChange?: (isRated: boolean) => void;
|
|
129
|
+
conversationId?: string;
|
|
125
130
|
}
|
|
126
131
|
export interface ChatHeaderProps {
|
|
127
132
|
title: string;
|
|
@@ -138,6 +143,7 @@ export interface MessageListProps {
|
|
|
138
143
|
avatar?: string;
|
|
139
144
|
textColor?: string;
|
|
140
145
|
bubbleUserColor?: string;
|
|
146
|
+
chatbotActivated?: boolean;
|
|
141
147
|
}
|
|
142
148
|
export interface MessageProps {
|
|
143
149
|
message: Message;
|
package/dist/utils/ably.d.ts
CHANGED
|
@@ -10,10 +10,11 @@ export interface AblyConnectionData {
|
|
|
10
10
|
* @param chatbotUid Chatbot UID
|
|
11
11
|
* @param conversationId Conversation ID
|
|
12
12
|
* @param onMessage Callback for new messages
|
|
13
|
+
* @param onChatbotToggle Callback for chatbot activation changes
|
|
13
14
|
* @param onConnectionChange Callback for connection status changes
|
|
14
15
|
* @returns Promise that resolves to Ably connection data
|
|
15
16
|
*/
|
|
16
|
-
export declare const initializeAblyConnection: (tokenDetails: any, chatbotUid: string, conversationId: string, onMessage: (message: Message) => void, onConnectionChange?: (status: string) => void) => Promise<AblyConnectionData>;
|
|
17
|
+
export declare const initializeAblyConnection: (tokenDetails: any, chatbotUid: string, conversationId: string, onMessage: (message: Message) => void, onChatbotToggle?: (chatbotActivated: boolean) => void, onConnectionChange?: (status: string) => void) => Promise<AblyConnectionData>;
|
|
17
18
|
/**
|
|
18
19
|
* Fetches Ably token from conversation endpoint
|
|
19
20
|
* @param conversationId Conversation ID
|
|
@@ -12,6 +12,7 @@ export interface SendMessagePayload {
|
|
|
12
12
|
messages: any[];
|
|
13
13
|
};
|
|
14
14
|
chatbotUid: string;
|
|
15
|
+
newMessages: any[];
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Creates a fallback bot message for error scenarios
|
|
@@ -21,12 +22,13 @@ export declare const createFallbackMessage: () => Message;
|
|
|
21
22
|
/**
|
|
22
23
|
* Builds the payload for sending messages to the API
|
|
23
24
|
* @param conversationId Conversation ID
|
|
24
|
-
* @param messages Array of messages
|
|
25
|
+
* @param messages Array of all messages
|
|
26
|
+
* @param newMessages Array of only new messages to be processed
|
|
25
27
|
* @param config Chat configuration
|
|
26
28
|
* @param sessionId User's session identifier
|
|
27
29
|
* @returns API payload
|
|
28
30
|
*/
|
|
29
|
-
export declare const buildMessagePayload: (conversationId: string, messages: Message[], config: {
|
|
31
|
+
export declare const buildMessagePayload: (conversationId: string, messages: Message[], newMessages: Message[], config: {
|
|
30
32
|
apiKey: string;
|
|
31
33
|
}, sessionId: string) => SendMessagePayload;
|
|
32
34
|
/**
|