Add CRUD for other entities
This commit is contained in:
parent
f87bcc43a5
commit
a3e8b89128
64 changed files with 949 additions and 62 deletions
|
|
@ -29,22 +29,6 @@ export const addGraphileJob = async (jobInfo: GraphileJob) => {
|
|||
// await db.insertInto("graphile_worker.jobs").values(jobInfo).execute();
|
||||
};
|
||||
|
||||
interface FacebookBotTable {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
token: string | null;
|
||||
pageAccessToken: string | null;
|
||||
appSecret: string | null;
|
||||
verifyToken: string | null;
|
||||
pageId: string | null;
|
||||
appId: string | null;
|
||||
userId: string | null;
|
||||
isVerified: Generated<boolean>;
|
||||
createdAt: GeneratedAlways<Timestamp>;
|
||||
updatedAt: GeneratedAlways<Timestamp>;
|
||||
}
|
||||
|
||||
export interface Database {
|
||||
User: {
|
||||
id: string;
|
||||
|
|
@ -85,17 +69,33 @@ export interface Database {
|
|||
WhatsappBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
phoneNumber: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
FacebookBot: FacebookBotTable;
|
||||
FacebookBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
token: string | null;
|
||||
pageAccessToken: string | null;
|
||||
appSecret: string | null;
|
||||
verifyToken: string | null;
|
||||
pageId: string | null;
|
||||
appId: string | null;
|
||||
userId: string | null;
|
||||
isVerified: Generated<boolean>;
|
||||
createdAt: GeneratedAlways<Timestamp>;
|
||||
updatedAt: GeneratedAlways<Timestamp>;
|
||||
};
|
||||
|
||||
VoiceLine: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
|
|
@ -104,6 +104,7 @@ export interface Database {
|
|||
SignalBot: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
phoneNumber: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
|
|
@ -113,13 +114,19 @@ export interface Database {
|
|||
Webhook: {
|
||||
id: GeneratedAlways<string>;
|
||||
name: string;
|
||||
description: string;
|
||||
createdBy: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
};
|
||||
}
|
||||
|
||||
export type FacebookBot = Selectable<FacebookBotTable>;
|
||||
export type FacebookBot = Selectable<Database["FacebookBot"]>;
|
||||
export type SignalBot = Selectable<Database["SignalBot"]>;
|
||||
export type WhatsappBot = Selectable<Database["WhatsappBot"]>;
|
||||
export type VoiceLine = Selectable<Database["VoiceLine"]>;
|
||||
export type Webhook = Selectable<Database["Webhook"]>;
|
||||
export type User = Selectable<Database["User"]>;
|
||||
|
||||
export const db = new KyselyAuth<Database>({
|
||||
dialect: new PostgresDialect({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue