cmcts-c-agent-embedding 1.1.2-cmcuni → 1.1.5-cmcuni
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 +349 -349
- package/dist/components/Bot.d.ts.map +1 -1
- package/dist/components/bubbles/BotBubble.d.ts +1 -0
- package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
- package/dist/components/buttons/ConsultationButton.d.ts +1 -0
- package/dist/components/buttons/ConsultationButton.d.ts.map +1 -1
- package/dist/components/buttons/PopupToast.d.ts +1 -1
- package/dist/components/buttons/PopupToast.d.ts.map +1 -1
- package/dist/utils/redisAndQueue.d.ts +32 -0
- package/dist/utils/redisAndQueue.d.ts.map +1 -0
- package/dist/utils/transcriptApi.d.ts.map +1 -1
- package/dist/web.js +1 -1
- package/package.json +2 -2
- package/public/index.html +47 -45
- package/server.js +401 -401
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmcts-c-agent-embedding",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-cmcuni",
|
|
4
4
|
"description": "Javascript library to display flowise chatbot on your website",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -78,4 +78,4 @@
|
|
|
78
78
|
"uuid": "^9.0.1"
|
|
79
79
|
},
|
|
80
80
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
81
|
-
}
|
|
81
|
+
}
|
package/public/index.html
CHANGED
|
@@ -8,53 +8,55 @@
|
|
|
8
8
|
|
|
9
9
|
<!doctype html>
|
|
10
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
11
|
|
|
17
|
-
|
|
18
|
-
|
|
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">
|
|
19
20
|
<flowise-fullchatbot></flowise-fullchatbot>
|
|
20
21
|
</div> -->
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
};
|
|
23
39
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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.init({
|
|
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: '373bfccc-9796-48df-a63a-45dcf5855aeb', // or 'support', 'salesbot', etc.
|
|
52
|
+
apiHost: 'https://cmc-uni.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
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
</body>
|
|
38
61
|
|
|
39
|
-
|
|
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: '226da69f-74ed-4250-b754-a388e57b2877', // or 'support', 'salesbot', etc.
|
|
51
|
-
apiHost: 'https://cmc-uni.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>
|
|
62
|
+
</html>
|