@xuda.io/notification_module 1.1.86 → 1.1.88

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.
Files changed (2) hide show
  1. package/index.mjs +5 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -11,9 +11,9 @@ const require = createRequire(import.meta.url);
11
11
  // Load Globals
12
12
  global._conf = require(path.join(process.env.XUDA_HOME, process.env.XUDA_CONFIG));
13
13
 
14
- const _common = require(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.mjs'));
14
+ const _common = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.mjs'));
15
15
  const module_path = path.join(process.env.XUDA_HOME, 'cpi') + (!_conf.is_debug ? '/node_modules/@xuda.io' : '');
16
- const db_module = require(`${module_path}/db_module`);
16
+ const db_module = await import(`${module_path}/db_module`);
17
17
 
18
18
  //////////////////// FCM /////////////////////
19
19
  const serviceAccount = _conf.firebase_serviceAccount;
@@ -149,7 +149,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
149
149
  send_result[uid] = false;
150
150
  return;
151
151
  }
152
- const email_module = require(`${module_path}/email_module`);
152
+ const email_module = await import(`${module_path}/email_module`);
153
153
  email_module.send_email({
154
154
  email: obj.email,
155
155
  subject,
@@ -455,7 +455,7 @@ export const submit_app_notification = async (req) => {
455
455
  }
456
456
  }
457
457
 
458
- const app_module = require(`${module_path}/app_module`);
458
+ const app_module = await import(`${module_path}/app_module`);
459
459
  const users_arr = (
460
460
  await app_module.get_app_users({
461
461
  app_id_query: to_app_id,
@@ -537,7 +537,7 @@ export const submit_topic_app_notification = async (req, _ch) => {
537
537
 
538
538
  if (_.isEmpty(to_uid)) {
539
539
  if (!system) {
540
- const app_module = require(`${module_path}/app_module`);
540
+ const app_module = await import(`${module_path}/app_module`);
541
541
  const users_arr = (
542
542
  await app_module.get_app_users({
543
543
  app_id_query: to_app_id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/notification_module",
3
- "version": "1.1.86",
3
+ "version": "1.1.88",
4
4
  "description": "Xuda Notification Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {