rez_core 2.2.187 → 2.2.188
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/dist/module/communication/controller/communication.controller.d.ts +2 -12
- package/dist/module/communication/controller/communication.controller.js +2 -16
- package/dist/module/communication/controller/communication.controller.js.map +1 -1
- package/dist/module/communication/dto/create-config.dto.d.ts +0 -12
- package/dist/module/communication/dto/create-config.dto.js +1 -36
- package/dist/module/communication/dto/create-config.dto.js.map +1 -1
- package/dist/module/communication/service/communication.service.js +0 -1
- package/dist/module/communication/service/communication.service.js.map +1 -1
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.d.ts +0 -8
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.js +0 -52
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.js.map +1 -1
- package/dist/module/listmaster/service/list-master.service.js +4 -2
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/module/notification/controller/notification.controller.d.ts +1 -5
- package/dist/module/notification/controller/notification.controller.js +3 -16
- package/dist/module/notification/controller/notification.controller.js.map +1 -1
- package/dist/module/notification/service/notification.service.d.ts +1 -7
- package/dist/module/notification/service/notification.service.js +12 -27
- package/dist/module/notification/service/notification.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/communication/controller/communication.controller.ts +1 -12
- package/src/module/communication/dto/create-config.dto.ts +0 -26
- package/src/module/communication/service/communication.service.ts +0 -1
- package/src/module/communication/strategies/email/sendgrid-api.strategy.ts +0 -65
- package/src/module/listmaster/service/list-master.service.ts +6 -3
- package/src/module/notification/controller/notification.controller.ts +3 -21
- package/src/module/notification/service/notification.service.ts +20 -45
- package/src/module/workflow/service/task.service.ts +1 -1
|
@@ -42,14 +42,9 @@ let NotificationsService = class NotificationsService {
|
|
|
42
42
|
return { error: 'No token found for user' };
|
|
43
43
|
return this.sendToDevice(token, title, body);
|
|
44
44
|
}
|
|
45
|
-
async getAllNotifications(loggedInUser
|
|
45
|
+
async getAllNotifications(loggedInUser) {
|
|
46
46
|
const { id, level_id, level_type } = loggedInUser;
|
|
47
|
-
|
|
48
|
-
if (filterQuery && filterQuery.is_read !== undefined) {
|
|
49
|
-
const isReadBool = String(filterQuery.is_read).toLowerCase() === 'true';
|
|
50
|
-
isReadFilter = isReadBool ? 1 : 0;
|
|
51
|
-
}
|
|
52
|
-
let query = `
|
|
47
|
+
const notifications = await this.dataSource.query(`
|
|
53
48
|
SELECT
|
|
54
49
|
n.*,
|
|
55
50
|
u.name AS user_name,
|
|
@@ -57,17 +52,11 @@ let NotificationsService = class NotificationsService {
|
|
|
57
52
|
FROM cr_notification n
|
|
58
53
|
LEFT JOIN eth_user_profile u ON n.user_id = u.parent_id
|
|
59
54
|
WHERE n.user_id = ? AND n.level_id = ? AND n.level_type = ?
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (isReadFilter !== undefined) {
|
|
63
|
-
query += ` AND n.is_read = ?`;
|
|
64
|
-
params.push(isReadFilter);
|
|
65
|
-
}
|
|
66
|
-
query += ` ORDER BY n.created_date DESC`;
|
|
67
|
-
const notifications = await this.dataSource.query(query, params);
|
|
55
|
+
ORDER BY n.created_date DESC
|
|
56
|
+
`, [id, level_id, 'SCH']);
|
|
68
57
|
const mediaCache = new Map();
|
|
69
58
|
for (const notification of notifications) {
|
|
70
|
-
notification.is_read =
|
|
59
|
+
notification.is_read = true;
|
|
71
60
|
if (notification.user_profile) {
|
|
72
61
|
if (!mediaCache.has(notification.user_profile)) {
|
|
73
62
|
const url = await this.mediaDataService.getMediaDownloadUrl(notification.user_profile, loggedInUser);
|
|
@@ -79,19 +68,15 @@ let NotificationsService = class NotificationsService {
|
|
|
79
68
|
notification.user_profile = null;
|
|
80
69
|
}
|
|
81
70
|
}
|
|
71
|
+
if (notifications.length > 0) {
|
|
72
|
+
await this.dataSource.query(`
|
|
73
|
+
UPDATE cr_notification
|
|
74
|
+
SET is_read = 1
|
|
75
|
+
WHERE user_id = ? AND level_id = ? AND level_type = ?
|
|
76
|
+
`, [id, level_id, level_type]);
|
|
77
|
+
}
|
|
82
78
|
return notifications;
|
|
83
79
|
}
|
|
84
|
-
async markAllAsRead(loggedInUser) {
|
|
85
|
-
const { id, level_id, level_type } = loggedInUser;
|
|
86
|
-
const query = `
|
|
87
|
-
UPDATE cr_notification
|
|
88
|
-
SET is_read = 1
|
|
89
|
-
WHERE user_id = ? AND level_id = ? AND level_type = ? AND is_read = 0
|
|
90
|
-
`;
|
|
91
|
-
const params = [id, level_id, level_type];
|
|
92
|
-
const result = await this.dataSource.query(query, params);
|
|
93
|
-
return { success: true, affectedRows: result.affectedRows || 0 };
|
|
94
|
-
}
|
|
95
80
|
};
|
|
96
81
|
exports.NotificationsService = NotificationsService;
|
|
97
82
|
exports.NotificationsService = NotificationsService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../../src/module/notification/service/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qCAAqC;AACrC,8EAA8E;AAIvE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,UAAsB,EACtB,gBAAkC,EACzB,aAA4C;QAFrD,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;QACR,kBAAa,GAAb,aAAa,CAAc;QAGhE,WAAM,GAAwB,IAAI,GAAG,EAAE,CAAC;IAF7C,CAAC;IAIJ,KAAK,CAAC,SAAS,CAAC,MAA0B,EAAE,KAAa;QACvD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAa,EAAE,KAAa,EAAE,IAAY;QAC3D,MAAM,OAAO,GAAG;YACd,KAAK;YACL,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;SAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAGD,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,KAAa,EAAE,IAAY;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC;QAExD,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../../src/module/notification/service/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,qCAAqC;AACrC,8EAA8E;AAIvE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,UAAsB,EACtB,gBAAkC,EACzB,aAA4C;QAFrD,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;QACR,kBAAa,GAAb,aAAa,CAAc;QAGhE,WAAM,GAAwB,IAAI,GAAG,EAAE,CAAC;IAF7C,CAAC;IAIJ,KAAK,CAAC,SAAS,CAAC,MAA0B,EAAE,KAAa;QACvD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAa,EAAE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C;gBACD,YAAY,CAAC,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACxE,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;YACnC,CAAC;QACH,CAAC;QAGD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CACzB;;;;OAID,EACC,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,CAC3B,CAAC;QACJ,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AAnFY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,gBAAgB,CAAC,CAAA;qCAFI,oBAAU;QACJ,qCAAgB;GAH1C,oBAAoB,CAmFhC"}
|
|
@@ -310,7 +310,7 @@ let TaskService = class TaskService extends entity_service_impl_service_1.Entity
|
|
|
310
310
|
};
|
|
311
311
|
exports.TaskService = TaskService;
|
|
312
312
|
__decorate([
|
|
313
|
-
(0, schedule_1.Cron)(schedule_1.CronExpression.
|
|
313
|
+
(0, schedule_1.Cron)(schedule_1.CronExpression.EVERY_30_SECONDS),
|
|
314
314
|
__metadata("design:type", Function),
|
|
315
315
|
__metadata("design:paramtypes", []),
|
|
316
316
|
__metadata("design:returntype", Promise)
|