mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 07:13:29 +00:00
Measurement upserts in /api/sync/changes carry appleHealthMirror. A new
measurementMirror domain delivers { id, appleHealthMirror } for the live
readings of every token whose setting changed past the cursor, keyed on
(token.mirrorChangedAt, measurement.id). Switching the setting writes the
token row only, so the readings keep their updatedAt and syncVersion and
nothing keyed on them recomputes. The domain is additive inside the v2
cursor and is left out of the retention expiry, since its watermark is a
setting's age, not a deletion's.
238 lines
7.3 KiB
Plaintext
238 lines
7.3 KiB
Plaintext
{
|
|
"status": 200,
|
|
"body": {
|
|
"data": {
|
|
"serverNow": "<now>",
|
|
"cursor": "eyJ2IjoyLCJ0IjoxNzkyMDY1NjAwMDAwLCJkIjp7Im1lYXN1cmVtZW50cyI6eyJ1IjoxNzkyMDQ4MjAwMDAwLCJpIjoibS0wMiJ9LCJtb29kIjp7InUiOjE3OTIwNTE4MDAwMDAsImkiOiJtb29kLTAyIn0sImludGFrZXMiOnsidSI6MTc5MjA1MzAwMDAwMCwiaSI6ImluLTAyIn0sImN5Y2xlRGF5cyI6eyJ1IjoxNzkyMDU2NjAwMDAwLCJpIjoiY2QtMDIifSwiY3ljbGVzIjp7InUiOjE3OTIwNTQ4MDAwMDAsImkiOiJjeS0wMiJ9fX0",
|
|
"hasMore": true,
|
|
"cursorExpired": false,
|
|
"changes": {
|
|
"measurements": {
|
|
"upserts": [
|
|
{
|
|
"id": "m-01",
|
|
"externalId": null,
|
|
"type": "WEIGHT",
|
|
"value": 81.2,
|
|
"unit": "kg",
|
|
"measuredAt": "2026-10-14T06:30:00.000Z",
|
|
"source": "MANUAL",
|
|
"notes": "after the run",
|
|
"appleHealthMirror": true,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
},
|
|
{
|
|
"id": "m-02",
|
|
"externalId": "w-pulse-1",
|
|
"type": "PULSE",
|
|
"value": 61,
|
|
"unit": "bpm",
|
|
"measuredAt": "2026-10-14T07:00:00.000Z",
|
|
"source": "WITHINGS",
|
|
"notes": null,
|
|
"appleHealthMirror": true,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
}
|
|
],
|
|
"tombstones": []
|
|
},
|
|
"mood": {
|
|
"upserts": [
|
|
{
|
|
"id": "mood-01",
|
|
"date": "2026-10-14",
|
|
"mood": "GUT",
|
|
"score": 4,
|
|
"a1": 7,
|
|
"a2": 3,
|
|
"a3": null,
|
|
"a4": null,
|
|
"a5": null,
|
|
"context": {
|
|
"workStatus": "regular",
|
|
"workMinutes": 480,
|
|
"overtimeMinutes": null,
|
|
"workLoad": null,
|
|
"workSatisfaction": null,
|
|
"contactCircles": [],
|
|
"contactForm": null,
|
|
"contactExtent": null,
|
|
"contactQuality": null,
|
|
"contactSupport": null,
|
|
"leisureCategories": [],
|
|
"leisureMinutes": null,
|
|
"leisureJoy": null,
|
|
"leisureRecovery": null,
|
|
"eventType": null,
|
|
"eventValence": null,
|
|
"eventAt": null,
|
|
"note": null
|
|
},
|
|
"tags": "[\"slept well\"]",
|
|
"note": "a calm morning",
|
|
"moodLoggedAt": "2026-10-14T07:00:00.000Z",
|
|
"source": "MANUAL",
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
}
|
|
],
|
|
"tombstones": [
|
|
{
|
|
"id": "mood-02",
|
|
"syncVersion": "<syncVersion>",
|
|
"deletedAt": "2026-10-15T11:30:00.000Z",
|
|
"updatedAt": "<updatedAt>"
|
|
}
|
|
]
|
|
},
|
|
"intakes": {
|
|
"upserts": [
|
|
{
|
|
"id": "in-01",
|
|
"medicationId": "<id:1>",
|
|
"scheduledFor": "2026-10-14T06:00:00.000Z",
|
|
"takenAt": "2026-10-14T06:10:00.000Z",
|
|
"skipped": false,
|
|
"source": "WEB",
|
|
"autoRecorded": false,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
},
|
|
{
|
|
"id": "in-02",
|
|
"medicationId": "<id:1>",
|
|
"scheduledFor": "2026-10-13T06:00:00.000Z",
|
|
"takenAt": "2026-10-13T06:00:00.000Z",
|
|
"skipped": false,
|
|
"source": "WEB",
|
|
"autoRecorded": true,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
}
|
|
],
|
|
"tombstones": []
|
|
},
|
|
"cycleDays": {
|
|
"upserts": [
|
|
{
|
|
"id": "cd-01",
|
|
"date": "2026-10-10",
|
|
"cycleId": "cy-02",
|
|
"flow": "MEDIUM",
|
|
"intermenstrualBleeding": false,
|
|
"basalBodyTempC": null,
|
|
"temperatureExcluded": false,
|
|
"ovulationTest": null,
|
|
"cervicalMucus": null,
|
|
"cervixPosition": null,
|
|
"cervixFirmness": null,
|
|
"cervixOpening": null,
|
|
"sexualActivity": false,
|
|
"protectedSex": null,
|
|
"pregnancyTest": null,
|
|
"progesteroneTest": null,
|
|
"contraceptive": null,
|
|
"symptoms": [],
|
|
"note": null,
|
|
"source": "MANUAL",
|
|
"externalId": null,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>",
|
|
"deletedAt": null
|
|
},
|
|
{
|
|
"id": "cd-02",
|
|
"date": "2026-10-11",
|
|
"cycleId": "cy-02",
|
|
"flow": "LIGHT",
|
|
"intermenstrualBleeding": false,
|
|
"basalBodyTempC": 36.4,
|
|
"temperatureExcluded": false,
|
|
"ovulationTest": null,
|
|
"cervicalMucus": null,
|
|
"cervixPosition": null,
|
|
"cervixFirmness": null,
|
|
"cervixOpening": null,
|
|
"sexualActivity": false,
|
|
"protectedSex": null,
|
|
"pregnancyTest": null,
|
|
"progesteroneTest": null,
|
|
"contraceptive": null,
|
|
"symptoms": [],
|
|
"note": null,
|
|
"source": "MANUAL",
|
|
"externalId": "hk-cycle-1",
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>",
|
|
"deletedAt": null
|
|
}
|
|
],
|
|
"tombstones": []
|
|
},
|
|
"cycles": {
|
|
"upserts": [
|
|
{
|
|
"id": "cy-01",
|
|
"startDate": "2026-09-12",
|
|
"endDate": "2026-10-09",
|
|
"periodEndDate": "2026-09-16",
|
|
"lengthDays": 28,
|
|
"ovulationDate": null,
|
|
"ovulationConfirmed": false,
|
|
"isPredicted": false,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
},
|
|
{
|
|
"id": "cy-02",
|
|
"startDate": "2026-10-10",
|
|
"endDate": null,
|
|
"periodEndDate": null,
|
|
"lengthDays": null,
|
|
"ovulationDate": null,
|
|
"ovulationConfirmed": false,
|
|
"isPredicted": false,
|
|
"syncVersion": "<syncVersion>",
|
|
"updatedAt": "<updatedAt>"
|
|
}
|
|
],
|
|
"tombstones": []
|
|
},
|
|
"measurementMirror": {
|
|
"upserts": [],
|
|
"tombstones": []
|
|
}
|
|
}
|
|
},
|
|
"error": null
|
|
},
|
|
"events": [
|
|
{
|
|
"status": 200,
|
|
"action": {
|
|
"name": "sync.changes.pull"
|
|
},
|
|
"meta": {
|
|
"measurement_upserts": 2,
|
|
"measurement_tombstones": 0,
|
|
"mood_upserts": 1,
|
|
"mood_tombstones": 1,
|
|
"intake_upserts": 2,
|
|
"intake_tombstones": 0,
|
|
"cycle_day_upserts": 2,
|
|
"cycle_day_tombstones": 0,
|
|
"cycle_upserts": 2,
|
|
"cycle_tombstones": 0,
|
|
"measurement_mirror_upserts": 0,
|
|
"cycle_module_enabled": true,
|
|
"has_more": true,
|
|
"cursor_present": false
|
|
},
|
|
"warnings": null,
|
|
"error": null
|
|
}
|
|
]
|
|
}
|