Team Ai
Apppublic

delqhi/sin-github-issues

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
audit.ts18 linesDownload Raw Back to src
1import { getSupabaseClient } from './supabase.js';2 3const DEFAULT_TABLE = process.env.SIN_GITHUB_ISSUES_AUDIT_TABLE?.trim() || 'sin_github_issues_events';4 5export async function recordAuditEvent(event: Record<string, unknown>) {6  try {7    const client = getSupabaseClient();8    const { error } = await client.from(DEFAULT_TABLE).insert({9      kind: String(event.kind || 'unknown'),10      payload: event,11      created_at: new Date().toISOString(),12    });13    return { persisted: !error, error: error?.message || null, table: DEFAULT_TABLE };14  } catch (error) {15    return { persisted: false, error: error instanceof Error ? error.message : String(error), table: DEFAULT_TABLE };16  }17}18