Add company settings and number sequence API routes
- Add CompanySetting routes (list, get, set) backed by company-scoped store - Add Number routes (list, update) for managing number sequences - Register new store namespaces for numbers and companysetting - Add CompanySetting and NumberSequence schemas to OpenAPI - Regenerate API docs and index for the new routes
This commit is contained in:
51
docs/api/routes/companysetting/set.md
Normal file
51
docs/api/routes/companysetting/set.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# `PUT /company/setting/{key}`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Upsert company setting
|
||||
|
||||
Sets (upserts) a company setting for the selected company.
|
||||
Only a fixed allow-list of keys can be set: `ui.theme`, `keys.tavily`,
|
||||
`keys.openrouter`, `labelprinter.addr`, `labelprinter.type`.
|
||||
|
||||
|
||||
## Path parameters
|
||||
|
||||
| Param | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `key` | yes | string | |
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
```json
|
||||
{
|
||||
"value": "dark",
|
||||
"frontend": true
|
||||
}
|
||||
```
|
||||
|
||||
## Response `200`
|
||||
|
||||
Upserted company setting
|
||||
|
||||
```json
|
||||
{
|
||||
"setting": {
|
||||
"key": "…",
|
||||
"value": "…"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid setting, invalid key, or 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`._
|
||||
Reference in New Issue
Block a user