@nativesquare/soma 0.12.0 → 0.13.1
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/garmin.d.ts +9 -2
- package/dist/client/garmin.d.ts.map +1 -1
- package/dist/client/garmin.js +152 -1
- package/dist/client/garmin.js.map +1 -1
- package/dist/client/index.d.ts +5 -6
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +5 -211
- package/dist/client/index.js.map +1 -1
- package/dist/client/strava.d.ts +14 -7
- package/dist/client/strava.d.ts.map +1 -1
- package/dist/client/strava.js +67 -1
- package/dist/client/strava.js.map +1 -1
- package/dist/client/types.d.ts +93 -20
- package/dist/client/types.d.ts.map +1 -1
- package/dist/component/_generated/component.d.ts +24 -5
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/garmin/private.d.ts +53 -68
- package/dist/component/garmin/private.d.ts.map +1 -1
- package/dist/component/garmin/private.js +87 -85
- package/dist/component/garmin/private.js.map +1 -1
- package/dist/component/garmin/public.d.ts +97 -43
- package/dist/component/garmin/public.d.ts.map +1 -1
- package/dist/component/garmin/public.js +75 -51
- package/dist/component/garmin/public.js.map +1 -1
- package/dist/component/garmin/webhooks.d.ts +22 -20
- package/dist/component/garmin/webhooks.d.ts.map +1 -1
- package/dist/component/garmin/webhooks.js +115 -76
- package/dist/component/garmin/webhooks.js.map +1 -1
- package/dist/component/public.d.ts +15 -15
- package/dist/component/schema.d.ts +25 -25
- package/dist/component/strava/public.d.ts +12 -8
- package/dist/component/strava/public.d.ts.map +1 -1
- package/dist/component/strava/public.js +7 -7
- package/dist/component/strava/public.js.map +1 -1
- package/dist/component/validators/activity.d.ts +4 -4
- package/dist/component/validators/athlete.d.ts +6 -0
- package/dist/component/validators/athlete.d.ts.map +1 -1
- package/dist/component/validators/athlete.js.map +1 -1
- package/dist/component/validators/body.d.ts +4 -4
- package/dist/component/validators/daily.d.ts +4 -4
- package/dist/component/validators/nutrition.d.ts +9 -3
- package/dist/component/validators/nutrition.d.ts.map +1 -1
- package/dist/component/validators/nutrition.js.map +1 -1
- package/dist/component/validators/samples.d.ts +4 -4
- package/dist/component/validators/shared.d.ts +13 -4
- package/dist/component/validators/shared.d.ts.map +1 -1
- package/dist/component/validators/shared.js +7 -0
- package/dist/component/validators/shared.js.map +1 -1
- package/dist/component/validators/sleep.d.ts +11 -5
- package/dist/component/validators/sleep.d.ts.map +1 -1
- package/dist/component/validators/sleep.js.map +1 -1
- package/dist/validators.d.ts +48 -41
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +7 -6
- package/dist/validators.js.map +1 -1
- package/package.json +1 -1
- package/src/client/garmin.ts +695 -487
- package/src/client/index.ts +10 -279
- package/src/client/strava.ts +201 -108
- package/src/client/types.ts +303 -215
- package/src/component/_generated/component.ts +19 -19
- package/src/component/garmin/private.ts +1872 -1870
- package/src/component/garmin/public.ts +104 -80
- package/src/component/garmin/webhooks.ts +122 -81
- package/src/component/strava/public.ts +393 -393
- package/src/component/validators/athlete.ts +6 -0
- package/src/component/validators/nutrition.ts +6 -0
- package/src/component/validators/shared.ts +9 -0
- package/src/component/validators/sleep.ts +6 -0
- package/src/validators.ts +35 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Infer } from "convex/values";
|
|
1
2
|
import { v } from "convex/values";
|
|
2
3
|
|
|
3
4
|
// ─── Athlete ─────────────────────────────────────────────────────────────────
|
|
@@ -23,3 +24,8 @@ export const athleteValidator = {
|
|
|
23
24
|
joined_provider: v.optional(v.string()),
|
|
24
25
|
devices: v.optional(v.array(v.any())),
|
|
25
26
|
};
|
|
27
|
+
|
|
28
|
+
/** Data-only shape (no connectionId / userId). */
|
|
29
|
+
type AthleteData = Omit<typeof athleteValidator, "connectionId" | "userId">;
|
|
30
|
+
|
|
31
|
+
export type SomaAthlete = Infer<ReturnType<typeof v.object<AthleteData>>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Infer } from "convex/values";
|
|
1
2
|
import { v } from "convex/values";
|
|
2
3
|
import { drinkSample, meal } from "./samples.js";
|
|
3
4
|
import { macros, micros } from "./shared.js";
|
|
@@ -35,3 +36,8 @@ export const nutritionValidator = {
|
|
|
35
36
|
}),
|
|
36
37
|
),
|
|
37
38
|
};
|
|
39
|
+
|
|
40
|
+
/** Data-only shape (no connectionId / userId). */
|
|
41
|
+
type NutritionData = Omit<typeof nutritionValidator, "connectionId" | "userId">;
|
|
42
|
+
|
|
43
|
+
export type SomaNutrition = Infer<ReturnType<typeof v.object<NutritionData>>>;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { v } from "convex/values";
|
|
2
|
+
|
|
3
|
+
// ─── SomaError ──��──────────────────────────────────────────────────────────
|
|
4
|
+
// Convex validator matching the SomaError TypeScript interface.
|
|
5
|
+
export const somaErrorValidator = v.object({
|
|
6
|
+
type: v.string(),
|
|
7
|
+
id: v.string(),
|
|
8
|
+
message: v.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
2
11
|
import {
|
|
3
12
|
heartRateDataSample,
|
|
4
13
|
hrvSampleRmssd,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Infer } from "convex/values";
|
|
1
2
|
import { v } from "convex/values";
|
|
2
3
|
import {
|
|
3
4
|
sleepHypnogramSample,
|
|
@@ -131,3 +132,8 @@ export const sleepValidator = {
|
|
|
131
132
|
}),
|
|
132
133
|
),
|
|
133
134
|
};
|
|
135
|
+
|
|
136
|
+
/** Data-only shape (no connectionId / userId). */
|
|
137
|
+
type SleepData = Omit<typeof sleepValidator, "connectionId" | "userId">;
|
|
138
|
+
|
|
139
|
+
export type SomaSleep = Infer<ReturnType<typeof v.object<SleepData>>>;
|
package/src/validators.ts
CHANGED
|
@@ -39,21 +39,40 @@
|
|
|
39
39
|
// });
|
|
40
40
|
|
|
41
41
|
import { v } from "convex/values";
|
|
42
|
+
export { somaErrorValidator } from "./component/validators/shared.js";
|
|
42
43
|
import { connectionValidator as _connectionValidator } from "./component/validators/connection.js";
|
|
43
|
-
import { athleteValidator as _athleteValidator } from "./component/validators/athlete.js";
|
|
44
44
|
import {
|
|
45
45
|
activityValidator as _activityValidator,
|
|
46
46
|
type SomaActivity,
|
|
47
47
|
} from "./component/validators/activity.js";
|
|
48
|
+
import {
|
|
49
|
+
athleteValidator as _athleteValidator,
|
|
50
|
+
type SomaAthlete,
|
|
51
|
+
} from "./component/validators/athlete.js";
|
|
48
52
|
import {
|
|
49
53
|
bodyValidator as _bodyValidator,
|
|
50
54
|
type SomaBody,
|
|
51
55
|
} from "./component/validators/body.js";
|
|
52
|
-
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
dailyValidator as _dailyValidator,
|
|
58
|
+
type SomaDaily,
|
|
59
|
+
} from "./component/validators/daily.js";
|
|
60
|
+
import {
|
|
61
|
+
sleepValidator as _sleepValidator,
|
|
62
|
+
type SomaSleep,
|
|
63
|
+
} from "./component/validators/sleep.js";
|
|
64
|
+
import {
|
|
65
|
+
menstruationValidator as _menstruationValidator,
|
|
66
|
+
type SomaMenstruation,
|
|
67
|
+
} from "./component/validators/menstruation.js";
|
|
68
|
+
import {
|
|
69
|
+
nutritionValidator as _nutritionValidator,
|
|
70
|
+
type SomaNutrition,
|
|
71
|
+
} from "./component/validators/nutrition.js";
|
|
72
|
+
import {
|
|
73
|
+
plannedWorkoutValidator as _plannedWorkoutValidator,
|
|
74
|
+
type SomaPlannedWorkout,
|
|
75
|
+
} from "./component/validators/plannedWorkout.js";
|
|
57
76
|
|
|
58
77
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
59
78
|
|
|
@@ -96,4 +115,13 @@ export const plannedWorkoutData = stripConnection(_plannedWorkoutValidator);
|
|
|
96
115
|
|
|
97
116
|
// ─── Soma types ─────────────────────────────────────────────────────────────
|
|
98
117
|
|
|
99
|
-
export type {
|
|
118
|
+
export type {
|
|
119
|
+
SomaActivity,
|
|
120
|
+
SomaAthlete,
|
|
121
|
+
SomaBody,
|
|
122
|
+
SomaDaily,
|
|
123
|
+
SomaMenstruation,
|
|
124
|
+
SomaNutrition,
|
|
125
|
+
SomaPlannedWorkout,
|
|
126
|
+
SomaSleep,
|
|
127
|
+
};
|