test(bruno): update API collections for consolidated endpoints

Add collections for Delete User, Reset User Password, and Update User
endpoints. Remove obsolete collections for individual profile update
operations. Update Update Profile collection to reflect new consolidated
API structure.
This commit is contained in:
2026-02-22 01:59:58 -05:00
parent ff25454901
commit 2b92d5c6c1
8 changed files with 123 additions and 97 deletions
-25
View File
@@ -1,25 +0,0 @@
info:
name: Delete Account
type: http
seq: 4
http:
method: DELETE
url: '{{base_url}}/api/auth/account'
auth: inherit
body:
type: none
docs: |-
## Delete Account
Permanently deletes user account and all associated data.
**Method:** DELETE
**Endpoint:** /api/auth/account
**Authentication:** Required
**Usage:**
- **Self-deletion**: DELETE /api/auth/account (no parameters)
- **Admin deletion**: DELETE /api/auth/account?user_id={uuid
+25
View File
@@ -0,0 +1,25 @@
info:
name: Delete User
type: http
seq: 12
http:
method: DELETE
url: '{{base_url}}/api/auth/profile/{{user_id}}'
auth: inherit
docs: |-
## Delete User Account
Delete a user account. Users can delete their own account, admins can delete any user.
**Method:** DELETE
**Endpoint:** /api/auth/profile (self) or /api/auth/profile/:id (admin)
**Authentication:** Required (Bearer token)
**Status Codes:**
- 200: Success
- 400: Cannot delete the last admin
- 403: Not an admin (when trying to delete another user)
- 404: User not found
+36
View File
@@ -0,0 +1,36 @@
info:
name: Reset User Password
type: http
seq: 11
http:
method: PUT
url: '{{base_url}}/api/auth/password/{{user_id}}'
auth: inherit
body:
type: json
jsonBody: |-
{
"new_password": "NewSecurePassword123!",
"confirm_password": "NewSecurePassword123!"
}
docs: |-
## Admin Reset User Password
Admin-only endpoint to reset another user's password.
**Method:** PUT
**Endpoint:** /api/auth/password/:id
**Authentication:** Required (Admin Bearer token)
**Request Body:**
- `new_password` (string, required): New password
- `confirm_password` (string, required): Must match new_password
**Status Codes:**
- 200: Success
- 400: Passwords do not match or invalid format
- 403: Not an admin
- 404: User not found
+42
View File
@@ -0,0 +1,42 @@
info:
name: Update User
type: http
seq: 10
http:
method: PUT
url: '{{base_url}}/api/auth/profile/{{user_id}}'
auth: inherit
body:
type: json
jsonBody: |-
{
"username": "newusername",
"email": "newemail@example.com",
"role": "admin"
}
docs: |-
## Admin Update User
Admin-only endpoint to update another user's profile.
**Method:** PUT
**Endpoint:** /api/auth/profile/:id
**Authentication:** Required (Admin Bearer token)
**Request Body:**
- `username` (string, optional): New username
- `email` (string, optional): New email
- `first_name` (string, optional): First name
- `last_name` (string, optional): Last name
- `theme` (string, optional): Theme preference
- `role` (string, optional): Role ("user" or "admin") - admin only
**Status Codes:**
- 200: Success
- 400: Invalid role or cannot demote last admin
- 403: Not an admin
- 404: User not found
- 409: Username or email already taken