@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 +2 -0
- package/models/TiledeskChatbotUtil.js +1 -1
- package/models/TiledeskIntentsMachine.js +1 -1
- package/package.json +2 -2
- package/tiledeskChatbotPlugs/WebhookChatbotPlug.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirAskGPT.js +6 -6
- package/tiledeskChatbotPlugs/directives/DirAskGPTV2.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirAssistant.js +2 -3
- package/tiledeskChatbotPlugs/directives/DirCode.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirConnectBlock.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirGptTask.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirIfOnlineAgentsV2.js +1 -0
- package/tiledeskChatbotPlugs/directives/DirIfOpenHours.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirIntent.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirMessageToBot.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirQapla.js +1 -1
- package/tiledeskChatbotPlugs/directives/DirWebRequest.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -970,7 +970,7 @@ class TiledeskChatbotUtil {
|
|
|
970
970
|
}
|
|
971
971
|
})
|
|
972
972
|
.catch((error) => {
|
|
973
|
-
|
|
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
|
-
|
|
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.
|
|
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": "^
|
|
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("
|
|
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("
|
|
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("
|
|
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
|
-
|
|
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("
|
|
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("
|
|
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("
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -191,7 +191,7 @@ class DirConnectBlock {
|
|
|
191
191
|
}
|
|
192
192
|
})
|
|
193
193
|
.catch( (error) => {
|
|
194
|
-
console.error("
|
|
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) {
|
|
@@ -231,7 +231,7 @@ class DirIfOpenHours {
|
|
|
231
231
|
}
|
|
232
232
|
})
|
|
233
233
|
.catch((error) => {
|
|
234
|
-
|
|
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)
|
|
228
|
+
console.error("(DirIntent) Axios error: ", JSON.stringify(error));
|
|
229
229
|
if (callback) {
|
|
230
230
|
callback(error, null, null);
|
|
231
231
|
}
|