refactor: update Bruno API collection for media-items system
- Remove all ebook-specific API requests (15 files deleted) - Rename Scan Ebooks.bru to Scan Media Items.bru - Update API paths from /api/ebooks to /api/media-items - Update base URL and environment configuration - Maintain all existing media-items, library, auth, and progress tests Aligns Bruno collection with unified media-items API architecture
This commit is contained in:
@@ -6,6 +6,7 @@ meta {
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/types
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -13,48 +14,6 @@ headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_get_library_types_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
}
|
||||
|
||||
const contentType = headers["content-type"];
|
||||
if (!contentType || !contentType.includes("application/json")) {
|
||||
throw new Error("Expected content-type to contain application/json, got " + contentType);
|
||||
}
|
||||
|
||||
// Verify response body is valid JSON and has expected structure
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (e) {
|
||||
throw new Error("Response body is not valid JSON");
|
||||
}
|
||||
|
||||
if (!Array.isArray(data)) {
|
||||
throw new Error("Expected response body to be an array");
|
||||
}
|
||||
|
||||
// Validate each library type
|
||||
data.forEach((type, index) => {
|
||||
if (!type || typeof type !== "object") {
|
||||
throw new Error("Library type at index " + index + " is not an object");
|
||||
}
|
||||
|
||||
if (!type.id) {
|
||||
throw new Error("Library type at index " + index + " missing required field: id");
|
||||
}
|
||||
|
||||
if (!type.name) {
|
||||
throw new Error("Library type at index " + index + " missing required field: name");
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
@@ -80,4 +39,4 @@ docs {
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user