test: add Bruno API collections for sync features
- Add device registration and management API tests - Add conflicts resolution API tests - Add queue management API tests - Add KOReader sync protocol tests - Add Kobo sync protocol tests
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
meta {
|
||||
name: Approve Device Registration
|
||||
type: http
|
||||
seq: 6
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/devices/approve/{{registration_id}}
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
headers: {
|
||||
Authorization: Bearer {{token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Approve Device Registration
|
||||
|
||||
Approves a pending device registration request.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/devices/approve/:registration_id
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `registration_id` (string): Registration request UUID
|
||||
|
||||
**Response:**
|
||||
- Success message with approved device details
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Registration not found
|
||||
- 400: Invalid registration status
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
{
|
||||
"message": "Device registration approved",
|
||||
"device_id": "uuid",
|
||||
"device_name": "My Kobo"
|
||||
}
|
||||
```
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
meta {
|
||||
name: List Pending Device Registrations
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/devices/pending
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
headers: {
|
||||
Authorization: Bearer {{token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
## List Pending Device Registrations
|
||||
|
||||
Retrieves all pending device registration requests awaiting approval.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/devices/pending
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Response:**
|
||||
- Array of pending device registrations
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "uuid",
|
||||
"device_name": "My Kobo",
|
||||
"device_type": "kobo",
|
||||
"user_id": "uuid",
|
||||
"created_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
]
|
||||
```
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
meta {
|
||||
name: Reject Device Registration
|
||||
type: http
|
||||
seq: 7
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/devices/reject/{{registration_id}}
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
headers: {
|
||||
Authorization: Bearer {{token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Reject Device Registration
|
||||
|
||||
Rejects a pending device registration request.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/devices/reject/:registration_id
|
||||
|
||||
**Authentication:** Bearer token
|
||||
|
||||
**Path Parameters:**
|
||||
- `registration_id` (string): Registration request UUID
|
||||
|
||||
**Response:**
|
||||
- Success message confirming rejection
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Registration not found
|
||||
- 400: Invalid registration status
|
||||
|
||||
**Example Response:**
|
||||
```json
|
||||
{
|
||||
"message": "Device registration rejected",
|
||||
"registration_id": "uuid"
|
||||
}
|
||||
```
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
meta {
|
||||
name: "Bookmann Device Management API"
|
||||
type: "collection"
|
||||
environment: {
|
||||
development: {
|
||||
base_url: "http://localhost:8765/api"
|
||||
},
|
||||
production: {
|
||||
base_url: "https://your-domain.com/api"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Register Device
|
||||
@name("Register Device")
|
||||
POST {{environment.base_url}}/devices/register
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "My Kobo Clara",
|
||||
"device_type": "kobo",
|
||||
"device_identifier": "N1234567890123"
|
||||
}
|
||||
|
||||
@name("Register KOReader Device")
|
||||
POST {{environment.base_url}}/devices/register
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "My Kindle Paperwhite",
|
||||
"device_type": "koreader",
|
||||
"device_identifier": "G090GP123456789"
|
||||
}
|
||||
|
||||
@name("Register Web Device")
|
||||
POST {{environment.base_url}}/devices/register
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "Chrome Browser",
|
||||
"device_type": "web",
|
||||
"device_identifier": "web-client-abc123"
|
||||
}
|
||||
|
||||
# Check Registration Status
|
||||
@name("Check Pending Registration")
|
||||
POST {{environment.base_url}}/devices/register/status
|
||||
Content-Type: application/json
|
||||
{
|
||||
"registration_id": "registration-uuid-here"
|
||||
}
|
||||
|
||||
@name("Check Approved Registration")
|
||||
POST {{environment.base_url}}/devices/register/status
|
||||
Content-Type: application/json
|
||||
{
|
||||
"registration_id": "registration-uuid-here"
|
||||
}
|
||||
|
||||
# List Devices (requires authentication)
|
||||
@name("List User Devices")
|
||||
GET {{environment.base_url}}/devices
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
@name("Get Device Details")
|
||||
GET {{environment.base_url}}/devices/{{device_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
# Update Device Settings
|
||||
@name("Update Device Settings")
|
||||
PUT {{environment.base_url}}/devices/{{device_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "Updated Device Name",
|
||||
"sync_enabled": true,
|
||||
"auto_sync": true,
|
||||
"sync_frequency_minutes": 10
|
||||
}
|
||||
|
||||
@name("Disable Device Sync")
|
||||
PUT {{environment.base_url}}/devices/{{device_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "My Kobo Clara",
|
||||
"sync_enabled": false,
|
||||
"auto_sync": false,
|
||||
"sync_frequency_minutes": 30
|
||||
}
|
||||
|
||||
@name("Update Sync Frequency")
|
||||
PUT {{environment.base_url}}/devices/{{device_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
Content-Type: application/json
|
||||
{
|
||||
"device_name": "My Kobo Clara",
|
||||
"sync_enabled": true,
|
||||
"auto_sync": true,
|
||||
"sync_frequency_minutes": 15
|
||||
}
|
||||
|
||||
# Delete/Revoke Device
|
||||
@name("Delete Device")
|
||||
DELETE {{environment.base_url}}/devices/{{device_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
# Get Pending Registrations
|
||||
@name("Get Pending Registrations")
|
||||
GET {{environment.base_url}}/devices/pending
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
# Approve Device Registration
|
||||
@name("Approve Device Registration")
|
||||
GET {{environment.base_url}}/devices/approve/{{registration_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
@name("Approve Registration - KOReader")
|
||||
GET {{environment.base_url}}/devices/approve/reg-uuid-123
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
@name("Approve Registration - Kobo")
|
||||
GET {{environment.base_url}}/devices/approve/reg-uuid-456
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
# Reject Device Registration
|
||||
@name("Reject Device Registration")
|
||||
POST {{environment.base_url}}/devices/reject/{{registration_id}}
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
@name("Reject Registration - KOReader")
|
||||
POST {{environment.base_url}}/devices/reject/reg-uuid-123
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
|
||||
@name("Reject Registration - Kobo")
|
||||
POST {{environment.base_url}}/devices/reject/reg-uuid-456
|
||||
Authorization: Bearer {{jwt_token}}
|
||||
Reference in New Issue
Block a user