Complete project cleanup: remove unneeded files, organize static assets, update .gitignore
This commit is contained in:
@@ -17,20 +17,20 @@ settings {
|
||||
|
||||
docs {
|
||||
## Get User Profile
|
||||
|
||||
|
||||
Retrieves the authenticated user's profile.
|
||||
|
||||
|
||||
**Method:** GET
|
||||
|
||||
|
||||
**Endpoint:** /api/auth/profile
|
||||
|
||||
|
||||
**Authentication:** Required
|
||||
|
||||
|
||||
**Response:**
|
||||
- `id` (string): User ID
|
||||
- `email` (string): Email
|
||||
- `username` (string): Username
|
||||
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
|
||||
+28
-20
@@ -17,29 +17,37 @@ body:json {
|
||||
}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Login User
|
||||
|
||||
Authenticates a user with email/username and password.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/auth/login
|
||||
|
||||
**Request Body:**
|
||||
- `login` (string): Email or username
|
||||
- `password` (string): Password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT token
|
||||
- `user` (object): User details
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Invalid credentials
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
let token = bru.setEnvVar("token", data.token, { persist: true });
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Login User
|
||||
|
||||
Authenticates a user with email/username and password.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/auth/login
|
||||
|
||||
**Request Body:**
|
||||
- `login` (string): Email or username
|
||||
- `password` (string): Password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT token
|
||||
- `user` (object): User details
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Invalid credentials
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ settings {
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
const data = res.getBody();
|
||||
if (res.getStatusCode() === 201) {
|
||||
bru.setEnvVar("token", data.token);
|
||||
}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Register User
|
||||
|
||||
|
||||
@@ -23,6 +23,14 @@ body:json {
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
let token = bru.setEnvVar("ebookid", data.id, { persist: true });
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
@@ -30,11 +38,11 @@ settings {
|
||||
|
||||
docs {
|
||||
## Create Ebook
|
||||
|
||||
|
||||
Creates a new ebook entry in the library.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Request Body:**
|
||||
- `title` (string, required): Book title
|
||||
- `author` (string, optional): Book author
|
||||
@@ -44,9 +52,9 @@ docs {
|
||||
- `file_size` (number, optional): File size in bytes
|
||||
- `mime_type` (string, optional): MIME type
|
||||
- `cover_image_path` (string, optional): Path to cover image
|
||||
|
||||
|
||||
**Response:** Created ebook object
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
- 400: Invalid request data
|
||||
|
||||
@@ -5,32 +5,36 @@ meta {
|
||||
}
|
||||
|
||||
delete {
|
||||
url: http://localhost:8765/api/ebooks/123e4567-e89b-12d3-a456-426614174000
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let token = bru.setEnvVar("ebookid", "", { persist: true });
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
docs {
|
||||
## Delete Ebook
|
||||
|
||||
|
||||
Removes an ebook from the library.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
|
||||
**Response:** 204 No Content
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
- 404: Ebook not found
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:8765/api/ebooks/123e4567-e89b-12d3-a456-426614174000
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -14,23 +15,19 @@ settings {
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
docs {
|
||||
## Get Ebook
|
||||
|
||||
|
||||
Retrieves details of a specific ebook.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
|
||||
**Response:** Complete ebook object with all metadata
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
- 404: Ebook not found
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ meta {
|
||||
|
||||
get {
|
||||
url: http://localhost:8765/api/ebooks
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -14,21 +15,19 @@ settings {
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
docs {
|
||||
## List Ebooks
|
||||
|
||||
|
||||
Retrieves a paginated list of ebooks.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Query Parameters:**
|
||||
- `limit` (number, optional): Number of results (default: 20, max: 100)
|
||||
- `offset` (number, optional): Pagination offset (default: 0)
|
||||
|
||||
|
||||
**Response:** Array of ebook objects with id, title, author, etc.
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
put {
|
||||
url: http://localhost:8765/api/ebooks/123e4567-e89b-12d3-a456-426614174000
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
@@ -25,23 +25,23 @@ settings {
|
||||
|
||||
docs {
|
||||
## Update Ebook
|
||||
|
||||
|
||||
Updates an existing ebook's metadata.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
|
||||
**Request Body:** (all fields optional)
|
||||
- `title` (string): Book title
|
||||
- `author` (string): Book author
|
||||
- `isbn` (string): ISBN number
|
||||
- `description` (string): Book description
|
||||
- `cover_image_path` (string): Path to cover image
|
||||
|
||||
|
||||
**Response:** Updated ebook object
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
- 404: Ebook not found
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
vars {
|
||||
base_url: http://localhost:8765
|
||||
ebookid: b8ace5d5-529b-448a-ba68-5fe6d09cafdb
|
||||
}
|
||||
vars:secret [
|
||||
token
|
||||
]
|
||||
|
||||
@@ -5,7 +5,8 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: http://localhost:8765/api/ebooks/123e4567-e89b-12d3-a456-426614174000/progress
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}/progress
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
@@ -16,21 +17,21 @@ settings {
|
||||
|
||||
docs {
|
||||
## Get Reading Progress
|
||||
|
||||
|
||||
Retrieves the authenticated user's reading progress for an ebook.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
|
||||
**Response:**
|
||||
- `ebook_id` (string): Ebook UUID
|
||||
- `user_id` (string): User UUID
|
||||
- `current_page` (number): Current page number
|
||||
- `total_pages` (number, nullable): Total pages
|
||||
- `last_read_at` (string): Last read timestamp
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
put {
|
||||
url: http://localhost:8765/api/ebooks/123e4567-e89b-12d3-a456-426614174000/progress
|
||||
url: http://localhost:8765/api/ebooks/{{ebookid}}/progress
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
@@ -24,20 +24,20 @@ settings {
|
||||
|
||||
docs {
|
||||
## Update Reading Progress
|
||||
|
||||
|
||||
Updates the authenticated user's reading progress for an ebook.
|
||||
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Ebook UUID
|
||||
|
||||
|
||||
**Request Body:**
|
||||
- `current_page` (number, required): Current page number
|
||||
- `total_pages` (number, optional): Total pages in book
|
||||
|
||||
|
||||
**Response:** Updated progress object
|
||||
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid authentication
|
||||
- 400: Invalid request data
|
||||
|
||||
Reference in New Issue
Block a user