av6-core 1.7.12 → 1.7.14
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/index.js +13 -4
- package/dist/index.mjs +13 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3311,7 +3311,9 @@ async function resolveAllRecipients(args) {
|
|
|
3311
3311
|
for (const k of toArray(cfg.recipients)) {
|
|
3312
3312
|
const v = getNestedValueV2(args.evtData, k);
|
|
3313
3313
|
if (typeof v === "string") res[type].push(v);
|
|
3314
|
-
if (
|
|
3314
|
+
if (typeof v === "number") res[type].push(String(v));
|
|
3315
|
+
if (Array.isArray(v))
|
|
3316
|
+
res[type].push(...v.filter((x) => typeof x === "string" || typeof x === "number").map(String));
|
|
3315
3317
|
}
|
|
3316
3318
|
continue;
|
|
3317
3319
|
}
|
|
@@ -3758,14 +3760,21 @@ var NotificationService = class {
|
|
|
3758
3760
|
deviceNotificationToken: { not: null },
|
|
3759
3761
|
logoutAt: null
|
|
3760
3762
|
},
|
|
3761
|
-
select: {
|
|
3763
|
+
select: {
|
|
3764
|
+
user: {
|
|
3765
|
+
select: {
|
|
3766
|
+
userId: true
|
|
3767
|
+
}
|
|
3768
|
+
},
|
|
3769
|
+
deviceNotificationToken: true
|
|
3770
|
+
}
|
|
3762
3771
|
});
|
|
3763
3772
|
const map = /* @__PURE__ */ new Map();
|
|
3764
3773
|
for (const r of rows) {
|
|
3765
3774
|
const token = r.deviceNotificationToken?.trim();
|
|
3766
3775
|
if (!token) continue;
|
|
3767
|
-
if (!map.has(r.userId)) map.set(r.userId, []);
|
|
3768
|
-
map.get(r.userId).push(token);
|
|
3776
|
+
if (!map.has(r.user.userId)) map.set(r.user.userId, []);
|
|
3777
|
+
map.get(r.user.userId).push(token);
|
|
3769
3778
|
}
|
|
3770
3779
|
for (const [k, v] of map.entries()) map.set(k, Array.from(new Set(v)));
|
|
3771
3780
|
return map;
|
package/dist/index.mjs
CHANGED
|
@@ -3255,7 +3255,9 @@ async function resolveAllRecipients(args) {
|
|
|
3255
3255
|
for (const k of toArray(cfg.recipients)) {
|
|
3256
3256
|
const v = getNestedValueV2(args.evtData, k);
|
|
3257
3257
|
if (typeof v === "string") res[type].push(v);
|
|
3258
|
-
if (
|
|
3258
|
+
if (typeof v === "number") res[type].push(String(v));
|
|
3259
|
+
if (Array.isArray(v))
|
|
3260
|
+
res[type].push(...v.filter((x) => typeof x === "string" || typeof x === "number").map(String));
|
|
3259
3261
|
}
|
|
3260
3262
|
continue;
|
|
3261
3263
|
}
|
|
@@ -3702,14 +3704,21 @@ var NotificationService = class {
|
|
|
3702
3704
|
deviceNotificationToken: { not: null },
|
|
3703
3705
|
logoutAt: null
|
|
3704
3706
|
},
|
|
3705
|
-
select: {
|
|
3707
|
+
select: {
|
|
3708
|
+
user: {
|
|
3709
|
+
select: {
|
|
3710
|
+
userId: true
|
|
3711
|
+
}
|
|
3712
|
+
},
|
|
3713
|
+
deviceNotificationToken: true
|
|
3714
|
+
}
|
|
3706
3715
|
});
|
|
3707
3716
|
const map = /* @__PURE__ */ new Map();
|
|
3708
3717
|
for (const r of rows) {
|
|
3709
3718
|
const token = r.deviceNotificationToken?.trim();
|
|
3710
3719
|
if (!token) continue;
|
|
3711
|
-
if (!map.has(r.userId)) map.set(r.userId, []);
|
|
3712
|
-
map.get(r.userId).push(token);
|
|
3720
|
+
if (!map.has(r.user.userId)) map.set(r.user.userId, []);
|
|
3721
|
+
map.get(r.user.userId).push(token);
|
|
3713
3722
|
}
|
|
3714
3723
|
for (const [k, v] of map.entries()) map.set(k, Array.from(new Set(v)));
|
|
3715
3724
|
return map;
|