@tiledesk/tiledesk-server 2.10.41 → 2.10.43
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/app.js +3 -3
- package/models/analyticResult.js +1 -1
- package/models/channel.js +1 -1
- package/models/department.js +1 -1
- package/models/faq.js +7 -3
- package/models/faq_kb.js +1 -1
- package/models/lead.js +1 -1
- package/models/message.js +1 -1
- package/models/pending-invitation.js +1 -1
- package/models/profile.js +1 -1
- package/models/property.js +1 -1
- package/models/request.js +1 -1
- package/models/requester.js +1 -1
- package/models/segment.js +1 -1
- package/models/setting.js +1 -1
- package/models/subscription.js +1 -1
- package/models/user.js +1 -1
- package/package.json +2 -2
- package/routes/auth.js +1 -1
- package/routes/auth_newjwt.js +3 -3
- package/routes/campaigns.js +2 -2
- package/routes/kb.js +1 -1
- package/routes/request.js +1 -2
- package/services/chatbotService.js +1 -1
- package/services/openaiService.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
🚀 IN PRODUCTION 🚀
|
|
6
6
|
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
|
|
7
7
|
|
|
8
|
+
# 2.10.43
|
|
9
|
+
- changed index on fulltext in faq model adding id_faq_kb
|
|
10
|
+
|
|
11
|
+
# 2.10.42
|
|
12
|
+
- updated tybot-connector to 0.2.140
|
|
13
|
+
|
|
8
14
|
# 2.10.41
|
|
9
15
|
- added agents_available field in faq_kb and faq models
|
|
10
16
|
|
package/app.js
CHANGED
|
@@ -451,7 +451,7 @@ var projectSetter = function (req, res, next) {
|
|
|
451
451
|
if (projectid) {
|
|
452
452
|
|
|
453
453
|
if (!mongoose.Types.ObjectId.isValid(projectid)) {
|
|
454
|
-
winston.warn(`Invalid ObjectId: ${projectid}`);
|
|
454
|
+
//winston.warn(`Invalid ObjectId: ${projectid}`);
|
|
455
455
|
return res.status(400).send({ error: "Invalid project id: " + projectid });
|
|
456
456
|
}
|
|
457
457
|
|
|
@@ -462,11 +462,11 @@ var projectSetter = function (req, res, next) {
|
|
|
462
462
|
}
|
|
463
463
|
q.exec(function(err, project){
|
|
464
464
|
if (err) {
|
|
465
|
-
winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl);
|
|
465
|
+
//winston.warn("Problem getting project with id: " + projectid + " req.originalUrl: " + req.originalUrl);
|
|
466
466
|
}
|
|
467
467
|
winston.debug("projectSetter project:" + project);
|
|
468
468
|
if (!project) {
|
|
469
|
-
winston.warn("ProjectSetter project not found with id: " + projectid);
|
|
469
|
+
//winston.warn("ProjectSetter project not found with id: " + projectid);
|
|
470
470
|
//next();
|
|
471
471
|
return res.status(400).send({ error: "Project not found with id: " + projectid })
|
|
472
472
|
} else {
|
package/models/analyticResult.js
CHANGED
package/models/channel.js
CHANGED
package/models/department.js
CHANGED
package/models/faq.js
CHANGED
|
@@ -164,8 +164,12 @@ FaqSchema.index({ id_project: 1, id_faq_kb: 1, question: 1 });
|
|
|
164
164
|
|
|
165
165
|
// }
|
|
166
166
|
|
|
167
|
-
FaqSchema.index({ question: 'text' },
|
|
168
|
-
|
|
167
|
+
// FaqSchema.index({ question: 'text' },
|
|
168
|
+
// { "name": "faq_fulltext", "default_language": defaultFullTextLanguage, "language_override": "language" }); // schema level
|
|
169
|
+
|
|
170
|
+
FaqSchema.index({ id_faq_kb: 1, question: "text" },
|
|
171
|
+
{ name: "faq_fulltext", default_language: defaultFullTextLanguage, language_override: "language" }
|
|
172
|
+
);
|
|
169
173
|
|
|
170
174
|
// FaqSchema.index({question: 'text', answer: 'text'},
|
|
171
175
|
// {"name":"faq_fulltext","default_language": defaultFqullTextLanguage,"language_override": "language", weights: {question: 10,answer: 1}}); // schema level
|
|
@@ -189,7 +193,7 @@ faq.on('index', function (error) {
|
|
|
189
193
|
|
|
190
194
|
if (process.env.MONGOOSE_SYNCINDEX) {
|
|
191
195
|
faq.syncIndexes();
|
|
192
|
-
winston.
|
|
196
|
+
winston.verbose("faq syncIndexes")
|
|
193
197
|
}
|
|
194
198
|
|
|
195
199
|
|
package/models/faq_kb.js
CHANGED
package/models/lead.js
CHANGED
package/models/message.js
CHANGED
package/models/profile.js
CHANGED
package/models/property.js
CHANGED
package/models/request.js
CHANGED
|
@@ -522,7 +522,7 @@ RequestSchema.index({ id_project: 1, preflight: 1, smartAssignment: 1, "snapshot
|
|
|
522
522
|
var request = mongoose.model('request', RequestSchema);
|
|
523
523
|
if (process.env.MONGOOSE_SYNCINDEX) {
|
|
524
524
|
request.syncIndexes();
|
|
525
|
-
winston.
|
|
525
|
+
winston.verbose("message syncIndexes")
|
|
526
526
|
|
|
527
527
|
}
|
|
528
528
|
|
package/models/requester.js
CHANGED
package/models/segment.js
CHANGED
package/models/setting.js
CHANGED
package/models/subscription.js
CHANGED
|
@@ -49,7 +49,7 @@ var subscription = mongoose.model('subscription', SubscriptionSchema);
|
|
|
49
49
|
|
|
50
50
|
if (process.env.MONGOOSE_SYNCINDEX) {
|
|
51
51
|
subscription.syncIndexes();
|
|
52
|
-
winston.
|
|
52
|
+
winston.verbose("subscription syncIndexes")
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
module.exports = subscription;
|
package/models/user.js
CHANGED
|
@@ -133,7 +133,7 @@ var UserModel = mongoose.model('user', UserSchema);
|
|
|
133
133
|
|
|
134
134
|
if (process.env.MONGOOSE_SYNCINDEX) {
|
|
135
135
|
UserModel.syncIndexes();
|
|
136
|
-
winston.
|
|
136
|
+
winston.verbose("UserModel syncIndexes")
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
module.exports = UserModel;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-server",
|
|
3
3
|
"description": "The Tiledesk server module",
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.43",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "node ./bin/www",
|
|
7
7
|
"pretest": "mongodb-runner start",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
|
|
49
49
|
"@tiledesk/tiledesk-telegram-connector": "^0.1.14",
|
|
50
50
|
"@tiledesk/tiledesk-train-jobworker": "^0.0.11",
|
|
51
|
-
"@tiledesk/tiledesk-tybot-connector": "^0.2.
|
|
51
|
+
"@tiledesk/tiledesk-tybot-connector": "^0.2.140",
|
|
52
52
|
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.76",
|
|
53
53
|
"@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.11",
|
|
54
54
|
"@tiledesk/tiledesk-sms-connector": "^0.1.11",
|
package/routes/auth.js
CHANGED
|
@@ -854,7 +854,7 @@ router.get(
|
|
|
854
854
|
"/keycloak/callback",
|
|
855
855
|
passport.authenticate("keycloak"),
|
|
856
856
|
function(req, res) {
|
|
857
|
-
winston.
|
|
857
|
+
winston.verbose("'/keycloak/callback: ");
|
|
858
858
|
// Successful authentication, redirect home.
|
|
859
859
|
res.redirect('/');
|
|
860
860
|
}
|
package/routes/auth_newjwt.js
CHANGED
|
@@ -135,7 +135,7 @@ function (req, res) {
|
|
|
135
135
|
|
|
136
136
|
authEvent.emit("projectuser.create", savedProject_user);
|
|
137
137
|
|
|
138
|
-
winston.
|
|
138
|
+
winston.verbose('project user created ', savedProject_user.toObject());
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
// JWT_HERE
|
|
@@ -215,14 +215,14 @@ router.post('/signinWithCustomToken', [
|
|
|
215
215
|
|
|
216
216
|
authEvent.emit("projectuser.create", savedProject_user);
|
|
217
217
|
|
|
218
|
-
winston.
|
|
218
|
+
winston.verbose('project user created ', savedProject_user.toObject());
|
|
219
219
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
return res.json({ success: true, token: req.headers["authorization"], user: req.user });
|
|
223
223
|
});
|
|
224
224
|
}else {
|
|
225
|
-
winston.
|
|
225
|
+
winston.verbose('project user already exists ');
|
|
226
226
|
return res.json({ success: true, token: req.headers["authorization"], user: req.user });
|
|
227
227
|
}
|
|
228
228
|
|
package/routes/campaigns.js
CHANGED
|
@@ -15,7 +15,7 @@ var Segment2MongoConverter = require("../utils/segment2mongoConverter");
|
|
|
15
15
|
var JobManager = require("jobs-worker-queued");
|
|
16
16
|
|
|
17
17
|
var JOB_RABBITURI = process.env.JOB_RABBITURI;
|
|
18
|
-
winston.
|
|
18
|
+
winston.verbose("JobWorkerQueued uri: " + JOB_RABBITURI);
|
|
19
19
|
|
|
20
20
|
var jobManager = new JobManager(JOB_RABBITURI,
|
|
21
21
|
{
|
|
@@ -44,7 +44,7 @@ router.post('/', function (req, res) {
|
|
|
44
44
|
req.body.text, req.body.departmentid, req.body.sourcePage,
|
|
45
45
|
req.body.language, req.body.userAgent, null, req.user._id, req.body.attributes, req.body.subject, true, req.body.channel).then(function (savedRequest) {
|
|
46
46
|
|
|
47
|
-
winston.
|
|
47
|
+
winston.debug("savedRequest", savedRequest);
|
|
48
48
|
|
|
49
49
|
// create(sender, senderFullname, recipient, text, id_project, createdBy, status, attributes, type, metadata, language, channel_type) {
|
|
50
50
|
return messageService.create(req.body.sender || req.user._id, req.body.senderFullname || req.user.fullName, savedRequest.request_id, req.body.text,
|
package/routes/kb.js
CHANGED
|
@@ -1445,7 +1445,7 @@ async function scheduleScrape(resources) {
|
|
|
1445
1445
|
winston.error("Scheduling error: ", err);
|
|
1446
1446
|
error_code = 400;
|
|
1447
1447
|
} else {
|
|
1448
|
-
winston.
|
|
1448
|
+
winston.verbose("Scheduling result: ", result);
|
|
1449
1449
|
}
|
|
1450
1450
|
await updateStatus(r.id, error_code);
|
|
1451
1451
|
});
|
package/routes/request.js
CHANGED
|
@@ -2357,12 +2357,11 @@ async function scheduleTags(id_project, tags) {
|
|
|
2357
2357
|
type: "conversation-tag",
|
|
2358
2358
|
date: new Date()
|
|
2359
2359
|
}
|
|
2360
|
-
console.log("payload: ", payload);
|
|
2361
2360
|
scheduler.tagSchedule(payload, async (err, result) => {
|
|
2362
2361
|
if (err) {
|
|
2363
2362
|
winston.error("Scheduling error: ", err);
|
|
2364
2363
|
} else {
|
|
2365
|
-
winston.
|
|
2364
|
+
winston.verbose("Scheduling result: ", result);
|
|
2366
2365
|
}
|
|
2367
2366
|
})
|
|
2368
2367
|
})
|
|
@@ -62,7 +62,7 @@ class ChatbotService {
|
|
|
62
62
|
},
|
|
63
63
|
method: 'GET'
|
|
64
64
|
}).then((resbody) => {
|
|
65
|
-
winston.
|
|
65
|
+
winston.debug("(CHATBOT SERVICE) forking public chatbot " + resbody.data.name);
|
|
66
66
|
let chatbot = resbody.data;
|
|
67
67
|
return chatbot
|
|
68
68
|
}).catch((err) => {
|
|
@@ -165,8 +165,8 @@ class OpenaiService {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
getContentChunks(namespace_id, content_id, engine) {
|
|
168
|
-
winston.
|
|
169
|
-
|
|
168
|
+
winston.debug("[OPENAI SERVICE] kb endpoint: " + kb_endpoint_train);
|
|
169
|
+
|
|
170
170
|
return new Promise((resolve, reject) => {
|
|
171
171
|
|
|
172
172
|
let payload = { engine: engine };
|