@tiledesk/tiledesk-tybot-connector 0.4.0 → 0.4.2

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
@@ -5,6 +5,12 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.4.2
9
+ - bug-fixed: minor log fix
10
+
11
+ # v0.4.1
12
+ - fix: wrong key for web_response
13
+
8
14
  # v0.4.0
9
15
  - added: DirWebResposne
10
16
  - added: management of webhook
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -596,7 +596,6 @@ class DirAssistant {
596
596
  });
597
597
  console.error("(DirAssistant) An error occurred: ", error_log);
598
598
  // FIX THE STRINGIFY OF CIRCULAR STRUCTURE BUG - END
599
- // console.error("An error occurred:", JSON.stringify(err));
600
599
  }
601
600
  if (callback) {
602
601
  let status = 1000;
@@ -423,7 +423,6 @@ class DirGptTask {
423
423
  }
424
424
  })
425
425
  .catch((error) => {
426
- // console.error("An error occurred:", JSON.stringify(error.data));
427
426
  if (callback) {
428
427
  callback(error, null);
429
428
  }
@@ -243,9 +243,8 @@ class DirMake {
243
243
  }
244
244
  return value;
245
245
  });
246
- console.error("An error occurred: ", error_log);
246
+ console.error("(DirMake) An error occurred: ", error_log);
247
247
  // FIX THE STRINGIFY OF CIRCULAR STRUCTURE BUG - END
248
- // console.error("An error occurred:", JSON.stringify(err));
249
248
  }
250
249
  if (callback) {
251
250
  let status = 1000;
@@ -278,54 +277,6 @@ class DirMake {
278
277
  });
279
278
  }
280
279
 
281
- // #myrequest(options, callback) {
282
- // if (this.log) {
283
- // console.log("API URL:", options.url);
284
- // console.log("** Options:", JSON.stringify(options));
285
- // }
286
- // let axios_options = {
287
- // url: options.url,
288
- // method: options.method,
289
- // params: options.params,
290
- // headers: options.headers
291
- // }
292
- // if (options.json !== null) {
293
- // axios_options.data = options.json
294
- // }
295
- // if (this.log) {
296
- // console.log("axios_options:", JSON.stringify(axios_options));
297
- // }
298
- // if (options.url.startsWith("https:")) {
299
- // const httpsAgent = new https.Agent({
300
- // rejectUnauthorized: false,
301
- // });
302
- // axios_options.httpsAgent = httpsAgent;
303
- // }
304
- // axios(axios_options)
305
- // .then((res) => {
306
- // if (this.log) {
307
- // console.log("Response for url:", options.url);
308
- // console.log("Response headers:\n", JSON.stringify(res.headers));
309
- // }
310
- // if (res && res.status == 200 && res.data) {
311
- // if (callback) {
312
- // callback(null, res.data);
313
- // }
314
- // }
315
- // else {
316
- // if (callback) {
317
- // callback(new Error("Response status is not 200"), null);
318
- // }
319
- // }
320
- // })
321
- // .catch((error) => {
322
- // if (this.log) { console.error("An error occurred:", JSON.stringify(error.message)) };
323
- // if (callback) {
324
- // callback(error, null);
325
- // }
326
- // });
327
- // }
328
-
329
280
  async #executeCondition(result, trueIntent, trueIntentAttributes, falseIntent, falseIntentAttributes, callback) {
330
281
  let trueIntentDirective = null;
331
282
  if (trueIntent) {
@@ -359,7 +359,7 @@ class DirWebRequestV2 {
359
359
  }
360
360
  return value;
361
361
  });
362
- console.error("An error occurred: ", error_log);
362
+ console.error("(DirWebRequestv2) An error occurred: ", error_log);
363
363
  // FIX THE STRINGIFY OF CIRCULAR STRUCTURE BUG - END
364
364
  // console.error("An error occurred:", JSON.stringify(err));
365
365
  }
@@ -63,7 +63,7 @@ class DirWebResponse {
63
63
 
64
64
  try {
65
65
  this.tdcache.publish(topic, JSON.stringify(webResponse));
66
- console.log("Published webresponse:", to_send, "to topic:", topic);
66
+ console.log("Published webresponse to topic:", topic);
67
67
  }
68
68
  catch(e) {
69
69
  console.error(e)
@@ -58,7 +58,7 @@ class Directives {
58
58
  static MOVE_TO_UNASSIGNED = "move_to_unassigned";
59
59
  static CONNECT_BLOCK = "connect_block";
60
60
  static ADD_TAGS = 'add_tags'
61
- static WEB_RESPONSE = "webresponse";
61
+ static WEB_RESPONSE = "web_response";
62
62
 
63
63
  // static WHEN_ONLINE_MOVE_TO_AGENT = "whenonlinemovetoagent"; // DEPRECATED?
64
64
  // static WHEN_OFFLINE_HOURS = "whenofflinehours"; // DEPRECATED // adds a message on top of the original message when offline hours opts: --replace