Commit graph

9 commits

Author SHA1 Message Date
efc1bc82ab v10: full version — HealthKit reading + POST to /ingest 2026-08-22 23:25:58 +01:00
7b7d2ac0b3 v9: minimal test with timeout + IP fallback + catch 2026-08-22 23:21:47 +01:00
1b84eb8c60 v8: minimal test — just fetch /health and log 2026-08-22 23:20:35 +01:00
270d6645f7 fix v7: wrap in async main() to avoid top-level await parse error
Scripting app's JavaScriptCore doesn't support top-level await in
file scope. Wrapped everything in async main() + .then(Script.exit).
Converted function declarations to arrow functions.
2026-08-22 23:16:48 +01:00
9c8dac7ec4 fix: add version number to script header for debugging 2026-08-22 23:11:54 +01:00
a08048b918 fix: add @ts-nocheck to suppress Scripting app type errors
The Scripting app's type checker doesn't recognize Health/HealthUnit/
HealthUnitPrefix as global types. @ts-nocheck skips type checking
entirely — the APIs exist at runtime.
2026-08-22 23:11:30 +01:00
0673dd822f fix: remove type annotations, use HealthUnitPrefix + millimeterOfMercury
- Remove all TS type annotations (HealthQuantityType, HealthUnit etc.)
  to avoid 'string not assignable' errors — let the app infer types
- HealthMetricPrefix → HealthUnitPrefix (correct enum name per docs)
- HealthUnit.fromString('mmHg') → HealthUnit.millimeterOfMercury()
  (confirmed in docs: line 35229)
2026-08-22 23:08:53 +01:00
ddc6a54d84 fix: import Notification from scripting, use HealthQuantityType type
- Notification is not global, must import from 'scripting'
- queryQuantitySamples expects HealthQuantityType not string
2026-08-22 23:00:30 +01:00
bcd8c1241b fix: rewrite script as TypeScript for Scripting app (.tsx)
Scripting app expects TypeScript with import from 'scripting' and Script.exit().
- Renamed health-sync.js → health-sync.tsx
- Added 'import { Script } from "scripting"' and Script.exit() at end
- Added TypeScript type annotations
- Health/HealthUnit/Notification/fetch are global APIs (no import needed)
2026-08-22 22:55:55 +01:00