This commit is contained in:
seb
2026-10-04 23:39:49 +02:00
parent 9feca54a0b
commit ab40a38a75
10 changed files with 1217 additions and 865 deletions

View File

@@ -1,60 +0,0 @@
# `GET /articleIndex`
Protected. Requires a valid session cookie (`credentials: 'include'`).
List article search index
Returns every article reachable via the company's category tree.
Designed for client-side search / autocomplete preload.
Auth via company access.
REQUIRES `windowSize`. Without it the response is always an empty list — the full
index can be very large and is not useful to a caller that did not ask for a
specific window. Pass the number of entries the client actually intends to preload.
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `windowSize` | yes | integer | Number of articles to return (window size). Required; omitting it returns an
empty `articles` array. `truncated` is true when more entries exist than were
returned, signalling the client should request a larger window or narrow its
query.
|
## Response `200`
Search index
```json
{
"articles": [
{
"id": 1,
"sku": "…",
"name": "…",
"eans": [
"…"
],
"categoryIds": [
1
]
}
],
"truncated": true
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | No company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Company not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._