@tiledesk/tiledesk-server 2.4.26 → 2.4.28

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+
9
+
10
+ # 2.4.27
11
+ - tiledesk/tiledesk-tybot-connector:0.1.83
12
+
8
13
  # 2.4.26
9
14
  - filter by priority
10
15
  - bugfix intent invalidation by intent id
@@ -500,8 +500,8 @@ if (enableGoogleSignin==true) {
500
500
  var password = uniqid()
501
501
 
502
502
 
503
-
504
- userService.signup(email, password, undefined, profile.displayName, true)
503
+ // signup ( email, password, firstname, lastname, emailverified) {
504
+ userService.signup(email, password, profile.displayName, undefined, true)
505
505
  .then(function (savedUser) {
506
506
 
507
507
 
package/models/request.js CHANGED
@@ -5,6 +5,7 @@ var winston = require('../config/winston');
5
5
  var Channel = require('../models/channel');
6
6
  var winston = require('../config/winston');
7
7
  var RequestConstants = require("../models/requestConstants");
8
+ var ChannelConstants = require("../models/channelConstants");
8
9
 
9
10
  var ProjectUserSchema = require("../models/project_user").schema;
10
11
  var RequestStatus = require("../models/requestStatus");
@@ -275,10 +276,19 @@ var RequestSchema = new Schema({
275
276
  },
276
277
  smartAssignment: {
277
278
  type: Boolean,
278
- default: true,
279
+ default: function() {
280
+ // winston.info("smartAssignment default this.channel.name:" + this.channel.name);
281
+ if (this.channel && (this.channel.name===ChannelConstants.FORM || this.channel.name===ChannelConstants.EMAIL )) {
282
+ // winston.info("smartAssignment default return false");
283
+ return false;
284
+ }else {
285
+ // winston.info("smartAssignment default return true");
286
+ return true;
287
+ }
288
+ },
279
289
  index: true
280
290
  },
281
- workingStatus: { //new, pending
291
+ workingStatus: { //new, pending, open
282
292
  type: String,
283
293
  required: false,
284
294
  index: true
@@ -451,11 +461,11 @@ RequestSchema.index({ id_project: 1, participants: 1});
451
461
  // https://docs.mongodb.com/manual/core/index-compound/ The order of the fields listed in a compound index is important. The index will contain references to documents sorted first by the values of the item field and, within each value of the item field, sorted by values of the stock field. See Sort Order for more information
452
462
  RequestSchema.index({ id_project: 1, status: 1, updatedAt: -1 }); // query for websocket
453
463
  RequestSchema.index({ id_project: 1, status: 1, preflight:1, updatedAt: -1 }); // query for websocket
454
-
455
464
  RequestSchema.index({ id_project: 1, preflight:1, updatedAt: -1 }); // used query ws (topic.endsWith('/requests'))
456
465
 
457
466
  RequestSchema.index({ hasBot: 1, createdAt: 1 }); // suggested by atlas
458
467
 
468
+
459
469
  // suggested by atlas
460
470
  RequestSchema.index({ lead: 1, id_project: 1, participants: 1, preflight: 1, createdAt: -1 });
461
471
  // suggested by atlas
@@ -464,6 +474,7 @@ RequestSchema.index({ lead: 1, id_project: 1, preflight: 1, createdAt: -1 });
464
474
  // suggested by atlas
465
475
  RequestSchema.index({ lead: 1, "snapshot.agents.id_user": 1, id_project: 1, preflight: 1, createdAt: -1 });
466
476
 
477
+
467
478
  // suggested by atlas
468
479
  RequestSchema.index({ id_project: 1, ticket_id: 1 });
469
480
 
@@ -474,8 +485,6 @@ RequestSchema.index({ id_project: 1, createdAt: 1, preflight: 1});
474
485
  RequestSchema.index({ hasBot: 1, status: 1, createdAt: 1});
475
486
 
476
487
 
477
-
478
-
479
488
  // cannot index parallel arrays [agents] [participants] {"driv
480
489
  // RequestSchema.index({ id_project: 1, status: 1, preflight:1, participants:1, "agents.id_user":1, updatedAt: -1 }); //NN LO APPLICA
481
490
 
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.4.26",
4
+ "version": "2.4.28",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -44,7 +44,7 @@
44
44
  "@tiledesk/tiledesk-kaleyra-proxy": "^0.1.7",
45
45
  "@tiledesk/tiledesk-messenger-connector": "0.1.9",
46
46
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
47
- "@tiledesk/tiledesk-tybot-connector": "^0.1.81",
47
+ "@tiledesk/tiledesk-tybot-connector": "^0.1.83",
48
48
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.49",
49
49
  "amqplib": "^0.5.5",
50
50
  "app-root-path": "^3.0.0",
@@ -25,7 +25,7 @@ class Listener {
25
25
  let graph_url = process.env.META_GRAPH_URL || config.graphUrl || "https://graph.facebook.com/v14.0/"
26
26
  winston.debug("Whatsapp graph_url: "+ password);
27
27
 
28
- let baseFileUrl = process.env.BASE_FILE_URL
28
+ let baseFileUrl = process.env.BASE_FILE_URL || apiUrl || "http://localhost:3000"
29
29
 
30
30
  let log = process.env.WHATSAPP_LOG || false
31
31
  winston.debug("Whatsapp log: "+ log);