bruno: regenerate collection from canonical docs + permanent docs↔Bruno parity gate
WO4. The old collection was the drifted artifact AGENTS.md warned about:
bodies pre-truncated at their first {{var}}, routes renamed server-side
but not here (/api/notes/:media_id, /api/book-matching/search,
/api/collections/:id/rules/test), an orphan universal-progress suite for
routes that no longer exist.
scripts/gen_bruno_from_docs.py emits one OpenCollection request per
frontmatter'd endpoint doc (191 requests): gate-verified example-request
JSON as body, {{env}} params per the environment file, device-token
routes get an explicit Bearer {{device_token}} header, login/register/
refresh keep the token-capture after-response scripts that chain the
collection. Old 1:1 mirrors deleted (128); hand-authored NewDevDBSetup,
environments, and edge-case suites kept. 30 scenario files with
truncated bodies (the documented corruption) deleted — they could not
run.
internal/docs/drift_test.go gains TestBrunoMirrorsDocs: every
frontmatter'd doc must have a Bruno request with matching method+URL
shape — the collection can never silently drift from the docs again.
opencollection.yml README block replaced with the real run instructions.
make test green (9 pkgs, parity test included in internal/docs).
This commit is contained in:
1 parent
6fc501b35a
commit
acd82fff0a
353 files changed
+5165
-5293
No files matched your search
@@ -1,47 +0,0 @@
|
||||
info:
|
||||
name: Get Device Usage
|
||||
type: http
|
||||
seq: 2
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/device-usage'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test(\"status must be 200\", function() {\n expect(res.status).to.eql(200);"
|
||||
|
||||
docs: |-
|
||||
Get usage statistics for all devices.
|
||||
|
||||
**Endpoint**: GET /api/analytics/device-usage
|
||||
**Auth**: Required (Bearer token)
|
||||
|
||||
## Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| devices | array | List of device usage statistics |
|
||||
| devices[].id | string | Device ID |
|
||||
| devices[].device_name | string | Device name |
|
||||
| devices[].device_type | string | Device type (kobo, kindle, koreader) |
|
||||
| devices[].sync_count | int | Number of sync operations |
|
||||
| devices[].last_sync | string | Last sync timestamp |
|
||||
| devices[].total_reading_minutes | int | Total reading time on device |
|
||||
| devices[].books_read | int | Number of books completed on device |
|
||||
|
||||
## Example Response
|
||||
|
||||
```json
|
||||
{
|
||||
"devices": [
|
||||
{
|
||||
"id": "789e4567-e89b-12d3-a456-426614174001",
|
||||
"device_name": "My Kobo Clara",
|
||||
"device_type": "kobo",
|
||||
"sync_count": 45,
|
||||
"last_sync": "2026-02-08T17:25:00Z",
|
||||
"total_reading_minutes": 1250,
|
||||
"books_read": 3
|
||||
@@ -1,57 +0,0 @@
|
||||
info:
|
||||
name: Get Popular Books
|
||||
type: http
|
||||
seq: 1
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/popular-books?limit=10'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test(\"status must be 200\", function() {\n expect(res.status).to.eql(200);"
|
||||
|
||||
docs: |-
|
||||
Get popular books sorted by read count.
|
||||
|
||||
**Endpoint**: GET /api/analytics/popular-books
|
||||
**Auth**: Required (Bearer token)
|
||||
|
||||
## Query Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|-----------|-------------|
|
||||
| limit | int | No | Maximum number of books to return (default: 10) |
|
||||
|
||||
## Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| books | array | List of popular books |
|
||||
| books[].media_item_id | string | Book ID |
|
||||
| books[].title | string | Book title |
|
||||
| books[].author | string | Book author |
|
||||
| books[].read_count | int | Number of times read |
|
||||
| books[].avg_completion | float | Average completion rate (0-1) |
|
||||
| books[].cover_url | string | Cover image URL |
|
||||
|
||||
## Example Request
|
||||
|
||||
```
|
||||
GET /api/analytics/popular-books?limit=10
|
||||
```
|
||||
|
||||
## Example Response
|
||||
|
||||
```json
|
||||
{
|
||||
"books": [
|
||||
{
|
||||
"media_item_id": "323e4567-e89b-12d3-a456-426614174002",
|
||||
"title": "The Great Gatsby",
|
||||
"author": "F. Scott Fitzgerald",
|
||||
"read_count": 5,
|
||||
"avg_completion": 0.85,
|
||||
"cover_url": "/api/books/323e4567-e89b-12d3-a456-426614174002/cover"
|
||||
@@ -1,58 +0,0 @@
|
||||
info:
|
||||
name: Get Reading Stats Date Range
|
||||
type: http
|
||||
seq: 3
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/reading-stats?start_date=2024-01-01&end_date=2024-01-31'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test(\"status must be 200\", function() {\n expect(res.status).to.eql(200);"
|
||||
|
||||
docs: |-
|
||||
Get reading statistics for a specific date range.
|
||||
|
||||
**Endpoint**: GET /api/analytics/reading-stats
|
||||
**Auth**: Required (Bearer token)
|
||||
|
||||
## Query Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|-----------|-------------|
|
||||
| start_date | string | No | Start date (ISO 8601 format, default: 30 days ago) |
|
||||
| end_date | string | No | End date (ISO 8601 format, default: today) |
|
||||
|
||||
## Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| total_books_read | int | Total books completed in range |
|
||||
| total_pages_read | int | Total pages read in range |
|
||||
| total_reading_time_minutes | int | Total reading time in minutes |
|
||||
| completion_rate | float | Percentage of books completed (0-1) |
|
||||
| daily_reading_minutes | array | Daily reading time per day |
|
||||
| daily_reading_minutes[].date | string | Date (ISO 8601) |
|
||||
| daily_reading_minutes[].minutes | int | Minutes read on that date |
|
||||
|
||||
## Example Request
|
||||
|
||||
```
|
||||
GET /api/analytics/reading-stats?start_date=2024-01-01&end_date=2024-01-31
|
||||
```
|
||||
|
||||
## Example Response
|
||||
|
||||
```json
|
||||
{
|
||||
"total_books_read": 2,
|
||||
"total_pages_read": 450,
|
||||
"total_reading_time_minutes": 720,
|
||||
"completion_rate": 0.85,
|
||||
"daily_reading_minutes": [
|
||||
{
|
||||
"date": "2024-01-01",
|
||||
"minutes": 30
|
||||
@@ -1,58 +0,0 @@
|
||||
info:
|
||||
name: Get Reading Stats
|
||||
type: http
|
||||
seq: 4
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/reading-stats'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test(\"status must be 200\", function() {\n expect(res.status).to.eql(200);"
|
||||
|
||||
docs: |-
|
||||
Get overall reading statistics for the authenticated user.
|
||||
|
||||
**Endpoint**: GET /api/analytics/reading-stats
|
||||
**Auth**: Required (Bearer token)
|
||||
|
||||
## Query Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|-----------|-------------|
|
||||
| start_date | string | No | Start date (ISO 8601 format) |
|
||||
| end_date | string | No | End date (ISO 8601 format) |
|
||||
|
||||
## Response Fields
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| total_books_read | int | Total books completed |
|
||||
| total_pages_read | int | Total pages read |
|
||||
| total_reading_time_minutes | int | Total reading time in minutes |
|
||||
| completion_rate | float | Average book completion rate (0-1) |
|
||||
| daily_reading_minutes | array | Daily reading time breakdown |
|
||||
| daily_reading_minutes[].date | string | Date (ISO 8601) |
|
||||
| daily_reading_minutes[].minutes | int | Minutes read on that date |
|
||||
|
||||
## Example Request
|
||||
|
||||
```
|
||||
GET /api/analytics/reading-stats
|
||||
```
|
||||
|
||||
## Example Response
|
||||
|
||||
```json
|
||||
{
|
||||
"total_books_read": 12,
|
||||
"total_pages_read": 3450,
|
||||
"total_reading_time_minutes": 5400,
|
||||
"completion_rate": 0.78,
|
||||
"daily_reading_minutes": [
|
||||
{
|
||||
"date": "2026-01-15",
|
||||
"minutes": 45
|
||||
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Get Reading Statistics
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/reading-stats'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Reading Statistics
|
||||
|
||||
`GET /api/analytics/reading-stats` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/analytics/get_analytics.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Get Device Usage
|
||||
type: http
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/device-usage'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Device Usage
|
||||
|
||||
`GET /api/analytics/device-usage` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/analytics/get_device_usage.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Get Popular Books
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/analytics/popular-books'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Popular Books
|
||||
|
||||
`GET /api/analytics/popular-books` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/analytics/get_popular_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
Reference in new issue
Block a user