Merge branch 'v143/links' into release/v1.43.0

# Conflicts:
#	docs/api/openapi.yaml
#	src/__tests__/contract-stub-inventory.test.ts
#	src/app/api/medications/[id]/route.ts
#	src/components/medications/detail/medication-detail-tabs.tsx
#	src/lib/export/backup-plan.ts
This commit is contained in:
Marc-André Bombeck committed 2026-10-16 00:34:53 +02:00
commit 0dd634c9c8
64 files changed
+3445 -119

No files matched your search

+115 -8
View File
@@ -15771,7 +15771,8 @@ paths:
- Records
summary: File targets against a visit
description: "Adds links. Idempotent: a pair that already exists succeeds and changes nothing. Session-authenticated
only, matching document link and unlink."
only, matching document link and unlink. Since v1.43 `targetKind` also takes `medication` and `vaccination`;
those links show in the visit's `related` list (`GET /api/encounters/{id}`), not in `links`."
parameters:
- in: path
name: id
@@ -16384,9 +16385,11 @@ paths:
post:
tags:
- Records
summary: File documents against a vaccination
summary: File documents or a visit against a vaccination
description: "Adds links. Idempotent: a pair that already exists succeeds and changes nothing. Session-authenticated
only, matching document and visit link and unlink."
only, matching document and visit link and unlink. Since v1.43 `targetKind` also takes `encounter` (the visit
the dose was given at); that link shows in the dose's `related` list (`GET /api/vaccinations/{id}`), not in
`documents`."
parameters:
- in: path
name: id
@@ -16413,7 +16416,7 @@ paths:
delete:
tags:
- Records
summary: Unfile documents from a vaccination
summary: Unfile documents or a visit from a vaccination
description: Removes links. Idempotent, and it still works for a page the account has since deleted — refusing would
leave a filing nobody can clear.
parameters:
@@ -24601,7 +24604,6 @@ paths:
$ref: "#/components/schemas/ErrorEnvelope"
"422": *a4
"429": *a5
"501": *a69
delete:
tags:
- Links
@@ -24637,7 +24639,6 @@ paths:
$ref: "#/components/schemas/ErrorEnvelope"
"422": *a4
"429": *a5
"501": *a69
/api/labs/{id}/links:
post:
tags:
@@ -24674,7 +24675,6 @@ paths:
$ref: "#/components/schemas/ErrorEnvelope"
"422": *a4
"429": *a5
"501": *a69
delete:
tags:
- Links
@@ -24710,7 +24710,6 @@ paths:
$ref: "#/components/schemas/ErrorEnvelope"
"422": *a4
"429": *a5
"501": *a69
/api/bugreport:
post:
security: []
@@ -31672,6 +31671,8 @@ components:
- document
- labResult
- conditionEpisode
- medication
- vaccination
targetIds:
minItems: 1
maxItems: 100
@@ -32080,6 +32081,7 @@ components:
type: string
enum:
- document
- encounter
targetIds:
minItems: 1
maxItems: 100
@@ -42198,6 +42200,106 @@ components:
- targetId
- createdAt
additionalProperties: {}
labResultDocumentLinks:
default: []
type: array
items:
type: object
properties:
labResultId:
type: string
minLength: 1
documentId:
type: string
minLength: 1
createdAt:
type: string
minLength: 1
required:
- labResultId
- documentId
- createdAt
additionalProperties: {}
encounterMedicationLinks:
default: []
type: array
items:
type: object
properties:
encounterId:
type: string
minLength: 1
medicationId:
type: string
minLength: 1
createdAt:
type: string
minLength: 1
required:
- encounterId
- medicationId
- createdAt
additionalProperties: {}
encounterVaccinationLinks:
default: []
type: array
items:
type: object
properties:
encounterId:
type: string
minLength: 1
vaccinationId:
type: string
minLength: 1
createdAt:
type: string
minLength: 1
required:
- encounterId
- vaccinationId
- createdAt
additionalProperties: {}
medicationDocumentLinks:
default: []
type: array
items:
type: object
properties:
medicationId:
type: string
minLength: 1
documentId:
type: string
minLength: 1
createdAt:
type: string
minLength: 1
required:
- medicationId
- documentId
- createdAt
additionalProperties: {}
medicationConditionLinks:
default: []
type: array
items:
type: object
properties:
medicationId:
type: string
minLength: 1
episodeId:
type: string
minLength: 1
createdAt:
type: string
minLength: 1
required:
- medicationId
- episodeId
- createdAt
additionalProperties: {}
coachConversations:
default: []
type: array
@@ -43422,6 +43524,11 @@ components:
- customVaccines
- vaccinations
- vaccinationDocumentLinks
- labResultDocumentLinks
- encounterMedicationLinks
- encounterVaccinationLinks
- medicationDocumentLinks
- medicationConditionLinks
- coachConversations
- mentalHealthAssessments
- consentReceipts
+23 -3
View File
@@ -472,7 +472,7 @@ once per event type, and every channel carries the same target:
| Medication reminder, low supply, shared dose | `/medications` (low supply opens the medication) |
| Check-up and measurement reminders | `/checkups` |
| Proactive Coach nudge | the Coach conversation it started |
| Cycle reminders | `/cycle` (nothing with discreet notifications on) |
| Cycle reminders | `/cycle` (the dashboard with discreet notifications on) |
| New sign-in | Settings, Security |
| Integration sync failing | Settings, Integrations (an admin alert about another account opens the admin page) |
| Illness red flag | the illness episode |
@@ -496,8 +496,11 @@ How each channel carries it:
ntfy, Telegram, the webhook and email need an absolute link, built from
`APP_URL` (or `NEXT_PUBLIC_APP_URL`). Without one those channels deliver as
before, just without a link. A notification about a profile you look after
as a Guardian carries no deep link, because your session opens on your own
record.
as a Guardian opens the dashboard rather than the profile's page, because
your session opens on your own record and the record switcher lives there.
A discreet notification opens the dashboard as well, so its link names
nothing. The silent background sync push for medication intake is the only
notification without a link.
### Health figures in notifications
@@ -538,6 +541,23 @@ token is the only credential, so it is built to be harmless on its own:
The buttons need `APP_URL`, because the ntfy app calls the URL from your
phone. Your phone has to reach the instance at that address.
### Quick answers behind forward auth
If the instance sits behind a forward-auth gateway (Authelia, Authentik,
oauth2-proxy, Cloudflare Access and the like), the gateway answers the
button's request with its login page and the answer is never logged: the
ntfy app has no session with the gateway. Exempt the one path from the
gateway:
```
/api/notifications/action/*
```
The route does not rely on the gateway. The signed token is its only
credential, it is rate-limited before the token is read, and it can log one
mood answer for one account and nothing else. Every other path stays behind
the gateway.
What the token cannot protect against is the topic itself. The button URLs,
token included, travel through your ntfy server inside the message, and the
message is delivered to everyone subscribed to the topic. For the six hours