feat: initial scaffold — MVP catalogue de données d'API
- Backend NestJS : CRUD api_entries + categories, upload YAML multi-fichiers, génération docs AsyncAPI (@asyncapi/cli@6.0.0) et OpenAPI (redocly) - Fix: route wildcard GET /api/apis/:id/*path pour servir les assets statiques (CSS/JS) générés par AsyncAPI HTML template (contournement bug path-to-regexp v8) - Frontend Angular 19 : pages catalog, browse, api-detail, doc-viewer, upload (DSFR) - Seeder de données de démo (idempotent) - Docker Compose dev + Dockerfiles + manifests K8s - Documentation : README, architecture, référence API REST Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
3
shared/src/index.ts
Normal file
3
shared/src/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './types/api-entry.types';
|
||||
export * from './schemas/api-entry.schema';
|
||||
export * from './types/category.types';
|
||||
19
shared/src/schemas/api-entry.schema.ts
Normal file
19
shared/src/schemas/api-entry.schema.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// Zod schemas for validation (used in backend)
|
||||
// Install zod in back/ if needed: pnpm add zod
|
||||
|
||||
export const API_TYPES = ['ASYNCAPI', 'OPENAPI'] as const;
|
||||
export const API_STATUSES = ['PENDING', 'GENERATED', 'ERROR'] as const;
|
||||
|
||||
export interface CreateApiEntryDto {
|
||||
title: string;
|
||||
version: string;
|
||||
description?: string;
|
||||
type: 'ASYNCAPI' | 'OPENAPI';
|
||||
}
|
||||
|
||||
export interface UpdateApiEntryDto {
|
||||
title?: string;
|
||||
version?: string;
|
||||
description?: string;
|
||||
categoryId?: string | null;
|
||||
}
|
||||
45
shared/src/types/api-entry.types.ts
Normal file
45
shared/src/types/api-entry.types.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
export type ApiType = 'ASYNCAPI' | 'OPENAPI';
|
||||
|
||||
export type ApiStatus = 'PENDING' | 'GENERATED' | 'ERROR';
|
||||
|
||||
export interface ApiEntry {
|
||||
id: string;
|
||||
title: string;
|
||||
version: string;
|
||||
description: string | null;
|
||||
type: ApiType;
|
||||
yamlContent: string;
|
||||
htmlPath: string | null;
|
||||
status: ApiStatus;
|
||||
errorMessage: string | null;
|
||||
categoryId: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ApiEntryListItem {
|
||||
id: string;
|
||||
title: string;
|
||||
version: string;
|
||||
description: string | null;
|
||||
type: ApiType;
|
||||
status: ApiStatus;
|
||||
categoryId: string | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface ApiListResponse {
|
||||
items: ApiEntryListItem[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface ApiListQuery {
|
||||
search?: string;
|
||||
type?: ApiType;
|
||||
categoryId?: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
27
shared/src/types/category.types.ts
Normal file
27
shared/src/types/category.types.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { ApiEntryListItem } from './api-entry.types';
|
||||
|
||||
export interface Category {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
parentId: string | null;
|
||||
orderIndex: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface CategoryWithCounts extends Category {
|
||||
subcategoryCount: number;
|
||||
apiCount: number;
|
||||
}
|
||||
|
||||
export interface CategoryBrowseResponse {
|
||||
category: Category | null;
|
||||
breadcrumb: Category[];
|
||||
subcategories: CategoryWithCounts[];
|
||||
apis: ApiEntryListItem[];
|
||||
}
|
||||
|
||||
export interface CategoryListResponse {
|
||||
items: Category[];
|
||||
}
|
||||
Reference in New Issue
Block a user