@botfabrik/engine-webclient 4.88.0 → 4.89.0
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 +2 -2
- package/dist/createSessionInfo.d.ts +3 -4
- package/dist/extractLocale.d.ts +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +3 -36
- package/dist/loadPreviousConversation.d.ts +1 -1
- package/dist/middleware/index.d.ts +1 -1
- package/dist/requestSessionData.d.ts +2 -2
- package/dist/setTranslations.d.ts +2 -2
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -224,7 +224,7 @@ Erlaubt es, den Chatverlauf an eine Email-Adresse zu verschicken. Idealerweise w
|
|
|
224
224
|
Beispiel:
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
|
-
import { requestNLUEvent } from '@botfabrik/engine-
|
|
227
|
+
import { requestNLUEvent } from '@botfabrik/engine-domain';
|
|
228
228
|
|
|
229
229
|
const webclientProps = {
|
|
230
230
|
getStartedAction: requestNLUEvent('WELCOME'),
|
|
@@ -255,7 +255,7 @@ Mit dieser Option können allgemeine Bedingungen zu Beginn des Chats angezeigt w
|
|
|
255
255
|
Beispiel:
|
|
256
256
|
|
|
257
257
|
```typescript
|
|
258
|
-
import { requestNLUEvent } from '@botfabrik/engine-
|
|
258
|
+
import { requestNLUEvent } from '@botfabrik/engine-domain';
|
|
259
259
|
|
|
260
260
|
const webclientProps = {
|
|
261
261
|
getStartedAction: requestNLUEvent('WELCOME'),
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { SessionInfo } from '@botfabrik/engine-
|
|
2
|
-
import type {
|
|
3
|
-
import { ParsedUrlQuery } from 'node:querystring';
|
|
1
|
+
import type { Environment, SessionInfo } from '@botfabrik/engine-domain';
|
|
2
|
+
import type { ParsedUrlQuery } from 'node:querystring';
|
|
4
3
|
import type { Socket } from 'socket.io';
|
|
5
|
-
import { WebClientProps } from './index';
|
|
4
|
+
import { type WebClientProps } from './index';
|
|
6
5
|
import type { SessionInfoClientPayload, SessionInfoUserPayload } from './types';
|
|
7
6
|
declare const createSessionInfo: (socket: Socket, clientName: string, environment: Environment, sessionInfo: SessionInfo<SessionInfoClientPayload, SessionInfoUserPayload>, userId: string, locale: string | undefined, querystrings: ParsedUrlQuery, props: WebClientProps) => () => Promise<SessionInfo<SessionInfoClientPayload, SessionInfoUserPayload>>;
|
|
8
7
|
export default createSessionInfo;
|
package/dist/extractLocale.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { Environment } from '@botfabrik/engine-domain';
|
|
3
|
-
import { Action } from '@botfabrik/engine-domain';
|
|
1
|
+
import { type Action, type Client, type Environment, type SessionInfoUser } from '@botfabrik/engine-domain';
|
|
4
2
|
import { SpeechToTextProps } from './speechToText';
|
|
5
3
|
import type { SessionInfoUserPayload, WebclientMiddlewareState } from './types';
|
|
6
4
|
export type RequestUserInfos = (querystrings: any) => Promise<Partial<SessionInfoUser<SessionInfoUserPayload>>>;
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
@@ -39,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
6
|
exports.CLIENT_TYPE = exports.Devices = void 0;
|
|
40
7
|
const engine_domain_1 = require("@botfabrik/engine-domain");
|
|
41
8
|
const engine_transcript_export_1 = require("@botfabrik/engine-transcript-export");
|
|
42
|
-
const
|
|
9
|
+
const express_1 = require("express");
|
|
43
10
|
const package_json_1 = require("../package.json");
|
|
44
11
|
const createSessionInfo_1 = __importDefault(require("./createSessionInfo"));
|
|
45
12
|
const extractLocale_1 = __importDefault(require("./extractLocale"));
|
|
@@ -93,7 +60,7 @@ exports.default = (clientName, environment, props) => async (bot) => {
|
|
|
93
60
|
}
|
|
94
61
|
});
|
|
95
62
|
}
|
|
96
|
-
bot.webserver.express.use(`/${clientName}/embed`,
|
|
63
|
+
bot.webserver.express.use(`/${clientName}/embed`, (0, express_1.static)(__dirname + '/embed', serveStaticOptions));
|
|
97
64
|
bot.webserver.express.get(`/${clientName}/logo.svg`, (_req, res) => {
|
|
98
65
|
res.redirect(`/cms/chatbot/design/logo.svg?client=${clientName}`);
|
|
99
66
|
});
|
|
@@ -104,7 +71,7 @@ exports.default = (clientName, environment, props) => async (bot) => {
|
|
|
104
71
|
res.redirect(`/cms/chatbot/design/fab.svg?client=${clientName}`);
|
|
105
72
|
});
|
|
106
73
|
// serve chat client resources
|
|
107
|
-
bot.webserver.express.use(`/${clientName}`,
|
|
74
|
+
bot.webserver.express.use(`/${clientName}`, (0, express_1.static)(__dirname + '/client', serveStaticOptions));
|
|
108
75
|
logger.info(`Webclient will be available on route: /${clientName}`);
|
|
109
76
|
const nsp = bot.webserver.socket.of(`/${clientName}/chat`);
|
|
110
77
|
nsp.on('connection', async (socket) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Middleware } from '@botfabrik/engine-domain';
|
|
2
2
|
import type { Namespace } from 'socket.io';
|
|
3
3
|
import type { WebclientMiddlewareState } from '../types';
|
|
4
4
|
declare const _default: (clientName: string, nsp: Namespace) => Middleware<WebclientMiddlewareState>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SessionInfo } from '@botfabrik/engine-
|
|
2
|
-
import { WebClientProps } from './index';
|
|
1
|
+
import type { SessionInfo } from '@botfabrik/engine-domain';
|
|
2
|
+
import { type WebClientProps } from './index';
|
|
3
3
|
import type { SessionInfoClientPayload, SessionInfoUserPayload } from './types';
|
|
4
4
|
interface SessionData {
|
|
5
5
|
sessionId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BotInstance } from '@botfabrik/engine-
|
|
2
|
-
import { Namespace, Socket } from 'socket.io';
|
|
1
|
+
import type { BotInstance } from '@botfabrik/engine-domain';
|
|
2
|
+
import type { Namespace, Socket } from 'socket.io';
|
|
3
3
|
declare const setTranslations: (socket: Socket | Namespace, bot: BotInstance, clientLocale: string, clientName: string) => void;
|
|
4
4
|
export default setTranslations;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botfabrik/engine-webclient",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.89.0",
|
|
4
4
|
"description": "Webclient for Botfabriks Bot Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,14 +20,12 @@
|
|
|
20
20
|
"dev:embed": "tsx --watch ./run-embed-local.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@botfabrik/engine-
|
|
24
|
-
"@botfabrik/engine-
|
|
25
|
-
"@botfabrik/engine-
|
|
26
|
-
"@botfabrik/engine-utils": "^4.88.0",
|
|
23
|
+
"@botfabrik/engine-domain": "^4.89.0",
|
|
24
|
+
"@botfabrik/engine-transcript-export": "^4.89.0",
|
|
25
|
+
"@botfabrik/engine-utils": "^4.89.0",
|
|
27
26
|
"@google-cloud/speech": "^7.0.1",
|
|
28
27
|
"accept-language-parser": "^1.5.0",
|
|
29
28
|
"express": "^5.1.0",
|
|
30
|
-
"socket.io": "^4.8.1",
|
|
31
29
|
"uuid": "^11.1.0"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
@@ -37,8 +35,9 @@
|
|
|
37
35
|
"@types/ua-parser-js": "^0.7.39",
|
|
38
36
|
"copyfiles": "^2.4.1",
|
|
39
37
|
"rimraf": "^6.0.1",
|
|
38
|
+
"socket.io": "^4.8.1",
|
|
40
39
|
"tsx": "^4.19.4",
|
|
41
40
|
"typescript": "5.8.3"
|
|
42
41
|
},
|
|
43
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "04a36aeb965d40b67ee5dc12b5a1b8fcd55c1e92"
|
|
44
43
|
}
|