@tiledesk/tiledesk-server 2.2.32 → 2.2.33

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,6 +1,11 @@
1
1
 
2
2
 
3
3
 
4
+ # # 2.2.32 -> PROD
5
+ - Added Arabic language for the widget
6
+ - Updated dependencies with npm update
7
+ - Filter requests by lead email
8
+
4
9
  # 2.2.31 (compatible with: Dashboard 2.2.37, Widget 5.0.25)
5
10
  - Fix email template reading from project.
6
11
  - Added transcript webpage for users without system messages
@@ -8,10 +13,12 @@
8
13
  - Fix ip address resolver
9
14
  - Exclude poweredBy field from widget endpoint
10
15
  - Bugfix when a conversation has a first_text with \agent
11
- - Added rasa chatbot chatbot type
16
+ - Added rasa chatbot chatbot type
12
17
  - Added visitor email and fullname in the fulltext index
13
18
 
14
- # 2.2.30 -> PROD
19
+
20
+
21
+ # 2.2.30
15
22
  - Log fix
16
23
 
17
24
  # 2.2.29
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.2.32",
4
+ "version": "2.2.33",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
package/routes/request.js CHANGED
@@ -837,12 +837,21 @@ router.get('/', function (req, res, next) {
837
837
 
838
838
  winston.verbose('REQUEST ROUTE - REQUEST FIND ', query);
839
839
 
840
+ var projection = undefined;
841
+
842
+ if (req.query.full_text) {
843
+ winston.info('fulltext projection');
844
+
845
+ projection = {score: { $meta: "textScore" } };
846
+ }
840
847
  // requestcachefarequi populaterequired
841
- var q1 = Request.find(query).
848
+ var q1 = Request.find(query, projection).
842
849
  skip(skip).limit(limit);
843
850
 
844
851
 
845
-
852
+
853
+
854
+
846
855
  winston.debug('REQUEST ROUTE no_populate:' + req.query.no_populate);
847
856
 
848
857
  if (req.query.no_populate != "true" && req.query.no_populate != true) {
@@ -863,7 +872,13 @@ router.get('/', function (req, res, next) {
863
872
  // // q1.select({ "snapshot": 1});
864
873
  // }
865
874
 
866
- q1.sort(sortQuery);
875
+ if (req.query.full_text) {
876
+ winston.info('fulltext sort');
877
+ q1.sort( { score: { $meta: "textScore" } } ) //https://docs.mongodb.com/manual/reference/operator/query/text/#sort-by-text-search-score
878
+ } else {
879
+ q1.sort(sortQuery);
880
+ }
881
+
867
882
 
868
883
  // winston.info('q1',q1);
869
884
 
@@ -1011,7 +1026,6 @@ router.get('/csv', function (req, res, next) {
1011
1026
 
1012
1027
 
1013
1028
 
1014
-
1015
1029
  winston.debug('REQUEST ROUTE - REQUEST FIND ', query)
1016
1030
  return Request.find(query, '-transcript -status -__v').
1017
1031
  skip(skip).limit(limit).
@@ -321,11 +321,16 @@ router.get('/me', function (req, res, next) {
321
321
 
322
322
  winston.verbose('REQUEST ROUTE - REQUEST FIND ', query);
323
323
 
324
+ if (req.query.full_text) {
325
+ winston.info('fulltext projection');
326
+
327
+ projection = {score: { $meta: "textScore" } };
328
+ }
324
329
  // requestcachefarequi populaterequired
325
- var q1 = Request.find(query).
330
+ var q1 = Request.find(query, projection).
326
331
  skip(skip).limit(limit);
327
332
 
328
-
333
+
329
334
  winston.debug('REQUEST ROUTE no_populate:' + req.query.no_populate);
330
335
 
331
336
  if (req.query.no_populate != "true" && req.query.no_populate != true) {
@@ -346,7 +351,12 @@ router.get('/me', function (req, res, next) {
346
351
  // // q1.select({ "snapshot": 1});
347
352
  // }
348
353
 
349
- q1.sort(sortQuery);
354
+ if (req.query.full_text) {
355
+ winston.info('fulltext sort');
356
+ q1.sort( { score: { $meta: "textScore" } } ) //https://docs.mongodb.com/manual/reference/operator/query/text/#sort-by-text-search-score
357
+ } else {
358
+ q1.sort(sortQuery);
359
+ }
350
360
 
351
361
  // winston.info('q1',q1);
352
362
 
package/routes/widget.js CHANGED
@@ -116,7 +116,7 @@ router.get('/', function(req, res, next) {
116
116
 
117
117
 
118
118
  var getProject = function(req) {
119
- winston.info('getProject.');
119
+ winston.debug('getProject.');
120
120
 
121
121
  return new Promise(function (resolve, reject) {
122
122
 
@@ -130,7 +130,7 @@ router.get('/', function(req, res, next) {
130
130
  }
131
131
 
132
132
  if (project && project.profile && (project.profile.type === 'free' && project.trialExpired === true) || (project.profile.type === 'payment' && project.isActiveSubscription === false)) {
133
- winston.info('getProject remove poweredBy tag', project);
133
+ winston.debug('getProject remove poweredBy tag', project);
134
134
  project.widget.poweredBy = undefined;
135
135
  project.widget.baloonImage = undefined;
136
136
  }