refactor: standardize Bruno API requests with bruToJsonV2 format
- Convert all JSON tests to JavaScript functions for bruToJsonV2 compatibility
- Update authentication to use 'inherit' instead of manual headers
- Fix hardcoded URLs to use {{base_url}} variables
- Standardize variable syntax from {{ _.var }} to {{var}}
- Add comprehensive API documentation to all requests
- Update environment variables with missing required fields
- Apply consistent structure: meta, http method, headers, tests, vars, settings, docs
- Enhanced validation with proper error handling and field checks
This commit is contained in:
@@ -7,5 +7,45 @@ meta {
|
||||
post {
|
||||
url: {{base_url}}/api/scanner/scan
|
||||
body: json
|
||||
auth: bearer
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Scan Ebooks
|
||||
|
||||
Triggers a scanning operation to discover and index ebook files in the library.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/scanner/scan
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Request Body:** (optional)
|
||||
- `library_id` (string, optional): Specific library ID to scan
|
||||
- `scan_depth` (number, optional): Maximum directory depth to scan
|
||||
- `file_types` (array, optional): File extensions to include
|
||||
|
||||
**Response:**
|
||||
- JSON object containing scan operation details
|
||||
- `scan_id` (string): Unique scan operation identifier
|
||||
- `status` (string): Scan status ("initiated", "running", "completed")
|
||||
- `library_id` (string): Library being scanned
|
||||
- `files_found` (number): Number of files discovered
|
||||
- `files_processed` (number): Number of files processed
|
||||
- `started_at` (string): Scan start timestamp
|
||||
- `estimated_completion` (string): Estimated completion time
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Scan initiated successfully
|
||||
- 400: Invalid request parameters
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (insufficient permissions)
|
||||
- 409: Scan already in progress
|
||||
- 500: Internal server error
|
||||
}
|
||||
|
||||
@@ -6,5 +6,35 @@ meta {
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/scanner/start
|
||||
auth: bearer
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Start Scanner
|
||||
|
||||
Starts the media scanner service for indexing library content.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/scanner/start
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:**
|
||||
- JSON object containing scanner status
|
||||
- `status` (string): Scanner state ("started", "running")
|
||||
- `message` (string): Status message
|
||||
- `started_at` (string): Timestamp when scanner started
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Scanner started successfully
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (insufficient permissions)
|
||||
- 409: Scanner already running
|
||||
- 500: Internal server error
|
||||
}
|
||||
@@ -6,5 +6,35 @@ meta {
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/scanner/stop
|
||||
auth: bearer
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Stop Scanner
|
||||
|
||||
Stops the currently running media scanner service.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/scanner/stop
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:**
|
||||
- JSON object containing scanner status
|
||||
- `status` (string): Scanner state ("stopped", "idle")
|
||||
- `message` (string): Status message
|
||||
- `stopped_at` (string): Timestamp when scanner stopped
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Scanner stopped successfully
|
||||
- 401: Unauthorized
|
||||
- 403: Forbidden (insufficient permissions)
|
||||
- 409: Scanner not running
|
||||
- 500: Internal server error
|
||||
}
|
||||
Reference in New Issue
Block a user