docs: add Carousel dashboard implementation plan
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
meta {
|
||||
name: Add Library Folder
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}/folders
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"folder_path": {{library_folder}}
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "8821b703-h29b-71d4-d716-446655440003"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Add Library Folder
|
||||
|
||||
Adds a new folder path to a library for media scanning and indexing.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/libraries/{id}/folders
|
||||
|
||||
**Authentication:** Required (Bearer token, admin permissions)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string, required): Library UUID
|
||||
|
||||
**Request Body:**
|
||||
- `folder_path` (string, required): Absolute path to the folder containing media files
|
||||
|
||||
**Response:** Folder object
|
||||
- `id` (string): Folder UUID
|
||||
- `library_id` (string): Library UUID
|
||||
- `folder_path` (string): Absolute path to folder
|
||||
- `is_active` (boolean): Whether folder is active for scanning
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 201: Folder added successfully
|
||||
- 400: Invalid folder path or request data
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 409: Folder already exists for this library
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
meta {
|
||||
name: Create Library
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/libraries
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"name": "My Ebook Library",
|
||||
"description": "A collection of technical books and novels",
|
||||
"type": "ebooks"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
// If successful registration, set token environment variable
|
||||
if (res.getStatus() === 201 || res.getStatus() === 200) {
|
||||
if (data && data.id) {
|
||||
|
||||
return bru.setEnvVar("library_id", data.id, { persist: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
meta {
|
||||
name: Delete Library Folder
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}/folders
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
"folder_path": "/path/to/folder"
|
||||
}
|
||||
|
||||
tests {
|
||||
test_delete_library_folder_success(status, headers, body) {
|
||||
if (status !== 204) {
|
||||
throw new Error("Expected status 204, got " + status);
|
||||
}
|
||||
|
||||
// Delete should return no content
|
||||
if (body && body.length > 0) {
|
||||
throw new Error("Expected empty response body for delete");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23c3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Delete Library Folder
|
||||
|
||||
Removes a folder from a library's scanning configuration.
|
||||
|
||||
**Method:** DELETE
|
||||
|
||||
**Endpoint:** /api/libraries/{id}/folders
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Request Body:**
|
||||
- `folder_path` (string, required): Path to folder to remove
|
||||
|
||||
**Response:** Empty (204 No Content)
|
||||
|
||||
**Status Codes:**
|
||||
- 204: Folder deleted successfully
|
||||
- 400: Invalid request data
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Delete folder: `DELETE /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a/folders`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can manage library folders.
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
meta {
|
||||
name: Delete Library
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
delete {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_delete_library_success(status, headers, body) {
|
||||
if (status !== 204) {
|
||||
throw new Error("Expected status 204, got " + status);
|
||||
}
|
||||
|
||||
// Delete should return no content
|
||||
if (body && body.length > 0) {
|
||||
throw new Error("Expected empty response body for delete");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23c3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Delete Library
|
||||
|
||||
Deletes a library and all associated media items.
|
||||
|
||||
**Method:** DELETE
|
||||
|
||||
**Endpoint:** /api/libraries/{id}
|
||||
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Response:** Empty (204 No Content)
|
||||
|
||||
**Status Codes:**
|
||||
- 204: Library deleted successfully
|
||||
- 400: Invalid library ID
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Warning:** This will delete ALL media items in the library.
|
||||
|
||||
**Examples:**
|
||||
- Delete library: `DELETE /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can delete libraries.
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
meta {
|
||||
name: Get Libraries (Admin)
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Libraries (Admin)
|
||||
|
||||
Retrieves all libraries in the system (admin access required).
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries
|
||||
|
||||
**Authentication:** Required (Bearer token, admin permissions)
|
||||
|
||||
**Response:** Array of library objects
|
||||
- `id` (string): Library UUID
|
||||
- `name` (string): Library name
|
||||
- `description` (string, optional): Library description
|
||||
- `type` (string): Library type (ebooks, audiobooks, videos, other)
|
||||
- `is_visible` (boolean): Library visibility to users
|
||||
- `media_count` (number): Number of media items in library
|
||||
- `folder_count` (number): Number of folders associated
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
meta {
|
||||
name: Get Library Folders
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}/folders
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "8821b703-h29b-71d4-d716-446655440003"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Library Folders
|
||||
|
||||
Retrieves all folders associated with a specific library.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries/{id}/folders
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string, required): Library UUID
|
||||
|
||||
**Response:** Array of folder objects
|
||||
- `id` (string): Folder UUID
|
||||
- `library_id` (string): Library UUID
|
||||
- `folder_path` (string): Absolute path to the folder
|
||||
- `is_active` (boolean): Whether the folder is currently active for scanning
|
||||
- `last_scanned` (string, optional): Timestamp of last scan
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (library access denied)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
meta {
|
||||
name: Get Library Stats
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}/stats
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
tests {
|
||||
test_get_library_stats_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");
|
||||
}
|
||||
|
||||
if (!data || typeof data !== "object") {
|
||||
throw new Error("Expected stats object in response");
|
||||
}
|
||||
|
||||
// Expected fields (verify they exist)
|
||||
const expectedFields = ["total_items", "total_size", "scanned_at"];
|
||||
for (const field of expectedFields) {
|
||||
if (!(field in data)) {
|
||||
console.warn("Stats field '" + field + "' is missing from response");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23d3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Library Stats
|
||||
|
||||
Retrieves statistical information about a library's media items.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries/{id}/stats
|
||||
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Response:** Stats object
|
||||
- `total_items` (number): Total media items in library
|
||||
- `total_size` (number): Total file size in bytes
|
||||
- `scanned_at` (string): Last scan timestamp
|
||||
- Additional fields may be included
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid library ID
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Get library stats: `GET /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a/stats`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can access library statistics.
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
meta {
|
||||
name: Get Library Types
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/types
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Library Types
|
||||
|
||||
Retrieves all available library types that can be used when creating libraries.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries/types
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:** Array of library type objects
|
||||
- `id` (string): Type identifier (e.g., "ebooks", "audiobooks", "videos", "other")
|
||||
- `name` (string): Display name for the type (e.g., "Ebooks", "Audiobooks", "Videos", "Other")
|
||||
- `description` (string, optional): Description of what this type is used for
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
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.
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
meta {
|
||||
name: Get Scan Settings
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/library/scan-settings
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Scan Settings
|
||||
|
||||
Retrieves the user's current library scanning settings.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/library/scan-settings
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:**
|
||||
- `scan_frequency_minutes` (number): Minutes between automatic scans (minimum 1)
|
||||
- `auto_scan_enabled` (boolean): Whether automatic scanning is enabled
|
||||
- `last_scan_at` (string, optional): Timestamp of last scan
|
||||
- `next_scan_at` (string, optional): Timestamp of next scheduled scan
|
||||
- `library_id` (string, optional): Library ID for context
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (access denied)
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
meta {
|
||||
name: Get User Visible Libraries
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/libraries/visible
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get User Visible Libraries
|
||||
|
||||
Retrieves all libraries that are visible to regular users.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/libraries/visible
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:** Array of visible library objects
|
||||
- `id` (string): Library UUID
|
||||
- `name` (string): Library name
|
||||
- `description` (string, optional): Library description
|
||||
- `type` (string): Library type (ebooks, audiobooks, videos, other)
|
||||
- `is_visible` (boolean): Always true for this endpoint
|
||||
- `media_count` (number): Number of media items in library
|
||||
- `created_at` (string): Creation timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
meta {
|
||||
name: Set Library Visibility
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/libraries/visibility
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"library_id": "{{library_id}}",
|
||||
"is_visible": {{is_visible}}
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "8821b703-h29b-71d4-d716-446655440003",
|
||||
isVisible: true
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Set Library Visibility
|
||||
|
||||
Updates the visibility status of a library for regular users.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/libraries/visibility
|
||||
|
||||
**Authentication:** Required (Bearer token, admin permissions)
|
||||
|
||||
**Request Body:**
|
||||
- `library_id` (string, required): Library UUID
|
||||
- `is_visible` (boolean, required): Visibility status
|
||||
- `true`: Library visible to all users
|
||||
- `false`: Library hidden from regular users
|
||||
|
||||
**Response:** Updated library visibility object
|
||||
- `library_id` (string): Library UUID
|
||||
- `is_visible` (boolean): Updated visibility status
|
||||
- `updated_at` (string): Update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Visibility updated successfully
|
||||
- 400: Invalid request data
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
meta {
|
||||
name: Update Library
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{base_url}}/api/libraries/{{library_id}}
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
"name": "Updated Library Name",
|
||||
"description": "Updated library description"
|
||||
}
|
||||
|
||||
tests {
|
||||
test_update_library_success(status, headers, body) {
|
||||
if (status !== 200) {
|
||||
throw new Error("Expected status 200, got " + status);
|
||||
}
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = JSON.parse(body);
|
||||
} catch (e) {
|
||||
throw new Error("Response body is not valid JSON");
|
||||
}
|
||||
|
||||
if (!data || typeof data !== "object") {
|
||||
throw new Error("Expected updated library object in response");
|
||||
}
|
||||
|
||||
if (!data.id || !data.updated_at) {
|
||||
throw new Error("Library response missing update confirmation");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
libraryId: "cc23c3a7-f8fb-451a-a78d-2a16df1b725a"
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Update Library
|
||||
|
||||
Updates an existing library's information.
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
**Endpoint:** /api/libraries/{id}
|
||||
|
||||
**Authentication:** Required (Bearer token, admin only)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Library UUID
|
||||
|
||||
**Request Body:**
|
||||
- `name` (string, optional): Library name
|
||||
- `description` (string, optional): Library description
|
||||
|
||||
**Response:** Updated library object
|
||||
- `id` (string): Library UUID
|
||||
- `name` (string): Updated library name
|
||||
- `description` (string): Updated library description
|
||||
- `library_type_id` (string): Library type UUID
|
||||
- `updated_at` (string): Update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid request data
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (admin access required)
|
||||
- 404: Library not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Examples:**
|
||||
- Update library: `PUT /api/libraries/cc23c3a7-f8fb-451a-a78d-2a16df1b725a`
|
||||
|
||||
**Note:** Admin access required - only users with admin role can update libraries.
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
meta {
|
||||
name: Update Scan Settings
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
put {
|
||||
url: {{base_url}}/api/library/scan-settings
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"scan_frequency_minutes": 60,
|
||||
"auto_scan_enabled": true
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Update Scan Settings
|
||||
|
||||
Updates the user's media scanning settings.
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
**Endpoint:** /api/library/scan-settings
|
||||
|
||||
**Authentication:** Required
|
||||
|
||||
**Request Body:**
|
||||
- `scan_frequency_minutes` (integer, required): Minutes between automatic scans (15-1440)
|
||||
- `auto_scan_enabled` (boolean, required): Whether automatic scanning is enabled
|
||||
|
||||
**Response:**
|
||||
- `message` (string): Success message
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid settings
|
||||
- 401: Unauthorized
|
||||
}
|
||||
Reference in New Issue
Block a user