@snf/qa-bot-core 0.2.18 → 0.2.21
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 +3 -1
- package/build/static/css/main.css +1 -1
- package/build/static/css/main.css.map +1 -1
- package/build/static/js/main.js +1 -1
- package/build/static/js/main.js.map +1 -1
- package/dist/qa-bot-core.js +1 -1
- 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 +2 -2
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/utils/flows/qa-flow.d.ts +5 -1
- package/dist/types/utils/logger.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/config/constants.d.ts +0 -66
- package/dist/types/config/defaults.d.ts +0 -118
- package/dist/types/config/index.d.ts +0 -11
- package/dist/types/config/types.d.ts +0 -150
- package/dist/types/utils/create-bot-flow.d.ts +0 -12
- package/dist/types/utils/deep-merge.d.ts +0 -10
- package/dist/types/utils/flow-merger.d.ts +0 -14
- package/dist/types/utils/validation-utils.d.ts +0 -19
|
@@ -20,7 +20,11 @@ export interface CreateQAFlowParams {
|
|
|
20
20
|
allowAnonAccess?: boolean;
|
|
21
21
|
/** Login URL to redirect to (optional) */
|
|
22
22
|
loginUrl?: string;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The acting user's identifier.
|
|
25
|
+
* @deprecated Identity is now determined server-side from the JWT cookie.
|
|
26
|
+
* This prop is ignored — retained only for backward compatibility during transition.
|
|
27
|
+
*/
|
|
24
28
|
actingUser?: string;
|
|
25
29
|
/** Enriched analytics tracker (adds common fields automatically) */
|
|
26
30
|
trackEvent?: (event: AnalyticsEventInput) => void;
|
|
@@ -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.19";
|
|
11
11
|
export declare const logger: {
|
|
12
12
|
version: () => void;
|
|
13
13
|
session: (action: string, ...args: unknown[]) => void;
|
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QA Bot Core - Runtime Constants and Usage Examples
|
|
3
|
-
*
|
|
4
|
-
* This file contains runtime constants and documentation that was previously
|
|
5
|
-
* in the large api-reference.js file. TypeScript interfaces are now in types.ts.
|
|
6
|
-
*/
|
|
7
|
-
import { CONSTANTS } from './types';
|
|
8
|
-
export { CONSTANTS };
|
|
9
|
-
/**
|
|
10
|
-
* ===========================================
|
|
11
|
-
* USAGE EXAMPLES & PATTERNS
|
|
12
|
-
* ===========================================
|
|
13
|
-
*/
|
|
14
|
-
export declare const USAGE_EXAMPLES: {
|
|
15
|
-
readonly SIMPLE: {
|
|
16
|
-
readonly name: "Level 1: Simple Usage";
|
|
17
|
-
readonly description: "Just business logic props - everything else uses sensible defaults";
|
|
18
|
-
readonly code: "\n<QABot\n apiKey=\"your-key\"\n endpoints={{ qa: 'https://your-api.com/chat' }}\n/>";
|
|
19
|
-
readonly requiredProps: readonly ["apiKey", "endpoints"];
|
|
20
|
-
readonly optionalProps: readonly ["userEmail", "welcomeMessage"];
|
|
21
|
-
};
|
|
22
|
-
readonly COMPLEX: {
|
|
23
|
-
readonly name: "Level 2: Complex Usage";
|
|
24
|
-
readonly description: "Business logic props + full react-chatbotify settings control";
|
|
25
|
-
readonly code: "\n<QABot\n apiKey=\"your-key\"\n endpoints={{ qa: 'https://your-api.com/chat' }}\n welcomeMessage=\"Custom welcome!\"\n settings={{\n general: { primaryColor: '#brand-color' },\n header: { title: 'Support Bot' }\n }}\n/>";
|
|
26
|
-
readonly props: readonly ["...businessProps", "settings", "plugins", "...reactChatbotifyProps"];
|
|
27
|
-
};
|
|
28
|
-
readonly WRAPPER: {
|
|
29
|
-
readonly name: "Level 3: Wrapper Pattern";
|
|
30
|
-
readonly description: "Create organizational bots with pre-configured defaults";
|
|
31
|
-
readonly code: "\nfunction MyOrgBot({ settings = {}, ...props }: WrapperProps) {\n return (\n <QABot\n endpoints={{ qa: 'https://org.com/api' }}\n settings={{\n general: { primaryColor: '#org-blue' },\n ...settings\n }}\n {...props}\n />\n );\n}";
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* ===========================================
|
|
36
|
-
* CUSTOM FLOWS EXAMPLES
|
|
37
|
-
* ===========================================
|
|
38
|
-
*/
|
|
39
|
-
export declare const FLOW_EXAMPLES: {
|
|
40
|
-
readonly description: "Examples of custom conversation flows";
|
|
41
|
-
readonly simple: "\nconst customFlows = {\n start: {\n message: \"How can I help you?\",\n options: [\"Ask Question\", \"Create Ticket\"],\n paths: [\"qa_loop\", \"ticket_flow\"]\n },\n\n ticket_flow: {\n message: \"Please describe your issue:\",\n function: async (params) => {\n const ticket = await createTicket(params.userInput);\n return `Ticket #${ticket.id} created!`;\n }\n }\n};";
|
|
42
|
-
readonly advanced: "\nconst advancedFlows = {\n start: {\n message: \"Welcome! What would you like to do?\",\n options: [\"General Q&A\", \"Create Support Ticket\", \"Report Security Issue\"],\n paths: [\"qa_loop\", \"ticket_flow\", \"security_flow\"]\n },\n\n security_flow: {\n message: \"Security reports are taken seriously. Please describe the issue:\",\n function: async (params) => {\n await createSecurityReport({\n description: params.userInput,\n userEmail: params.userEmail,\n timestamp: new Date(),\n sessionId: params.sessionId\n });\n return \"Thank you for the security report. Our team has been notified.\";\n }\n }\n};";
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* ===========================================
|
|
46
|
-
* MIGRATION GUIDE
|
|
47
|
-
* ===========================================
|
|
48
|
-
*/
|
|
49
|
-
export declare const MIGRATION_FROM_CONFIG_SYSTEM: {
|
|
50
|
-
readonly description: "How to migrate from the old config-based system to the new prop-based system";
|
|
51
|
-
readonly mappings: {
|
|
52
|
-
readonly 'config.core.auth.apiKey': "apiKey prop";
|
|
53
|
-
readonly 'config.core.endpoints.qa': "endpoints.qa prop";
|
|
54
|
-
readonly 'config.core.endpoints.rating': "endpoints.rating prop";
|
|
55
|
-
readonly 'config.user.email': "userEmail prop";
|
|
56
|
-
readonly 'config.user.name': "userName prop";
|
|
57
|
-
readonly 'config.user.loginUrl': "loginUrl prop";
|
|
58
|
-
readonly 'config.flows.welcomeMessage': "welcomeMessage prop";
|
|
59
|
-
readonly 'config.flows.customFlows': "customFlows prop";
|
|
60
|
-
readonly 'config.general.*': "settings.general.*";
|
|
61
|
-
readonly 'config.header.*': "settings.header.*";
|
|
62
|
-
readonly 'config.chatInput.*': "settings.chatInput.*";
|
|
63
|
-
};
|
|
64
|
-
readonly before: "\n// Old config-based system\n<QABot\n config={{\n core: {\n auth: { apiKey: 'key' },\n endpoints: { qa: '/api' }\n },\n flows: { welcomeMessage: 'Hi!' },\n general: { primaryColor: '#blue' }\n }}\n embedded={true} // Prop override confusion\n/>";
|
|
65
|
-
readonly after: "\n// New prop-based system\n<QABot\n apiKey=\"key\"\n endpoints={{ qa: '/api' }}\n welcomeMessage=\"Hi!\"\n settings={{\n general: {\n primaryColor: '#blue',\n embedded: true\n }\n }}\n/>";
|
|
66
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default react-chatbotify settings for QA Bot Core
|
|
3
|
-
*
|
|
4
|
-
* These are sensible defaults that provide a good out-of-the-box experience.
|
|
5
|
-
* Users can override any of these by passing their own settings object.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import type { CustomFlows } from './types';
|
|
9
|
-
export interface ReactChatbotifySettings {
|
|
10
|
-
general?: {
|
|
11
|
-
primaryColor?: string;
|
|
12
|
-
secondaryColor?: string;
|
|
13
|
-
fontFamily?: string;
|
|
14
|
-
embedded?: boolean;
|
|
15
|
-
showHeader?: boolean;
|
|
16
|
-
showFooter?: boolean;
|
|
17
|
-
};
|
|
18
|
-
device?: {
|
|
19
|
-
desktopEnabled?: boolean;
|
|
20
|
-
mobileEnabled?: boolean;
|
|
21
|
-
applyMobileOptimizations?: boolean;
|
|
22
|
-
};
|
|
23
|
-
chatHistory?: {
|
|
24
|
-
disabled?: boolean;
|
|
25
|
-
};
|
|
26
|
-
chatButton?: {
|
|
27
|
-
icon?: string;
|
|
28
|
-
};
|
|
29
|
-
audio?: {
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
};
|
|
32
|
-
emoji?: {
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
};
|
|
35
|
-
fileAttachment?: {
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
};
|
|
38
|
-
notification?: {
|
|
39
|
-
disabled?: boolean;
|
|
40
|
-
};
|
|
41
|
-
footer?: {
|
|
42
|
-
text?: React.ReactElement;
|
|
43
|
-
buttons?: React.ReactElement[];
|
|
44
|
-
};
|
|
45
|
-
event?: {
|
|
46
|
-
rcbToggleChatWindow?: boolean;
|
|
47
|
-
};
|
|
48
|
-
tooltip?: {
|
|
49
|
-
mode?: 'CLOSE' | 'ALWAYS' | 'NEVER';
|
|
50
|
-
text?: string;
|
|
51
|
-
};
|
|
52
|
-
header?: {
|
|
53
|
-
title?: string | React.ReactElement;
|
|
54
|
-
showAvatar?: boolean;
|
|
55
|
-
avatar?: string;
|
|
56
|
-
buttons?: any[];
|
|
57
|
-
};
|
|
58
|
-
chatInput?: {
|
|
59
|
-
disabled?: boolean;
|
|
60
|
-
enabledPlaceholderText?: string;
|
|
61
|
-
disabledPlaceholderText?: string;
|
|
62
|
-
characterLimit?: number;
|
|
63
|
-
showCharacterCount?: boolean;
|
|
64
|
-
allowNewline?: boolean;
|
|
65
|
-
sendButtonStyle?: any;
|
|
66
|
-
sendButtonAriaLabel?: string;
|
|
67
|
-
ariaLabel?: string;
|
|
68
|
-
ariaDescribedBy?: string;
|
|
69
|
-
};
|
|
70
|
-
chatWindow?: {
|
|
71
|
-
defaultOpen?: boolean;
|
|
72
|
-
showScrollbar?: boolean;
|
|
73
|
-
};
|
|
74
|
-
botBubble?: {
|
|
75
|
-
simulateStream?: boolean;
|
|
76
|
-
streamSpeed?: number;
|
|
77
|
-
showAvatar?: boolean;
|
|
78
|
-
allowNewline?: boolean;
|
|
79
|
-
dangerouslySetInnerHTML?: boolean;
|
|
80
|
-
renderHtml?: boolean;
|
|
81
|
-
ariaLabel?: string;
|
|
82
|
-
role?: string;
|
|
83
|
-
};
|
|
84
|
-
userBubble?: {
|
|
85
|
-
showAvatar?: boolean;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
export declare const defaultReactChatbotifySettings: ReactChatbotifySettings;
|
|
89
|
-
/**
|
|
90
|
-
* Default welcome message for Q&A flows
|
|
91
|
-
*/
|
|
92
|
-
export declare const defaultWelcomeMessage: string;
|
|
93
|
-
/**
|
|
94
|
-
* Default business configuration structure
|
|
95
|
-
* Used internally for flow generation and business logic
|
|
96
|
-
*/
|
|
97
|
-
export interface BusinessConfig {
|
|
98
|
-
core: {
|
|
99
|
-
endpoints: {
|
|
100
|
-
qa?: string;
|
|
101
|
-
rating?: string;
|
|
102
|
-
};
|
|
103
|
-
auth: {
|
|
104
|
-
apiKey?: string;
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
user: {
|
|
108
|
-
email?: string;
|
|
109
|
-
name?: string;
|
|
110
|
-
loginUrl?: string;
|
|
111
|
-
};
|
|
112
|
-
flows: {
|
|
113
|
-
welcomeMessage: string;
|
|
114
|
-
customFlows?: CustomFlows;
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
export type { FlowStep, FlowParams } from './types';
|
|
118
|
-
export declare const defaultBusinessConfig: BusinessConfig;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QA Bot Core - Configuration Exports
|
|
3
|
-
*
|
|
4
|
-
* Central export point for all configuration, types, and constants.
|
|
5
|
-
* This replaces the old complex api-reference.js system.
|
|
6
|
-
*/
|
|
7
|
-
export type { QABotProps, QABotBusinessProps, EndpointsConfig, BrandingConfig, MessagesConfig, ReactChatbotifyFlow, ReactChatbotifyPlugin, ReactChatbotifyStyles, SimpleUsageProps, ThemeColors, BotControllerHandle, TooltipMode, FlowPath } from './types';
|
|
8
|
-
export type { ReactChatbotifySettings, BusinessConfig } from './defaults';
|
|
9
|
-
export type { CustomFlows, FlowStep, FlowParams } from './types';
|
|
10
|
-
export { defaultReactChatbotifySettings, defaultWelcomeMessage, defaultBusinessConfig } from './defaults';
|
|
11
|
-
export { CONSTANTS } from './types';
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QA Bot Core - TypeScript Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* SINGLE SOURCE OF TRUTH for all TypeScript interfaces and types.
|
|
5
|
-
* This replaces the old api-reference.js with proper type definitions.
|
|
6
|
-
*/
|
|
7
|
-
export interface CustomFlows {
|
|
8
|
-
[stepName: string]: FlowStep;
|
|
9
|
-
}
|
|
10
|
-
export interface FlowStep {
|
|
11
|
-
message: string;
|
|
12
|
-
options?: string[];
|
|
13
|
-
path?: string | ((input: string) => string | Promise<string>);
|
|
14
|
-
paths?: string[];
|
|
15
|
-
function?: (params: FlowParams) => string | Promise<string>;
|
|
16
|
-
}
|
|
17
|
-
export interface FlowParams {
|
|
18
|
-
userInput: string;
|
|
19
|
-
sessionId: string;
|
|
20
|
-
injectMessage: (message: string) => void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* ===========================================
|
|
24
|
-
* SIMPLE CONFIGURATION (For out-of-the-box users)
|
|
25
|
-
* ===========================================
|
|
26
|
-
*/
|
|
27
|
-
export interface BrandingConfig {
|
|
28
|
-
/** Logo/avatar URL for the chatbot header */
|
|
29
|
-
logo?: string;
|
|
30
|
-
/** Primary color for buttons, highlights (e.g., "#007bff") */
|
|
31
|
-
primaryColor?: string;
|
|
32
|
-
/** Secondary color for hover states (e.g., "#0056b3") */
|
|
33
|
-
secondaryColor?: string;
|
|
34
|
-
/** Primary font family for the chat interface */
|
|
35
|
-
primaryFont?: string;
|
|
36
|
-
/** Secondary font family for special text (code, etc.) */
|
|
37
|
-
secondaryFont?: string;
|
|
38
|
-
/** Name displayed in the chat header */
|
|
39
|
-
botName?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface MessagesConfig {
|
|
42
|
-
/** Initial greeting message from the bot */
|
|
43
|
-
welcome?: string;
|
|
44
|
-
/** Placeholder text in the input field */
|
|
45
|
-
placeholder?: string;
|
|
46
|
-
/** Error message when something goes wrong */
|
|
47
|
-
error?: string;
|
|
48
|
-
/** Message shown when chat is disabled */
|
|
49
|
-
disabled?: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* ===========================================
|
|
53
|
-
* BUSINESS LOGIC PROPS (QA Bot Core Specific)
|
|
54
|
-
* ===========================================
|
|
55
|
-
*/
|
|
56
|
-
export interface EndpointsConfig {
|
|
57
|
-
/** Q&A endpoint URL (e.g., "https://your-api.com/chat") */
|
|
58
|
-
qa: string;
|
|
59
|
-
/** Optional rating/feedback endpoint URL */
|
|
60
|
-
rating?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface QABotBusinessProps {
|
|
63
|
-
/** API key for authenticating with your Q&A service */
|
|
64
|
-
apiKey?: string;
|
|
65
|
-
/** API endpoints for Q&A and rating services */
|
|
66
|
-
endpoints?: EndpointsConfig;
|
|
67
|
-
/** URL to redirect users for login/authentication */
|
|
68
|
-
loginUrl?: string;
|
|
69
|
-
/** Initial greeting message from the bot */
|
|
70
|
-
welcomeMessage?: string;
|
|
71
|
-
/** Custom conversation flow definitions */
|
|
72
|
-
customFlows?: CustomFlows;
|
|
73
|
-
/** Simple branding configuration */
|
|
74
|
-
branding?: BrandingConfig;
|
|
75
|
-
/** Simple message customization */
|
|
76
|
-
messages?: MessagesConfig;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* ===========================================
|
|
80
|
-
* REACT-CHATBOTIFY INTEGRATION
|
|
81
|
-
* ===========================================
|
|
82
|
-
*/
|
|
83
|
-
export interface ReactChatbotifyFlow {
|
|
84
|
-
[stepName: string]: any;
|
|
85
|
-
}
|
|
86
|
-
export type ReactChatbotifyPlugin = (...args: unknown[]) => {
|
|
87
|
-
name: string;
|
|
88
|
-
settings?: any;
|
|
89
|
-
styles?: any;
|
|
90
|
-
};
|
|
91
|
-
export interface ReactChatbotifyStyles {
|
|
92
|
-
[key: string]: any;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* ===========================================
|
|
96
|
-
* COMPLETE QABOT PROPS
|
|
97
|
-
* ===========================================
|
|
98
|
-
*/
|
|
99
|
-
export interface QABotProps extends QABotBusinessProps {
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* ===========================================
|
|
103
|
-
* USAGE TYPES (SIMPLIFIED)
|
|
104
|
-
* ===========================================
|
|
105
|
-
*/
|
|
106
|
-
export interface SimpleUsageProps {
|
|
107
|
-
apiKey: string;
|
|
108
|
-
endpoints: EndpointsConfig;
|
|
109
|
-
welcomeMessage?: string;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* ===========================================
|
|
113
|
-
* INTERNAL TYPES
|
|
114
|
-
* ===========================================
|
|
115
|
-
*/
|
|
116
|
-
export interface ThemeColors {
|
|
117
|
-
primaryColor?: string;
|
|
118
|
-
secondaryColor?: string;
|
|
119
|
-
fontFamily?: string;
|
|
120
|
-
}
|
|
121
|
-
export interface BotControllerHandle {
|
|
122
|
-
addMessage: (message: string) => void;
|
|
123
|
-
openChat: () => void;
|
|
124
|
-
closeChat: () => void;
|
|
125
|
-
toggleChat: () => void;
|
|
126
|
-
setBotEnabled: (enabled: boolean) => void;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* ===========================================
|
|
130
|
-
* CONSTANTS & ENUMS
|
|
131
|
-
* ===========================================
|
|
132
|
-
*/
|
|
133
|
-
export declare const CONSTANTS: {
|
|
134
|
-
readonly DEFAULT_WELCOME_MESSAGE: "Hello! What can I help you with?";
|
|
135
|
-
readonly DEFAULT_PRIMARY_COLOR: "#1a5b6e";
|
|
136
|
-
readonly DEFAULT_SECONDARY_COLOR: "#107180";
|
|
137
|
-
readonly DEFAULT_FONT_FAMILY: "Arial, sans-serif";
|
|
138
|
-
readonly DEFAULT_AVATAR: "/default-chat-icon.svg";
|
|
139
|
-
readonly DEFAULT_CHARACTER_LIMIT: 1000;
|
|
140
|
-
readonly DEFAULT_STREAM_SPEED: 10;
|
|
141
|
-
readonly TOOLTIP_MODES: readonly ["CLOSE", "ALWAYS", "NEVER"];
|
|
142
|
-
readonly FLOW_PATHS: {
|
|
143
|
-
readonly QA_LOOP: "qa_loop";
|
|
144
|
-
readonly QA_START: "qa_start";
|
|
145
|
-
readonly RATING: "rating";
|
|
146
|
-
readonly START: "start";
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export type TooltipMode = typeof CONSTANTS.TOOLTIP_MODES[number];
|
|
150
|
-
export type FlowPath = typeof CONSTANTS.FLOW_PATHS[keyof typeof CONSTANTS.FLOW_PATHS];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BusinessConfig, CustomFlows, ReactChatbotifyFlow } from '../config';
|
|
2
|
-
interface CreateBotFlowParams {
|
|
3
|
-
config: BusinessConfig;
|
|
4
|
-
customFlows?: CustomFlows;
|
|
5
|
-
sessionId: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Creates the bot conversation flow
|
|
9
|
-
* Supports both basic Q&A and custom flows via plugins
|
|
10
|
-
*/
|
|
11
|
-
export declare function createBotFlow({ config, customFlows, sessionId }: CreateBotFlowParams): ReactChatbotifyFlow;
|
|
12
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deep merge utility for nested configuration objects
|
|
3
|
-
* Handles proper merging of nested objects while preserving arrays and other types
|
|
4
|
-
*/
|
|
5
|
-
export declare function deepMerge(target: any, source: any): any;
|
|
6
|
-
/**
|
|
7
|
-
* Merge multiple objects with deep merging
|
|
8
|
-
* Objects are merged left-to-right (later objects have higher priority)
|
|
9
|
-
*/
|
|
10
|
-
export declare function deepMergeAll(...objects: any[]): any;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Flow } from 'react-chatbotify';
|
|
2
|
-
import type { CustomFlows } from '../config';
|
|
3
|
-
/**
|
|
4
|
-
* Merges custom flows with the base Q&A flow
|
|
5
|
-
* Custom flows can:
|
|
6
|
-
* - Override existing flow steps
|
|
7
|
-
* - Add new flow paths
|
|
8
|
-
* - Integrate with Q&A loop via 'qa_loop' path
|
|
9
|
-
*/
|
|
10
|
-
export declare function mergeFlows(baseFlow: Flow, customFlows?: CustomFlows): Flow;
|
|
11
|
-
/**
|
|
12
|
-
* Creates a flow that integrates custom flows with Q&A
|
|
13
|
-
*/
|
|
14
|
-
export declare function createIntegratedFlow(qaFlow: Flow, customFlows?: CustomFlows, welcomeMessage?: string): Flow;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Email validation utility functions
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Validates email format using a comprehensive regex pattern
|
|
6
|
-
*/
|
|
7
|
-
export declare const isValidEmail: (email: string) => boolean;
|
|
8
|
-
interface ValidationResult {
|
|
9
|
-
success: boolean;
|
|
10
|
-
promptContent?: string;
|
|
11
|
-
promptDuration?: number;
|
|
12
|
-
promptType?: string;
|
|
13
|
-
highlightTextArea?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Creates email validation for chat bot flows
|
|
17
|
-
*/
|
|
18
|
-
export declare const validateEmail: (email: string) => ValidationResult;
|
|
19
|
-
export {};
|