Refactor: rename baseUrl to base_url in .bru files
Update configuration key naming convention to use snake_case consistently. Applies changes recursively across all subdirectories.
This commit is contained in:
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/analytics/device-usage
|
||||
url: {{base_url}}/api/analytics/device-usage
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/analytics/popular-books?limit=10
|
||||
url: {{base_url}}/api/analytics/popular-books?limit=10
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/analytics/reading-stats?start_date=2024-01-01&end_date=2024-01-31
|
||||
url: {{base_url}}/api/analytics/reading-stats?start_date=2024-01-01&end_date=2024-01-31
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/analytics/reading-stats
|
||||
url: {{base_url}}/api/analytics/reading-stats
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/books/bulk-delete
|
||||
url: {{base_url}}/api/books/bulk-delete
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/books/bulk-update
|
||||
url: {{base_url}}/api/books/bulk-update
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/bulk-add-books
|
||||
url: {{base_url}}/api/collections/bulk-add-books
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,14 +5,13 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{authToken}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
@@ -25,31 +24,77 @@ body:json {
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
tests['All books removed'] = true;
|
||||
const body = res.getBody();
|
||||
tests['Removed equals total'] = body.removed === body.total;
|
||||
tests['Total is 3'] = body.total === 3;
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Bulk Remove Books - All Books
|
||||
## Bulk Remove Books from Collection
|
||||
|
||||
Tests removing multiple books from a collection in a single request.
|
||||
Removes multiple books from a collection in a single request.
|
||||
|
||||
**Expected Result:** 200 OK with removed: 3, total: 3
|
||||
**Method:** POST
|
||||
|
||||
**Purpose:** Verifies the bulk remove functionality works correctly when removing multiple books that all exist in the collection.
|
||||
**Endpoint:** /api/collections/{collection_id}/books/bulk-remove
|
||||
|
||||
**Use Case:** Common scenario when a user wants to remove several books from a collection at once, such as when reorganizing their library or removing books they've finished reading.
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `collection_id` (string): Collection UUID
|
||||
|
||||
**Request Body:**
|
||||
- `book_ids` (array): Array of book UUIDs to remove from the collection
|
||||
|
||||
**Response:**
|
||||
- `removed` (number): Number of books successfully removed
|
||||
- `total` (number): Total number of books processed
|
||||
- `results` (array): Results for each removal attempt
|
||||
- `book_id` (string): Book UUID
|
||||
- `success` (boolean): Whether the removal succeeded
|
||||
- `error` (string, optional): Error message if failed
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success (with partial results if some failed)
|
||||
- 400: Invalid request data (e.g., empty book_ids array)
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden
|
||||
- 404: Collection not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Example Request:**
|
||||
```json
|
||||
{
|
||||
"book_ids": [
|
||||
"book-uuid-1",
|
||||
"book-uuid-2",
|
||||
"book-uuid-3"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
{
|
||||
"removed": 2,
|
||||
"total": 3,
|
||||
"results": [
|
||||
{
|
||||
"book_id": "book-uuid-1",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"book_id": "book-uuid-2",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"book_id": "book-uuid-3",
|
||||
"success": false,
|
||||
"error": "Book not in collection"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Note:** Removing a book that's not in the collection returns success: false for that book but doesn't fail the entire request. Empty book_ids array returns 400.
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
url: {{base_url}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
meta {
|
||||
name: Bulk Remove Books from Collection
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/{{collection_id}}/books/bulk-remove
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{authToken}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"book_ids": [
|
||||
"{{bookId1}}",
|
||||
"{{bookId2}}",
|
||||
"{{bookId3}}"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
if (res.getStatus() === 200) {
|
||||
tests['Bulk remove successful'] = true;
|
||||
const body = res.getBody();
|
||||
tests['Has removed count'] = body.removed !== undefined;
|
||||
tests['Has total count'] = body.total !== undefined;
|
||||
tests['Has results array'] = Array.isArray(body.results);
|
||||
} else {
|
||||
tests['Bulk remove failed'] = false;
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Bulk Remove Books from Collection
|
||||
|
||||
Removes multiple books from a collection in a single request.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/collections/{collection_id}/books/bulk-remove
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `collection_id` (string): Collection UUID
|
||||
|
||||
**Request Body:**
|
||||
- `book_ids` (array): Array of book UUIDs to remove from the collection
|
||||
|
||||
**Response:**
|
||||
- `removed` (number): Number of books successfully removed
|
||||
- `total` (number): Total number of books processed
|
||||
- `results` (array): Results for each removal attempt
|
||||
- `book_id` (string): Book UUID
|
||||
- `success` (boolean): Whether the removal succeeded
|
||||
- `error` (string, optional): Error message if failed
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success (with partial results if some failed)
|
||||
- 400: Invalid request data (e.g., empty book_ids array)
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden
|
||||
- 404: Collection not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Example Request:**
|
||||
```json
|
||||
{
|
||||
"book_ids": [
|
||||
"book-uuid-1",
|
||||
"book-uuid-2",
|
||||
"book-uuid-3"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
{
|
||||
"removed": 2,
|
||||
"total": 3,
|
||||
"results": [
|
||||
{
|
||||
"book_id": "book-uuid-1",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"book_id": "book-uuid-2",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"book_id": "book-uuid-3",
|
||||
"success": false,
|
||||
"error": "Book not in collection"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Note:** Removing a book that's not in the collection returns success: false for that book but doesn't fail the entire request. Empty book_ids array returns 400.
|
||||
}
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/test-rules
|
||||
url: {{base_url}}/api/collections/test-rules
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/test-rules
|
||||
url: {{base_url}}/api/collections/test-rules
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/test-rules
|
||||
url: {{base_url}}/api/collections/test-rules
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/test-rules
|
||||
url: {{base_url}}/api/collections/test-rules
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/collections/test-rules
|
||||
url: {{base_url}}/api/collections/test-rules
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/conflicts/bulk-dismiss
|
||||
url: {{base_url}}/api/conflicts/bulk-dismiss
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/conflicts/bulk-resolve
|
||||
url: {{base_url}}/api/conflicts/bulk-resolve
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/conflicts/bulk-resolve
|
||||
url: {{base_url}}/api/conflicts/bulk-resolve
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{baseUrl}}/api/conflicts/{{conflict_id}}
|
||||
url: {{base_url}}/api/conflicts/{{conflict_id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/conflicts/dismiss-all
|
||||
url: {{base_url}}/api/conflicts/dismiss-all
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/conflicts/{{conflict_id}}
|
||||
url: {{base_url}}/api/conflicts/{{conflict_id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/conflicts?status=unresolved
|
||||
url: {{base_url}}/api/conflicts?status=unresolved
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/conflicts/{{conflict_id}}/resolve
|
||||
url: {{base_url}}/api/conflicts/{{conflict_id}}/resolve
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/devices/register/status
|
||||
url: {{base_url}}/api/devices/register/status
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{baseUrl}}/api/devices/{{deviceId}}
|
||||
url: {{base_url}}/api/devices/{{deviceId}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/devices/{{deviceId}}
|
||||
url: {{base_url}}/api/devices/{{deviceId}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/devices
|
||||
url: {{base_url}}/api/devices
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{baseUrl}}/api/devices/{{deviceId}}
|
||||
url: {{base_url}}/api/devices/{{deviceId}}
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/sync/koreader/metadata/{{book_uuid}}
|
||||
url: {{base_url}}/api/sync/koreader/metadata/{{book_uuid}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/sync/koreader/library
|
||||
url: {{base_url}}/api/sync/koreader/library
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/sync/koreader/bookmarks
|
||||
url: {{base_url}}/api/sync/koreader/bookmarks
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/sync/koreader/progress
|
||||
url: {{base_url}}/api/sync/koreader/progress
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/opds/devices/{{deviceId}}/download/{{mediaItemId}}?format=kepub
|
||||
url: {{base_url}}/opds/devices/{{deviceId}}/download/{{mediaItemId}}?format=kepub
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/sync/auto-link-books
|
||||
url: {{base_url}}/sync/auto-link-books
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/sync/bulk-link-books
|
||||
url: {{base_url}}/sync/bulk-link-books
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/sync/unlinked-books/{{unlinkedBookId}}/suggestions
|
||||
url: {{base_url}}/sync/unlinked-books/{{unlinkedBookId}}/suggestions
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/progress/{{mediaItemId}}/history
|
||||
url: {{base_url}}/api/progress/{{mediaItemId}}/history
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/progress/{{mediaItemId}}
|
||||
url: {{base_url}}/api/progress/{{mediaItemId}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{baseUrl}}/api/progress/{{mediaItemId}}
|
||||
url: {{base_url}}/api/progress/{{mediaItemId}}
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ vars {
|
||||
}
|
||||
|
||||
websocket {
|
||||
url: {{baseUrl}}/ws/sync?token={{token}}
|
||||
url: {{base_url}}/ws/sync?token={{token}}
|
||||
body: {
|
||||
type: "ping",
|
||||
timestamp: "2026-01-30T20:00:00Z"
|
||||
|
||||
Reference in New Issue
Block a user