Date : 29/12/2024 Priorite : HAUTE - CETTE SEMAINE Status : BACKLOG
Les catchers sont unidirectionnels : fetch only (GET)
{
"id": "products",
"connector": "fakestore",
"endpoint": "products",
"method": "GET" // Implicite
}
Catchers bidirectionnels : fetch + send (GET, POST, PUT, DELETE)
{
"id": "create-product",
"connector": "fakestore",
"endpoint": "products",
"method": "POST",
"type": "action", // "fetch" | "action" | "mutation"
"payload": {
"from": "formData", // "formData" | "props" | "context"
"transform": { ... }
},
"onSuccess": {
"invalidate": ["products"], // Invalide le cache
"redirect": "/products/{id}"
},
"onError": {
"fallback": { "error": true }
}
}
Afficher le flow complet des données dans l'admin :
Connectors → Catchers → Layouts → Pages → Modules
┌─────────────────────────────────────────────────────────────┐
│ Page: /documentation/api │
├─────────────────────────────────────────────────────────────┤
│ │
│ Layout Chain: root → docs │
│ ┌─────────┐ ┌─────────┐ │
│ │ root │ → │ docs │ │
│ │ header │ │ sidebar │ │
│ │ footer │ │ │ │
│ └─────────┘ └─────────┘ │
│ │
│ Data Catchers: │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ docs-pages │ → │ api-endpoints│ │
│ │ Connector: fs│ │ Connector: sw│ │
│ └──────────────┘ └──────────────┘ │
│ │
│ Modules: │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Hero │ │ TextBlock│ │ CodeBlock│ │
│ │ data: {} │ │ data: {} │ │ catcher: │ │
│ └──────────┘ └──────────┘ │api-endpts│ │
│ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
/admin/flow/ # Vue globale des flows
/admin/flow/page/[pageId] # Flow d'une page spécifique
/admin/flow/layout/[layoutId] # Flow d'un layout
/admin/flow/catcher/[catcherId] # Dépendances d'un catcher
| Élément | Informations |
|---|---|
| Module | Type, template, props, catcher assigné |
| Catcher | Connector, endpoint, dépendances, cache |
| Layout | Zones, catchers globaux, pages utilisant ce layout |
| Connector | URL base, endpoints disponibles, auth |
Le slug contient le chemin complet :
Page: doc-api
Slug: /documentation/api
Page: v2-architecture
Slug: /documentation/v2-architecture
## Règles des Slugs
1. Le slug d'une page contient son chemin complet depuis la racine
2. Ne pas construire le chemin en remontant les parents - utiliser le slug directement
3. Le slug doit commencer par `/` et finir par le nom de la page
4. Pour les pages enfants : `/parent/child` (pas besoin de remonter la hiérarchie)
### Exemple
- Page home → slug: `/`
- Page about → slug: `/about`
- Page doc-api (enfant de documentation) → slug: `/documentation/api`
src/types/data-catcher.ts # Ajouter method, type, onSuccess, onError
src/services/data-catchers/ # Implémenter exécution actions
src/routes/admin/flow/ # Nouvelle section admin
docs/ARCHITECTURE.md # Documentation complète