@xuda.io/notification_module 1.1.88 → 1.1.90
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 +6 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ global._conf = require(path.join(process.env.XUDA_HOME, process.env.XUDA_CONFIG)
|
|
|
13
13
|
|
|
14
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 = await import(`${module_path}/db_module`);
|
|
16
|
+
const db_module = await import(`${module_path}/db_module/index.mjs`);
|
|
17
17
|
|
|
18
18
|
//////////////////// FCM /////////////////////
|
|
19
19
|
const serviceAccount = _conf.firebase_serviceAccount;
|
|
@@ -111,6 +111,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
|
|
|
111
111
|
|
|
112
112
|
for await (let uid of uid_arr) {
|
|
113
113
|
for await (let delivery_method_item of delivery_method) {
|
|
114
|
+
let obj = {};
|
|
114
115
|
let account_ret;
|
|
115
116
|
if (!system) {
|
|
116
117
|
account_ret = await db_module.get_couch_doc('xuda_accounts', uid);
|
|
@@ -120,7 +121,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
|
|
|
120
121
|
}
|
|
121
122
|
send_result[uid] = true;
|
|
122
123
|
const uuid = await _common.xuda_get_uuid('notification');
|
|
123
|
-
|
|
124
|
+
obj = {
|
|
124
125
|
_id: uuid,
|
|
125
126
|
docType: 'notification',
|
|
126
127
|
type,
|
|
@@ -149,7 +150,7 @@ export const submit_notification = async (req, _ch = global[`_notification_modul
|
|
|
149
150
|
send_result[uid] = false;
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
const email_module = await import(`${module_path}/email_module`);
|
|
153
|
+
const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
153
154
|
email_module.send_email({
|
|
154
155
|
email: obj.email,
|
|
155
156
|
subject,
|
|
@@ -455,7 +456,7 @@ export const submit_app_notification = async (req) => {
|
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
|
|
458
|
-
const app_module = await import(`${module_path}/app_module`);
|
|
459
|
+
const app_module = await import(`${module_path}/app_module/index.mjs`);
|
|
459
460
|
const users_arr = (
|
|
460
461
|
await app_module.get_app_users({
|
|
461
462
|
app_id_query: to_app_id,
|
|
@@ -537,7 +538,7 @@ export const submit_topic_app_notification = async (req, _ch) => {
|
|
|
537
538
|
|
|
538
539
|
if (_.isEmpty(to_uid)) {
|
|
539
540
|
if (!system) {
|
|
540
|
-
const app_module = await import(`${module_path}/app_module`);
|
|
541
|
+
const app_module = await import(`${module_path}/app_module/index.mjs`);
|
|
541
542
|
const users_arr = (
|
|
542
543
|
await app_module.get_app_users({
|
|
543
544
|
app_id_query: to_app_id,
|