@tiledesk/tiledesk-server 2.3.5 → 2.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -202,20 +202,14 @@ router.post('/', function (req, res) {
202
202
  }
203
203
 
204
204
 
205
- // var auto_close;
206
-
207
- // // qui projecy nn c'è devi leggerlo
208
- // if (req.project.attributes.auto_close === false) {
209
- // auto_close = 10;
210
- // }
211
-
205
+
212
206
 
213
207
  var new_request = {
214
208
  request_id: message.recipient, project_user_id:project_user_id, lead_id:createdLead._id, id_project:projectid, first_text:message.text,
215
209
  departmentid:departmentid, sourcePage:sourcePage, language:language, userAgent:client, status:requestStatus, createdBy: undefined,
216
210
  attributes:rAttributes, subject:undefined, preflight:false, channel:undefined, location:undefined,
217
211
  lead:createdLead, requester:project_user
218
- // , auto_close: auto_close
212
+
219
213
  };
220
214
 
221
215
  winston.debug("new_request", new_request);
@@ -543,9 +537,9 @@ router.post('/', function (req, res) {
543
537
  });
544
538
  }
545
539
 
546
- else if (req.body.event_type == "deleted-archivedconversation") {
540
+ else if (req.body.event_type == "deleted-archivedconversation" || req.body.event_type == "conversation-unarchived") {
547
541
 
548
- winston.debug("event_type","deleted-archivedconversation");
542
+ winston.info("event_type","deleted-archivedconversation");
549
543
 
550
544
  winston.debug("req.body",req.body);
551
545
 
@@ -559,21 +553,21 @@ router.post('/', function (req, res) {
559
553
  // winston.debug("conversation",conversation);
560
554
 
561
555
  var user_id = req.body.user_id;
562
- winston.debug("user_id",user_id);
556
+ winston.info("user_id",user_id);
563
557
 
564
558
  var recipient_id = req.body.recipient_id;
565
- winston.debug("recipient_id",recipient_id);
559
+ winston.info("recipient_id",recipient_id);
566
560
 
567
561
 
568
562
  // TODO leggi projectid from support-group
569
563
 
570
564
  if (!recipient_id.startsWith("support-group")){
571
- winston.debug("not a support conversation");
565
+ winston.info("not a support conversation");
572
566
  return res.status(400).send({success: false, msg: "not a support conversation" });
573
567
  }
574
568
 
575
569
  if (user_id!="system"){
576
- winston.debug("not a system conversation");
570
+ winston.info("not a system conversation");
577
571
  return res.status(400).send({success: false, msg: "not a system conversation" });
578
572
  }
579
573
 
@@ -582,9 +576,10 @@ router.post('/', function (req, res) {
582
576
  if (conversation && conversation.attributes) {
583
577
  id_project = conversation.attributes.projectId;
584
578
  }else {
579
+ winston.info( "not a support deleting archived conversation" );
585
580
  return res.status(400).send({success: false, msg: "not a support deleting archived conversation" });
586
581
  }
587
- winston.debug("id_project", id_project);
582
+ winston.info("id_project", id_project);
588
583
 
589
584
 
590
585
  return requestService.reopenRequestByRequestId(recipient_id, id_project).then(function(updatedRequest) {
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.3.5",
4
+ "version": "2.3.8",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -43,7 +43,7 @@
43
43
  "@tiledesk/tiledesk-chat21-app": "^1.1.4",
44
44
  "@tiledesk/tiledesk-chatbot-util": "^0.8.33",
45
45
  "@tiledesk/tiledesk-json-rules-engine": "^4.0.3",
46
- "@tiledesk/tiledesk-rasa-connector": "^1.0.7",
46
+ "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
47
47
  "app-root-path": "^3.0.0",
48
48
  "bcrypt-nodejs": "0.0.3",
49
49
  "body-parser": "^1.20.0",
@@ -188,7 +188,7 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
188
188
 
189
189
  setImmediate(() => {
190
190
 
191
- winston.debug("ConciergeBot send close bot message");
191
+ winston.debug("ConciergeBot send close bot message",request);
192
192
 
193
193
  // send(sender, senderFullname, recipient, text, id_project, createdBy, attributes, type, metadata, language)
194
194
  messageService.send(
@@ -198,7 +198,7 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
198
198
  "Chat closed",
199
199
  request.id_project,
200
200
  'system',
201
- {subtype:"info/support", "updateconversation" : false, messagelabel: {key: "CHAT_CLOSED"}},
201
+ {subtype:"info/support", "updateconversation" : false, messagelabel: {key: "CHAT_CLOSED"}},
202
202
  undefined,
203
203
  request.language
204
204
  );
@@ -228,8 +228,8 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
228
228
  request.request_id,
229
229
  "Chat reopened",
230
230
  request.id_project,
231
- 'system',
232
- {subtype:"info/support", "updateconversation" : false, messagelabel: {key: "CHAT_REOPENED"}},
231
+ 'system',
232
+ {subtype:"info/support", "updateconversation" : true, messagelabel: {key: "CHAT_REOPENED"}},
233
233
  undefined,
234
234
  request.language
235
235
 
package/routes/faq.js CHANGED
@@ -299,10 +299,17 @@ router.get('/', function (req, res, next) {
299
299
  query.id_project = req.projectid
300
300
  }
301
301
 
302
+ if (req.query.intent_display_name) {
303
+ query.intent_display_name=req.query.intent_display_name
304
+ }
305
+
306
+
302
307
  winston.debug("GET FAQ query", query);
303
308
 
304
309
  // query.$text = {"$search": "question"};
305
310
 
311
+
312
+
306
313
  return Faq.find(query).
307
314
  skip(skip).limit(limit).
308
315
  populate({path:'faq_kb'})//, match: { trashed: { $in: [null, false] } }}).