cmcts-c-agent-embedding 1.0.52-vib → 1.0.55-vib

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmcts-c-agent-embedding",
3
- "version": "1.0.52-vib",
3
+ "version": "1.0.55-vib",
4
4
  "description": "Javascript library to display flowise chatbot on your website",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,11 +8,11 @@
8
8
  "scripts": {
9
9
  "dev": "cross-env NODE_ENV=development rollup --watch --config rollup.config.js",
10
10
  "build": "cross-env NODE_ENV=production rollup --config rollup.config.js",
11
+ "type-check": "tsc --noEmit",
11
12
  "lint": "eslint \"src/**/*.ts*\"",
12
13
  "lint-fix": "eslint --fix \"src/**/*.ts*\"",
13
14
  "format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
14
15
  "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
15
- "prepare": "husky install",
16
16
  "start": "node server.js",
17
17
  "build-and-publish": "yarn build && npm publish"
18
18
  },
@@ -63,7 +63,6 @@
63
63
  "eslint-plugin-prettier": "^5.0.1",
64
64
  "eslint-plugin-react": "^7.26.1",
65
65
  "eslint-plugin-solid": "0.12.0",
66
- "husky": "^8.0.0",
67
66
  "postcss": "8.4.21",
68
67
  "react": "18.2.0",
69
68
  "rollup": "3.23.0",
package/public/index.html CHANGED
@@ -1,153 +1,60 @@
1
- <!--
2
- NOTE: This .html file (and public folder) is optional and can be safely deleted.
3
- It serves only as a demo/test page.
4
-
5
- The chatbot can be embedded directly on any allowed domain using the embed script that
6
- is generated when starting the server.
7
- -->
8
-
9
- <!doctype html>
10
- <html lang="en">
11
-
12
- <head>
13
- <meta charset="UTF-8" />
14
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
- <title>Flowise Chatbot Widget</title>
16
- </head>
17
-
18
- <body>
19
- <div id="root">
20
- <flowise-fullchatbot></flowise-fullchatbot>
21
- </div>
22
- <script type="module">
23
- import Chatbot from './web.js';
24
-
25
- const customStringify = (obj) => {
26
- let stringified = JSON.stringify(obj, null, 4)
27
- .replace(/"([^"]+)":/g, '$1:')
28
- .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
29
- .replace(/: "(true|false|\d+)"/g, ': $1')
30
- .replace(/customCSS: ""/g, 'customCSS: ``');
31
- return stringified
32
- .split('\n')
33
- .map((line, index) => {
34
- if (index === 0) return line;
35
- return ' '.repeat(8) + line;
36
- })
37
- .join('\n');
38
- };
39
-
40
- // Example initialization:
41
- // If your .env contains:
42
- // agent1=xyz789-uvw456,https://example.com
43
- // support=abc123-def456,https://example.com
44
- // salesbot=ghi123-jkl456,https://example.com
45
- //
46
- // Then use the environment variable name as chatflowid:
47
- Chatbot.initFull({
48
- // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
49
- // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
50
- // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
51
- chatflowid: '1755164d-cb72-4325-9831-83b295ce42bc', // or 'support', 'salesbot', etc.
52
- apiHost: 'https://vib.cagent.cmcts.ai',
53
- // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
54
- chatwootUrl: 'https://livechat.cagent.cmcts.ai',
55
- roomIds: {
56
- '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
57
- },
58
- theme: customStringify({
59
- button: {
60
- backgroundColor: '#3B81F6',
61
- right: 20,
62
- bottom: 20,
63
- size: 48,
64
- dragAndDrop: true,
65
- iconColor: 'white',
66
- customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
67
- autoWindowOpen: {
68
- autoOpen: true,
69
- openDelay: 2,
70
- autoOpenOnMobile: false,
71
- },
72
- },
73
- tooltip: {
74
- showTooltip: true,
75
- tooltipMessage: 'Hi There 👋!',
76
- tooltipBackgroundColor: 'black',
77
- tooltipTextColor: 'white',
78
- tooltipFontSize: 16,
79
- },
80
- disclaimer: {
81
- title: 'Disclaimer',
82
- message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
83
- textColor: 'black',
84
- buttonColor: '#3b82f6',
85
- buttonText: 'Start Chatting',
86
- buttonTextColor: 'white',
87
- blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)',
88
- backgroundColor: 'white',
89
- },
90
- customCSS: ``,
91
- chatWindow: {
92
- showTitle: true,
93
- showAgentMessages: true,
94
- title: 'Agent Studio Bot',
95
- titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
96
- welcomeMessage: 'Hello! This is custom welcome message',
97
- errorMessage: 'This is a custom error message',
98
- backgroundColor: '#ffffff',
99
- backgroundImage: 'enter image path or link',
100
- height: 700,
101
- width: 400,
102
- fontSize: 16,
103
- starterPrompts: ['What is a bot?', 'Who are you?'],
104
- starterPromptFontSize: 15,
105
- clearChatOnReload: false,
106
- sourceDocsTitle: 'Sources:',
107
- renderHTML: true,
108
- botMessage: {
109
- backgroundColor: '#f7f8ff',
110
- textColor: '#303235',
111
- showAvatar: true,
112
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
113
- },
114
- userMessage: {
115
- backgroundColor: '#3B81F6',
116
- textColor: '#ffffff',
117
- showAvatar: true,
118
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
119
- },
120
- textInput: {
121
- placeholder: 'Type your question',
122
- backgroundColor: '#ffffff',
123
- textColor: '#303235',
124
- sendButtonColor: '#3B81F6',
125
- maxChars: 50,
126
- maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
127
- autoFocus: true,
128
- sendMessageSound: true,
129
- sendSoundLocation: 'send_message.mp3',
130
- receiveMessageSound: true,
131
- receiveSoundLocation: 'receive_message.mp3',
132
- },
133
- feedback: {
134
- color: '#303235',
135
- },
136
- dateTimeToggle: {
137
- date: true,
138
- time: true,
139
- },
140
- footer: {
141
- textColor: '#303235',
142
- text: 'Powered by',
143
- company: 'Agent Studio',
144
- // companyLink: 'https://flowiseai.com'
145
- companyLink: '#',
146
- },
147
- },
148
- }),
149
- });
150
- </script>
151
- </body>
152
-
153
- </html>
1
+ <!--
2
+ NOTE: This .html file (and public folder) is optional and can be safely deleted.
3
+ It serves only as a demo/test page.
4
+
5
+ The chatbot can be embedded directly on any allowed domain using the embed script that
6
+ is generated when starting the server.
7
+ -->
8
+
9
+ <!doctype html>
10
+ <html lang="en">
11
+ <head>
12
+ <meta charset="UTF-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
+ <title>Flowise Chatbot Widget</title>
15
+ </head>
16
+
17
+ <body>
18
+ <div id="root">
19
+ <!-- <flowise-fullchatbot></flowise-fullchatbot>-->
20
+ </div>
21
+ <script type="module">
22
+ import Chatbot from './web.js';
23
+
24
+ const customStringify = (obj) => {
25
+ let stringified = JSON.stringify(obj, null, 4)
26
+ .replace(/"([^"]+)":/g, '$1:')
27
+ .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
28
+ .replace(/: "(true|false|\d+)"/g, ': $1')
29
+ .replace(/customCSS: ""/g, 'customCSS: ``');
30
+ return stringified
31
+ .split('\n')
32
+ .map((line, index) => {
33
+ if (index === 0) return line;
34
+ return ' '.repeat(8) + line;
35
+ })
36
+ .join('\n');
37
+ };
38
+
39
+ // Example initialization:
40
+ // If your .env contains:
41
+ // agent1=xyz789-uvw456,https://example.com
42
+ // support=abc123-def456,https://example.com
43
+ // salesbot=ghi123-jkl456,https://example.com
44
+ //
45
+ // Then use the environment variable name as chatflowid:
46
+ Chatbot.init({
47
+ // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
48
+ // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
49
+ // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
50
+ chatflowid: '1755164d-cb72-4325-9831-83b295ce42bc', // or 'support', 'salesbot', etc.
51
+ apiHost: 'https://vib.cagent.cmcts.ai',
52
+ // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
53
+ chatwootUrl: 'https://livechat.cagent.cmcts.ai',
54
+ roomIds: {
55
+ '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
56
+ },
57
+ });
58
+ </script>
59
+ </body>
60
+ </html>
package/.husky/pre-commit DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- set -e # Exit on any error
5
-
6
- echo "Running ESLint for linting..."
7
- npm run lint
8
-
9
- echo "Running ESLint for fixing issues..."
10
- npm run lint-fix
11
-
12
- echo "Formatting code..."
13
- npm run format
14
-
15
- echo "Checking formatting..."
16
- npm run format:check
17
-
18
- echo "Pre-commit checks passed."
package/temp.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "RESULT": { "CODE": 0, "MSG": "THÀNH CÔNG." },
3
- "OBJRETURN": {
4
- "data": [
5
- {
6
- "email": "toan.duongquoc@vib.com.vn",
7
- "fullname": "Dương Quốc Toản",
8
- "deptCode": "BTS2004",
9
- "deptName": "Intranet Application Development",
10
- "fullDepCode": "BTS|BTS20|BTS2004",
11
- "fullDeptName": "Banking Technology Services Division | Corporate Application Development | Intranet Application Development",
12
- "address": "Hội sở Mê Linh Point"
13
- },
14
- {
15
- "email": "chau.vuongtu@vib.com.vn",
16
- "fullname": "Vương Tú Châu",
17
- "deptCode": "BTS2004",
18
- "deptName": "Intranet Application Development",
19
- "fullDepCode": "BTS|BTS20|BTS2004",
20
- "fullDeptName": "Banking Technology Services Division | Corporate Application Development | Intranet Application Development",
21
- "address": "Hội sở Mê Linh Point"
22
- }
23
- ]
24
- }
25
- }