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:
@@ -688,81 +688,101 @@ export class SeederService implements OnApplicationBootstrap {
|
||||
/* APIs de démo */
|
||||
const entries = await this.apiRepo.save([
|
||||
this.apiRepo.create({
|
||||
title: 'Swagger Petstore',
|
||||
version: '3.0.4',
|
||||
convention: 'CONSULTER',
|
||||
name: 'Référentiel Produits',
|
||||
versionMajor: 3,
|
||||
versionMinor: 0,
|
||||
versionPatch: 4,
|
||||
description:
|
||||
'A sample API that uses a petstore as an example to demonstrate features in the OpenAPI specification.',
|
||||
type: 'OPENAPI',
|
||||
yamlContent: PETSTORE_YAML,
|
||||
status: 'PENDING',
|
||||
categoryId: produits.id,
|
||||
functionalDoc: 'Cas d\'usage : gestion du catalogue produits. Permet de lister, créer et consulter des animaux de compagnie. Usage typique : intégration e-commerce, démo API REST.',
|
||||
technicalDoc: 'Authentification Bearer token requise. Pagination via paramètre `limit` (max 100). Réponses JSON selon schéma OpenAPI 3.0. Endpoint base : https://petstore.swagger.io/v3.',
|
||||
externalDocUrl: null,
|
||||
contactFunctional: 'Équipe Produit',
|
||||
contactTechnical: 'Équipe API',
|
||||
accessRights: 'API publique — aucune habilitation requise.',
|
||||
provider: 'DINUM',
|
||||
contactFunctionalName: 'Alice Martin',
|
||||
contactFunctionalEntity: 'Équipe Produit',
|
||||
contactFunctionalEmail: 'alice.martin@example.gouv.fr',
|
||||
contactTechnicalName: 'Bob Dupont',
|
||||
contactTechnicalEntity: 'Équipe API',
|
||||
contactTechnicalEmail: 'bob.dupont@example.gouv.fr',
|
||||
}),
|
||||
this.apiRepo.create({
|
||||
title: 'Streetlights Kafka API',
|
||||
version: '1.0.0',
|
||||
convention: 'ETRE_NOTIFIE',
|
||||
name: 'Éclairage Urbain Kafka',
|
||||
versionMajor: 1,
|
||||
versionMinor: 0,
|
||||
versionPatch: 0,
|
||||
description:
|
||||
'The Smartylighting Streetlights API allows you to remotely manage the city lights using Kafka messaging.',
|
||||
type: 'ASYNCAPI',
|
||||
yamlContent: STREETLIGHTS_YAML,
|
||||
status: 'PENDING',
|
||||
categoryId: evenements.id,
|
||||
functionalDoc: 'Gestion de l\'éclairage urbain IoT. Permet de recevoir les mesures de luminosité des lampadaires et d\'envoyer des commandes d\'allumage/extinction à distance.',
|
||||
technicalDoc: 'Broker Kafka sécurisé avec SCRAM-SHA-512. Topics : smartylighting.streetlights.1.0.*. Schémas de messages définis en AsyncAPI 3.0. Adresse broker : test.mykafkacluster.org:18092.',
|
||||
externalDocUrl: null,
|
||||
contactFunctional: 'Bureau Infrastructure',
|
||||
contactTechnical: 'ops@example.com',
|
||||
accessRights: 'Accès sur demande — habilitation DSI requise.',
|
||||
provider: 'Bureau Infrastructure',
|
||||
contactFunctionalName: 'Claire Leroy',
|
||||
contactFunctionalEntity: 'Bureau Infrastructure',
|
||||
contactFunctionalEmail: 'claire.leroy@example.gouv.fr',
|
||||
contactTechnicalName: 'David Chen',
|
||||
contactTechnicalEntity: 'Ops',
|
||||
contactTechnicalEmail: 'ops@example.com',
|
||||
}),
|
||||
this.apiRepo.create({
|
||||
title: 'Account Service',
|
||||
version: '1.0.0',
|
||||
convention: 'ETRE_NOTIFIE',
|
||||
name: 'Comptes Utilisateurs',
|
||||
versionMajor: 1,
|
||||
versionMinor: 0,
|
||||
versionPatch: 0,
|
||||
description: "Service de gestion des comptes utilisateurs avec publication d'événements.",
|
||||
type: 'ASYNCAPI',
|
||||
yamlContent: ACCOUNT_SERVICE_YAML,
|
||||
status: 'PENDING',
|
||||
categoryId: notifications.id,
|
||||
functionalDoc: 'Cycle de vie du compte utilisateur. Publie des événements lors de l\'inscription et du changement de mot de passe. Utilisé par les services de notification et d\'audit.',
|
||||
technicalDoc: 'Consommer via broker AMQP ou Kafka. Canaux : user/signedup, user/passwordchanged. Payloads JSON avec horodatage ISO 8601. Spec AsyncAPI 3.0.',
|
||||
externalDocUrl: null,
|
||||
contactFunctional: 'Équipe Comptes',
|
||||
contactTechnical: 'dev-core@example.com',
|
||||
accessRights: 'Interne uniquement — accès réservé aux services du SI.',
|
||||
provider: 'Équipe Comptes',
|
||||
contactFunctionalName: 'Emma Roux',
|
||||
contactFunctionalEntity: 'Équipe Comptes',
|
||||
contactFunctionalEmail: 'emma.roux@example.gouv.fr',
|
||||
contactTechnicalName: 'François Blanc',
|
||||
contactTechnicalEntity: 'Dev Core',
|
||||
contactTechnicalEmail: 'dev-core@example.com',
|
||||
}),
|
||||
this.apiRepo.create({
|
||||
title: 'Orders API',
|
||||
version: '1.0.0',
|
||||
convention: 'ENREGISTRER',
|
||||
name: 'Commandes Clients',
|
||||
versionMajor: 1,
|
||||
versionMinor: 0,
|
||||
versionPatch: 0,
|
||||
description: 'API de gestion des commandes clients.',
|
||||
type: 'OPENAPI',
|
||||
yamlContent: ORDERS_YAML,
|
||||
status: 'PENDING',
|
||||
categoryId: commandes.id,
|
||||
functionalDoc: 'Gestion des commandes clients : création, consultation, mise à jour du statut. Supporte les webhooks pour les transitions de statut (confirmed, shipped, delivered, cancelled).',
|
||||
technicalDoc: 'REST + JWT Bearer. Pagination via paramètres `page` et `limit`. Webhook de statut : POST vers URL configurée lors de la transition. Base URL : https://api.example.com/v1.',
|
||||
externalDocUrl: null,
|
||||
contactFunctional: 'Équipe Commerce',
|
||||
contactTechnical: 'api-orders@example.com',
|
||||
accessRights: 'Partenaires agréés uniquement — convention de partenariat requise.',
|
||||
provider: 'Équipe Commerce',
|
||||
contactFunctionalName: 'Gaëlle Moreau',
|
||||
contactFunctionalEntity: 'Équipe Commerce',
|
||||
contactFunctionalEmail: 'gaelle.moreau@example.gouv.fr',
|
||||
contactTechnicalName: 'Hugo Simon',
|
||||
contactTechnicalEntity: 'API Commerce',
|
||||
contactTechnicalEmail: 'api-orders@example.com',
|
||||
}),
|
||||
this.apiRepo.create({
|
||||
title: 'Auth API',
|
||||
version: '1.0.0',
|
||||
convention: 'CONSULTER',
|
||||
name: 'Authentification JWT',
|
||||
versionMajor: 1,
|
||||
versionMinor: 0,
|
||||
versionPatch: 0,
|
||||
description: "Service d'authentification et d'autorisation.",
|
||||
type: 'OPENAPI',
|
||||
yamlContent: AUTH_YAML,
|
||||
status: 'PENDING',
|
||||
categoryId: auth.id,
|
||||
functionalDoc: 'SSO centralisé avec tokens JWT. Gère la connexion, le rafraîchissement de token et la déconnexion. Exposé à tous les services du SI comme fournisseur d\'identité.',
|
||||
technicalDoc: 'Bearer JWT (RS256). Endpoint principal : POST /auth/login. Refresh via POST /auth/refresh. Durée access token : 15 min. Durée refresh token : 7 jours. Base URL : https://auth.example.com/v1.',
|
||||
externalDocUrl: null,
|
||||
contactFunctional: 'Équipe Sécurité',
|
||||
contactTechnical: 'securite@example.com',
|
||||
accessRights: 'Restreint — habilitation RSSI requise avant intégration.',
|
||||
provider: 'Équipe Sécurité',
|
||||
contactFunctionalName: 'Isabelle Petit',
|
||||
contactFunctionalEntity: 'Équipe Sécurité',
|
||||
contactFunctionalEmail: 'isabelle.petit@example.gouv.fr',
|
||||
contactTechnicalName: 'Julien Bernard',
|
||||
contactTechnicalEntity: 'Sécurité SI',
|
||||
contactTechnicalEmail: 'securite@example.com',
|
||||
}),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user