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,42 +0,0 @@
|
||||
info:
|
||||
name: Delete Reading Progress
|
||||
type: http
|
||||
seq: 1
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
headers:
|
||||
- key: Content-Type
|
||||
value: application/json
|
||||
runtime:
|
||||
scripts:
|
||||
- type: tests
|
||||
code: "test_delete_reading_progress_success(status, headers, body) {\n if (status\
|
||||
\ !== 200 && status !== 204) {\n throw new Error(\"Expected status 200\
|
||||
\ or 204, got \" + status);"
|
||||
|
||||
docs: |-
|
||||
## Delete Reading Progress
|
||||
|
||||
Deletes reading progress for a media item. This is a legacy endpoint - consider using universal progress endpoints instead.
|
||||
|
||||
**Method:** DELETE
|
||||
|
||||
**Endpoint:** /api/media-items/:id/progress
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string, required): Media item UUID
|
||||
|
||||
**Response:** Success message or empty
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 204: Success (no content)
|
||||
- 401: Unauthorized
|
||||
- 404: Media item not found
|
||||
- 500: Internal server error
|
||||
|
||||
**Note:** This is a legacy endpoint. Use `/api/progress/:id` endpoints for new implementations.
|
||||
@@ -1,30 +0,0 @@
|
||||
info:
|
||||
name: Get Reading Progress
|
||||
type: http
|
||||
seq: 6
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
|
||||
docs: |-
|
||||
## Get Reading Progress
|
||||
|
||||
Retrieves the authenticated user's reading progress for a media item.
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media Item UUID
|
||||
|
||||
**Response:**
|
||||
- `id` (string): Media Item 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
|
||||
@@ -1,35 +0,0 @@
|
||||
info:
|
||||
name: Update Reading Progress
|
||||
type: http
|
||||
seq: 7
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"current_page": 45,
|
||||
"total_pages": 200
|
||||
}
|
||||
|
||||
docs: |-
|
||||
## Update Reading Progress
|
||||
|
||||
Updates the authenticated user's reading progress for a media item.
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media Item 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
|
||||
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Delete Media Item Progress
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Delete Media Item Progress
|
||||
|
||||
`DELETE /api/media-items/:id/progress` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/progress/delete_media_progress.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 Media Item Progress
|
||||
type: http
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Media Item Progress
|
||||
|
||||
`GET /api/media-items/:id/progress` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/progress/get_media_progress.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 Progress History
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/progress/{{media_item_id}}/history'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Progress History
|
||||
|
||||
`GET /api/progress/:id/history` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/progress/get_progress_history.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
@@ -0,0 +1,29 @@
|
||||
info:
|
||||
name: Update Media Item Progress
|
||||
type: http
|
||||
seq: 4
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/progress'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"percentage": 0.0415,
|
||||
"context_text": "was at war with one of these Powers it was generally at peace with the other. But what was strange w",
|
||||
"epubcfi": "epubcfi(/6/4!/4/8[_idContainer003]/62/1:456)"
|
||||
}
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Update Media Item Progress
|
||||
|
||||
`PUT /api/media-items/:id/progress` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/progress/update_media_progress.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