@tiledesk/tiledesk-server 2.1.41 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/.circleci/config.yml +54 -0
- package/.env.sample +1 -1
- package/.github/workflows/docker-community-push-latest.yml +22 -0
- package/.github/workflows/{docker-image-push.yml → docker-image-en-tag-push.yml} +1 -1
- package/.github/workflows/docker-image-tag-community-tag-push.yml +21 -0
- package/.github/workflows/{docker-push-latest.yml → docker-push-en-push-latest.yml} +1 -1
- package/CHANGELOG.md +198 -1
- package/Dockerfile +1 -1
- package/Dockerfile-en +1 -1
- package/README.md +5 -7
- package/app.js +12 -1
- package/channels/chat21/chat21Contact.js +34 -8
- package/channels/chat21/chat21Handler.js +48 -5
- package/channels/chat21/chat21WebHook.js +34 -5
- package/channels/chat21/nativeauth.js +2 -2
- package/config/email.js +2 -1
- package/config/global.js +3 -0
- package/config/labels/widget.json +170 -16
- package/event/messageEvent.js +18 -1
- package/middleware/passport.js +10 -4
- package/models/actionsConstants.js +7 -0
- package/models/department.js +3 -0
- package/models/faq.js +8 -2
- package/models/faq_kb.js +6 -0
- package/models/message.js +10 -4
- package/models/messageConstants.js +3 -3
- package/models/request.js +33 -3
- package/package.json +31 -28
- package/pubmodules/emailNotification/requestNotification.js +380 -62
- package/pubmodules/messageActions/messageActionsInterceptor.js +20 -7
- package/pubmodules/messageTransformer/index.js +1 -1
- package/pubmodules/messageTransformer/microLanguageAttributesTransformerInterceptor.js +67 -0
- package/pubmodules/pubModulesManager.js +66 -14
- package/pubmodules/rules/conciergeBot.js +81 -49
- package/routes/auth.js +34 -10
- package/routes/campaigns.js +117 -25
- package/routes/faq.js +19 -0
- package/routes/faq_kb.js +13 -4
- package/routes/faqpub.js +1 -1
- package/routes/images.js +1 -1
- package/routes/jwt.js +0 -1
- package/routes/logs.js +26 -0
- package/routes/message.js +7 -2
- package/routes/messagesRoot.js +73 -16
- package/routes/project_user.js +36 -1
- package/routes/request.js +88 -12
- package/routes/requestUtilRoot.js +30 -0
- package/routes/urls.js +12 -0
- package/routes/users.js +5 -1
- package/services/BotSubscriptionNotifier.js +1 -0
- package/services/departmentService.js +29 -5
- package/services/emailService.js +1103 -298
- package/services/faqBotHandler.js +176 -61
- package/services/faqBotSupport.js +181 -117
- package/services/faqService.js +17 -14
- package/services/messageService.js +57 -9
- package/services/modulesManager.js +86 -23
- package/services/requestService.js +58 -17
- package/template/email/assignedEmailMessage.html +205 -0
- package/template/email/assignedRequest.html +44 -14
- package/template/email/beenInvitedExistingUser.html +2 -2
- package/template/email/beenInvitedNewUser.html +1 -1
- package/template/email/newMessage.html +31 -12
- package/template/email/passwordChanged.html +2 -3
- package/template/email/pooledEmailMessage.html +208 -0
- package/template/email/pooledRequest.html +41 -14
- package/template/email/resetPassword.html +2 -3
- package/template/email/sendTranscript.html +1 -1
- package/template/email/test.html +1 -1
- package/template/email/ticket.html +78 -52
- package/template/email/ticket.txt +5 -1
- package/template/email/verify.html +1 -1
- package/test/authentication.js +76 -4
- package/test/authenticationJwt.js +76 -2
- package/test/campaignsRoute.js +226 -0
- package/test/faqService.js +3 -3
- package/test/faqkbRoute.js +3 -2
- package/test/messageRootRoute.js +193 -0
- package/test/messageRoute.js +75 -0
- package/test/messageService.js +5 -5
- package/test/requestRoute.js +27 -9
- package/test/requestService.js +472 -11
- package/test-int/bot.js +673 -8
- package/websocket/webSocketServer.js +7 -4
- package/template/email/ticket-taking.txt +0 -7
@@ -22,6 +22,7 @@ var cacheUtil = require('../utils/cacheUtil');
|
|
22
22
|
var mongoose = require('mongoose');
|
23
23
|
const requestConstants = require("../models/requestConstants");
|
24
24
|
var RoleConstants = require('../models/roleConstants');
|
25
|
+
let configSecret = process.env.GLOBAL_SECRET || config.secret;
|
25
26
|
|
26
27
|
|
27
28
|
|
@@ -70,14 +71,14 @@ class WebSocketServer {
|
|
70
71
|
|
71
72
|
var token = queryParameter.token;
|
72
73
|
winston.debug('token:'+ token);
|
73
|
-
winston.debug('
|
74
|
+
winston.debug('configSecret:'+ configSecret);
|
74
75
|
|
75
76
|
|
76
77
|
if (!token)
|
77
78
|
cb(false, 401, 'Unauthorized');
|
78
79
|
else {
|
79
80
|
token = token.replace('JWT ', '');
|
80
|
-
jwt.verify(token,
|
81
|
+
jwt.verify(token, configSecret, function (err, decoded) {
|
81
82
|
if (err) {
|
82
83
|
winston.error('WebSocket error verifing websocket jwt token ', err);
|
83
84
|
return cb(false, 401, 'Unauthorized');
|
@@ -619,10 +620,11 @@ class WebSocketServer {
|
|
619
620
|
requestJSON.snapshot = {};
|
620
621
|
|
621
622
|
|
623
|
+
|
622
624
|
|
623
625
|
// ATTENTO https://stackoverflow.com/questions/64059795/mongodb-get-error-message-mongoerror-path-collision-at-activity
|
624
626
|
try {
|
625
|
-
var snapshotAgents = await Request.findById(request.id).select({"snapshot
|
627
|
+
var snapshotAgents = await Request.findById(request.id).select({"snapshot":1}).exec(); //SEMBRA CHE RITORNI TUTTO LO SNAPSHOT INVECE CHE SOLO AGENTS
|
626
628
|
winston.debug('snapshotAgents',snapshotAgents);
|
627
629
|
// requestJSON.snapshot.agents = snapshotAgents;
|
628
630
|
|
@@ -665,8 +667,9 @@ class WebSocketServer {
|
|
665
667
|
requestJSON.snapshot = {};
|
666
668
|
|
667
669
|
// ATTENTO https://stackoverflow.com/questions/64059795/mongodb-get-error-message-mongoerror-path-collision-at-activity
|
670
|
+
|
668
671
|
try {
|
669
|
-
var snapshotAgents = await Request.findById(request.id).select({"snapshot
|
672
|
+
var snapshotAgents = await Request.findById(request.id).select({"snapshot":1}).exec(); //SEMBRA CHE RITORNI TUTTO LO SNAPSHOT INVECE CHE SOLO AGENTS
|
670
673
|
winston.debug('snapshotAgents',snapshotAgents);
|
671
674
|
// requestJSON.snapshot.agents = snapshotAgents;
|
672
675
|
|