优化 Webhook 列表, 优化日志系统

This commit is contained in:
yml
2026-04-14 20:02:37 +08:00
parent 215f8bb710
commit 9636167177
21 changed files with 518 additions and 20 deletions
@@ -76,6 +76,7 @@ export async function mapAdminWebhookEvent(item, { includeRaw = false } = {}) {
signatureValid: Boolean(item.signature_valid),
processed: Boolean(item.processed),
processError: item.process_error,
visibilityLevel: resolveWebhookVisibilityLevel(item.process_error),
relatedOrderId: item.related_order_id,
createdAt: item.created_at,
platformOrderId: resolveAgisoTradePlatformOrderId(payload),
@@ -166,6 +167,16 @@ function extractWebhookItemSources(payload) {
return []
}
export function resolveWebhookVisibilityLevel(processError) {
const normalized = String(processError || '').trim()
if (normalized.startsWith('ignored_')) {
return 'ignored'
}
return 'important'
}
function normalizeRecord(value) {
return value && typeof value === 'object' && !Array.isArray(value) ? value : {}
}