@tiledesk/tiledesk-tybot-connector 2.0.10 → 2.0.12-rc1
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/Logger.js +28 -16
- package/logs/app2.log +1882 -0
- package/package.json +3 -2
- package/tiledeskChatbotPlugs/DirectivesChatbotPlug.js +7 -0
- package/tiledeskChatbotPlugs/directives/DirAddTags.js +17 -11
- package/tiledeskChatbotPlugs/directives/DirAiPrompt.js +18 -2
- package/tiledeskChatbotPlugs/directives/DirAskGPT.js +2 -2
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +21 -5
- package/tiledeskChatbotPlugs/directives/DirAssign.js +0 -9
- package/tiledeskChatbotPlugs/directives/DirAssignFromFunction.js +1 -8
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +13 -3
- package/tiledeskChatbotPlugs/directives/DirBrevo.js +11 -8
- package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +10 -1
- package/tiledeskChatbotPlugs/directives/DirClearTranscript.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirClose.js +8 -9
- package/tiledeskChatbotPlugs/directives/DirCode.js +9 -1
- package/tiledeskChatbotPlugs/directives/DirCondition.js +13 -1
- package/tiledeskChatbotPlugs/directives/DirContactUpdate.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirCustomerio.js +11 -2
- package/tiledeskChatbotPlugs/directives/DirDeflectToHelpCenter.js +1 -7
- package/tiledeskChatbotPlugs/directives/DirDeleteVariable.js +14 -1
- package/tiledeskChatbotPlugs/directives/DirDepartment.js +13 -9
- package/tiledeskChatbotPlugs/directives/DirFireTiledeskEvent.js +2 -8
- package/tiledeskChatbotPlugs/directives/DirFlowLog.js +88 -0
- package/tiledeskChatbotPlugs/directives/DirForm.js +3 -10
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +19 -7
- package/tiledeskChatbotPlugs/directives/DirGptTask_OLD.js +2 -1
- package/tiledeskChatbotPlugs/directives/DirHubspot.js +12 -3
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgents.js +3 -9
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +12 -10
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +11 -1
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours_OLD.js +3 -9
- package/tiledeskChatbotPlugs/directives/DirJSONCondition.js +14 -4
- package/tiledeskChatbotPlugs/directives/DirMake.js +6 -1
- package/tiledeskChatbotPlugs/directives/DirMessage.js +1 -7
- package/tiledeskChatbotPlugs/directives/DirMoveToAgent.js +5 -9
- package/tiledeskChatbotPlugs/directives/DirMoveToUnassigned.js +6 -9
- package/tiledeskChatbotPlugs/directives/DirQapla.js +7 -3
- package/tiledeskChatbotPlugs/directives/DirRandomReply.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirRemoveCurrentBot.js +1 -7
- package/tiledeskChatbotPlugs/directives/DirReplaceBot.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV3.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirReply.js +9 -16
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +8 -10
- package/tiledeskChatbotPlugs/directives/DirSendEmail.js +7 -9
- package/tiledeskChatbotPlugs/directives/DirSendWhatsapp.js +7 -2
- package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +7 -1
- package/tiledeskChatbotPlugs/directives/DirSetConversationTags.js +2 -8
- package/tiledeskChatbotPlugs/directives/DirWait.js +6 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +20 -5
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2_old.js +2 -1
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +8 -40
- package/tiledeskChatbotPlugs/directives/DirWhatsappByAttribute.js +7 -1
- package/tiledeskChatbotPlugs/directives/Directives.js +1 -0
- package/utils/TiledeskChatbotUtil.js +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const axios = require("axios").default;
|
|
2
|
+
const { Logger } = require("../../Logger");
|
|
2
3
|
const { TiledeskChatbot } = require('../../engine/TiledeskChatbot');
|
|
3
4
|
const httpUtils = require("../../utils/HttpUtils");
|
|
4
5
|
const winston = require('../../utils/winston');
|
|
@@ -12,22 +13,27 @@ class DirWhatsappByAttribute {
|
|
|
12
13
|
throw new Error('context object is mandatory');
|
|
13
14
|
}
|
|
14
15
|
this.context = context;
|
|
16
|
+
this.requestId = this.context.requestId;
|
|
15
17
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
16
|
-
|
|
18
|
+
|
|
19
|
+
this.logger = new Logger({ request_id: this.requestId, dev: this.context.supportRequest?.draft, intent_id: this.context.reply?.attributes?.intent_info?.intent_id });
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
execute(directive, callback) {
|
|
23
|
+
this.logger.info("[Whatsapp by Attribute] Executing action");
|
|
20
24
|
winston.verbose("Execute WhatsappByAttribute directive");
|
|
21
25
|
let action;
|
|
22
26
|
if (directive.action) {
|
|
23
27
|
action = directive.action;
|
|
24
28
|
}
|
|
25
29
|
else {
|
|
30
|
+
this.logger.error("Incorrect action for ", directive.name, directive)
|
|
26
31
|
winston.warn("DirWhatsappByAttribute Incorrect directive: ", directive);
|
|
27
32
|
callback();
|
|
28
33
|
return;
|
|
29
34
|
}
|
|
30
35
|
this.go(action, () => {
|
|
36
|
+
this.logger.info("[Whatsapp by Attribute] Action completed");
|
|
31
37
|
callback();
|
|
32
38
|
})
|
|
33
39
|
}
|
|
@@ -59,6 +59,7 @@ class Directives {
|
|
|
59
59
|
static CONNECT_BLOCK = "connect_block";
|
|
60
60
|
static ADD_TAGS = 'add_tags'
|
|
61
61
|
static WEB_RESPONSE = "web_response";
|
|
62
|
+
static FLOW_LOG = "flow_log";
|
|
62
63
|
|
|
63
64
|
// static WHEN_ONLINE_MOVE_TO_AGENT = "whenonlinemovetoagent"; // DEPRECATED?
|
|
64
65
|
// static WHEN_OFFLINE_HOURS = "whenofflinehours"; // DEPRECATED // adds a message on top of the original message when offline hours opts: --replace
|
|
@@ -605,10 +605,10 @@ class TiledeskChatbotUtil {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
let currentLeadName = await chatbot.getParameter(TiledeskChatbotConst.REQ_LEAD_USERFULLNAME_KEY);
|
|
608
|
-
if (chatbot.log) { winston.debug("(TiledeskChatbotUtil) You lead
|
|
608
|
+
if (chatbot.log) { winston.debug("(TiledeskChatbotUtil) You lead name from attributes: " + currentLeadName); }
|
|
609
609
|
if (message.request.lead.fullname && !currentLeadName) {
|
|
610
610
|
// worth saving
|
|
611
|
-
if (chatbot.log) { winston.debug("(TiledeskChatbotUtil) worth saving
|
|
611
|
+
if (chatbot.log) { winston.debug("(TiledeskChatbotUtil) worth saving name"); }
|
|
612
612
|
try {
|
|
613
613
|
await chatbot.addParameter(TiledeskChatbotConst.REQ_LEAD_USERFULLNAME_KEY, message.request.lead.fullname);
|
|
614
614
|
}
|