@tiledesk/tiledesk-tybot-connector 2.0.7 → 2.0.8-rc2
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 +34 -0
- package/ExtApi.js +1 -8
- package/ExtUtil.js +5 -6
- package/Logger.js +30 -13
- package/engine/IntentForm.js +0 -1
- package/engine/IntentsMachineFactory.js +4 -4
- package/engine/MongodbBotsDataSource.js +0 -1
- package/engine/MongodbIntentsMachine.js +0 -1
- package/engine/TiledeskChatbot.js +11 -16
- package/engine/TiledeskIntentsMachine.js +1 -2
- package/engine/mock/MockBotsDataSource.js +1 -2
- package/index.js +22 -25
- package/logs/app.log +20243 -7549
- package/logs/app1.log +12807 -0
- package/package.json +3 -2
- package/services/AIService.js +1 -1
- package/tiledeskChatbotPlugs/DirectivesChatbotPlug.js +24 -18
- package/tiledeskChatbotPlugs/FillParamsChatbotPlug.js +1 -2
- package/tiledeskChatbotPlugs/MarkbotChatbotPlug.js +1 -3
- package/tiledeskChatbotPlugs/SplitsChatbotPlug.js +1 -3
- package/tiledeskChatbotPlugs/WebhookChatbotPlug.js +7 -9
- package/tiledeskChatbotPlugs/directives/DEPRECATED_DirIfNotOpenHours.js +3 -10
- package/tiledeskChatbotPlugs/directives/DEPRECATED_DirIfOpenHours.js +2 -9
- package/tiledeskChatbotPlugs/directives/DirAddTags.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirAiPrompt.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirAskGPT.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirAssign.js +5 -8
- package/tiledeskChatbotPlugs/directives/DirAssignFromFunction.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirBrevo.js +4 -6
- package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirClose.js +0 -2
- package/tiledeskChatbotPlugs/directives/DirCode.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirCondition.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirConnectBlock.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirContactUpdate.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirCustomerio.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirDeflectToHelpCenter.js +2 -5
- package/tiledeskChatbotPlugs/directives/DirDeleteVariable.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirDepartment.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirFireTiledeskEvent.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirForm.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirGptTask_OLD.js +36 -55
- package/tiledeskChatbotPlugs/directives/DirHubspot.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgents.js +1 -4
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +1 -4
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +0 -2
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours_OLD.js +8 -12
- package/tiledeskChatbotPlugs/directives/DirIntent.js +6 -5
- package/tiledeskChatbotPlugs/directives/DirJSONCondition.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirLockIntent.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirMake.js +1 -16
- package/tiledeskChatbotPlugs/directives/DirMessage.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirMessageToBot.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirMoveToAgent.js +1 -4
- package/tiledeskChatbotPlugs/directives/DirMoveToUnassigned.js +0 -3
- package/tiledeskChatbotPlugs/directives/DirQapla.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirRandomReply.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirRemoveCurrentBot.js +1 -2
- package/tiledeskChatbotPlugs/directives/DirReplaceBot.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirReplaceBotV3.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirReply.js +7 -18
- package/tiledeskChatbotPlugs/directives/DirReplyV2.js +8 -13
- package/tiledeskChatbotPlugs/directives/DirSendEmail.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirSendWhatsapp.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirSetAttribute.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +1 -4
- package/tiledeskChatbotPlugs/directives/DirSetConversationTags.js +1 -3
- package/tiledeskChatbotPlugs/directives/DirUnlockIntent.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirWait.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequest.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +1 -16
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +0 -39
- package/tiledeskChatbotPlugs/directives/DirWhatsappByAttribute.js +0 -1
- package/tiledeskChatbotPlugs/directives/Directives.js +1 -0
- package/utils/TiledeskChatbotUtil.js +19 -57
- package/TdCache copy.js +0 -242
- package/logs/app2.log +0 -46280
- package/logs/app3.log +0 -31686
- package/logs/app4.log +0 -46163
- package/logs/app5.log +0 -39983
- package/logs/app6.log +0 -5964
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2_old.js +0 -417
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-tybot-connector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8-rc2",
|
|
4
4
|
"description": "Tiledesk Tybot connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@tiledesk/tiledesk-chatbot-client": "^0.5.30",
|
|
16
16
|
"@tiledesk/tiledesk-chatbot-util": "^0.8.39",
|
|
17
17
|
"@tiledesk/tiledesk-client": "^0.10.13",
|
|
18
|
-
"@tiledesk/tiledesk-multi-worker": "^0.
|
|
18
|
+
"@tiledesk/tiledesk-multi-worker": "^0.3.1-rc10",
|
|
19
19
|
"accept-language-parser": "^1.5.0",
|
|
20
20
|
"app-root-path": "^3.1.0",
|
|
21
21
|
"axios": "^1.7.7",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"liquidjs": "^10.8.4",
|
|
30
30
|
"minimist-string": "^1.0.2",
|
|
31
31
|
"mongoose": "^6.3.5",
|
|
32
|
+
"mqtt": "^5.10.4",
|
|
32
33
|
"multer": "^1.4.5-lts.1",
|
|
33
34
|
"nanoid": "^3.1.25",
|
|
34
35
|
"redis": "^4.7.0",
|
package/services/AIService.js
CHANGED
|
@@ -73,7 +73,6 @@ class DirectivesChatbotPlug {
|
|
|
73
73
|
this.API_ENDPOINT = config.API_ENDPOINT;
|
|
74
74
|
this.TILEBOT_ENDPOINT = config.TILEBOT_ENDPOINT;
|
|
75
75
|
this.token = config.token;
|
|
76
|
-
this.log = config.log;
|
|
77
76
|
this.HELP_CENTER_API_ENDPOINT = config.HELP_CENTER_API_ENDPOINT;
|
|
78
77
|
this.tdcache = config.cache;
|
|
79
78
|
this.directives = config.directives;
|
|
@@ -142,8 +141,7 @@ class DirectivesChatbotPlug {
|
|
|
142
141
|
projectId: projectId,
|
|
143
142
|
token: token,
|
|
144
143
|
APIURL: API_ENDPOINT,
|
|
145
|
-
APIKEY: "___"
|
|
146
|
-
log: this.log
|
|
144
|
+
APIKEY: "___"
|
|
147
145
|
});
|
|
148
146
|
}
|
|
149
147
|
catch(err) {
|
|
@@ -162,8 +160,7 @@ class DirectivesChatbotPlug {
|
|
|
162
160
|
TILEBOT_ENDPOINT: TILEBOT_ENDPOINT,
|
|
163
161
|
departmentId: depId,
|
|
164
162
|
tdcache: tdcache,
|
|
165
|
-
HELP_CENTER_API_ENDPOINT: this.HELP_CENTER_API_ENDPOINT
|
|
166
|
-
log: this.log
|
|
163
|
+
HELP_CENTER_API_ENDPOINT: this.HELP_CENTER_API_ENDPOINT
|
|
167
164
|
}
|
|
168
165
|
winston.debug("(DirectivesChatbotPlug) this.context.departmentId: " + this.context.departmentId);
|
|
169
166
|
|
|
@@ -177,9 +174,7 @@ class DirectivesChatbotPlug {
|
|
|
177
174
|
|
|
178
175
|
async nextDirective(directives) {
|
|
179
176
|
winston.debug("(DirectivesChatbotPlug) ....nextDirective() checkStep()");
|
|
180
|
-
const go_on = await TiledeskChatbot.checkStep(
|
|
181
|
-
this.context.tdcache, this.context.requestId, this.chatbot?.MAX_STEPS, this.chatbot?.MAX_EXECUTION_TIME, this.log
|
|
182
|
-
);
|
|
177
|
+
const go_on = await TiledeskChatbot.checkStep(this.context.tdcache, this.context.requestId, this.chatbot?.MAX_STEPS, this.chatbot?.MAX_EXECUTION_TIME);
|
|
183
178
|
|
|
184
179
|
if (go_on.error) {
|
|
185
180
|
winston.debug("(DirectivesChatbotPlug) go_on == false! nextDirective() Stopped!");
|
|
@@ -222,14 +217,13 @@ class DirectivesChatbotPlug {
|
|
|
222
217
|
directive_name = directive.name.toLowerCase();
|
|
223
218
|
}
|
|
224
219
|
if (directive && directive.action) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
220
|
+
const action_id = directive.action["_tdActionId"];
|
|
221
|
+
const locked_action_id = await this.chatbot.currentLockedAction(this.supportRequest.request_id);
|
|
222
|
+
if ( locked_action_id && (locked_action_id !== action_id) ) {
|
|
223
|
+
let next_dir = await this.nextDirective(this.directives);
|
|
224
|
+
this.process(next_dir);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
233
227
|
}
|
|
234
228
|
if (directive == null || (directive !== null && directive["name"] === undefined)) {
|
|
235
229
|
winston.debug("(DirectivesChatbotPlug) stop process(). directive is (null?): ", directive);
|
|
@@ -701,6 +695,19 @@ class DirectivesChatbotPlug {
|
|
|
701
695
|
}
|
|
702
696
|
});
|
|
703
697
|
}
|
|
698
|
+
else if (directive_name === Directives.WEBHOOK) {
|
|
699
|
+
// console.log(".....DirIntent")
|
|
700
|
+
new DirIntent(context).execute(directive, async (stop) => {
|
|
701
|
+
if (stop) {
|
|
702
|
+
if (context.log) { console.log("Stopping Actions on:", JSON.stringify(directive));}
|
|
703
|
+
this.theend();
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
let next_dir = await this.nextDirective(this.directives);
|
|
707
|
+
this.process(next_dir);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
704
711
|
else if (directive_name === Directives.WEB_RESPONSE) {
|
|
705
712
|
new DirWebResponse(context).execute(directive, async () => {
|
|
706
713
|
let next_dir = await this.nextDirective(this.directives);
|
|
@@ -733,8 +740,7 @@ class DirectivesChatbotPlug {
|
|
|
733
740
|
projectId: projectId,
|
|
734
741
|
token: token,
|
|
735
742
|
APIURL: API_ENDPOINT,
|
|
736
|
-
APIKEY: "___"
|
|
737
|
-
log: false
|
|
743
|
+
APIKEY: "___"
|
|
738
744
|
});
|
|
739
745
|
let i = -1;
|
|
740
746
|
winston.debug("(DirectivesChatbotPlug) processing Inline directives: ", directives);
|
|
@@ -3,11 +3,10 @@ const winston = require('../utils/winston');
|
|
|
3
3
|
|
|
4
4
|
class WebhookChatbotPlug {
|
|
5
5
|
|
|
6
|
-
constructor(supportRequest, webhookurl, token
|
|
6
|
+
constructor(supportRequest, webhookurl, token) {
|
|
7
7
|
this.supportRequest = supportRequest;
|
|
8
8
|
this.webhookurl = webhookurl;
|
|
9
9
|
this.token = token;
|
|
10
|
-
this.log = log;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
exec(pipeline) {
|
|
@@ -101,19 +100,18 @@ class WebhookChatbotPlug {
|
|
|
101
100
|
callback(null, res.data);
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
}
|
|
105
|
-
);
|
|
103
|
+
});
|
|
106
104
|
}
|
|
107
105
|
|
|
108
106
|
// ************************************************
|
|
109
107
|
// ****************** HTTP REQUEST ****************
|
|
110
108
|
// ************************************************
|
|
111
109
|
|
|
112
|
-
static myrequest(options, callback
|
|
113
|
-
|
|
110
|
+
static myrequest(options, callback) {
|
|
111
|
+
|
|
114
112
|
winston.debug("(WebhookChatbotPlug) myrequest API URL:" + options.url);
|
|
115
113
|
winston.debug("(WebhookChatbotPlug) myrequest Options:", options);
|
|
116
|
-
|
|
114
|
+
|
|
117
115
|
axios(
|
|
118
116
|
{
|
|
119
117
|
url: options.url,
|
|
@@ -122,11 +120,11 @@ class WebhookChatbotPlug {
|
|
|
122
120
|
headers: options.headers
|
|
123
121
|
})
|
|
124
122
|
.then(function (res) {
|
|
125
|
-
|
|
123
|
+
|
|
126
124
|
winston.debug("(WebhookChatbotPlug) myrequest Response for url:", options.url);
|
|
127
125
|
winston.debug("(WebhookChatbotPlug) myrequest Response headers:\n", res.headers);
|
|
128
126
|
winston.debug("(WebhookChatbotPlug) myrequest Response body:\n", res.data);
|
|
129
|
-
|
|
127
|
+
|
|
130
128
|
if (callback) {
|
|
131
129
|
callback(null, res);
|
|
132
130
|
}
|
|
@@ -12,8 +12,7 @@ class DirIfNotOpenHours {
|
|
|
12
12
|
projectId: context.projectId,
|
|
13
13
|
token: context.token,
|
|
14
14
|
APIURL: context.TILEDESK_APIURL,
|
|
15
|
-
APIKEY: "___"
|
|
16
|
-
log: context.log
|
|
15
|
+
APIKEY: "___"
|
|
17
16
|
});
|
|
18
17
|
// this.intentDir = config.intentDir;
|
|
19
18
|
// let context = {
|
|
@@ -22,19 +21,16 @@ class DirIfNotOpenHours {
|
|
|
22
21
|
// requestId: supportRequest,
|
|
23
22
|
// APIURL: API_URL,
|
|
24
23
|
// TILEBOT_ENDPOINT:TILEBOT_ENDPOINT,
|
|
25
|
-
// departmentId: depId
|
|
26
|
-
// log: false
|
|
24
|
+
// departmentId: depId
|
|
27
25
|
// }
|
|
28
26
|
this.intentDir = new DirIntent(
|
|
29
27
|
{
|
|
30
28
|
API_ENDPOINT: context.TILEDESK_APIURL,
|
|
31
29
|
TILEBOT_ENDPOINT: context.TILEBOT_ENDPOINT,
|
|
32
30
|
supportRequest: context.supportRequest,
|
|
33
|
-
token: context.token
|
|
34
|
-
log: context.log
|
|
31
|
+
token: context.token
|
|
35
32
|
}
|
|
36
33
|
);
|
|
37
|
-
this.log = context.log;
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
execute(directive, callback) {
|
|
@@ -58,7 +54,6 @@ class DirIfNotOpenHours {
|
|
|
58
54
|
go(action, callback) {
|
|
59
55
|
const intentName = action.body.intentName;
|
|
60
56
|
if (!intentName) {
|
|
61
|
-
if (this.log) {console.log("Invalid intent name for If-open-hours");}
|
|
62
57
|
callback();
|
|
63
58
|
}
|
|
64
59
|
let intentDirective = {
|
|
@@ -69,13 +64,11 @@ class DirIfNotOpenHours {
|
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
66
|
this.tdclient.openNow((err, result) => {
|
|
72
|
-
if (this.log) {console.log("openNow():", result);}
|
|
73
67
|
if (err) {
|
|
74
68
|
console.error("DirIfNotOpenHours Error:", err);
|
|
75
69
|
callback();
|
|
76
70
|
}
|
|
77
71
|
else if (result && !result.isopen) {
|
|
78
|
-
if (this.log) {console.log("executing the action on 'closed'");}
|
|
79
72
|
this.intentDir.execute(intentDirective, () => {
|
|
80
73
|
callback();
|
|
81
74
|
});
|
|
@@ -12,8 +12,7 @@ class DirIfOpenHours {
|
|
|
12
12
|
projectId: context.projectId,
|
|
13
13
|
token: context.token,
|
|
14
14
|
APIURL: context.TILEDESK_APIURL,
|
|
15
|
-
APIKEY: "___"
|
|
16
|
-
log: context.log
|
|
15
|
+
APIKEY: "___"
|
|
17
16
|
});
|
|
18
17
|
// let context = {
|
|
19
18
|
// projectId: projectId,
|
|
@@ -22,7 +21,6 @@ class DirIfOpenHours {
|
|
|
22
21
|
// APIURL: API_URL,
|
|
23
22
|
// TILEBOT_ENDPOINT:TILEBOT_ENDPOINT,
|
|
24
23
|
// departmentId: depId,
|
|
25
|
-
// log: false
|
|
26
24
|
// }
|
|
27
25
|
this.intentDir = new DirIntent(
|
|
28
26
|
{
|
|
@@ -30,10 +28,8 @@ class DirIfOpenHours {
|
|
|
30
28
|
TILEBOT_ENDPOINT: context.TILEBOT_ENDPOINT,
|
|
31
29
|
supportRequest: context.supportRequest,
|
|
32
30
|
token: context.token,
|
|
33
|
-
log: context.log
|
|
34
31
|
}
|
|
35
|
-
)
|
|
36
|
-
this.log = context.log;
|
|
32
|
+
)
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
execute(directive, callback) {
|
|
@@ -56,7 +52,6 @@ class DirIfOpenHours {
|
|
|
56
52
|
go(action, callback) {
|
|
57
53
|
const intentName = action.body.intentName;
|
|
58
54
|
if (!intentName) {
|
|
59
|
-
if (this.log) {console.log("Invalid intent name for If-open-hours");}
|
|
60
55
|
callback();
|
|
61
56
|
}
|
|
62
57
|
let intentDirective = {
|
|
@@ -67,13 +62,11 @@ class DirIfOpenHours {
|
|
|
67
62
|
}
|
|
68
63
|
}
|
|
69
64
|
this.tdclient.openNow((err, result) => {
|
|
70
|
-
if (this.log) {console.log("openNow():", result);}
|
|
71
65
|
if (err) {
|
|
72
66
|
console.error("DirIfOpenHours Error:", err);
|
|
73
67
|
callback();
|
|
74
68
|
}
|
|
75
69
|
else if (result && result.isopen) {
|
|
76
|
-
if (this.log) {console.log("executing the action on 'open'");}
|
|
77
70
|
this.intentDir.execute(intentDirective, () => {
|
|
78
71
|
callback();
|
|
79
72
|
});
|
|
@@ -23,14 +23,12 @@ class DirAddTags {
|
|
|
23
23
|
this.tdcache = this.context.tdcache;
|
|
24
24
|
this.requestId = this.context.requestId;
|
|
25
25
|
this.API_ENDPOINT = this.context.API_ENDPOINT;
|
|
26
|
-
this.log = context.log;
|
|
27
26
|
|
|
28
27
|
this.tdClient = new TiledeskClient({
|
|
29
28
|
projectId: this.context.projectId,
|
|
30
29
|
token: this.context.token,
|
|
31
30
|
APIURL: this.API_ENDPOINT,
|
|
32
|
-
APIKEY: "___"
|
|
33
|
-
log: this.log
|
|
31
|
+
APIKEY: "___"
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
34
|
|
|
@@ -11,7 +11,6 @@ class DirAssign {
|
|
|
11
11
|
throw new Error('context object is mandatory.');
|
|
12
12
|
}
|
|
13
13
|
this.context = context;
|
|
14
|
-
this.log = context.log;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
execute(directive, callback) {
|
|
@@ -63,13 +62,11 @@ class DirAssign {
|
|
|
63
62
|
const value = new TiledeskExpression().evaluateExpression(expression, variables);
|
|
64
63
|
winston.debug("(DirAssign) executed expression: " + expression + " value: " + value);
|
|
65
64
|
await TiledeskChatbot.addParameterStatic(this.context.tdcache, this.context.requestId, variableName, value);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
winston.debug("(DirAssign) request parameter: " + key + " value: " + value + " type: " + value_type)
|
|
72
|
-
}
|
|
65
|
+
winston.debug("(DirAssign) Assigned: " + variableName + " = " + value);
|
|
66
|
+
const all_parameters = await TiledeskChatbot.allParametersStatic(this.context.tdcache, this.context.requestId);
|
|
67
|
+
for (const [key, value] of Object.entries(all_parameters)) {
|
|
68
|
+
const value_type = typeof value;
|
|
69
|
+
winston.debug("(DirAssign) request parameter: " + key + " value: " + value + " type: " + value_type)
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
callback();
|
|
@@ -10,7 +10,6 @@ class DirAssignFromFunction {
|
|
|
10
10
|
throw new Error('context object is mandatory.');
|
|
11
11
|
}
|
|
12
12
|
this.context = context;
|
|
13
|
-
this.log = context.log;
|
|
14
13
|
this.tdcache = context.tdcache;
|
|
15
14
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
16
15
|
|
|
@@ -18,8 +17,7 @@ class DirAssignFromFunction {
|
|
|
18
17
|
projectId: this.context.projectId,
|
|
19
18
|
token: this.context.token,
|
|
20
19
|
APIURL: this.API_ENDPOINT,
|
|
21
|
-
APIKEY: "___"
|
|
22
|
-
log: this.log
|
|
20
|
+
APIKEY: "___"
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
23
|
|
|
@@ -20,7 +20,6 @@ class DirBrevo {
|
|
|
20
20
|
this.token = this.context.token;
|
|
21
21
|
this.intentDir = new DirIntent(context);
|
|
22
22
|
this.API_ENDPOINT = this.context.API_ENDPOINT;
|
|
23
|
-
this.log = context.log;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
execute(directive, callback) {
|
|
@@ -158,11 +157,10 @@ class DirBrevo {
|
|
|
158
157
|
error = err.response.data.message;
|
|
159
158
|
}
|
|
160
159
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
160
|
+
winston.error("(DirBrevo) DirBrevo err data result:", result); // CONTROLLA IL VALORE
|
|
161
|
+
winston.error("(DirBrevo) DirBrevo err data status:", status);
|
|
162
|
+
winston.error("(DirBrevo) DirBrevo err data error:", error);
|
|
163
|
+
|
|
166
164
|
|
|
167
165
|
await this.#assignAttributes(action, status, result, error);
|
|
168
166
|
if (falseIntent) {
|
|
@@ -13,14 +13,12 @@ class DirClose {
|
|
|
13
13
|
this.requestId = context.requestId;
|
|
14
14
|
this.chatbot = context.chatbot;
|
|
15
15
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
16
|
-
this.log = context.log;
|
|
17
16
|
|
|
18
17
|
this.tdClient = new TiledeskClient({
|
|
19
18
|
projectId: this.context.projectId,
|
|
20
19
|
token: this.context.token,
|
|
21
20
|
APIURL: this.API_ENDPOINT,
|
|
22
21
|
APIKEY: "___",
|
|
23
|
-
log: this.log
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -19,14 +19,12 @@ class DirContactUpdate {
|
|
|
19
19
|
this.token = context.token;
|
|
20
20
|
this.tdcache = context.tdcache;
|
|
21
21
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
22
|
-
this.log = context.log;
|
|
23
22
|
|
|
24
23
|
this.tdClient = new TiledeskClient({
|
|
25
24
|
projectId: this.context.projectId,
|
|
26
25
|
token: this.context.token,
|
|
27
26
|
APIURL: this.API_ENDPOINT,
|
|
28
|
-
APIKEY: "___"
|
|
29
|
-
log: this.log
|
|
27
|
+
APIKEY: "___"
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
|
|
@@ -13,14 +13,12 @@ class DirDeflectToHelpCenter {
|
|
|
13
13
|
}
|
|
14
14
|
this.context = context;
|
|
15
15
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
16
|
-
this.log = context.log;
|
|
17
16
|
|
|
18
17
|
this.tdClient = new TiledeskClient({
|
|
19
18
|
projectId: this.context.projectId,
|
|
20
19
|
token: this.context.token,
|
|
21
20
|
APIURL: this.API_ENDPOINT,
|
|
22
|
-
APIKEY: "___"
|
|
23
|
-
log: this.log
|
|
21
|
+
APIKEY: "___"
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
24
|
|
|
@@ -70,8 +68,7 @@ class DirDeflectToHelpCenter {
|
|
|
70
68
|
if (last_user_text && last_user_text.trim() !== '') {
|
|
71
69
|
const helpcenter = new HelpCenterQuery({
|
|
72
70
|
APIKEY: "__",
|
|
73
|
-
projectId: project_id
|
|
74
|
-
log: false
|
|
71
|
+
projectId: project_id
|
|
75
72
|
});
|
|
76
73
|
if (this.helpcenter_api_endpoint) {
|
|
77
74
|
helpcenter.APIURL = this.helpcenter_api_endpoint
|
|
@@ -10,14 +10,12 @@ class DirDepartment {
|
|
|
10
10
|
this.context = context;
|
|
11
11
|
this.requestId = context.requestId;
|
|
12
12
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
13
|
-
this.log = context.log;
|
|
14
13
|
|
|
15
14
|
this.tdClient = new TiledeskClient({
|
|
16
15
|
projectId: this.context.projectId,
|
|
17
16
|
token: this.context.token,
|
|
18
17
|
APIURL: this.API_ENDPOINT,
|
|
19
|
-
APIKEY: "___"
|
|
20
|
-
log: this.log
|
|
18
|
+
APIKEY: "___"
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
|
|
@@ -10,15 +10,13 @@ class DirFireTiledeskEvent {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
this.context = context;
|
|
13
|
-
this.log = context.log;
|
|
14
13
|
|
|
15
14
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
16
15
|
this.tdClient = new TiledeskClient({
|
|
17
16
|
projectId: this.context.projectId,
|
|
18
17
|
token: this.context.token,
|
|
19
18
|
APIURL: this.API_ENDPOINT,
|
|
20
|
-
APIKEY: "___"
|
|
21
|
-
log: this.log
|
|
19
|
+
APIKEY: "___"
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
22
|
|
|
@@ -15,15 +15,13 @@ class DirForm {
|
|
|
15
15
|
this.tdcache = context.tdcache;
|
|
16
16
|
this.requestId = context.requestId;
|
|
17
17
|
this.intentDir = new DirIntent(context);
|
|
18
|
-
this.log = context.log;
|
|
19
18
|
|
|
20
19
|
this.API_ENDPOINT = context.API_ENDPOINT;
|
|
21
20
|
this.tdClient = new TiledeskClient({
|
|
22
21
|
projectId: this.context.projectId,
|
|
23
22
|
token: this.context.token,
|
|
24
23
|
APIURL: this.API_ENDPOINT,
|
|
25
|
-
APIKEY: "___"
|
|
26
|
-
log: this.log
|
|
24
|
+
APIKEY: "___"
|
|
27
25
|
});
|
|
28
26
|
|
|
29
27
|
}
|