OpenAPI spec at /api/docs with a Scalar viewer, opt-in via FEAT_API_DOCS

This commit is contained in:
jarek committed 2026-08-17 09:50:34 +02:00
1 parent ba8670af66
commit da26f7f764
251 files changed
+32497 -66

No files matched your search

@@ -84,6 +84,22 @@ function createTarArchive(filename: string, content: Uint8Array): Uint8Array {
return tar;
}
/**
* POST /api/containers/{id}/files/upload - Upload files into a container
*
* @openapi
* summary: Upload one or more files into a container directory (requires the 'exec' permission)
* description: Send `multipart/form-data` with one or more `files` parts; each file is tar-wrapped and written into the target directory. Partial success is reported per file in `uploaded`/`errors`.
* path: id:string! Container ID or name (from GET /api/containers)
* query: env:integer The target environment ID (omit for the local/default Docker host) (from GET /api/environments)
* query: path:string! Absolute target directory inside the container
* resp-200: {success:boolean!, uploaded:array<string>!, errors:array<string>}
* resp-200-example: {"success":true,"uploaded":["app.conf"]}
* resp-400: Target path missing, or no files provided
* resp-403: Permission denied to write to the path
* resp-404: Target directory not found
* resp-500: Failed to upload the files
*/
export const POST: RequestHandler = async ({ params, url, request, cookies }) => {
const invalid = validateDockerIdParam(params.id, 'container');
if (invalid) return invalid;