@botfabrik/engine-webclient 4.43.2 → 4.44.1
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 +75 -75
- package/dist/client/assets/index-2bed803d.js.map +1 -1
- package/dist/client/index.html +18 -20
- package/dist/createSessionInfo.test.js +10 -2
- package/dist/embed/bundle.js.map +1 -1
- package/dist/extractIP.test.js +4 -1
- package/dist/index.js +20 -6
- package/dist/middleware/index.js +3 -1
- package/dist/requestSessionData.js +4 -1
- package/dist/requestSessionData.test.js +10 -2
- package/dist/speechToText.js +5 -2
- package/package.json +43 -43
package/README.md
CHANGED
|
@@ -32,14 +32,14 @@ Beispiel:
|
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
34
|
export default async (querystrings: any): Promise<any> => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const accessToken = querystrings.accessToken;
|
|
36
|
+
const userProfile: UserProfile = await fetchUserProfile(accessToken);
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
id: userProfile.username + '@' + userProfile.domain,
|
|
40
|
+
displayName: userProfile.firstName + ' ' + userProfile.lastName,
|
|
41
|
+
payload: userProfile,
|
|
42
|
+
};
|
|
43
43
|
};
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -54,11 +54,11 @@ Beispiel:
|
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
56
|
export default async (querystrings: any): Promise<any> => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const accessToken = querystrings.accessToken;
|
|
58
|
+
const userProfile: UserProfile = await fetchUserProfile(accessToken);
|
|
59
|
+
return {
|
|
60
|
+
'sessionInfo.user.id': userProfile.username + '@' + userProfile.domain,
|
|
61
|
+
};
|
|
62
62
|
};
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -68,27 +68,27 @@ Aktiviert die Sprachsteuerung
|
|
|
68
68
|
|
|
69
69
|
Folgende Parameter müssen mitgegeben werden:
|
|
70
70
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
71
|
+
- clientEmail
|
|
72
|
+
- privateKey
|
|
73
73
|
|
|
74
74
|
Folgende Parameter sind optional:
|
|
75
75
|
|
|
76
|
-
-
|
|
76
|
+
- contextPhrases: Hier können Wörter und Sätze angegeben werden, welche in diesem Kontext häufig verwendet werden. So kann z.B. sichergestellt werden, dass bei der Umwandlung von Sprache zu Text "Botfabrik" und nicht "Brotfabrik" rauskommt. Texte können pro Locale erfasst werden.
|
|
77
77
|
|
|
78
78
|
Beispiel:
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
81
|
const webclientProps = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
getStartedAction: requestNLUEvent('WELCOME'),
|
|
83
|
+
speech: process.env.GOOGLE_CLOUD_SPEECH_PRIVATE_KEY
|
|
84
|
+
? {
|
|
85
|
+
clientEmail: process.env.GOOGLE_CLOUD_SPEECH_CLIENT_EMAIL || '',
|
|
86
|
+
privateKey: process.env.GOOGLE_CLOUD_SPEECH_PRIVATE_KEY || '',
|
|
87
|
+
contextPhrases: {
|
|
88
|
+
de: ['Bot', 'Was ist die Botfabrik?', 'Botfabrik'],
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
: undefined,
|
|
92
92
|
};
|
|
93
93
|
bot.addClient(Webclient('webclient', webclientProps));
|
|
94
94
|
```
|
|
@@ -102,8 +102,8 @@ Beispiel:
|
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
104
|
const webclientProps = {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
getStartedAction: requestNLUEvent('Welcome'),
|
|
106
|
+
expandChatWindowAtStart: Devices.Desktop,
|
|
107
107
|
};
|
|
108
108
|
bot.addClient(Webclient('webclient', webclientProps));
|
|
109
109
|
```
|
|
@@ -118,8 +118,8 @@ Beispiel:
|
|
|
118
118
|
import { requestNLUEvent } from '@botfabrik/engine-core';
|
|
119
119
|
|
|
120
120
|
const webclientProps = {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
getStartedAction: requestNLUEvent('WELCOME'),
|
|
122
|
+
emailExportEnabled: true,
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
bot.addClient(Webclient('webclient', webclientProps));
|
|
@@ -133,7 +133,7 @@ Beispiel:
|
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
const webclientProps = {
|
|
136
|
-
|
|
136
|
+
pdfExportEnabled: true,
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
bot.addClient(Webclient('webclient', webclientProps));
|
|
@@ -149,8 +149,8 @@ Beispiel:
|
|
|
149
149
|
import { requestNLUEvent } from '@botfabrik/engine-core';
|
|
150
150
|
|
|
151
151
|
const webclientProps = {
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
getStartedAction: requestNLUEvent('WELCOME'),
|
|
153
|
+
showGeneralConditions: true,
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
bot.addClient(Webclient('webclient', webclientProps));
|
|
@@ -158,9 +158,9 @@ bot.addClient(Webclient('webclient', webclientProps));
|
|
|
158
158
|
|
|
159
159
|
Die Bedingungen beinhalten drei Elemente:
|
|
160
160
|
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
161
|
+
- Header: Titel der Bedingungen
|
|
162
|
+
- Body: Eigentlicher Inhalt der Bedingungen
|
|
163
|
+
- Accept-Condition-Note: Hinweis, dass man die Bedingungen akzeptiert, sobald man mit dem Bot kommuniziert.
|
|
164
164
|
|
|
165
165
|
Diese Texte können auch Markdown beinhalten. Um die Standardtexte zu überschreiben, kann man den Übersetzungsmechanismus verwenden.
|
|
166
166
|
|
|
@@ -186,38 +186,38 @@ Beispiel (de.json)
|
|
|
186
186
|
|
|
187
187
|
```json
|
|
188
188
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
189
|
+
"webclient": {
|
|
190
|
+
"message-input-label": "Nachricht eingeben ...",
|
|
191
|
+
"export-transcript": {
|
|
192
|
+
"email": {
|
|
193
|
+
"title": "Konversation per E-Mail versenden",
|
|
194
|
+
"description": "Geben Sie Ihre E-Mail-Adresse ein, um den Chatverlauf zu erhalten.",
|
|
195
|
+
"cancel": "Abbrechen",
|
|
196
|
+
"send": "Senden",
|
|
197
|
+
"placeholder": "Ihre E-Mail-Adresse",
|
|
198
|
+
"invalid": "Bitte gültige E-Mail-Adresse eingeben.",
|
|
199
|
+
"success": "Ich habe den Chatverlauf an Ihre E-Mail-Adresse gesendet."
|
|
200
|
+
},
|
|
201
|
+
"pdf": {
|
|
202
|
+
"title": "Konversation als PDF",
|
|
203
|
+
"description": "Laden Sie die Konversation als PDF herunter.",
|
|
204
|
+
"cancel": "Abbrechen",
|
|
205
|
+
"download": "Herunterladen"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"general-conditions": {
|
|
209
|
+
"header": "**Nutzungsbedingungen**", // Wird hier der Text leer gelassen, wird der Header inkl. Body nicht angezeigt.
|
|
210
|
+
"body": "Bitte berücksichtigen Sie die folgenden Punkte:\n\n - ...",
|
|
211
|
+
"accept-conditions-note": "Mit der Verwendung des Chats erklären Sie sich mit den Nutzungsbedingungen einverstanden." // Wird hier der Text leer gelassen, so wird dieses Element nicht angezeigt.
|
|
212
|
+
},
|
|
213
|
+
"problem-report": {
|
|
214
|
+
"action": {
|
|
215
|
+
"mark": "Als fehlerhaft markieren",
|
|
216
|
+
"unmark": "Markierung entfernen"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"powered-by": "Powered by [Bubble CMS](https://bubblecms.io)"
|
|
220
|
+
}
|
|
221
221
|
}
|
|
222
222
|
```
|
|
223
223
|
|
|
@@ -231,16 +231,16 @@ Verzeichnis 'public/\${name-meines-webclients}/' abgelegt werden. Auf gleiche Ar
|
|
|
231
231
|
|
|
232
232
|
```css
|
|
233
233
|
:root {
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
--brand-primary-color: #008fd7;
|
|
235
|
+
--brand-secondary-color: white;
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
--bot-bubble-background-color: white;
|
|
238
|
+
--bot-bubble-text-color: rgb(46, 46, 46);
|
|
239
239
|
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
--guest-bubble-background-color: #008fd7;
|
|
241
|
+
--guest-bubble-text-color: white;
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
--danger-color: #ee263d;
|
|
244
244
|
}
|
|
245
245
|
```
|
|
246
246
|
|