refactor: true facades
This commit is contained in:
@@ -7,8 +7,11 @@ Manages the list of server endpoints the client can connect to, health-checking
|
||||
```
|
||||
server-directory/
|
||||
├── application/
|
||||
│ ├── server-directory.facade.ts High-level API: server CRUD, search, health, invites, moderation
|
||||
│ └── server-endpoint-state.service.ts Signal-based endpoint list, reconciliation with defaults, localStorage persistence
|
||||
│ ├── facades/
|
||||
│ │ └── server-directory.facade.ts Thin domain boundary, delegates to ServerDirectoryService
|
||||
│ └── services/
|
||||
│ ├── server-directory.service.ts Orchestrator: server CRUD, search, health, invites, moderation
|
||||
│ └── server-endpoint-state.service.ts Signal-based endpoint list, reconciliation with defaults, localStorage persistence
|
||||
│
|
||||
├── domain/
|
||||
│ ├── server-directory.models.ts ServerEndpoint, ServerInfo, ServerJoinAccessResponse, invite/ban/kick types
|
||||
@@ -31,11 +34,12 @@ server-directory/
|
||||
|
||||
## Layer composition
|
||||
|
||||
The facade delegates HTTP work to the API service and endpoint state to the state service. Health probing combines the health service and compatibility service. Storage is accessed only through the state service.
|
||||
The facade is a thin pass-through that delegates to `ServerDirectoryService`. The service delegates HTTP work to the API service and endpoint state to the state service. Health probing combines the health service and compatibility service. Storage is accessed only through the state service.
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
Facade[ServerDirectoryFacade]
|
||||
Service[ServerDirectoryService]
|
||||
State[ServerEndpointStateService]
|
||||
API[ServerDirectoryApiService]
|
||||
Health[ServerEndpointHealthService]
|
||||
@@ -44,17 +48,19 @@ graph TD
|
||||
Defaults[server-endpoint-defaults]
|
||||
Models[server-directory.models]
|
||||
|
||||
Facade --> API
|
||||
Facade --> State
|
||||
Facade --> Health
|
||||
Facade --> Compat
|
||||
Facade --> Service
|
||||
Service --> API
|
||||
Service --> State
|
||||
Service --> Health
|
||||
Service --> Compat
|
||||
API --> State
|
||||
State --> Storage
|
||||
State --> Defaults
|
||||
Health --> Compat
|
||||
|
||||
click Facade "application/server-directory.facade.ts" "High-level API" _blank
|
||||
click State "application/server-endpoint-state.service.ts" "Signal-based endpoint state" _blank
|
||||
click Facade "application/facades/server-directory.facade.ts" "Thin domain boundary" _blank
|
||||
click Service "application/services/server-directory.service.ts" "Orchestrator" _blank
|
||||
click State "application/services/server-endpoint-state.service.ts" "Signal-based endpoint state" _blank
|
||||
click API "infrastructure/server-directory-api.service.ts" "HTTP client for server API" _blank
|
||||
click Health "infrastructure/server-endpoint-health.service.ts" "Health probe" _blank
|
||||
click Compat "infrastructure/server-endpoint-compatibility.service.ts" "Version compatibility" _blank
|
||||
@@ -87,7 +93,7 @@ stateDiagram-v2
|
||||
|
||||
## Health probing
|
||||
|
||||
The facade exposes `testServer(endpointId)` and `testAllServers()`. Both delegate to `ServerEndpointHealthService.probeEndpoint()`, which:
|
||||
The facade exposes `testServer(endpointId)` and `testAllServers()`. Both delegate through the service to `ServerEndpointHealthService.probeEndpoint()`, which:
|
||||
|
||||
1. Sends `GET /api/health` with a 5-second timeout
|
||||
2. Reads the response's `serverVersion` and stable `serverInstanceId`
|
||||
|
||||
Reference in New Issue
Block a user