feat: add 16 missing Bruno requests for complete API coverage
Add missing Bruno requests for all API endpoints: Library Management: - Get Library - retrieve single library details - Update Library - modify existing library - Delete Library - remove library and media items - Delete Library Folder - remove folder from library - Get Library Stats - retrieve library statistics Media Items Management: - Create Media Item - add new media with full metadata - Update Media Item - modify existing media metadata - Delete Media Item - remove media from library - Get Media Rating - retrieve single media rating - Delete Media Rating - remove user's media rating Coverage now complete: 47/47 API endpoints have Bruno requests Organized requests in proper folder structure for maintainability
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
meta {
|
||||
name: Get Library
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_get_library_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);
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (e) {
|
||||
throw new Error("Response body is not valid JSON");
|
||||
}
|
||||
|
||||
// Verify library object structure
|
||||
if (!data || typeof data !== "object") {
|
||||
throw new Error("Expected library object in response");
|
||||
}
|
||||
|
||||
// Required fields
|
||||
if (!data.id || !data.name || !data.library_type_id) {
|
||||
throw new Error("Library missing required fields: id, name, library_type_id");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23c3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Library
|
||||
|
||||
Retrieves detailed information about a specific library by ID.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries/{id}
|
||||
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Response:** Library object
|
||||
- `id` (string): Library UUID
|
||||
- `name` (string): Library name
|
||||
- `description` (string): Library description
|
||||
- `library_type_id` (string): Library type UUID
|
||||
- `created_by_admin_id` (string): Admin UUID who created it
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Get library: `GET /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can access library details.
|
||||
}
|
||||
Reference in New Issue
Block a user