- Backend: room creation for live streams, permissions CanJoin/CanSend/CanRead for stream rooms - LiveViewChat: useLiveStreamChat hook, WebSocket connection, stream_id as room - LiveViewPlayer: real-time viewer count via polling (5s) - Media Session: seekbackward/seekforward handlers (10s step) - GoLiveView.stories.tsx: Default, Loading, Error, StreamKeyVisible - Docs: API_REFERENCE, CHANGELOG, PROJECT_STATE, FEATURE_STATUS, RETROSPECTIVE_V0703 - SCOPE_CONTROL, .cursorrules: update to v0.801 - Archive V0_703_RELEASE_SCOPE.md
48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
/**
|
|
* FE-API-019: MSW Mock Handlers
|
|
* Mock request handlers for development and testing
|
|
*
|
|
* 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
|
|
* - handlers-cloud: cloud storage, folders, files, quota
|
|
*/
|
|
|
|
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';
|
|
import { handlersCloud } from './handlers-cloud';
|
|
import { handlersStreaming } from './handlers-streaming';
|
|
import { handlersLive } from './handlers-live';
|
|
|
|
export const handlers = [
|
|
...handlersCommon,
|
|
...handlersAuth,
|
|
...handlersAdmin,
|
|
...handlersSocial,
|
|
...handlersMarketplace,
|
|
...handlersTracks,
|
|
...handlersPlaylists,
|
|
...handlersMisc,
|
|
...handlersCloud,
|
|
...handlersStreaming,
|
|
...handlersLive,
|
|
|
|
// 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' });
|
|
}),
|
|
];
|