@nativesquare/soma 0.14.0 → 0.14.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/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +3 -2
- package/dist/client/types.d.ts.map +1 -1
- package/dist/component/_generated/component.d.ts +7 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/garmin/private.d.ts +18 -85
- package/dist/component/garmin/private.d.ts.map +1 -1
- package/dist/component/garmin/private.js +12 -12
- package/dist/component/garmin/private.js.map +1 -1
- package/dist/component/garmin/public.d.ts +38 -65
- package/dist/component/garmin/public.d.ts.map +1 -1
- package/dist/component/garmin/public.js +132 -10
- package/dist/component/garmin/public.js.map +1 -1
- package/dist/component/garmin/utils.d.ts +48 -0
- package/dist/component/garmin/utils.d.ts.map +1 -1
- package/dist/component/garmin/utils.js +65 -0
- package/dist/component/garmin/utils.js.map +1 -1
- package/dist/component/garmin/webhooks.d.ts +1 -11
- package/dist/component/garmin/webhooks.d.ts.map +1 -1
- package/dist/component/garmin/webhooks.js.map +1 -1
- package/dist/component/public.d.ts +3 -3
- package/dist/component/schema.d.ts +4 -4
- package/dist/component/strava/public.d.ts +4 -15
- package/dist/component/strava/public.d.ts.map +1 -1
- package/dist/component/strava/public.js +4 -3
- package/dist/component/strava/public.js.map +1 -1
- package/dist/component/strava/webhooks.d.ts +3 -10
- package/dist/component/strava/webhooks.d.ts.map +1 -1
- package/dist/component/strava/webhooks.js.map +1 -1
- package/dist/component/validators/daily.d.ts +2 -2
- package/dist/component/validators/shared.d.ts +16 -3
- package/dist/component/validators/shared.d.ts.map +1 -1
- package/dist/component/validators/shared.js +1 -1
- package/dist/component/validators/shared.js.map +1 -1
- package/dist/validators.d.ts +5 -4
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +1 -0
- package/src/client/types.ts +4 -2
- package/src/component/_generated/component.ts +13 -0
- package/src/component/garmin/private.ts +12 -12
- package/src/component/garmin/public.ts +166 -11
- package/src/component/garmin/utils.ts +102 -0
- package/src/component/garmin/webhooks.ts +1 -7
- package/src/component/strava/public.ts +6 -5
- package/src/component/strava/webhooks.ts +9 -11
- package/src/component/validators/shared.ts +47 -4
- package/src/validators.ts +1 -0
|
@@ -1,15 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
|
|
3
|
+
// ─── SomaErrorType ──────────────────────────────────────────────────────────
|
|
4
|
+
// Canonical error‐type identifiers shared across Garmin & Strava modules.
|
|
5
|
+
|
|
6
|
+
export type SomaErrorType =
|
|
7
|
+
// Data domain types
|
|
8
|
+
| "activity"
|
|
9
|
+
| "activityDetails"
|
|
10
|
+
| "athlete"
|
|
11
|
+
| "bloodPressure"
|
|
12
|
+
| "body"
|
|
13
|
+
| "daily"
|
|
14
|
+
| "epochs"
|
|
15
|
+
| "healthSnapshot"
|
|
16
|
+
| "hrv"
|
|
17
|
+
| "manuallyUpdatedActivities"
|
|
18
|
+
| "menstruation"
|
|
19
|
+
| "moveIQ"
|
|
20
|
+
| "pulseOx"
|
|
21
|
+
| "respiration"
|
|
22
|
+
| "skinTemperature"
|
|
23
|
+
| "sleep"
|
|
24
|
+
| "stressDetails"
|
|
25
|
+
| "userMetrics"
|
|
26
|
+
// Operation types
|
|
27
|
+
| "deleteSchedule"
|
|
28
|
+
| "deleteWorkout"
|
|
29
|
+
| "ingest"
|
|
30
|
+
| "pushSchedule"
|
|
31
|
+
| "pushWorkout";
|
|
2
32
|
|
|
3
33
|
// ─── SomaError ──────────────────────────────────────────────────────────────
|
|
4
|
-
|
|
34
|
+
|
|
35
|
+
/** Convex validator for SomaError (uses v.string() for runtime flexibility). */
|
|
5
36
|
export const somaErrorValidator = v.object({
|
|
6
37
|
type: v.string(),
|
|
7
38
|
id: v.string(),
|
|
8
39
|
message: v.string(),
|
|
9
40
|
});
|
|
10
41
|
|
|
11
|
-
/** Structured error from a Soma operation
|
|
12
|
-
export
|
|
42
|
+
/** Structured error from a Soma operation. */
|
|
43
|
+
export interface SomaError {
|
|
44
|
+
type: SomaErrorType;
|
|
45
|
+
id: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ─── WebhookResult ──────────────────────────────────────────────────────────
|
|
50
|
+
// Shared return shape for all webhook handler actions.
|
|
51
|
+
|
|
52
|
+
export type WebhookResult<TData = Record<string, unknown>> = {
|
|
53
|
+
errors: SomaError[];
|
|
54
|
+
items: Array<{ connectionId: string; userId: string; data: TData }>;
|
|
55
|
+
};
|
|
13
56
|
|
|
14
57
|
import {
|
|
15
58
|
heartRateDataSample,
|
package/src/validators.ts
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
import { v } from "convex/values";
|
|
42
42
|
export { somaErrorValidator } from "./component/validators/shared.js";
|
|
43
|
+
export type { SomaErrorType } from "./component/validators/shared.js";
|
|
43
44
|
import { connectionValidator as _connectionValidator } from "./component/validators/connection.js";
|
|
44
45
|
import {
|
|
45
46
|
activityValidator as _activityValidator,
|