cmcts-c-agent-embedding 1.0.64-vib → 1.1.1-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/.env.example +34 -34
- package/.eslintrc.cjs +14 -14
- package/.prettierignore +3 -3
- package/.prettierrc +8 -8
- package/README.md +349 -349
- package/base.json +21 -21
- package/dist/components/Bot.d.ts.map +1 -1
- package/dist/components/bubbles/BotBubble.d.ts +0 -1
- package/dist/components/bubbles/BotBubble.d.ts.map +1 -1
- package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -1
- package/dist/components/buttons/ConsultationButton.d.ts +13 -0
- package/dist/components/buttons/ConsultationButton.d.ts.map +1 -0
- package/dist/components/buttons/CopyMessageButton.d.ts +10 -0
- package/dist/components/buttons/CopyMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/EditMessageButton.d.ts +8 -0
- package/dist/components/buttons/EditMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/PopupToast.d.ts +7 -0
- package/dist/components/buttons/PopupToast.d.ts.map +1 -0
- package/dist/components/dialogs/EditMessageDialog.d.ts +9 -0
- package/dist/components/dialogs/EditMessageDialog.d.ts.map +1 -0
- package/dist/components/icons/AddImageIcon.d.ts.map +1 -1
- package/dist/components/icons/CheckIcon.d.ts +3 -0
- package/dist/components/icons/CheckIcon.d.ts.map +1 -0
- package/dist/components/icons/CopyIcon.d.ts +5 -0
- package/dist/components/icons/CopyIcon.d.ts.map +1 -0
- package/dist/components/icons/EditIcon.d.ts +5 -0
- package/dist/components/icons/EditIcon.d.ts.map +1 -0
- package/dist/components/icons/SupportIcon.d.ts +3 -0
- package/dist/components/icons/SupportIcon.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/inputs/textInput/components/TextInput.d.ts +12 -1
- package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -1
- package/dist/components/modals/ZaloQRModal.d.ts +8 -0
- package/dist/components/modals/ZaloQRModal.d.ts.map +1 -0
- package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
- package/dist/utils/index.d.ts +17 -64
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/transcriptApi.d.ts +8 -0
- package/dist/utils/transcriptApi.d.ts.map +1 -0
- package/dist/web.js +1 -1
- package/dist/window.d.ts.map +1 -1
- package/package.json +81 -79
- package/public/index.html +57 -46
- package/server.js +401 -401
- package/.env +0 -5
package/dist/window.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,QAAQ,GAAG;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,QAAQ,UAAW,QAAQ,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,SAMzD,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,QAAQ,
|
|
1
|
+
{"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../src/window.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,KAAK,QAAQ,GAAG;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,QAAQ,UAAW,QAAQ,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,SAMzD,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,QAAQ,SAMnC,CAAC;AAEF,eAAO,MAAM,OAAO,YAEnB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAC;AAQF,eAAO,MAAM,YAAY;sBAhCO,QAAQ,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;kBAQ9B,QAAQ;;CA4BlC,CAAC;AAEH,eAAO,MAAM,qBAAqB,QAAS,OAAO,SAGjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cmcts-c-agent-embedding",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Javascript library to display flowise chatbot on your website",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "cross-env NODE_ENV=development rollup --watch --config rollup.config.js",
|
|
10
|
-
"build": "cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
11
|
-
"type-check": "tsc --noEmit",
|
|
12
|
-
"lint": "eslint \"src/**/*.ts*\"",
|
|
13
|
-
"lint-fix": "eslint --fix \"src/**/*.ts*\"",
|
|
14
|
-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
|
15
|
-
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"c-agent-embedding
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"solid-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@
|
|
46
|
-
"@rollup/plugin-
|
|
47
|
-
"@rollup/plugin-
|
|
48
|
-
"@rollup/plugin-
|
|
49
|
-
"@rollup/plugin-
|
|
50
|
-
"@rollup/plugin-
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/
|
|
55
|
-
"@
|
|
56
|
-
"@typescript-eslint/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"babel-
|
|
60
|
-
"
|
|
61
|
-
"eslint
|
|
62
|
-
"eslint-config-
|
|
63
|
-
"eslint-
|
|
64
|
-
"eslint-plugin-
|
|
65
|
-
"eslint-plugin-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"rollup
|
|
71
|
-
"rollup-plugin-
|
|
72
|
-
"rollup-plugin-
|
|
73
|
-
"rollup-plugin-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "cmcts-c-agent-embedding",
|
|
3
|
+
"version": "1.1.1-cmcuni",
|
|
4
|
+
"description": "Javascript library to display flowise chatbot on your website",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "cross-env NODE_ENV=development rollup --watch --config rollup.config.js",
|
|
10
|
+
"build": "cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
11
|
+
"type-check": "tsc --noEmit",
|
|
12
|
+
"lint": "eslint \"src/**/*.ts*\"",
|
|
13
|
+
"lint-fix": "eslint --fix \"src/**/*.ts*\"",
|
|
14
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
|
15
|
+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
|
16
|
+
"prepare": "husky install",
|
|
17
|
+
"start": "node server.js",
|
|
18
|
+
"build-and-publish": "yarn build && npm publish"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@babel/core": "^7.22.1",
|
|
23
|
+
"@microsoft/fetch-event-source": "^2.0.1",
|
|
24
|
+
"@ts-stack/markdown": "^1.4.0",
|
|
25
|
+
"@types/pdfjs-dist": "^2.10.378",
|
|
26
|
+
"axios": "^1.7.7",
|
|
27
|
+
"c-agent-embedding": "^1.0.4",
|
|
28
|
+
"c-agent-embedding-react": "^1.0.1",
|
|
29
|
+
"cors": "^2.8.5",
|
|
30
|
+
"cross-env": "^7.0.3",
|
|
31
|
+
"device-detector-js": "^3.0.3",
|
|
32
|
+
"dotenv": "^16.4.5",
|
|
33
|
+
"express": "^4.21.1",
|
|
34
|
+
"form-data": "^4.0.1",
|
|
35
|
+
"lodash": "^4.17.21",
|
|
36
|
+
"multer": "^1.4.5-lts.1",
|
|
37
|
+
"node-fetch": "^3.3.2",
|
|
38
|
+
"pdfjs-dist": "3.11.174",
|
|
39
|
+
"prettier": "^3.4.2",
|
|
40
|
+
"solid-element": "1.7.0",
|
|
41
|
+
"solid-js": "1.7.1",
|
|
42
|
+
"zod": "^3.22.4"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@babel/preset-typescript": "7.21.4",
|
|
46
|
+
"@rollup/plugin-babel": "6.0.3",
|
|
47
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
48
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
49
|
+
"@rollup/plugin-node-resolve": "15.0.1",
|
|
50
|
+
"@rollup/plugin-terser": "0.4.0",
|
|
51
|
+
"@rollup/plugin-typescript": "11.0.0",
|
|
52
|
+
"@tailwindcss/typography": "^0.5.10",
|
|
53
|
+
"@types/lodash": "^4.14.195",
|
|
54
|
+
"@types/node": "18.15.11",
|
|
55
|
+
"@types/uuid": "^8.3.4",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
57
|
+
"@typescript-eslint/parser": "^5.57.0",
|
|
58
|
+
"autoprefixer": "10.4.14",
|
|
59
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
60
|
+
"babel-preset-solid": "1.7.1",
|
|
61
|
+
"eslint": "^8.24.0",
|
|
62
|
+
"eslint-config-next": "13.2.4",
|
|
63
|
+
"eslint-config-prettier": "^9.0.0",
|
|
64
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
65
|
+
"eslint-plugin-react": "^7.26.1",
|
|
66
|
+
"eslint-plugin-solid": "0.12.0",
|
|
67
|
+
"husky": "^8.0.0",
|
|
68
|
+
"postcss": "8.4.21",
|
|
69
|
+
"react": "18.2.0",
|
|
70
|
+
"rollup": "3.23.0",
|
|
71
|
+
"rollup-plugin-livereload": "2.0.5",
|
|
72
|
+
"rollup-plugin-postcss": "4.0.2",
|
|
73
|
+
"rollup-plugin-serve": "2.0.2",
|
|
74
|
+
"rollup-plugin-typescript-paths": "1.4.0",
|
|
75
|
+
"rollup-plugin-uglify": "^6.0.4",
|
|
76
|
+
"tailwindcss": "3.3.1",
|
|
77
|
+
"typescript": "5.0.3",
|
|
78
|
+
"uuid": "^9.0.1"
|
|
79
|
+
},
|
|
80
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
81
|
+
}
|
package/public/index.html
CHANGED
|
@@ -1,47 +1,58 @@
|
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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.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: '226da69f-74ed-4250-b754-a388e57b2877', // or 'support', 'salesbot', etc.
|
|
52
|
+
apiHost: 'https://cmc-uni.cagent.cmcts.ai',
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
</script>
|
|
56
|
+
</body>
|
|
57
|
+
|
|
47
58
|
</html>
|