Files
bookhoard/bruno/koreader/Sync Progress (SHA-256).bru
T
john-okeefe 3117ce54ec refactor(bruno): migrate API tests to Bruno DSL format
- 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
2026-02-08 20:49:06 -05:00

92 lines
2.2 KiB
Plaintext

meta {
name: KOReader Sync Progress - SHA-256
type: http
seq: 1
}
post {
url: {{base_url}}/api/v1/koreader/sync/progress
body: json
auth: inherit
}
headers {
Authorization: Bearer {{koreader_device_token}}
Content-Type: application/json
}
body:json {
{
"sync_mode": "immediate",
"books": [
{
"uuid": "{{book_uuid}}",
"sha256": "{{book_sha256}}",
"file_path": "/mnt/onboard/The%20Hobbit.epub",
"percentage": 0.65,
"chapter": 5,
"page": 142,
"total_pages": 310,
"epubcfi": "/6/4[chap1ref]!/4/2/1:0",
"last_read": "2026-01-31T12:00:00Z",
"title": "The Hobbit",
"authors": ["J.R.R. Tolkien"]
}
]
}
}
script:post-response {
function onResponse(res) {
if (res.getStatus() === 200 || res.getStatus() === 202) {
const body = res.getBody();
tests['Status accepted'] = res.getStatus() === 200 || res.getStatus() === 202;
tests('Has sync_status', body.sync_status !== undefined);
tests('Books synced >= 0', body.books_synced >= 0);
}
}
onResponse(res);
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## KOReader Sync Progress - SHA-256
Synchronizes reading progress from a KOReader device using SHA-256 book hash for identification.
**Method:** POST
**Endpoint:** /api/v1/koreader/sync/progress
**Authentication:** Bearer token (KOReader device token)
**Request Body:**
- `sync_mode` (string): Sync mode (immediate, deferred)
- `books` (array): Array of book progress objects
- `uuid` (string): Book UUID
- `sha256` (string): SHA-256 hash of book file for identification
- `file_path` (string): Path to book file on device
- `percentage` (number): Progress percentage (0-1)
- `chapter` (number): Current chapter
- `page` (number): Current page
- `total_pages` (number): Total pages
- `epubcfi` (string): EPUB location
- `last_read` (string): ISO 8601 timestamp
- `title` (string): Book title
- `authors` (array): List of authors
**Response:**
- `sync_status` (string): Sync status
- `books_synced` (number): Number of books synced
**Status Codes:**
- 200: Success
- 202: Accepted - processing
- 401: Unauthorized
- 500: Internal server error
}