@tiledesk/tiledesk-server 2.3.14 → 2.3.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/CHANGELOG.md
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
# 2.3.
|
1
|
+
# 2.3.17 -> PROD
|
2
|
+
- Webhook chat21 fix return
|
3
|
+
|
4
|
+
# 2.3.16
|
5
|
+
- Request close activity added as event
|
6
|
+
- Log fix webhook chat21
|
7
|
+
|
8
|
+
# 2.3.15
|
9
|
+
- Endpoint Widget fix undefined project.widget
|
10
|
+
|
11
|
+
# 2.3.14
|
2
12
|
- Added ip filter with Deny roles and ban User roles
|
3
13
|
- Ban notifier
|
4
14
|
- Middleware decodeJwt before passport with passport fallback
|
@@ -210,7 +210,7 @@ router.post('/', function (req, res) {
|
|
210
210
|
departmentid:departmentid, sourcePage:sourcePage, language:language, userAgent:client, status:requestStatus, createdBy: undefined,
|
211
211
|
attributes:rAttributes, subject:undefined, preflight:false, channel:undefined, location:undefined,
|
212
212
|
lead:createdLead, requester:project_user
|
213
|
-
|
213
|
+
|
214
214
|
};
|
215
215
|
|
216
216
|
winston.debug("new_request", new_request);
|
@@ -296,18 +296,19 @@ router.post('/', function (req, res) {
|
|
296
296
|
// TODO it doesn't work for internal requests bacause participanets == message.sender⁄
|
297
297
|
if (request.participants && request.participants.indexOf(message.sender) > -1) { //update waiitng time if write an agent (member of participants)
|
298
298
|
winston.debug("updateWaitingTimeByRequestId");
|
299
|
+
|
299
300
|
return requestService.updateWaitingTimeByRequestId(request.request_id, request.id_project).then(function(upRequest) {
|
300
301
|
return res.json(upRequest);
|
301
302
|
});
|
302
303
|
}else {
|
303
|
-
|
304
|
+
|
305
|
+
return res.json(savedMessage);
|
304
306
|
}
|
305
307
|
// });
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
});
|
308
|
+
}).catch(function(err){
|
309
|
+
winston.error("Error creating chat21 webhook message: "+ JSON.stringify({err: err, message: message}));
|
310
|
+
return res.status(500).send({success: false, msg: 'Error creating message', err:err });
|
311
|
+
});
|
311
312
|
|
312
313
|
|
313
314
|
|
@@ -568,6 +569,8 @@ router.post('/', function (req, res) {
|
|
568
569
|
return res.status(400).send({success: false, msg: "not a support conversation" });
|
569
570
|
}
|
570
571
|
|
572
|
+
|
573
|
+
|
571
574
|
if (user_id!="system"){
|
572
575
|
winston.debug("not a system conversation");
|
573
576
|
return res.status(400).send({success: false, msg: "not a system conversation" });
|
package/package.json
CHANGED
@@ -76,7 +76,6 @@ class ActivityArchiver {
|
|
76
76
|
|
77
77
|
authEvent.on('project_user.update', function(event) {
|
78
78
|
setImmediate(() => {
|
79
|
-
// console.log("project_user.update");
|
80
79
|
/*
|
81
80
|
2019-11-20T10:40:52.686991+00:00 app[web.1]: TypeError: Cannot read property '_id' of undefined
|
82
81
|
*/
|
@@ -272,6 +271,26 @@ class ActivityArchiver {
|
|
272
271
|
});
|
273
272
|
|
274
273
|
|
274
|
+
requestEvent.on('request.close', function(request) {
|
275
|
+
setImmediate(() => {
|
276
|
+
|
277
|
+
try {
|
278
|
+
winston.error('ActivityArchiver close');
|
279
|
+
|
280
|
+
var activity = new Activity({actor: {type:"user", id: request.closed_by},
|
281
|
+
verb: "REQUEST_CLOSE", actionObj: request,
|
282
|
+
target: {type:"request", id:request._id, object: request },
|
283
|
+
id_project: request.id_project });
|
284
|
+
that.save(activity);
|
285
|
+
} catch(e) {
|
286
|
+
winston.error('ActivityArchiver error saving activity',e);
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
});
|
291
|
+
});
|
292
|
+
|
293
|
+
|
275
294
|
|
276
295
|
|
277
296
|
winston.info('ActivityArchiver listening');
|
package/routes/widget.js
CHANGED
@@ -146,8 +146,12 @@ router.get('/', function(req, res, next) {
|
|
146
146
|
//secondo me qui manca un parentesi tonda per gli or
|
147
147
|
if (project && project.profile && ((project.profile.type === 'free' && project.trialExpired === true) || (project.profile.type === 'payment' && project.isActiveSubscription === false))) {
|
148
148
|
winston.debug('getProject remove poweredBy tag', project);
|
149
|
-
|
150
|
-
project.widget
|
149
|
+
|
150
|
+
if (project.widget) {
|
151
|
+
project.widget.poweredBy = undefined;
|
152
|
+
project.widget.baloonImage = undefined;
|
153
|
+
}
|
154
|
+
|
151
155
|
}
|
152
156
|
|
153
157
|
return resolve(project);
|