From c60b899c4d21e4ccc963fd10697631cb553029b3 Mon Sep 17 00:00:00 2001 From: seb Date: Sun, 1 Nov 2026 04:33:45 +0100 Subject: [PATCH] u --- docs/api/README.md | 1 + docs/api/routes-all.md | 5 +- docs/api/routes.md | 5 +- docs/api/routes/labeltemplate/testprint.md | 59 ++++++++++++++++++++++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 docs/api/routes/labeltemplate/testprint.md diff --git a/docs/api/README.md b/docs/api/README.md index e610b6d..7c14491 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -173,6 +173,7 @@ Generated from `@openapi` annotations in [`src/api/routes/`](../../src/api/route | [`routes/image/get.md`](routes/image/get.md) | `GET /image/{fullHash}` | | [`routes/labeltemplate/list.md`](routes/labeltemplate/list.md) | `GET /labeltemplate` | | [`routes/labeltemplate/create.md`](routes/labeltemplate/create.md) | `POST /labeltemplate` | +| [`routes/labeltemplate/testprint.md`](routes/labeltemplate/testprint.md) | `POST /labeltemplate/testprint` | | [`routes/labeltemplate/delete.md`](routes/labeltemplate/delete.md) | `DELETE /labeltemplate/{id}` | | [`routes/labeltemplate/get.md`](routes/labeltemplate/get.md) | `GET /labeltemplate/{id}` | | [`routes/labeltemplate/update.md`](routes/labeltemplate/update.md) | `PATCH /labeltemplate/{id}` | diff --git a/docs/api/routes-all.md b/docs/api/routes-all.md index 8627f24..4d955af 100644 --- a/docs/api/routes-all.md +++ b/docs/api/routes-all.md @@ -1,6 +1,6 @@ # Dash API Routes Overview (All) -Overview of all 306 API endpoints across all modules. +Overview of all 307 API endpoints across all modules. ### Notation @@ -558,6 +558,9 @@ _none_ #### Create label template — `POST /labeltemplate` - Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: { objects: T25[] } }` - Returns: `201 { labeltemplate: T9 }` +#### Test print label template — `POST /labeltemplate/testprint` +- Params: `body: { printerId?: int, agentprinterId?: int, templateId?: int, objects?: any[], width?: int, height?: int, dpi?: int, sku?: str, quantity?: int }` +- Returns: `200 { success: bool }` #### Delete label template — `DELETE /labeltemplate/{id}` - Params: `id: int` - Returns: `204 void` diff --git a/docs/api/routes.md b/docs/api/routes.md index 3b1ac61..fe97b8a 100644 --- a/docs/api/routes.md +++ b/docs/api/routes.md @@ -1,6 +1,6 @@ # Dash API Routes Overview -Overview of all 226 API endpoints across all modules. +Overview of all 227 API endpoints across all modules. ### Notation @@ -430,6 +430,9 @@ _none_ #### Create label template — `POST /labeltemplate` - Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: { objects: T19[] } }` - Returns: `201 { labeltemplate: T6 }` +#### Test print label template — `POST /labeltemplate/testprint` +- Params: `body: { printerId?: int, agentprinterId?: int, templateId?: int, objects?: any[], width?: int, height?: int, dpi?: int, sku?: str, quantity?: int }` +- Returns: `200 { success: bool }` #### Delete label template — `DELETE /labeltemplate/{id}` - Params: `id: int` - Returns: `204 void` diff --git a/docs/api/routes/labeltemplate/testprint.md b/docs/api/routes/labeltemplate/testprint.md new file mode 100644 index 0000000..3c5f63f --- /dev/null +++ b/docs/api/routes/labeltemplate/testprint.md @@ -0,0 +1,59 @@ +# `POST /labeltemplate/testprint` + +Protected. Requires a valid session cookie (`credentials: 'include'`). + +Test print label template + +Dispatches a test print job for a label template or unsaved canvas objects to a specified ZPL printer. +Placeholders in text and barcodes are interpolated using a sample article or the specified article SKU. + + +## Body (JSON) + +| Field | Required | Type | Description | +|-------|----------|------|-------------| +| `printerId` | no | integer | | +| `agentprinterId` | no | integer | | +| `templateId` | no | integer | | +| `objects` | no | any[] | | +| `width` | no | integer | | +| `height` | no | integer | | +| `dpi` | no | integer | | +| `sku` | no | string | | +| `quantity` | no | integer | | + +```json +{ + "printerId": 1, + "agentprinterId": 1, + "templateId": 1, + "objects": [], + "width": 1, + "height": 1, + "dpi": 1, + "sku": "…", + "quantity": 1 +} +``` + +## Response `200` + +Print job created + +```json +{ + "success": true +} +``` + +## Errors + +| Status | Description | +|--------|-------------| +| 400 | Invalid parameters | +| 404 | Printer or template not found | +| 500 | Server error | + +--- + +_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._