2025-12-25 12:37:10 +00:00
|
|
|
/**
|
|
|
|
|
* FE-API-019: MSW Mock Handlers
|
|
|
|
|
* Mock request handlers for development and testing
|
2026-02-14 21:40:12 +00:00
|
|
|
*
|
|
|
|
|
* Handlers are split by feature:
|
|
|
|
|
* - handlers-common: external images, csrf
|
|
|
|
|
* - handlers-auth: auth, 2fa, sessions
|
|
|
|
|
* - handlers-admin: audit, dashboard, roles, users list, monitoring, webhooks, api-keys
|
|
|
|
|
* - handlers-social: social feed, posts, groups
|
|
|
|
|
* - handlers-marketplace: marketplace, commerce, cart, orders
|
|
|
|
|
* - handlers-tracks: tracks, comments
|
|
|
|
|
* - handlers-playlists: playlists
|
|
|
|
|
* - handlers-misc: search, notifications, users profile, chat, streaming, inventory, live
|
2025-12-25 12:37:10 +00:00
|
|
|
*/
|
|
|
|
|
|
2026-02-14 21:40:12 +00:00
|
|
|
import { http, HttpResponse } from 'msw';
|
|
|
|
|
import { handlersCommon } from './handlers-common';
|
|
|
|
|
import { handlersAuth } from './handlers-auth';
|
|
|
|
|
import { handlersAdmin } from './handlers-admin';
|
|
|
|
|
import { handlersSocial } from './handlers-social';
|
|
|
|
|
import { handlersMarketplace } from './handlers-marketplace';
|
|
|
|
|
import { handlersTracks } from './handlers-tracks';
|
|
|
|
|
import { handlersPlaylists } from './handlers-playlists';
|
|
|
|
|
import { handlersMisc } from './handlers-misc';
|
Phase 2 stabilisation: code mort, Modal→Dialog, feature flags, tests, router split, Rust legacy
Bloc A - Code mort:
- Suppression Studio (components, views, features)
- Suppression gamification + services mock (projectService, storageService, gamificationService)
- Mise à jour Sidebar, Navbar, locales
Bloc B - Frontend:
- Suppression modal.tsx deprecated, Modal.stories (doublon Dialog)
- Feature flags: PLAYLIST_SEARCH, PLAYLIST_RECOMMENDATIONS, ROLE_MANAGEMENT = true
- Suppression 19 tests orphelins, retrait exclusions vitest.config
Bloc C - Backend:
- Extraction routes_auth.go depuis router.go
Bloc D - Rust:
- Suppression security_legacy.rs (code mort, patterns déjà dans security/)
2026-02-14 16:23:32 +00:00
|
|
|
|
2026-02-14 21:40:12 +00:00
|
|
|
export const handlers = [
|
|
|
|
|
...handlersCommon,
|
|
|
|
|
...handlersAuth,
|
|
|
|
|
...handlersAdmin,
|
|
|
|
|
...handlersSocial,
|
|
|
|
|
...handlersMarketplace,
|
|
|
|
|
...handlersTracks,
|
|
|
|
|
...handlersPlaylists,
|
|
|
|
|
...handlersMisc,
|
2026-02-12 22:12:35 +00:00
|
|
|
|
2026-02-05 11:16:56 +00:00
|
|
|
// Catch-all for API to prevent network leaks (Phase 1: Stabilization)
|
|
|
|
|
http.all('*/api/v1/*', ({ request }) => {
|
|
|
|
|
console.warn('[MSW] Intercepted unhandled API request:', request.method, request.url);
|
|
|
|
|
return HttpResponse.json({ success: true, message: 'Mocked fallback response from Storybook' });
|
|
|
|
|
}),
|
|
|
|
|
];
|