-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.cursorrules
755 lines (660 loc) · 25.2 KB
/
.cursorrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
You are an expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind.
Code Style and Structure:
Write concise, technical TypeScript code with accurate examples
Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Structure files: exported component, subcomponents, helpers, static content, types
Naming Conventions:
Use lowercase with dashes for directories (e.g., components/auth-wizard)
Favor named exports for components
TypeScript Usage:
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use functional components with TypeScript interfaces
Syntax and Formatting:
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
Use declarative JSX
When using an apostrophe for text, make sure to write it as ' instead of '
Error Handling and Validation:
Prioritize error handling: handle errors and edge cases early
Use early returns and guard clauses
Implement proper error logging and user-friendly messages
Use Zod for form validation
Model expected errors as return values in Server Actions
Use error boundaries for unexpected errors
UI and Styling:
Use Shadcn UI (which is based on Radix UI) and Tailwind for components and styling
Implement responsive design with Tailwind CSS; use a mobile-first approach
Performance Optimization:
Wrap client components in Suspense with fallback
Use dynamic loading for non-critical components
Optimize images: use WebP format, include size data, implement lazy loading
Key Conventions:
Always use zod for creating schemas for data both on the client and server
Optimize Web Vitals (LCP, CLS, FID)
Always use 'use client' in components to ensure that we can use state, effects and client-side data fetching
Never use server components
Follow Next.js docs for Data Fetching, Rendering, and Routing
AI SDK Integration:
To generate JSON from an LLM, use this pattern with zod and ai-sdk:
```ts
import { openai } from "@ai-sdk/openai";
import { generateObject } from "ai";
import { z } from "zod";
const { object } = await generateObject({
model: openai("gpt-4o"),
schema: z.object({
recipe: z.object({
name: z.string(),
ingredients: z.array(z.string()),
steps: z.array(z.string()),
}),
}),
prompt: "Generate a lasagna recipe.",
});
```
To generate text from an LLM, use this pattern:
```ts
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
const { text } = await generateText({
model: openai("gpt-4o-mini"),
prompt: "Invent a new holiday.",
});
```
When importing our schema/ORM into an endpoint, use the following import:
import { db } from "@/db/db";
When invoking an API route from an API route, use an absolute path.
When invoking an API route from a page, use a relative path starting with /api.
When interacting with our database, make sure to read the schema first before making any changes at: "db/schema/core.ts"
YOU MUST BE AWARE OF THE SCHEMA BEFORE YOU CAN MAKE ANY CHANGES TO THE DATABASE OR WRITE ANY ENDPOINTS THAT INTERACT WITH THE DATABASE.
When creating endpoints, use the following pattern:
```ts
import { db } from "@/db/db";
import { prompts } from "@/db/schema";
import { eq, and } from "drizzle-orm";
import { NextRequest, NextResponse } from "next/server";
import { z } from "zod";
const resourceTypes = [
"system",
"application",
"feature",
"userStory",
"technicalSpec",
] as const;
// Schema for validating prompt data
const promptSchema = z.object({
promptType: z.string().min(1),
subType: z.string().optional(),
content: z.string(),
resourceType: z.enum(resourceTypes),
userId: z.string().uuid(),
});
// GET /api/core/settings/prompts?resourceType=feature&userId=123
export async function GET(request: NextRequest) {
try {
const searchParams = request.nextUrl.searchParams;
const resourceType = searchParams.get("resourceType");
const userId = searchParams.get("userId");
if (!resourceType || !userId) {
return NextResponse.json(
{ error: "Missing required parameters" },
{ status: 400 }
);
}
if (!resourceTypes.includes(resourceType as any)) {
return NextResponse.json(
{ error: "Invalid resource type" },
{ status: 400 }
);
}
const promptsList = await db.query.prompts.findMany({
where: and(
eq(prompts.resourceType, resourceType),
eq(prompts.userId, userId)
),
});
return NextResponse.json(promptsList);
} catch (error) {
console.error("Failed to fetch prompts:", error);
return NextResponse.json(
{ error: "Failed to fetch prompts" },
{ status: 500 }
);
}
}
// POST /api/core/settings/prompts
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const validatedData = promptSchema.parse(body);
const newPrompt = await db.insert(prompts).values({
...validatedData,
});
return NextResponse.json(newPrompt);
} catch (error) {
if (error instanceof z.ZodError) {
return NextResponse.json({ error: error.errors }, { status: 400 });
}
console.error("Failed to create prompt:", error);
return NextResponse.json(
{ error: "Failed to create prompt" },
{ status: 500 }
);
}
}
export async function PUT(request: NextRequest) {
try {
const { id, ...updateData } = await request.json();
if (!id) {
return NextResponse.json(
{ error: "Prompt ID is required" },
{ status: 400 }
);
}
// Only update specific fields
const updatedPrompt = await db
.update(prompts)
.set({
content: updateData.content,
promptType: updateData.promptType,
subType: updateData.subType,
resourceType: updateData.resourceType,
updatedAt: new Date(),
})
.where(eq(prompts.id, id))
.returning();
if (!updatedPrompt.length) {
return NextResponse.json({ error: "Prompt not found" }, { status: 404 });
}
return NextResponse.json(updatedPrompt[0]);
} catch (error) {
console.error("Failed to update prompt:", error);
return NextResponse.json(
{ error: "Failed to update prompt" },
{ status: 500 }
);
}
}
export async function DELETE(request: NextRequest) {
try {
const body = await request.json();
const { id } = body;
if (!id) {
return NextResponse.json(
{ error: "Prompt ID is required" },
{ status: 400 }
);
}
const deletedPrompt = await db
.delete(prompts)
.where(eq(prompts.id, id))
.returning();
if (!deletedPrompt.length) {
return NextResponse.json({ error: "Prompt not found" }, { status: 404 });
}
return NextResponse.json({ success: true });
} catch (error) {
console.error("Failed to delete prompt:", error);
return NextResponse.json(
{ error: "Failed to delete prompt" },
{ status: 500 }
);
}
}
```
If provided markdown files, make sure to read them as reference for how to structure your code. Do not update the markdown files at all. Only use them for reference and examples of how to structure your code.
When intefacing with Github:
When asked, to submit a PR - use the Github CLI. Assume I am already authenticated correctly.
When asked to create a PR follow this process:
1. git status - to check if there are any changes to commit
2. git add . - to add all the changes to the staging area (IF NEEDED)
3. git commit -m "your commit message" - to commit the changes (IF NEEDED)
4. git push - to push the changes to the remote repository (IF NEEDED)
5. git branch - to check the current branch
5. git log main..[insert current branch] - specifically log the changes made to the current branch
6. git diff --name-status main - check to see what files have been changed
When asked to create a commit, first check for all files that have been changed using git status.
Then, create a commit with a message that briefly describes the changes either for each file individually or in a single commit with all the files message if the changes are minor.
7. gh pr create --title "Title goes ehre..." --body "Example body..."
When writing a message for the PR, don't include new lines in the message. Just write a single long message.
Example of a working drizzle schema:
import { relations } from "drizzle-orm";
import {
pgTable,
uuid,
varchar,
text,
jsonb,
integer,
timestamp,
date,
primaryKey,
index,
boolean,
} from "drizzle-orm/pg-core";
/* --------------------------------------------------------------------------------
ROLES TABLE
Stores distinct roles (e.g., "admin", "viewer") that can be assigned to users.
-------------------------------------------------------------------------------- */
export const roles = pgTable("roles", {
id: uuid("id").primaryKey().defaultRandom(),
name: varchar("name", { length: 100 }).notNull(),
description: text("description"),
// Timestamps for auditing or reference
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
/* --------------------------------------------------------------------------------
USERS TABLE
Stores Clerk user IDs, and we will map users to roles via a join table.
-------------------------------------------------------------------------------- */
export const users = pgTable(
"users",
{
id: uuid("id").primaryKey().defaultRandom(),
clerkUserId: varchar("clerk_user_id", { length: 255 }).notNull(),
email: varchar("email", { length: 255 }),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
isConfirmed: boolean("is_confirmed").default(false),
},
(table) => [
index("users_clerk_user_id_idx").on(table.clerkUserId),
index("users_email_idx").on(table.email),
]
);
/* --------------------------------------------------------------------------------
USER_ROLES TABLE
A bridging (many-to-many) table that links users to multiple roles.
This is the most reliable way to enforce foreign keys in Postgres.
-------------------------------------------------------------------------------- */
export const userRoles = pgTable(
"user_roles",
{
userId: uuid("user_id")
.references(() => users.id, { onDelete: "cascade" })
.notNull(),
roleId: uuid("role_id")
.references(() => roles.id, { onDelete: "cascade" })
.notNull(),
},
(table) => [primaryKey({ columns: [table.userId, table.roleId] })]
);
/* --------------------------------------------------------------------------------
INSIGHT_TYPES TABLE
Stores user-defined insight types. A user can define them in the UI, specifying
a name, description, and minimum number of insights required.
-------------------------------------------------------------------------------- */
export const insightTypes = pgTable("insight_types", {
id: uuid("id").primaryKey().defaultRandom(),
name: varchar("name", { length: 255 }).notNull(),
description: text("description"),
minInsights: integer("min_insights").default(0),
// Timestamps for auditing or reference
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
});
/* --------------------------------------------------------------------------------
REPORTS TABLE
Stores details about a report, including data sources, the AI-processed report
content, any extracted insights, timestamps, etc.
- dataSources: JSON array of objects containing { sourceName, sourceURL?, sourceChannel?, cachedContent? }
- extractedInsights: JSON array of objects containing { content, insightType }
-------------------------------------------------------------------------------- */
export const reports = pgTable(
"reports",
{
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
name: text("name").notNull(),
instructions: text("instructions"),
status: text("status", { enum: ["draft", "processing", "completed"] })
.notNull()
.default("draft"),
reportContent: text("report_content"),
timeframeSelection: integer("timeframe_selection").notNull().default(7),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
},
(table) => [
index("reports_status_idx").on(table.status),
index("reports_user_id_idx").on(table.userId),
]
);
/* --------------------------------------------------------------------------------
DATA_SOURCES TABLE
Stores information about data sources used in reports. Each report can have
multiple data sources, and each data source can optionally reference cached content.
-------------------------------------------------------------------------------- */
export const dataSources = pgTable(
"data_sources",
{
id: uuid("id").primaryKey().defaultRandom(),
reportId: uuid("report_id")
.references(() => reports.id, { onDelete: "cascade" })
.notNull(),
sourceName: varchar("source_name", { length: 255 }).notNull(),
sourceType: varchar("source_type", { length: 50 })
.notNull()
.$type<"youtube" | "telegram" | "other">(),
sourceURL: text("source_url"),
sourceChannel: varchar("source_channel", { length: 255 }),
cachedContentId: uuid("cached_content_id").references(
() => cachedContent.id
),
metadata: jsonb("metadata"),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [
index("data_sources_report_id_idx").on(table.reportId),
index("data_sources_source_type_idx").on(table.sourceType),
]
);
/* --------------------------------------------------------------------------------
INSIGHTS TABLE
Stores extracted insights from reports. Each insight is associated with a report
and an insight type, containing the actual insight content.
-------------------------------------------------------------------------------- */
export const insights = pgTable(
"insights",
{
id: uuid("id").primaryKey().defaultRandom(),
reportId: uuid("report_id")
.references(() => reports.id, { onDelete: "cascade" })
.notNull(),
insightTypeId: uuid("insight_type_id")
.references(() => insightTypes.id)
.notNull(),
content: text("content").notNull(),
confidence: integer("confidence"),
metadata: jsonb("metadata"),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [
index("insights_report_id_idx").on(table.reportId),
index("insights_type_id_idx").on(table.insightTypeId),
]
);
/* ------------------------------------------------------------------
CACHED_CONTENT TABLE
Used to store transcripts or other cached data from external sources
(e.g., videos, articles).
------------------------------------------------------------------- */
export const cachedContent = pgTable(
"cached_content",
{
id: uuid("id").primaryKey().defaultRandom(),
sourceURL: text("source_url").notNull(),
sourceContent: jsonb("source_content").notNull(),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [index("cached_content_source_url_idx").on(table.sourceURL)]
);
/* --------------------------------------------------------------------------------
CONNECTIONS TABLE
Stores API keys, session tokens, or other configuration data for third-party
integrations (e.g., OpenAI, Telegram).
-------------------------------------------------------------------------------- */
export const connections = pgTable(
"connections",
{
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id").references(() => users.id, { onDelete: "cascade" }),
connectionType: varchar("connection_type", { length: 255 })
.notNull()
.$type<"telegram" | "openai" | "other">(),
connectionConfig: jsonb("connection_config"),
expires: date("expires"),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [
index("connections_type_idx").on(table.connectionType),
index("connections_user_id_idx").on(table.userId),
]
);
/* --------------------------------------------------------------------------------
SETTINGS TABLE
Stores various settings records, such as system prompts or other config
needed for LLM-based report generation, dashboard configs, etc.
-------------------------------------------------------------------------------- */
export const settings = pgTable(
"settings",
{
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id")
.references(() => users.id, { onDelete: "cascade" })
.notNull(),
settingType: varchar("setting_type", { length: 255 }).notNull(),
settingConfig: jsonb("setting_config").notNull(),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [index("settings_user_id_idx").on(table.userId)]
);
/* --------------------------------------------------------------------------------
COMMUNICATION_CHANNELS TABLE
Stores information about communication channels (e.g., Telegram channels)
that can be associated with reports.
-------------------------------------------------------------------------------- */
export const communicationChannels = pgTable(
"communication_channels",
{
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id")
.references(() => users.id, { onDelete: "cascade" })
.notNull(),
channelId: varchar("channel_id", { length: 255 }).notNull(),
channelName: varchar("channel_name", { length: 255 }).notNull(),
channelType: varchar("channel_type", { length: 50 })
.notNull()
.$type<"telegram" | "discord" | "other">(),
metadata: jsonb("metadata"),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [
index("communication_channels_channel_id_idx").on(table.channelId),
index("communication_channels_channel_type_idx").on(table.channelType),
index("communication_channels_user_id_idx").on(table.userId),
]
);
/* --------------------------------------------------------------------------------
REPORTS_CHANNELS TABLE
A bridging (many-to-many) table that links reports to communication channels.
-------------------------------------------------------------------------------- */
export const reportsChannels = pgTable(
"reports_channels",
{
reportId: uuid("report_id")
.references(() => reports.id, { onDelete: "cascade" })
.notNull(),
channelId: uuid("channel_id")
.references(() => communicationChannels.id, { onDelete: "cascade" })
.notNull(),
createdAt: timestamp("created_at").defaultNow(),
},
(table) => [
primaryKey({ columns: [table.reportId, table.channelId] }),
index("reports_channels_report_id_idx").on(table.reportId),
index("reports_channels_channel_id_idx").on(table.channelId),
]
);
/* --------------------------------------------------------------------------------
REPORT_INSIGHT_TYPES TABLE
A join table that associates insight types with reports and tracks whether they
are for video or text analysis.
-------------------------------------------------------------------------------- */
export const reportInsightTypes = pgTable(
"report_insight_types",
{
reportId: uuid("report_id")
.references(() => reports.id, { onDelete: "cascade" })
.notNull(),
insightTypeId: uuid("insight_type_id")
.references(() => insightTypes.id, { onDelete: "cascade" })
.notNull(),
analysisType: varchar("analysis_type", { length: 50 })
.notNull()
.$type<"video" | "text">(),
minInsights: integer("min_insights"),
createdAt: timestamp("created_at").defaultNow(),
updatedAt: timestamp("updated_at").defaultNow(),
},
(table) => [
primaryKey({
columns: [table.reportId, table.insightTypeId, table.analysisType],
}),
index("report_insight_types_report_id_idx").on(table.reportId),
index("report_insight_types_insight_type_id_idx").on(table.insightTypeId),
]
);
/* --------------------------------------------------------------------------------
RELATIONS
Below we define the Drizzle-ORM relations for each table that references others.
-------------------------------------------------------------------------------- */
// Roles have a many-to-many relationship to users via userRoles
export const rolesRelations = relations(roles, ({ many }) => ({
userRoles: many(userRoles),
}));
// Users have a many-to-many relationship to roles via userRoles
export const usersRelations = relations(users, ({ many }) => ({
userRoles: many(userRoles),
settings: many(settings),
}));
// userRoles is the join table linking users and roles
export const userRolesRelations = relations(userRoles, ({ one }) => ({
user: one(users, {
fields: [userRoles.userId],
references: [users.id],
}),
role: one(roles, {
fields: [userRoles.roleId],
references: [roles.id],
}),
}));
// Add reportInsightTypes relations first
export const reportInsightTypesRelations = relations(
reportInsightTypes,
({ one }) => ({
report: one(reports, {
fields: [reportInsightTypes.reportId],
references: [reports.id],
}),
insightType: one(insightTypes, {
fields: [reportInsightTypes.insightTypeId],
references: [insightTypes.id],
}),
})
);
// Add insightTypes relations
export const insightTypesRelations = relations(insightTypes, ({ many }) => ({
reportInsightTypes: many(reportInsightTypes),
insights: many(insights),
}));
// Then define Reports relations
export const reportsRelations = relations(reports, ({ many, one }) => ({
user: one(users, {
fields: [reports.userId],
references: [users.id],
}),
dataSources: many(dataSources),
insights: many(insights),
reportsChannels: many(reportsChannels),
reportInsightTypes: many(reportInsightTypes),
}));
// Data Sources relations
export const dataSourcesRelations = relations(dataSources, ({ one }) => ({
report: one(reports, {
fields: [dataSources.reportId],
references: [reports.id],
}),
cachedContent: one(cachedContent, {
fields: [dataSources.cachedContentId],
references: [cachedContent.id],
}),
}));
// Insights relations
export const insightsRelations = relations(insights, ({ one }) => ({
report: one(reports, {
fields: [insights.reportId],
references: [reports.id],
}),
insightType: one(insightTypes, {
fields: [insights.insightTypeId],
references: [insightTypes.id],
}),
}));
// Connections relations
export const connectionsRelations = relations(connections, ({ one }) => ({
user: one(users, {
fields: [connections.userId],
references: [users.id],
}),
}));
// Settings relations
export const settingsRelations = relations(settings, ({ one }) => ({
user: one(users, {
fields: [settings.userId],
references: [users.id],
}),
}));
// Communication Channels relations
export const communicationChannelsRelations = relations(
communicationChannels,
({ one, many }) => ({
user: one(users, {
fields: [communicationChannels.userId],
references: [users.id],
}),
reportsChannels: many(reportsChannels),
})
);
// Reports Channels relations
export const reportsChannelsRelations = relations(
reportsChannels,
({ one }) => ({
report: one(reports, {
fields: [reportsChannels.reportId],
references: [reports.id],
}),
channel: one(communicationChannels, {
fields: [reportsChannels.channelId],
references: [communicationChannels.id],
}),
})
);
/* --------------------------------------------------------------------------------
TYPE INFERENCES
(Optional but often helpful for strongly typed insert/select operations.)
-------------------------------------------------------------------------------- */
export type InsertRole = typeof roles.$inferInsert;
export type SelectRole = typeof roles.$inferSelect;
export type InsertUser = typeof users.$inferInsert;
export type SelectUser = typeof users.$inferSelect;
export type InsertUserRoles = typeof userRoles.$inferInsert;
export type SelectUserRoles = typeof userRoles.$inferSelect;
export type InsertInsightType = typeof insightTypes.$inferInsert;
export type SelectInsightType = typeof insightTypes.$inferSelect;
export type InsertReport = typeof reports.$inferInsert;
export type SelectReport = typeof reports.$inferSelect;
export type InsertCachedContent = typeof cachedContent.$inferInsert;
export type SelectCachedContent = typeof cachedContent.$inferSelect;
export type InsertConnection = typeof connections.$inferInsert;
export type SelectConnection = typeof connections.$inferSelect;
export type InsertSetting = typeof settings.$inferInsert;
export type SelectSetting = typeof settings.$inferSelect;
export type InsertCommunicationChannel =
typeof communicationChannels.$inferInsert;
export type SelectCommunicationChannel =
typeof communicationChannels.$inferSelect;
export type InsertReportChannel = typeof reportsChannels.$inferInsert;
export type SelectReportChannel = typeof reportsChannels.$inferSelect;