@ -4,6 +4,7 @@ import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
import { wgInterface } from '../../schema';
export const hooks = sqliteTable('hooks_table', {
/** same as `wgInterface.name` */
id: text()
.primaryKey()
.references(() => wgInterface.name, {
@ -4,6 +4,7 @@ import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core';
import { client } from '../../schema';
export const oneTimeLink = sqliteTable('one_time_links_table', {
/** same as `client.id` */
id: int()
.references(() => client.id, {
@ -50,11 +50,7 @@ export class OneTimeLinkService {
const oneTimeLink = Math.abs(CRC32.str(key)).toString(16);
const expiresAt = new Date(Date.now() + 5 * 60 * 1000).toISOString();
return this.#statements.create.execute({
id,
oneTimeLink,
expiresAt,
});
return this.#statements.create.execute({ id, oneTimeLink, expiresAt });
}
erase(id: ID) {
@ -5,6 +5,7 @@ import { wgInterface } from '../../schema';
// default* means clients store it themselves
export const userConfig = sqliteTable('user_configs_table', {