mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
Merge pull request #71 from logto-io/gao--refactor-applications
refactor(schemas): oidc_clients -> applications
This commit is contained in:
commit
1b6a755376
6 changed files with 49 additions and 26 deletions
27
packages/schemas/src/db-entries/application.ts
Normal file
27
packages/schemas/src/db-entries/application.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
import { OidcClientMetadata } from '../foundations';
|
||||
|
||||
import { ApplicationType } from './custom-types';
|
||||
|
||||
export type ApplicationDBEntry = {
|
||||
id: string;
|
||||
name: string;
|
||||
type: ApplicationType;
|
||||
oidcClientId: string;
|
||||
oidcClientMetadata: OidcClientMetadata;
|
||||
createdAt: number;
|
||||
};
|
||||
|
||||
export const Applications = Object.freeze({
|
||||
table: 'applications',
|
||||
fields: {
|
||||
id: 'id',
|
||||
name: 'name',
|
||||
type: 'type',
|
||||
oidcClientId: 'oidc_client_id',
|
||||
oidcClientMetadata: 'oidc_client_metadata',
|
||||
createdAt: 'created_at',
|
||||
},
|
||||
fieldKeys: ['id', 'name', 'type', 'oidcClientId', 'oidcClientMetadata', 'createdAt'],
|
||||
} as const);
|
|
@ -1,5 +1,10 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
export enum ApplicationType {
|
||||
Native = 'Native',
|
||||
SPA = 'SPA',
|
||||
Traditional = 'Traditional',
|
||||
}
|
||||
export enum PasswordEncryptionMethod {
|
||||
SaltAndPepper = 'SaltAndPepper',
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
export * from './custom-types';
|
||||
export * from './oidc-client';
|
||||
export * from './application';
|
||||
export * from './oidc-model-instance';
|
||||
export * from './user';
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|
||||
import { OidcClientMetadata } from '../foundations';
|
||||
|
||||
export type OidcClientDBEntry = {
|
||||
clientId: string;
|
||||
metadata: OidcClientMetadata;
|
||||
createdAt: number;
|
||||
};
|
||||
|
||||
export const OidcClients = Object.freeze({
|
||||
table: 'oidc_clients',
|
||||
fields: {
|
||||
clientId: 'client_id',
|
||||
metadata: 'metadata',
|
||||
createdAt: 'created_at',
|
||||
},
|
||||
fieldKeys: ['clientId', 'metadata', 'createdAt'],
|
||||
} as const);
|
16
packages/schemas/tables/applications.sql
Normal file
16
packages/schemas/tables/applications.sql
Normal file
|
@ -0,0 +1,16 @@
|
|||
create type application_type as enum ('Native', 'SPA', 'Traditional');
|
||||
|
||||
create table applications (
|
||||
id varchar(128) not null,
|
||||
name varchar(256) not null,
|
||||
type application_type not null,
|
||||
oidc_client_id varchar(128) not null,
|
||||
oidc_client_metadata jsonb /* @use OidcClientMetadata */ not null,
|
||||
created_at bigint not null default(extract(epoch from now())),
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create index applications__oidc_client_id
|
||||
on applications (
|
||||
oidc_client_id
|
||||
);
|
|
@ -1,6 +0,0 @@
|
|||
create table oidc_clients (
|
||||
client_id varchar(128) not null,
|
||||
metadata jsonb /* @use OidcClientMetadata */ not null,
|
||||
created_at bigint not null default(extract(epoch from now())),
|
||||
primary key (client_id)
|
||||
);
|
Loading…
Add table
Reference in a new issue