@robylon/web-react-sdk 1.1.32-staging.0 → 1.1.32
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 +452 -101
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ChatbotContainer/ChatbotContainer.d.ts +5 -0
- package/dist/cjs/types/components/ChatbotFloatingButton.d.ts +3 -0
- package/dist/cjs/types/components/ChatbotIframe.d.ts +2 -0
- package/dist/cjs/types/components/RobylonChatbot.d.ts +3 -0
- package/dist/cjs/types/constants/fontStyles.d.ts +2 -0
- package/dist/cjs/types/core/api.d.ts +8 -0
- package/dist/cjs/types/core/config.d.ts +34 -0
- package/dist/cjs/types/core/events.d.ts +22 -0
- package/dist/cjs/types/core/index.d.ts +4 -0
- package/dist/cjs/types/core/state.d.ts +34 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/types.d.ts +33 -0
- package/dist/cjs/types/utils/fetchData.d.ts +16 -0
- package/dist/cjs/types/vanilla/components/ChatbotContainer.d.ts +45 -0
- package/dist/cjs/types/vanilla/components/ChatbotFloatingButton.d.ts +72 -0
- package/dist/cjs/types/vanilla/components/ChatbotIframe.d.ts +73 -0
- package/dist/cjs/types/vanilla/index.d.ts +35 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ChatbotContainer/ChatbotContainer.d.ts +5 -0
- package/dist/esm/types/components/ChatbotFloatingButton.d.ts +3 -0
- package/dist/esm/types/components/ChatbotIframe.d.ts +2 -0
- package/dist/esm/types/components/RobylonChatbot.d.ts +3 -0
- package/dist/esm/types/constants/fontStyles.d.ts +2 -0
- package/dist/esm/types/core/api.d.ts +8 -0
- package/dist/esm/types/core/config.d.ts +34 -0
- package/dist/esm/types/core/events.d.ts +22 -0
- package/dist/esm/types/core/index.d.ts +4 -0
- package/dist/esm/types/core/state.d.ts +34 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/types.d.ts +33 -0
- package/dist/esm/types/utils/fetchData.d.ts +16 -0
- package/dist/esm/types/vanilla/components/ChatbotContainer.d.ts +45 -0
- package/dist/esm/types/vanilla/components/ChatbotFloatingButton.d.ts +72 -0
- package/dist/esm/types/vanilla/components/ChatbotIframe.d.ts +73 -0
- package/dist/esm/types/vanilla/index.d.ts +35 -0
- package/dist/index.d.ts +71 -1
- package/dist/umd/robylon-chatbot.js +2 -0
- package/dist/umd/robylon-chatbot.js.map +1 -0
- package/dist/umd/types/components/ChatbotContainer/ChatbotContainer.d.ts +15 -0
- package/dist/umd/types/components/ChatbotContainer/index.d.ts +1 -0
- package/dist/umd/types/components/ChatbotFloatingButton.d.ts +15 -0
- package/dist/umd/types/components/ChatbotIframe.d.ts +14 -0
- package/dist/umd/types/components/ErrorBoundary.d.ts +15 -0
- package/dist/umd/types/components/RobylonChatbot.d.ts +14 -0
- package/dist/umd/types/config.d.ts +5 -0
- package/dist/umd/types/constants/errorConstants.d.ts +60 -0
- package/dist/umd/types/constants/fontStyles.d.ts +2 -0
- package/dist/umd/types/core/api.d.ts +8 -0
- package/dist/umd/types/core/config.d.ts +34 -0
- package/dist/umd/types/core/events.d.ts +22 -0
- package/dist/umd/types/core/index.d.ts +4 -0
- package/dist/umd/types/core/state.d.ts +34 -0
- package/dist/umd/types/hooks/useChatbot.d.ts +2 -0
- package/dist/umd/types/hooks/useChatbotEvents.d.ts +12 -0
- package/dist/umd/types/hooks/useChatbotState.d.ts +16 -0
- package/dist/umd/types/hooks/useWhyDidYouUpdate.d.ts +5 -0
- package/dist/umd/types/index.d.ts +5 -0
- package/dist/umd/types/services/ErrorTrackingService.d.ts +38 -0
- package/dist/umd/types/types/events.d.ts +22 -0
- package/dist/umd/types/types/state.d.ts +5 -0
- package/dist/umd/types/types.d.ts +71 -0
- package/dist/umd/types/utils/chatbotSdk.d.ts +23 -0
- package/dist/umd/types/utils/colorUtils.d.ts +1 -0
- package/dist/umd/types/utils/cookieUtils.d.ts +6 -0
- package/dist/umd/types/utils/environment.d.ts +12 -0
- package/dist/umd/types/utils/fetchData.d.ts +46 -0
- package/dist/umd/types/utils/logger.d.ts +6 -0
- package/dist/umd/types/utils/misc.d.ts +1 -0
- package/dist/umd/types/utils/originalFetchDataFile.d.ts +1 -0
- package/dist/umd/types/utils/systemInfo.d.ts +13 -0
- package/dist/umd/types/utils/version.d.ts +1 -0
- package/dist/umd/types/vanilla/components/ChatbotContainer.d.ts +45 -0
- package/dist/umd/types/vanilla/components/ChatbotFloatingButton.d.ts +72 -0
- package/dist/umd/types/vanilla/components/ChatbotIframe.d.ts +73 -0
- package/dist/umd/types/vanilla/index.d.ts +35 -0
- package/package.json +28 -9
- package/dist/cjs/types/types/config.d.ts +0 -33
- package/dist/cjs/types/types/index.d.ts +0 -16
- package/dist/esm/types/types/config.d.ts +0 -33
- package/dist/esm/types/types/index.d.ts +0 -16
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChatbotConfig } from "../types";
|
|
2
|
+
export declare class ChatbotEmbed {
|
|
3
|
+
private config;
|
|
4
|
+
private logoContainer;
|
|
5
|
+
private iframe;
|
|
6
|
+
private bubblePromptContainer;
|
|
7
|
+
private chatBtnImage;
|
|
8
|
+
constructor(config: ChatbotConfig);
|
|
9
|
+
private onCloseListener;
|
|
10
|
+
private validateDomain;
|
|
11
|
+
private createChatBubblContainer;
|
|
12
|
+
private createMessageBubble;
|
|
13
|
+
private createFloatingButton;
|
|
14
|
+
private loadImage;
|
|
15
|
+
private createIframe;
|
|
16
|
+
private adjustIframeWidth;
|
|
17
|
+
private loadSvgInline;
|
|
18
|
+
private toggleIcon;
|
|
19
|
+
private toggleIframe;
|
|
20
|
+
private closeIframe;
|
|
21
|
+
init(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const initializeRobylonSdk: (config: ChatbotConfig, setIsInitialized: (value: boolean) => void, setError: (error: string | null) => void) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBestFontColor: (backgroundColor: string, contrastThreshold?: number) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const generateUUID: () => string;
|
|
2
|
+
export declare const getCookie: (name: string) => string | undefined;
|
|
3
|
+
export declare const setCookie: (name: string, value: string, days: number) => void;
|
|
4
|
+
export declare const getLocalStorage: () => string;
|
|
5
|
+
export declare const getSessionStorage: () => string;
|
|
6
|
+
export declare const getCookies: (isTeachmint: boolean) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if code is running in a browser environment
|
|
3
|
+
*/
|
|
4
|
+
export declare const isBrowser: () => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Gets environment configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare const getEnvironmentConfig: () => {
|
|
9
|
+
copilotUrl: string;
|
|
10
|
+
environment: string;
|
|
11
|
+
apiUrl: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ChatbotInterfaceType, LauncherType, WidgetPositionEnums } from "../types";
|
|
2
|
+
interface ChatbotResponse {
|
|
3
|
+
user: {
|
|
4
|
+
token: string;
|
|
5
|
+
user_info: {
|
|
6
|
+
email: string;
|
|
7
|
+
user_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
org_info: {
|
|
11
|
+
org_id: string;
|
|
12
|
+
org_name: string;
|
|
13
|
+
role: string;
|
|
14
|
+
auth_status: string;
|
|
15
|
+
domain: string;
|
|
16
|
+
brand_config: {
|
|
17
|
+
display_name: string;
|
|
18
|
+
redirect_url: string;
|
|
19
|
+
colors?: {
|
|
20
|
+
brand_color: string;
|
|
21
|
+
title_bar_color?: string;
|
|
22
|
+
};
|
|
23
|
+
launcher_logo_url?: string;
|
|
24
|
+
welcome_message: string;
|
|
25
|
+
image_url: string;
|
|
26
|
+
interface_properties: {
|
|
27
|
+
position: WidgetPositionEnums;
|
|
28
|
+
side_spacing: number;
|
|
29
|
+
bottom_spacing: number;
|
|
30
|
+
};
|
|
31
|
+
interface_type: ChatbotInterfaceType;
|
|
32
|
+
launcher_type: LauncherType;
|
|
33
|
+
launcher_properties: {
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
images: {
|
|
37
|
+
launcher_image_url: {
|
|
38
|
+
url: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare const fetchChatbotConfig: (chatbotId: string, userId: string | null | number, token?: string) => Promise<ChatbotResponse>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateUUID(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const originalFetchData: (url: string, payload: any) => Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChatbotConfig } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Class representing the ChatbotContainer component
|
|
4
|
+
* Container component that wraps the floating button and iframe
|
|
5
|
+
* to allow styling them as a single unit
|
|
6
|
+
*/
|
|
7
|
+
export declare class ChatbotContainer {
|
|
8
|
+
private containerElement;
|
|
9
|
+
private resizeObserver;
|
|
10
|
+
private handleResizeFunction;
|
|
11
|
+
private config;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new ChatbotContainer
|
|
14
|
+
*/
|
|
15
|
+
constructor(config: ChatbotConfig, position?: "Left" | "Right", sideSpacing?: number, bottomSpacing?: number);
|
|
16
|
+
/**
|
|
17
|
+
* Renders the container element
|
|
18
|
+
*/
|
|
19
|
+
private render;
|
|
20
|
+
/**
|
|
21
|
+
* Apply styles based on screen width
|
|
22
|
+
*/
|
|
23
|
+
private applyStyles;
|
|
24
|
+
/**
|
|
25
|
+
* Handle resize event
|
|
26
|
+
*/
|
|
27
|
+
private handleResize;
|
|
28
|
+
/**
|
|
29
|
+
* Set up resize listener to adjust styles on window resize
|
|
30
|
+
*/
|
|
31
|
+
private setupResizeListener;
|
|
32
|
+
/**
|
|
33
|
+
* Mounts the container to the DOM
|
|
34
|
+
*/
|
|
35
|
+
private mount;
|
|
36
|
+
/**
|
|
37
|
+
* Gets the container element
|
|
38
|
+
* @returns The container element
|
|
39
|
+
*/
|
|
40
|
+
getElement(): HTMLDivElement;
|
|
41
|
+
/**
|
|
42
|
+
* Unmounts and destroys the container
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ChatbotConfig } from "../../types";
|
|
2
|
+
import { ChatbotEventType, AllEventTypes } from "../../types/events";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for the ChatbotFloatingButton configuration
|
|
5
|
+
*/
|
|
6
|
+
interface ChatbotFloatingButtonConfig {
|
|
7
|
+
config: ChatbotConfig;
|
|
8
|
+
toggleIframe: () => void;
|
|
9
|
+
isIframeVisible: boolean;
|
|
10
|
+
onEvent?: (event: {
|
|
11
|
+
type: ChatbotEventType;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
data?: any;
|
|
14
|
+
}) => void;
|
|
15
|
+
onInternalEvent: (eventType: AllEventTypes, additionalData?: Record<string, any>) => void;
|
|
16
|
+
position?: "Left" | "Right";
|
|
17
|
+
sideSpacing?: number;
|
|
18
|
+
bottomSpacing?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Class representing the ChatbotFloatingButton component
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChatbotFloatingButton {
|
|
24
|
+
private buttonElement;
|
|
25
|
+
private config;
|
|
26
|
+
private resizeObserver;
|
|
27
|
+
private handleResizeFunction;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new ChatbotFloatingButton
|
|
30
|
+
* @param config The button configuration
|
|
31
|
+
*/
|
|
32
|
+
constructor(config: ChatbotFloatingButtonConfig);
|
|
33
|
+
/**
|
|
34
|
+
* Renders the button element
|
|
35
|
+
*/
|
|
36
|
+
private render;
|
|
37
|
+
private createLauncherElement;
|
|
38
|
+
private createTextLauncher;
|
|
39
|
+
private createTextualImageLauncher;
|
|
40
|
+
/**
|
|
41
|
+
* Apply responsive styles based on screen width
|
|
42
|
+
* @param baseStyles The base styles to apply
|
|
43
|
+
*/
|
|
44
|
+
private applyResponsiveStyles;
|
|
45
|
+
/**
|
|
46
|
+
* Handle resize event
|
|
47
|
+
*/
|
|
48
|
+
private handleResize;
|
|
49
|
+
/**
|
|
50
|
+
* Set up resize listener to adjust styles on window resize
|
|
51
|
+
*/
|
|
52
|
+
private setupResizeListener;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the button element
|
|
55
|
+
* @returns The button element
|
|
56
|
+
*/
|
|
57
|
+
getElement(): HTMLDivElement;
|
|
58
|
+
/**
|
|
59
|
+
* Mounts the button to the DOM
|
|
60
|
+
*/
|
|
61
|
+
private mount;
|
|
62
|
+
/**
|
|
63
|
+
* Updates the button with new configuration
|
|
64
|
+
* @param config The new configuration
|
|
65
|
+
*/
|
|
66
|
+
update(config: Partial<ChatbotFloatingButtonConfig>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Unmounts and destroys the button
|
|
69
|
+
*/
|
|
70
|
+
destroy(): void;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ChatbotConfig } from "../../types";
|
|
2
|
+
import { ChatbotEventType, AllEventTypes } from "../../types/events";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for the ChatbotIframe configuration
|
|
5
|
+
*/
|
|
6
|
+
interface ChatbotIframeConfig {
|
|
7
|
+
config: ChatbotConfig;
|
|
8
|
+
isVisible: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onEvent?: (event: {
|
|
11
|
+
type: ChatbotEventType;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
data?: any;
|
|
14
|
+
}) => void;
|
|
15
|
+
onInternalEvent: (eventType: AllEventTypes, additionalData?: Record<string, any>) => void;
|
|
16
|
+
position?: "Left" | "Right";
|
|
17
|
+
bottomSpacing?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Class representing the ChatbotIframe component
|
|
21
|
+
*/
|
|
22
|
+
export declare class ChatbotIframe {
|
|
23
|
+
private iframeElement;
|
|
24
|
+
private config;
|
|
25
|
+
private isInitialized;
|
|
26
|
+
private hasRegistered;
|
|
27
|
+
private resizeHandler;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new ChatbotIframe
|
|
30
|
+
* @param config The iframe configuration
|
|
31
|
+
*/
|
|
32
|
+
constructor(config: ChatbotIframeConfig);
|
|
33
|
+
/**
|
|
34
|
+
* Gets the iframe element
|
|
35
|
+
* @returns The iframe element
|
|
36
|
+
*/
|
|
37
|
+
getElement(): HTMLIFrameElement;
|
|
38
|
+
/**
|
|
39
|
+
* Renders the iframe element
|
|
40
|
+
*/
|
|
41
|
+
private render;
|
|
42
|
+
/**
|
|
43
|
+
* Applies responsive styles based on window width
|
|
44
|
+
*/
|
|
45
|
+
private applyResponsiveStyles;
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the iframe
|
|
48
|
+
*/
|
|
49
|
+
private initialize;
|
|
50
|
+
/**
|
|
51
|
+
* Sets up event listeners
|
|
52
|
+
*/
|
|
53
|
+
private setupEventListeners;
|
|
54
|
+
/**
|
|
55
|
+
* Handles messages from the iframe
|
|
56
|
+
*/
|
|
57
|
+
private handleMessage;
|
|
58
|
+
/**
|
|
59
|
+
* Updates the iframe visibility
|
|
60
|
+
* @param isVisible Whether the iframe should be visible
|
|
61
|
+
*/
|
|
62
|
+
updateVisibility(isVisible: boolean): void;
|
|
63
|
+
/**
|
|
64
|
+
* Updates the iframe with new configuration
|
|
65
|
+
* @param config The new configuration
|
|
66
|
+
*/
|
|
67
|
+
update(config: Partial<ChatbotIframeConfig>): void;
|
|
68
|
+
/**
|
|
69
|
+
* Unmounts and destroys the iframe
|
|
70
|
+
*/
|
|
71
|
+
destroy(): void;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChatbotEvent } from "../types/events";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for the RobylonChatbot configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface RobylonChatbotConfig {
|
|
6
|
+
api_key: string;
|
|
7
|
+
user_id?: string | null | number;
|
|
8
|
+
user_token?: string;
|
|
9
|
+
user_profile?: Record<string, any>;
|
|
10
|
+
onEvent?: (event: ChatbotEvent) => void;
|
|
11
|
+
position?: "Left" | "Right" | string;
|
|
12
|
+
sideSpacing?: number | string;
|
|
13
|
+
bottomSpacing?: number | string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* RobylonChatbot instance interface
|
|
17
|
+
*/
|
|
18
|
+
export interface RobylonChatbotInstance {
|
|
19
|
+
show: () => void;
|
|
20
|
+
hide: () => void;
|
|
21
|
+
toggle: () => void;
|
|
22
|
+
destroy: () => void;
|
|
23
|
+
getState: () => string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new RobylonChatbot instance
|
|
27
|
+
* @param config The chatbot configuration
|
|
28
|
+
* @returns A RobylonChatbot instance
|
|
29
|
+
*/
|
|
30
|
+
export declare function create(config: RobylonChatbotConfig): RobylonChatbotInstance;
|
|
31
|
+
declare const _default: {
|
|
32
|
+
create: typeof create;
|
|
33
|
+
getState: () => string;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robylon/web-react-sdk",
|
|
3
|
-
"version": "1.1.32
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"description": "React SDK for Robylon AI Chatbot",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"unpkg": "dist/umd/robylon-chatbot.js",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist",
|
|
10
11
|
"README.md",
|
|
@@ -12,20 +13,38 @@
|
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"clean": "rm -rf dist",
|
|
15
|
-
"build:development": "npm run clean && cross-env NODE_ENV=development rollup -c",
|
|
16
|
-
"build:staging": "npm run clean && cross-env NODE_ENV=staging PUBLISH_TYPE=staging rollup -c",
|
|
17
|
-
"build:production": "npm run clean && cross-env NODE_ENV=production PUBLISH_TYPE=production rollup -c",
|
|
18
|
-
"build": "npm run
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
16
|
+
"build:development": "npm run clean && cross-env NODE_ENV=development TARGET=npm rollup -c",
|
|
17
|
+
"build:staging": "npm run clean && cross-env NODE_ENV=staging PUBLISH_TYPE=staging TARGET=npm rollup -c",
|
|
18
|
+
"build:production": "npm run clean && cross-env NODE_ENV=production PUBLISH_TYPE=production TARGET=npm rollup -c",
|
|
19
|
+
"build:development:unpkg": "npm run clean && cross-env NODE_ENV=development TARGET=unpkg rollup -c",
|
|
20
|
+
"build:staging:unpkg": "npm run clean && cross-env NODE_ENV=staging PUBLISH_TYPE=staging TARGET=unpkg rollup -c",
|
|
21
|
+
"build:production:unpkg": "npm run clean && cross-env NODE_ENV=production PUBLISH_TYPE=production TARGET=unpkg rollup -c",
|
|
22
|
+
"build:development:all": "npm run clean && cross-env NODE_ENV=development TARGET=all rollup -c",
|
|
23
|
+
"build:staging:all": "npm run clean && cross-env NODE_ENV=staging PUBLISH_TYPE=staging TARGET=all rollup -c",
|
|
24
|
+
"build:production:all": "npm run clean && cross-env NODE_ENV=production PUBLISH_TYPE=production TARGET=all rollup -c",
|
|
25
|
+
"build": "npm run build:development:all",
|
|
26
|
+
"version:staging": "npm version prerelease --preid=staging",
|
|
27
|
+
"version:production": "npm version patch",
|
|
28
|
+
"trigger:staging": "node scripts/trigger-staging-workflow.js",
|
|
29
|
+
"trigger:production": "gh workflow run deploy-sdk.yml",
|
|
30
|
+
"deploy:staging": "npm run version:staging && npm run trigger:staging",
|
|
31
|
+
"deploy:production": "npm run version:production && npm run trigger:production",
|
|
32
|
+
"update-changelog": "node scripts/update-changelog.js",
|
|
33
|
+
"install-hooks": "node scripts/install-hooks.js",
|
|
34
|
+
"publish:staging": "node scripts/validate-publish.js staging && npm run build:staging:all && npm version prerelease --preid=staging --force && npm publish --tag staging && node scripts/create-version-tag.js",
|
|
35
|
+
"publish:production": "node scripts/validate-publish.js production && npm run build:production:all && node scripts/publish-version.js && npm publish --tag latest && node scripts/create-version-tag.js",
|
|
36
|
+
"publish:hotfix": "node scripts/validate-publish.js hotfix && npm run build:production:all && npm version prerelease --preid=patch && npm publish --tag hotfix && node scripts/create-version-tag.js",
|
|
22
37
|
"test": "jest",
|
|
23
38
|
"test:watch": "jest --watch",
|
|
24
39
|
"lint": "eslint src/**/*.{ts,tsx}",
|
|
25
40
|
"lint:fix": "eslint src/**/*.{ts,tsx} --fix",
|
|
26
41
|
"prepare": "node scripts/husky-setup.js",
|
|
27
42
|
"branch": "node scripts/create-branch.js",
|
|
28
|
-
"release": "node scripts/release.js"
|
|
43
|
+
"release": "node scripts/release.js",
|
|
44
|
+
"build:vanilla": "cross-env TARGET=unpkg rollup -c",
|
|
45
|
+
"build:development:cloudfront": "npm run clean && cross-env NODE_ENV=development TARGET=cloudfront rollup -c",
|
|
46
|
+
"build:staging:cloudfront": "npm run clean && cross-env NODE_ENV=staging PUBLISH_TYPE=staging TARGET=cloudfront rollup -c",
|
|
47
|
+
"build:production:cloudfront": "npm run clean && cross-env NODE_ENV=production PUBLISH_TYPE=production TARGET=cloudfront rollup -c"
|
|
29
48
|
},
|
|
30
49
|
"publishConfig": {
|
|
31
50
|
"access": "public"
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface UserProfile {
|
|
2
|
-
email: string;
|
|
3
|
-
name: string;
|
|
4
|
-
platform?: string;
|
|
5
|
-
OS?: string;
|
|
6
|
-
browser?: string;
|
|
7
|
-
sdkVersion?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ChatbotStyles {
|
|
10
|
-
buttonPosition?: "bottom-right" | "bottom-left";
|
|
11
|
-
primaryColor?: string;
|
|
12
|
-
buttonSize?: "small" | "medium" | "large";
|
|
13
|
-
}
|
|
14
|
-
export interface ChatbotConfig {
|
|
15
|
-
chatbotId: string;
|
|
16
|
-
userId: string;
|
|
17
|
-
token: string;
|
|
18
|
-
userProfile?: Record<string, any>;
|
|
19
|
-
domain: string;
|
|
20
|
-
brand_colour: string;
|
|
21
|
-
image_url?: string;
|
|
22
|
-
chat_interface_config?: {
|
|
23
|
-
chat_bubble_prompts?: string[];
|
|
24
|
-
display_name?: string;
|
|
25
|
-
welcome_message?: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface RobylonSdkConfig {
|
|
29
|
-
chatbot_id: string;
|
|
30
|
-
user_id: string;
|
|
31
|
-
token?: string;
|
|
32
|
-
userProfile: UserProfile;
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./config";
|
|
2
|
-
export * from "./state";
|
|
3
|
-
export interface ChatbotConfig {
|
|
4
|
-
chatbotId: string;
|
|
5
|
-
userId: string;
|
|
6
|
-
token: string;
|
|
7
|
-
userProfile?: Record<string, any>;
|
|
8
|
-
domain: string;
|
|
9
|
-
brand_colour: string;
|
|
10
|
-
image_url?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ChatbotState {
|
|
13
|
-
isLoading: boolean;
|
|
14
|
-
isInitialized: boolean;
|
|
15
|
-
error: string | null;
|
|
16
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export interface UserProfile {
|
|
2
|
-
email: string;
|
|
3
|
-
name: string;
|
|
4
|
-
platform?: string;
|
|
5
|
-
OS?: string;
|
|
6
|
-
browser?: string;
|
|
7
|
-
sdkVersion?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ChatbotStyles {
|
|
10
|
-
buttonPosition?: "bottom-right" | "bottom-left";
|
|
11
|
-
primaryColor?: string;
|
|
12
|
-
buttonSize?: "small" | "medium" | "large";
|
|
13
|
-
}
|
|
14
|
-
export interface ChatbotConfig {
|
|
15
|
-
chatbotId: string;
|
|
16
|
-
userId: string;
|
|
17
|
-
token: string;
|
|
18
|
-
userProfile?: Record<string, any>;
|
|
19
|
-
domain: string;
|
|
20
|
-
brand_colour: string;
|
|
21
|
-
image_url?: string;
|
|
22
|
-
chat_interface_config?: {
|
|
23
|
-
chat_bubble_prompts?: string[];
|
|
24
|
-
display_name?: string;
|
|
25
|
-
welcome_message?: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface RobylonSdkConfig {
|
|
29
|
-
chatbot_id: string;
|
|
30
|
-
user_id: string;
|
|
31
|
-
token?: string;
|
|
32
|
-
userProfile: UserProfile;
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./config";
|
|
2
|
-
export * from "./state";
|
|
3
|
-
export interface ChatbotConfig {
|
|
4
|
-
chatbotId: string;
|
|
5
|
-
userId: string;
|
|
6
|
-
token: string;
|
|
7
|
-
userProfile?: Record<string, any>;
|
|
8
|
-
domain: string;
|
|
9
|
-
brand_colour: string;
|
|
10
|
-
image_url?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ChatbotState {
|
|
13
|
-
isLoading: boolean;
|
|
14
|
-
isInitialized: boolean;
|
|
15
|
-
error: string | null;
|
|
16
|
-
}
|