@tiledesk/tiledesk-server 2.3.40 → 2.3.41

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
@@ -1,9 +1,16 @@
1
1
 
2
+
2
3
  💥 TILEDESK SERVER v2.3.39 💥
3
4
  🚀 TAGGED AND PUBLISHED ON NPM 🚀
4
5
  🚀 IN PRODUCTION 🚀
5
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.39)
6
7
 
8
+ # 2.3.41
9
+ - Added force parameter to close request
10
+
11
+ # 2.3.40
12
+ - logfix
13
+
7
14
  # 2.3.39
8
15
  - logfix
9
16
 
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.40",
4
+ "version": "2.3.41",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -40,7 +40,7 @@
40
40
  "@tiledesk/tiledesk-chatbot-util": "^0.8.33",
41
41
  "@tiledesk/tiledesk-json-rules-engine": "^4.0.3",
42
42
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
43
- "@tiledesk/tiledesk-tybot-connector": "^0.1.14",
43
+ "@tiledesk/tiledesk-tybot-connector": "^0.1.16",
44
44
  "@tiledesk/tiledesk-dialogflow-connector": "^1.7.4",
45
45
  "app-root-path": "^3.0.0",
46
46
  "bcrypt-nodejs": "0.0.3",
package/routes/request.js CHANGED
@@ -288,7 +288,7 @@ router.put('/:requestid/close', function (req, res) {
288
288
 
289
289
  // closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
290
290
  const closed_by = req.user.id;
291
- return requestService.closeRequestByRequestId(req.params.requestid, req.projectid, false, true, closed_by).then(function(closedRequest) {
291
+ return requestService.closeRequestByRequestId(req.params.requestid, req.projectid, false, true, closed_by, req.body.force).then(function(closedRequest) {
292
292
 
293
293
  winston.verbose("request closed", closedRequest);
294
294
 
@@ -1019,12 +1019,19 @@ class RequestService {
1019
1019
  }
1020
1020
 
1021
1021
 
1022
- closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by) {
1022
+ closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by, force) {
1023
1023
 
1024
1024
  var that = this;
1025
1025
  return new Promise(function (resolve, reject) {
1026
1026
  // winston.debug("request_id", request_id);
1027
1027
 
1028
+ if (force==undefined) {
1029
+ winston.debug("force is undefined ");
1030
+ force = false;
1031
+ }
1032
+ // else {
1033
+ // winston.info("force is: " + force);
1034
+ // }
1028
1035
 
1029
1036
  return Request
1030
1037
  .findOne({request_id: request_id, id_project: id_project})
@@ -1045,13 +1052,15 @@ class RequestService {
1045
1052
  winston.error("Request not found for request_id "+ request_id + " and id_project " + id_project);
1046
1053
  return reject({"success":false, msg:"Request not found for request_id "+ request_id + " and id_project " + id_project});
1047
1054
  }
1048
- if (request.status == RequestConstants.CLOSED) {
1055
+ if (force == false && request.status == RequestConstants.CLOSED) {
1049
1056
  // qui1000
1050
1057
  // if (request.statusObj.closed) {
1051
1058
  winston.debug("Request already closed for request_id "+ request_id + " and id_project " + id_project);
1052
1059
  return resolve(request);
1053
1060
  }
1054
1061
 
1062
+ winston.debug("sono qui");
1063
+
1055
1064
  // un utente può chiudere se appartiene a participatingAgents oppure meglio agents del progetto?
1056
1065
 
1057
1066