docs: add Carousel dashboard implementation plan
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
meta {
|
||||
name: Download Device Sidecar File
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/devices/{{device_id}}/sidecar/download
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{user_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const headers = res.getHeaders();
|
||||
const contentType = headers.get("Content-Type");
|
||||
const contentDisposition = headers.get("Content-Disposition");
|
||||
tests('Content-Type is JSON', contentType && contentType.includes("application/json"));
|
||||
tests('Has .bookhoard.json filename', contentDisposition && contentDisposition.includes(".bookhoard.json"));
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Download Device Sidecar File
|
||||
|
||||
Downloads the sidecar configuration file for a device in JSON format.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/devices/{device_id}/sidecar/download
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
|
||||
**Response Headers:**
|
||||
- `Content-Type`: application/json
|
||||
- `Content-Disposition`: attachment; filename="device.bookhoard.json"
|
||||
|
||||
**Response Body:** JSON sidecar configuration file
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success - file returned
|
||||
- 401: Unauthorized
|
||||
- 404: Device not found
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
meta {
|
||||
name: Get Device Sidecar Config
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/devices/{{device_id}}/sidecar
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{user_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Version is 1.0', body.version === "1.0");
|
||||
tests('Has bookhoard config', body.bookhoard !== undefined);
|
||||
tests('Has books array', body.books !== undefined);
|
||||
tests('Has collections array', body.collections !== undefined);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Device Sidecar Config
|
||||
|
||||
Retrieves sidecar configuration for a specific device.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/devices/{device_id}/sidecar
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
|
||||
**Response:**
|
||||
- `version` (string): Sidecar version (e.g., "1.0")
|
||||
- `bookhoard` (object): Bookhoard configuration
|
||||
- `books` (array): Array of book configurations
|
||||
- `collections` (array): Array of collection configurations
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Device not found
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
meta {
|
||||
name: Get System Configuration
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/system/config
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{admin_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Has base_url', body.base_url !== undefined);
|
||||
tests('Has opds_base_url', body.opds_base_url !== undefined);
|
||||
tests('Has api_base_url', body.api_base_url !== undefined);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get System Configuration
|
||||
|
||||
Retrieves system-wide configuration settings.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/system/config
|
||||
|
||||
**Authentication:** Bearer token (admin only)
|
||||
|
||||
**Response:**
|
||||
- `base_url` (string): Base URL
|
||||
- `opds_base_url` (string): OPDS endpoint URL
|
||||
- `api_base_url` (string): API endpoint URL
|
||||
- Additional configuration fields
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin only)
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
meta {
|
||||
name: Update System Configuration
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{base_url}}/api/system/config
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{admin_token}}
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"base_url": "https://bookhoard.example.com",
|
||||
"opds_base_url": "https://bookhoard.example.com/opds",
|
||||
"api_base_url": "https://bookhoard.example.com/api"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
const body = res.getBody();
|
||||
tests('Status is success', body.status === "success");
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Update System Configuration
|
||||
|
||||
Updates system-wide configuration settings for the Bookhoard instance.
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
**Endpoint:** /api/system/config
|
||||
|
||||
**Authentication:** Bearer token (admin only)
|
||||
|
||||
**Request Body:**
|
||||
- `base_url` (string): Base URL for the instance
|
||||
- `opds_base_url` (string): OPDS endpoint base URL
|
||||
- `api_base_url` (string): API endpoint base URL
|
||||
|
||||
**Response:**
|
||||
- `status` (string): Update status
|
||||
- `config` (object): Updated configuration
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid configuration
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin only)
|
||||
- 500: Internal server error
|
||||
}
|
||||
Reference in New Issue
Block a user