@tivagent/tiva-chat 1.0.5 → 1.0.8
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 +337 -60
- package/dist/components/chatbot.d.ts +1 -1
- package/dist/index.cjs.js +57 -57
- package/dist/index.esm.js +892 -884
- package/dist/index.umd.js +117 -117
- package/dist/test.html +24 -24
- package/dist/utils/APIRequests.d.ts +8 -7
- package/package.json +79 -73
package/dist/test.html
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Chatbot Web Component Test</title>
|
|
8
|
-
</head>
|
|
9
|
-
<style>
|
|
10
|
-
body {
|
|
11
|
-
margin: 0;
|
|
12
|
-
min-height: 100dvh;
|
|
13
|
-
background-color: rgb(229, 231, 235);
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
16
|
-
|
|
17
|
-
<body>
|
|
18
|
-
<!-- Use the web component -->
|
|
19
|
-
<tiva-chatbot ui-key="..." api-key="..." base-url="..."></tiva-chatbot>
|
|
20
|
-
|
|
21
|
-
<!-- Load the bundle -->
|
|
22
|
-
<script src="./index.umd.js"></script>
|
|
23
|
-
</body>
|
|
24
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Chatbot Web Component Test</title>
|
|
8
|
+
</head>
|
|
9
|
+
<style>
|
|
10
|
+
body {
|
|
11
|
+
margin: 0;
|
|
12
|
+
min-height: 100dvh;
|
|
13
|
+
background-color: rgb(229, 231, 235);
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
|
|
17
|
+
<body>
|
|
18
|
+
<!-- Use the web component -->
|
|
19
|
+
<tiva-chatbot ui-key="..." api-key="..." base-url="..."></tiva-chatbot>
|
|
20
|
+
|
|
21
|
+
<!-- Load the bundle -->
|
|
22
|
+
<script src="./index.umd.js"></script>
|
|
23
|
+
</body>
|
|
24
|
+
|
|
25
25
|
</html>
|
|
@@ -30,6 +30,7 @@ interface GetResponseParams {
|
|
|
30
30
|
language: string;
|
|
31
31
|
version?: string;
|
|
32
32
|
apiKey?: string;
|
|
33
|
+
uiKey: string;
|
|
33
34
|
baseUrl?: string;
|
|
34
35
|
signal: AbortSignal;
|
|
35
36
|
onStart: OnStartCallback;
|
|
@@ -50,11 +51,11 @@ export interface FeedbackData {
|
|
|
50
51
|
message_id: string;
|
|
51
52
|
feedback: FeedbackType;
|
|
52
53
|
}
|
|
53
|
-
export declare const getHistory: (sessionId: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Message[]>;
|
|
54
|
-
export declare const resetHistory: (sessionId: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Response>;
|
|
55
|
-
export declare const getResponse: ({ message, sessionId, language, version, apiKey, baseUrl, signal, onStart, onStream, onStatus, onComplete, onError, }: GetResponseParams) => Promise<void>;
|
|
56
|
-
export declare const getVoice: (messageId: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Blob>;
|
|
57
|
-
export declare const submitFeedback: (feedbackData: FeedbackData, version?: string, apiKey?: string, baseUrl?: string) => Promise<void>;
|
|
58
|
-
export declare const submitReport: (reportData: ReportData, version?: string, apiKey?: string, baseUrl?: string) => Promise<void>;
|
|
59
|
-
export declare const fetchAPIConfig: (ui_key: string, version?: string,
|
|
54
|
+
export declare const getHistory: (sessionId: string, uiKey: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Message[]>;
|
|
55
|
+
export declare const resetHistory: (sessionId: string, uiKey: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Response>;
|
|
56
|
+
export declare const getResponse: ({ message, sessionId, language, version, apiKey, uiKey, baseUrl, signal, onStart, onStream, onStatus, onComplete, onError, }: GetResponseParams) => Promise<void>;
|
|
57
|
+
export declare const getVoice: (messageId: string, uiKey: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<Blob>;
|
|
58
|
+
export declare const submitFeedback: (feedbackData: FeedbackData, uiKey: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<void>;
|
|
59
|
+
export declare const submitReport: (reportData: ReportData, uiKey: string, version?: string, apiKey?: string, baseUrl?: string) => Promise<void>;
|
|
60
|
+
export declare const fetchAPIConfig: (ui_key: string, version?: string, baseUrl?: string) => Promise<UiConfig | null>;
|
|
60
61
|
export {};
|
package/package.json
CHANGED
|
@@ -1,73 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tivagent/tiva-chat",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"author": "Mahyar Amiri <mmaahhyyaarr@gmail.com>",
|
|
5
|
-
"private": false,
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"unpkg": "./dist/index.umd.js",
|
|
10
|
-
"main": "dist/index.cjs.js",
|
|
11
|
-
"module": "dist/index.esm.js",
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/tivagent/tiva-chatbot.git"
|
|
15
|
-
},
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"import": "./dist/index.esm.js",
|
|
20
|
-
"require": "./dist/index.cjs.js"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"types": "dist/index.d.ts",
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
|
-
"scripts": {
|
|
28
|
-
"dev": "vite",
|
|
29
|
-
"build": "npm run build:modules && npm run build:umd",
|
|
30
|
-
"build:modules": "vite build --mode modules",
|
|
31
|
-
"build:umd": "vite build --mode umd",
|
|
32
|
-
"preview": "vite preview",
|
|
33
|
-
"lint": "eslint .",
|
|
34
|
-
"
|
|
35
|
-
"tw
|
|
36
|
-
"tw
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"@
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"react
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"@eslint/
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/react
|
|
56
|
-
"@
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"eslint
|
|
60
|
-
"eslint-plugin-react-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"react
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"typescript
|
|
69
|
-
"
|
|
70
|
-
"vite
|
|
71
|
-
"vite-plugin-
|
|
72
|
-
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tivagent/tiva-chat",
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"author": "Mahyar Amiri <mmaahhyyaarr@gmail.com>",
|
|
5
|
+
"private": false,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"unpkg": "./dist/index.umd.js",
|
|
10
|
+
"main": "dist/index.cjs.js",
|
|
11
|
+
"module": "dist/index.esm.js",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/tivagent/tiva-chatbot.git"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.esm.js",
|
|
20
|
+
"require": "./dist/index.cjs.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "dist/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite",
|
|
29
|
+
"build": "npm run build:modules && npm run build:umd",
|
|
30
|
+
"build:modules": "vite build --mode modules",
|
|
31
|
+
"build:umd": "vite build --mode umd",
|
|
32
|
+
"preview": "vite preview",
|
|
33
|
+
"lint": "eslint .",
|
|
34
|
+
"build:wp-plugin": "node scripts/build-wordpress-plugin.mjs",
|
|
35
|
+
"build:tw": "npx @tailwindcss/cli -i src/index.css -o src/styles.css",
|
|
36
|
+
"build:tw-minify": "npx @tailwindcss/cli -i src/index.css -o src/styles.min.css --minify",
|
|
37
|
+
"tw:add-prefix": "node scripts/add-tailwind-prefix.js"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@babel/preset-react": "^7.28.5",
|
|
41
|
+
"@r2wc/react-to-web-component": "^2.1.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": "^19.0.0",
|
|
45
|
+
"react-dom": "^19.0.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/eslintrc": "^3",
|
|
49
|
+
"@eslint/js": "^9.39.2",
|
|
50
|
+
"@playwright/test": "^1.57.0",
|
|
51
|
+
"@svgr/rollup": "^8.1.0",
|
|
52
|
+
"@tailwindcss/postcss": "^4",
|
|
53
|
+
"@types/dom-speech-recognition": "^0.0.7",
|
|
54
|
+
"@types/node": "^25",
|
|
55
|
+
"@types/react": "^19.2.10",
|
|
56
|
+
"@types/react-dom": "^19.2.3",
|
|
57
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
58
|
+
"autoprefixer": "^10.4.23",
|
|
59
|
+
"eslint": "^9",
|
|
60
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
61
|
+
"eslint-plugin-react-refresh": "^0.5.0",
|
|
62
|
+
"globals": "^17.3.0",
|
|
63
|
+
"postcss": "^8.5.6",
|
|
64
|
+
"react": "^19.2.3",
|
|
65
|
+
"react-dom": "^19.2.3",
|
|
66
|
+
"tailwindcss": "^4.1.18",
|
|
67
|
+
"tslib": "^2.8.1",
|
|
68
|
+
"typescript": "^5",
|
|
69
|
+
"typescript-eslint": "^8.54.0",
|
|
70
|
+
"vite": "^7.3.1",
|
|
71
|
+
"vite-plugin-dts": "^4.5.4",
|
|
72
|
+
"vite-plugin-svgr": "^4.5.0"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"@microsoft/api-extractor": {
|
|
76
|
+
"minimatch": "^10.2.3"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|