@tiledesk/tiledesk-tybot-connector 0.2.10 → 0.2.11
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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
### 0.2.11
|
|
9
|
+
- TiledeskClient update to 0.10.3
|
|
10
|
+
- updateLead() replaces the deprecated updateLeadData()
|
|
11
|
+
- added support to automatically update userPhone as well as the already supported userEmail and UserFullname
|
|
12
|
+
- fixed form messages: missing replace of {{...}} attributes
|
|
13
|
+
|
|
8
14
|
### 0.2.10 - online pre
|
|
9
15
|
- WebRequest: "body" renamed in "jsonBody"
|
|
10
16
|
|
|
@@ -735,7 +735,14 @@ class TiledeskChatbot {
|
|
|
735
735
|
if (all_parameters) {
|
|
736
736
|
if (this.log) {console.log("(populatePrechatFormAndLead) userEmail:", all_parameters['userEmail']);}
|
|
737
737
|
if (this.log) {console.log("(populatePrechatFormAndLead) userFullname:", all_parameters['userFullname']);}
|
|
738
|
-
|
|
738
|
+
if (this.log) {console.log("(populatePrechatFormAndLead) userPhone:", all_parameters['userPhone']);}
|
|
739
|
+
let nativeAttributes = {
|
|
740
|
+
email: all_parameters['userEmail'],
|
|
741
|
+
fullname: all_parameters['userFullname'],
|
|
742
|
+
phone: all_parameters['userPhone']
|
|
743
|
+
}
|
|
744
|
+
// tdclient.updateLeadData(leadId, all_parameters['userEmail'], all_parameters['userFullname'], null, () => {
|
|
745
|
+
tdclient.updateLead(leadId, nativeAttributes, null, null, () => {
|
|
739
746
|
if (this.log) {console.log("Lead updated.")}
|
|
740
747
|
// tdclient.updateRequestAttributes(requestId, {
|
|
741
748
|
// preChatForm: all_parameters,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-tybot-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Tiledesk Tybot connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@tiledesk/helpcenter-query-client": "^0.1.8",
|
|
15
15
|
"@tiledesk/tiledesk-chatbot-client": "^0.5.30",
|
|
16
16
|
"@tiledesk/tiledesk-chatbot-util": "^0.8.39",
|
|
17
|
-
"@tiledesk/tiledesk-client": "^0.10.
|
|
17
|
+
"@tiledesk/tiledesk-client": "^0.10.3",
|
|
18
18
|
"accept-language-parser": "^1.5.0",
|
|
19
19
|
"axios": "^0.27.2",
|
|
20
20
|
"body-parser": "^1.19.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { TiledeskChatbotUtil } = require('@tiledesk/tiledesk-chatbot-util');
|
|
2
2
|
const { TiledeskChatbot } = require('../models/TiledeskChatbot.js');
|
|
3
|
+
const { Filler } = require('./Filler');
|
|
3
4
|
|
|
4
5
|
class FillParamsChatbotPlug {
|
|
5
6
|
|
|
@@ -34,7 +35,10 @@ class FillParamsChatbotPlug {
|
|
|
34
35
|
pipeline.nextplug();
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
const filler = new Filler();
|
|
40
|
+
const filled_message_text = filler.fill(message.text, all_parameters);
|
|
41
|
+
// const filled_message_text = this.fillWithRequestParams(message.text, all_parameters);
|
|
38
42
|
message.text = filled_message_text;
|
|
39
43
|
//console.log("message filled_message_text:", message)
|
|
40
44
|
if (!message.attributes) {
|