Migration to Nuxt v4 file structure and dependencies update

This commit is contained in:
Clément Pons
2025-11-13 10:05:41 +01:00
parent dd4191bea6
commit dfbb31595e
90 changed files with 652 additions and 924 deletions

86
app/types/api.d.ts vendored Normal file
View File

@@ -0,0 +1,86 @@
import type { FileType } from '~/types/content';
export interface SuccessHandler
{
success: true;
session: UserSession;
}
export interface ErrorHandler
{
success: false;
error: Error | ZodError;
}
export type Return = SuccessHandler | ErrorHandler;
export interface Project {
id: number;
name: string;
owner: number;
home: string;
summary: string;
}
export interface Navigation {
title: string;
path: string;
type: string;
private: boolean;
children?: Navigation[];
}
export type FileMetadata = Record<string, boolean | string | number>;
export interface File {
path: string;
owner: number;
title: string;
order: number;
type: FileType;
content: string;
navigable: boolean;
private: boolean;
metadata: FileMetadata;
}
export interface Comment {
project: number;
path: number;
user_id: number;
sequence: number;
position: number;
length: number;
content: string;
}
export interface User {
id: number;
username: string;
}
export interface Tag {
tag: string;
project: number;
description: string;
}
export type ProjectSearch = Project &
{
pages: number;
username: string;
}
export type FileSearch = Omit<File, 'content'> &
{
comments: number;
username: string;
}
export type CommentSearch = Comment &
{
username: string;
}
export type UserSearch = User &
{
}
export type CommentedFile = File &
{
comments: CommentSearch[];
}
export interface Search {
projects: ProjectSearch[];
files: FileSearch[];
users: UserSearch[];
}