diff --git a/bruno/admin/Add Ebook Folder.bru b/bruno/admin/Add Ebook Folder.bru new file mode 100644 index 0000000..96e2451 --- /dev/null +++ b/bruno/admin/Add Ebook Folder.bru @@ -0,0 +1,56 @@ +meta { + name: Add Ebook Folder + type: http + seq: 8 +} + +post { + url: {{base_url}}/api/auth/ebook-folders + body: json + auth: inherit +} + +body:json { + { + "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 (Admin only) + + **Request Body:** JSON object with: + - `folder_path` (string, required): Path to the ebook folder + + **Response:** Folder object with: + - `id` (string): Folder ID (UUID) + - `user_id` (string): User ID (UUID) + - `folder_path` (string): Normalized folder path + - `created_at` (string): Creation timestamp (ISO 8601) + + **Status Codes:** + - 201: Folder created successfully + - 400: Bad request (invalid folder path) + - 401: Unauthorized + - 403: Forbidden (admin access required) + - 500: Internal server error + + **Features:** + - Admin-only endpoint for adding ebook folders + - Path normalization for consistent storage + - Supports both absolute paths and home directory (~) paths + - Prevents duplicate folders for the same user +} \ No newline at end of file diff --git a/bruno/admin/Delete Ebook Folder.bru b/bruno/admin/Delete Ebook Folder.bru new file mode 100644 index 0000000..379231d --- /dev/null +++ b/bruno/admin/Delete Ebook Folder.bru @@ -0,0 +1,54 @@ +meta { + name: Delete Ebook Folder + type: http + seq: 10 +} + +delete { + url: {{base_url}}/api/auth/ebook-folders + body: json + auth: inherit +} + +body:json { + { + "folder_path": "/path/to/ebooks" + } +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + ## Delete Ebook Folder + + Deletes an ebook folder for the authenticated user. + + **Method:** DELETE + + **Endpoint:** /api/auth/ebook-folders + + **Authentication:** Required (Admin only) + + **Request Body:** JSON object with: + - `folder_path` (string, required): Path to the ebook folder to delete + + **Response:** Success message object: + - `message` (string): "ebook folder deleted successfully" + + **Status Codes:** + - 200: Folder deleted successfully + - 400: Bad request (invalid folder path) + - 401: Unauthorized + - 403: Forbidden (admin access required) + - 404: Folder not found + - 500: Internal server error + + **Features:** + - Admin-only endpoint for deleting ebook folders + - Path normalization for matching + - Supports both absolute paths and home directory (~) paths + - Prevents deletion of non-existent folders +} \ No newline at end of file diff --git a/bruno/admin/Get Ebook Folders.bru b/bruno/admin/Get Ebook Folders.bru new file mode 100644 index 0000000..75f98ee --- /dev/null +++ b/bruno/admin/Get Ebook Folders.bru @@ -0,0 +1,46 @@ +meta { + name: Get Ebook Folders + type: http + seq: 9 +} + +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 configured for the authenticated user. + + **Method:** GET + + **Endpoint:** /api/auth/ebook-folders + + **Authentication:** Required (Admin only) + + **Response:** Array of folder objects with: + - `id` (string): Folder ID (UUID) + - `user_id` (string): User ID (UUID) + - `folder_path` (string): Normalized folder path + - `created_at` (string): Creation timestamp (ISO 8601) + + **Status Codes:** + - 200: Success (empty array if no folders found) + - 401: Unauthorized + - 403: Forbidden (admin access required) + - 500: Internal server error + + **Features:** + - Admin-only endpoint for retrieving configured folders + - Returns all folders configured for the user + - Useful for folder management interfaces + - Empty array returned if no folders configured +} \ No newline at end of file