Update all library API request files to the current Bruno format with proper settings blocks, updated sequence numbers, and cleaner YAML formatting. Add NewDevDBSetup collection with requests for creating comic, ebook, and manga libraries, user registration, and folder configuration to speed up development environment setup.
84 lines
2.1 KiB
YAML
84 lines
2.1 KiB
YAML
info:
|
|
name: CreateMangaLibrary
|
|
type: http
|
|
seq: 4
|
|
|
|
http:
|
|
method: POST
|
|
url: "{{base_url}}/api/libraries"
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"name": "My Ebook Library",
|
|
"description": "A collection of technical books and novels",
|
|
"type": "ebooks"
|
|
}
|
|
auth: inherit
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: after-response
|
|
code: |-
|
|
function onResponse(res) {
|
|
try {
|
|
const responseBody = res.getBody();
|
|
const id = responseBody.id;
|
|
|
|
if (id) {
|
|
bru.setEnvVar("library_id", id, { persist: true });
|
|
console.log("Library ID saved:", id);
|
|
}
|
|
|
|
if (!id) {
|
|
console.log("No id found in response.");
|
|
}
|
|
} catch (error) {
|
|
console.error("Error in post-response script:", error.message);
|
|
}
|
|
}
|
|
onResponse(res);
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Create Library
|
|
|
|
Creates a new library for organizing media items.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/libraries
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Request Body:**
|
|
- `name` (string, required): Library name
|
|
- `description` (string, optional): Library description
|
|
- `type` (string, required): Library type
|
|
- `"ebooks"`: Electronic books
|
|
- `"audiobooks"`: Audio books
|
|
- `"videos"`: Video content
|
|
- `"other"`: Other media types
|
|
|
|
**Response:** Library object
|
|
- `id` (string): Library UUID
|
|
- `name` (string): Library name
|
|
- `description` (string, optional): Library description
|
|
- `type` (string): Library type
|
|
- `is_visible` (boolean): Library visibility status
|
|
- `created_at` (string): Creation timestamp
|
|
- `updated_at` (string): Last update timestamp
|
|
|
|
**Status Codes:**
|
|
- 201: Library created successfully
|
|
- 400: Invalid request data
|
|
- 401: Unauthorized
|
|
- 403: Forbidden (insufficient permissions)
|
|
- 409: Library name already exists
|
|
- 500: Internal server error
|