u
This commit is contained in:
@@ -4,7 +4,7 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List label templates
|
||||
|
||||
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.
|
||||
Lists all ZPL label templates for the selected company. The `thumb` field is returned as a base64-encoded PNG string when present. The `content` field is omitted to reduce payload size (use GET /labeltemplate/{id} for it).
|
||||
|
||||
## Response `200`
|
||||
|
||||
|
||||
39
docs/api/routes/modelconversation.get.md
Normal file
39
docs/api/routes/modelconversation.get.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# `GET /modelconversation`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List conversations
|
||||
|
||||
Lists the authenticated user's model conversations in the selected company, most recently updated first.
|
||||
|
||||
## Response `200`
|
||||
|
||||
List of conversations
|
||||
|
||||
```json
|
||||
{
|
||||
"conversations": [
|
||||
{
|
||||
"id": 1,
|
||||
"companyuser_id": 1,
|
||||
"provider": "…",
|
||||
"model": "…",
|
||||
"created_at": "…",
|
||||
"updated_at": "…",
|
||||
"state": "idle"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | No company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
51
docs/api/routes/modelconversation.post.md
Normal file
51
docs/api/routes/modelconversation.post.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# `POST /modelconversation`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create conversation
|
||||
|
||||
Creates a new conversation in state `idle`.
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `provider` | yes | string | |
|
||||
| `model` | yes | string | |
|
||||
|
||||
```json
|
||||
{
|
||||
"provider": "…",
|
||||
"model": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created conversation
|
||||
|
||||
```json
|
||||
{
|
||||
"conversation": {
|
||||
"id": 1,
|
||||
"companyuser_id": 1,
|
||||
"provider": "…",
|
||||
"model": "…",
|
||||
"created_at": "…",
|
||||
"updated_at": "…",
|
||||
"state": "idle"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid input or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
32
docs/api/routes/modelconversation/_id.delete.md
Normal file
32
docs/api/routes/modelconversation/_id.delete.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# `DELETE /modelconversation/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Delete conversation
|
||||
|
||||
Deletes one of the authenticated user's model conversations and all its messages.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Conversation ID |
|
||||
|
||||
## Response `204`
|
||||
|
||||
Conversation deleted
|
||||
|
||||
_No content_
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Conversation not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
44
docs/api/routes/modelconversation/_id.get.md
Normal file
44
docs/api/routes/modelconversation/_id.get.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# `GET /modelconversation/{id}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Get conversation
|
||||
|
||||
Gets details and current state of one of the authenticated user's model conversations.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Conversation ID |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Conversation details
|
||||
|
||||
```json
|
||||
{
|
||||
"conversation": {
|
||||
"id": 1,
|
||||
"companyuser_id": 1,
|
||||
"provider": "…",
|
||||
"model": "…",
|
||||
"created_at": "…",
|
||||
"updated_at": "…",
|
||||
"state": "idle"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Conversation not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
44
docs/api/routes/modelconversation/_id/message.get.md
Normal file
44
docs/api/routes/modelconversation/_id/message.get.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# `GET /modelconversation/{id}/message`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
List conversation messages
|
||||
|
||||
Lists messages of one of the user's own conversations, oldest first.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Conversation ID |
|
||||
|
||||
## Response `200`
|
||||
|
||||
List of messages
|
||||
|
||||
```json
|
||||
{
|
||||
"messages": [
|
||||
{
|
||||
"id": 1,
|
||||
"conversation_id": 1,
|
||||
"created_at": "…",
|
||||
"role": "system",
|
||||
"message": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Conversation not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
65
docs/api/routes/modelconversation/_id/message.post.md
Normal file
65
docs/api/routes/modelconversation/_id/message.post.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# `POST /modelconversation/{id}/message`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Post a user message
|
||||
|
||||
Appends a message with role `user` to the conversation.
|
||||
Refused with 409 unless the conversation state is `idle`.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Conversation ID |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `message` | no | string | User message text or fallback content |
|
||||
| `role` | no | string | Message role ('user' or 'tool') |
|
||||
| `tool_call_id` | no | string | Target tool call ID when responding to a tool like ask_user |
|
||||
| `content` | no | | Tool response content payload |
|
||||
| `answer` | no | | Shorthand answer for ask_user response |
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "…",
|
||||
"role": "user",
|
||||
"tool_call_id": "…",
|
||||
"content": "…",
|
||||
"answer": "…"
|
||||
}
|
||||
```
|
||||
|
||||
## Response `201`
|
||||
|
||||
Created message
|
||||
|
||||
```json
|
||||
{
|
||||
"message": {
|
||||
"id": 1,
|
||||
"conversation_id": 1,
|
||||
"created_at": "…",
|
||||
"role": "system",
|
||||
"message": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID, empty message or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Conversation not found — `{"error":"…"}` |
|
||||
| 409 | Conversation is not idle — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
37
docs/api/routes/modelconversation/_id/stream.md
Normal file
37
docs/api/routes/modelconversation/_id/stream.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# `GET /modelconversation/{id}/stream`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Stream conversation events (SSE)
|
||||
|
||||
Opens a Server-Sent Events stream for the specified conversation.
|
||||
Streams `message` events (persisted user/assistant messages), live `delta`
|
||||
text chunks of the model answer, and `state` events (`thinking`, `working`,
|
||||
`done`). The SSE states are not stored; the database only knows `idle`/`busy`.
|
||||
`done` carries `usage` (`input`, `cached`, `output`, `cost`) on success or
|
||||
`error` (string) if the run failed.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `id` | yes | integer | Conversation ID |
|
||||
|
||||
## Response `200`
|
||||
|
||||
SSE stream (`text/event-stream`). Emits `state`, `delta`, and `message` events.
|
||||
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 403 | Not authorized — `{"error":"…"}` |
|
||||
| 404 | Conversation not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
62
docs/api/routes/public/_companyId/articles.md
Normal file
62
docs/api/routes/public/_companyId/articles.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# `GET /public/{companyId}/articles`
|
||||
|
||||
Public. No cookie required.
|
||||
|
||||
List public articles
|
||||
|
||||
Returns a paginated list of catalog articles for the specified company, optionally filtered by category.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `companyId` | yes | integer | Company ID |
|
||||
|
||||
## Query parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `categoryId` | no | integer | Optional category ID to filter by |
|
||||
| `search` | no | string | Search query for name or SKU |
|
||||
| `limit` | no | integer | Number of articles to return (max 200) |
|
||||
| `offset` | no | integer | Number of articles to skip |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Articles list
|
||||
|
||||
```json
|
||||
{
|
||||
"articles": [
|
||||
{
|
||||
"id": 1,
|
||||
"sku": "…",
|
||||
"name": "…",
|
||||
"slug": "…",
|
||||
"net": 1,
|
||||
"taxRate": 1,
|
||||
"gross": 1,
|
||||
"trackStock": true,
|
||||
"brand": {
|
||||
"id": 1,
|
||||
"name": "…"
|
||||
},
|
||||
"fullHash": "…",
|
||||
"thumbW": 1,
|
||||
"thumbH": 1,
|
||||
"thumbHash": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid parameters — `{"error":"…"}` |
|
||||
| 404 | Company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
64
docs/api/routes/public/_companyId/articles/_sku.md
Normal file
64
docs/api/routes/public/_companyId/articles/_sku.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# `GET /public/{companyId}/articles/{sku}`
|
||||
|
||||
Public. No cookie required.
|
||||
|
||||
Get public article detail
|
||||
|
||||
Returns detailed public catalog data for a single article identified by SKU.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `companyId` | yes | integer | Company ID |
|
||||
| `sku` | yes | string | Article SKU |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Article detail
|
||||
|
||||
```json
|
||||
{
|
||||
"article": {
|
||||
"id": 1,
|
||||
"sku": "…",
|
||||
"name": "…",
|
||||
"slug": "…",
|
||||
"description": "…",
|
||||
"unitamount": 1,
|
||||
"weight": 1,
|
||||
"trackStock": true,
|
||||
"unit": {},
|
||||
"brand": {},
|
||||
"price": {},
|
||||
"prices": [
|
||||
{}
|
||||
],
|
||||
"categories": [
|
||||
{}
|
||||
],
|
||||
"photos": [
|
||||
{}
|
||||
],
|
||||
"eans": [
|
||||
"…"
|
||||
],
|
||||
"isFather": true,
|
||||
"fatherSku": "…",
|
||||
"variants": [
|
||||
{}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid parameters — `{"error":"…"}` |
|
||||
| 404 | Article or Company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
46
docs/api/routes/public/_companyId/categories.md
Normal file
46
docs/api/routes/public/_companyId/categories.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# `GET /public/{companyId}/categories`
|
||||
|
||||
Public. No cookie required.
|
||||
|
||||
List public categories
|
||||
|
||||
Returns the category tree for the specified company.
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `companyId` | yes | integer | Company ID |
|
||||
|
||||
## Response `200`
|
||||
|
||||
Category list
|
||||
|
||||
```json
|
||||
{
|
||||
"categories": [
|
||||
{
|
||||
"id": 1,
|
||||
"parentId": 1,
|
||||
"sort": 1,
|
||||
"name": "…",
|
||||
"slug": "…",
|
||||
"fullHash": "…",
|
||||
"thumbW": 1,
|
||||
"thumbH": 1,
|
||||
"thumbHash": "…"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid parameters — `{"error":"…"}` |
|
||||
| 404 | Company not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user