@tiledesk/tiledesk-server 2.4.16 → 2.4.17
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/channels/chat21/chat21WebHook.js +4 -3
- package/package.json +1 -1
- package/pubmodules/cache/mongoose-cachegoose-fn.js +34 -1
- package/pubmodules/queue/reconnect.js +3 -4
- package/routes/lead.js +50 -0
- package/services/chatbotService.js +1 -1
- package/template/email/assignedEmailMessage.html +1 -1
- package/template/email/assignedRequest.html +1 -1
- package/template/email/beenInvitedExistingUser.html +1 -1
- package/template/email/beenInvitedNewUser.html +6 -6
- package/template/email/emailDirect.html +1 -1
- package/template/email/newMessage.html +1 -1
- package/template/email/newMessageFollower.html +1 -1
- package/template/email/passwordChanged.html +6 -6
- package/template/email/pooledEmailMessage.html +1 -1
- package/template/email/pooledRequest.html +1 -1
- package/template/email/resetPassword.html +1 -1
- package/template/email/sendTranscript.html +1 -1
- package/template/email/ticket.html +1 -1
- package/template/email/verify.html +1 -1
@@ -25,7 +25,7 @@ if (process.env.SYNC_JOIN_LEAVE_GROUP_EVENT === true || process.env.SYNC_JOIN_LE
|
|
25
25
|
}
|
26
26
|
winston.info("Chat21 Sync JoinAndLeave Support Group Event: " + syncJoinAndLeaveGroupEvent);
|
27
27
|
|
28
|
-
var allowReopenChat = false;
|
28
|
+
var allowReopenChat = false; //It's work only with firebase chat engine
|
29
29
|
if (process.env.ALLOW_REOPEN_CHAT === true || process.env.ALLOW_REOPEN_CHAT ==="true") {
|
30
30
|
allowReopenChat = true;
|
31
31
|
}
|
@@ -305,10 +305,11 @@ router.post('/', function (req, res) {
|
|
305
305
|
|
306
306
|
// return requestService.incrementMessagesCountByRequestId(request.request_id, request.id_project).then(function(savedRequest) {
|
307
307
|
// winston.debug("savedRequest.participants.indexOf(message.sender)", savedRequest.participants.indexOf(message.sender));
|
308
|
-
|
308
|
+
winston.info("before updateWaitingTimeByRequestId*******",request.participants, message.sender);
|
309
|
+
winston.info("updateWaitingTimeByRequestId******* message: "+ message.sender);
|
309
310
|
// TODO it doesn't work for internal requests bacause participanets == message.sender⁄
|
310
311
|
if (request.participants && request.participants.indexOf(message.sender) > -1) { //update waiitng time if write an agent (member of participants)
|
311
|
-
winston.
|
312
|
+
winston.info("updateWaitingTimeByRequestId*******");
|
312
313
|
return requestService.updateWaitingTimeByRequestId(request.request_id, request.id_project, false).then(function(upRequest) {
|
313
314
|
return res.json(upRequest);
|
314
315
|
});
|
package/package.json
CHANGED
@@ -286,6 +286,32 @@
|
|
286
286
|
})
|
287
287
|
});
|
288
288
|
|
289
|
+
function invalidatRequestSimple(client, project_id, rid, request_id) {
|
290
|
+
var key = project_id+":requests:id:"+rid+":simple";
|
291
|
+
winston.verbose("Deleting cache for widgets with key: " + key);
|
292
|
+
client.del(key, function (err, reply) {
|
293
|
+
winston.debug("Deleted cache for invalidatRequestSimple",reply);
|
294
|
+
winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
|
295
|
+
});
|
296
|
+
|
297
|
+
key = "requests:request_id:"+request_id+":simple"; //without project for chat21 webhook
|
298
|
+
winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple without project with key : " + key);
|
299
|
+
client.del(key, function (err, reply) {
|
300
|
+
winston.debug("Deleted cache for invalidatRequestSimple",reply);
|
301
|
+
winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
|
302
|
+
});
|
303
|
+
|
304
|
+
key = project_id+":requests:request_id:"+request_id+":simple";
|
305
|
+
winston.verbose("Creating cache for request.create.simple for invalidatRequestSimple with key: " + key);
|
306
|
+
client.del(key, function (err, reply) {
|
307
|
+
winston.debug("Deleted cache for invalidatRequestSimple",reply);
|
308
|
+
winston.verbose("Deleted cache for invalidatRequestSimple",{err:err});
|
309
|
+
});
|
310
|
+
|
311
|
+
|
312
|
+
}
|
313
|
+
|
314
|
+
|
289
315
|
requestEvent.on("request.create", function(request) {
|
290
316
|
setImmediate(() => {
|
291
317
|
var key = request.id_project+":requests:id:"+request.id;
|
@@ -310,6 +336,7 @@
|
|
310
336
|
winston.debug("Deleted cache for request.create",reply);
|
311
337
|
winston.verbose("Deleted cache for request.create",{err:err});
|
312
338
|
});
|
339
|
+
|
313
340
|
});
|
314
341
|
});
|
315
342
|
|
@@ -338,6 +365,9 @@
|
|
338
365
|
winston.debug("Deleted cache for request.update",reply);
|
339
366
|
winston.verbose("Deleted cache for request.update",{err:err});
|
340
367
|
});
|
368
|
+
|
369
|
+
invalidatRequestSimple(client, request.id_project, request.id, request.request_id)
|
370
|
+
|
341
371
|
});
|
342
372
|
});
|
343
373
|
|
@@ -365,6 +395,9 @@
|
|
365
395
|
winston.debug("Deleted cache for request.close",reply);
|
366
396
|
winston.verbose("Deleted cache for request.close",{err:err});
|
367
397
|
});
|
398
|
+
|
399
|
+
invalidatRequestSimple(client, request.id_project, request.id, request.request_id)
|
400
|
+
|
368
401
|
});
|
369
402
|
});
|
370
403
|
|
@@ -727,7 +760,7 @@
|
|
727
760
|
}
|
728
761
|
|
729
762
|
function invalidateWidgets(client, project_id) {
|
730
|
-
key = project_id+":widgets";
|
763
|
+
let key = project_id+":widgets";
|
731
764
|
winston.verbose("Deleting cache for widgets with key: " + key);
|
732
765
|
client.del(key, function (err, reply) {
|
733
766
|
winston.debug("Deleted cache for widgets",reply);
|
@@ -19,17 +19,16 @@ var durable = false;
|
|
19
19
|
if (process.env.ENABLE_DURABLE_QUEUE == true || process.env.ENABLE_DURABLE_QUEUE == "true") {
|
20
20
|
durable = true;
|
21
21
|
}
|
22
|
-
winston.info("Durable queue: " + durable);
|
23
22
|
|
24
23
|
var persistent = false;
|
25
24
|
if (process.env.ENABLE_PERSISTENT_QUEUE == true || process.env.ENABLE_PERSISTENT_QUEUE == "true") {
|
26
25
|
persistent = true;
|
27
26
|
}
|
28
|
-
winston.info("Persistent queue: " + persistent);
|
29
27
|
|
28
|
+
var exchange = process.env.QUEUE_EXCHANGE_TOPIC || 'amq.topic';
|
30
29
|
|
30
|
+
winston.info("Durable queue: " + durable + " Persistent queue: " + persistent + " Exchange topic: " + exchange);
|
31
31
|
|
32
|
-
var exchange = 'amq.topic';
|
33
32
|
|
34
33
|
function start() {
|
35
34
|
amqp.connect(url, function(err, conn) {
|
@@ -251,7 +250,7 @@ function work(msg, cb) {
|
|
251
250
|
}
|
252
251
|
|
253
252
|
if (topic === 'faqbot_update') {
|
254
|
-
winston.
|
253
|
+
winston.debug("reconnect here topic faqbot_update:" + topic);
|
255
254
|
// requestEvent.emit('request.update.queue', msg.content);
|
256
255
|
botEvent.emit('faqbot.update.queue', JSON.parse(message_string));
|
257
256
|
}
|
package/routes/lead.js
CHANGED
@@ -148,6 +148,56 @@ router.patch('/:leadid/attributes', function (req, res) {
|
|
148
148
|
});
|
149
149
|
|
150
150
|
|
151
|
+
//.post and .patch for /properties are equals
|
152
|
+
|
153
|
+
router.post('/:leadid/properties', function (req, res) {
|
154
|
+
var data = req.body;
|
155
|
+
|
156
|
+
// TODO use service method
|
157
|
+
|
158
|
+
Lead.findById(req.params.leadid, function (err, lead) {
|
159
|
+
if (err) {
|
160
|
+
winston.error('--- > ERROR ', err);
|
161
|
+
return res.status(500).send({ success: false, msg: 'Error updating object.' });
|
162
|
+
}
|
163
|
+
|
164
|
+
if (!lead) {
|
165
|
+
return res.status(404).send({ success: false, msg: 'Object not found.' });
|
166
|
+
}
|
167
|
+
|
168
|
+
if (!lead.properties) {
|
169
|
+
winston.debug("empty properties")
|
170
|
+
lead.properties = {};
|
171
|
+
}
|
172
|
+
|
173
|
+
winston.debug(" lead properties", lead.properties)
|
174
|
+
|
175
|
+
Object.keys(data).forEach(function(key) {
|
176
|
+
var val = data[key];
|
177
|
+
winston.debug("data attributes "+key+" " +val)
|
178
|
+
lead.properties[key] = val;
|
179
|
+
});
|
180
|
+
|
181
|
+
winston.debug(" lead properties", lead.properties)
|
182
|
+
|
183
|
+
// https://stackoverflow.com/questions/24054552/mongoose-not-saving-nested-object
|
184
|
+
lead.markModified('properties');
|
185
|
+
|
186
|
+
//cacheinvalidation
|
187
|
+
lead.save(function (err, savedLead) {
|
188
|
+
if (err) {
|
189
|
+
winston.error("error saving lead properties",err)
|
190
|
+
return res.status(500).send({ success: false, msg: 'Error getting object.' });
|
191
|
+
}
|
192
|
+
winston.verbose(" saved lead properties",savedLead.toObject())
|
193
|
+
leadEvent.emit('lead.update', savedLead);
|
194
|
+
|
195
|
+
res.json(savedLead);
|
196
|
+
});
|
197
|
+
});
|
198
|
+
|
199
|
+
});
|
200
|
+
|
151
201
|
|
152
202
|
router.patch('/:leadid/properties', function (req, res) {
|
153
203
|
var data = req.body;
|
@@ -277,7 +277,7 @@
|
|
277
277
|
<span>Powered by </span>
|
278
278
|
<span style="display: flex;"><img
|
279
279
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
280
|
-
height="15" style="margin-left: 6px;" /></span>
|
280
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
281
281
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
282
282
|
</div>
|
283
283
|
|
@@ -269,7 +269,7 @@
|
|
269
269
|
<span>Powered by </span>
|
270
270
|
<span style="display: flex;"><img
|
271
271
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png"
|
272
|
-
width="15" height="15" style="margin-left: 6px;" /></span>
|
272
|
+
width="15" height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
273
273
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
274
274
|
</div>
|
275
275
|
|
@@ -191,7 +191,7 @@
|
|
191
191
|
<span>Powered by </span>
|
192
192
|
<span style="display: flex;"><img
|
193
193
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
194
|
-
height="15" style="margin-left: 6px;" /></span>
|
194
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
195
195
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
196
196
|
</div>
|
197
197
|
|
@@ -190,12 +190,12 @@
|
|
190
190
|
<hr style="width:94%;height:1px;border:none;background-color: #cacaca;">
|
191
191
|
|
192
192
|
<div style="display: flex; padding: 20px 18px; color: #888888; align-items: center;">
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
193
|
+
<span>Powered by </span>
|
194
|
+
<span style="display: flex;"><img
|
195
|
+
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png"
|
196
|
+
width="15" height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
197
|
+
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
198
|
+
</div>
|
199
199
|
|
200
200
|
</td>
|
201
201
|
</tr>
|
@@ -184,7 +184,7 @@
|
|
184
184
|
<span>Powered by </span>
|
185
185
|
<span style="display: flex;"><img
|
186
186
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
187
|
-
height="15" style="margin-left: 6px;" /></span>
|
187
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
188
188
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
189
189
|
</div>
|
190
190
|
|
@@ -244,7 +244,7 @@
|
|
244
244
|
<span>Powered by </span>
|
245
245
|
<span style="display: flex;"><img
|
246
246
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
247
|
-
height="15" style="margin-left: 6px;" /></span>
|
247
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
248
248
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
249
249
|
</div>
|
250
250
|
|
@@ -333,7 +333,7 @@
|
|
333
333
|
<span>Powered by </span>
|
334
334
|
<span style="display: flex;"><img
|
335
335
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
336
|
-
height="15" style="margin-left: 6px;" /></span>
|
336
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
337
337
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
338
338
|
</div>
|
339
339
|
|
@@ -181,12 +181,12 @@
|
|
181
181
|
<hr style="width:94%;height:1px;border:none;background-color: #cacaca;">
|
182
182
|
|
183
183
|
<div style="display: flex; padding: 20px 18px; color: #888888; align-items: center;">
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
184
|
+
<span>Powered by </span>
|
185
|
+
<span style="display: flex;"><img
|
186
|
+
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png"
|
187
|
+
width="15" height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
188
|
+
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
189
|
+
</div>
|
190
190
|
|
191
191
|
</td>
|
192
192
|
</tr>
|
@@ -272,7 +272,7 @@
|
|
272
272
|
<span>Powered by </span>
|
273
273
|
<span style="display: flex;"><img
|
274
274
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png"
|
275
|
-
width="15" height="15" style="margin-left: 6px;" /></span>
|
275
|
+
width="15" height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
276
276
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
277
277
|
</div>
|
278
278
|
|
@@ -269,7 +269,7 @@
|
|
269
269
|
<span>Powered by </span>
|
270
270
|
<span style="display: flex;"><img
|
271
271
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
272
|
-
height="15" style="margin-left: 6px;" /></span>
|
272
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
273
273
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
274
274
|
</div>
|
275
275
|
|
@@ -191,7 +191,7 @@
|
|
191
191
|
<span>Powered by </span>
|
192
192
|
<span style="display: flex;"><img
|
193
193
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
194
|
-
height="15" style="margin-left: 6px;" /></span>
|
194
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
195
195
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
196
196
|
</div>
|
197
197
|
|
@@ -263,7 +263,7 @@
|
|
263
263
|
<span>Powered by </span>
|
264
264
|
<span style="display: flex;"><img
|
265
265
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
266
|
-
height="15" style="margin-left: 6px;" /></span>
|
266
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
267
267
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
268
268
|
</div>
|
269
269
|
|
@@ -268,7 +268,7 @@
|
|
268
268
|
<span>Powered by </span>
|
269
269
|
<span style="display: flex;"><img
|
270
270
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
271
|
-
height="15" style="margin-left: 6px;" /></span>
|
271
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
272
272
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
273
273
|
</div>
|
274
274
|
|
@@ -187,7 +187,7 @@
|
|
187
187
|
<span>Powered by </span>
|
188
188
|
<span style="display: flex;"><img
|
189
189
|
src="https://tiledesk.com/wp-content/uploads/2023/05/tiledesk-solo_logo_new_gray.png" width="15"
|
190
|
-
height="15" style="margin-left: 6px;" /></span>
|
190
|
+
height="15" style="margin-left: 6px; margin-top: 2px;" /></span>
|
191
191
|
<span style="font-weight: bold; margin-left: 2px;">Tiledesk</span>
|
192
192
|
</div>
|
193
193
|
|