@tiledesk/tiledesk-tybot-connector 0.2.127 → 0.2.128

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 CHANGED
@@ -17,6 +17,8 @@ available on:
17
17
  - Added flowError on JSONCondition when result = null
18
18
  - Added fix on Filler -->
19
19
 
20
+ # v0.2.127 -> test
21
+ - Updated axios from 0.27.2 to 1.7.7
20
22
  # v0.2.127 -> test
21
23
  - TiledeskChatbot =>
22
24
  - static MAX_STEPS = 1000;
@@ -970,7 +970,7 @@ class TiledeskChatbotUtil {
970
970
  }
971
971
  })
972
972
  .catch((error) => {
973
- // console.error("An error occurred:", error);
973
+ console.error("(TiledeskChatbotUtil) Axios error: ", JSON.stringify(error));
974
974
  if (callback) {
975
975
  callback(error, null, null);
976
976
  }
@@ -124,7 +124,7 @@ class TiledeskIntentsMachine {
124
124
  }
125
125
  })
126
126
  .catch( (error) => {
127
- // console.error("An error occurred:", error);
127
+ console.error("(TiledeskIntentsMachine) Axios error: ", JSON.stringify(error));
128
128
  if (callback) {
129
129
  callback(error, null, null);
130
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.127",
3
+ "version": "0.2.128",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "@tiledesk/tiledesk-chatbot-util": "^0.8.39",
17
17
  "@tiledesk/tiledesk-client": "^0.10.13",
18
18
  "accept-language-parser": "^1.5.0",
19
- "axios": "^0.27.2",
19
+ "axios": "^1.7.7",
20
20
  "body-parser": "^1.19.0",
21
21
  "cors": "^2.8.5",
22
22
  "dotenv": "^16.0.3",
@@ -206,7 +206,7 @@ class WebhookChatbotPlug {
206
206
  }
207
207
  })
208
208
  .catch(function (error) {
209
- console.error("An error occurred:", error);
209
+ console.error("(WebhookChatbotPlug) Axios error: ", JSON.stringify(error));
210
210
  if (callback) {
211
211
  callback(error, null, null);
212
212
  }
@@ -102,7 +102,7 @@ class DirAskGPT {
102
102
  }
103
103
 
104
104
  if (!key) {
105
- if (this.log) { console.log("DirGptTask - Retrieve public gptkey")}
105
+ if (this.log) { console.log("DirAskGPT - Retrieve public gptkey")}
106
106
  key = process.env.GPTKEY;
107
107
  publicKey = true;
108
108
  }
@@ -122,7 +122,7 @@ class DirAskGPT {
122
122
  if (publicKey === true) {
123
123
  let keep_going = await this.checkQuoteAvailability(server_base_url);
124
124
  if (keep_going === false) {
125
- if (this.log) { console.log("DirGptTask - Quota exceeded for tokens. Skip the action")}
125
+ if (this.log) { console.log("DirAskGPT - Quota exceeded for tokens. Skip the action")}
126
126
  callback();
127
127
  return;
128
128
  }
@@ -298,7 +298,7 @@ class DirAskGPT {
298
298
  }
299
299
  })
300
300
  .catch((error) => {
301
- // console.error("An error occurred:", JSON.stringify(error.data));
301
+ console.error("(DirAskGPT) Axios error: ", JSON.stringify(error));
302
302
  if (callback) {
303
303
  callback(error, null);
304
304
  }
@@ -316,7 +316,7 @@ class DirAskGPT {
316
316
  },
317
317
  method: "GET"
318
318
  }
319
- if (this.log) { console.log("DirGptTask INTEGRATIONS_HTTPREQUEST ", INTEGRATIONS_HTTPREQUEST) }
319
+ if (this.log) { console.log("DirAskGPT INTEGRATIONS_HTTPREQUEST ", INTEGRATIONS_HTTPREQUEST) }
320
320
 
321
321
  this.#myrequest(
322
322
  INTEGRATIONS_HTTPREQUEST, async (err, integration) => {
@@ -348,12 +348,12 @@ class DirAskGPT {
348
348
  },
349
349
  method: "GET"
350
350
  }
351
- if (this.log) { console.log("DirGptTask KB_HTTPREQUEST", KB_HTTPREQUEST); }
351
+ if (this.log) { console.log("DirAskGPT KB_HTTPREQUEST", KB_HTTPREQUEST); }
352
352
 
353
353
  this.#myrequest(
354
354
  KB_HTTPREQUEST, async (err, resbody) => {
355
355
  if (err) {
356
- if (this.log) { console.error("DirGptTask Get kb settings error ", err); }
356
+ if (this.log) { console.error("DirAskGPT Get kb settings error ", err); }
357
357
  resolve(null);
358
358
  } else {
359
359
  if (!resbody.gptkey) {
@@ -413,7 +413,7 @@ class DirAskGPTV2 {
413
413
  }
414
414
  })
415
415
  .catch((error) => {
416
- // console.error("An error occurred:", JSON.stringify(error.data));
416
+ console.error("(DirAskGPT) Axios error: ", JSON.stringify(error));
417
417
  if (callback) {
418
418
  callback(error, null);
419
419
  }
@@ -136,7 +136,6 @@ class DirAssistant {
136
136
  }
137
137
  else {
138
138
  apikey = "Bearer " + apikey;
139
- console.log("APIKEY::", apikey);
140
139
  }
141
140
  let threadId = null;
142
141
  try {
@@ -166,7 +165,7 @@ class DirAssistant {
166
165
  lastMessage = messages.data[0].content[0].text.value;
167
166
  }
168
167
  }
169
- console.log("lastMessage:", lastMessage);
168
+
170
169
  // process.exit(0);
171
170
  if (lastMessage !== null) {
172
171
  await TiledeskChatbot.addParameterStatic(this.context.tdcache, this.context.requestId, assignResultTo, lastMessage);
@@ -596,7 +595,7 @@ class DirAssistant {
596
595
  }
597
596
  return value;
598
597
  });
599
- console.error("An error occurred: ", error_log);
598
+ console.error("(DirAssistant) An error occurred: ", error_log);
600
599
  // FIX THE STRINGIFY OF CIRCULAR STRUCTURE BUG - END
601
600
  // console.error("An error occurred:", JSON.stringify(err));
602
601
  }
@@ -81,7 +81,7 @@ class DirCode {
81
81
  // console.log("newvars_del:", newvars_del);
82
82
  }
83
83
  catch(err) {
84
- console.error("An error occurred:", err);
84
+ console.error("(DirCode) An error occurred:", err);
85
85
  }
86
86
  callback();
87
87
  return;
@@ -191,7 +191,7 @@ class DirConnectBlock {
191
191
  }
192
192
  })
193
193
  .catch( (error) => {
194
- console.error("An error occurred:", JSON.stringify(error), "url:", options.url);
194
+ console.error("(DirConnectBlock) Axios error: ", JSON.stringify(error));
195
195
  if (callback) {
196
196
  callback(error, null, null);
197
197
  }
@@ -361,6 +361,7 @@ class DirGptTask {
361
361
  }
362
362
  })
363
363
  .catch((error) => {
364
+ console.error("(DirGptTask) Axios error: ", JSON.stringify(error));
364
365
  if (callback) {
365
366
  callback(error, null);
366
367
  }
@@ -447,7 +448,6 @@ class DirGptTask {
447
448
  this.#myrequest(
448
449
  HTTPREQUEST, async (err, resbody) => {
449
450
  if (err) {
450
- console.error("(httprequest) DirGptTask Check quote availability err: ", err);
451
451
  resolve(true)
452
452
  } else {
453
453
  if (resbody.isAvailable === true) {
@@ -249,6 +249,7 @@ class DirIfOnlineAgentsV2 {
249
249
  }
250
250
  })
251
251
  .catch((error) => {
252
+ console.error("(DirIfOnlineAgents) Axios error: ", JSON.stringify(error));
252
253
  if (callback) {
253
254
  callback(error, null);
254
255
  }
@@ -231,7 +231,7 @@ class DirIfOpenHours {
231
231
  }
232
232
  })
233
233
  .catch((error) => {
234
- // console.error("An error occurred:", JSON.stringify(error.data));
234
+ console.error("(DirIfOpenHours) Axios error: ", JSON.stringify(error));
235
235
  if (callback) {
236
236
  callback(error, null);
237
237
  }
@@ -225,7 +225,7 @@ class DirIntent {
225
225
  }
226
226
  })
227
227
  .catch( (error) => {
228
- console.error("(DirIntent) An error occurred:", JSON.stringify(error), "url:", options.url);
228
+ console.error("(DirIntent) Axios error: ", JSON.stringify(error));
229
229
  if (callback) {
230
230
  callback(error, null, null);
231
231
  }
@@ -143,7 +143,7 @@ class DirMessageToBot {
143
143
  }
144
144
  })
145
145
  .catch( (error) => {
146
- console.error("An error occurred:", error);
146
+ console.error("(DirMessageToBot) Axios error: ", JSON.stringify(error));
147
147
  if (callback) {
148
148
  callback(error, null, null);
149
149
  }
@@ -281,7 +281,7 @@ class DirQapla {
281
281
  }
282
282
  })
283
283
  .catch((error) => {
284
- // console.error("An error occurred:", JSON.stringify(error.data));
284
+ console.error("(DirQapla) Axios error: ", JSON.stringify(error));
285
285
  if (callback) {
286
286
  callback(error, null);
287
287
  }
@@ -190,7 +190,7 @@ class DirWebRequest {
190
190
  }
191
191
  })
192
192
  .catch( (error) => {
193
- console.error("An error occurred:", JSON.stringify(error));
193
+ console.error("(DirWebRequest) Axios error: ", JSON.stringify(error));
194
194
  if (callback) {
195
195
  callback(error, null);
196
196
  }