@tiledesk/tiledesk-server 2.7.6 → 2.7.8

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,6 +5,14 @@
5
5
  🚀 IN PRODUCTION 🚀
6
6
  (https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.77)
7
7
 
8
+ # 2.7.8
9
+ - Updated tybot-connector to 0.2.61
10
+
11
+ # 2.7.7
12
+ - Fix update user verifiedEmail with signup from Admin
13
+ - Updated WhatsApp listener to reduce mongodb connections
14
+ - Fix duplicated intents
15
+
8
16
  # 2.7.6
9
17
  - Fix auth with admin token
10
18
 
package/models/profile.js CHANGED
@@ -23,6 +23,9 @@ var ProfileSchema = new Schema({
23
23
  quotes: {
24
24
  type: Object
25
25
  },
26
+ customization: {
27
+ type: Object
28
+ },
26
29
  subStart: {
27
30
  type: Date,
28
31
  },
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.7.6",
4
+ "version": "2.7.8",
5
5
  "scripts": {
6
6
  "start": "node ./bin/www",
7
7
  "pretest": "mongodb-runner start",
@@ -48,8 +48,8 @@
48
48
  "@tiledesk/tiledesk-rasa-connector": "^1.0.10",
49
49
  "@tiledesk/tiledesk-telegram-connector": "^0.1.10",
50
50
  "@tiledesk/tiledesk-train-jobworker": "^0.0.7",
51
- "@tiledesk/tiledesk-tybot-connector": "^0.2.60",
52
- "@tiledesk/tiledesk-whatsapp-connector": "^0.1.64",
51
+ "@tiledesk/tiledesk-tybot-connector": "^0.2.61",
52
+ "@tiledesk/tiledesk-whatsapp-connector": "^0.1.65",
53
53
  "@tiledesk/tiledesk-whatsapp-jobworker": "^0.0.7",
54
54
  "amqplib": "^0.5.5",
55
55
  "app-root-path": "^3.0.0",
@@ -1,10 +1,13 @@
1
1
  const whatsapp = require("@tiledesk/tiledesk-whatsapp-connector");
2
2
  var winston = require('../../config/winston');
3
3
  var configGlobal = require('../../config/global');
4
+ const mongoose = require("mongoose");
4
5
 
5
6
  const apiUrl = process.env.API_URL || configGlobal.apiUrl;
6
7
  winston.info('Whatsapp apiUrl: ' + apiUrl);
7
8
 
9
+ const dbConnection = mongoose.connection;
10
+
8
11
  class Listener {
9
12
 
10
13
  listen(config) {
@@ -38,6 +41,7 @@ class Listener {
38
41
 
39
42
  whatsapp.startApp({
40
43
  MONGODB_URL: config.databaseUri,
44
+ dbconnection: dbConnection,
41
45
  API_URL: apiUrl,
42
46
  BASE_FILE_URL: baseFileUrl,
43
47
  GRAPH_URL: graph_url,
package/routes/auth.js CHANGED
@@ -77,7 +77,7 @@ router.post('/signup',
77
77
  return res.json({ success: false, msg: 'Please pass email and password.' });
78
78
  } else {
79
79
  return userService.signup(req.body.email, req.body.password, req.body.firstname, req.body.lastname, false)
80
- .then(function (savedUser) {
80
+ .then( async function (savedUser) {
81
81
 
82
82
  winston.debug('-- >> -- >> savedUser ', savedUser.toObject());
83
83
 
@@ -87,6 +87,8 @@ router.post('/signup',
87
87
  let token = req.headers.authorization.split(" ")[1];
88
88
  let decode = jwt.verify(token, pubConfigSecret)
89
89
  if (decode && (decode.email === process.env.ADMIN_EMAIL)) {
90
+ let updatedUser = await User.findByIdAndUpdate(savedUser._id, { emailverified: true }, { new: true }).exec();
91
+ winston.debug("updatedUser: ", updatedUser);
90
92
  skipVerificationEmail = true;
91
93
  winston.verbose("skip sending verification email")
92
94
  }