@tiledesk/tiledesk-tybot-connector 2.0.10-rc10 → 2.0.10-rc12
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/logs/app.log +43071 -4803
- package/logs/app1.log +41129 -0
- package/logs/app2.log +4140 -46280
- package/logs/app6.log +29039 -0
- package/logs/app7.log +4726 -0
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/directives/DirAddTags.js +11 -12
- package/tiledeskChatbotPlugs/directives/DirAiPrompt.js +15 -16
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +13 -14
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +11 -1
- package/tiledeskChatbotPlugs/directives/DirBrevo.js +9 -5
- package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirClearTranscript.js +4 -0
- package/tiledeskChatbotPlugs/directives/DirClose.js +7 -1
- package/tiledeskChatbotPlugs/directives/DirCode.js +8 -0
- package/tiledeskChatbotPlugs/directives/DirCondition.js +12 -0
- package/tiledeskChatbotPlugs/directives/DirContactUpdate.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirCustomerio.js +9 -0
- package/tiledeskChatbotPlugs/directives/DirDeleteVariable.js +13 -0
- package/tiledeskChatbotPlugs/directives/DirDepartment.js +12 -1
- package/tiledeskChatbotPlugs/directives/DirForm.js +1 -0
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +17 -5
- package/tiledeskChatbotPlugs/directives/DirHubspot.js +10 -1
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +10 -1
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +10 -0
- package/tiledeskChatbotPlugs/directives/DirJSONCondition.js +13 -3
- package/tiledeskChatbotPlugs/directives/DirMake.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirMoveToAgent.js +4 -0
- package/tiledeskChatbotPlugs/directives/DirMoveToUnassigned.js +5 -1
- package/tiledeskChatbotPlugs/directives/DirQapla.js +5 -1
- package/tiledeskChatbotPlugs/directives/DirRandomReply.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirReplaceBot.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +4 -0
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV3.js +4 -0
- package/tiledeskChatbotPlugs/directives/DirReply.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirSendEmail.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirSendWhatsapp.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +9 -0
- package/tiledeskChatbotPlugs/directives/DirWait.js +5 -0
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +10 -9
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +5 -4
- package/tiledeskChatbotPlugs/directives/DirWhatsappByAttribute.js +6 -0
|
@@ -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,21 +13,26 @@ 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;
|
|
18
|
+
this.logger = new Logger({ request_id: this.requestId, dev: this.context.supportRequest.draft, intent_id: this.context.reply.attributes.intent_info.intent_id });
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
execute(directive, callback) {
|
|
22
|
+
this.logger.info("[Whatsapp by Attribute] Executing action");
|
|
19
23
|
winston.verbose("Execute WhatsappByAttribute directive");
|
|
20
24
|
let action;
|
|
21
25
|
if (directive.action) {
|
|
22
26
|
action = directive.action;
|
|
23
27
|
}
|
|
24
28
|
else {
|
|
29
|
+
this.logger.error("Incorrect action for ", directive.name, directive)
|
|
25
30
|
winston.warn("DirWhatsappByAttribute Incorrect directive: ", directive);
|
|
26
31
|
callback();
|
|
27
32
|
return;
|
|
28
33
|
}
|
|
29
34
|
this.go(action, () => {
|
|
35
|
+
this.logger.info("[Whatsapp by Attribute] Action completed");
|
|
30
36
|
callback();
|
|
31
37
|
})
|
|
32
38
|
}
|