feat: basic admin interface
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE "instance_settings" (
|
||||
"id" text PRIMARY KEY,
|
||||
"registration" text DEFAULT 'open' NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,19 @@ export enum ToolCallType {
|
||||
Json = 'json',
|
||||
}
|
||||
|
||||
export const REGISTRATION_MODES = ['open', 'invite', 'closed'] as const;
|
||||
export type RegistrationMode = typeof REGISTRATION_MODES[number];
|
||||
|
||||
export const INSTANCE_SETTINGS_ID = 'instance';
|
||||
|
||||
// Settings of the whole instance, changed by admins. There is only ever the
|
||||
// one row with the id above.
|
||||
export const instanceSettings = pgTable('instance_settings', {
|
||||
id: text('id').primaryKey(),
|
||||
registration: text('registration').$type<RegistrationMode>().notNull().default('open'),
|
||||
updatedAt: timestamptz('updated_at').notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
|
||||
});
|
||||
|
||||
export const settings = pgTable('settings', {
|
||||
id: text('id').primaryKey().$defaultFn(nanoid),
|
||||
userId: text('user_id').notNull(),
|
||||
|
||||
Reference in New Issue
Block a user