feat: certificate qrcode (#1755)

Adds document access tokens and QR code functionality to enable secure
document sharing via URLs. It includes a new document access page that
allows viewing and downloading documents through tokenized links.
This commit is contained in:
Ephraim Duncan
2025-04-28 01:30:09 +00:00
committed by GitHub
parent 6a41a37bd4
commit bdb0b0ea88
26 changed files with 423 additions and 31 deletions

View File

@ -31,4 +31,38 @@ export const kyselyPrisma = remember('kyselyPrisma', () =>
),
);
export const prismaWithLogging = remember('prismaWithLogging', () => {
const client = new PrismaClient({
datasourceUrl: getDatabaseUrl(),
log: [
{
emit: 'event',
level: 'query',
},
],
});
client.$on('query', (e) => {
console.log('query:', e.query);
console.log('params:', e.params);
console.log('duration:', e.duration);
const params = JSON.parse(e.params) as unknown[];
const query = e.query.replace(/\$\d+/g, (match) => {
const index = Number(match.replace('$', ''));
if (index > params.length) {
return match;
}
return String(params[index - 1]);
});
console.log('formatted query:', query);
});
return client;
});
export { sql } from 'kysely';