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
This commit is contained in:
@@ -7,30 +7,88 @@ meta {
|
||||
get {
|
||||
url: {{baseUrl}}/api/conflicts?status=unresolved
|
||||
body: none
|
||||
auth: bearer
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers: {
|
||||
headers {
|
||||
Authorization: Bearer {{token}}
|
||||
}
|
||||
|
||||
docs: {
|
||||
Lists all sync conflicts for the authenticated user.
|
||||
|
||||
Query Parameters:
|
||||
- status: Filter by resolution status (unresolved, user_resolved, auto_resolved, all)
|
||||
|
||||
Response includes:
|
||||
- conflicts: Array of conflict details
|
||||
- total: Total number of conflicts
|
||||
- unresolved: Number of unresolved conflicts
|
||||
|
||||
Each conflict includes:
|
||||
- id: Conflict UUID
|
||||
- media_item_id: Associated book UUID
|
||||
- media_item_title: Book title
|
||||
- conflict_type: Type of conflict (progress, note, highlight)
|
||||
- conflict_data: Side-by-side comparison of conflicting data
|
||||
- resolution_status: Current status
|
||||
- created_at: When conflict was detected
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## List Conflicts
|
||||
|
||||
Lists all sync conflicts for the authenticated user with optional filtering.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/conflicts
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Query Parameters:**
|
||||
- `status` (string, optional): Filter by resolution status
|
||||
- `unresolved`: Only unresolved conflicts (default)
|
||||
- `user_resolved`: Conflicts resolved by user
|
||||
- `auto_resolved`: Automatically resolved conflicts
|
||||
- `all`: All conflicts regardless of status
|
||||
- `type` (string, optional): Filter by conflict type
|
||||
- `progress`: Reading progress conflicts
|
||||
- `note`: Bookmark/note conflicts
|
||||
- `highlight`: Highlight conflicts
|
||||
|
||||
**Response:**
|
||||
- `conflicts` (array): Array of conflict objects
|
||||
- `total` (number): Total number of conflicts matching filters
|
||||
- `unresolved` (number): Number of unresolved conflicts
|
||||
|
||||
**Each Conflict Object:**
|
||||
- `id` (string): Conflict UUID
|
||||
- `media_item_id` (string): Associated book UUID
|
||||
- `media_item_title` (string): Book title
|
||||
- `conflict_type` (string): Type of conflict (progress, note, highlight)
|
||||
- `conflict_data` (object): Side-by-side comparison of conflicting data
|
||||
- `koreader`: Data from KOReader device
|
||||
- `kobo`: Data from Kobo device
|
||||
- `web`: Data from web interface
|
||||
- `resolution_status` (string): Current status (unresolved, user_resolved, auto_resolved)
|
||||
- `created_at` (string): ISO 8601 timestamp when conflict was detected
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
|
||||
**Example Request:**
|
||||
```
|
||||
GET /api/conflicts?status=unresolved&type=progress
|
||||
```
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
{
|
||||
"conflicts": [
|
||||
{
|
||||
"id": "conflict-uuid",
|
||||
"media_item_id": "book-uuid",
|
||||
"media_item_title": "Foundation",
|
||||
"conflict_type": "progress",
|
||||
"conflict_data": {
|
||||
"koreader": { "percentage": 0.65, "epubcfi": "..." },
|
||||
"kobo": { "percentage": 0.43, "epubcfi": "..." }
|
||||
},
|
||||
"resolution_status": "unresolved",
|
||||
"created_at": "2026-01-31T12:00:00Z"
|
||||
}
|
||||
],
|
||||
"total": 1,
|
||||
"unresolved": 1
|
||||
}
|
||||
```
|
||||
|
||||
**Note:** Conflicts occur when multiple devices update the same book data without syncing first.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user