@xuda.io/notification_module 1.1.107 → 1.1.109
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/index.mjs +5 -4
- package/index_msa.mjs +62 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -13,7 +13,8 @@ global._conf = (
|
|
|
13
13
|
const _common = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.mjs'));
|
|
14
14
|
const module_path = path.join(process.env.XUDA_HOME, 'cpi') + (!_conf.is_debug ? '/node_modules/@xuda.io' : '');
|
|
15
15
|
const db_module = await import(`${module_path}/db_module/index.mjs`);
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
const email_msa = await import(`${module_path}/email_module/index_msa.mjs`);
|
|
17
18
|
|
|
18
19
|
const ws_dashboard_msa = await import(`${module_path}/ws_dashboard_module/index_msa.mjs`);
|
|
19
20
|
|
|
@@ -61,8 +62,8 @@ export const update_notification_status = async (req) => {
|
|
|
61
62
|
});
|
|
62
63
|
return await db_module.save_couch_doc('xuda_notification', notification_doc);
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
-
export const submit_notification = async (req, _ch
|
|
65
|
+
//= global[`_notification_module_ch`]
|
|
66
|
+
export const submit_notification = async (req, _ch) => {
|
|
66
67
|
let { type, app_id, to_app_id, uid_arr, subject = '', body = '', delivery_method = [], display_type = 'info', ref, email, sender_uid, system, topic, params } = req;
|
|
67
68
|
let obj = {};
|
|
68
69
|
const { notification_categories } = await import(path.join(process.env.XUDA_HOME, 'notification_templates.mjs'));
|
|
@@ -143,7 +144,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
|
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
|
|
147
|
+
email_msa.send_email({
|
|
147
148
|
email: obj.email,
|
|
148
149
|
subject,
|
|
149
150
|
body,
|
package/index_msa.mjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// =====================================================
|
|
2
|
+
// Queue wrapper – generated from index.mjs
|
|
3
|
+
// Queue target : notification_module
|
|
4
|
+
// =====================================================
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
|
|
9
|
+
const { MessageBroker } = await import(path.join(process.env.XUDA_HOME, 'common', 'ms_broker.mjs'));
|
|
10
|
+
|
|
11
|
+
const broker = new MessageBroker();
|
|
12
|
+
|
|
13
|
+
await broker.init({
|
|
14
|
+
queueName: 'notification_module',
|
|
15
|
+
module_in: global.module_in
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const get_new_notification_count = function (...args) {
|
|
21
|
+
broker.send_to_queue_async("get_new_notification_count", ...args);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const set_notification_read = function (...args) {
|
|
25
|
+
broker.send_to_queue_async("set_notification_read", ...args);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const update_notification_status = function (...args) {
|
|
29
|
+
broker.send_to_queue_async("update_notification_status", ...args);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const submit_notification = function (...args) {
|
|
33
|
+
broker.send_to_queue_async("submit_notification", ...args);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const get_notifications = function (...args) {
|
|
37
|
+
broker.send_to_queue_async("get_notifications", ...args);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const submit_superuser_notification = function (...args) {
|
|
41
|
+
broker.send_to_queue_async("submit_superuser_notification", ...args);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const submit_app_notification = function (...args) {
|
|
45
|
+
broker.send_to_queue_async("submit_app_notification", ...args);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const update_system_notification = function (...args) {
|
|
49
|
+
broker.send_to_queue_async("update_system_notification", ...args);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const submit_topic_app_notification = function (...args) {
|
|
53
|
+
broker.send_to_queue_async("submit_topic_app_notification", ...args);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const get_system_notifications = function (...args) {
|
|
57
|
+
broker.send_to_queue_async("get_system_notifications", ...args);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const notifications_validation_fx = function (...args) {
|
|
61
|
+
broker.send_to_queue_async("notifications_validation_fx", ...args);
|
|
62
|
+
};
|