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,46 +0,0 @@
|
||||
info:
|
||||
name: Create Media Highlight
|
||||
type: http
|
||||
seq: 2
|
||||
http:
|
||||
method: POST
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"selection_text": "This is the highlighted text from the media item.",
|
||||
"start_position": "page:45:offset:120",
|
||||
"end_position": "page:45:offset:145",
|
||||
"color": "#ffff00",
|
||||
"note_id": ""
|
||||
}
|
||||
|
||||
docs: |-
|
||||
## Create Media Highlight
|
||||
|
||||
Creates a new highlight for a specific media item.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/media-items/:id/highlights
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item ID
|
||||
|
||||
**Request Body:**
|
||||
- `selection_text` (string): Highlighted text (required, 1-5000 chars)
|
||||
- `start_position` (string): Start position (required, max 100 chars)
|
||||
- `end_position` (string): End position (required, max 100 chars)
|
||||
- `color` (string): Highlight color in hex format (optional, default #ffff00)
|
||||
- `note_id` (string): Optional associated note ID
|
||||
|
||||
**Response:**
|
||||
- Highlight object with all fields including generated ID and timestamps
|
||||
|
||||
**Status Codes:**
|
||||
- 201: Created
|
||||
- 400: Invalid request
|
||||
- 401: Unauthorized
|
||||
- 404: Media item not found
|
||||
@@ -1,31 +0,0 @@
|
||||
info:
|
||||
name: Delete Media Highlight
|
||||
type: http
|
||||
seq: 5
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights/{{highlight_id}}'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
|
||||
docs: |-
|
||||
## Delete Media Highlight
|
||||
|
||||
Deletes a specific highlight.
|
||||
|
||||
**Method:** DELETE
|
||||
|
||||
**Endpoint:** /api/media-items/:id/highlights/:highlightId
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item ID
|
||||
- `highlightId` (string): Highlight ID
|
||||
|
||||
**Response:**
|
||||
- 204 No Content on success
|
||||
|
||||
**Status Codes:**
|
||||
- 204: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Highlight not found
|
||||
@@ -1,40 +0,0 @@
|
||||
info:
|
||||
name: Get Media Highlights
|
||||
type: http
|
||||
seq: 1
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
|
||||
docs: |-
|
||||
## Get Media Highlights
|
||||
|
||||
Retrieves all highlights for a specific media item for the authenticated user.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/media-items/:id/highlights
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item ID
|
||||
|
||||
**Response:**
|
||||
- Array of highlight objects with fields:
|
||||
- `id` (string): Highlight ID
|
||||
- `media_item_id` (string): Media item ID
|
||||
- `user_id` (string): User ID
|
||||
- `selection_text` (string): Highlighted text
|
||||
- `start_position` (string): Start position
|
||||
- `end_position` (string): End position
|
||||
- `color` (string): Highlight color (hex)
|
||||
- `note_id` (string): Optional associated note ID
|
||||
- `created_at` (string): Creation timestamp
|
||||
- `updated_at` (string): Last update timestamp
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Media item not found
|
||||
@@ -1,31 +0,0 @@
|
||||
info:
|
||||
name: Get Single Media Highlight
|
||||
type: http
|
||||
seq: 3
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights/{{highlight_id}}'
|
||||
auth: inherit
|
||||
body:
|
||||
type: none
|
||||
|
||||
docs: |-
|
||||
## Get Single Media Highlight
|
||||
|
||||
Retrieves a specific highlight by ID.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /api/media-items/:id/highlights/:highlightId
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item ID
|
||||
- `highlightId` (string): Highlight ID
|
||||
|
||||
**Response:**
|
||||
- Highlight object with all fields
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
- 404: Highlight not found
|
||||
@@ -1,47 +0,0 @@
|
||||
info:
|
||||
name: Update Media Highlight
|
||||
type: http
|
||||
seq: 4
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights/{{highlight_id}}'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"selection_text": "This is the updated highlighted text.",
|
||||
"start_position": "page:45:offset:125",
|
||||
"end_position": "page:45:offset:150",
|
||||
"color": "#ffeb3b",
|
||||
"note_id": ""
|
||||
}
|
||||
|
||||
docs: |-
|
||||
## Update Media Highlight
|
||||
|
||||
Updates an existing highlight.
|
||||
|
||||
**Method:** PUT
|
||||
|
||||
**Endpoint:** /api/media-items/:id/highlights/:highlightId
|
||||
|
||||
**Path Parameters:**
|
||||
- `id` (string): Media item ID
|
||||
- `highlightId` (string): Highlight ID
|
||||
|
||||
**Request Body:**
|
||||
- `selection_text` (string): Updated highlighted text (required, 1-5000 chars)
|
||||
- `start_position` (string): Updated start position (required, max 100 chars)
|
||||
- `end_position` (string): Updated end position (required, max 100 chars)
|
||||
- `color` (string): Updated highlight color in hex format (optional)
|
||||
- `note_id` (string): Updated associated note ID (optional)
|
||||
|
||||
**Response:**
|
||||
- Updated highlight object with all fields
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 400: Invalid request
|
||||
- 401: Unauthorized
|
||||
- 404: Highlight not found
|
||||
@@ -0,0 +1,32 @@
|
||||
info:
|
||||
name: Create Highlight
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"selection_text": "Highlighted text...",
|
||||
"start_position": "epubcfi(/6/4/2:15)",
|
||||
"end_position": "epubcfi(/6/4/2:20)",
|
||||
"color": "#ffff00",
|
||||
"percentage_start": 0.45,
|
||||
"percentage_end": 0.47
|
||||
}
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Create Highlight
|
||||
|
||||
`POST /api/media-items/:id/highlights` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/highlights/create_highlight.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
@@ -0,0 +1,21 @@
|
||||
info:
|
||||
name: Delete Highlight
|
||||
type: http
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights/{{highlight_id}}'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Delete Highlight
|
||||
|
||||
`DELETE /api/media-items/:id/highlights/:highlightId` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/highlights/delete_highlight.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 Highlights
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights'
|
||||
auth: inherit
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Get Highlights
|
||||
|
||||
`GET /api/media-items/:id/highlights` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/highlights/get_highlights.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|
||||
@@ -0,0 +1,28 @@
|
||||
info:
|
||||
name: Update Highlight
|
||||
type: http
|
||||
seq: 4
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: '{{base_url}}/api/media-items/{{media_item_id}}/highlights/{{highlight_id}}'
|
||||
auth: inherit
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"selection_text": "Updated text",
|
||||
"color": "#00ff00"
|
||||
}
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
# Update Highlight
|
||||
|
||||
`PUT /api/media-items/:id/highlights/:highlightId` — auth: jwt.
|
||||
|
||||
Canonical reference: `docs/developer/api/highlights/update_highlight.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