Metamigo -> Bridge
This commit is contained in:
parent
242f3cf6b8
commit
a445762a37
145 changed files with 396 additions and 16668 deletions
89
apps/bridge-frontend/app/_lib/database.ts
Normal file
89
apps/bridge-frontend/app/_lib/database.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import { PostgresDialect } from "kysely";
|
||||
import { Pool } from "pg";
|
||||
import { KyselyAuth } from "@auth/kysely-adapter";
|
||||
import { CamelCasePlugin } from "kysely";
|
||||
import type { GeneratedAlways } from "kysely";
|
||||
|
||||
interface Database {
|
||||
User: {
|
||||
id: string;
|
||||
name: string | null;
|
||||
email: string;
|
||||
emailVerified: Date | null;
|
||||
image: string | null;
|
||||
};
|
||||
|
||||
Account: {
|
||||
id: GeneratedAlways<string>;
|
||||
userId: string;
|
||||
type: "oidc" | "oauth" | "email" | "webauthn";
|
||||
provider: string;
|
||||
providerAccountId: string;
|
||||
refresh_token: string | undefined;
|
||||
access_token: string | undefined;
|
||||
expires_at: number | undefined;
|
||||
token_type: Lowercase<string> | undefined;
|
||||
scope: string | undefined;
|
||||
id_token: string | undefined;
|
||||
session_state: string | undefined;
|
||||
};
|
||||
|
||||
Session: {
|
||||
id: GeneratedAlways<string>;
|
||||
userId: string;
|
||||
sessionToken: string;
|
||||
expires: Date;
|
||||
};
|
||||
|
||||
VerificationToken: {
|
||||
identifier: string;
|
||||
token: string;
|
||||
expires: Date;
|
||||
};
|
||||
|
||||
WhatsAppBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
phoneNumber: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
FacebookBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
VoiceBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
SignalBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
phoneNumber: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
}
|
||||
|
||||
export const db = new KyselyAuth<Database>({
|
||||
dialect: new PostgresDialect({
|
||||
pool: new Pool({
|
||||
host: process.env.DATABASE_HOST,
|
||||
database: process.env.DATABASE_NAME,
|
||||
user: process.env.DATABASE_USER,
|
||||
password: process.env.DATABASE_PASSWORD,
|
||||
}),
|
||||
}),
|
||||
plugins: [new CamelCasePlugin()],
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue