This commit is contained in:
seb
2026-09-28 06:50:00 +02:00
parent d2aa9ff8b1
commit e8e4265dc4
11 changed files with 747 additions and 116 deletions

View File

@@ -4624,6 +4624,415 @@
}
}
},
"/labeltemplate": {
"get": {
"tags": [
"LabelTemplate"
],
"summary": "List label templates",
"description": "Lists all ZPL label templates for the selected company. The `thumb` field is returned as a base64-encoded PNG string when present. `content.objects` is omitted to reduce payload size.",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/list.md",
"responses": {
"200": {
"description": "List of label templates",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"labeltemplates": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LabelTemplate"
}
}
}
}
}
}
},
"400": {
"description": "No company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"post": {
"tags": [
"LabelTemplate"
],
"summary": "Create label template",
"description": "Creates a new ZPL label template for the selected company.\nA 50×50 1-bit PNG thumbnail is automatically rendered from the content\nand stored with the template.\n",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/create.md",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LabelTemplateCreateInput"
}
}
}
},
"responses": {
"201": {
"description": "Created label template",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"labeltemplate": {
"$ref": "#/components/schemas/LabelTemplate"
}
}
}
}
}
},
"400": {
"description": "Invalid input or missing fields",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/labeltemplate/{id}": {
"get": {
"tags": [
"LabelTemplate"
],
"summary": "Get label template by ID",
"description": "Retrieves a single label template for the authenticated user's selected company.",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/get.md",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Label template ID"
}
],
"responses": {
"200": {
"description": "Label template details",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"labeltemplate": {
"$ref": "#/components/schemas/LabelTemplate"
}
}
}
}
}
},
"400": {
"description": "Invalid ID or no company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Label template not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"patch": {
"tags": [
"LabelTemplate"
],
"summary": "Update label template (partial)",
"description": "Updates specified fields of an existing label template.\nWhen `content` (or `width`/`height`) is provided, the thumbnail is automatically re-rendered.\n",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/update.md",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Label template ID"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LabelTemplateUpdateInput"
}
}
}
},
"responses": {
"200": {
"description": "Updated label template",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"labeltemplate": {
"$ref": "#/components/schemas/LabelTemplate"
}
}
}
}
}
},
"400": {
"description": "Invalid input",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Label template not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"put": {
"tags": [
"LabelTemplate"
],
"summary": "Update label template",
"description": "Replaces an existing label template.\nWhen `content` (or `width`/`height`) is provided, the thumbnail is automatically re-rendered.\n",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/update.md",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Label template ID"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LabelTemplateUpdateInput"
}
}
}
},
"responses": {
"200": {
"description": "Updated label template",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"labeltemplate": {
"$ref": "#/components/schemas/LabelTemplate"
}
}
}
}
}
},
"400": {
"description": "Invalid input",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Label template not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"delete": {
"tags": [
"LabelTemplate"
],
"summary": "Delete label template",
"description": "Deletes a label template for the authenticated user's selected company.",
"security": [
{
"cookieAuth": []
}
],
"x-markdown": "labeltemplate/delete.md",
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
},
"description": "Label template ID"
}
],
"responses": {
"204": {
"description": "Label template deleted"
},
"400": {
"description": "Invalid ID or no company selected",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Label template not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/health": {
"get": {
"tags": [
@@ -11200,6 +11609,70 @@
}
}
},
"/article/{sku}/print": {
"post": {
"tags": [
"Article"
],
"summary": "Print article label",
"description": "Prints a label for the article using a label template.",
"security": [
{
"cookieAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "sku",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"templateId",
"printerId",
"quantity"
],
"properties": {
"templateId": {
"type": "integer"
},
"printerId": {
"type": "integer"
},
"quantity": {
"type": "integer"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Print job dispatched"
},
"400": {
"description": "Invalid parameters"
},
"404": {
"description": "Printer, Template or Article not found"
},
"500": {
"description": "Server error"
}
}
}
},
"/auth/selected-company": {
"put": {
"tags": [