@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.
Files changed (86) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/ExtApi.js +1 -8
  3. package/ExtUtil.js +5 -6
  4. package/Logger.js +30 -13
  5. package/engine/IntentForm.js +0 -1
  6. package/engine/IntentsMachineFactory.js +4 -4
  7. package/engine/MongodbBotsDataSource.js +0 -1
  8. package/engine/MongodbIntentsMachine.js +0 -1
  9. package/engine/TiledeskChatbot.js +11 -16
  10. package/engine/TiledeskIntentsMachine.js +1 -2
  11. package/engine/mock/MockBotsDataSource.js +1 -2
  12. package/index.js +22 -25
  13. package/logs/app.log +20243 -7549
  14. package/logs/app1.log +12807 -0
  15. package/package.json +3 -2
  16. package/services/AIService.js +1 -1
  17. package/tiledeskChatbotPlugs/DirectivesChatbotPlug.js +24 -18
  18. package/tiledeskChatbotPlugs/FillParamsChatbotPlug.js +1 -2
  19. package/tiledeskChatbotPlugs/MarkbotChatbotPlug.js +1 -3
  20. package/tiledeskChatbotPlugs/SplitsChatbotPlug.js +1 -3
  21. package/tiledeskChatbotPlugs/WebhookChatbotPlug.js +7 -9
  22. package/tiledeskChatbotPlugs/directives/DEPRECATED_DirIfNotOpenHours.js +3 -10
  23. package/tiledeskChatbotPlugs/directives/DEPRECATED_DirIfOpenHours.js +2 -9
  24. package/tiledeskChatbotPlugs/directives/DirAddTags.js +1 -3
  25. package/tiledeskChatbotPlugs/directives/DirAiPrompt.js +0 -1
  26. package/tiledeskChatbotPlugs/directives/DirAskGPT.js +0 -1
  27. package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +0 -1
  28. package/tiledeskChatbotPlugs/directives/DirAssign.js +5 -8
  29. package/tiledeskChatbotPlugs/directives/DirAssignFromFunction.js +1 -3
  30. package/tiledeskChatbotPlugs/directives/DirAssistant.js +0 -1
  31. package/tiledeskChatbotPlugs/directives/DirBrevo.js +4 -6
  32. package/tiledeskChatbotPlugs/directives/DirCaptureUserReply.js +0 -1
  33. package/tiledeskChatbotPlugs/directives/DirClose.js +0 -2
  34. package/tiledeskChatbotPlugs/directives/DirCode.js +0 -1
  35. package/tiledeskChatbotPlugs/directives/DirCondition.js +0 -1
  36. package/tiledeskChatbotPlugs/directives/DirConnectBlock.js +0 -1
  37. package/tiledeskChatbotPlugs/directives/DirContactUpdate.js +1 -3
  38. package/tiledeskChatbotPlugs/directives/DirCustomerio.js +0 -1
  39. package/tiledeskChatbotPlugs/directives/DirDeflectToHelpCenter.js +2 -5
  40. package/tiledeskChatbotPlugs/directives/DirDeleteVariable.js +0 -1
  41. package/tiledeskChatbotPlugs/directives/DirDepartment.js +1 -3
  42. package/tiledeskChatbotPlugs/directives/DirFireTiledeskEvent.js +1 -3
  43. package/tiledeskChatbotPlugs/directives/DirForm.js +1 -3
  44. package/tiledeskChatbotPlugs/directives/DirGptTask.js +0 -1
  45. package/tiledeskChatbotPlugs/directives/DirGptTask_OLD.js +36 -55
  46. package/tiledeskChatbotPlugs/directives/DirHubspot.js +0 -1
  47. package/tiledeskChatbotPlugs/directives/DirIfOnlineAgents.js +1 -4
  48. package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +1 -4
  49. package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +0 -2
  50. package/tiledeskChatbotPlugs/directives/DirIfOpenHours_OLD.js +8 -12
  51. package/tiledeskChatbotPlugs/directives/DirIntent.js +6 -5
  52. package/tiledeskChatbotPlugs/directives/DirJSONCondition.js +0 -1
  53. package/tiledeskChatbotPlugs/directives/DirLockIntent.js +0 -1
  54. package/tiledeskChatbotPlugs/directives/DirMake.js +1 -16
  55. package/tiledeskChatbotPlugs/directives/DirMessage.js +1 -3
  56. package/tiledeskChatbotPlugs/directives/DirMessageToBot.js +0 -1
  57. package/tiledeskChatbotPlugs/directives/DirMoveToAgent.js +1 -4
  58. package/tiledeskChatbotPlugs/directives/DirMoveToUnassigned.js +0 -3
  59. package/tiledeskChatbotPlugs/directives/DirQapla.js +0 -1
  60. package/tiledeskChatbotPlugs/directives/DirRandomReply.js +1 -3
  61. package/tiledeskChatbotPlugs/directives/DirRemoveCurrentBot.js +1 -2
  62. package/tiledeskChatbotPlugs/directives/DirReplaceBot.js +1 -3
  63. package/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +1 -3
  64. package/tiledeskChatbotPlugs/directives/DirReplaceBotV3.js +1 -3
  65. package/tiledeskChatbotPlugs/directives/DirReply.js +7 -18
  66. package/tiledeskChatbotPlugs/directives/DirReplyV2.js +8 -13
  67. package/tiledeskChatbotPlugs/directives/DirSendEmail.js +1 -3
  68. package/tiledeskChatbotPlugs/directives/DirSendWhatsapp.js +0 -1
  69. package/tiledeskChatbotPlugs/directives/DirSetAttribute.js +0 -1
  70. package/tiledeskChatbotPlugs/directives/DirSetAttributeV2.js +1 -4
  71. package/tiledeskChatbotPlugs/directives/DirSetConversationTags.js +1 -3
  72. package/tiledeskChatbotPlugs/directives/DirUnlockIntent.js +0 -1
  73. package/tiledeskChatbotPlugs/directives/DirWait.js +0 -1
  74. package/tiledeskChatbotPlugs/directives/DirWebRequest.js +0 -1
  75. package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +1 -16
  76. package/tiledeskChatbotPlugs/directives/DirWebResponse.js +0 -39
  77. package/tiledeskChatbotPlugs/directives/DirWhatsappByAttribute.js +0 -1
  78. package/tiledeskChatbotPlugs/directives/Directives.js +1 -0
  79. package/utils/TiledeskChatbotUtil.js +19 -57
  80. package/TdCache copy.js +0 -242
  81. package/logs/app2.log +0 -46280
  82. package/logs/app3.log +0 -31686
  83. package/logs/app4.log +0 -46163
  84. package/logs/app5.log +0 -39983
  85. package/logs/app6.log +0 -5964
  86. 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.7",
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.2.1-rc2",
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",
@@ -31,7 +31,7 @@ class AiService {
31
31
  else {
32
32
  resolve(resbody)
33
33
  }
34
- }, this.LOG
34
+ }
35
35
  );
36
36
  });
37
37
  }
@@ -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
- const action_id = directive.action["_tdActionId"];
226
- const locked_action_id = await this.chatbot.currentLockedAction(this.supportRequest.request_id);
227
- if ( locked_action_id && (locked_action_id !== action_id) ) {
228
- let next_dir = await this.nextDirective(this.directives);
229
- this.process(next_dir);
230
- return;
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);
@@ -11,8 +11,7 @@ class FillParamsChatbotPlug {
11
11
  *
12
12
  */
13
13
 
14
- constructor(request, tdcache, log) {
15
- this.log = log;
14
+ constructor(request, tdcache) {
16
15
  this.tdcache = tdcache;
17
16
  this.request = request;
18
17
  }
@@ -10,9 +10,7 @@ class MarkbotChatbotPlug {
10
10
  *
11
11
  */
12
12
 
13
- constructor(log) {
14
- this.log = log;
15
- }
13
+ constructor() {}
16
14
 
17
15
  exec(pipeline) {
18
16
  let message = pipeline.message;
@@ -10,9 +10,7 @@ class SplitsChatbotPlug {
10
10
  *
11
11
  */
12
12
 
13
- constructor(log) {
14
- this.log = log;
15
- }
13
+ constructor() {}
16
14
 
17
15
  exec(pipeline) {
18
16
  let message = pipeline.message;
@@ -3,11 +3,10 @@ const winston = require('../utils/winston');
3
3
 
4
4
  class WebhookChatbotPlug {
5
5
 
6
- constructor(supportRequest, webhookurl, token, log) {
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
- }, this.log
105
- );
103
+ });
106
104
  }
107
105
 
108
106
  // ************************************************
109
107
  // ****************** HTTP REQUEST ****************
110
108
  // ************************************************
111
109
 
112
- static myrequest(options, callback, log) {
113
- if (log) {
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
- if (log) {
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
 
@@ -27,7 +27,6 @@ class DirAiPrompt {
27
27
  this.token = this.context.token;
28
28
  this.intentDir = new DirIntent(context);
29
29
  this.API_ENDPOINT = this.context.API_ENDPOINT;
30
- this.log = context.log;
31
30
  }
32
31
 
33
32
  execute(directive, callback) {
@@ -21,7 +21,6 @@ class DirAskGPT {
21
21
  this.token = this.context.token;
22
22
  this.intentDir = new DirIntent(context);
23
23
  this.API_ENDPOINT = this.context.API_ENDPOINT;
24
- this.log = context.log;
25
24
  }
26
25
 
27
26
  execute(directive, callback) {
@@ -25,7 +25,6 @@ class DirAskGPTV2 {
25
25
  this.token = this.context.token;
26
26
  this.intentDir = new DirIntent(context);
27
27
  this.API_ENDPOINT = this.context.API_ENDPOINT;
28
- this.log = context.log;
29
28
  }
30
29
 
31
30
  execute(directive, callback) {
@@ -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
- if (this.log) {
67
- winston.debug("(DirAssign) Assigned: " + variableName + " = " + value);
68
- const all_parameters = await TiledeskChatbot.allParametersStatic(this.context.tdcache, this.context.requestId);
69
- for (const [key, value] of Object.entries(all_parameters)) {
70
- const value_type = typeof value;
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
 
@@ -19,7 +19,6 @@ class DirAssistant {
19
19
  this.token = this.context.token;
20
20
  this.intentDir = new DirIntent(context);
21
21
  this.API_ENDPOINT = context.API_ENDPOINT;
22
- this.log = context.log;
23
22
  }
24
23
 
25
24
  execute(directive, callback) {
@@ -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
- if (this.log) {
162
- winston.error("(DirBrevo) DirBrevo err data result:", result); // CONTROLLA IL VALORE
163
- winston.error("(DirBrevo) DirBrevo err data status:", status);
164
- winston.error("(DirBrevo) DirBrevo err data error:", error);
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) {
@@ -16,7 +16,6 @@ class DirCaptureUserReply {
16
16
  this.tdcache = context.tdcache;
17
17
  this.requestId = context.requestId;
18
18
  this.intentDir = new DirIntent(context);
19
- this.log = context.log;
20
19
  }
21
20
 
22
21
  execute(directive, callback) {
@@ -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
 
@@ -10,7 +10,6 @@ class DirCode {
10
10
  throw new Error('context object is mandatory.');
11
11
  }
12
12
  this.context = context;
13
- this.log = context.log;
14
13
  }
15
14
 
16
15
  execute(directive, callback) {
@@ -12,7 +12,6 @@ class DirCondition {
12
12
  }
13
13
  this.context = context;
14
14
  this.intentDir = new DirIntent(context);
15
- this.log = context.log;
16
15
  }
17
16
 
18
17
  execute(directive, callback) {
@@ -15,7 +15,6 @@ class DirConnectBlock {
15
15
  this.TILEBOT_ENDPOINT = context.TILEBOT_ENDPOINT;
16
16
  this.supportRequest = context.supportRequest;
17
17
  this.token = context.token;
18
- this.log = context.log;
19
18
  }
20
19
 
21
20
  execute(directive, callback) {
@@ -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
 
@@ -20,7 +20,6 @@ class DirCustomerio {
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) {
@@ -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
@@ -11,7 +11,6 @@ class DirDeleteVariable {
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
  async execute(directive, callback) {
@@ -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
  }
@@ -24,7 +24,6 @@ class DirGptTask {
24
24
  this.token = this.context.token;
25
25
  this.intentDir = new DirIntent(context);
26
26
  this.API_ENDPOINT = this.context.API_ENDPOINT;
27
- this.log = context.log;
28
27
  }
29
28
 
30
29
  execute(directive, callback) {