@botfabrik/engine-webclient 4.61.21 → 4.61.23
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/dist/client/assets/index-CnXv3Pwx.js +111 -0
- package/dist/client/assets/index-CnXv3Pwx.js.map +1 -0
- package/dist/client/index.html +2 -2
- package/dist/middleware/index.js +24 -23
- package/package.json +10 -10
- package/dist/client/assets/index-Ffv1JdyZ.js +0 -111
- package/dist/client/assets/index-Ffv1JdyZ.js.map +0 -1
- /package/dist/client/assets/{index-NsnWPQ3S.css → index-2ydY9DdJ.css} +0 -0
package/dist/client/index.html
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<meta name="theme-color" content="#000000" />
|
|
8
8
|
<meta name="google" content="notranslate" />
|
|
9
9
|
<title>Bubble Chat Client</title>
|
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-CnXv3Pwx.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/index-2ydY9DdJ.css">
|
|
12
12
|
</head>
|
|
13
13
|
|
|
14
14
|
<body>
|
package/dist/middleware/index.js
CHANGED
|
@@ -5,45 +5,46 @@ const engine_utils_1 = require("@botfabrik/engine-utils");
|
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
exports.default = (clientName, nsp) => async () => {
|
|
7
7
|
return async (next, _state, action, session) => {
|
|
8
|
-
const emitMessageToGuestAction = async (action) => {
|
|
9
|
-
const useTyping = !action.noTypingDelay;
|
|
10
|
-
if (useTyping) {
|
|
11
|
-
nsp.to(session.id).emit('action', { type: engine_domain_1.ActionTypes.TYPING_ON });
|
|
12
|
-
await (0, engine_utils_1.waitForTyping)(action.message);
|
|
13
|
-
}
|
|
14
|
-
nsp.to(session.id).emit('action', action);
|
|
15
|
-
await (0, engine_utils_1.waitFor)(500);
|
|
16
|
-
};
|
|
17
|
-
const sendToChatClient = async (action) => {
|
|
18
|
-
nsp.to(session.id).emit('action', action);
|
|
19
|
-
};
|
|
20
|
-
const expandChatWindow = (action) => {
|
|
21
|
-
const devices = action.payload?.devices;
|
|
22
|
-
if (!!devices && devices !== __1.Devices.None) {
|
|
23
|
-
nsp
|
|
24
|
-
.to(session.id)
|
|
25
|
-
.emit('expand-window', { devices: action.payload.devices });
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
8
|
const sessionInfo = session.getSessionInfo();
|
|
29
9
|
const clientInfo = sessionInfo.client;
|
|
30
10
|
if (clientInfo.type === 'webclient' && clientInfo.name === clientName) {
|
|
31
11
|
switch (action.type) {
|
|
32
12
|
case engine_domain_1.ActionTypes.MESSAGE_TO_GUEST:
|
|
33
|
-
await emitMessageToGuestAction(action);
|
|
13
|
+
await emitMessageToGuestAction(nsp, session, action);
|
|
34
14
|
break;
|
|
35
15
|
case engine_domain_1.ActionTypes.TYPING_ON:
|
|
36
16
|
case engine_domain_1.ActionTypes.TYPING_OFF:
|
|
37
17
|
case engine_domain_1.ActionTypes.EVENT_TO_GUEST:
|
|
38
18
|
case engine_domain_1.ActionTypes.MESSAGE_FROM_GUEST:
|
|
39
19
|
case engine_domain_1.ActionTypes.MESSAGE_WITHOUT_ANALYSIS_FROM_GUEST:
|
|
40
|
-
|
|
20
|
+
case engine_domain_1.ActionTypes.RESTART_CHAT_REQUEST:
|
|
21
|
+
await sendToChatClient(nsp, session, action);
|
|
41
22
|
break;
|
|
42
23
|
case 'webclient.expand.window':
|
|
43
|
-
expandChatWindow(action);
|
|
24
|
+
expandChatWindow(nsp, session, action);
|
|
44
25
|
break;
|
|
45
26
|
}
|
|
46
27
|
}
|
|
47
28
|
next(action);
|
|
48
29
|
};
|
|
49
30
|
};
|
|
31
|
+
const emitMessageToGuestAction = async (nsp, session, action) => {
|
|
32
|
+
const useTyping = !action.noTypingDelay;
|
|
33
|
+
if (useTyping) {
|
|
34
|
+
nsp.to(session.id).emit('action', { type: engine_domain_1.ActionTypes.TYPING_ON });
|
|
35
|
+
await (0, engine_utils_1.waitForTyping)(action['message']);
|
|
36
|
+
}
|
|
37
|
+
await sendToChatClient(nsp, session, action);
|
|
38
|
+
await (0, engine_utils_1.waitFor)(500);
|
|
39
|
+
};
|
|
40
|
+
const sendToChatClient = async (nsp, session, action) => {
|
|
41
|
+
nsp.to(session.id).emit('action', action);
|
|
42
|
+
};
|
|
43
|
+
const expandChatWindow = (nsp, session, action) => {
|
|
44
|
+
const devices = action.payload?.devices;
|
|
45
|
+
if (!!devices && devices !== __1.Devices.None) {
|
|
46
|
+
nsp
|
|
47
|
+
.to(session.id)
|
|
48
|
+
.emit('expand-window', { devices: action.payload.devices });
|
|
49
|
+
}
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botfabrik/engine-webclient",
|
|
3
|
-
"version": "4.61.
|
|
3
|
+
"version": "4.61.23",
|
|
4
4
|
"description": "Webclient for Botfabriks Bot Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
"update": "npx npm-check-updates -i"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@botfabrik/engine-core": "^4.61.
|
|
23
|
-
"@botfabrik/engine-domain": "^4.61.
|
|
24
|
-
"@botfabrik/engine-transcript-export": "^4.61.
|
|
25
|
-
"@botfabrik/engine-utils": "^4.61.
|
|
26
|
-
"@google-cloud/speech": "^6.
|
|
22
|
+
"@botfabrik/engine-core": "^4.61.23",
|
|
23
|
+
"@botfabrik/engine-domain": "^4.61.22",
|
|
24
|
+
"@botfabrik/engine-transcript-export": "^4.61.23",
|
|
25
|
+
"@botfabrik/engine-utils": "^4.61.23",
|
|
26
|
+
"@google-cloud/speech": "^6.5.0",
|
|
27
27
|
"accept-language-parser": "^1.5.0",
|
|
28
|
-
"express": "^4.
|
|
29
|
-
"socket.io": "^4.7.
|
|
28
|
+
"express": "^4.19.2",
|
|
29
|
+
"socket.io": "^4.7.5",
|
|
30
30
|
"ua-parser-js": "^1.0.37",
|
|
31
31
|
"uuid": "^9.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/accept-language-parser": "^1.5.6",
|
|
35
35
|
"@types/express": "^4.17.21",
|
|
36
|
-
"@types/serve-static": "^1.15.
|
|
36
|
+
"@types/serve-static": "^1.15.7",
|
|
37
37
|
"@types/ua-parser-js": "^0.7.39",
|
|
38
38
|
"@types/uuid": "^9.0.8",
|
|
39
39
|
"copyfiles": "^2.4.1",
|
|
40
40
|
"rimraf": "^5.0.5",
|
|
41
41
|
"typescript": "5.1.6"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "7fc6cf021de8fc372716d170e4e4c36ef93b5c5f"
|
|
44
44
|
}
|