Files
flowdeck/app/routers/api_v2/__init__.py
T
bruno 6a5fe0524a
FlowDeck CI / lint (push) Canceled after 0s
FlowDeck CI / test (push) Canceled after 0s
FlowDeck CI / docker (push) Canceled after 0s
refactor: A28 lot 1 — api_v2.py (2 110 L) → package 14 fichiers (v7.29.0)
Découpe par concern de l'ancien app/routers/api_v2.py (2 110 lignes,
115 routes) en package `app/routers/api_v2/` :

- 12 modules de routes : collections 566 L (23 r.), engagement 338 (21),
  workspaces 230 (9), templates_io 205 (9), webhooks 195 (8),
  identity 195 (7), views 164 (8), sharing 160 (8), properties 151 (7),
  planning 148 (7), projects 93 (4), admin 91 (4)
- `_common.py` : helpers partagés (_hash, _v2_rate_check)
- `__init__.py` : router = APIRouter(prefix="/api/v2") + include_router
  sur les routers de sections (sans prefix, tags « api-v2 »)

Preuve contractuelle : `docs/openapi-v2.json` régénéré = IDENTIQUE
byte-à-byte (0 changement de chemin/tag/operation_id). Seul importateur
(app/main.py : from app.routers.api_v2 import router) fonctionne via le
package. En-tête d'imports copié par module puis émondé par ruff --fix
(143 imports morts), I001 réordonnés.

Reste A28 : dashboard.py 2 735 L, collections.py 2 622 L, board.py 2 101 L
(même recette, lots suivants).

suite **1091/1091** · ruff OK · OpenAPI 509 identique · docs à jour
2026-10-01 23:26:45 -04:00

43 lines
814 B
Python

"""FlowDeck — Public API v2.
Découpe A28 : l'ancien `api_v2.py` (2 110 lignes, 115 routes) est devenu
ce package — un module par concern (`_common` = helpers), `router`
agrégé ci-dessous avec le même prefix/tags qu'avant → 0 changement
d'URL, 0 changement d'operation_id.
"""
from __future__ import annotations
from fastapi import APIRouter
from . import (
admin,
collections,
engagement,
identity,
planning,
projects,
properties,
sharing,
templates_io,
views,
webhooks,
workspaces,
)
router = APIRouter(prefix="/api/v2")
for _mod in (
identity,
workspaces,
collections,
properties,
views,
engagement,
sharing,
planning,
templates_io,
projects,
admin,
webhooks,
):
router.include_router(_mod.router)