@nativesquare/soma 0.7.3 → 0.8.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.
Files changed (134) hide show
  1. package/dist/client/index.d.ts +83 -0
  2. package/dist/client/index.d.ts.map +1 -1
  3. package/dist/client/index.js +131 -0
  4. package/dist/client/index.js.map +1 -1
  5. package/dist/component/_generated/component.d.ts +159 -0
  6. package/dist/component/_generated/component.d.ts.map +1 -1
  7. package/dist/component/garmin.d.ts +190 -6
  8. package/dist/component/garmin.d.ts.map +1 -1
  9. package/dist/component/garmin.js +805 -25
  10. package/dist/component/garmin.js.map +1 -1
  11. package/dist/component/private.d.ts +18 -0
  12. package/dist/component/private.d.ts.map +1 -1
  13. package/dist/component/private.js +18 -0
  14. package/dist/component/private.js.map +1 -1
  15. package/dist/component/public.d.ts +88 -42
  16. package/dist/component/public.d.ts.map +1 -1
  17. package/dist/component/public.js +12 -2
  18. package/dist/component/public.js.map +1 -1
  19. package/dist/component/schema.d.ts +87 -32
  20. package/dist/component/schema.d.ts.map +1 -1
  21. package/dist/component/schema.js +2 -1
  22. package/dist/component/schema.js.map +1 -1
  23. package/dist/component/validators/connection.d.ts +1 -0
  24. package/dist/component/validators/connection.d.ts.map +1 -1
  25. package/dist/component/validators/connection.js +2 -0
  26. package/dist/component/validators/connection.js.map +1 -1
  27. package/dist/component/validators/daily.d.ts +40 -5
  28. package/dist/component/validators/daily.d.ts.map +1 -1
  29. package/dist/component/validators/daily.js +10 -1
  30. package/dist/component/validators/daily.js.map +1 -1
  31. package/dist/component/validators/enums.d.ts +1 -1
  32. package/dist/component/validators/plannedWorkout.d.ts +5 -1
  33. package/dist/component/validators/plannedWorkout.d.ts.map +1 -1
  34. package/dist/component/validators/plannedWorkout.js +4 -0
  35. package/dist/component/validators/plannedWorkout.js.map +1 -1
  36. package/dist/component/validators/sleep.d.ts +8 -8
  37. package/dist/garmin/activity.d.ts +7 -16
  38. package/dist/garmin/activity.d.ts.map +1 -1
  39. package/dist/garmin/activity.js +17 -23
  40. package/dist/garmin/activity.js.map +1 -1
  41. package/dist/garmin/bloodPressure.d.ts +28 -0
  42. package/dist/garmin/bloodPressure.d.ts.map +1 -0
  43. package/dist/garmin/bloodPressure.js +34 -0
  44. package/dist/garmin/bloodPressure.js.map +1 -0
  45. package/dist/garmin/body.js +1 -1
  46. package/dist/garmin/body.js.map +1 -1
  47. package/dist/garmin/client.d.ts +117 -17
  48. package/dist/garmin/client.d.ts.map +1 -1
  49. package/dist/garmin/client.js +337 -43
  50. package/dist/garmin/client.js.map +1 -1
  51. package/dist/garmin/daily.d.ts.map +1 -1
  52. package/dist/garmin/daily.js +3 -3
  53. package/dist/garmin/daily.js.map +1 -1
  54. package/dist/garmin/hrv.d.ts +30 -0
  55. package/dist/garmin/hrv.d.ts.map +1 -0
  56. package/dist/garmin/hrv.js +45 -0
  57. package/dist/garmin/hrv.js.map +1 -0
  58. package/dist/garmin/index.d.ts +16 -2
  59. package/dist/garmin/index.d.ts.map +1 -1
  60. package/dist/garmin/index.js +8 -1
  61. package/dist/garmin/index.js.map +1 -1
  62. package/dist/garmin/maps/activity-type.d.ts +1 -2
  63. package/dist/garmin/maps/activity-type.d.ts.map +1 -1
  64. package/dist/garmin/maps/activity-type.js +1 -0
  65. package/dist/garmin/maps/activity-type.js.map +1 -1
  66. package/dist/garmin/menstruation.d.ts +6 -4
  67. package/dist/garmin/menstruation.d.ts.map +1 -1
  68. package/dist/garmin/menstruation.js +12 -8
  69. package/dist/garmin/menstruation.js.map +1 -1
  70. package/dist/garmin/pulseOx.d.ts +24 -0
  71. package/dist/garmin/pulseOx.d.ts.map +1 -0
  72. package/dist/garmin/pulseOx.js +33 -0
  73. package/dist/garmin/pulseOx.js.map +1 -0
  74. package/dist/garmin/respiration.d.ts +29 -0
  75. package/dist/garmin/respiration.d.ts.map +1 -0
  76. package/dist/garmin/respiration.js +42 -0
  77. package/dist/garmin/respiration.js.map +1 -0
  78. package/dist/garmin/skinTemp.d.ts +27 -0
  79. package/dist/garmin/skinTemp.d.ts.map +1 -0
  80. package/dist/garmin/skinTemp.js +35 -0
  81. package/dist/garmin/skinTemp.js.map +1 -0
  82. package/dist/garmin/sleep.d.ts +4 -4
  83. package/dist/garmin/sleep.d.ts.map +1 -1
  84. package/dist/garmin/sleep.js +15 -9
  85. package/dist/garmin/sleep.js.map +1 -1
  86. package/dist/garmin/stressDetails.d.ts +30 -0
  87. package/dist/garmin/stressDetails.d.ts.map +1 -0
  88. package/dist/garmin/stressDetails.js +49 -0
  89. package/dist/garmin/stressDetails.js.map +1 -0
  90. package/dist/garmin/sync.d.ts +14 -0
  91. package/dist/garmin/sync.d.ts.map +1 -1
  92. package/dist/garmin/sync.js +287 -5
  93. package/dist/garmin/sync.js.map +1 -1
  94. package/dist/garmin/types.d.ts +77 -186
  95. package/dist/garmin/types.d.ts.map +1 -1
  96. package/dist/garmin/types.js +4 -2
  97. package/dist/garmin/types.js.map +1 -1
  98. package/dist/garmin/userMetrics.d.ts +23 -0
  99. package/dist/garmin/userMetrics.d.ts.map +1 -0
  100. package/dist/garmin/userMetrics.js +41 -0
  101. package/dist/garmin/userMetrics.js.map +1 -0
  102. package/dist/validators.d.ts +107 -28
  103. package/dist/validators.d.ts.map +1 -1
  104. package/package.json +133 -124
  105. package/src/client/index.ts +199 -0
  106. package/src/component/_generated/component.ts +161 -2
  107. package/src/component/garmin.ts +898 -26
  108. package/src/component/private.ts +21 -0
  109. package/src/component/public.ts +11 -2
  110. package/src/component/schema.ts +2 -1
  111. package/src/component/validators/connection.ts +2 -0
  112. package/src/component/validators/daily.ts +15 -0
  113. package/src/component/validators/plannedWorkout.ts +4 -0
  114. package/src/garmin/activity.test.ts +13 -21
  115. package/src/garmin/activity.ts +38 -45
  116. package/src/garmin/bloodPressure.ts +41 -0
  117. package/src/garmin/body.ts +1 -1
  118. package/src/garmin/client.ts +550 -71
  119. package/src/garmin/daily.ts +8 -4
  120. package/src/garmin/hrv.ts +57 -0
  121. package/src/garmin/index.ts +77 -7
  122. package/src/garmin/maps/activity-type.ts +2 -2
  123. package/src/garmin/menstruation.ts +14 -12
  124. package/src/garmin/pulseOx.ts +45 -0
  125. package/src/garmin/respiration.ts +55 -0
  126. package/src/garmin/skinTemp.ts +42 -0
  127. package/src/garmin/sleep.test.ts +5 -6
  128. package/src/garmin/sleep.ts +22 -16
  129. package/src/garmin/spec/wellness-api.json +1 -0
  130. package/src/garmin/stressDetails.ts +71 -0
  131. package/src/garmin/sync.ts +348 -5
  132. package/src/garmin/types.ts +88 -300
  133. package/src/garmin/userMetrics.ts +50 -0
  134. package/src/garmin/wellness-api.d.ts +5637 -0
@@ -10,6 +10,7 @@ export type SomaComponent = ComponentApi;
10
10
 
11
11
  export const STRAVA_CALLBACK_PATH = "/api/strava/callback";
12
12
  export const GARMIN_CALLBACK_PATH = "/api/garmin/callback";
13
+ export const GARMIN_WEBHOOK_BASE_PATH = "/api/garmin/webhook";
13
14
 
14
15
  /**
15
16
  * Configuration for the Strava integration.
@@ -1198,6 +1199,136 @@ export class Soma {
1198
1199
  ) {
1199
1200
  return await ctx.runAction(this.component.garmin.disconnectGarmin, args);
1200
1201
  }
1202
+
1203
+ // ── Garmin Webhook Handlers ──────────────────────────────────────────────
1204
+ // For host apps that handle webhook routes manually instead of using
1205
+ // registerRoutes. Pass the raw JSON body from the Garmin POST request.
1206
+
1207
+ /**
1208
+ * Handle a Garmin activities webhook (push mode).
1209
+ *
1210
+ * @param ctx - Convex action context
1211
+ * @param payload - The raw JSON body from Garmin's POST (array of GarminActivity)
1212
+ */
1213
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1214
+ private get garminApi(): any { return this.component.garmin; }
1215
+
1216
+ async handleGarminWebhookActivities(ctx: ActionCtx, payload: unknown) {
1217
+ return await ctx.runAction(
1218
+ this.garminApi.handleGarminWebhookActivities,
1219
+ { payload },
1220
+ );
1221
+ }
1222
+
1223
+ /**
1224
+ * Handle a Garmin dailies webhook (push mode).
1225
+ */
1226
+ async handleGarminWebhookDailies(ctx: ActionCtx, payload: unknown) {
1227
+ return await ctx.runAction(
1228
+ this.garminApi.handleGarminWebhookDailies,
1229
+ { payload },
1230
+ );
1231
+ }
1232
+
1233
+ /**
1234
+ * Handle a Garmin sleeps webhook (push mode).
1235
+ */
1236
+ async handleGarminWebhookSleeps(ctx: ActionCtx, payload: unknown) {
1237
+ return await ctx.runAction(
1238
+ this.garminApi.handleGarminWebhookSleeps,
1239
+ { payload },
1240
+ );
1241
+ }
1242
+
1243
+ /**
1244
+ * Handle a Garmin body composition webhook (push mode).
1245
+ */
1246
+ async handleGarminWebhookBody(ctx: ActionCtx, payload: unknown) {
1247
+ return await ctx.runAction(
1248
+ this.garminApi.handleGarminWebhookBody,
1249
+ { payload },
1250
+ );
1251
+ }
1252
+
1253
+ /**
1254
+ * Handle a Garmin menstrual cycle tracking webhook (push mode).
1255
+ */
1256
+ async handleGarminWebhookMenstruation(ctx: ActionCtx, payload: unknown) {
1257
+ return await ctx.runAction(
1258
+ this.garminApi.handleGarminWebhookMenstruation,
1259
+ { payload },
1260
+ );
1261
+ }
1262
+
1263
+ /**
1264
+ * Handle a Garmin blood pressure webhook (push mode).
1265
+ */
1266
+ async handleGarminWebhookBloodPressures(ctx: ActionCtx, payload: unknown) {
1267
+ return await ctx.runAction(
1268
+ this.garminApi.handleGarminWebhookBloodPressures,
1269
+ { payload },
1270
+ );
1271
+ }
1272
+
1273
+ /**
1274
+ * Handle a Garmin skin temperature webhook (push mode).
1275
+ */
1276
+ async handleGarminWebhookSkinTemp(ctx: ActionCtx, payload: unknown) {
1277
+ return await ctx.runAction(
1278
+ this.garminApi.handleGarminWebhookSkinTemp,
1279
+ { payload },
1280
+ );
1281
+ }
1282
+
1283
+ /**
1284
+ * Handle a Garmin user metrics webhook (push mode).
1285
+ */
1286
+ async handleGarminWebhookUserMetrics(ctx: ActionCtx, payload: unknown) {
1287
+ return await ctx.runAction(
1288
+ this.garminApi.handleGarminWebhookUserMetrics,
1289
+ { payload },
1290
+ );
1291
+ }
1292
+
1293
+ /**
1294
+ * Handle a Garmin HRV webhook (push mode).
1295
+ */
1296
+ async handleGarminWebhookHRV(ctx: ActionCtx, payload: unknown) {
1297
+ return await ctx.runAction(
1298
+ this.garminApi.handleGarminWebhookHRV,
1299
+ { payload },
1300
+ );
1301
+ }
1302
+
1303
+ /**
1304
+ * Handle a Garmin stress details webhook (push mode).
1305
+ */
1306
+ async handleGarminWebhookStressDetails(ctx: ActionCtx, payload: unknown) {
1307
+ return await ctx.runAction(
1308
+ this.garminApi.handleGarminWebhookStressDetails,
1309
+ { payload },
1310
+ );
1311
+ }
1312
+
1313
+ /**
1314
+ * Handle a Garmin pulse oximetry webhook (push mode).
1315
+ */
1316
+ async handleGarminWebhookPulseOx(ctx: ActionCtx, payload: unknown) {
1317
+ return await ctx.runAction(
1318
+ this.garminApi.handleGarminWebhookPulseOx,
1319
+ { payload },
1320
+ );
1321
+ }
1322
+
1323
+ /**
1324
+ * Handle a Garmin respiration webhook (push mode).
1325
+ */
1326
+ async handleGarminWebhookRespiration(ctx: ActionCtx, payload: unknown) {
1327
+ return await ctx.runAction(
1328
+ this.garminApi.handleGarminWebhookRespiration,
1329
+ { payload },
1330
+ );
1331
+ }
1201
1332
  }
1202
1333
 
1203
1334
  // ─── Shared Types ────────────────────────────────────────────────────────────
@@ -1259,6 +1390,11 @@ export interface StravaRouteOptions {
1259
1390
  onSuccess?: string;
1260
1391
  }
1261
1392
 
1393
+ export interface GarminWebhookRouteOptions {
1394
+ /** Base path prefix for all webhook routes. @default "/api/garmin/webhook" */
1395
+ basePath?: string;
1396
+ }
1397
+
1262
1398
  export interface GarminRouteOptions {
1263
1399
  /** HTTP path for the OAuth callback. @default "/api/garmin/callback" */
1264
1400
  path?: string;
@@ -1268,6 +1404,8 @@ export interface GarminRouteOptions {
1268
1404
  clientSecret?: string;
1269
1405
  /** URL to redirect the user to after a successful connection. */
1270
1406
  onSuccess?: string;
1407
+ /** Webhook route configuration. Set to `false` to skip webhook registration. */
1408
+ webhook?: GarminWebhookRouteOptions | false;
1271
1409
  }
1272
1410
 
1273
1411
  export interface RegisterRoutesOptions {
@@ -1456,5 +1594,66 @@ export function registerRoutes(
1456
1594
  });
1457
1595
  }),
1458
1596
  });
1597
+
1598
+ // ── Garmin Webhook Routes (Push Mode) ──────────────────────────────────
1599
+ if (garmin.webhook !== false) {
1600
+ const webhookBase =
1601
+ (garmin.webhook && garmin.webhook.basePath) ?? GARMIN_WEBHOOK_BASE_PATH;
1602
+
1603
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1604
+ const garminApi = component.garmin as any;
1605
+ const webhookRoutes: Array<{
1606
+ suffix: string;
1607
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1608
+ action: any;
1609
+ }> = [
1610
+ // ACTIVITY category
1611
+ { suffix: "/activities", action: garminApi.handleGarminWebhookActivities },
1612
+ { suffix: "/activity-details", action: garminApi.handleGarminWebhookActivities },
1613
+ { suffix: "/manually-updated-activities", action: garminApi.handleGarminWebhookActivities },
1614
+ { suffix: "/move-iq", action: garminApi.handleGarminWebhookActivities },
1615
+ // HEALTH category
1616
+ { suffix: "/dailies", action: garminApi.handleGarminWebhookDailies },
1617
+ { suffix: "/sleeps", action: garminApi.handleGarminWebhookSleeps },
1618
+ { suffix: "/hrv", action: garminApi.handleGarminWebhookHRV },
1619
+ { suffix: "/stress-details", action: garminApi.handleGarminWebhookStressDetails },
1620
+ { suffix: "/pulse-ox", action: garminApi.handleGarminWebhookPulseOx },
1621
+ { suffix: "/respiration", action: garminApi.handleGarminWebhookRespiration },
1622
+ // BODY category
1623
+ { suffix: "/body", action: garminApi.handleGarminWebhookBody },
1624
+ { suffix: "/blood-pressures", action: garminApi.handleGarminWebhookBloodPressures },
1625
+ { suffix: "/skin-temp", action: garminApi.handleGarminWebhookSkinTemp },
1626
+ { suffix: "/user-metrics", action: garminApi.handleGarminWebhookUserMetrics },
1627
+ // WOMEN_HEALTH category
1628
+ { suffix: "/menstruation", action: garminApi.handleGarminWebhookMenstruation },
1629
+ ];
1630
+
1631
+ for (const route of webhookRoutes) {
1632
+ http.route({
1633
+ path: `${webhookBase}${route.suffix}`,
1634
+ method: "POST",
1635
+ handler: httpActionGeneric(async (ctx, request) => {
1636
+ let payload: unknown;
1637
+ try {
1638
+ payload = await request.json();
1639
+ } catch {
1640
+ return new Response("Invalid JSON body", { status: 400 });
1641
+ }
1642
+
1643
+ try {
1644
+ await ctx.runAction(route.action, { payload });
1645
+ } catch (error) {
1646
+ // Log but return 200 to prevent Garmin from retrying
1647
+ console.error(
1648
+ `Garmin webhook error (${route.suffix}):`,
1649
+ error instanceof Error ? error.message : error,
1650
+ );
1651
+ }
1652
+
1653
+ return new Response("OK", { status: 200 });
1654
+ }),
1655
+ });
1656
+ }
1657
+ }
1459
1658
  }
1460
1659
  }
@@ -39,10 +39,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
39
39
  errors: Array<{ error: string; id: string; type: string }>;
40
40
  synced: {
41
41
  activities: number;
42
+ bloodPressures: number;
42
43
  body: number;
43
44
  dailies: number;
45
+ hrv: number;
44
46
  menstruation: number;
47
+ pulseOx: number;
48
+ respiration: number;
49
+ skinTemp: number;
45
50
  sleep: number;
51
+ stressDetails: number;
52
+ userMetrics: number;
46
53
  };
47
54
  },
48
55
  Name
@@ -63,10 +70,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
63
70
  errors: Array<{ error: string; id: string; type: string }>;
64
71
  synced: {
65
72
  activities: number;
73
+ bloodPressures: number;
66
74
  body: number;
67
75
  dailies: number;
76
+ hrv: number;
68
77
  menstruation: number;
78
+ pulseOx: number;
79
+ respiration: number;
80
+ skinTemp: number;
69
81
  sleep: number;
82
+ stressDetails: number;
83
+ userMetrics: number;
70
84
  };
71
85
  },
72
86
  Name
@@ -85,6 +99,126 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
85
99
  { authUrl: string; codeVerifier: string; state: string },
86
100
  Name
87
101
  >;
102
+ handleGarminWebhookActivities: FunctionReference<
103
+ "action",
104
+ "internal",
105
+ { payload: any },
106
+ {
107
+ errors: Array<{ error: string; id: string; type: string }>;
108
+ processed: number;
109
+ },
110
+ Name
111
+ >;
112
+ handleGarminWebhookBloodPressures: FunctionReference<
113
+ "action",
114
+ "internal",
115
+ { payload: any },
116
+ {
117
+ errors: Array<{ error: string; id: string; type: string }>;
118
+ processed: number;
119
+ },
120
+ Name
121
+ >;
122
+ handleGarminWebhookBody: FunctionReference<
123
+ "action",
124
+ "internal",
125
+ { payload: any },
126
+ {
127
+ errors: Array<{ error: string; id: string; type: string }>;
128
+ processed: number;
129
+ },
130
+ Name
131
+ >;
132
+ handleGarminWebhookDailies: FunctionReference<
133
+ "action",
134
+ "internal",
135
+ { payload: any },
136
+ {
137
+ errors: Array<{ error: string; id: string; type: string }>;
138
+ processed: number;
139
+ },
140
+ Name
141
+ >;
142
+ handleGarminWebhookHRV: FunctionReference<
143
+ "action",
144
+ "internal",
145
+ { payload: any },
146
+ {
147
+ errors: Array<{ error: string; id: string; type: string }>;
148
+ processed: number;
149
+ },
150
+ Name
151
+ >;
152
+ handleGarminWebhookMenstruation: FunctionReference<
153
+ "action",
154
+ "internal",
155
+ { payload: any },
156
+ {
157
+ errors: Array<{ error: string; id: string; type: string }>;
158
+ processed: number;
159
+ },
160
+ Name
161
+ >;
162
+ handleGarminWebhookPulseOx: FunctionReference<
163
+ "action",
164
+ "internal",
165
+ { payload: any },
166
+ {
167
+ errors: Array<{ error: string; id: string; type: string }>;
168
+ processed: number;
169
+ },
170
+ Name
171
+ >;
172
+ handleGarminWebhookRespiration: FunctionReference<
173
+ "action",
174
+ "internal",
175
+ { payload: any },
176
+ {
177
+ errors: Array<{ error: string; id: string; type: string }>;
178
+ processed: number;
179
+ },
180
+ Name
181
+ >;
182
+ handleGarminWebhookSkinTemp: FunctionReference<
183
+ "action",
184
+ "internal",
185
+ { payload: any },
186
+ {
187
+ errors: Array<{ error: string; id: string; type: string }>;
188
+ processed: number;
189
+ },
190
+ Name
191
+ >;
192
+ handleGarminWebhookSleeps: FunctionReference<
193
+ "action",
194
+ "internal",
195
+ { payload: any },
196
+ {
197
+ errors: Array<{ error: string; id: string; type: string }>;
198
+ processed: number;
199
+ },
200
+ Name
201
+ >;
202
+ handleGarminWebhookStressDetails: FunctionReference<
203
+ "action",
204
+ "internal",
205
+ { payload: any },
206
+ {
207
+ errors: Array<{ error: string; id: string; type: string }>;
208
+ processed: number;
209
+ },
210
+ Name
211
+ >;
212
+ handleGarminWebhookUserMetrics: FunctionReference<
213
+ "action",
214
+ "internal",
215
+ { payload: any },
216
+ {
217
+ errors: Array<{ error: string; id: string; type: string }>;
218
+ processed: number;
219
+ },
220
+ Name
221
+ >;
88
222
  pushPlannedWorkout: FunctionReference<
89
223
  "action",
90
224
  "internal",
@@ -112,10 +246,17 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
112
246
  errors: Array<{ error: string; id: string; type: string }>;
113
247
  synced: {
114
248
  activities: number;
249
+ bloodPressures: number;
115
250
  body: number;
116
251
  dailies: number;
252
+ hrv: number;
117
253
  menstruation: number;
254
+ pulseOx: number;
255
+ respiration: number;
256
+ skinTemp: number;
118
257
  sleep: number;
258
+ stressDetails: number;
259
+ userMetrics: number;
119
260
  };
120
261
  },
121
262
  Name
@@ -125,7 +266,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
125
266
  connect: FunctionReference<
126
267
  "mutation",
127
268
  "internal",
128
- { provider: string; userId: string },
269
+ { provider: string; providerUserId?: string; userId: string },
129
270
  string,
130
271
  Name
131
272
  >;
@@ -167,6 +308,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
167
308
  active?: boolean;
168
309
  lastDataUpdate?: string;
169
310
  provider: string;
311
+ providerUserId?: string;
170
312
  userId: string;
171
313
  },
172
314
  Name
@@ -181,6 +323,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
181
323
  active?: boolean;
182
324
  lastDataUpdate?: string;
183
325
  provider: string;
326
+ providerUserId?: string;
184
327
  userId: string;
185
328
  },
186
329
  Name
@@ -827,6 +970,14 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
827
970
  }>;
828
971
  vo2max_ml_per_min_per_kg?: number;
829
972
  };
973
+ respiration_data?: {
974
+ breaths_data?: {
975
+ avg_breaths_per_min?: number;
976
+ max_breaths_per_min?: number;
977
+ min_breaths_per_min?: number;
978
+ samples?: Array<{ breaths_per_min?: number; timestamp?: string }>;
979
+ };
980
+ };
830
981
  scores?: {
831
982
  activity?: number;
832
983
  biological_age?: number;
@@ -1069,6 +1220,8 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
1069
1220
  planned_date?: string;
1070
1221
  pool_length_meters?: number;
1071
1222
  provider?: string;
1223
+ provider_schedule_id?: string;
1224
+ provider_workout_id?: string;
1072
1225
  type?: string;
1073
1226
  };
1074
1227
  steps?: Array<{
@@ -1310,6 +1463,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
1310
1463
  active?: boolean;
1311
1464
  lastDataUpdate?: string;
1312
1465
  provider: string;
1466
+ providerUserId?: string;
1313
1467
  userId: string;
1314
1468
  }>,
1315
1469
  Name
@@ -1515,7 +1669,12 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
1515
1669
  updateConnection: FunctionReference<
1516
1670
  "mutation",
1517
1671
  "internal",
1518
- { active?: boolean; connectionId: string; lastDataUpdate?: string },
1672
+ {
1673
+ active?: boolean;
1674
+ connectionId: string;
1675
+ lastDataUpdate?: string;
1676
+ providerUserId?: string;
1677
+ },
1519
1678
  null,
1520
1679
  Name
1521
1680
  >;