mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
parent
bf165644c9
commit
14d8b18c1d
4 changed files with 53 additions and 0 deletions
|
@ -6,5 +6,6 @@ export * from './connector';
|
|||
export * from './oidc-model-instance';
|
||||
export * from './resource-scope';
|
||||
export * from './resource';
|
||||
export * from './setting';
|
||||
export * from './user-log';
|
||||
export * from './user';
|
||||
|
|
40
packages/schemas/src/db-entries/setting.ts
Normal file
40
packages/schemas/src/db-entries/setting.ts
Normal file
|
@ -0,0 +1,40 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
import {
|
||||
AdminConsoleConfig,
|
||||
adminConsoleConfigGuard,
|
||||
GeneratedSchema,
|
||||
Guard,
|
||||
} from '../foundations';
|
||||
|
||||
export type SettingDBEntry = {
|
||||
id: string;
|
||||
customDomain?: string | null;
|
||||
adminConsole: AdminConsoleConfig;
|
||||
};
|
||||
|
||||
export type Setting = {
|
||||
id: string;
|
||||
customDomain: string | null;
|
||||
adminConsole: AdminConsoleConfig;
|
||||
};
|
||||
|
||||
const guard: Guard<SettingDBEntry> = z.object({
|
||||
id: z.string(),
|
||||
customDomain: z.string().optional(),
|
||||
adminConsole: adminConsoleConfigGuard,
|
||||
});
|
||||
|
||||
export const Settings: GeneratedSchema<SettingDBEntry> = Object.freeze({
|
||||
table: 'settings',
|
||||
tableSingular: 'setting',
|
||||
fields: {
|
||||
id: 'id',
|
||||
customDomain: 'custom_domain',
|
||||
adminConsole: 'admin_console',
|
||||
},
|
||||
fieldKeys: ['id', 'customDomain', 'adminConsole'],
|
||||
guard,
|
||||
});
|
|
@ -36,3 +36,9 @@ export type UserLogPayload = z.infer<typeof userLogPayloadGuard>;
|
|||
export const connectorConfigGuard = z.object({});
|
||||
|
||||
export type ConnectorConfig = z.infer<typeof connectorConfigGuard>;
|
||||
|
||||
export const adminConsoleConfigGuard = z.object({
|
||||
applicationSkipGetStarted: z.boolean(),
|
||||
});
|
||||
|
||||
export type AdminConsoleConfig = z.infer<typeof adminConsoleConfigGuard>;
|
||||
|
|
6
packages/schemas/tables/settings.sql
Normal file
6
packages/schemas/tables/settings.sql
Normal file
|
@ -0,0 +1,6 @@
|
|||
create table settings (
|
||||
id varchar(128) not null,
|
||||
custom_domain text,
|
||||
admin_console jsonb /* @use AdminConsoleConfig */ not null,
|
||||
primary key (id)
|
||||
);
|
Loading…
Reference in a new issue