feat: add Prisma schema with User, Project, Module, Endpoint models
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc --watch",
|
||||
"db:generate": "prisma generate",
|
||||
"db:migrate": "prisma migrate dev",
|
||||
"db:push": "prisma db push"
|
||||
"db:generate": "prisma generate --schema ../../prisma/schema.prisma",
|
||||
"db:migrate": "prisma migrate dev --schema ../../prisma/schema.prisma",
|
||||
"db:push": "prisma db push --schema ../../prisma/schema.prisma"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^6.0.0"
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// Shared types — will be populated as we build features
|
||||
import type { User, Project, Module, Endpoint, ModuleSource } from '@prisma/client';
|
||||
|
||||
export type { User, Project, Module, Endpoint, ModuleSource };
|
||||
|
||||
export type ApiResponse<T = unknown> = {
|
||||
success: boolean;
|
||||
data?: T;
|
||||
@@ -7,3 +10,23 @@ export type ApiResponse<T = unknown> = {
|
||||
message: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type ProjectWithStats = Project & {
|
||||
_count: { endpoints: number; modules: number };
|
||||
};
|
||||
|
||||
export type ModuleWithCount = Module & {
|
||||
_count: { endpoints: number };
|
||||
};
|
||||
|
||||
export type EndpointSummary = {
|
||||
id: string;
|
||||
method: string;
|
||||
path: string;
|
||||
summary: string | null;
|
||||
deprecated: boolean;
|
||||
};
|
||||
|
||||
export type EndpointDetail = Endpoint & {
|
||||
moduleName: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user