This commit is contained in:
seb
2026-10-14 03:07:21 +02:00
parent 1991c0b529
commit 6c821d381e
10 changed files with 607 additions and 124 deletions

View File

@@ -0,0 +1,55 @@
# `POST /backup/{id}/vfs/recover`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Recover VFS file from a backup
Recovers a specific virtual filesystem (VFS) file from a backup archive into the active VFS directory for the authorized company.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | string | Backup identifier (e.g. backup-2026-10-14_02-00-00, backup-2026-10-14, backup-2026-10) |
## Body (JSON)
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `path` | yes | string | Relative path of the VFS file to recover |
| `companyId` | no | integer | Optional company ID (defaults to user's selected company) |
```json
{
"path": "…",
"companyId": 1
}
```
## Response `200`
VFS file recovered successfully
```json
{
"success": true,
"backupId": "…",
"companyId": 1,
"path": "…",
"sizeBytes": 1,
"mime": "…"
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Validation error or path escapes boundary — `{"error":"…"}` |
| 403 | Not authorized for the company — `{"error":"…"}` |
| 404 | Backup or file not found — `{"error":"…"}` |
| 500 | Internal server error — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._