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).
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
info:
|
|
name: Refresh Token
|
|
type: http
|
|
seq: 4
|
|
|
|
http:
|
|
method: POST
|
|
url: '{{base_url}}/api/auth/refresh'
|
|
auth: inherit
|
|
body:
|
|
type: json
|
|
data: |-
|
|
{
|
|
"refresh_token": "d4f5g6h7..."
|
|
}
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: after-response
|
|
code: |-
|
|
function onResponse(res) {
|
|
try {
|
|
const responseBody = res.getBody();
|
|
const token = responseBody.access_token;
|
|
const refreshToken = responseBody.refresh_token;
|
|
if (token) {
|
|
bru.setEnvVar("token", token, { persist: true });
|
|
console.log("Access token saved");
|
|
}
|
|
if (refreshToken) {
|
|
bru.setEnvVar("refresh_token", refreshToken, { persist: true });
|
|
console.log("Refresh token saved");
|
|
}
|
|
} catch (error) {
|
|
console.error("Token capture failed:", error.message);
|
|
}
|
|
}
|
|
onResponse();
|
|
|
|
docs: |-
|
|
# Refresh Token
|
|
|
|
`POST /api/auth/refresh` — auth: none.
|
|
|
|
Canonical reference: `docs/developer/api/authentication/refresh_token.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
|