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:
John O'Keefe committed 2026-10-24 18:35:51 -04:00
1 parent 6fc501b35a
commit acd82fff0a
353 files changed
+5165 -5293

No files matched your search

-34
View File
@@ -1,34 +0,0 @@
info:
name: Download Book (EPUB)
type: http
seq: 3
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/download/{{book_id}}'
docs: |-
## Download Book (EPUB)
Downloads a book in standard EPUB format for reading on e-reader devices.
**Method:** GET
**Endpoint:** /devices/{device_id}/download/{book_id}
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
- `book_id` (string): Book ID
**Query Parameters:**
- `format` (string, optional): File format (epub, default)
**Response:**
- Binary EPUB file content
**Status Codes:**
- 200: Success (file download)
- 401: Unauthorized
- 403: Forbidden (device not authorized for this book)
- 404: Book not found
@@ -1,19 +0,0 @@
info:
name: Download Book KEPUB (On-the-fly Conversion)
type: http
seq: 1
http:
method: GET
url: '{{base_url}}/opds/devices/{{deviceId}}/download/{{mediaItemId}}?format=kepub'
auth: inherit
body:
type: none
docs: |-
## Download Book KEPUB (On-the-fly Conversion)
Downloads a book in Kobo EPUB (KEPUB) format with on-the-fly conversion if needed.
**Method:** GET
**Endpoint:** /opds/devices/{deviceId
-34
View File
@@ -1,34 +0,0 @@
info:
name: Download Book (KEPUB)
type: http
seq: 4
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/download/{{book_id}}?format=kepub'
docs: |-
## Download Book (KEPUB)
Downloads a book in Kobo-specific KEPUB format, optimized for Kobo e-readers.
**Method:** GET
**Endpoint:** /devices/{device_id}/download/{book_id}
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
- `book_id` (string): Book ID
**Query Parameters:**
- `format` (string, required): File format (kepub for Kobo devices)
**Response:**
- Binary KEPUB file content (EPUB with Kobo-specific enhancements)
**Status Codes:**
- 200: Success (file download)
- 401: Unauthorized
- 403: Forbidden (device not authorized for this book)
- 404: Book not found
-35
View File
@@ -1,35 +0,0 @@
info:
name: Get Cover Image
type: http
seq: 5
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/cover/{{book_id}}'
docs: |-
## Get Cover Image
Retrieves the cover image for a specific book.
**Method:** GET
**Endpoint:** /devices/{device_id}/cover/{book_id}
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
- `book_id` (string): Book ID
**Query Parameters:**
- `width` (integer, optional): Desired width in pixels
- `height` (integer, optional): Desired height in pixels
- `quality` (integer, optional): Image quality (1-100, default 85)
**Response:**
- Binary image file (JPEG or PNG)
**Status Codes:**
- 200: Success (image file)
- 401: Unauthorized
- 404: Book or cover not found
-35
View File
@@ -1,35 +0,0 @@
info:
name: Get Device Catalog
type: http
seq: 1
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/catalog?page=1&per_page=50'
docs: |-
## Get Device Catalog
Retrieves a paginated catalog of books available for the device, compatible with OPDS feed format.
**Method:** GET
**Endpoint:** /devices/{device_id}/catalog
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
**Query Parameters:**
- `page` (integer, optional): Page number (default 1)
- `per_page` (integer, optional): Items per page (default 50, max 200)
- `sort_by` (string, optional): Sort field (title, author, date_added)
- `order` (string, optional): Sort order (asc, desc)
**Response:**
- OPDS 2.0 feed with book entries including metadata and download links
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 404: Device not found
-34
View File
@@ -1,34 +0,0 @@
info:
name: Get Device Navigation
type: http
seq: 6
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/nav'
docs: |-
## Get Device Navigation
Provides OPDS navigation feed for device, including collections and series groups.
**Method:** GET
**Endpoint:** /devices/{device_id}/nav
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
**Response:**
- OPDS navigation feed with links to:
- All books
- Collections
- Series
- Authors
- Recent additions
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 404: Device not found
-34
View File
@@ -1,34 +0,0 @@
info:
name: List Formats
type: http
seq: 7
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/formats/{{book_id}}'
docs: |-
## List Formats
Lists all available file formats for a specific book.
**Method:** GET
**Endpoint:** /devices/{device_id}/formats/{book_id}
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
- `book_id` (string): Book ID
**Response:**
- Array of available formats:
- `format` (string): Format identifier (epub, kepub, pdf, etc.)
- `file_size` (integer): File size in bytes
- `download_url` (string): Download link
- `optimized_for` (array): Compatible device types
**Status Codes:**
- 200: Success
- 401: Unauthorized
- 404: Book not found
-35
View File
@@ -1,35 +0,0 @@
info:
name: Search Device Catalog
type: http
seq: 2
http:
method: GET
url: '{{opds_base_url}}/devices/{{device_id}}/search?q=hobbit'
docs: |-
## Search Device Catalog
Searches the device's book catalog for matching titles, authors, or series.
**Method:** GET
**Endpoint:** /devices/{device_id}/search
**Authentication:** Required (Device token or Bearer token)
**Path Parameters:**
- `device_id` (string): Device ID
**Query Parameters:**
- `q` (string, required): Search query
- `page` (integer, optional): Page number (default 1)
- `per_page` (integer, optional): Items per page (default 50)
- `search_in` (string, optional): Search fields (title, author, series, all)
**Response:**
- OPDS 2.0 feed with matching book entries
**Status Codes:**
- 200: Success
- 400: Invalid query
- 401: Unauthorized
+24
View File
@@ -0,0 +1,24 @@
info:
name: OPDS Acquisition
type: http
seq: 1
http:
method: GET
url: '{{base_url}}/opds/devices/{{device_id}}/download/{{book_uuid}}'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# OPDS Acquisition
`GET /opds/devices/:deviceId/download/:bookId` — auth: device-token.
Canonical reference: `docs/developer/api/opds/acquisition.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: OPDS Feeds
type: http
seq: 2
http:
method: GET
url: '{{base_url}}/opds/devices/{{device_id}}/catalog'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# OPDS Feeds
`GET /opds/devices/:deviceId/catalog` — auth: device-token.
Canonical reference: `docs/developer/api/opds/feeds.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
+24
View File
@@ -0,0 +1,24 @@
info:
name: OPDS Publication
type: http
seq: 3
http:
method: GET
url: '{{base_url}}/opds/devices/{{device_id}}/cover/{{book_uuid}}'
auth: inherit
headers:
- key: Authorization
value: Bearer {{device_token}}
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
# OPDS Publication
`GET /opds/devices/:deviceId/cover/:bookId` — auth: device-token.
Canonical reference: `docs/developer/api/opds/publication.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.