refactor: Reorganize Bruno requests by role permissions
- Create separate admin folder for admin-only operations
- Move admin endpoints (Create/Update/Delete Ebook, Scanner, Folder Management) to /bruno/admin/
- Add admin dashboard, profile, and library page requests
- Add Register Admin User request with explicit admin role
- Update Register User request to include role field
- Remove empty scanner folder structure
API organization:
- Admin requests: /bruno/admin/ (require admin role)
- User requests: /bruno/user/ (available to all authenticated users)
- Environment: Single {{token}} variable works for both roles
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
meta {
|
||||
name: Scan Ebooks
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/scanner/scan
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Scan Ebooks
|
||||
|
||||
Scans configured ebook folders for ebooks and adds them to the database. **Admin only operation.**
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/scanner/scan
|
||||
|
||||
**Authentication:** Required (Admin role required)
|
||||
|
||||
**Request Body:**
|
||||
- `folder_paths` (array of strings, optional): Array of folder paths to scan. If not provided, uses configured folders from Add Ebook Folder.
|
||||
|
||||
**Response:**
|
||||
- `message` (string): Success message
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Bad Request
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (non-admin users)
|
||||
|
||||
**Usage:**
|
||||
- Without body: Scans all folders added via "Add Ebook Folder"
|
||||
- With folder_paths: Scans the specified paths directly (useful for testing)
|
||||
|
||||
**Note:** All discovered ebooks will be associated with the admin user who initiated the scan.
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
meta {
|
||||
name: Start Scanner
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/scanner/start
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
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