- 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
91 lines
1.9 KiB
Plaintext
91 lines
1.9 KiB
Plaintext
meta {
|
|
name: KOReader Sync Bookmarks - SHA-256
|
|
type: http
|
|
seq: 3
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/v1/koreader/sync/bookmarks
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{koreader_device_token}}
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"book_sha256": "{{book_sha256}}",
|
|
"bookmarks": [
|
|
{
|
|
"text": "Important passage about chapter 3",
|
|
"pos0": "/6/4[chap3ref]!/4/2/1:0",
|
|
"page": 45,
|
|
"type": "bookmark"
|
|
}
|
|
],
|
|
"notes": [
|
|
{
|
|
"notes": "My note about this section",
|
|
"pos0": "/6/4[chap3ref]!/4/2/1:100",
|
|
"page": 47,
|
|
"text": "Quoted text from the book"
|
|
}
|
|
],
|
|
"highlights": [
|
|
{
|
|
"text": "This is highlighted text",
|
|
"pos0": "/6/4[chap3ref]!/4/2/1:50",
|
|
"pos1": "/6/4[chap3ref]!/4/2/1:100",
|
|
"color": "#ffff00",
|
|
"page": 50
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
function onResponse(res) {
|
|
if (res.getStatus() === 200) {
|
|
const body = res.getBody();
|
|
tests('Sync completed', body.sync_status === "completed");
|
|
tests('Total synced >= 0', body.total_synced >= 0);
|
|
}
|
|
}
|
|
onResponse(res);
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## KOReader Sync Bookmarks - SHA-256
|
|
|
|
Synchronizes bookmarks, notes, and highlights from KOReader using SHA-256 hash for book identification.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/v1/koreader/sync/bookmarks
|
|
|
|
**Authentication:** Bearer token (KOReader device token)
|
|
|
|
**Request Body:**
|
|
- `book_sha256` (string): SHA-256 hash of book file
|
|
- `bookmarks` (array): Array of bookmarks
|
|
- `notes` (array): Array of notes
|
|
- `highlights` (array): Array of highlights
|
|
|
|
**Response:**
|
|
- `sync_status` (string): Sync status
|
|
- `total_synced` (number): Total items synced
|
|
|
|
**Status Codes:**
|
|
- 200: Success
|
|
- 401: Unauthorized
|
|
- 500: Internal server error
|
|
}
|