Update Bruno API tests for user endpoints including new profile management

This commit is contained in:
2026-01-23 21:27:13 -05:00
parent 382a2369c5
commit 7c70e9e85a
12 changed files with 144 additions and 81 deletions
+12 -12
View File
@@ -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
}
+21 -15
View File
@@ -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
}
+8 -8
View File
@@ -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
+7 -5
View File
@@ -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
+2 -2
View File
@@ -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
+7 -5
View File
@@ -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
+16 -10
View File
@@ -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
+2 -2
View File
@@ -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
+12 -12
View File
@@ -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
}
}
+47
View File
@@ -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
}
+8 -8
View File
@@ -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
}
}
+2 -2
View File
@@ -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