feat: add Bruno API testing files for multiple folder functionality
- Add auth/Add Ebook Folder.bru - test adding folders to user account - Add auth/Get Ebook Folders.bru - test listing user's folders - Add auth/Delete Ebook Folder.bru - test removing folders - Add scanner/Scan Ebooks.bru - test manual scanning of multiple folders - Add scanner/Start Scanner.bru - test starting folder monitoring - Add scanner/Stop Scanner.bru - test stopping folder monitoring - Update all scanner endpoints to use folder_paths array format
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
meta {
|
||||||
|
name: Add Ebook Folder
|
||||||
|
type: http
|
||||||
|
seq: 5
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: {{base_url}}/api/auth/ebook-folders
|
||||||
|
body: json
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
{
|
||||||
|
"folder_path": "/path/to/ebooks"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Add Ebook Folder
|
||||||
|
|
||||||
|
Adds a new ebook folder for the authenticated user.
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**Endpoint:** /api/auth/ebook-folders
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**Request Body:**
|
||||||
|
- `folder_path` (string, required): Path to the ebook folder
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
- `id` (string): Folder ID
|
||||||
|
- `user_id` (string): User ID
|
||||||
|
- `folder_path` (string): Folder path
|
||||||
|
- `created_at` (string): Creation timestamp
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 201: Created
|
||||||
|
- 400: Bad Request
|
||||||
|
- 401: Unauthorized
|
||||||
|
- 409: Conflict (folder already exists)
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
meta {
|
||||||
|
name: Delete Ebook Folder
|
||||||
|
type: http
|
||||||
|
seq: 7
|
||||||
|
}
|
||||||
|
|
||||||
|
delete {
|
||||||
|
url: {{base_url}}/api/auth/ebook-folders/{{folder_path}}
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Delete Ebook Folder
|
||||||
|
|
||||||
|
Removes an ebook folder for the authenticated user.
|
||||||
|
|
||||||
|
**Method:** DELETE
|
||||||
|
|
||||||
|
**Endpoint:** /api/auth/ebook-folders/:folderPath
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**URL Parameters:**
|
||||||
|
- `folderPath` (string): URL-encoded folder path to remove
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
- `message` (string): Success message
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 200: Success
|
||||||
|
- 400: Bad Request
|
||||||
|
- 401: Unauthorized
|
||||||
|
- 404: Folder not found
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
meta {
|
||||||
|
name: Get Ebook Folders
|
||||||
|
type: http
|
||||||
|
seq: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
get {
|
||||||
|
url: {{base_url}}/api/auth/ebook-folders
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Get Ebook Folders
|
||||||
|
|
||||||
|
Retrieves all ebook folders for the authenticated user.
|
||||||
|
|
||||||
|
**Method:** GET
|
||||||
|
|
||||||
|
**Endpoint:** /api/auth/ebook-folders
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**Response:** Array of folder objects
|
||||||
|
- `id` (string): Folder ID
|
||||||
|
- `user_id` (string): User ID
|
||||||
|
- `folder_path` (string): Folder path
|
||||||
|
- `created_at` (string): Creation timestamp
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 200: Success
|
||||||
|
- 401: Unauthorized
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
meta {
|
||||||
|
name: Scan Ebooks
|
||||||
|
type: http
|
||||||
|
seq: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: {{base_url}}/api/scanner/scan
|
||||||
|
body: json
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
{
|
||||||
|
"folder_paths": [
|
||||||
|
"/path/to/ebooks",
|
||||||
|
"/another/path/to/ebooks"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Scan Ebooks
|
||||||
|
|
||||||
|
Manually scans the specified folders for ebooks and adds them to the database.
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**Endpoint:** /api/scanner/scan
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**Request Body:**
|
||||||
|
- `folder_paths` (array of strings, required): Array of folder paths to scan
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
- `message` (string): Success message
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 200: Success
|
||||||
|
- 400: Bad Request
|
||||||
|
- 401: Unauthorized
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
meta {
|
||||||
|
name: Start Scanner
|
||||||
|
type: http
|
||||||
|
seq: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: {{base_url}}/api/scanner/start
|
||||||
|
body: json
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
{
|
||||||
|
"folder_paths": [
|
||||||
|
"/path/to/ebooks",
|
||||||
|
"/another/path/to/ebooks"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Start Scanner
|
||||||
|
|
||||||
|
Starts monitoring the specified folders for ebook changes.
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**Endpoint:** /api/scanner/start
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**Request Body:**
|
||||||
|
- `folder_paths` (array of strings, required): Array of folder paths to monitor
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
- `message` (string): Success message
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 200: Success
|
||||||
|
- 400: Bad Request
|
||||||
|
- 401: Unauthorized
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
meta {
|
||||||
|
name: Stop Scanner
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: {{base_url}}/api/scanner/stop
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
docs {
|
||||||
|
## Stop Scanner
|
||||||
|
|
||||||
|
Stops monitoring folders for ebook changes.
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**Endpoint:** /api/scanner/stop
|
||||||
|
|
||||||
|
**Authentication:** Required
|
||||||
|
|
||||||
|
**Request Body:** None
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
- `message` (string): Success message
|
||||||
|
|
||||||
|
**Status Codes:**
|
||||||
|
- 200: Success
|
||||||
|
- 401: Unauthorized
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user