feat: refonte métadonnées API + UX dossiers et import
- Nouveau schéma api_entries : convention+name, version X.X.X, provider, contacts splitées (name/entity/email), suppression des anciens champs - Formulaire upload étape 2 : convention+nom, version 3 champs, fournisseur, contacts métier et technique obligatoires ; type détecté auto → select désactivé - Validation YAML : redocly.yaml (extends: spec), support noms avec espaces, extraction métadonnées (name, version, description) depuis info YAML - Dossiers : modale création avec champ Emplacement pré-initialisé depuis le contexte de navigation, options └ avec indentation par profondeur - Import depuis un dossier : pré-sélection de la catégorie via queryParam - Recherche étendue : name, provider, description, contacts - Résolution @datacat/shared via workspace:* + compilation CJS avant NestJS 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:
@@ -1,19 +1,3 @@
|
||||
// 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;
|
||||
}
|
||||
export const API_CONVENTIONS = ['CONSULTER', 'ENREGISTRER', 'ETRE_NOTIFIE'] as const;
|
||||
|
||||
@@ -2,23 +2,37 @@ export type ApiType = 'ASYNCAPI' | 'OPENAPI';
|
||||
|
||||
export type ApiStatus = 'PENDING' | 'GENERATED' | 'ERROR';
|
||||
|
||||
export type ApiConvention = 'CONSULTER' | 'ENREGISTRER' | 'ETRE_NOTIFIE';
|
||||
|
||||
export const API_CONVENTION_LABELS: Record<ApiConvention, string> = {
|
||||
CONSULTER: 'Consulter',
|
||||
ENREGISTRER: 'Enregistrer',
|
||||
ETRE_NOTIFIE: 'Être notifié',
|
||||
};
|
||||
|
||||
export interface ApiEntry {
|
||||
id: string;
|
||||
title: string;
|
||||
name: string;
|
||||
convention: ApiConvention;
|
||||
version: string;
|
||||
versionMajor: number;
|
||||
versionMinor: number;
|
||||
versionPatch: number;
|
||||
description: string | null;
|
||||
type: ApiType;
|
||||
provider: string;
|
||||
yamlContent: string;
|
||||
htmlPath: string | null;
|
||||
status: ApiStatus;
|
||||
errorMessage: string | null;
|
||||
categoryId: string | null;
|
||||
functionalDoc: string | null;
|
||||
technicalDoc: string | null;
|
||||
externalDocUrl: string | null;
|
||||
contactFunctional: string | null;
|
||||
contactTechnical: string | null;
|
||||
accessRights: string | null;
|
||||
contactFunctionalName: string;
|
||||
contactFunctionalEntity: string;
|
||||
contactFunctionalEmail: string;
|
||||
contactTechnicalName: string;
|
||||
contactTechnicalEntity: string;
|
||||
contactTechnicalEmail: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -26,9 +40,12 @@ export interface ApiEntry {
|
||||
export interface ApiEntryListItem {
|
||||
id: string;
|
||||
title: string;
|
||||
name: string;
|
||||
convention: ApiConvention;
|
||||
version: string;
|
||||
description: string | null;
|
||||
type: ApiType;
|
||||
provider: string;
|
||||
status: ApiStatus;
|
||||
categoryId: string | null;
|
||||
createdAt: string;
|
||||
|
||||
Reference in New Issue
Block a user