@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 +6 -0
- package/package.json +1 -1
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirGptTask_OLD.js +0 -1
- package/tiledeskChatbotPlugs/directives/DirMake.js +1 -50
- package/tiledeskChatbotPlugs/directives/DirWebRequestV2.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirWebResponse.js +1 -1
- package/tiledeskChatbotPlugs/directives/Directives.js +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -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;
|
|
@@ -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
|
|
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 = "
|
|
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
|