docs: update API.md, FRONTEND.md, MODULES.md, CLAUDE.md for Phase 1 and 2 completion
- API.md: add GET /config/schema endpoint docs; add GET|PUT /missions/rotation endpoints; fix mission response shape (name/filename/size_bytes/terrain); mark Phase 1+2 as done - FRONTEND.md: add TagListEditor, useServerConfigSchema, useServerMissionRotation, useUpdateMissionRotation; update Mission/Mod type notes; remove planned hooks now live - MODULES.md: update config_generator and missions_router descriptions - CLAUDE.md: mark Phase 1 and 2 as Done
This commit is contained in:
108
API.md
108
API.md
@@ -790,6 +790,39 @@ Get all config sections combined. Sensitive fields (passwords) are masked with `
|
||||
|
||||
---
|
||||
|
||||
### GET /servers/{server_id}/config/schema
|
||||
|
||||
Returns per-field widget hints for the frontend config editor. Used by `ConfigEditor` to render the correct UI widget (text box, toggle, select, tag list, etc.) for each field.
|
||||
|
||||
**Auth:** Required (any role)
|
||||
|
||||
**Response 200:**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"server": {
|
||||
"hostname": { "widget": "text", "label": "Server Hostname" },
|
||||
"max_players": { "widget": "number", "label": "Max Players", "min": 1, "max": 1000 },
|
||||
"password": { "widget": "password", "label": "Player Password" },
|
||||
"forced_difficulty": { "widget": "select", "label": "Difficulty Preset", "options": ["Recruit", "Regular", "Veteran", "Custom"] },
|
||||
"battleye": { "widget": "toggle", "label": "BattleEye Anti-Cheat" },
|
||||
"motd_lines": { "widget": "textarea", "label": "Message of the Day (one line per row)" },
|
||||
"admin_uids": { "widget": "tag-list", "label": "Admin Steam UIDs", "placeholder": "76561198000000000" }
|
||||
},
|
||||
"rcon": {
|
||||
"rcon_password": { "widget": "password", "label": "RCon Password" }
|
||||
}
|
||||
},
|
||||
"error": null
|
||||
}
|
||||
```
|
||||
|
||||
Returns `{}` if the adapter does not implement `get_ui_schema()`.
|
||||
|
||||
---
|
||||
|
||||
### GET /servers/{server_id}/config/preview
|
||||
|
||||
Rendered config for preview. Admin only because it may contain plaintext credentials.
|
||||
@@ -1182,10 +1215,10 @@ List all available mission/scenario files on disk.
|
||||
"total": 2,
|
||||
"missions": [
|
||||
{
|
||||
"name": "MyMission.Altis",
|
||||
"filename": "MyMission.Altis.pbo",
|
||||
"mission_name": "MyMission.Altis",
|
||||
"terrain": "Altis",
|
||||
"file_size": 102400
|
||||
"size_bytes": 102400,
|
||||
"terrain": "Altis"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1226,6 +1259,63 @@ Upload a mission file. **Multipart form-data**. Maximum file size: **500 MB**. F
|
||||
|
||||
---
|
||||
|
||||
### GET /servers/{server_id}/missions/rotation
|
||||
|
||||
Get the current mission rotation from the server config.
|
||||
|
||||
**Auth:** Required (any role)
|
||||
|
||||
**Response 200:**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"missions": [
|
||||
{ "name": "MyMission.Altis", "difficulty": "Regular" },
|
||||
{ "name": "TvT.Stratis", "difficulty": "Veteran" }
|
||||
]
|
||||
},
|
||||
"error": null
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### PUT /servers/{server_id}/missions/rotation
|
||||
|
||||
Replace the mission rotation. Uses **optimistic locking** — must include `config_version` from the last server config read.
|
||||
|
||||
**Auth:** Admin required
|
||||
|
||||
**Request:**
|
||||
|
||||
```json
|
||||
{
|
||||
"missions": [
|
||||
{ "name": "MyMission.Altis", "difficulty": "Regular" },
|
||||
{ "name": "TvT.Stratis", "difficulty": "" }
|
||||
],
|
||||
"config_version": 3
|
||||
}
|
||||
```
|
||||
|
||||
`difficulty` can be `""` for default, or one of `"Recruit"`, `"Regular"`, `"Veteran"`, `"Custom"`.
|
||||
|
||||
**Response 200:**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": { "missions": [ ... ] },
|
||||
"error": null
|
||||
}
|
||||
```
|
||||
|
||||
**Error 409:** Config version conflict — re-fetch and retry.
|
||||
|
||||
---
|
||||
|
||||
### DELETE /servers/{server_id}/missions/{filename}
|
||||
|
||||
Delete a mission file by filename. Removes the file from disk.
|
||||
@@ -1491,20 +1581,20 @@ Implemented via `slowapi` middleware.
|
||||
|
||||
## Upcoming Endpoints (UX Enhancement Plan)
|
||||
|
||||
These endpoints are planned and will be added during the Arma 3 UX Enhancement implementation. They do not exist yet.
|
||||
Endpoints planned during the Arma 3 UX Enhancement. ✅ = implemented.
|
||||
|
||||
### Phase 1 — Config UI Schema
|
||||
### Phase 1 — Config UI Schema ✅
|
||||
|
||||
| Method | Path | Auth | Description |
|
||||
|--------|------|------|-------------|
|
||||
| GET | `/servers/{server_id}/config/ui-schema` | Bearer | Returns widget hints per field (`widget`, `label`, `placeholder`) for the frontend config editor |
|
||||
| GET ✅ | `/servers/{server_id}/config/schema` | Bearer | Returns widget hints per field for the frontend config editor |
|
||||
|
||||
### Phase 2 — Mission Rotation
|
||||
### Phase 2 — Mission Rotation ✅
|
||||
|
||||
| Method | Path | Auth | Description |
|
||||
|--------|------|------|-------------|
|
||||
| GET | `/servers/{server_id}/missions/rotation` | Bearer | Get current mission rotation list |
|
||||
| PUT | `/servers/{server_id}/missions/rotation` | Admin | Replace mission rotation (requires `config_version` for optimistic locking) |
|
||||
| GET ✅ | `/servers/{server_id}/missions/rotation` | Bearer | Get current mission rotation list |
|
||||
| PUT ✅ | `/servers/{server_id}/missions/rotation` | Admin | Replace mission rotation (requires `config_version` for optimistic locking) |
|
||||
|
||||
### Phase 4 — Player Kick / Ban
|
||||
|
||||
|
||||
Reference in New Issue
Block a user