@tiledesk/tiledesk-server 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
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.3",
4
+ "version": "2.3.4",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -170,6 +170,11 @@ var printer = new PdfPrinter(fonts);
170
170
 
171
171
  var pdfDoc = printer.createPdfKitDocument(docDefinition);
172
172
  // pdfDoc.pipe(fs.createWriteStream('lists.pdf'));
173
+
174
+ res.setHeader('Content-Type', 'application/pdf');
175
+ res.setHeader('Content-Disposition', 'attachment; filename=transcript.pdf');
176
+
177
+
173
178
  pdfDoc.pipe(res);
174
179
  pdfDoc.end();
175
180
 
@@ -287,6 +292,10 @@ var printer = new PdfPrinter(fonts);
287
292
 
288
293
  var pdfDoc = printer.createPdfKitDocument(docDefinition);
289
294
  // pdfDoc.pipe(fs.createWriteStream('lists.pdf'));
295
+
296
+ res.setHeader('Content-Type', 'application/pdf');
297
+ res.setHeader('Content-Disposition', 'attachment; filename=transcript.pdf');
298
+
290
299
  pdfDoc.pipe(res);
291
300
  pdfDoc.end();
292
301
 
package/routes/request.js CHANGED
@@ -656,6 +656,8 @@ router.delete('/id/:id', function (req, res) {
656
656
 
657
657
  router.get('/', function (req, res, next) {
658
658
 
659
+ const startExecTime = new Date();
660
+
659
661
  winston.debug("req projectid", req.projectid);
660
662
  winston.debug("req.query.sort", req.query.sort);
661
663
  winston.debug('REQUEST ROUTE - QUERY ', req.query)
@@ -910,14 +912,17 @@ router.get('/', function (req, res, next) {
910
912
 
911
913
  winston.debug("sort query", sortQuery);
912
914
 
913
- winston.verbose('REQUEST ROUTE - REQUEST FIND ', query);
915
+ winston.debug('REQUEST ROUTE - REQUEST FIND ', query);
914
916
 
915
917
  var projection = undefined;
916
918
 
917
919
  if (req.query.full_text) {
918
- winston.debug('fulltext projection');
919
920
 
920
- projection = {score: { $meta: "textScore" } };
921
+ if (req.query.no_textscore!= "true" && req.query.no_textscore!= true) {
922
+ winston.info('fulltext projection on');
923
+ projection = {score: { $meta: "textScore" } };
924
+ }
925
+
921
926
  }
922
927
  // requestcachefarequi populaterequired
923
928
  var q1 = Request.find(query, projection).
@@ -965,6 +970,11 @@ router.get('/', function (req, res, next) {
965
970
 
966
971
  var q2 = Request.countDocuments(query).exec();
967
972
 
973
+ if (req.query.no_count && req.query.no_count =="true") {
974
+ winston.info('REQUEST ROUTE - no_count ');
975
+ q2 = 0;
976
+ }
977
+
968
978
  var promises = [
969
979
  q1,
970
980
  q2
@@ -978,6 +988,10 @@ router.get('/', function (req, res, next) {
978
988
  };
979
989
  winston.debug('REQUEST ROUTE - objectToReturn ');
980
990
  winston.debug('REQUEST ROUTE - objectToReturn ', objectToReturn);
991
+
992
+ const endExecTime = new Date();
993
+ winston.info('REQUEST ROUTE - exec time: ' + (endExecTime-startExecTime));
994
+
981
995
  return res.json(objectToReturn);
982
996
 
983
997
  }).catch(function(err){