feat: Add comprehensive backend validation, toast notifications, and Tokyo Night theme
- Backend: Add server-side validation with go-playground/validator/v10 - Frontend: Add toast notifications for API errors with @zerodevx/svelte-toast - UI: Complete Tokyo Night theme redesign with modern animations - Docs: Update COMPLETE_DOCUMENTATION.md and README.md with all enhancements - Validation: Email format, password strength, and input sanitization - UX: Real-time error feedback, loading states, and responsive design
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
meta:
|
||||
name: Create Ebook
|
||||
seq: 3
|
||||
http:
|
||||
method: post
|
||||
url: "{{base_url}}/api/ebooks"
|
||||
auth:
|
||||
type: bearer
|
||||
body:
|
||||
type: json
|
||||
data: |
|
||||
{
|
||||
"title": "Sample Book",
|
||||
"author": "Sample Author",
|
||||
"isbn": "1234567890",
|
||||
"description": "A sample ebook",
|
||||
"file_path": "/uploads/sample.epub",
|
||||
"file_size": 1024000,
|
||||
"mime_type": "application/epub+zip",
|
||||
"cover_image_path": "/uploads/cover.jpg"
|
||||
}
|
||||
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
|
||||
- `isbn` (string, optional): ISBN number
|
||||
- `description` (string, optional): Book description
|
||||
- `file_path` (string, required): Path to ebook file
|
||||
- `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
|
||||
@@ -0,0 +1,27 @@
|
||||
meta:
|
||||
name: Delete Ebook
|
||||
seq: 5
|
||||
http:
|
||||
method: delete
|
||||
url: "{{base_url}}/api/ebooks/{{ebook_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
vars:
|
||||
pre-request:
|
||||
- name: ebook_id
|
||||
value: "123e4567-e89b-12d3-a456-426614174000"
|
||||
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
|
||||
@@ -0,0 +1,27 @@
|
||||
meta:
|
||||
name: Get Ebook
|
||||
seq: 2
|
||||
http:
|
||||
method: get
|
||||
url: "{{base_url}}/api/ebooks/{{ebook_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
vars:
|
||||
pre-request:
|
||||
- name: ebook_id
|
||||
value: "123e4567-e89b-12d3-a456-426614174000"
|
||||
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
|
||||
@@ -0,0 +1,23 @@
|
||||
meta:
|
||||
name: List Ebooks
|
||||
seq: 1
|
||||
http:
|
||||
method: get
|
||||
url: "{{base_url}}/api/ebooks"
|
||||
auth:
|
||||
type: bearer
|
||||
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
|
||||
@@ -0,0 +1,43 @@
|
||||
meta:
|
||||
name: Update Ebook
|
||||
seq: 4
|
||||
http:
|
||||
method: put
|
||||
url: "{{base_url}}/api/ebooks/{{ebook_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
body:
|
||||
type: json
|
||||
data: |
|
||||
{
|
||||
"title": "Updated Book Title",
|
||||
"author": "Updated Author",
|
||||
"description": "Updated description"
|
||||
}
|
||||
vars:
|
||||
pre-request:
|
||||
- name: ebook_id
|
||||
value: "123e4567-e89b-12d3-a456-426614174000"
|
||||
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
|
||||
- 400: Invalid request data
|
||||
Reference in New Issue
Block a user