@tiledesk/tiledesk-tybot-connector 0.2.138-rc5 → 0.2.138-rc7
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
package/index.js
CHANGED
|
@@ -4,7 +4,7 @@ const bodyParser = require('body-parser');
|
|
|
4
4
|
const { TiledeskClient } = require('@tiledesk/tiledesk-client');
|
|
5
5
|
const { ExtApi } = require('./ExtApi.js');
|
|
6
6
|
const { ExtUtil } = require('./ExtUtil.js');
|
|
7
|
-
const { TdCache } = require('./
|
|
7
|
+
const { TdCache } = require('./TdCache_v3.js');
|
|
8
8
|
const { TiledeskChatbot } = require('./models/TiledeskChatbot.js');
|
|
9
9
|
const { MongodbBotsDataSource } = require('./models/MongodbBotsDataSource.js');
|
|
10
10
|
// const { MongodbIntentsMachine } = require('./models/MongodbIntentsMachine.js');
|
|
@@ -609,7 +609,7 @@ router.post('/block/:project_id/:bot_id/:block_id', async (req, res) => {
|
|
|
609
609
|
|
|
610
610
|
async function startApp(settings, completionCallback) {
|
|
611
611
|
console.log("Starting Tilebot...");
|
|
612
|
-
console.log("Starting Tilebot with Settings:", settings);
|
|
612
|
+
// console.log("Starting Tilebot with Settings:", settings);
|
|
613
613
|
if (settings.bots) { // static bots data source
|
|
614
614
|
staticBots = settings.bots;
|
|
615
615
|
}
|
|
@@ -628,9 +628,6 @@ async function startApp(settings, completionCallback) {
|
|
|
628
628
|
}
|
|
629
629
|
|
|
630
630
|
if (settings.REDIS_HOST && settings.REDIS_PORT) {
|
|
631
|
-
console.log("startApp REDIS_HOST: ", settings.REDIS_HOST)
|
|
632
|
-
console.log("startApp REDIS_PORT: ", settings.REDIS_PORT)
|
|
633
|
-
console.log("startApp REDIS_PASSWORD: ", settings.REDIS_PASSWORD)
|
|
634
631
|
tdcache = new TdCache({
|
|
635
632
|
host: settings.REDIS_HOST,
|
|
636
633
|
port: settings.REDIS_PORT,
|
|
@@ -705,7 +702,6 @@ async function startApp(settings, completionCallback) {
|
|
|
705
702
|
}
|
|
706
703
|
|
|
707
704
|
async function connectRedis() {
|
|
708
|
-
console.log("connectRedis tdcache: ", tdcache)
|
|
709
705
|
if (tdcache) {
|
|
710
706
|
try {
|
|
711
707
|
console.log("(Tilebot) Connecting Redis...");
|
|
@@ -699,7 +699,6 @@ class TiledeskChatbotUtil {
|
|
|
699
699
|
await chatbot.addParameter(TiledeskChatbotConst.REQ_DEPARTMENT_ID_KEY, message.attributes.departmentId);
|
|
700
700
|
await chatbot.addParameter(TiledeskChatbotConst.REQ_DEPARTMENT_NAME_KEY, message.attributes.departmentName);
|
|
701
701
|
}
|
|
702
|
-
|
|
703
702
|
if (message.attributes) {
|
|
704
703
|
if (chatbot.log) {console.log("Ok message.attributes", JSON.stringify(message.attributes));}
|
|
705
704
|
// if (projectId === "641864da99c1fb00131ba495") {console.log("641864da99c1fb00131ba495 > Ok message.attributes", JSON.stringify(message.attributes));}
|
|
@@ -920,6 +919,7 @@ class TiledeskChatbotUtil {
|
|
|
920
919
|
}
|
|
921
920
|
|
|
922
921
|
/**
|
|
922
|
+
* DEPRECATED
|
|
923
923
|
* A stub to get the request parameters, hosted by tilebot on:
|
|
924
924
|
* /${TILEBOT_ROUTE}/ext/parameters/requests/${requestId}?all
|
|
925
925
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-tybot-connector",
|
|
3
|
-
"version": "0.2.138-
|
|
3
|
+
"version": "0.2.138-rc7",
|
|
4
4
|
"description": "Tiledesk Tybot connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"mongoose": "^6.3.5",
|
|
30
30
|
"multer": "^1.4.5-lts.1",
|
|
31
31
|
"nanoid": "^3.1.25",
|
|
32
|
-
"redis": "^
|
|
32
|
+
"redis": "^3.1.2",
|
|
33
33
|
"uuid": "^3.3.3",
|
|
34
34
|
"vm2": "^3.9.13"
|
|
35
35
|
},
|
|
@@ -624,10 +624,10 @@ class DirAskGPTV2 {
|
|
|
624
624
|
return new Promise((resolve) => {
|
|
625
625
|
let engine = {
|
|
626
626
|
name: "pinecone",
|
|
627
|
-
type:
|
|
627
|
+
type: process.env.PINECONE_TYPE,
|
|
628
628
|
apikey: "",
|
|
629
629
|
vector_size: 1536,
|
|
630
|
-
index_name:
|
|
630
|
+
index_name: process.env.PINECONE_INDEX
|
|
631
631
|
}
|
|
632
632
|
resolve(engine);
|
|
633
633
|
})
|
|
@@ -26,6 +26,7 @@ class DirMessage {
|
|
|
26
26
|
this.token = context.token;
|
|
27
27
|
this.log = this.context.log;
|
|
28
28
|
this.supportRequest = this.context.supportRequest
|
|
29
|
+
this.hMessage = false
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
execute(directive, callback) {
|
|
@@ -70,6 +71,7 @@ class DirMessage {
|
|
|
70
71
|
}
|
|
71
72
|
if (directive.name === Directives.HMESSAGE) {
|
|
72
73
|
action.attributes.subtype = "info";
|
|
74
|
+
this.hMessage = true;
|
|
73
75
|
}
|
|
74
76
|
// if (directive.name === Directives.HMESSAGE) {
|
|
75
77
|
// action.sender = "tiledesk";
|
|
@@ -95,7 +97,7 @@ class DirMessage {
|
|
|
95
97
|
const message = action;
|
|
96
98
|
if (this.log) {console.log("Message to extEndpoint:", JSON.stringify(message))};
|
|
97
99
|
|
|
98
|
-
if(this.supportRequest && !this.supportRequest.draft){
|
|
100
|
+
if(this.hMessage && this.supportRequest && !this.supportRequest.draft){
|
|
99
101
|
callback();
|
|
100
102
|
return;
|
|
101
103
|
}
|