@tiledesk/tiledesk-tybot-connector 2.0.17 → 2.0.18
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 +1 -1
- package/Logger.js +11 -4
- package/logs/app.log +6791 -44726
- package/logs/app4.log +46163 -0
- package/logs/app5.log +39983 -0
- package/logs/app6.log +50376 -0
- package/logs/app7.log +43568 -0
- package/logs/app8.log +4779 -0
- package/package.json +2 -2
- package/tiledeskChatbotPlugs/directives/DirAddKbContent.js +20 -21
- package/tiledeskChatbotPlugs/directives/DirAddTags.js +5 -6
- package/tiledeskChatbotPlugs/directives/DirAiPrompt.js +7 -8
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +50 -21
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirBrevo.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +4 -5
- package/tiledeskChatbotPlugs/directives/DirClearTranscript.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirClose.js +2 -3
- package/tiledeskChatbotPlugs/directives/DirCode.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirCondition.js +3 -4
- package/tiledeskChatbotPlugs/directives/DirContactUpdate.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirCustomerio.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirDeleteVariable.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirDepartment.js +3 -4
- package/tiledeskChatbotPlugs/directives/DirFlowLog.js +5 -5
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +4 -5
- package/tiledeskChatbotPlugs/directives/DirHubspot.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +3 -4
- package/tiledeskChatbotPlugs/directives/DirJSONCondition.js +4 -5
- package/tiledeskChatbotPlugs/directives/DirMake.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirMoveToAgent.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirMoveToUnassigned.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirQapla.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirRandomReply.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirReplaceBot.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV3.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirReply.js +4 -5
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirSendEmail.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirSendWhatsapp.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirWait.js +2 -3
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +7 -8
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +2 -3
- package/tiledeskChatbotPlugs/directives/DirWhatsappByAttribute.js +1 -2
- package/logs/app1.log +0 -16653
|
@@ -18,7 +18,6 @@ class DirDepartment {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
execute(directive, callback) {
|
|
21
|
-
this.logger.info("[Change Department] Executing action");
|
|
22
21
|
winston.verbose("Execute Department directive");
|
|
23
22
|
let action;
|
|
24
23
|
if (directive.action) {
|
|
@@ -34,7 +33,7 @@ class DirDepartment {
|
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
this.go(action, () => {
|
|
37
|
-
this.logger.
|
|
36
|
+
this.logger.native("[Change Department] Action executed");
|
|
38
37
|
callback();
|
|
39
38
|
});
|
|
40
39
|
|
|
@@ -96,7 +95,7 @@ class DirDepartment {
|
|
|
96
95
|
this.logger.error("[Change Department] Unable to trigger bot");
|
|
97
96
|
winston.error("(DirDepartment) Error sending hidden message: " + err.message)
|
|
98
97
|
} else {
|
|
99
|
-
this.logger.
|
|
98
|
+
this.logger.native("[Change Department] Bot triggered");
|
|
100
99
|
winston.debug("(DirDepartment) Hidden message sent.");
|
|
101
100
|
|
|
102
101
|
}
|
|
@@ -105,7 +104,7 @@ class DirDepartment {
|
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
else {
|
|
108
|
-
this.logger.
|
|
107
|
+
this.logger.native("[Change Department] No triggering bot");
|
|
109
108
|
winston.debug("(DirDepartment) No action.triggerBot");
|
|
110
109
|
callback();
|
|
111
110
|
}
|
|
@@ -62,22 +62,22 @@ class DirFlowLog {
|
|
|
62
62
|
|
|
63
63
|
const filler = new Filler();
|
|
64
64
|
const filled_log = filler.fill(action.log, requestVariables);
|
|
65
|
-
winston.debug("(DirFlowLog)
|
|
65
|
+
winston.debug("(DirFlowLog) filled log: ", filled_log);
|
|
66
66
|
|
|
67
67
|
if (level === 'error') {
|
|
68
|
-
winston.
|
|
68
|
+
winston.verbose("Adding log '" + filled_log + "' with level " + level);
|
|
69
69
|
this.logger.error(filled_log);
|
|
70
70
|
}
|
|
71
71
|
else if (level === 'warn') {
|
|
72
|
-
winston.
|
|
72
|
+
winston.verbose("Adding log '" + filled_log + "' with level " + level);
|
|
73
73
|
this.logger.warn(filled_log);
|
|
74
74
|
}
|
|
75
75
|
else if (level === 'info') {
|
|
76
|
-
winston.
|
|
76
|
+
winston.verbose("Adding log '" + filled_log + "' with level " + level);
|
|
77
77
|
this.logger.info(filled_log);
|
|
78
78
|
}
|
|
79
79
|
else if (level === 'debug') {
|
|
80
|
-
winston.
|
|
80
|
+
winston.verbose("Adding log '" + filled_log + "' with level " + level);
|
|
81
81
|
this.logger.debug(filled_log);
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -30,7 +30,6 @@ class DirGptTask {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
execute(directive, callback) {
|
|
33
|
-
this.logger.info("[ChatGPT Task] Executing action");
|
|
34
33
|
winston.verbose("Execute GptTask directive");
|
|
35
34
|
let action;
|
|
36
35
|
if (directive.action) {
|
|
@@ -43,7 +42,7 @@ class DirGptTask {
|
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
44
|
this.go(action, (stop) => {
|
|
46
|
-
this.logger.
|
|
45
|
+
this.logger.native("[ChatGPT Task] Executed");
|
|
47
46
|
callback(stop);
|
|
48
47
|
})
|
|
49
48
|
}
|
|
@@ -125,13 +124,13 @@ class DirGptTask {
|
|
|
125
124
|
|
|
126
125
|
let key = await integrationService.getKeyFromIntegrations(this.projectId, 'openai', this.token);
|
|
127
126
|
if (!key) {
|
|
128
|
-
this.logger.
|
|
127
|
+
this.logger.native("[ChatGPT Task] Key not found in Integrations.");
|
|
129
128
|
winston.debug("(DirGptTask) - Key not found in Integrations. Searching in kb settings...");
|
|
130
129
|
key = await this.getKeyFromKbSettings();
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
if (!key) {
|
|
134
|
-
this.logger.
|
|
133
|
+
this.logger.native("[ChatGPT Task] Retrieve shared gptkey.");
|
|
135
134
|
winston.debug("(DirGptTask) - Retrieve public gptkey")
|
|
136
135
|
key = process.env.GPTKEY;
|
|
137
136
|
publicKey = true;
|
|
@@ -229,7 +228,7 @@ class DirGptTask {
|
|
|
229
228
|
answer = await this.convertToJson(answer);
|
|
230
229
|
}
|
|
231
230
|
|
|
232
|
-
this.logger.
|
|
231
|
+
this.logger.native("[ChatGPT Task] Completions answer: ", answer);
|
|
233
232
|
|
|
234
233
|
await this.#assignAttributes(action, answer);
|
|
235
234
|
|
|
@@ -26,7 +26,6 @@ class DirHubspot {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
execute(directive, callback) {
|
|
29
|
-
this.logger.info("[Hubspot] Executing action");
|
|
30
29
|
winston.verbose("Execute Hubspot directive");
|
|
31
30
|
let action;
|
|
32
31
|
if (directive.action) {
|
|
@@ -39,7 +38,7 @@ class DirHubspot {
|
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
40
|
this.go(action, (stop) => {
|
|
42
|
-
this.logger.
|
|
41
|
+
this.logger.native("[Hubspot] Executed");
|
|
43
42
|
callback(stop);
|
|
44
43
|
})
|
|
45
44
|
}
|
|
@@ -25,7 +25,6 @@ class DirIfOnlineAgentsV2 {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
execute(directive, callback) {
|
|
28
|
-
this.logger.info("[If Online Agents] Executing action");
|
|
29
28
|
winston.verbose("Execute IfOnlineAgentsV2 directive");
|
|
30
29
|
let action;
|
|
31
30
|
if (directive.action) {
|
|
@@ -38,7 +37,7 @@ class DirIfOnlineAgentsV2 {
|
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
39
|
this.go(action, (stop) => {
|
|
41
|
-
this.logger.
|
|
40
|
+
this.logger.native("[If Online Agents] Executed");
|
|
42
41
|
callback(stop);
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -22,7 +22,6 @@ class DirIfOpenHours {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
execute(directive, callback) {
|
|
25
|
-
this.logger.info("[If Operating Hours] Executing action");
|
|
26
25
|
winston.verbose("Execute IfOpenHours directive");
|
|
27
26
|
let action;
|
|
28
27
|
if (directive.action) {
|
|
@@ -48,7 +47,7 @@ class DirIfOpenHours {
|
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
49
|
this.go(action, (stop) => {
|
|
51
|
-
this.logger.
|
|
50
|
+
this.logger.native("[If Operating Hours] Action complteted");
|
|
52
51
|
callback(stop);
|
|
53
52
|
});
|
|
54
53
|
}
|
|
@@ -115,7 +114,7 @@ class DirIfOpenHours {
|
|
|
115
114
|
}
|
|
116
115
|
} else {
|
|
117
116
|
if (resbody.isopen && resbody.isopen === true) {
|
|
118
|
-
this.logger.
|
|
117
|
+
this.logger.native("[If Operating Hours] is open: true")
|
|
119
118
|
if (trueIntent) {
|
|
120
119
|
let intentDirective = DirIntent.intentDirectiveFor(trueIntent);
|
|
121
120
|
winston.debug("(DirIfOpenHours) agents (openHours) => trueIntent");
|
|
@@ -126,7 +125,7 @@ class DirIfOpenHours {
|
|
|
126
125
|
callback();
|
|
127
126
|
return;
|
|
128
127
|
} else {
|
|
129
|
-
this.logger.
|
|
128
|
+
this.logger.native("[If Operating Hours] is open: false")
|
|
130
129
|
if (falseIntent) {
|
|
131
130
|
let intentDirective = DirIntent.intentDirectiveFor(falseIntent);
|
|
132
131
|
winston.debug("(DirIfOpenHours) !agents (openHours) => falseIntent", falseIntent);
|
|
@@ -19,7 +19,6 @@ class DirJSONCondition {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
execute(directive, callback) {
|
|
22
|
-
this.logger.info("[Condition] Executing action");
|
|
23
22
|
winston.verbose("Execute JSONCondition directive");
|
|
24
23
|
let action;
|
|
25
24
|
if (directive.action) {
|
|
@@ -32,7 +31,7 @@ class DirJSONCondition {
|
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
33
|
this.go(action, (stop) => {
|
|
35
|
-
this.logger.
|
|
34
|
+
this.logger.native("[Condition] Executed");
|
|
36
35
|
callback(stop);
|
|
37
36
|
});
|
|
38
37
|
|
|
@@ -88,7 +87,7 @@ class DirJSONCondition {
|
|
|
88
87
|
// const result = await this.evaluateCondition(scriptCondition, variables);
|
|
89
88
|
let result;
|
|
90
89
|
const expression = TiledeskExpression.JSONGroupsToExpression(groups, variables);
|
|
91
|
-
this.logger.
|
|
90
|
+
this.logger.native("[Condition] Evaluating expression: ", expression);
|
|
92
91
|
result = new TiledeskExpression().evaluateStaticExpression(expression, variables);
|
|
93
92
|
winston.debug("(DirJSONCondition) Evaluation result: ", result);
|
|
94
93
|
if (result === true) {
|
|
@@ -98,7 +97,7 @@ class DirJSONCondition {
|
|
|
98
97
|
});
|
|
99
98
|
}
|
|
100
99
|
else {
|
|
101
|
-
this.logger.
|
|
100
|
+
this.logger.native("[Condition] No trueIntentDirective specified");
|
|
102
101
|
winston.debug("(DirJSONCondition) No trueIntentDirective specified");
|
|
103
102
|
callback();
|
|
104
103
|
return;
|
|
@@ -115,7 +114,7 @@ class DirJSONCondition {
|
|
|
115
114
|
});
|
|
116
115
|
}
|
|
117
116
|
else {
|
|
118
|
-
this.logger.
|
|
117
|
+
this.logger.native("[Condition] No falseIntentDirective specified");
|
|
119
118
|
winston.debug("(DirJSONCondition) No falseIntentDirective specified");
|
|
120
119
|
callback();
|
|
121
120
|
return;
|
|
@@ -22,7 +22,6 @@ class DirMake {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
execute(directive, callback) {
|
|
25
|
-
this.logger.info("[Make] Executing action");
|
|
26
25
|
winston.verbose("Execute Make directive");
|
|
27
26
|
let action;
|
|
28
27
|
if (directive.action) {
|
|
@@ -35,7 +34,7 @@ class DirMake {
|
|
|
35
34
|
return;
|
|
36
35
|
}
|
|
37
36
|
this.go(action, (stop) => {
|
|
38
|
-
this.logger.
|
|
37
|
+
this.logger.native("[Make] Executed");
|
|
39
38
|
callback(stop);
|
|
40
39
|
})
|
|
41
40
|
}
|
|
@@ -21,11 +21,10 @@ class DirMoveToAgent {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
execute(directive, callback) {
|
|
24
|
-
this.logger.info("[Transfer to a Human] Executing action");
|
|
25
24
|
winston.verbose("Execute MoveToAgent directive");
|
|
26
25
|
directive.action = {};
|
|
27
26
|
this.go(directive.action, () => {
|
|
28
|
-
this.logger.
|
|
27
|
+
this.logger.native("[Transfer to a Human] Executed");
|
|
29
28
|
callback();
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -20,11 +20,10 @@ class DirMoveToUnassigned {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
execute(directive, callback) {
|
|
23
|
-
this.logger.info("[Move to Unassigned] Executing action");
|
|
24
23
|
winston.verbose("Execute MoveToUnassigned directive");
|
|
25
24
|
directive.action = {};
|
|
26
25
|
this.go(directive.action, () => {
|
|
27
|
-
this.logger.
|
|
26
|
+
this.logger.native("[Move to Unassigned] Executed");
|
|
28
27
|
callback();
|
|
29
28
|
});
|
|
30
29
|
}
|
|
@@ -27,7 +27,6 @@ class DirQapla {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
execute(directive, callback) {
|
|
30
|
-
this.logger.info("[Qapla] Executing action");
|
|
31
30
|
let action;
|
|
32
31
|
if (directive.action) {
|
|
33
32
|
action = directive.action;
|
|
@@ -39,7 +38,7 @@ class DirQapla {
|
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
40
|
this.go(action, (stop) => {
|
|
42
|
-
this.logger.
|
|
41
|
+
this.logger.native("[Qapla] Executed");
|
|
43
42
|
callback(stop);
|
|
44
43
|
})
|
|
45
44
|
}
|
|
@@ -23,7 +23,6 @@ class DirRandomReply {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
execute(directive, callback) {
|
|
26
|
-
this.logger.info("[Random Reply] Executing action");
|
|
27
26
|
winston.verbose("Execute RandomReply directive");
|
|
28
27
|
let action;
|
|
29
28
|
if (directive.action) {
|
|
@@ -40,7 +39,7 @@ class DirRandomReply {
|
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
41
|
this.go(action, () => {
|
|
43
|
-
this.logger.
|
|
42
|
+
this.logger.native("[Random Reply] Executed");
|
|
44
43
|
callback();
|
|
45
44
|
});
|
|
46
45
|
}
|
|
@@ -19,7 +19,6 @@ class DirReplaceBot {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
execute(directive, callback) {
|
|
22
|
-
this.logger.info("[Replace Bot] Executing action");
|
|
23
22
|
winston.verbose("Execute ReplaceBot directive");
|
|
24
23
|
let action;
|
|
25
24
|
if (directive.action) {
|
|
@@ -37,7 +36,7 @@ class DirReplaceBot {
|
|
|
37
36
|
callback();
|
|
38
37
|
}
|
|
39
38
|
this.go(action, () => {
|
|
40
|
-
this.logger.
|
|
39
|
+
this.logger.native("[Replace Bot] Executed");
|
|
41
40
|
callback();
|
|
42
41
|
})
|
|
43
42
|
}
|
|
@@ -23,7 +23,6 @@ class DirReplaceBotV2 {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
execute(directive, callback) {
|
|
26
|
-
this.logger.info("[Replace Bot] Executing action");
|
|
27
26
|
winston.verbose("Execute ReplaceBotV2 directive");
|
|
28
27
|
let action;
|
|
29
28
|
if (directive.action) {
|
|
@@ -41,7 +40,7 @@ class DirReplaceBotV2 {
|
|
|
41
40
|
callback();
|
|
42
41
|
}
|
|
43
42
|
this.go(action, () => {
|
|
44
|
-
this.logger.
|
|
43
|
+
this.logger.native("[Replace Bot] Executed");
|
|
45
44
|
callback();
|
|
46
45
|
})
|
|
47
46
|
}
|
|
@@ -23,7 +23,6 @@ class DirReplaceBotV3 {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
execute(directive, callback) {
|
|
26
|
-
this.logger.info("[Replace Bot] Executing action");
|
|
27
26
|
winston.verbose("Execute ReplaceBotV3 directive");
|
|
28
27
|
let action;
|
|
29
28
|
if (directive.action) {
|
|
@@ -36,7 +35,7 @@ class DirReplaceBotV3 {
|
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
this.go(action, () => {
|
|
39
|
-
this.logger.
|
|
38
|
+
this.logger.native("[Replace Bot] Executed");
|
|
40
39
|
callback();
|
|
41
40
|
})
|
|
42
41
|
}
|
|
@@ -25,7 +25,6 @@ class DirReply {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
execute(directive, callback) {
|
|
28
|
-
this.logger.info("[Reply] Executing action");
|
|
29
28
|
let action;
|
|
30
29
|
if (directive.action) {
|
|
31
30
|
action = directive.action;
|
|
@@ -42,7 +41,7 @@ class DirReply {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
this.go(action, () => {
|
|
45
|
-
this.logger.
|
|
44
|
+
this.logger.native("[Reply] Executed");
|
|
46
45
|
callback();
|
|
47
46
|
});
|
|
48
47
|
}
|
|
@@ -63,17 +62,17 @@ class DirReply {
|
|
|
63
62
|
const filler = new Filler();
|
|
64
63
|
// fill text attribute
|
|
65
64
|
message.text = filler.fill(message.text, requestAttributes);
|
|
66
|
-
this.logger.
|
|
65
|
+
this.logger.native("[Reply] Reply with: " + message.text);
|
|
67
66
|
|
|
68
67
|
if (message.metadata) {
|
|
69
68
|
winston.debug("DirReply filling message 'metadata':", message.metadata);
|
|
70
69
|
if (message.metadata.src) {
|
|
71
70
|
message.metadata.src = filler.fill(message.metadata.src, requestAttributes);
|
|
72
|
-
this.logger.
|
|
71
|
+
this.logger.native("Filled metadata.src with ", message.metadata.src);
|
|
73
72
|
}
|
|
74
73
|
if (message.metadata.name) {
|
|
75
74
|
message.metadata.name = filler.fill(message.metadata.name, requestAttributes);
|
|
76
|
-
this.logger.
|
|
75
|
+
this.logger.native("Filled metadata.name with ", message.metadata.name);
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
winston.debug("DirReply filling commands'. Message:", message);
|
|
@@ -32,7 +32,6 @@ class DirReplyV2 {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
execute(directive, callback) {
|
|
35
|
-
this.logger.info("[Advanced Reply] Executing action");
|
|
36
35
|
winston.verbose("Execute ReplyV2 directive");
|
|
37
36
|
let action;
|
|
38
37
|
if (directive.action) {
|
|
@@ -49,7 +48,7 @@ class DirReplyV2 {
|
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
50
|
this.go(action, (stop) => {
|
|
52
|
-
this.logger.
|
|
51
|
+
this.logger.native("[Advanced Reply] Executed");
|
|
53
52
|
callback(stop);
|
|
54
53
|
});
|
|
55
54
|
}
|
|
@@ -23,7 +23,6 @@ class DirSendEmail {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
execute(directive, callback) {
|
|
26
|
-
this.logger.info("[Send Email] Executing action");
|
|
27
26
|
winston.verbose("Execute SendEmail directive");
|
|
28
27
|
let action;
|
|
29
28
|
if (directive.action) {
|
|
@@ -44,7 +43,7 @@ class DirSendEmail {
|
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
45
|
this.go(action, () => {
|
|
47
|
-
this.logger.
|
|
46
|
+
this.logger.native("[Send Email] Executed");
|
|
48
47
|
callback();
|
|
49
48
|
});
|
|
50
49
|
}
|
|
@@ -25,7 +25,6 @@ class DirSendWhatsapp {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
execute(directive, callback) {
|
|
28
|
-
this.logger.info("[Send Whatsapp] Executing action");
|
|
29
28
|
winston.verbose("Execute SendWhatsapp directive");
|
|
30
29
|
let action;
|
|
31
30
|
if (directive.action) {
|
|
@@ -38,7 +37,7 @@ class DirSendWhatsapp {
|
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
39
|
this.go(action, (stop) => {
|
|
41
|
-
this.logger.
|
|
40
|
+
this.logger.native("[Send Whatsapp] Executed");
|
|
42
41
|
callback(stop);
|
|
43
42
|
})
|
|
44
43
|
}
|
|
@@ -86,7 +86,6 @@ class DirSetAttributeV2 {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
execute(directive, callback) {
|
|
89
|
-
this.logger.info("[Set Attribute] Executing action");
|
|
90
89
|
winston.verbose("Execute SetAttributeV2 directive");
|
|
91
90
|
let action;
|
|
92
91
|
if (directive.action) {
|
|
@@ -99,7 +98,7 @@ class DirSetAttributeV2 {
|
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
100
|
this.go(action, () => {
|
|
102
|
-
this.logger.
|
|
101
|
+
this.logger.native("[Set Attribute] Executed");
|
|
103
102
|
callback();
|
|
104
103
|
});
|
|
105
104
|
}
|
|
@@ -19,7 +19,6 @@ class DirWait {
|
|
|
19
19
|
|
|
20
20
|
execute(directive, callback) {
|
|
21
21
|
// 500ms < wait-time < 10.000ms
|
|
22
|
-
this.logger.info("[Wait] Executing action");
|
|
23
22
|
winston.verbose("Execute Wait directive");
|
|
24
23
|
let action;
|
|
25
24
|
if (directive.action) {
|
|
@@ -48,7 +47,7 @@ class DirWait {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
this.go(action, () => {
|
|
51
|
-
this.logger.
|
|
50
|
+
this.logger.native("[Wait] Executed");
|
|
52
51
|
callback();
|
|
53
52
|
})
|
|
54
53
|
}
|
|
@@ -61,7 +60,7 @@ class DirWait {
|
|
|
61
60
|
// await this.tdcache.set(step_key, 0);
|
|
62
61
|
await TiledeskChatbot.resetStep(this.tdcache, this.requestId);
|
|
63
62
|
}
|
|
64
|
-
this.logger.
|
|
63
|
+
this.logger.native("[Wait] Waiting for ", action.millis, "[ms]")
|
|
65
64
|
setTimeout(() => {
|
|
66
65
|
callback();
|
|
67
66
|
}, action.millis);
|
|
@@ -23,7 +23,6 @@ class DirWebRequestV2 {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
execute(directive, callback) {
|
|
26
|
-
this.logger.info("[Web Request] Executing action");
|
|
27
26
|
winston.verbose("Execute WebRequestV2 directive");
|
|
28
27
|
let action;
|
|
29
28
|
if (directive.action) {
|
|
@@ -35,9 +34,9 @@ class DirWebRequestV2 {
|
|
|
35
34
|
callback();
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
|
-
this.logger.
|
|
37
|
+
this.logger.native("Executing WebRequest action ", directive.action)
|
|
39
38
|
this.go(action, (stop) => {
|
|
40
|
-
this.logger.
|
|
39
|
+
this.logger.native("[Web Request] Executed");
|
|
41
40
|
callback(stop);
|
|
42
41
|
}).catch((err) => {
|
|
43
42
|
// do not nothing
|
|
@@ -116,7 +115,7 @@ class DirWebRequestV2 {
|
|
|
116
115
|
let error = res.error;
|
|
117
116
|
await this.#assignAttributes(action, resbody, status, error)
|
|
118
117
|
winston.debug("DirWebRequestV2 resbody:", resbody);
|
|
119
|
-
this.logger.
|
|
118
|
+
this.logger.native("[Web Request] resbody: ", resbody);
|
|
120
119
|
|
|
121
120
|
if (err) {
|
|
122
121
|
this.logger.error("WebRequest error: ", err);
|
|
@@ -241,7 +240,7 @@ class DirWebRequestV2 {
|
|
|
241
240
|
}
|
|
242
241
|
if (result === true) {
|
|
243
242
|
if (trueIntentDirective) {
|
|
244
|
-
this.logger.
|
|
243
|
+
this.logger.native("WebRequest: executing true condition");
|
|
245
244
|
this.intentDir.execute(trueIntentDirective, () => {
|
|
246
245
|
if (callback) {
|
|
247
246
|
callback();
|
|
@@ -249,7 +248,7 @@ class DirWebRequestV2 {
|
|
|
249
248
|
});
|
|
250
249
|
}
|
|
251
250
|
else {
|
|
252
|
-
this.logger.
|
|
251
|
+
this.logger.native("WebRequest: no block connected to true condition");
|
|
253
252
|
winston.debug("DirWebRequestV2 No trueIntentDirective specified");
|
|
254
253
|
if (callback) {
|
|
255
254
|
callback();
|
|
@@ -258,7 +257,7 @@ class DirWebRequestV2 {
|
|
|
258
257
|
}
|
|
259
258
|
else {
|
|
260
259
|
if (falseIntentDirective) {
|
|
261
|
-
this.logger.
|
|
260
|
+
this.logger.native("WebRequest: executing false condition");
|
|
262
261
|
this.intentDir.execute(falseIntentDirective, () => {
|
|
263
262
|
if (callback) {
|
|
264
263
|
callback();
|
|
@@ -266,7 +265,7 @@ class DirWebRequestV2 {
|
|
|
266
265
|
});
|
|
267
266
|
}
|
|
268
267
|
else {
|
|
269
|
-
this.logger.
|
|
268
|
+
this.logger.native("WebRequest: no block connected to false condition");
|
|
270
269
|
winston.debug("DirWebRequestV2 No falseIntentDirective specified");
|
|
271
270
|
if (callback) {
|
|
272
271
|
callback();
|
|
@@ -21,7 +21,6 @@ class DirWebResponse {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
execute(directive, callback) {
|
|
24
|
-
this.logger.info("[Web Response] Executing action");
|
|
25
24
|
winston.debug("Execute WebResponse directive: ", directive);
|
|
26
25
|
let action;
|
|
27
26
|
if (directive.action) {
|
|
@@ -34,7 +33,7 @@ class DirWebResponse {
|
|
|
34
33
|
return;
|
|
35
34
|
}
|
|
36
35
|
this.go(action, () => {
|
|
37
|
-
this.logger.
|
|
36
|
+
this.logger.native("[Web Response] Executed");
|
|
38
37
|
callback();
|
|
39
38
|
});
|
|
40
39
|
}
|
|
@@ -63,7 +62,7 @@ class DirWebResponse {
|
|
|
63
62
|
payload: json
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
this.logger.
|
|
65
|
+
this.logger.native("[Web Response] payload: ", webResponse);
|
|
67
66
|
|
|
68
67
|
const topic = `/webhooks/${this.requestId}`;
|
|
69
68
|
|
|
@@ -20,7 +20,6 @@ class DirWhatsappByAttribute {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
execute(directive, callback) {
|
|
23
|
-
this.logger.info("[Whatsapp by Attribute] Executing action");
|
|
24
23
|
winston.verbose("Execute WhatsappByAttribute directive");
|
|
25
24
|
let action;
|
|
26
25
|
if (directive.action) {
|
|
@@ -33,7 +32,7 @@ class DirWhatsappByAttribute {
|
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
this.go(action, () => {
|
|
36
|
-
this.logger.
|
|
35
|
+
this.logger.native("[Whatsapp by Attribute] Executed");
|
|
37
36
|
callback();
|
|
38
37
|
})
|
|
39
38
|
}
|