@tiledesk/tiledesk-server 2.10.25 → 2.10.27

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
@@ -5,12 +5,20 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
- # 2.10.24
9
- - updated tybot-connector to 0.2.32
8
+ # 2.10.27
9
+ - updated tybot-connector to 0.2.133
10
+ - updated vxml-connector to 0.2.65
11
+ - updated EmailService methods
12
+
13
+ # 2.10.26
14
+ - Added missing catch blocks
15
+
16
+ # 2.10.25
17
+ - updated tybot-connector to 0.2.132
10
18
  - updated twilio-voice--connector to 0.1.10
11
19
 
12
20
  # 2.10.24
13
- - updated tybot-connector to 0.2.32-rc1
21
+ - updated tybot-connector to 0.2.132-rc1
14
22
  - updated vxml-connector to 0.2.64
15
23
  - updated twilio-voice--connector to 0.1.9
16
24
 
@@ -141,6 +141,8 @@ var KBSettingSchema = new Schema({
141
141
 
142
142
 
143
143
  KBSchema.index({ createdAt: -1, updatedAt: -1 })
144
+ KBSchema.index({ id_project: 1, namespace: 1, updatedAt: -1 })
145
+
144
146
 
145
147
  // DEPRECATED
146
148
  const KBSettings = mongoose.model('KBSettings', KBSettingSchema);
package/models/request.js CHANGED
@@ -492,14 +492,20 @@ RequestSchema.index({ id_project: 1, createdAt: 1, preflight: 1});
492
492
  //suggested by atlas profiler. Used by auto closing requests
493
493
  RequestSchema.index({ hasBot: 1, status: 1, createdAt: 1});
494
494
 
495
- // Evaluate following indexes
495
+ // suggested by atlas
496
496
  RequestSchema.index({ "channel.name": 1, id_project: 1, preflight: 1, "snapshot.requester.uuid_user": 1, createdAt: - 1, status: 1 })
497
497
  RequestSchema.index({ id_project: 1, preflight: 1, "snapshot.agents.id_user": 1, updatedAt: -1, draft: 1, status: 1 })
498
498
  RequestSchema.index({ id_project: 1, participants: 1, preflight: 1, updatedAt: -1, draft: 1, status: 1 })
499
499
  RequestSchema.index({ id_project: 1, preflight: 1, updatedAt: -1, draft: 1, status: 1 })
500
500
  RequestSchema.index({ id_project: 1, preflight: 1, "snapshot.requester.uuid_user": 1, createdAt: -1, status: 1 })
501
501
  RequestSchema.index({ department: 1, id_project: 1, participants: 1, preflight: 1, createdAt: -1, status: 1 })
502
-
502
+ RequestSchema.index({ id_project: 1, preflight: 1, createdAt: -1, status: 1 });
503
+ RequestSchema.index({ id_project: 1, preflight: 1, createdAt: 1 })
504
+ RequestSchema.index({ participants: 1, id_project: 1, createdAt: -1, status: 1 })
505
+ RequestSchema.index({ id_project: 1, "snapshot.lead.email": 1, createdAt: -1, status: 1 })
506
+ RequestSchema.index({ id_project: 1, participants: 1, "snapshot.agents.id_user": 1, createdAt: -1, status: 1 })
507
+ RequestSchema.index({ id_project: 1, createdAt: -1, status: 1 })
508
+ RequestSchema.index({ id_project: 1, participants: 1, "snapshot.agents.id_user": 1, createdAt: -1, status: 1 })
503
509
 
504
510
  // cannot index parallel arrays [agents] [participants] {"driv
505
511
  // RequestSchema.index({ id_project: 1, status: 1, preflight:1, participants:1, "agents.id_user":1, updatedAt: -1 }); //NN LO APPLICA
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.10.25",
4
+ "version": "2.10.27",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -48,11 +48,11 @@
48
48
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
49
49
  "@tiledesk/tiledesk-telegram-connector": "^0.1.14",
50
50
  "@tiledesk/tiledesk-train-jobworker": "^0.0.11",
51
- "@tiledesk/tiledesk-tybot-connector": "^0.2.132",
51
+ "@tiledesk/tiledesk-tybot-connector": "^0.2.133",
52
52
  "@tiledesk/tiledesk-whatsapp-connector": "^0.1.75",
53
53
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.10",
54
54
  "@tiledesk/tiledesk-sms-connector": "^0.1.10",
55
- "@tiledesk/tiledesk-vxml-connector": "^0.1.64",
55
+ "@tiledesk/tiledesk-vxml-connector": "^0.1.65",
56
56
  "@tiledesk/tiledesk-voice-twilio-connector": "^0.1.10",
57
57
  "amqplib": "^0.5.5",
58
58
  "app-root-path": "^3.0.0",
@@ -131,6 +131,8 @@ class MessageActionsInterceptor {
131
131
  // {"updateconversation" : false, messagelabel: {key: "TOUCHING_OPERATOR"}}
132
132
  // );
133
133
 
134
+ }).catch((err) => {
135
+ winston.error("(MessageActionsInterceptor) reroute request error ", err)
134
136
  });
135
137
  }
136
138
 
@@ -78,7 +78,9 @@ devi mandare un messaggio welcome tu altrimenti il bot inserito successivamente
78
78
  //apply only if the status is temp and no bot is available. with agent you must reroute to assign temp request to an agent
79
79
  winston.debug("rerouting");
80
80
  // reroute(request_id, id_project, nobot)
81
- requestService.reroute(message.request.request_id, message.request.id_project, false );
81
+ requestService.reroute(message.request.request_id, message.request.id_project, false ).catch((err) => {
82
+ winston.error("ConciergeBot error reroute: ", err);
83
+ });
82
84
  }
83
85
 
84
86
  // updateStatusWitId(lead_id, id_project, status)
@@ -474,7 +474,9 @@ class RulesTrigger {
474
474
  winston.debug('runAction action id_project: ' + id_project);
475
475
 
476
476
  // route(request_id, departmentid, id_project, nobot) {
477
- requestService.route(request_id, departmentid, id_project);
477
+ requestService.route(request_id, departmentid, id_project).catch((err) => {
478
+ winston.error("Error runAction route: ", err);
479
+ });
478
480
 
479
481
  } catch(e) {
480
482
  winston.error("Error runAction", e);
@@ -510,7 +512,9 @@ class RulesTrigger {
510
512
  winston.debug('runAction action id_project: ' + id_project);
511
513
 
512
514
  // reroute(request_id, id_project, nobot) {
513
- requestService.reroute(request_id, id_project);
515
+ requestService.reroute(request_id, id_project).catch((err) => {
516
+ winston.error("Error runAction on reroute", err);
517
+ });
514
518
 
515
519
  } catch(e) {
516
520
  winston.error("Error runAction", e);
@@ -736,6 +740,8 @@ class RulesTrigger {
736
740
  );
737
741
 
738
742
  // TODO Add typing?
743
+ }).catch((err) => {
744
+ winston.error("Error runAction on reroute", err);
739
745
  })
740
746
 
741
747
 
@@ -1582,7 +1582,7 @@ class EmailService {
1582
1582
 
1583
1583
  var that = this;
1584
1584
 
1585
- var html = await this.readTemplateFile('passwordChanged.html', undefined, "EMAIL_PASSWORD_CHANGED_HTML_TEMPLATE");
1585
+ var html = await this.readTemplate('passwordChanged.html', undefined, "EMAIL_PASSWORD_CHANGED_HTML_TEMPLATE");
1586
1586
 
1587
1587
  winston.debug("html: " + html);
1588
1588
 
@@ -1618,7 +1618,7 @@ class EmailService {
1618
1618
 
1619
1619
  var that = this;
1620
1620
 
1621
- var html = await this.readTemplateFile('beenInvitedExistingUser.html', undefined, "EMAIL_EXUSER_INVITED_HTML_TEMPLATE");
1621
+ var html = await this.readTemplate('beenInvitedExistingUser.html', undefined, "EMAIL_EXUSER_INVITED_HTML_TEMPLATE");
1622
1622
 
1623
1623
  winston.debug("html: " + html);
1624
1624
 
@@ -1657,7 +1657,7 @@ class EmailService {
1657
1657
 
1658
1658
  var that = this;
1659
1659
 
1660
- var html = await this.readTemplateFile('beenInvitedNewUser.html', undefined, "EMAIL_NEWUSER_INVITED_HTML_TEMPLATE");
1660
+ var html = await this.readTemplate('beenInvitedNewUser.html', undefined, "EMAIL_NEWUSER_INVITED_HTML_TEMPLATE");
1661
1661
 
1662
1662
  winston.debug("html: " + html);
1663
1663
 
@@ -1693,7 +1693,7 @@ class EmailService {
1693
1693
  if (savedUser.toJSON) {
1694
1694
  savedUser = savedUser.toJSON();
1695
1695
  }
1696
- var html = await this.readTemplateFile('verify.html', undefined, "EMAIL_VERIFY_HTML_TEMPLATE");
1696
+ var html = await this.readTemplate('verify.html', undefined, "EMAIL_VERIFY_HTML_TEMPLATE");
1697
1697
 
1698
1698
  winston.debug("html: " + html);
1699
1699