From 7c70e9e85a63f0d8f06f7b66741893cc2a7106c6 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 23 Jan 2026 21:27:13 -0500 Subject: [PATCH] Update Bruno API tests for user endpoints including new profile management --- bruno/user/Add Ebook Folder.bru | 24 +++++++-------- bruno/user/Delete Ebook Folder.bru | 36 +++++++++++++---------- bruno/user/Get Ebook Folders.bru | 16 +++++----- bruno/user/Get Profile.bru | 12 ++++---- bruno/user/List Users.bru | 4 +-- bruno/user/Login User.bru | 12 ++++---- bruno/user/Register User.bru | 26 ++++++++++------- bruno/user/Update Email.bru | 4 +-- bruno/user/Update Password.bru | 24 +++++++-------- bruno/user/Update Profile.bru | 47 ++++++++++++++++++++++++++++++ bruno/user/Update Theme.bru | 16 +++++----- bruno/user/Update Username.bru | 4 +-- 12 files changed, 144 insertions(+), 81 deletions(-) create mode 100644 bruno/user/Update Profile.bru diff --git a/bruno/user/Add Ebook Folder.bru b/bruno/user/Add Ebook Folder.bru index b7fe4a5..5158313 100644 --- a/bruno/user/Add Ebook Folder.bru +++ b/bruno/user/Add Ebook Folder.bru @@ -1,7 +1,7 @@ meta { name: Add Ebook Folder type: http - seq: 5 + seq: 8 } post { @@ -10,9 +10,9 @@ post { auth: inherit } -body { +body:json { { - "folder_path": "/path/to/ebooks" + "folder_path": "/home/user/ebooks" } } @@ -23,27 +23,27 @@ settings { 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 + - 400: Invalid request - 401: Unauthorized - - 409: Conflict (folder already exists) + - 409: Folder already exists } \ No newline at end of file diff --git a/bruno/user/Delete Ebook Folder.bru b/bruno/user/Delete Ebook Folder.bru index 0fec713..76549fa 100644 --- a/bruno/user/Delete Ebook Folder.bru +++ b/bruno/user/Delete Ebook Folder.bru @@ -1,15 +1,21 @@ meta { name: Delete Ebook Folder type: http - seq: 7 + seq: 10 } delete { - url: {{base_url}}/api/auth/ebook-folders/{{folder_path}} - body: none + url: {{base_url}}/api/auth/ebook-folders + body: json auth: inherit } +body:json { + { + "folder_path": "/home/user/ebooks" + } +} + settings { encodeUrl: true timeout: 0 @@ -17,24 +23,24 @@ settings { docs { ## Delete Ebook Folder - + Removes an ebook folder for the authenticated user. - + **Method:** DELETE - - **Endpoint:** /api/auth/ebook-folders/:folderPath - + + **Endpoint:** /api/auth/ebook-folders + **Authentication:** Required - - **URL Parameters:** - - `folderPath` (string): URL-encoded folder path to remove - + + **Request Body:** + - `folder_path` (string, required): Path to the ebook folder to remove + **Response:** - `message` (string): Success message - + **Status Codes:** - 200: Success - - 400: Bad Request + - 400: Invalid request - 401: Unauthorized - - 404: Folder not found + - 500: Internal server error } \ No newline at end of file diff --git a/bruno/user/Get Ebook Folders.bru b/bruno/user/Get Ebook Folders.bru index 479c695..a7ad3ff 100644 --- a/bruno/user/Get Ebook Folders.bru +++ b/bruno/user/Get Ebook Folders.bru @@ -1,7 +1,7 @@ meta { name: Get Ebook Folders type: http - seq: 6 + seq: 9 } get { @@ -17,21 +17,21 @@ settings { docs { ## Get Ebook Folders - - Retrieves all ebook folders for the authenticated user. - + + Retrieves the list of 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 diff --git a/bruno/user/Get Profile.bru b/bruno/user/Get Profile.bru index 96383e5..b52cb58 100644 --- a/bruno/user/Get Profile.bru +++ b/bruno/user/Get Profile.bru @@ -26,11 +26,13 @@ docs { **Authentication:** Required - **Response:** - - `id` (string): User ID - - `email` (string): Email - - `username` (string): Username - - `theme` (string): User theme preference + **Response:** + - `id` (string): User ID + - `email` (string): Email + - `username` (string): Username + - `theme` (string): User theme preference + - `first_name` (string, optional): First name + - `last_name` (string, optional): Last name **Status Codes:** - 200: Success diff --git a/bruno/user/List Users.bru b/bruno/user/List Users.bru index 1cd3510..71d347f 100644 --- a/bruno/user/List Users.bru +++ b/bruno/user/List Users.bru @@ -5,7 +5,7 @@ meta { } get { - url: {{base_url}}/api/users + url: {{base_url}}/api/auth/users body: none auth: inherit } @@ -22,7 +22,7 @@ docs { **Method:** GET - **Endpoint:** /api/users + **Endpoint:** /api/auth/users **Authentication:** Required diff --git a/bruno/user/Login User.bru b/bruno/user/Login User.bru index 625f919..fa55c3e 100644 --- a/bruno/user/Login User.bru +++ b/bruno/user/Login User.bru @@ -45,11 +45,13 @@ docs { **Response:** - `token` (string): JWT token - - `user` (object): User details - - `id` (string): User ID - - `email` (string): Email - - `username` (string): Username - - `theme` (string): User theme preference + - `user` (object): User details + - `id` (string): User ID + - `email` (string): Email + - `username` (string): Username + - `theme` (string): User theme preference + - `first_name` (string): First name + - `last_name` (string): Last name **Status Codes:** - 200: Success diff --git a/bruno/user/Register User.bru b/bruno/user/Register User.bru index d18e570..3b47976 100644 --- a/bruno/user/Register User.bru +++ b/bruno/user/Register User.bru @@ -14,7 +14,9 @@ body:json { { "email": "test@example.com", "username": "testuser", - "password": "password123" + "password": "password123", + "first_name": "Test", + "last_name": "User" } } @@ -40,18 +42,22 @@ docs { **Endpoint:** /api/auth/register - **Request Body:** - - `email` (string): Email address - - `username` (string): Username - - `password` (string): Password + **Request Body:** + - `email` (string): Email address + - `username` (string): Username + - `password` (string): Password + - `first_name` (string, optional): First name + - `last_name` (string, optional): Last name **Response:** - `token` (string): JWT token - - `user` (object): User details - - `id` (string): User ID - - `email` (string): Email - - `username` (string): Username - - `theme` (string): User theme preference + - `user` (object): User details + - `id` (string): User ID + - `email` (string): Email + - `username` (string): Username + - `theme` (string): User theme preference + - `first_name` (string, optional): First name + - `last_name` (string, optional): Last name **Status Codes:** - 201: Created diff --git a/bruno/user/Update Email.bru b/bruno/user/Update Email.bru index bc30fdb..bed83e9 100644 --- a/bruno/user/Update Email.bru +++ b/bruno/user/Update Email.bru @@ -5,7 +5,7 @@ meta { } put { - url: {{base_url}}/api/user/email + url: {{base_url}}/api/auth/email body: json auth: inherit } @@ -28,7 +28,7 @@ docs { **Method:** PUT - **Endpoint:** /api/user/email + **Endpoint:** /api/auth/email **Authentication:** Required diff --git a/bruno/user/Update Password.bru b/bruno/user/Update Password.bru index 5738213..22d35a5 100644 --- a/bruno/user/Update Password.bru +++ b/bruno/user/Update Password.bru @@ -5,14 +5,14 @@ meta { } put { - url: {{base_url}}/api/user/password + url: {{base_url}}/api/auth/password body: json auth: inherit } -body { +body:json { { - "current_password": "currentpassword", + "current_password": "password123", "new_password": "newpassword123", "confirm_password": "newpassword123" } @@ -25,26 +25,26 @@ settings { docs { ## Update Password - + Updates the authenticated user's password. - + **Method:** PUT - - **Endpoint:** /api/user/password - + + **Endpoint:** /api/auth/password + **Authentication:** Required - + **Request Body:** - `current_password` (string, required): Current password for verification - `new_password` (string, required): New password (minimum 6 characters) - `confirm_password` (string, required): Confirmation of new password - + **Response:** - `message` (string): Success message - + **Status Codes:** - 200: Success - 400: Password validation failed - 401: Current password incorrect - 401: Unauthorized -} \ No newline at end of file +} diff --git a/bruno/user/Update Profile.bru b/bruno/user/Update Profile.bru new file mode 100644 index 0000000..eefa219 --- /dev/null +++ b/bruno/user/Update Profile.bru @@ -0,0 +1,47 @@ +meta { + name: Update Profile + type: http + seq: 4 +} + +put { + url: {{base_url}}/api/auth/profile + body: json + auth: inherit +} + +body:json { + { + "first_name": "Updated", + "last_name": "Name" + } +} + +settings { + encodeUrl: true + timeout: 0 +} + +docs { + ## Update User Profile + + Updates the authenticated user's profile information. + + **Method:** PUT + + **Endpoint:** /api/auth/profile + + **Authentication:** Required (Bearer token) + + **Request Body:** + - `first_name` (string, optional): First name + - `last_name` (string, optional): Last name + + **Response:** + - `message` (string): Success message + + **Status Codes:** + - 200: Success + - 400: Invalid request + - 401: Unauthorized +} diff --git a/bruno/user/Update Theme.bru b/bruno/user/Update Theme.bru index 941e8bb..9efb1a1 100644 --- a/bruno/user/Update Theme.bru +++ b/bruno/user/Update Theme.bru @@ -18,23 +18,23 @@ body:json { docs { ## Update User Theme - + Updates the authenticated user's theme preference. - + **Method:** PUT - + **Endpoint:** /api/auth/theme - + **Authentication:** Required (Bearer token) - + **Request Body:** - `theme` (string): Theme name (tokyo-night, dracula, nord, solarized-dark, monokai, one-dark-pro, material-dark, catppuccin-mocha, catppuccin-macchiato, catppuccin-frappe, catppuccin-latte) - + **Response:** - `message` (string): Success message - + **Status Codes:** - 200: Success - 400: Invalid theme - 401: Unauthorized -} \ No newline at end of file +} diff --git a/bruno/user/Update Username.bru b/bruno/user/Update Username.bru index 6f97bae..2674e3d 100644 --- a/bruno/user/Update Username.bru +++ b/bruno/user/Update Username.bru @@ -5,7 +5,7 @@ meta { } put { - url: {{base_url}}/api/user/username + url: {{base_url}}/api/auth/username body: json auth: inherit } @@ -28,7 +28,7 @@ docs { **Method:** PUT - **Endpoint:** /api/user/username + **Endpoint:** /api/auth/username **Authentication:** Required