@tiledesk/tiledesk-server 2.3.20 → 2.3.22
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +52 -10
- package/package.json +3 -3
- package/pubmodules/cache/index.js +2 -0
- package/pubmodules/cache/mongoose-cachegoose-fn.js +505 -0
- package/pubmodules/canned/cannedResponseRoute.js +0 -1
- package/pubmodules/events/eventRoute.js +15 -23
- package/pubmodules/pubModulesManager.js +15 -0
- package/routes/request.js +5 -0
- package/services/modulesManager.js +12 -12
- package/template/email/assignedEmailMessage.html +2 -1
- package/template/email/assignedRequest.html +2 -1
- package/template/email/beenInvitedExistingUser.html +2 -1
- package/template/email/beenInvitedNewUser.html +2 -1
- package/template/email/newMessage.html +2 -1
- package/template/email/newMessageFollower.html +2 -1
- package/template/email/passwordChanged.html +2 -1
- package/template/email/pooledEmailMessage.html +2 -1
- package/template/email/pooledRequest.html +2 -1
- package/template/email/resetPassword.html +2 -1
- package/template/email/sendTranscript.html +2 -1
- package/template/email/ticket.html +2 -1
- package/test/cannedRoute.js +0 -9
- package/test/messageRoute.js +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,62 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
|
2
|
+
|
3
|
+
# 2.3.21
|
4
|
+
- filter request by smartAssignment
|
5
|
+
|
6
|
+
# 2.3.20
|
7
|
+
- Performance: Removed populate for message.update messages. This event is not used by anyone.
|
8
|
+
|
9
|
+
# 2.3.19
|
10
|
+
- Moved queue module to public module
|
11
|
+
- Moved route-queue to public module
|
12
|
+
- Disable queue module if JOB_WORKER_ENABLED is true
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
💥 TILEDESK SERVER v2.3.18 💥
|
17
|
+
🚀 TAGGED AND PUBLISHED ON NPM 🚀
|
18
|
+
🚀 IN PRODUCTION 🚀
|
19
|
+
(https://www.npmjs.com/package/@tiledesk/tiledesk-server/v/2.3.17)
|
20
|
+
|
21
|
+
# 2.3.18 -> PROD
|
22
|
+
- Added profileStatus field to the project_user model
|
23
|
+
- Added smartAssignment field to the request model
|
24
|
+
- Canned responses default limit value increased from 40 to 1000
|
25
|
+
- Now you change channel name from REST endpoint
|
26
|
+
- New Tybot 0.1.5
|
27
|
+
- GeoService setImmediate added
|
28
|
+
- Websocket setImmediate and topic validation
|
29
|
+
- Do not trigger requestNotification send email method for preflight request
|
30
|
+
- Removed deprecated .count with .countDocument
|
31
|
+
- Added workingStatus to request model
|
32
|
+
- Changed Anonymous signin from Guest to guest#shortuid
|
33
|
+
- Updated chat21/chat21-node-sdk to 1.1.7. Now group parameter is supported.
|
34
|
+
- Moved queue module to public modules folder
|
35
|
+
- Created JobManager and Job runner files
|
36
|
+
- Now activity archiver module uses queue engine
|
37
|
+
- Now geoService uses queue engine
|
38
|
+
- Added GEO_SERVICE_ENABLED to enable disable ip lookup to latitude and longitude
|
39
|
+
- Added EMAIL_NOTIFICATION_ENABLED to enable disable email notification
|
40
|
+
|
41
|
+
|
42
|
+
# 2.3.17
|
43
|
+
- Webhook chat21 fix
|
44
|
+
- Chat21 Cloud Function: when an agent leaves a conversation an info message is sent to notify it to the visitor
|
3
45
|
|
4
46
|
# 2.3.16
|
5
|
-
- Request close activity added as event
|
6
|
-
- Log fix webhook chat21
|
47
|
+
- Request close activity added as event. Now you can see from the Activity menu who has closed the conversation and when.
|
48
|
+
- Log fix for webhook chat21
|
7
49
|
|
8
50
|
# 2.3.15
|
9
|
-
- Endpoint Widget fix undefined project.widget
|
51
|
+
- BugFix: Endpoint Widget fix for undefined of the project.widget object
|
10
52
|
|
11
53
|
# 2.3.14
|
12
54
|
- Added ip filter with Deny roles and ban User roles
|
13
|
-
- Ban notifier
|
14
|
-
- Middleware decodeJwt before passport with passport fallback
|
15
|
-
- Removed unused requestService.incrementMessagesCountByRequestId from chat21Webhook
|
16
|
-
-
|
17
|
-
-
|
55
|
+
- Ban notifier module
|
56
|
+
- Created a new Middleware decodeJwt before passport with passport fallback
|
57
|
+
- Removed unused requestService.incrementMessagesCountByRequestId code from chat21Webhook
|
58
|
+
- Allow agents to manage groups endpoint
|
59
|
+
- Embedded the new Tilebot chat server
|
18
60
|
|
19
61
|
# 2.3.13
|
20
62
|
- Getting ip fix
|
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.
|
4
|
+
"version": "2.3.22",
|
5
5
|
"scripts": {
|
6
6
|
"start": "node ./bin/www",
|
7
7
|
"pretest": "mongodb-runner start",
|
@@ -29,7 +29,6 @@
|
|
29
29
|
"tiledesk-server": "./bin/www"
|
30
30
|
},
|
31
31
|
"optionalDependencies": {
|
32
|
-
"@tiledesk-ent/tiledesk-server-cache": "^1.1.10",
|
33
32
|
"@tiledesk-ent/tiledesk-server-dialogflow": "^1.1.6",
|
34
33
|
"@tiledesk-ent/tiledesk-server-jwthistory": "^1.1.9",
|
35
34
|
"@tiledesk-ent/tiledesk-server-payments": "^1.1.6",
|
@@ -42,10 +41,11 @@
|
|
42
41
|
"@tiledesk/tiledesk-chatbot-util": "^0.8.33",
|
43
42
|
"@tiledesk/tiledesk-json-rules-engine": "^4.0.3",
|
44
43
|
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
|
45
|
-
"@tiledesk/tiledesk-tybot-connector": "^0.1.
|
44
|
+
"@tiledesk/tiledesk-tybot-connector": "^0.1.8",
|
46
45
|
"app-root-path": "^3.0.0",
|
47
46
|
"bcrypt-nodejs": "0.0.3",
|
48
47
|
"body-parser": "^1.20.0",
|
48
|
+
"cachegoose": "^8.0.0",
|
49
49
|
"cookie-parser": "^1.4.6",
|
50
50
|
"cors": "^2.8.5",
|
51
51
|
"csv-express": "^1.2.2",
|
@@ -0,0 +1,505 @@
|
|
1
|
+
var requestEvent = require("../../event/requestEvent");
|
2
|
+
var messageEvent = require("../../event/messageEvent");
|
3
|
+
var projectEvent = require("../../event/projectEvent");
|
4
|
+
var botEvent = require("../../event/botEvent");
|
5
|
+
var departmentEvent = require("../../event/departmentEvent");
|
6
|
+
var authEvent = require("../../event/authEvent");
|
7
|
+
var labelEvent = require("../../event/labelEvent");
|
8
|
+
|
9
|
+
// var subscriptionEvent = require("");
|
10
|
+
|
11
|
+
var winston = require('../../config/winston');
|
12
|
+
|
13
|
+
var cachegoose = require('cachegoose');
|
14
|
+
|
15
|
+
var defaultTTL = process.env.CACHE_DEFAULT_TTL || 120;
|
16
|
+
|
17
|
+
|
18
|
+
function listen(client) {
|
19
|
+
|
20
|
+
projectEvent.on("project.create", function(project) {
|
21
|
+
setImmediate(() => {
|
22
|
+
var key = "projects:id:"+project.id;
|
23
|
+
winston.verbose("Creating cache for project.create with key: " + key);
|
24
|
+
client.set(key, project, defaultTTL, (err, reply) => {
|
25
|
+
winston.verbose("Created cache for project.create",{err:err});
|
26
|
+
winston.debug("Created cache for project.create reply",reply);
|
27
|
+
});
|
28
|
+
|
29
|
+
key = "projects:query:*";
|
30
|
+
winston.verbose("Deleting cache for project.create with key: " + key);
|
31
|
+
client.del(key, function (err, reply) {
|
32
|
+
winston.verbose("Deleted cache for project.create",{err:err});
|
33
|
+
winston.debug("Deleted cache for project.create",reply);
|
34
|
+
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
projectEvent.on("project.update", function(project) {
|
40
|
+
setImmediate(() => {
|
41
|
+
var key = "projects:id:"+project.id;
|
42
|
+
winston.verbose("Updating cache for project.update with key: " + key);
|
43
|
+
client.set(key, project, defaultTTL, (err, reply) => {
|
44
|
+
winston.verbose("Updated cache for project.update",{err:err});
|
45
|
+
winston.debug("Updated cache for project.update",reply);
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
key = "projects:query:*";
|
50
|
+
winston.verbose("Deleting cache for project.create with key: " + key);
|
51
|
+
client.del(key, function (err, reply) {
|
52
|
+
winston.debug("Deleted cache for project.create",reply);
|
53
|
+
winston.verbose("Deleted cache for project.create",{err:err});
|
54
|
+
});
|
55
|
+
});
|
56
|
+
|
57
|
+
});
|
58
|
+
|
59
|
+
projectEvent.on("project.delete", function(project) {
|
60
|
+
setImmediate(() => {
|
61
|
+
var key = "projects:id:"+project.id;
|
62
|
+
winston.verbose("Deleting cache for project.delete with key: " + key);
|
63
|
+
client.del(key, (err, reply) => {
|
64
|
+
winston.debug("Deleted cache for project.delete",reply);
|
65
|
+
winston.verbose("Deleted cache for project.delete",{err:err});
|
66
|
+
});
|
67
|
+
|
68
|
+
key = "projects:query:*";
|
69
|
+
winston.verbose("Deleting cache for project.create with key: " + key);
|
70
|
+
client.del(key, function (err, reply) {
|
71
|
+
winston.debug("Deleted cache for project.create",reply);
|
72
|
+
winston.verbose("Deleted cache for project.create",{err:err});
|
73
|
+
});
|
74
|
+
});
|
75
|
+
});
|
76
|
+
|
77
|
+
projectEvent.on("project.downgrade", function(project) {
|
78
|
+
setImmediate(() => {
|
79
|
+
var key = "projects:id:"+project.id;
|
80
|
+
winston.verbose("Updating cache for project.downgrade with key: " + key);
|
81
|
+
|
82
|
+
client.set(key, project, defaultTTL, (err, reply) => {
|
83
|
+
winston.debug("Updated cache for project.downgrade",reply);
|
84
|
+
winston.verbose("Updated cache for project.downgrade",{err:err});
|
85
|
+
});
|
86
|
+
|
87
|
+
key = "projects:query:*";
|
88
|
+
winston.verbose("Deleting cache for project.create with key: " + key);
|
89
|
+
client.del(key, function (err, reply) {
|
90
|
+
winston.debug("Deleted cache for project.create",reply);
|
91
|
+
winston.verbose("Deleted cache for project.create",{err:err});
|
92
|
+
});
|
93
|
+
});
|
94
|
+
});
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
authEvent.on('project_user.update', function(data) {
|
102
|
+
setImmediate(() => {
|
103
|
+
|
104
|
+
var project_user = data.updatedProject_userPopulated;
|
105
|
+
|
106
|
+
var key = project_user.id_project+":project_users:id:"+project_user.id;
|
107
|
+
winston.verbose("Updating cache for project_user.update with key: " + key);
|
108
|
+
client.set(key, project_user, defaultTTL, (err, reply) => {
|
109
|
+
winston.debug("Updated cache for project_user.update",reply);
|
110
|
+
winston.verbose("Updated cache for project_user.update",{err:err});
|
111
|
+
});
|
112
|
+
|
113
|
+
var role = project_user.role;
|
114
|
+
|
115
|
+
var TEAMMATE_ROLES = {
|
116
|
+
"agent": ["guest","user","agent"],
|
117
|
+
"admin": ["guest","user","agent", "admin",],
|
118
|
+
"owner": ["guest","user","agent", "admin", "owner"],
|
119
|
+
}
|
120
|
+
// controllare bene
|
121
|
+
|
122
|
+
var hierarchicalRoles = TEAMMATE_ROLES[role];
|
123
|
+
winston.debug("hierarchicalRoles", hierarchicalRoles);
|
124
|
+
|
125
|
+
if ( hierarchicalRoles && hierarchicalRoles.includes(role)) {
|
126
|
+
|
127
|
+
var key = project_user.id_project+":project_users:role:teammate:"+project_user.id;
|
128
|
+
winston.verbose("Updating cache for project_user.update with key: " + key);
|
129
|
+
client.set(key, project_user, defaultTTL, (err, reply) => {
|
130
|
+
winston.debug("Updated cache for project_user.update",reply);
|
131
|
+
winston.verbose("Updated cache for project_user.update",{err:err});
|
132
|
+
});
|
133
|
+
}
|
134
|
+
});
|
135
|
+
});
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
authEvent.on('user.signup', function(data) {
|
142
|
+
setImmediate(() => {
|
143
|
+
var user = data.savedUser;
|
144
|
+
|
145
|
+
var key = "users:id:"+user.id;
|
146
|
+
winston.verbose("Creating cache for user.signup with key: " + key);
|
147
|
+
client.set(key, user, defaultTTL, (err, reply) => {
|
148
|
+
winston.debug("Created cache for user.signup",reply);
|
149
|
+
winston.verbose("Created cache for user.signup",{err:err});
|
150
|
+
});
|
151
|
+
|
152
|
+
var key = "users:email:"+user.email;
|
153
|
+
winston.verbose("Creating cache for user.signup with key: " + key);
|
154
|
+
client.set(key, user, defaultTTL, (err, reply) => {
|
155
|
+
winston.debug("Created cache for user.signup",reply);
|
156
|
+
winston.verbose("Created cache for user.signup",{err:err});
|
157
|
+
});
|
158
|
+
});
|
159
|
+
});
|
160
|
+
|
161
|
+
|
162
|
+
authEvent.on('user.update', function(data) {
|
163
|
+
setImmediate(() => {
|
164
|
+
var user = data.updatedUser;
|
165
|
+
|
166
|
+
var key = "users:id:"+user.id;
|
167
|
+
winston.verbose("Updating cache for user.update with key: " + key);
|
168
|
+
client.set(key, user, defaultTTL, (err, reply) => {
|
169
|
+
winston.debug("Updated cache for user.update",reply);
|
170
|
+
winston.verbose("Updated cache for user.update",{err:err});
|
171
|
+
});
|
172
|
+
|
173
|
+
var key = "users:email:"+user.email;
|
174
|
+
winston.verbose("Updating cache for user.update with key: " + key);
|
175
|
+
client.set(key, user, defaultTTL, (err, reply) => {
|
176
|
+
winston.debug("Updated cache for user.update",reply);
|
177
|
+
winston.verbose("Updated cache for user.update",{err:err});
|
178
|
+
});
|
179
|
+
});
|
180
|
+
});
|
181
|
+
|
182
|
+
authEvent.on('user.delete', function(data) {
|
183
|
+
setImmediate(() => {
|
184
|
+
var user = data.user;
|
185
|
+
|
186
|
+
var key = "users:id:"+user.id;
|
187
|
+
winston.verbose("Deleting cache for user.delete with key: " + key);
|
188
|
+
client.del(key, (err, reply) => {
|
189
|
+
winston.debug("Deleted cache for user.delete",reply);
|
190
|
+
winston.verbose("Deleted cache for user.delete",{err:err});
|
191
|
+
});
|
192
|
+
|
193
|
+
var key = "users:email:"+user.email;
|
194
|
+
winston.verbose("Deleting cache for user.delete with key: " + key);
|
195
|
+
client.del(key, (err, reply) => {
|
196
|
+
winston.debug("Deleted cache for user.delete",reply);
|
197
|
+
winston.verbose("Deleted cache for user.delete",{err:err});
|
198
|
+
});
|
199
|
+
});
|
200
|
+
});
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
requestEvent.on("request.create", function(request) {
|
206
|
+
setImmediate(() => {
|
207
|
+
var key = request.id_project+":requests:id:"+request.id;
|
208
|
+
winston.verbose("Creating cache for request.create with key: " + key);
|
209
|
+
|
210
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
211
|
+
winston.debug("Created cache for request.create",reply);
|
212
|
+
winston.verbose("Created cache for request.create",{err:err});
|
213
|
+
});
|
214
|
+
|
215
|
+
var key = request.id_project+":requests:request_id:"+request.request_id;
|
216
|
+
winston.verbose("Creating cache for request.create with key: " + key);
|
217
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
218
|
+
winston.debug("Created cache for request.create",reply);
|
219
|
+
winston.verbose("Created cache for request.create",{err:err});
|
220
|
+
});
|
221
|
+
|
222
|
+
key = request.id_project+":requests:query:*";
|
223
|
+
winston.verbose("Deleting cache for request.create with key: " + key);
|
224
|
+
client.del(key, function (err, reply) {
|
225
|
+
winston.debug("Deleted cache for request.create",reply);
|
226
|
+
winston.verbose("Deleted cache for request.create",{err:err});
|
227
|
+
});
|
228
|
+
});
|
229
|
+
});
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
requestEvent.on("request.update", function(request) {
|
234
|
+
setImmediate(() => {
|
235
|
+
var key = request.id_project+":requests:id:"+request.id;
|
236
|
+
winston.verbose("Creating cache for request.update with key: " + key);
|
237
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
238
|
+
winston.debug("Created cache for request.update",reply);
|
239
|
+
winston.verbose("Created cache for request.update",{err:err});
|
240
|
+
});
|
241
|
+
|
242
|
+
var key = request.id_project+":requests:request_id:"+request.request_id;
|
243
|
+
winston.verbose("Creating cache for request.update with key: " + key);
|
244
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
245
|
+
winston.debug("Created cache for request.update",reply);
|
246
|
+
winston.verbose("Created cache for request.update",{err:err});
|
247
|
+
});
|
248
|
+
|
249
|
+
key = request.id_project+":requests:query:*";
|
250
|
+
winston.verbose("Deleting cache for request.create with key: " + key);
|
251
|
+
client.del(key, function (err, reply) {
|
252
|
+
winston.debug("Deleted cache for request.create",reply);
|
253
|
+
winston.verbose("Deleted cache for request.create",{err:err});
|
254
|
+
});
|
255
|
+
});
|
256
|
+
});
|
257
|
+
|
258
|
+
|
259
|
+
requestEvent.on("request.close", function(request) {
|
260
|
+
setImmediate(() => {
|
261
|
+
var key = request.id_project+":requests:id:"+request.id;
|
262
|
+
winston.verbose("Creating cache for request.close with key: " + key);
|
263
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
264
|
+
winston.debug("Created cache for request.close",reply);
|
265
|
+
winston.verbose("Created cache for request.close",{err:err});
|
266
|
+
});
|
267
|
+
|
268
|
+
var key = request.id_project+":requests:request_id:"+request.request_id;
|
269
|
+
winston.verbose("Creating cache for request.close with key: " + key);
|
270
|
+
client.set(key, request, defaultTTL, (err, reply) => {
|
271
|
+
winston.debug("Created cache for request.close",reply);
|
272
|
+
winston.verbose("Created cache for request.close",{err:err});
|
273
|
+
});
|
274
|
+
|
275
|
+
key = request.id_project+":requests:query:*";
|
276
|
+
winston.verbose("Deleting cache for request.create with key: " + key);
|
277
|
+
client.del(key, function (err, reply) {
|
278
|
+
winston.debug("Deleted cache for request.create",reply);
|
279
|
+
winston.verbose("Deleted cache for request.create",{err:err});
|
280
|
+
});
|
281
|
+
});
|
282
|
+
});
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
// non serve tanto
|
288
|
+
// messageEvent.on("message.create", function(message) {
|
289
|
+
// setImmediate(() => {
|
290
|
+
// var key = message.id_project+":requests:id:"+message.request._id + ":messages:id:" + message._id;
|
291
|
+
// winston.verbose("Creating cache for message.create with key: " + key);
|
292
|
+
// client.set(key, message, defaultTTL, (err, reply) => {
|
293
|
+
// winston.verbose("Created cache for message.create",{err:err, reply:reply});
|
294
|
+
// });
|
295
|
+
|
296
|
+
// var key = message.id_project+":requests:request_id:"+message.request.request_id + ":messages:id:" + message._id;
|
297
|
+
// winston.verbose("Creating cache for message.create with key: " + key);
|
298
|
+
// client.set(key, message, defaultTTL, (err, reply) => {
|
299
|
+
// winston.verbose("Created cache for message.create",{err:err, reply:reply});
|
300
|
+
// });
|
301
|
+
// });
|
302
|
+
// });
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
botEvent.on("faqbot.create", function(faq_kb) {
|
307
|
+
setImmediate(() => {
|
308
|
+
var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
|
309
|
+
winston.verbose("Creating cache for faq_kb.create with key: " + key);
|
310
|
+
client.set(key, faq_kb, defaultTTL, (err, reply) => {
|
311
|
+
winston.debug("Created cache for faq_kb.create",reply);
|
312
|
+
winston.verbose("Created cache for faq_kb.create",{err:err});
|
313
|
+
});
|
314
|
+
});
|
315
|
+
});
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
botEvent.on("faqbot.update", function(faq_kb) {
|
320
|
+
setImmediate(() => {
|
321
|
+
var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
|
322
|
+
winston.verbose("Creating cache for faq_kb.update with key: " + key);
|
323
|
+
client.set(key, faq_kb, defaultTTL, (err, reply) => {
|
324
|
+
winston.debug("Created cache for faq_kb.create",reply);
|
325
|
+
winston.verbose("Created cache for faq_kb.update",{err:err});
|
326
|
+
});
|
327
|
+
});
|
328
|
+
});
|
329
|
+
|
330
|
+
|
331
|
+
botEvent.on("faqbot.delete", function(faq_kb) {
|
332
|
+
setImmediate(() => {
|
333
|
+
var key = faq_kb.id_project+":faq_kbs:id:"+faq_kb._id;
|
334
|
+
winston.verbose("Creating cache for faqbot.delete with key: " + key);
|
335
|
+
client.set(key, faq_kb, defaultTTL, (err, reply) => {
|
336
|
+
winston.debug("Created cache for faqbot.delete",reply);
|
337
|
+
winston.verbose("Created cache for faqbot.delete",{err:err});
|
338
|
+
});
|
339
|
+
});
|
340
|
+
});
|
341
|
+
|
342
|
+
|
343
|
+
departmentEvent.on("department.create", function(department) {
|
344
|
+
setImmediate(() => {
|
345
|
+
var key = department.id_project+":departments:id:"+department._id;
|
346
|
+
winston.verbose("Creating cache for department.create with key: " + key);
|
347
|
+
client.set(key, department, defaultTTL, (err, reply) => {
|
348
|
+
winston.debug("Created cache for department.create",reply);
|
349
|
+
winston.verbose("Created cache for department.create",{err:err});
|
350
|
+
});
|
351
|
+
|
352
|
+
key = department.id_project+":departments:query:*";
|
353
|
+
winston.verbose("Deleting cache for department.create with key: " + key);
|
354
|
+
client.del(key, function (err, reply) {
|
355
|
+
winston.debug("Deleted cache for department.create",reply);
|
356
|
+
winston.verbose("Deleted cache for department.create",{err:err});
|
357
|
+
});
|
358
|
+
});
|
359
|
+
});
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
departmentEvent.on("department.update", function(department) {
|
364
|
+
setImmediate(() => {
|
365
|
+
var key = department.id_project+":departments:id:"+department._id;
|
366
|
+
winston.verbose("Creating cache for department.update with key: " + key);
|
367
|
+
client.set(key, department, defaultTTL, (err, reply) => {
|
368
|
+
winston.debug("Created cache for department.update",reply);
|
369
|
+
winston.verbose("Created cache for department.update",{err:err});
|
370
|
+
});
|
371
|
+
|
372
|
+
key = department.id_project+":departments:query:*";
|
373
|
+
winston.verbose("Deleting cache for department.update with key: " + key);
|
374
|
+
client.del(key, function (err, reply) {
|
375
|
+
winston.debug("Deleted cache for department.update",reply);
|
376
|
+
winston.verbose("Deleted cache for department.update",{err:err});
|
377
|
+
});
|
378
|
+
});
|
379
|
+
});
|
380
|
+
|
381
|
+
|
382
|
+
departmentEvent.on("department.delete", function(department) {
|
383
|
+
setImmediate(() => {
|
384
|
+
var key = department.id_project+":departments:id:"+department._id;
|
385
|
+
winston.verbose("Creating cache for department.delete with key: " + key);
|
386
|
+
client.set(key, department, defaultTTL, (err, reply) => {
|
387
|
+
winston.debug("Created cache for department.delete",reply);
|
388
|
+
winston.verbose("Created cache for department.delete",{err:err});
|
389
|
+
});
|
390
|
+
|
391
|
+
key = department.id_project+":departments:query:*";
|
392
|
+
winston.verbose("Deleting cache for department.delete with key: " + key);
|
393
|
+
client.del(key, function (err, reply) {
|
394
|
+
winston.debug("Deleted cache for department.delete",reply);
|
395
|
+
winston.verbose("Deleted cache for department.delete",{err:err});
|
396
|
+
});
|
397
|
+
});
|
398
|
+
});
|
399
|
+
|
400
|
+
|
401
|
+
labelEvent.on("label.create", function(label) {
|
402
|
+
setImmediate(() => {
|
403
|
+
var key = label.id_project+":labels:query:*";
|
404
|
+
winston.verbose("Deleting cache for label.create with key: " + key);
|
405
|
+
client.del(key, function (err, reply) {
|
406
|
+
winston.debug("Deleted cache for label.create",reply);
|
407
|
+
winston.verbose("Deleted cache for label.create",{err:err});
|
408
|
+
});
|
409
|
+
});
|
410
|
+
});
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
labelEvent.on("label.update", function(label) {
|
415
|
+
setImmediate(() => {
|
416
|
+
var key = label.id_project+":labels:query:*";
|
417
|
+
winston.verbose("Deleting cache for label.update with key: " + key);
|
418
|
+
client.del(key, function (err, reply) {
|
419
|
+
winston.debug("Deleted cache for label.update",reply);
|
420
|
+
winston.verbose("Deleted cache for label.update",{err:err});
|
421
|
+
});
|
422
|
+
});
|
423
|
+
});
|
424
|
+
|
425
|
+
|
426
|
+
labelEvent.on("label.clone", function(label) {
|
427
|
+
setImmediate(() => {
|
428
|
+
var key = label.id_project+":labels:query:*";
|
429
|
+
winston.verbose("Deleting cache for label.clone with key: " + key);
|
430
|
+
client.del(key, function (err, reply) {
|
431
|
+
winston.debug("Deleted cache for label.clone",reply);
|
432
|
+
winston.verbose("Deleted cache for label.clone",{err:err});
|
433
|
+
});
|
434
|
+
});
|
435
|
+
});
|
436
|
+
|
437
|
+
|
438
|
+
labelEvent.on("label.delete", function(label) {
|
439
|
+
setImmediate(() => {
|
440
|
+
var key = label.id_project+":labels:query:*";
|
441
|
+
winston.verbose("Deleting cache for label.delete with key: " + key);
|
442
|
+
client.del(key, function (err, reply) {
|
443
|
+
winston.debug("Deleted cache for label.delete",reply);
|
444
|
+
winston.verbose("Deleted cache for label.delete",{err:err});
|
445
|
+
});
|
446
|
+
});
|
447
|
+
});
|
448
|
+
|
449
|
+
// fai cache per subscription.create, .update .delete
|
450
|
+
|
451
|
+
// fai cache per trigger.create, .update .delete
|
452
|
+
|
453
|
+
//jwt
|
454
|
+
|
455
|
+
// fai cache faq
|
456
|
+
|
457
|
+
}
|
458
|
+
|
459
|
+
module.exports = function (mongoose, option) {
|
460
|
+
|
461
|
+
if (process.env.CACHE_ENABLED == "true") {
|
462
|
+
var engine = process.env.CACHE_ENGINE;
|
463
|
+
winston.debug("Redis engine: "+ engine);
|
464
|
+
|
465
|
+
// var endPoint = process.env.CACHE_REDIS_ENDPOINT || "redis://127.0.0.1:6379";
|
466
|
+
// winston.debug("Redis endpoint: "+ endPoint);
|
467
|
+
|
468
|
+
var port = process.env.CACHE_REDIS_PORT || 6379;
|
469
|
+
winston.debug("Redis port: "+ port);
|
470
|
+
|
471
|
+
var host = process.env.CACHE_REDIS_HOST || "127.0.0.1"
|
472
|
+
winston.debug("Redis host: "+ host);
|
473
|
+
|
474
|
+
var password = process.env.CACHE_REDIS_PASSWORD;
|
475
|
+
winston.debug("Redis password: "+ password);
|
476
|
+
|
477
|
+
winston.info("Mongoose Cachegoose fn initialized, engine: " + engine + ", port: "+ port + ", host: "+ host + " defaultTTL: " +defaultTTL + ", password: "+ password);
|
478
|
+
// winston.info("Mongoose Cachegoose fn initialized, engine: " + engine + ", endpoint: "+endPoint +", port: "+ port + ", host: "+ host + ", password: "+ password);
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
// cachegoose(mongoose, endPoint);
|
484
|
+
|
485
|
+
cachegoose(mongoose, {
|
486
|
+
engine: engine, /* If you don't specify the redis engine, */
|
487
|
+
port: port, /* the query results will be cached in memory. */
|
488
|
+
host: host,
|
489
|
+
password: password
|
490
|
+
});
|
491
|
+
|
492
|
+
var client = cachegoose._cache;
|
493
|
+
listen(client);
|
494
|
+
}else {
|
495
|
+
winston.info("Mongoose Cachegoose disabled");
|
496
|
+
}
|
497
|
+
|
498
|
+
// console.log("init",init);
|
499
|
+
// console.log("cachegoose._cache",cachegoose._cache);
|
500
|
+
// cachegoose._cache.get("/projects/5ea800091147f28c72b90c5e", (err, cachedResults) => { //
|
501
|
+
// console.log("cachedResults",cachedResults);
|
502
|
+
// });
|
503
|
+
|
504
|
+
|
505
|
+
}
|
@@ -121,7 +121,6 @@ router.get('/', function (req, res) {
|
|
121
121
|
winston.debug('CannedResponse ROUTE - SKIP PAGE ', skip);
|
122
122
|
|
123
123
|
// var query = { "id_project": req.projectid, "status": {$lt:1000}};
|
124
|
-
console.log("canned_req.user: ", req.user);
|
125
124
|
var query = {"id_project": req.projectid, "status": { $lt:1000 }, $or:[ { shared: true }, { createdBy: req.user._id } ] }
|
126
125
|
|
127
126
|
if (req.query.full_text) {
|
@@ -39,8 +39,10 @@ router.post('/', [
|
|
39
39
|
pu = req.projectuser.id
|
40
40
|
}
|
41
41
|
|
42
|
-
console.log("************* emit event"+new Date().toISOString());
|
43
42
|
|
43
|
+
|
44
|
+
// // da qui
|
45
|
+
// console.log("************* emit event"+new Date().toISOString());
|
44
46
|
// // message.senderFullname, message.recipient,
|
45
47
|
// // message.recipient_fullname, message.text, message.sender, attributes, message.type, message.metadata, timestamp, message.group
|
46
48
|
// var recipient = req.body.attributes.request_id;
|
@@ -48,8 +50,7 @@ router.post('/', [
|
|
48
50
|
// var sender = req.user.id;
|
49
51
|
// console.log("sender",sender);
|
50
52
|
|
51
|
-
//
|
52
|
-
// {
|
53
|
+
// let message = {
|
53
54
|
// recipient: recipient,
|
54
55
|
// recipient_fullname: "pluto",
|
55
56
|
// // sender:"bb0d809b-b093-419b-8b48-11a192cc3619",
|
@@ -59,14 +60,21 @@ router.post('/', [
|
|
59
60
|
// group: {
|
60
61
|
// members: {
|
61
62
|
// // "bb0d809b-b093-419b-8b48-11a192cc3619": 1,
|
62
|
-
// sender: 1
|
63
|
+
// // sender: 1
|
63
64
|
|
64
65
|
// }
|
65
66
|
// }
|
66
|
-
// }
|
67
|
-
//
|
67
|
+
// };
|
68
|
+
// message.group.members[sender]= 1;
|
69
|
+
// console.log("message", message)
|
70
|
+
|
71
|
+
// messageEvent.emit("message.test", message);
|
72
|
+
// res.json({"event":"1"});
|
73
|
+
|
74
|
+
// //fino qui
|
68
75
|
|
69
|
-
|
76
|
+
|
77
|
+
// // emit(name, attributes, id_project, project_user, createdBy, status, user) {
|
70
78
|
eventService.emit(req.body.name, req.body.attributes, req.projectid, pu, req.user.id, undefined, req.user).then(function(event) {
|
71
79
|
|
72
80
|
res.json(event);
|
@@ -75,22 +83,6 @@ router.post('/', [
|
|
75
83
|
return res.status(500).send({success: false, msg: 'Error saving the event '+ JSON.stringify(event)});
|
76
84
|
});
|
77
85
|
|
78
|
-
// var newEvent = new Event({
|
79
|
-
// name: req.body.name,
|
80
|
-
// attributes: req.body.attributes,
|
81
|
-
// id_project: req.projectid,
|
82
|
-
// createdBy: req.user.id,
|
83
|
-
// updatedBy: req.user.id
|
84
|
-
// });
|
85
|
-
|
86
|
-
// newEvent.save(function(err, savedEvent) {
|
87
|
-
// if (err) {
|
88
|
-
// winston.error('Error saving the event '+ JSON.stringify(savedEvent), err)
|
89
|
-
// return res.status(500).send({success: false, msg: 'Error saving the event '+ JSON.stringify(savedEvent)});
|
90
|
-
// }
|
91
|
-
|
92
|
-
// res.json(savedEvent);
|
93
|
-
// });
|
94
86
|
});
|
95
87
|
|
96
88
|
|
@@ -39,6 +39,8 @@ class PubModulesManager {
|
|
39
39
|
this.jobsManager = undefined;
|
40
40
|
|
41
41
|
this.routingQueue = undefined;
|
42
|
+
|
43
|
+
this.cache = undefined;
|
42
44
|
}
|
43
45
|
|
44
46
|
|
@@ -321,6 +323,19 @@ class PubModulesManager {
|
|
321
323
|
}
|
322
324
|
|
323
325
|
|
326
|
+
try {
|
327
|
+
this.cache = require('./cache').cachegoose(config.mongoose);
|
328
|
+
winston.debug("this.cache:"+ this.cache);
|
329
|
+
winston.info("PubModulesManager cache initialized");
|
330
|
+
} catch(err) {
|
331
|
+
if (err.code == 'MODULE_NOT_FOUND') {
|
332
|
+
winston.info("PubModulesManager init cache module not found");
|
333
|
+
}else {
|
334
|
+
winston.error("PubModulesManager error initializing init cache module", err);
|
335
|
+
}
|
336
|
+
}
|
337
|
+
|
338
|
+
|
324
339
|
}
|
325
340
|
|
326
341
|
start() {
|
package/routes/request.js
CHANGED
@@ -900,6 +900,11 @@ router.get('/', function (req, res, next) {
|
|
900
900
|
winston.debug('REQUEST ROUTE - QUERY snap_lead_email', query.snap_lead_email);
|
901
901
|
}
|
902
902
|
|
903
|
+
if (req.query.smartAssignment) {
|
904
|
+
query.smartAssignment = req.query.smartAssignment;
|
905
|
+
winston.debug('REQUEST ROUTE - QUERY smartAssignment', query.smartAssignment);
|
906
|
+
}
|
907
|
+
|
903
908
|
if (req.query.channel) {
|
904
909
|
if (req.query.channel === "offline") {
|
905
910
|
query["channel.name"] = {"$in" : ["email", "form"]}
|
@@ -41,7 +41,7 @@ class ModulesManager {
|
|
41
41
|
this.requestHistoryRoute = undefined;
|
42
42
|
// this.routingQueue = undefined;
|
43
43
|
// this.queue = undefined;
|
44
|
-
this.cache = undefined;
|
44
|
+
// this.cache = undefined;
|
45
45
|
this.visitorCounterRoute = undefined;
|
46
46
|
this.visitorCounterMiddleware = undefined;
|
47
47
|
this.widgetsRoute = undefined;
|
@@ -247,17 +247,17 @@ class ModulesManager {
|
|
247
247
|
// }
|
248
248
|
|
249
249
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
250
|
+
// try {
|
251
|
+
// this.cache = require('@tiledesk-ent/tiledesk-server-cache').cachegoose(config.mongoose);
|
252
|
+
// winston.debug("this.cache:"+ this.cache);
|
253
|
+
// winston.info("ModulesManager cache initialized");
|
254
|
+
// } catch(err) {
|
255
|
+
// if (err.code == 'MODULE_NOT_FOUND') {
|
256
|
+
// winston.info("ModulesManager init cache module not found");
|
257
|
+
// }else {
|
258
|
+
// winston.error("ModulesManager error initializing init cache module", err);
|
259
|
+
// }
|
260
|
+
// }
|
261
261
|
|
262
262
|
|
263
263
|
|
@@ -82,7 +82,8 @@
|
|
82
82
|
|
83
83
|
<div style="text-align:center">
|
84
84
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
|
85
|
+
<!--<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">-->
|
86
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
86
87
|
</a>
|
87
88
|
</div>
|
88
89
|
</tr>
|
@@ -82,7 +82,8 @@
|
|
82
82
|
|
83
83
|
<div style="text-align:center">
|
84
84
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
85
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
86
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
86
87
|
</a>
|
87
88
|
</div>
|
88
89
|
</tr>
|
@@ -72,7 +72,8 @@
|
|
72
72
|
|
73
73
|
<div style="text-align:center">
|
74
74
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
75
|
-
<img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
|
75
|
+
<!-- <img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd"> -->
|
76
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
76
77
|
</a>
|
77
78
|
</div>
|
78
79
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
|
@@ -73,7 +73,8 @@
|
|
73
73
|
|
74
74
|
<div style="text-align:center">
|
75
75
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
76
|
-
<img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
|
76
|
+
<!-- <img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd"> -->
|
77
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
77
78
|
</a>
|
78
79
|
</div>
|
79
80
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
|
@@ -80,7 +80,8 @@
|
|
80
80
|
|
81
81
|
<div style="text-align:center">
|
82
82
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
83
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
83
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
84
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
84
85
|
</a>
|
85
86
|
</div>
|
86
87
|
</tr>
|
@@ -75,7 +75,8 @@
|
|
75
75
|
|
76
76
|
<div style="text-align:center">
|
77
77
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
78
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
79
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
79
80
|
</a>
|
80
81
|
</div>
|
81
82
|
</td>
|
@@ -72,7 +72,8 @@
|
|
72
72
|
|
73
73
|
<div style="text-align:center">
|
74
74
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
75
|
-
|
75
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd"> -->
|
76
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
76
77
|
</a>
|
77
78
|
</div>
|
78
79
|
<table class="main" width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;" bgcolor="#fff">
|
@@ -82,7 +82,8 @@
|
|
82
82
|
|
83
83
|
<div style="text-align:center">
|
84
84
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
85
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:10%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
86
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
86
87
|
</a>
|
87
88
|
</div>
|
88
89
|
</tr>
|
@@ -82,7 +82,8 @@
|
|
82
82
|
|
83
83
|
<div style="text-align:center">
|
84
84
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
|
85
|
+
<!--<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="max-width:250px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">-->
|
86
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
86
87
|
</a>
|
87
88
|
</div>
|
88
89
|
</tr>
|
@@ -71,7 +71,8 @@
|
|
71
71
|
|
72
72
|
<div style="text-align:center">
|
73
73
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
74
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd">
|
74
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:50%;outline:none;text-decoration:none;border:none;" class="CToWUd"> -->
|
75
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
75
76
|
</a>
|
76
77
|
</div>
|
77
78
|
|
@@ -75,7 +75,8 @@
|
|
75
75
|
|
76
76
|
<div style="text-align:center">
|
77
77
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
|
-
<img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
78
|
+
<!-- <img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
79
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
79
80
|
</a>
|
80
81
|
</div>
|
81
82
|
</tr>
|
@@ -75,7 +75,8 @@
|
|
75
75
|
|
76
76
|
<div style="text-align:center">
|
77
77
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd">
|
78
|
+
<!-- <img src="https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v2.png" style="width:20%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
79
|
+
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
79
80
|
</a>
|
80
81
|
</div>
|
81
82
|
</td>
|
package/test/cannedRoute.js
CHANGED
@@ -32,7 +32,6 @@ describe('CannedRoute', () => {
|
|
32
32
|
.set('content-type', 'application/json')
|
33
33
|
.send({ "title": "Test Title", "text": "Test Text" })
|
34
34
|
.end((err, res) => {
|
35
|
-
console.log("res.body", res.body);
|
36
35
|
res.should.have.status(200);
|
37
36
|
res.body.should.be.a('object');
|
38
37
|
res.body.should.have.property('title').eql("Test Title");
|
@@ -53,7 +52,6 @@ describe('CannedRoute', () => {
|
|
53
52
|
userService.signup(email, pwd, "Test Firstname", "Test Lastname").then(savedUser => {
|
54
53
|
projectService.create("test1", savedUser._id).then(savedProject => {
|
55
54
|
|
56
|
-
console.log("RoleConstants.AGENT: ", RoleConstants.AGENT);
|
57
55
|
Project_user.findOneAndUpdate({id_project: savedProject._id, id_user: savedUser._id }, { role: RoleConstants.AGENT }, function(err, savedProject_user){
|
58
56
|
chai.request(server)
|
59
57
|
.post('/' + savedProject._id + '/canned/')
|
@@ -61,7 +59,6 @@ describe('CannedRoute', () => {
|
|
61
59
|
.set('content-type', 'application/json')
|
62
60
|
.send({ title: "Test Title", text: "Test Text" })
|
63
61
|
.end((err, res) => {
|
64
|
-
console.log("res.body", res.body);
|
65
62
|
res.body.should.be.a('object');
|
66
63
|
res.body.should.have.property('title').eql("Test Title");
|
67
64
|
res.body.should.have.property('text').eql("Test Text");
|
@@ -92,7 +89,6 @@ describe('CannedRoute', () => {
|
|
92
89
|
.set('content-type', 'application/json')
|
93
90
|
.send({ email: email_agent, role: "agent", userAvailable: false })
|
94
91
|
.end((err, res) => {
|
95
|
-
console.log("res.boy", res.body)
|
96
92
|
res.should.have.status(200);
|
97
93
|
|
98
94
|
|
@@ -103,7 +99,6 @@ describe('CannedRoute', () => {
|
|
103
99
|
.send({ title: "Test1 Title", text: "Test1 Text" })
|
104
100
|
.end((err, res) => {
|
105
101
|
|
106
|
-
console.log("res.body", res.body);
|
107
102
|
res.should.have.status(200);
|
108
103
|
res.body.should.be.a('object');
|
109
104
|
|
@@ -114,7 +109,6 @@ describe('CannedRoute', () => {
|
|
114
109
|
.send({ title: "Test2 Title", text: "Test2 Text" })
|
115
110
|
.end((err, res) => {
|
116
111
|
|
117
|
-
console.log("res.body", res.body);
|
118
112
|
res.should.have.status(200);
|
119
113
|
res.body.should.be.a('object');
|
120
114
|
|
@@ -125,7 +119,6 @@ describe('CannedRoute', () => {
|
|
125
119
|
.send()
|
126
120
|
.end((err, res) => {
|
127
121
|
|
128
|
-
console.log("res.body", res.body);
|
129
122
|
res.should.have.status(200);
|
130
123
|
//res.body.should.be.a('array');
|
131
124
|
|
@@ -139,8 +132,6 @@ describe('CannedRoute', () => {
|
|
139
132
|
.send()
|
140
133
|
.end((err, res) => {
|
141
134
|
|
142
|
-
console.log("res.body", res.body);
|
143
|
-
console.log("\n --> body.length", res.body.length);
|
144
135
|
res.should.have.status(200);
|
145
136
|
//res.body.should.be.a('array');
|
146
137
|
|
package/test/messageRoute.js
CHANGED
@@ -1016,7 +1016,7 @@ describe('/SendMessageSigninAnonym', () => {
|
|
1016
1016
|
var userId = res.body.user._id;
|
1017
1017
|
expect(res.body.success).to.equal(true);
|
1018
1018
|
expect(res.body.user.email).to.equal(undefined);
|
1019
|
-
expect(res.body.user.firstname).to.
|
1019
|
+
expect(res.body.user.firstname).to.contains("guest#"); // guest_here
|
1020
1020
|
|
1021
1021
|
expect(res.body.token).to.not.equal(undefined);
|
1022
1022
|
|
@@ -1065,7 +1065,7 @@ describe('/SendMessageSigninAnonym', () => {
|
|
1065
1065
|
console.log("res.body", res.body);
|
1066
1066
|
expect(res.body.lead.lead_id).to.equal(userId);
|
1067
1067
|
expect(res.body.lead.email).to.equal(undefined);
|
1068
|
-
expect(res.body.lead.fullname).to.
|
1068
|
+
expect(res.body.lead.fullname).to.contains("guest#"); // guest_here
|
1069
1069
|
expect(res.body.requester.role).to.equal("guest");
|
1070
1070
|
expect(res.body.requester.uuid_user).to.equal(userId);
|
1071
1071
|
expect(res.body.requester.id_user).to.equal(undefined);
|