@tiledesk/tiledesk-server 2.10.10 → 2.10.12

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -5,9 +5,15 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
- # 2.10.10
8
+ # 2.10.12
9
+ - Updated tiledesk-chatbot-template to 0.1.3
10
+ - Added check on valid mongo id
11
+ - Removed logs
12
+
13
+ # 2.10.11
9
14
  - Updated tybot-connector to 0.2.118
10
15
  - Removed logs
16
+ - Removed $clusterTime from add kb response
11
17
 
12
18
  # 2.10.9
13
19
  - Removed logs
package/app.js CHANGED
@@ -449,6 +449,11 @@ var projectSetter = function (req, res, next) {
449
449
 
450
450
  if (projectid) {
451
451
 
452
+ if (!mongoose.Types.ObjectId.isValid(projectid)) {
453
+ winston.warn(`Invalid ObjectId: ${projectid}`);
454
+ return res.status(400).send({ error: "Invalid project id: " + projectid });
455
+ }
456
+
452
457
  let q = Project.findOne({_id: projectid, status: 100});
453
458
  if (cacheEnabler.project) {
454
459
  q.cache(cacheUtil.longTTL, "projects:id:"+projectid) //project_cache
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.10",
4
+ "version": "2.10.12",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@tiledesk/tiledesk-apps": "^1.0.26",
40
40
  "@tiledesk/tiledesk-chat21-app": "^1.1.8",
41
- "@tiledesk/tiledesk-chatbot-templates": "^0.1.2",
41
+ "@tiledesk/tiledesk-chatbot-templates": "^0.1.3",
42
42
  "@tiledesk/tiledesk-chatbot-util": "^0.8.33",
43
43
  "@tiledesk/tiledesk-client": "^0.10.10",
44
44
  "@tiledesk/tiledesk-dialogflow-connector": "^1.8.4",
@@ -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.118",
51
+ "@tiledesk/tiledesk-tybot-connector": "^0.2.120",
52
52
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.73",
53
53
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.8",
54
54
  "@tiledesk/tiledesk-sms-connector": "^0.1.10",
package/routes/kb.js CHANGED
@@ -521,8 +521,8 @@ router.get('/namespace/:id/chunks/:content_id', async (req, res) => {
521
521
  return res.status(200).send(chunks);
522
522
 
523
523
  }).catch((err) => {
524
- console.log("error getting content chunks err.response: ", err.response)
525
- console.log("error getting content chunks err.data: ", err.data)
524
+ console.error("error getting content chunks err.response: ", err.response)
525
+ console.error("error getting content chunks err.data: ", err.data)
526
526
  return res.status(500).send({ success: false, error: err });
527
527
  })
528
528
 
@@ -961,6 +961,9 @@ router.post('/', async (req, res) => {
961
961
  }
962
962
  else {
963
963
 
964
+ delete raw.ok;
965
+ delete raw.$clusterTime;
966
+ delete raw.operationTime;
964
967
  res.status(200).send(raw);
965
968
 
966
969
  let saved_kb = raw.value;
@@ -1105,8 +1108,6 @@ router.post('/multi', upload.single('uploadFile'), async (req, res) => {
1105
1108
  }
1106
1109
  })
1107
1110
 
1108
- console.log("kbs: ", kbs);
1109
-
1110
1111
  saveBulk(operations, kbs, project_id).then((result) => {
1111
1112
 
1112
1113
  let ns = namespaces.find(n => n.id === namespace_id);
@@ -1116,7 +1117,6 @@ router.post('/multi', upload.single('uploadFile'), async (req, res) => {
1116
1117
  resources = resources.map(({ _id, scrape_options, ...rest }) => {
1117
1118
  return { id: _id, webhook: webhook, parameters_scrape_type_4: scrape_options, engine: engine, ...rest}
1118
1119
  });
1119
- console.log("resources to be sent to worker: ", resources);
1120
1120
  winston.verbose("resources to be sent to worker: ", resources);
1121
1121
 
1122
1122
  scheduleScrape(resources);
@@ -1183,7 +1183,6 @@ router.post('/csv', upload.single('uploadFile'), async (req, res) => {
1183
1183
  let question = data[0];
1184
1184
  let answer = data[1];
1185
1185
 
1186
- console.log("data. ", data)
1187
1186
  kbs.push({
1188
1187
  id_project: project_id,
1189
1188
  name: question,
package/routes/request.js CHANGED
@@ -766,14 +766,14 @@ router.post('/:requestid/email/send',
766
766
 
767
767
 
768
768
 
769
- winston.info("Sending an email with text : " + text + " to request_id " + request_id);
769
+ winston.debug("Sending an email with text : " + text + " to request_id " + request_id);
770
770
 
771
771
  if (!request.lead.email) {
772
772
  res.json({ "no queued": true });
773
773
  }
774
774
 
775
775
  let newto = request.lead.email
776
- winston.info("Sending an email newto " + newto);
776
+ winston.verbose("Sending an email newto " + newto);
777
777
 
778
778
  //sendEmailDirect(to, text, project, request_id, subject, tokenQueryString, sourcePage, payload)
779
779
  emailService.sendEmailDirect(newto, text, req.project, request_id, subject, undefined, undefined, undefined, replyto);