- Convert all existing .bru files from JSON to Bruno DSL format - Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru) - Update auth configuration to use 'inherit' instead of explicit bearer tokens - Add comprehensive documentation to all test files - Improve test scripts with proper assertions and error handling
62 lines
1.4 KiB
Plaintext
62 lines
1.4 KiB
Plaintext
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
|
|
}
|