- 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>
69 lines
1.2 KiB
TypeScript
69 lines
1.2 KiB
TypeScript
import { IsString, IsNotEmpty, IsIn, IsOptional, IsUUID, IsInt, Min, IsEmail } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ApiType, ApiConvention } from '@datacat/shared';
|
|
|
|
export class CreateApiEntryDto {
|
|
@IsIn(['CONSULTER', 'ENREGISTRER', 'ETRE_NOTIFIE'])
|
|
convention!: ApiConvention;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
provider!: string;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
@Type(() => Number)
|
|
versionMajor!: number;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
@Type(() => Number)
|
|
versionMinor!: number;
|
|
|
|
@IsInt()
|
|
@Min(0)
|
|
@Type(() => Number)
|
|
versionPatch!: number;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
description?: string;
|
|
|
|
@IsIn(['ASYNCAPI', 'OPENAPI'])
|
|
type!: ApiType;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
yamlContent!: string;
|
|
|
|
@IsUUID()
|
|
@IsOptional()
|
|
categoryId?: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
contactFunctionalName!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
contactFunctionalEntity!: string;
|
|
|
|
@IsEmail()
|
|
contactFunctionalEmail!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
contactTechnicalName!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
contactTechnicalEntity!: string;
|
|
|
|
@IsEmail()
|
|
contactTechnicalEmail!: string;
|
|
}
|