file api
This commit is contained in:
@@ -84,6 +84,7 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route
|
||||
| [`routes/delivery/delete.md`](routes/delivery/delete.md) | `DELETE /delivery/{id}` |
|
||||
| [`routes/delivery/get.md`](routes/delivery/get.md) | `GET /delivery/{id}` |
|
||||
| [`routes/delivery/update.md`](routes/delivery/update.md) | `PATCH /delivery/{id}` |
|
||||
| [`routes/delivery/file.md`](routes/delivery/file.md) | `GET /delivery/{id}/file/{fileId}` |
|
||||
| [`routes/entity/list.md`](routes/entity/list.md) | `GET /entity` |
|
||||
| [`routes/entity/create.md`](routes/entity/create.md) | `POST /entity` |
|
||||
| [`routes/entity/next-number.md`](routes/entity/next-number.md) | `GET /entity/next-number` |
|
||||
|
||||
@@ -4884,6 +4884,143 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/delivery/{id}/file/{fileId}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Delivery"
|
||||
],
|
||||
"summary": "Get delivery attachment file content",
|
||||
"description": "Returns the full binary content of an attached file (e.g. PDF or text document)\nfor the specified delivery. Supports HTTP caching via ETag (SHA-256 hash) and 304 Not Modified.\n",
|
||||
"security": [
|
||||
{
|
||||
"cookieAuth": []
|
||||
}
|
||||
],
|
||||
"x-markdown": "delivery/file.md",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"description": "Delivery (manifest) ID"
|
||||
},
|
||||
{
|
||||
"in": "path",
|
||||
"name": "fileId",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "integer"
|
||||
},
|
||||
"description": "File ID or attachment ID"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "download",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"description": "When true, sets Content-Disposition to attachment instead of inline"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Full binary file content",
|
||||
"headers": {
|
||||
"Content-Type": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "application/pdf"
|
||||
}
|
||||
},
|
||||
"Content-Disposition": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "inline; filename=\"document.pdf\""
|
||||
}
|
||||
},
|
||||
"ETag": {
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"Cache-Control": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"example": "private, max-age=86400"
|
||||
}
|
||||
}
|
||||
},
|
||||
"content": {
|
||||
"application/pdf": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
},
|
||||
"text/plain": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
},
|
||||
"application/octet-stream": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "binary"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"304": {
|
||||
"description": "Not modified (If-None-Match matched ETag)"
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid id, invalid fileId, or no company selected",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Not authorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Delivery or file not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/customergroup": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -10088,7 +10225,7 @@
|
||||
},
|
||||
"DeliveryFile": {
|
||||
"type": "object",
|
||||
"description": "Attachment metadata (binary content is served via the attachment content endpoints). Thumbnails (AVIF) are generated server-side.",
|
||||
"description": "Attachment metadata (full binary content is served via `GET /delivery/{id}/file/{fileId}`). Thumbnails (AVIF) are generated server-side.",
|
||||
"required": [
|
||||
"id",
|
||||
"manifestId",
|
||||
|
||||
40
docs/api/routes/delivery/file.md
Normal file
40
docs/api/routes/delivery/file.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# `GET /delivery/{id}/file/{fileId}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get delivery attachment file content
|
||||
|
||||
Returns the full binary content of an attached file (e.g. PDF or text document)
|
||||
for the specified delivery. Supports HTTP caching via ETag (SHA-256 hash) and 304 Not Modified.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Delivery (manifest) ID |
|
||||
| `fileId` | yes | integer | File ID or attachment ID |
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `download` | no | boolean | When true, sets Content-Disposition to attachment instead of inline |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Full binary file content
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 304 | Not modified (If-None-Match matched ETag) |
|
||||
| 400 | Invalid id, invalid fileId, or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Delivery or file not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user