优化后端鉴权与日志安全

This commit is contained in:
yml2213
2026-05-26 08:21:11 +08:00
parent 851d1d1efc
commit dea3023825
35 changed files with 402 additions and 185 deletions
@@ -8,6 +8,7 @@ import { sendBarkNotification } from './bark-service.js'
import { sendWpushNotification } from './wpush-service.js'
type JsonObject = Record<string, any>
type NotificationResult = ReturnType<typeof mapNotificationResult>
type NotificationInput = {
title?: string
body?: string
@@ -31,12 +32,12 @@ export async function sendInternalNotification(input: NotificationInput = {}) {
successCount: 0,
failedCount: 0,
skippedCount: barkRecipients.length + wpushRecipients.length,
results: [],
results: [] as NotificationResult[],
}
}
const results = [
...(await Promise.all(barkRecipients.map(async (recipient) => {
...(await Promise.all(barkRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendBarkNotification({
serverUrl: bark.serverUrl,
@@ -64,7 +65,7 @@ export async function sendInternalNotification(input: NotificationInput = {}) {
)
}
}))),
...(await Promise.all(wpushRecipients.map(async (recipient) => {
...(await Promise.all(wpushRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendWpushNotification({
recipient,