@snf/qa-bot-core 0.2.12 → 0.2.13
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/README.md +8 -8
- package/build/static/js/main.js +1 -1
- package/build/static/js/main.js.map +1 -1
- package/dist/qa-bot-core.js +2 -2
- package/dist/qa-bot-core.js.map +1 -1
- package/dist/qa-bot-core.standalone.js +1 -1
- package/dist/qa-bot-core.standalone.js.map +1 -1
- package/dist/qa-bot-core.umd.cjs +1 -1
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/config.d.ts +9 -9
- package/dist/types/utils/logger.d.ts +1 -1
- package/dist/types/utils/session-utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/types/config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Settings, Flow } from 'react-chatbotify';
|
|
|
2
2
|
/**
|
|
3
3
|
* Analytics event types fired by qa-bot-core
|
|
4
4
|
*/
|
|
5
|
-
export type QABotAnalyticsEventType = '
|
|
5
|
+
export type QABotAnalyticsEventType = 'chatbot_open' | 'chatbot_close' | 'chatbot_new_chat' | 'chatbot_question_sent' | 'chatbot_answer_received' | 'chatbot_answer_error' | 'chatbot_rating_sent' | 'chatbot_login_prompt_shown';
|
|
6
6
|
/**
|
|
7
7
|
* Analytics event payload
|
|
8
8
|
*
|
|
@@ -13,14 +13,14 @@ export type QABotAnalyticsEventType = 'qa_bot_opened' | 'qa_bot_closed' | 'qa_ne
|
|
|
13
13
|
* - isEmbedded: Whether bot is in embedded mode (true) or floating/widget mode (false)
|
|
14
14
|
*
|
|
15
15
|
* Event-specific fields:
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
16
|
+
* - chatbot_open: (common fields only)
|
|
17
|
+
* - chatbot_close: messageCount, durationMs
|
|
18
|
+
* - chatbot_new_chat: previousMessageCount
|
|
19
|
+
* - chatbot_question_sent: queryId, questionLength
|
|
20
|
+
* - chatbot_answer_received: queryId, responseTimeMs, success, responseLength, hasMetadata
|
|
21
|
+
* - chatbot_answer_error: queryId, errorType
|
|
22
|
+
* - chatbot_rating_sent: queryId, rating
|
|
23
|
+
* - chatbot_login_prompt_shown: (common fields only)
|
|
24
24
|
*/
|
|
25
25
|
export interface QABotAnalyticsEvent {
|
|
26
26
|
type: QABotAnalyticsEventType;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Usage for consumers:
|
|
8
8
|
* localStorage.setItem('QA_BOT_DEBUG', 'true'); // Enable debug logs + version
|
|
9
9
|
*/
|
|
10
|
-
export declare const LIB_VERSION = "0.2.
|
|
10
|
+
export declare const LIB_VERSION = "0.2.13";
|
|
11
11
|
export declare const logger: {
|
|
12
12
|
version: () => void;
|
|
13
13
|
session: (action: string, ...args: unknown[]) => void;
|
|
@@ -43,12 +43,12 @@ export declare const getAllSessions: () => Array<{
|
|
|
43
43
|
export declare const getSessionMessages: (sessionId: string) => StoredMessage[];
|
|
44
44
|
/**
|
|
45
45
|
* Get the message count for a session.
|
|
46
|
-
* Used for analytics (
|
|
46
|
+
* Used for analytics (chatbot_close, chatbot_new_chat events).
|
|
47
47
|
*/
|
|
48
48
|
export declare const getSessionMessageCount: (sessionId: string) => number;
|
|
49
49
|
/**
|
|
50
50
|
* Compute how long a session has been active (in milliseconds).
|
|
51
51
|
* Calculates the difference between now and the session's startedAt timestamp.
|
|
52
|
-
* Used for analytics (
|
|
52
|
+
* Used for analytics (chatbot_close event).
|
|
53
53
|
*/
|
|
54
54
|
export declare const computeSessionDurationMs: (sessionId: string) => number;
|
package/package.json
CHANGED