@tiledesk/tiledesk-tybot-connector 0.2.48 → 0.2.49
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,10 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
# v0.2.49
|
|
9
|
+
- resplacebotv2, added "/" + blockName (so the blockname will be implicitly executed), removing the need to specify the "/" in the body of the replacebot editor
|
|
10
|
+
- Never add "guest#" as lead userFullname
|
|
11
|
+
|
|
8
12
|
# v0.2.48
|
|
9
13
|
- resplacebotv2
|
|
10
14
|
- fixed jsoncondition expression. added ? in some "static OPERATORS" (i.e. contains) to correctly evaluate undefined operands
|
package/TiledeskExpression.js
CHANGED
|
@@ -282,11 +282,11 @@ class TiledeskExpression {
|
|
|
282
282
|
const applyPattern = operator.applyPattern;
|
|
283
283
|
let operand = operands[i + 1].isVariable ? TiledeskExpression.variableOperand(operands[i + 1].value) : TiledeskExpression.quotedString(operands[i + 1].value);
|
|
284
284
|
operand = operands[i + 1].function ? TiledeskExpression.applyFunctionToOperand(operand, operands[i + 1].function) : operand;
|
|
285
|
-
console.log("1. expression is:", expression)
|
|
286
|
-
console.log("operand is:", operand)
|
|
285
|
+
// console.log("1. expression is:", expression)
|
|
286
|
+
// console.log("operand is:", operand)
|
|
287
287
|
|
|
288
288
|
expression = applyPattern.replace("#1", expression).replace("#2", operand);
|
|
289
|
-
console.log("2. expression is:", expression)
|
|
289
|
+
// console.log("2. expression is:", expression)
|
|
290
290
|
|
|
291
291
|
}
|
|
292
292
|
return expression;
|
|
@@ -458,22 +458,23 @@ class TiledeskChatbotUtil {
|
|
|
458
458
|
if (message.request.lead.email) {
|
|
459
459
|
await chatbot.addParameter("userEmail", message.request.lead.email);
|
|
460
460
|
}
|
|
461
|
-
if (message.request.lead.fullname) {
|
|
461
|
+
if (message.request.lead.fullname && !message.request.lead.fullname.startsWith("guest#")) {
|
|
462
|
+
// worth saving
|
|
462
463
|
try {
|
|
463
|
-
const current_userFullname = await chatbot.getParameter("userFullname");
|
|
464
|
-
if (current_userFullname && current_userFullname.startsWith("guest#")) {
|
|
464
|
+
// const current_userFullname = await chatbot.getParameter("userFullname");
|
|
465
|
+
// if (current_userFullname && current_userFullname.startsWith("guest#")) { // replace if exists as guest#
|
|
466
|
+
// await chatbot.addParameter("userFullname", message.request.lead.fullname);
|
|
467
|
+
// }
|
|
468
|
+
// else if (!current_userFullname) {
|
|
465
469
|
await chatbot.addParameter("userFullname", message.request.lead.fullname);
|
|
466
|
-
}
|
|
467
|
-
else if (!current_userFullname) {
|
|
468
|
-
await chatbot.addParameter("userFullname", message.request.lead.fullname);
|
|
469
|
-
}
|
|
470
|
+
// }
|
|
470
471
|
}
|
|
471
472
|
catch(error) {
|
|
472
473
|
console.error("Error on setting userFullname:", error);
|
|
473
474
|
}
|
|
474
475
|
}
|
|
475
476
|
else {
|
|
476
|
-
console.log("!lead.fullname");
|
|
477
|
+
// console.log("!lead.fullname");
|
|
477
478
|
}
|
|
478
479
|
// console.log("Getting userPhone:", JSON.stringify(message.request));
|
|
479
480
|
if (message.request.lead.phone) {
|
package/package.json
CHANGED