@xuda.io/notification_module 1.1.106 → 1.1.108

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 CHANGED
@@ -13,8 +13,10 @@ 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
- const email_ms = await import(`${module_path}/email_module/index_ms.mjs`);
17
- const ws_dashboard_ms = await import(`${module_path}/ws_dashboard_module/index_ms.mjs`);
16
+
17
+ const email_msa = await import(`${module_path}/email_module/index_msa.mjs`);
18
+
19
+ const ws_dashboard_msa = await import(`${module_path}/ws_dashboard_module/index_msa.mjs`);
18
20
 
19
21
  //////////////////// FCM /////////////////////
20
22
  const serviceAccount = _conf.firebase_serviceAccount;
@@ -54,7 +56,7 @@ export const update_notification_status = async (req) => {
54
56
  notification_doc.stat_ts = Date.now();
55
57
  notification_doc.stat = stat;
56
58
 
57
- ws_dashboard_ms.notification({
59
+ ws_dashboard_msa.notification({
58
60
  to: notification_doc.system ? uid : notification_doc.uid,
59
61
  data: notification_doc,
60
62
  });
@@ -142,7 +144,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
142
144
  return;
143
145
  }
144
146
 
145
- email_ms.send_email({
147
+ email_msa.send_email({
146
148
  email: obj.email,
147
149
  subject,
148
150
  body,
@@ -154,7 +156,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
154
156
  case 'banner':
155
157
  case 'consent':
156
158
  case 'alert':
157
- ws_dashboard_ms.notification({
159
+ ws_dashboard_msa.notification({
158
160
  to: uid,
159
161
  data: obj,
160
162
  });
@@ -495,7 +497,7 @@ export const update_system_notification = async (req) => {
495
497
  notification_doc.type = type;
496
498
  }
497
499
 
498
- ws_dashboard_ms.notification({
500
+ ws_dashboard_msa.notification({
499
501
  to: notification_doc.system ? uid : notification_doc.uid,
500
502
  data: notification_doc,
501
503
  });
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/notification_module",
3
- "version": "1.1.106",
3
+ "version": "1.1.108",
4
4
  "description": "Xuda Notification Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {