mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 23:52:24 +00:00
chore(release): v1.4.25
Largest feature delta in the v1.4.x line. Insights expands into seven dedicated metric sub-pages; GLP-1 medication tracking lands end-to-end (drug-level chart with Research Mode acknowledgment, EMA titration ladder, cadence + compliance, side-effect taxonomy, pen/vial inventory); cross-source priority becomes a two-axis resolver; per-user timezone threads through ten analytics surfaces; Withings activity + sleep v2 sync; onboarding rebuilt as a nested-route wizard; Personal Records ship end-to-end; Health Score provenance accordion; Coach runs native first-party prompts across six locales with a 1800-assertion refusal-probe matrix; OpenAPI drift gate hard-fails; multi-arch GHCR image. Migrations 0043 through 0060 are additive and forward-only. PROMPT_VERSION 4.24.0 → 4.25.0 with GROUND RULE 9 (refuses dose recommendations) and GROUND RULE 15 (refuses drug-level estimates with MDR + MDCG 2021-24 cites). See CHANGELOG.md for the full per-section delta.
This commit is contained in:
1 parent
de0689e419
commit
17b8d8d2c2
528 files changed
+104033
-6524
No files matched your search
+21
-3
@@ -10,15 +10,33 @@ export function apiSuccess<T>(data: T, status = 200) {
|
||||
* `{ errorCode: "credentials_rejected" }` so the UI translates the message
|
||||
* via `t("settings.testConnection.errors." + errorCode)` instead of
|
||||
* displaying the server's English fallback.
|
||||
*
|
||||
* v1.4.25 W21 Fix-N — the third argument may also carry a `headers`
|
||||
* record (e.g. `{ headers: rateLimitHeaders(rl) }`) so 429 responses
|
||||
* can attach the `X-RateLimit-*` triple in the same call. The `headers`
|
||||
* key is *not* echoed into the JSON body — it is consumed by the
|
||||
* NextResponse constructor and stripped from the meta envelope.
|
||||
*/
|
||||
export function apiError(
|
||||
message: string,
|
||||
status = 400,
|
||||
meta?: { errorCode?: string } & Record<string, unknown>,
|
||||
meta?: {
|
||||
errorCode?: string;
|
||||
headers?: Record<string, string>;
|
||||
} & Record<string, unknown>,
|
||||
) {
|
||||
const { headers, ...rest } = meta ?? {};
|
||||
const metaKeys = Object.keys(rest);
|
||||
return NextResponse.json(
|
||||
{ data: null, error: message, ...(meta ? { meta } : {}) },
|
||||
{ status },
|
||||
{
|
||||
data: null,
|
||||
error: message,
|
||||
...(metaKeys.length > 0 ? { meta: rest } : {}),
|
||||
},
|
||||
{
|
||||
status,
|
||||
...(headers ? { headers } : {}),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user