@nativesquare/soma 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.ts +7 -128
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +31 -112
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +80 -4
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +135 -261
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/garmin/private.d.ts +475 -0
- package/dist/component/garmin/private.d.ts.map +1 -0
- package/dist/component/garmin/private.js +1614 -0
- package/dist/component/garmin/private.js.map +1 -0
- package/dist/component/garmin/public.d.ts +155 -0
- package/dist/component/garmin/public.d.ts.map +1 -0
- package/dist/component/garmin/public.js +787 -0
- package/dist/component/garmin/public.js.map +1 -0
- package/dist/component/garmin/schemas/activity.d.ts +94 -0
- package/dist/component/garmin/schemas/activity.d.ts.map +1 -0
- package/dist/component/garmin/schemas/activity.js +27 -0
- package/dist/component/garmin/schemas/activity.js.map +1 -0
- package/dist/component/garmin/schemas/activityDetails.d.ts +146 -0
- package/dist/component/garmin/schemas/activityDetails.d.ts.map +1 -0
- package/dist/component/garmin/schemas/activityDetails.js +27 -0
- package/dist/component/garmin/schemas/activityDetails.js.map +1 -0
- package/dist/component/garmin/schemas/bloodPressure.d.ts +38 -0
- package/dist/component/garmin/schemas/bloodPressure.d.ts.map +1 -0
- package/dist/component/garmin/schemas/bloodPressure.js +27 -0
- package/dist/component/garmin/schemas/bloodPressure.js.map +1 -0
- package/dist/component/garmin/schemas/bodyCompositions.d.ts +42 -0
- package/dist/component/garmin/schemas/bodyCompositions.d.ts.map +1 -0
- package/dist/component/garmin/schemas/bodyCompositions.js +27 -0
- package/dist/component/garmin/schemas/bodyCompositions.js.map +1 -0
- package/dist/component/garmin/schemas/dailies.d.ts +98 -0
- package/dist/component/garmin/schemas/dailies.d.ts.map +1 -0
- package/dist/component/garmin/schemas/dailies.js +27 -0
- package/dist/component/garmin/schemas/dailies.js.map +1 -0
- package/dist/component/garmin/schemas/epochs.d.ts +54 -0
- package/dist/component/garmin/schemas/epochs.d.ts.map +1 -0
- package/dist/component/garmin/schemas/epochs.js +27 -0
- package/dist/component/garmin/schemas/epochs.js.map +1 -0
- package/dist/component/garmin/schemas/healthSnapshot.d.ts +48 -0
- package/dist/component/garmin/schemas/healthSnapshot.d.ts.map +1 -0
- package/dist/component/garmin/schemas/healthSnapshot.js +27 -0
- package/dist/component/garmin/schemas/healthSnapshot.js.map +1 -0
- package/dist/component/garmin/schemas/hrvSummary.d.ts +40 -0
- package/dist/component/garmin/schemas/hrvSummary.d.ts.map +1 -0
- package/dist/component/garmin/schemas/hrvSummary.js +27 -0
- package/dist/component/garmin/schemas/hrvSummary.js.map +1 -0
- package/dist/component/garmin/schemas/manuallyUpdatedActivities.d.ts +94 -0
- package/dist/component/garmin/schemas/manuallyUpdatedActivities.d.ts.map +1 -0
- package/dist/component/garmin/schemas/manuallyUpdatedActivities.js +27 -0
- package/dist/component/garmin/schemas/manuallyUpdatedActivities.js.map +1 -0
- package/dist/component/garmin/schemas/menstrualCycleTracking.d.ts +100 -0
- package/dist/component/garmin/schemas/menstrualCycleTracking.d.ts.map +1 -0
- package/dist/component/garmin/schemas/menstrualCycleTracking.js +28 -0
- package/dist/component/garmin/schemas/menstrualCycleTracking.js.map +1 -0
- package/dist/component/garmin/schemas/moveIQ.d.ts +40 -0
- package/dist/component/garmin/schemas/moveIQ.d.ts.map +1 -0
- package/dist/component/garmin/schemas/moveIQ.js +27 -0
- package/dist/component/garmin/schemas/moveIQ.js.map +1 -0
- package/dist/component/garmin/schemas/pulseOx.d.ts +38 -0
- package/dist/component/garmin/schemas/pulseOx.d.ts.map +1 -0
- package/dist/component/garmin/schemas/pulseOx.js +28 -0
- package/dist/component/garmin/schemas/pulseOx.js.map +1 -0
- package/dist/component/garmin/schemas/respiration.d.ts +34 -0
- package/dist/component/garmin/schemas/respiration.d.ts.map +1 -0
- package/dist/component/garmin/schemas/respiration.js +28 -0
- package/dist/component/garmin/schemas/respiration.js.map +1 -0
- package/dist/component/garmin/schemas/skinTemperature.d.ts +36 -0
- package/dist/component/garmin/schemas/skinTemperature.d.ts.map +1 -0
- package/dist/component/garmin/schemas/skinTemperature.js +28 -0
- package/dist/component/garmin/schemas/skinTemperature.js.map +1 -0
- package/dist/component/garmin/schemas/sleeps.d.ts +88 -0
- package/dist/component/garmin/schemas/sleeps.d.ts.map +1 -0
- package/dist/component/garmin/schemas/sleeps.js +27 -0
- package/dist/component/garmin/schemas/sleeps.js.map +1 -0
- package/dist/component/garmin/schemas/stress.d.ts +70 -0
- package/dist/component/garmin/schemas/stress.d.ts.map +1 -0
- package/dist/component/garmin/schemas/stress.js +28 -0
- package/dist/component/garmin/schemas/stress.js.map +1 -0
- package/dist/component/garmin/schemas/userMetrics.d.ts +36 -0
- package/dist/component/garmin/schemas/userMetrics.d.ts.map +1 -0
- package/dist/component/garmin/schemas/userMetrics.js +28 -0
- package/dist/component/garmin/schemas/userMetrics.js.map +1 -0
- package/dist/component/garmin/transform/activity.d.ts +13 -0
- package/dist/component/garmin/transform/activity.d.ts.map +1 -0
- package/dist/component/garmin/transform/activity.js +111 -0
- package/dist/component/garmin/transform/activity.js.map +1 -0
- package/dist/component/garmin/transform/activityDetails.d.ts +13 -0
- package/dist/component/garmin/transform/activityDetails.d.ts.map +1 -0
- package/dist/component/garmin/transform/activityDetails.js +173 -0
- package/dist/component/garmin/transform/activityDetails.js.map +1 -0
- package/dist/component/garmin/transform/bloodPressure.d.ts +12 -0
- package/dist/component/garmin/transform/bloodPressure.d.ts.map +1 -0
- package/dist/component/garmin/transform/bloodPressure.js +33 -0
- package/dist/component/garmin/transform/bloodPressure.js.map +1 -0
- package/dist/component/garmin/transform/bodyCompositions.d.ts +12 -0
- package/dist/component/garmin/transform/bodyCompositions.d.ts.map +1 -0
- package/dist/component/garmin/transform/bodyCompositions.js +42 -0
- package/dist/component/garmin/transform/bodyCompositions.js.map +1 -0
- package/dist/component/garmin/transform/dailies.d.ts +12 -0
- package/dist/component/garmin/transform/dailies.d.ts.map +1 -0
- package/dist/component/garmin/transform/dailies.js +132 -0
- package/dist/component/garmin/transform/dailies.js.map +1 -0
- package/dist/component/garmin/transform/epochs.d.ts +13 -0
- package/dist/component/garmin/transform/epochs.d.ts.map +1 -0
- package/dist/component/garmin/transform/epochs.js +76 -0
- package/dist/component/garmin/transform/epochs.js.map +1 -0
- package/dist/component/garmin/transform/healthSnapshot.d.ts +12 -0
- package/dist/component/garmin/transform/healthSnapshot.d.ts.map +1 -0
- package/dist/component/garmin/transform/healthSnapshot.js +111 -0
- package/dist/component/garmin/transform/healthSnapshot.js.map +1 -0
- package/dist/component/garmin/transform/hrvSummary.d.ts +12 -0
- package/dist/component/garmin/transform/hrvSummary.d.ts.map +1 -0
- package/dist/component/garmin/transform/hrvSummary.js +45 -0
- package/dist/component/garmin/transform/hrvSummary.js.map +1 -0
- package/dist/component/garmin/transform/manuallyUpdatedActivities.d.ts +11 -0
- package/dist/component/garmin/transform/manuallyUpdatedActivities.d.ts.map +1 -0
- package/dist/component/garmin/transform/manuallyUpdatedActivities.js +20 -0
- package/dist/component/garmin/transform/manuallyUpdatedActivities.js.map +1 -0
- package/dist/component/garmin/transform/menstrualCycleTracking.d.ts +10 -0
- package/dist/component/garmin/transform/menstrualCycleTracking.d.ts.map +1 -0
- package/dist/component/garmin/transform/menstrualCycleTracking.js +43 -0
- package/dist/component/garmin/transform/menstrualCycleTracking.js.map +1 -0
- package/dist/component/garmin/transform/moveIQ.d.ts +17 -0
- package/dist/component/garmin/transform/moveIQ.d.ts.map +1 -0
- package/dist/component/garmin/transform/moveIQ.js +41 -0
- package/dist/component/garmin/transform/moveIQ.js.map +1 -0
- package/dist/component/garmin/transform/pulseOx.d.ts +12 -0
- package/dist/component/garmin/transform/pulseOx.d.ts.map +1 -0
- package/dist/component/garmin/transform/pulseOx.js +46 -0
- package/dist/component/garmin/transform/pulseOx.js.map +1 -0
- package/dist/component/garmin/transform/respiration.d.ts +12 -0
- package/dist/component/garmin/transform/respiration.d.ts.map +1 -0
- package/dist/component/garmin/transform/respiration.js +54 -0
- package/dist/component/garmin/transform/respiration.js.map +1 -0
- package/dist/component/garmin/transform/skinTemperature.d.ts +12 -0
- package/dist/component/garmin/transform/skinTemperature.d.ts.map +1 -0
- package/dist/component/garmin/transform/skinTemperature.js +38 -0
- package/dist/component/garmin/transform/skinTemperature.js.map +1 -0
- package/dist/component/garmin/transform/sleeps.d.ts +55 -0
- package/dist/component/garmin/transform/sleeps.d.ts.map +1 -0
- package/dist/component/garmin/transform/sleeps.js +120 -0
- package/dist/component/garmin/transform/sleeps.js.map +1 -0
- package/dist/component/garmin/transform/stress.d.ts +12 -0
- package/dist/component/garmin/transform/stress.d.ts.map +1 -0
- package/dist/component/garmin/transform/stress.js +56 -0
- package/dist/component/garmin/transform/stress.js.map +1 -0
- package/dist/component/garmin/transform/userMetrics.d.ts +12 -0
- package/dist/component/garmin/transform/userMetrics.d.ts.map +1 -0
- package/dist/component/garmin/transform/userMetrics.js +48 -0
- package/dist/component/garmin/transform/userMetrics.js.map +1 -0
- package/dist/component/garmin/types/garmin.d.ts +21 -0
- package/dist/component/garmin/types/garmin.d.ts.map +1 -0
- package/dist/component/garmin/types/garmin.js +6 -0
- package/dist/component/garmin/types/garmin.js.map +1 -0
- package/dist/component/garmin/types/zod/zod.gen.d.ts +1319 -0
- package/dist/component/garmin/types/zod/zod.gen.d.ts.map +1 -0
- package/dist/component/garmin/types/zod/zod.gen.js +784 -0
- package/dist/component/garmin/types/zod/zod.gen.js.map +1 -0
- package/dist/component/garmin/webhooks.d.ts +141 -0
- package/dist/component/garmin/webhooks.d.ts.map +1 -0
- package/dist/component/garmin/webhooks.js +766 -0
- package/dist/component/garmin/webhooks.js.map +1 -0
- package/dist/component/private.d.ts +4 -4
- package/dist/component/public.d.ts +333 -333
- package/dist/component/schema.d.ts +133 -133
- package/dist/component/strava/private.d.ts +30 -0
- package/dist/component/strava/private.d.ts.map +1 -0
- package/dist/component/strava/private.js +71 -0
- package/dist/component/strava/private.js.map +1 -0
- package/dist/component/{strava.d.ts → strava/public.d.ts} +3 -31
- package/dist/component/strava/public.d.ts.map +1 -0
- package/dist/component/{strava.js → strava/public.js} +22 -101
- package/dist/component/strava/public.js.map +1 -0
- package/dist/component/validators/activity.d.ts +6 -0
- package/dist/component/validators/activity.d.ts.map +1 -1
- package/dist/component/validators/activity.js.map +1 -1
- package/dist/component/validators/body.d.ts +20 -14
- package/dist/component/validators/body.d.ts.map +1 -1
- package/dist/component/validators/body.js.map +1 -1
- package/dist/component/validators/daily.d.ts +6 -0
- package/dist/component/validators/daily.d.ts.map +1 -1
- package/dist/component/validators/daily.js.map +1 -1
- package/dist/component/validators/enums.d.ts +1 -1
- package/dist/component/validators/menstruation.d.ts +5 -0
- package/dist/component/validators/menstruation.d.ts.map +1 -1
- package/dist/component/validators/menstruation.js.map +1 -1
- package/dist/garmin/client.js.map +1 -1
- package/dist/garmin/index.d.ts +0 -2
- package/dist/garmin/index.d.ts.map +1 -1
- package/dist/garmin/index.js +0 -1
- package/dist/garmin/index.js.map +1 -1
- package/dist/garmin/sync.d.ts.map +1 -1
- package/dist/garmin/sync.js +3 -2
- package/dist/garmin/sync.js.map +1 -1
- package/dist/garmin/types.d.ts +1 -1
- package/dist/garmin/types.d.ts.map +1 -1
- package/dist/validators.d.ts +31 -28
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +2 -2
- package/dist/validators.js.map +1 -1
- package/package.json +4 -7
- package/src/client/index.ts +41 -172
- package/src/component/_generated/api.ts +96 -4
- package/src/component/_generated/component.ts +252 -284
- package/src/{garmin → component/garmin}/auth.ts +8 -1
- package/src/component/garmin/client.ts +39 -0
- package/src/component/garmin/private.ts +1798 -0
- package/src/component/garmin/public.ts +938 -0
- package/src/component/garmin/schemas/activity.ts +40 -0
- package/src/component/garmin/schemas/activityDetails.ts +45 -0
- package/src/component/garmin/schemas/bloodPressure.ts +38 -0
- package/src/component/garmin/schemas/bodyCompositions.ts +38 -0
- package/src/component/garmin/schemas/dailies.ts +38 -0
- package/src/component/garmin/schemas/epochs.ts +38 -0
- package/src/component/garmin/schemas/healthSnapshot.ts +38 -0
- package/src/component/garmin/schemas/hrvSummary.ts +38 -0
- package/src/component/garmin/schemas/manuallyUpdatedActivities.ts +49 -0
- package/src/component/garmin/schemas/menstrualCycleTracking.ts +39 -0
- package/src/component/garmin/schemas/moveIQ.ts +38 -0
- package/src/component/garmin/schemas/pulseOx.ts +39 -0
- package/src/component/garmin/schemas/respiration.ts +39 -0
- package/src/component/garmin/schemas/skinTemperature.ts +39 -0
- package/src/component/garmin/schemas/sleeps.ts +38 -0
- package/src/component/garmin/schemas/stress.ts +43 -0
- package/src/component/garmin/schemas/userMetrics.ts +39 -0
- package/src/component/garmin/transform/activity.ts +143 -0
- package/src/component/garmin/transform/activityDetails.ts +236 -0
- package/src/{garmin → component/garmin/transform}/bloodPressure.ts +39 -41
- package/src/component/garmin/transform/bodyCompositions.ts +51 -0
- package/src/component/garmin/transform/dailies.ts +179 -0
- package/src/component/garmin/transform/epochs.ts +94 -0
- package/src/component/garmin/transform/healthSnapshot.ts +152 -0
- package/src/component/garmin/transform/hrvSummary.ts +56 -0
- package/src/component/garmin/transform/manuallyUpdatedActivities.ts +27 -0
- package/src/{garmin/maps/activity-type.ts → component/garmin/transform/maps/activityType.ts} +116 -116
- package/src/{garmin/maps/sleep-level.ts → component/garmin/transform/maps/sleepLevel.ts} +22 -22
- package/src/component/garmin/transform/menstrualCycleTracking.ts +48 -0
- package/src/component/garmin/transform/moveIQ.ts +48 -0
- package/src/{garmin → component/garmin/transform}/plannedWorkout.ts +328 -333
- package/src/component/garmin/transform/pulseOx.ts +64 -0
- package/src/component/garmin/transform/respiration.ts +73 -0
- package/src/component/garmin/transform/skinTemperature.ts +44 -0
- package/src/component/garmin/transform/sleeps.ts +159 -0
- package/src/component/garmin/transform/stress.ts +78 -0
- package/src/component/garmin/transform/userMetrics.ts +56 -0
- package/src/component/garmin/types/specs/training-api-workouts.json +699 -0
- package/src/component/garmin/types/trainingApiWorkouts/client/client.gen.ts +290 -0
- package/src/component/garmin/types/trainingApiWorkouts/client/index.ts +25 -0
- package/src/component/garmin/types/trainingApiWorkouts/client/types.gen.ts +214 -0
- package/src/component/garmin/types/trainingApiWorkouts/client/utils.gen.ts +316 -0
- package/src/component/garmin/types/trainingApiWorkouts/client.gen.ts +16 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/auth.gen.ts +41 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/bodySerializer.gen.ts +82 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/params.gen.ts +169 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/pathSerializer.gen.ts +171 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/queryKeySerializer.gen.ts +117 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/serverSentEvents.gen.ts +243 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/types.gen.ts +104 -0
- package/src/component/garmin/types/trainingApiWorkouts/core/utils.gen.ts +140 -0
- package/src/component/garmin/types/trainingApiWorkouts/index.ts +4 -0
- package/src/component/garmin/types/trainingApiWorkouts/sdk.gen.ts +126 -0
- package/src/component/garmin/types/trainingApiWorkouts/types.gen.ts +387 -0
- package/src/component/garmin/types/trainingApiWorkouts/zod.gen.ts +423 -0
- package/src/component/garmin/types/wellnessApi/client/client.gen.ts +290 -0
- package/src/component/garmin/types/wellnessApi/client/index.ts +25 -0
- package/src/component/garmin/types/wellnessApi/client/types.gen.ts +214 -0
- package/src/component/garmin/types/wellnessApi/client/utils.gen.ts +316 -0
- package/src/component/garmin/types/wellnessApi/client.gen.ts +16 -0
- package/src/component/garmin/types/wellnessApi/core/auth.gen.ts +41 -0
- package/src/component/garmin/types/wellnessApi/core/bodySerializer.gen.ts +82 -0
- package/src/component/garmin/types/wellnessApi/core/params.gen.ts +169 -0
- package/src/component/garmin/types/wellnessApi/core/pathSerializer.gen.ts +171 -0
- package/src/component/garmin/types/wellnessApi/core/queryKeySerializer.gen.ts +117 -0
- package/src/component/garmin/types/wellnessApi/core/serverSentEvents.gen.ts +243 -0
- package/src/component/garmin/types/wellnessApi/core/types.gen.ts +104 -0
- package/src/component/garmin/types/wellnessApi/core/utils.gen.ts +140 -0
- package/src/component/garmin/types/wellnessApi/index.ts +4 -0
- package/src/component/garmin/types/wellnessApi/sdk.gen.ts +207 -0
- package/src/component/garmin/types/wellnessApi/types.gen.ts +2942 -0
- package/src/component/garmin/types/wellnessApi/zod.gen.ts +878 -0
- package/src/component/garmin/utils.ts +25 -0
- package/src/component/garmin/webhooks.ts +852 -0
- package/src/component/strava/private.ts +89 -0
- package/src/component/{strava.ts → strava/public.ts} +341 -404
- package/src/component/validators/activity.ts +5 -0
- package/src/component/validators/body.ts +5 -0
- package/src/component/validators/daily.ts +5 -0
- package/src/component/validators/menstruation.ts +5 -1
- package/src/component/validators/plannedWorkout.ts +5 -0
- package/src/validators.ts +12 -2
- package/dist/component/garmin.d.ts +0 -366
- package/dist/component/garmin.d.ts.map +0 -1
- package/dist/component/garmin.js +0 -1481
- package/dist/component/garmin.js.map +0 -1
- package/dist/component/strava.d.ts.map +0 -1
- package/dist/component/strava.js.map +0 -1
- package/dist/garmin/activity.d.ts +0 -92
- package/dist/garmin/activity.d.ts.map +0 -1
- package/dist/garmin/activity.js +0 -201
- package/dist/garmin/activity.js.map +0 -1
- package/src/component/garmin.ts +0 -1722
- package/src/garmin/activity.test.ts +0 -170
- package/src/garmin/activity.ts +0 -265
- package/src/garmin/auth.test.ts +0 -103
- package/src/garmin/body.ts +0 -59
- package/src/garmin/client.ts +0 -886
- package/src/garmin/daily.ts +0 -215
- package/src/garmin/hrv.ts +0 -57
- package/src/garmin/index.ts +0 -145
- package/src/garmin/maps/activity-type.test.ts +0 -78
- package/src/garmin/menstruation.ts +0 -44
- package/src/garmin/pulseOx.ts +0 -45
- package/src/garmin/respiration.ts +0 -55
- package/src/garmin/skinTemp.ts +0 -42
- package/src/garmin/sleep.test.ts +0 -109
- package/src/garmin/sleep.ts +0 -176
- package/src/garmin/stressDetails.ts +0 -71
- package/src/garmin/sync.ts +0 -566
- package/src/garmin/types.ts +0 -268
- package/src/garmin/userMetrics.ts +0 -50
- package/src/garmin/wellness-api.d.ts +0 -5637
- /package/src/{garmin/spec → component/garmin/types/specs}/wellness-api.json +0 -0
package/src/garmin/sync.ts
DELETED
|
@@ -1,566 +0,0 @@
|
|
|
1
|
-
// ─── Garmin Sync Helpers ─────────────────────────────────────────────────────
|
|
2
|
-
// High-level functions that combine the Garmin client, transformers,
|
|
3
|
-
// and Soma ingestion. Designed to be used inside a Convex action.
|
|
4
|
-
|
|
5
|
-
import type { Soma } from "../client/index.js";
|
|
6
|
-
import type { ActionCtx } from "../client/types.js";
|
|
7
|
-
import type { GarminClient } from "./client.js";
|
|
8
|
-
import type { TimeRangeParams } from "./client.js";
|
|
9
|
-
import { transformActivity } from "./activity.js";
|
|
10
|
-
import { transformDaily } from "./daily.js";
|
|
11
|
-
import { transformSleep } from "./sleep.js";
|
|
12
|
-
import { transformBody } from "./body.js";
|
|
13
|
-
import { transformMenstruation } from "./menstruation.js";
|
|
14
|
-
import { transformBloodPressure } from "./bloodPressure.js";
|
|
15
|
-
import { transformSkinTemp } from "./skinTemp.js";
|
|
16
|
-
import { transformUserMetrics } from "./userMetrics.js";
|
|
17
|
-
import { transformHRV } from "./hrv.js";
|
|
18
|
-
import { transformStressDetails } from "./stressDetails.js";
|
|
19
|
-
import { transformPulseOx } from "./pulseOx.js";
|
|
20
|
-
import { transformRespiration } from "./respiration.js";
|
|
21
|
-
|
|
22
|
-
// ─── Shared Types ────────────────────────────────────────────────────────────
|
|
23
|
-
|
|
24
|
-
export interface SyncOptions {
|
|
25
|
-
client: GarminClient;
|
|
26
|
-
soma: Soma;
|
|
27
|
-
ctx: ActionCtx;
|
|
28
|
-
connectionId: string;
|
|
29
|
-
userId: string;
|
|
30
|
-
timeRange: TimeRangeParams;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface SyncResult {
|
|
34
|
-
synced: number;
|
|
35
|
-
errors: Array<{ id: string; error: string }>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface SyncAllResult {
|
|
39
|
-
activities: SyncResult;
|
|
40
|
-
dailies: SyncResult;
|
|
41
|
-
sleep: SyncResult;
|
|
42
|
-
body: SyncResult;
|
|
43
|
-
menstruation: SyncResult;
|
|
44
|
-
bloodPressures: SyncResult;
|
|
45
|
-
skinTemp: SyncResult;
|
|
46
|
-
userMetrics: SyncResult;
|
|
47
|
-
hrv: SyncResult;
|
|
48
|
-
stressDetails: SyncResult;
|
|
49
|
-
pulseOx: SyncResult;
|
|
50
|
-
respiration: SyncResult;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// ─── Sync All ────────────────────────────────────────────────────────────────
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Sync all data types from Garmin for a given time range.
|
|
57
|
-
*
|
|
58
|
-
* Runs each sync independently so a failure in one type doesn't
|
|
59
|
-
* block the others.
|
|
60
|
-
*/
|
|
61
|
-
export async function syncAll(opts: SyncOptions): Promise<SyncAllResult> {
|
|
62
|
-
const [
|
|
63
|
-
activities,
|
|
64
|
-
dailies,
|
|
65
|
-
sleep,
|
|
66
|
-
body,
|
|
67
|
-
menstruation,
|
|
68
|
-
bloodPressures,
|
|
69
|
-
skinTemp,
|
|
70
|
-
userMetrics,
|
|
71
|
-
hrv,
|
|
72
|
-
stressDetails,
|
|
73
|
-
pulseOx,
|
|
74
|
-
respiration,
|
|
75
|
-
] = await Promise.all([
|
|
76
|
-
syncActivities(opts),
|
|
77
|
-
syncDailies(opts),
|
|
78
|
-
syncSleep(opts),
|
|
79
|
-
syncBody(opts),
|
|
80
|
-
syncMenstruation(opts),
|
|
81
|
-
syncBloodPressures(opts),
|
|
82
|
-
syncSkinTemp(opts),
|
|
83
|
-
syncUserMetrics(opts),
|
|
84
|
-
syncHRV(opts),
|
|
85
|
-
syncStressDetails(opts),
|
|
86
|
-
syncPulseOx(opts),
|
|
87
|
-
syncRespiration(opts),
|
|
88
|
-
]);
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
activities,
|
|
92
|
-
dailies,
|
|
93
|
-
sleep,
|
|
94
|
-
body,
|
|
95
|
-
menstruation,
|
|
96
|
-
bloodPressures,
|
|
97
|
-
skinTemp,
|
|
98
|
-
userMetrics,
|
|
99
|
-
hrv,
|
|
100
|
-
stressDetails,
|
|
101
|
-
pulseOx,
|
|
102
|
-
respiration,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// ─── Activities ──────────────────────────────────────────────────────────────
|
|
107
|
-
|
|
108
|
-
export async function syncActivities(opts: SyncOptions): Promise<SyncResult> {
|
|
109
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
110
|
-
let synced = 0;
|
|
111
|
-
const errors: SyncResult["errors"] = [];
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
const activities = await client.getActivities(timeRange);
|
|
115
|
-
|
|
116
|
-
for (const activity of activities) {
|
|
117
|
-
try {
|
|
118
|
-
const data = transformActivity(activity);
|
|
119
|
-
await soma.ingestActivity(ctx, { connectionId, userId, ...data });
|
|
120
|
-
synced++;
|
|
121
|
-
} catch (err) {
|
|
122
|
-
errors.push({
|
|
123
|
-
id: activity.summaryId ?? String(activity.activityId),
|
|
124
|
-
error: err instanceof Error ? err.message : String(err),
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} catch (err) {
|
|
129
|
-
errors.push({
|
|
130
|
-
id: "fetch",
|
|
131
|
-
error: err instanceof Error ? err.message : String(err),
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return { synced, errors };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// ─── Dailies ─────────────────────────────────────────────────────────────────
|
|
139
|
-
|
|
140
|
-
export async function syncDailies(opts: SyncOptions): Promise<SyncResult> {
|
|
141
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
142
|
-
let synced = 0;
|
|
143
|
-
const errors: SyncResult["errors"] = [];
|
|
144
|
-
|
|
145
|
-
try {
|
|
146
|
-
const dailies = await client.getDailies(timeRange);
|
|
147
|
-
|
|
148
|
-
for (const daily of dailies) {
|
|
149
|
-
try {
|
|
150
|
-
const data = transformDaily(daily);
|
|
151
|
-
await soma.ingestDaily(ctx, { connectionId, userId, ...data });
|
|
152
|
-
synced++;
|
|
153
|
-
} catch (err) {
|
|
154
|
-
errors.push({
|
|
155
|
-
id: daily.summaryId ?? daily.calendarDate ?? "unknown",
|
|
156
|
-
error: err instanceof Error ? err.message : String(err),
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
} catch (err) {
|
|
161
|
-
errors.push({
|
|
162
|
-
id: "fetch",
|
|
163
|
-
error: err instanceof Error ? err.message : String(err),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return { synced, errors };
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// ─── Sleep ───────────────────────────────────────────────────────────────────
|
|
171
|
-
|
|
172
|
-
export async function syncSleep(opts: SyncOptions): Promise<SyncResult> {
|
|
173
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
174
|
-
let synced = 0;
|
|
175
|
-
const errors: SyncResult["errors"] = [];
|
|
176
|
-
|
|
177
|
-
try {
|
|
178
|
-
const sleeps = await client.getSleeps(timeRange);
|
|
179
|
-
|
|
180
|
-
for (const sleep of sleeps) {
|
|
181
|
-
try {
|
|
182
|
-
const data = transformSleep(sleep);
|
|
183
|
-
await soma.ingestSleep(ctx, { connectionId, userId, ...data });
|
|
184
|
-
synced++;
|
|
185
|
-
} catch (err) {
|
|
186
|
-
errors.push({
|
|
187
|
-
id: sleep.summaryId ?? sleep.calendarDate ?? "unknown",
|
|
188
|
-
error: err instanceof Error ? err.message : String(err),
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
} catch (err) {
|
|
193
|
-
errors.push({
|
|
194
|
-
id: "fetch",
|
|
195
|
-
error: err instanceof Error ? err.message : String(err),
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return { synced, errors };
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// ─── Body Composition ────────────────────────────────────────────────────────
|
|
203
|
-
|
|
204
|
-
export async function syncBody(opts: SyncOptions): Promise<SyncResult> {
|
|
205
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
206
|
-
let synced = 0;
|
|
207
|
-
const errors: SyncResult["errors"] = [];
|
|
208
|
-
|
|
209
|
-
try {
|
|
210
|
-
const bodyComps = await client.getBodyCompositions(timeRange);
|
|
211
|
-
|
|
212
|
-
for (const body of bodyComps) {
|
|
213
|
-
try {
|
|
214
|
-
const data = transformBody(body);
|
|
215
|
-
await soma.ingestBody(ctx, { connectionId, userId, ...data });
|
|
216
|
-
synced++;
|
|
217
|
-
} catch (err) {
|
|
218
|
-
errors.push({
|
|
219
|
-
id: body.summaryId ?? String(body.measurementTimeInSeconds),
|
|
220
|
-
error: err instanceof Error ? err.message : String(err),
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
} catch (err) {
|
|
225
|
-
errors.push({
|
|
226
|
-
id: "fetch",
|
|
227
|
-
error: err instanceof Error ? err.message : String(err),
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return { synced, errors };
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// ─── Menstruation ────────────────────────────────────────────────────────────
|
|
235
|
-
|
|
236
|
-
export async function syncMenstruation(
|
|
237
|
-
opts: SyncOptions,
|
|
238
|
-
): Promise<SyncResult> {
|
|
239
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
240
|
-
let synced = 0;
|
|
241
|
-
const errors: SyncResult["errors"] = [];
|
|
242
|
-
|
|
243
|
-
try {
|
|
244
|
-
const records = await client.getMenstrualCycleData(timeRange);
|
|
245
|
-
|
|
246
|
-
for (const record of records) {
|
|
247
|
-
try {
|
|
248
|
-
const data = transformMenstruation(record);
|
|
249
|
-
await soma.ingestMenstruation(ctx, {
|
|
250
|
-
connectionId,
|
|
251
|
-
userId,
|
|
252
|
-
...data,
|
|
253
|
-
});
|
|
254
|
-
synced++;
|
|
255
|
-
} catch (err) {
|
|
256
|
-
errors.push({
|
|
257
|
-
id: record.summaryId ?? record.periodStartDate ?? "unknown",
|
|
258
|
-
error: err instanceof Error ? err.message : String(err),
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
} catch (err) {
|
|
263
|
-
errors.push({
|
|
264
|
-
id: "fetch",
|
|
265
|
-
error: err instanceof Error ? err.message : String(err),
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return { synced, errors };
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// ─── Blood Pressures ────────────────────────────────────────────────────────
|
|
273
|
-
|
|
274
|
-
export async function syncBloodPressures(
|
|
275
|
-
opts: SyncOptions,
|
|
276
|
-
): Promise<SyncResult> {
|
|
277
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
278
|
-
let synced = 0;
|
|
279
|
-
const errors: SyncResult["errors"] = [];
|
|
280
|
-
|
|
281
|
-
try {
|
|
282
|
-
const records = await client.getBloodPressures(timeRange);
|
|
283
|
-
|
|
284
|
-
for (const record of records) {
|
|
285
|
-
try {
|
|
286
|
-
const data = transformBloodPressure(record);
|
|
287
|
-
await soma.ingestBody(ctx, { connectionId, userId, ...data });
|
|
288
|
-
synced++;
|
|
289
|
-
} catch (err) {
|
|
290
|
-
errors.push({
|
|
291
|
-
id: record.summaryId ?? String(record.measurementTimeInSeconds),
|
|
292
|
-
error: err instanceof Error ? err.message : String(err),
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
} catch (err) {
|
|
297
|
-
errors.push({
|
|
298
|
-
id: "fetch",
|
|
299
|
-
error: err instanceof Error ? err.message : String(err),
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return { synced, errors };
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// ─── Skin Temperature ───────────────────────────────────────────────────────
|
|
307
|
-
|
|
308
|
-
export async function syncSkinTemp(opts: SyncOptions): Promise<SyncResult> {
|
|
309
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
310
|
-
let synced = 0;
|
|
311
|
-
const errors: SyncResult["errors"] = [];
|
|
312
|
-
|
|
313
|
-
try {
|
|
314
|
-
const records = await client.getSkinTemperature(timeRange);
|
|
315
|
-
|
|
316
|
-
for (const record of records) {
|
|
317
|
-
try {
|
|
318
|
-
const data = transformSkinTemp(record);
|
|
319
|
-
await soma.ingestBody(ctx, { connectionId, userId, ...data });
|
|
320
|
-
synced++;
|
|
321
|
-
} catch (err) {
|
|
322
|
-
errors.push({
|
|
323
|
-
id: record.summaryId ?? record.calendarDate ?? "unknown",
|
|
324
|
-
error: err instanceof Error ? err.message : String(err),
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
} catch (err) {
|
|
329
|
-
errors.push({
|
|
330
|
-
id: "fetch",
|
|
331
|
-
error: err instanceof Error ? err.message : String(err),
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return { synced, errors };
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// ─── User Metrics ───────────────────────────────────────────────────────────
|
|
339
|
-
|
|
340
|
-
export async function syncUserMetrics(opts: SyncOptions): Promise<SyncResult> {
|
|
341
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
342
|
-
let synced = 0;
|
|
343
|
-
const errors: SyncResult["errors"] = [];
|
|
344
|
-
|
|
345
|
-
try {
|
|
346
|
-
const records = await client.getUserMetrics(timeRange);
|
|
347
|
-
|
|
348
|
-
for (const record of records) {
|
|
349
|
-
try {
|
|
350
|
-
const data = transformUserMetrics(record);
|
|
351
|
-
await soma.ingestBody(ctx, { connectionId, userId, ...data });
|
|
352
|
-
synced++;
|
|
353
|
-
} catch (err) {
|
|
354
|
-
errors.push({
|
|
355
|
-
id: record.summaryId ?? record.calendarDate ?? "unknown",
|
|
356
|
-
error: err instanceof Error ? err.message : String(err),
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
} catch (err) {
|
|
361
|
-
errors.push({
|
|
362
|
-
id: "fetch",
|
|
363
|
-
error: err instanceof Error ? err.message : String(err),
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return { synced, errors };
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
// ─── HRV (enriches Daily) ───────────────────────────────────────────────────
|
|
371
|
-
|
|
372
|
-
export async function syncHRV(opts: SyncOptions): Promise<SyncResult> {
|
|
373
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
374
|
-
let synced = 0;
|
|
375
|
-
const errors: SyncResult["errors"] = [];
|
|
376
|
-
|
|
377
|
-
try {
|
|
378
|
-
const records = await client.getHRV(timeRange);
|
|
379
|
-
|
|
380
|
-
for (const record of records) {
|
|
381
|
-
try {
|
|
382
|
-
const data = transformHRV(record);
|
|
383
|
-
if (data.heart_rate_data) {
|
|
384
|
-
await soma.ingestDaily(ctx, {
|
|
385
|
-
connectionId,
|
|
386
|
-
userId,
|
|
387
|
-
metadata: {
|
|
388
|
-
start_time: new Date(
|
|
389
|
-
(record.startTimeInSeconds ?? 0) * 1000,
|
|
390
|
-
).toISOString(),
|
|
391
|
-
end_time: new Date(
|
|
392
|
-
((record.startTimeInSeconds ?? 0) +
|
|
393
|
-
(record.durationInSeconds ?? 86400)) *
|
|
394
|
-
1000,
|
|
395
|
-
).toISOString(),
|
|
396
|
-
upload_type: 1,
|
|
397
|
-
},
|
|
398
|
-
heart_rate_data: data.heart_rate_data,
|
|
399
|
-
});
|
|
400
|
-
synced++;
|
|
401
|
-
}
|
|
402
|
-
} catch (err) {
|
|
403
|
-
errors.push({
|
|
404
|
-
id: record.summaryId ?? record.calendarDate ?? "unknown",
|
|
405
|
-
error: err instanceof Error ? err.message : String(err),
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
} catch (err) {
|
|
410
|
-
errors.push({
|
|
411
|
-
id: "fetch",
|
|
412
|
-
error: err instanceof Error ? err.message : String(err),
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return { synced, errors };
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// ─── Stress Details (enriches Daily) ────────────────────────────────────────
|
|
420
|
-
|
|
421
|
-
export async function syncStressDetails(
|
|
422
|
-
opts: SyncOptions,
|
|
423
|
-
): Promise<SyncResult> {
|
|
424
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
425
|
-
let synced = 0;
|
|
426
|
-
const errors: SyncResult["errors"] = [];
|
|
427
|
-
|
|
428
|
-
try {
|
|
429
|
-
const records = await client.getStressDetails(timeRange);
|
|
430
|
-
|
|
431
|
-
for (const record of records) {
|
|
432
|
-
try {
|
|
433
|
-
const data = transformStressDetails(record);
|
|
434
|
-
if (data.stress_data) {
|
|
435
|
-
await soma.ingestDaily(ctx, {
|
|
436
|
-
connectionId,
|
|
437
|
-
userId,
|
|
438
|
-
metadata: {
|
|
439
|
-
start_time: new Date(
|
|
440
|
-
(record.startTimeInSeconds ?? 0) * 1000,
|
|
441
|
-
).toISOString(),
|
|
442
|
-
end_time: new Date(
|
|
443
|
-
((record.startTimeInSeconds ?? 0) +
|
|
444
|
-
(record.durationInSeconds ?? 86400)) *
|
|
445
|
-
1000,
|
|
446
|
-
).toISOString(),
|
|
447
|
-
upload_type: 1,
|
|
448
|
-
},
|
|
449
|
-
stress_data: data.stress_data,
|
|
450
|
-
});
|
|
451
|
-
synced++;
|
|
452
|
-
}
|
|
453
|
-
} catch (err) {
|
|
454
|
-
errors.push({
|
|
455
|
-
id: record.summaryId ?? record.calendarDate ?? "unknown",
|
|
456
|
-
error: err instanceof Error ? err.message : String(err),
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
} catch (err) {
|
|
461
|
-
errors.push({
|
|
462
|
-
id: "fetch",
|
|
463
|
-
error: err instanceof Error ? err.message : String(err),
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return { synced, errors };
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// ─── Pulse Ox (enriches Daily) ──────────────────────────────────────────────
|
|
471
|
-
|
|
472
|
-
export async function syncPulseOx(opts: SyncOptions): Promise<SyncResult> {
|
|
473
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
474
|
-
let synced = 0;
|
|
475
|
-
const errors: SyncResult["errors"] = [];
|
|
476
|
-
|
|
477
|
-
try {
|
|
478
|
-
const records = await client.getPulseOx(timeRange);
|
|
479
|
-
|
|
480
|
-
for (const record of records) {
|
|
481
|
-
try {
|
|
482
|
-
const data = transformPulseOx(record);
|
|
483
|
-
if (data.oxygen_data) {
|
|
484
|
-
await soma.ingestDaily(ctx, {
|
|
485
|
-
connectionId,
|
|
486
|
-
userId,
|
|
487
|
-
metadata: {
|
|
488
|
-
start_time: new Date(
|
|
489
|
-
(record.startTimeInSeconds ?? 0) * 1000,
|
|
490
|
-
).toISOString(),
|
|
491
|
-
end_time: new Date(
|
|
492
|
-
((record.startTimeInSeconds ?? 0) +
|
|
493
|
-
(record.durationInSeconds ?? 86400)) *
|
|
494
|
-
1000,
|
|
495
|
-
).toISOString(),
|
|
496
|
-
upload_type: 1,
|
|
497
|
-
},
|
|
498
|
-
oxygen_data: data.oxygen_data,
|
|
499
|
-
});
|
|
500
|
-
synced++;
|
|
501
|
-
}
|
|
502
|
-
} catch (err) {
|
|
503
|
-
errors.push({
|
|
504
|
-
id: record.summaryId ?? record.calendarDate ?? "unknown",
|
|
505
|
-
error: err instanceof Error ? err.message : String(err),
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
} catch (err) {
|
|
510
|
-
errors.push({
|
|
511
|
-
id: "fetch",
|
|
512
|
-
error: err instanceof Error ? err.message : String(err),
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return { synced, errors };
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
// ─── Respiration (enriches Daily) ───────────────────────────────────────────
|
|
520
|
-
|
|
521
|
-
export async function syncRespiration(opts: SyncOptions): Promise<SyncResult> {
|
|
522
|
-
const { client, soma, ctx, connectionId, userId, timeRange } = opts;
|
|
523
|
-
let synced = 0;
|
|
524
|
-
const errors: SyncResult["errors"] = [];
|
|
525
|
-
|
|
526
|
-
try {
|
|
527
|
-
const records = await client.getRespiration(timeRange);
|
|
528
|
-
|
|
529
|
-
for (const record of records) {
|
|
530
|
-
try {
|
|
531
|
-
const data = transformRespiration(record);
|
|
532
|
-
if (data.respiration_data) {
|
|
533
|
-
await soma.ingestDaily(ctx, {
|
|
534
|
-
connectionId,
|
|
535
|
-
userId,
|
|
536
|
-
metadata: {
|
|
537
|
-
start_time: new Date(
|
|
538
|
-
(record.startTimeInSeconds ?? 0) * 1000,
|
|
539
|
-
).toISOString(),
|
|
540
|
-
end_time: new Date(
|
|
541
|
-
((record.startTimeInSeconds ?? 0) +
|
|
542
|
-
(record.durationInSeconds ?? 86400)) *
|
|
543
|
-
1000,
|
|
544
|
-
).toISOString(),
|
|
545
|
-
upload_type: 1,
|
|
546
|
-
},
|
|
547
|
-
respiration_data: data.respiration_data,
|
|
548
|
-
});
|
|
549
|
-
synced++;
|
|
550
|
-
}
|
|
551
|
-
} catch (err) {
|
|
552
|
-
errors.push({
|
|
553
|
-
id: record.summaryId ?? "unknown",
|
|
554
|
-
error: err instanceof Error ? err.message : String(err),
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
} catch (err) {
|
|
559
|
-
errors.push({
|
|
560
|
-
id: "fetch",
|
|
561
|
-
error: err instanceof Error ? err.message : String(err),
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
return { synced, errors };
|
|
566
|
-
}
|