@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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
|
|
4
|
+
import {
|
|
5
|
+
type ArraySeparatorStyle,
|
|
6
|
+
serializeArrayParam,
|
|
7
|
+
serializeObjectParam,
|
|
8
|
+
serializePrimitiveParam,
|
|
9
|
+
} from './pathSerializer.gen';
|
|
10
|
+
|
|
11
|
+
export interface PathSerializer {
|
|
12
|
+
path: Record<string, unknown>;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
17
|
+
|
|
18
|
+
export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
19
|
+
let url = _url;
|
|
20
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
21
|
+
if (matches) {
|
|
22
|
+
for (const match of matches) {
|
|
23
|
+
let explode = false;
|
|
24
|
+
let name = match.substring(1, match.length - 1);
|
|
25
|
+
let style: ArraySeparatorStyle = 'simple';
|
|
26
|
+
|
|
27
|
+
if (name.endsWith('*')) {
|
|
28
|
+
explode = true;
|
|
29
|
+
name = name.substring(0, name.length - 1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (name.startsWith('.')) {
|
|
33
|
+
name = name.substring(1);
|
|
34
|
+
style = 'label';
|
|
35
|
+
} else if (name.startsWith(';')) {
|
|
36
|
+
name = name.substring(1);
|
|
37
|
+
style = 'matrix';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const value = path[name];
|
|
41
|
+
|
|
42
|
+
if (value === undefined || value === null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value === 'object') {
|
|
52
|
+
url = url.replace(
|
|
53
|
+
match,
|
|
54
|
+
serializeObjectParam({
|
|
55
|
+
explode,
|
|
56
|
+
name,
|
|
57
|
+
style,
|
|
58
|
+
value: value as Record<string, unknown>,
|
|
59
|
+
valueOnly: true,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (style === 'matrix') {
|
|
66
|
+
url = url.replace(
|
|
67
|
+
match,
|
|
68
|
+
`;${serializePrimitiveParam({
|
|
69
|
+
name,
|
|
70
|
+
value: value as string,
|
|
71
|
+
})}`,
|
|
72
|
+
);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const replaceValue = encodeURIComponent(
|
|
77
|
+
style === 'label' ? `.${value as string}` : (value as string),
|
|
78
|
+
);
|
|
79
|
+
url = url.replace(match, replaceValue);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return url;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const getUrl = ({
|
|
86
|
+
baseUrl,
|
|
87
|
+
path,
|
|
88
|
+
query,
|
|
89
|
+
querySerializer,
|
|
90
|
+
url: _url,
|
|
91
|
+
}: {
|
|
92
|
+
baseUrl?: string;
|
|
93
|
+
path?: Record<string, unknown>;
|
|
94
|
+
query?: Record<string, unknown>;
|
|
95
|
+
querySerializer: QuerySerializer;
|
|
96
|
+
url: string;
|
|
97
|
+
}) => {
|
|
98
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
99
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
100
|
+
if (path) {
|
|
101
|
+
url = defaultPathSerializer({ path, url });
|
|
102
|
+
}
|
|
103
|
+
let search = query ? querySerializer(query) : '';
|
|
104
|
+
if (search.startsWith('?')) {
|
|
105
|
+
search = search.substring(1);
|
|
106
|
+
}
|
|
107
|
+
if (search) {
|
|
108
|
+
url += `?${search}`;
|
|
109
|
+
}
|
|
110
|
+
return url;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export function getValidRequestBody(options: {
|
|
114
|
+
body?: unknown;
|
|
115
|
+
bodySerializer?: BodySerializer | null;
|
|
116
|
+
serializedBody?: unknown;
|
|
117
|
+
}) {
|
|
118
|
+
const hasBody = options.body !== undefined;
|
|
119
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
120
|
+
|
|
121
|
+
if (isSerializedBody) {
|
|
122
|
+
if ('serializedBody' in options) {
|
|
123
|
+
const hasSerializedBody =
|
|
124
|
+
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
125
|
+
|
|
126
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
130
|
+
return options.body !== '' ? options.body : null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// plain/text body
|
|
134
|
+
if (hasBody) {
|
|
135
|
+
return options.body;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// no body was provided
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
export { createWorkout, createWorkoutSchedule, createWorkoutV2, deleteWorkout, deleteWorkoutSchedule, deleteWorkoutV2, getWorkout, getWorkoutSchedule, getWorkoutV2, type Options, queryWorkoutScheduleByDates, updateWorkout, updateWorkoutSchedule, updateWorkoutV2 } from './sdk.gen';
|
|
4
|
+
export type { ClientOptions, ConnectErrorBody, CreateWorkoutData, CreateWorkoutResponse, CreateWorkoutResponses, CreateWorkoutScheduleData, CreateWorkoutScheduleResponse, CreateWorkoutScheduleResponses, CreateWorkoutV2Data, CreateWorkoutV2Response, CreateWorkoutV2Responses, DeleteWorkoutData, DeleteWorkoutResponse, DeleteWorkoutResponses, DeleteWorkoutScheduleData, DeleteWorkoutScheduleResponse, DeleteWorkoutScheduleResponses, DeleteWorkoutV2Data, DeleteWorkoutV2Response, DeleteWorkoutV2Responses, GetWorkoutData, GetWorkoutError, GetWorkoutErrors, GetWorkoutResponse, GetWorkoutResponses, GetWorkoutScheduleData, GetWorkoutScheduleError, GetWorkoutScheduleErrors, GetWorkoutScheduleResponse, GetWorkoutScheduleResponses, GetWorkoutV2Data, GetWorkoutV2Error, GetWorkoutV2Errors, GetWorkoutV2Response, GetWorkoutV2Responses, QueryWorkoutScheduleByDatesData, QueryWorkoutScheduleByDatesError, QueryWorkoutScheduleByDatesErrors, QueryWorkoutScheduleByDatesResponse, QueryWorkoutScheduleByDatesResponses, Segment, ServiceFailure, Step, UpdateWorkoutData, UpdateWorkoutResponse, UpdateWorkoutResponses, UpdateWorkoutScheduleData, UpdateWorkoutScheduleResponse, UpdateWorkoutScheduleResponses, UpdateWorkoutV2Data, UpdateWorkoutV2Response, UpdateWorkoutV2Responses, Workout, WorkoutRepeatStep, WorkoutSchedule, WorkoutStep, WorkoutV2 } from './types.gen';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { Client, Options as Options2, TDataShape } from './client';
|
|
4
|
+
import { client } from './client.gen';
|
|
5
|
+
import type { CreateWorkoutData, CreateWorkoutResponses, CreateWorkoutScheduleData, CreateWorkoutScheduleResponses, CreateWorkoutV2Data, CreateWorkoutV2Responses, DeleteWorkoutData, DeleteWorkoutResponses, DeleteWorkoutScheduleData, DeleteWorkoutScheduleResponses, DeleteWorkoutV2Data, DeleteWorkoutV2Responses, GetWorkoutData, GetWorkoutErrors, GetWorkoutResponses, GetWorkoutScheduleData, GetWorkoutScheduleErrors, GetWorkoutScheduleResponses, GetWorkoutV2Data, GetWorkoutV2Errors, GetWorkoutV2Responses, QueryWorkoutScheduleByDatesData, QueryWorkoutScheduleByDatesErrors, QueryWorkoutScheduleByDatesResponses, UpdateWorkoutData, UpdateWorkoutResponses, UpdateWorkoutScheduleData, UpdateWorkoutScheduleResponses, UpdateWorkoutV2Data, UpdateWorkoutV2Responses } from './types.gen';
|
|
6
|
+
|
|
7
|
+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
8
|
+
/**
|
|
9
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
10
|
+
* individual options. This might be also useful if you want to implement a
|
|
11
|
+
* custom client.
|
|
12
|
+
*/
|
|
13
|
+
client?: Client;
|
|
14
|
+
/**
|
|
15
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
16
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
17
|
+
*/
|
|
18
|
+
meta?: Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* This request is to delete a workout by/for a user
|
|
23
|
+
*/
|
|
24
|
+
export const deleteWorkout = <ThrowOnError extends boolean = false>(options: Options<DeleteWorkoutData, ThrowOnError>) => (options.client ?? client).delete<DeleteWorkoutResponses, unknown, ThrowOnError>({ url: '/training-api/workout/{workoutId}', ...options });
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This request is to retrieve a workout by/for a user
|
|
28
|
+
*/
|
|
29
|
+
export const getWorkout = <ThrowOnError extends boolean = false>(options: Options<GetWorkoutData, ThrowOnError>) => (options.client ?? client).get<GetWorkoutResponses, GetWorkoutErrors, ThrowOnError>({ url: '/training-api/workout/{workoutId}', ...options });
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This request is to update a workout by/for a user
|
|
33
|
+
*/
|
|
34
|
+
export const updateWorkout = <ThrowOnError extends boolean = false>(options: Options<UpdateWorkoutData, ThrowOnError>) => (options.client ?? client).put<UpdateWorkoutResponses, unknown, ThrowOnError>({
|
|
35
|
+
url: '/training-api/workout/{workoutId}',
|
|
36
|
+
...options,
|
|
37
|
+
headers: {
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
...options.headers
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This request is to delete a workout by/for a user
|
|
45
|
+
*/
|
|
46
|
+
export const deleteWorkoutV2 = <ThrowOnError extends boolean = false>(options: Options<DeleteWorkoutV2Data, ThrowOnError>) => (options.client ?? client).delete<DeleteWorkoutV2Responses, unknown, ThrowOnError>({ url: '/training-api/workout/v2/{workoutId}', ...options });
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* This request is to retrieve a workout by/for a user
|
|
50
|
+
*/
|
|
51
|
+
export const getWorkoutV2 = <ThrowOnError extends boolean = false>(options: Options<GetWorkoutV2Data, ThrowOnError>) => (options.client ?? client).get<GetWorkoutV2Responses, GetWorkoutV2Errors, ThrowOnError>({ url: '/training-api/workout/v2/{workoutId}', ...options });
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This request is to update a workout by/for a user
|
|
55
|
+
*/
|
|
56
|
+
export const updateWorkoutV2 = <ThrowOnError extends boolean = false>(options: Options<UpdateWorkoutV2Data, ThrowOnError>) => (options.client ?? client).put<UpdateWorkoutV2Responses, unknown, ThrowOnError>({
|
|
57
|
+
url: '/training-api/workout/v2/{workoutId}',
|
|
58
|
+
...options,
|
|
59
|
+
headers: {
|
|
60
|
+
'Content-Type': 'application/json',
|
|
61
|
+
...options.headers
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* This request is to create a V2 workout by/for a user
|
|
67
|
+
*/
|
|
68
|
+
export const createWorkoutV2 = <ThrowOnError extends boolean = false>(options: Options<CreateWorkoutV2Data, ThrowOnError>) => (options.client ?? client).post<CreateWorkoutV2Responses, unknown, ThrowOnError>({
|
|
69
|
+
url: '/workoutportal/workout/v2',
|
|
70
|
+
...options,
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
...options.headers
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This request is to create a workout by/for a user:
|
|
79
|
+
*/
|
|
80
|
+
export const createWorkout = <ThrowOnError extends boolean = false>(options: Options<CreateWorkoutData, ThrowOnError>) => (options.client ?? client).post<CreateWorkoutResponses, unknown, ThrowOnError>({
|
|
81
|
+
url: '/training-api/workout',
|
|
82
|
+
...options,
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'application/json',
|
|
85
|
+
...options.headers
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* This request is to delete a workout schedule by/for a user
|
|
91
|
+
*/
|
|
92
|
+
export const deleteWorkoutSchedule = <ThrowOnError extends boolean = false>(options: Options<DeleteWorkoutScheduleData, ThrowOnError>) => (options.client ?? client).delete<DeleteWorkoutScheduleResponses, unknown, ThrowOnError>({ url: '/training-api/schedule/{workoutScheduleId}', ...options });
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* This request is to retrieve a workout schedule by/for a user
|
|
96
|
+
*/
|
|
97
|
+
export const getWorkoutSchedule = <ThrowOnError extends boolean = false>(options: Options<GetWorkoutScheduleData, ThrowOnError>) => (options.client ?? client).get<GetWorkoutScheduleResponses, GetWorkoutScheduleErrors, ThrowOnError>({ url: '/training-api/schedule/{workoutScheduleId}', ...options });
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* This request is to update a workout schedule by/for a user
|
|
101
|
+
*/
|
|
102
|
+
export const updateWorkoutSchedule = <ThrowOnError extends boolean = false>(options: Options<UpdateWorkoutScheduleData, ThrowOnError>) => (options.client ?? client).put<UpdateWorkoutScheduleResponses, unknown, ThrowOnError>({
|
|
103
|
+
url: '/training-api/schedule/{workoutScheduleId}',
|
|
104
|
+
...options,
|
|
105
|
+
headers: {
|
|
106
|
+
'Content-Type': 'application/json',
|
|
107
|
+
...options.headers
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* This request is used to retrieve workout schedule by/for a user by date range:
|
|
113
|
+
*/
|
|
114
|
+
export const queryWorkoutScheduleByDates = <ThrowOnError extends boolean = false>(options: Options<QueryWorkoutScheduleByDatesData, ThrowOnError>) => (options.client ?? client).get<QueryWorkoutScheduleByDatesResponses, QueryWorkoutScheduleByDatesErrors, ThrowOnError>({ url: '/training-api/schedule', ...options });
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* This request is to create a workout schedule by/for a user:
|
|
118
|
+
*/
|
|
119
|
+
export const createWorkoutSchedule = <ThrowOnError extends boolean = false>(options: Options<CreateWorkoutScheduleData, ThrowOnError>) => (options.client ?? client).post<CreateWorkoutScheduleResponses, unknown, ThrowOnError>({
|
|
120
|
+
url: '/training-api/schedule',
|
|
121
|
+
...options,
|
|
122
|
+
headers: {
|
|
123
|
+
'Content-Type': 'application/json',
|
|
124
|
+
...options.headers
|
|
125
|
+
}
|
|
126
|
+
});
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
export type ClientOptions = {
|
|
4
|
+
baseUrl: 'https://apis.garmin.com' | (string & {});
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type Step = {
|
|
8
|
+
stepOrder?: number;
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type Workout = {
|
|
13
|
+
workoutId?: number;
|
|
14
|
+
ownerId?: number;
|
|
15
|
+
workoutName?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* iso 8601 timestamp without GMT offset or 'Z' indicator!
|
|
19
|
+
*/
|
|
20
|
+
updatedDate?: string;
|
|
21
|
+
/**
|
|
22
|
+
* iso 8601 timestamp without GMT offset or 'Z' indicator!
|
|
23
|
+
*/
|
|
24
|
+
createdDate?: string;
|
|
25
|
+
updatedTimeStamp?: number;
|
|
26
|
+
createdTimeStamp?: number;
|
|
27
|
+
sport?: 'RUNNING' | 'CYCLING' | 'LAP_SWIMMING' | 'STRENGTH_TRAINING' | 'CARDIO_TRAINING' | 'YOGA' | 'PILATES' | 'GENERIC' | 'HIIT' | 'MULTI_SPORT';
|
|
28
|
+
estimatedDurationInSecs?: number;
|
|
29
|
+
estimatedDistanceInMeters?: number;
|
|
30
|
+
poolLength?: number;
|
|
31
|
+
poolLengthUnit?: 'YARD' | 'METER';
|
|
32
|
+
workoutProvider?: string;
|
|
33
|
+
workoutSourceId?: string;
|
|
34
|
+
steps?: Array<WorkoutRepeatStep | WorkoutStep>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type WorkoutRepeatStep = Omit<Step, 'type'> & {
|
|
38
|
+
repeatType?: 'REPEAT_UNTIL_STEPS_CMPLT' | 'REPEAT_UNTIL_TIME' | 'REPEAT_UNTIL_DISTANCE' | 'REPEAT_UNTIL_CALORIES' | 'REPEAT_UNTIL_HR_LESS_THAN' | 'REPEAT_UNTIL_HR_GREATER_THAN' | 'REPEAT_UNTIL_POWER_LESS_THAN' | 'REPEAT_UNTIL_POWER_GREATER_THAN' | 'REPEAT_UNTIL_POWER_LAST_LAP_LESS_THAN' | 'REPEAT_UNTIL_MAX_POWER_LAST_LAP_LESS_THAN' | 'REPEAT_UNTIL_TRAINING_PEAKS_TSS';
|
|
39
|
+
repeatValue?: number;
|
|
40
|
+
skipLastRestStep?: boolean;
|
|
41
|
+
type: 'WorkoutRepeatStep';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type WorkoutStep = Omit<Step, 'type'> & {
|
|
45
|
+
intensity?: 'ACTIVE' | 'REST' | 'WARMUP' | 'COOLDOWN' | 'RECOVERY' | 'INTERVAL' | 'MAIN';
|
|
46
|
+
description?: string;
|
|
47
|
+
durationType?: 'TIME' | 'DISTANCE' | 'HR_LESS_THAN' | 'HR_GREATER_THAN' | 'CALORIES' | 'OPEN' | 'POWER_LESS_THAN' | 'POWER_GREATER_THAN' | 'TRAINING_PEAKS_TSS' | 'REPETITION_TIME' | 'REPS' | 'TIME_AT_VALID_CDA' | 'FIXED_REST' | 'FIXED_REPETITION' | 'REPETITION_SWIM_CSS_OFFSET';
|
|
48
|
+
durationValue?: number;
|
|
49
|
+
durationValueType?: 'PERCENT' | 'MILE' | 'KILOMETER' | 'METER' | 'YARD';
|
|
50
|
+
targetType?: 'SPEED' | 'HEART_RATE' | 'OPEN' | 'CADENCE' | 'POWER' | 'GRADE' | 'RESISTANCE' | 'POWER_3S' | 'POWER_10S' | 'POWER_30S' | 'POWER_LAP' | 'SWIM_STROKE' | 'SPEED_LAP' | 'HEART_RATE_LAP' | 'PACE' | 'PACE_ZONE' | 'SWIM_INSTRUCTION' | 'SWIM_CSS_OFFSET';
|
|
51
|
+
targetValue?: number;
|
|
52
|
+
targetValueLow?: number;
|
|
53
|
+
targetValueHigh?: number;
|
|
54
|
+
targetValueType?: 'PERCENT' | 'MILE' | 'KILOMETER' | 'METER' | 'YARD';
|
|
55
|
+
secondaryTargetType?: 'SPEED' | 'HEART_RATE' | 'OPEN' | 'CADENCE' | 'POWER' | 'GRADE' | 'RESISTANCE' | 'POWER_3S' | 'POWER_10S' | 'POWER_30S' | 'POWER_LAP' | 'SWIM_STROKE' | 'SPEED_LAP' | 'HEART_RATE_LAP' | 'PACE' | 'PACE_ZONE' | 'SWIM_INSTRUCTION' | 'SWIM_CSS_OFFSET';
|
|
56
|
+
secondaryTargetValue?: number;
|
|
57
|
+
secondaryTargetValueLow?: number;
|
|
58
|
+
secondaryTargetValueHigh?: number;
|
|
59
|
+
secondaryTargetValueType?: 'PERCENT' | 'MILE' | 'KILOMETER' | 'METER' | 'YARD';
|
|
60
|
+
strokeType?: 'BACKSTROKE' | 'BREASTSTROKE' | 'DRILL' | 'BUTTERFLY' | 'FREESTYLE' | 'MIXED' | 'IM' | 'IM_BY_ROUND' | 'REVERSE_IM_BY_ROUND' | 'CHOICE';
|
|
61
|
+
drillType?: 'KICK' | 'PULL' | 'DRILL';
|
|
62
|
+
equipmentType?: 'NONE' | 'SWIM_FINS' | 'SWIM_KICKBOARD' | 'SWIM_PADDLES' | 'SWIM_PULL_BUOY' | 'SWIM_SNORKEL';
|
|
63
|
+
exerciseCategory?: string;
|
|
64
|
+
exerciseName?: string;
|
|
65
|
+
weightValue?: number;
|
|
66
|
+
weightDisplayUnit?: 'OTHER' | 'KILOGRAM' | 'POUND';
|
|
67
|
+
type: 'WorkoutStep';
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type Segment = {
|
|
71
|
+
segmentOrder?: number;
|
|
72
|
+
sport?: 'RUNNING' | 'CYCLING' | 'LAP_SWIMMING' | 'STRENGTH_TRAINING' | 'CARDIO_TRAINING' | 'YOGA' | 'PILATES' | 'GENERIC' | 'HIIT' | 'MULTI_SPORT';
|
|
73
|
+
estimatedDurationInSecs?: number;
|
|
74
|
+
estimatedDistanceInMeters?: number;
|
|
75
|
+
poolLength?: number;
|
|
76
|
+
poolLengthUnit?: 'YARD' | 'METER';
|
|
77
|
+
steps?: Array<WorkoutRepeatStep | WorkoutStep>;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type WorkoutV2 = {
|
|
81
|
+
workoutId?: number;
|
|
82
|
+
ownerId?: number;
|
|
83
|
+
workoutName?: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
/**
|
|
86
|
+
* iso 8601 timestamp without GMT offset or 'Z' indicator!
|
|
87
|
+
*/
|
|
88
|
+
updatedDate?: string;
|
|
89
|
+
/**
|
|
90
|
+
* iso 8601 timestamp without GMT offset or 'Z' indicator!
|
|
91
|
+
*/
|
|
92
|
+
createdDate?: string;
|
|
93
|
+
updatedTimeStamp?: number;
|
|
94
|
+
createdTimeStamp?: number;
|
|
95
|
+
sport?: 'RUNNING' | 'CYCLING' | 'LAP_SWIMMING' | 'STRENGTH_TRAINING' | 'CARDIO_TRAINING' | 'YOGA' | 'PILATES' | 'GENERIC' | 'HIIT' | 'MULTI_SPORT';
|
|
96
|
+
estimatedDurationInSecs?: number;
|
|
97
|
+
estimatedDistanceInMeters?: number;
|
|
98
|
+
poolLength?: number;
|
|
99
|
+
poolLengthUnit?: 'YARD' | 'METER';
|
|
100
|
+
workoutProvider?: string;
|
|
101
|
+
workoutSourceId?: string;
|
|
102
|
+
isSessionTransitionEnabled?: boolean;
|
|
103
|
+
segments?: Array<Segment>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type WorkoutSchedule = {
|
|
107
|
+
scheduleId?: number;
|
|
108
|
+
workoutId?: number;
|
|
109
|
+
date?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type ServiceFailure = {
|
|
113
|
+
errorType?: string;
|
|
114
|
+
message?: string;
|
|
115
|
+
errorMessage?: string;
|
|
116
|
+
errorId?: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export type ConnectErrorBody = {
|
|
120
|
+
message?: string;
|
|
121
|
+
error?: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export type DeleteWorkoutData = {
|
|
125
|
+
body?: never;
|
|
126
|
+
path: {
|
|
127
|
+
workoutId: number;
|
|
128
|
+
};
|
|
129
|
+
query?: never;
|
|
130
|
+
url: '/training-api/workout/{workoutId}';
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type DeleteWorkoutResponses = {
|
|
134
|
+
/**
|
|
135
|
+
* No Content
|
|
136
|
+
*/
|
|
137
|
+
204: void;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type DeleteWorkoutResponse = DeleteWorkoutResponses[keyof DeleteWorkoutResponses];
|
|
141
|
+
|
|
142
|
+
export type GetWorkoutData = {
|
|
143
|
+
body?: never;
|
|
144
|
+
path: {
|
|
145
|
+
workoutId: number;
|
|
146
|
+
};
|
|
147
|
+
query?: never;
|
|
148
|
+
url: '/training-api/workout/{workoutId}';
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type GetWorkoutErrors = {
|
|
152
|
+
/**
|
|
153
|
+
* Forbidden
|
|
154
|
+
*/
|
|
155
|
+
403: ConnectErrorBody;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type GetWorkoutError = GetWorkoutErrors[keyof GetWorkoutErrors];
|
|
159
|
+
|
|
160
|
+
export type GetWorkoutResponses = {
|
|
161
|
+
/**
|
|
162
|
+
* OK
|
|
163
|
+
*/
|
|
164
|
+
200: Workout;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type GetWorkoutResponse = GetWorkoutResponses[keyof GetWorkoutResponses];
|
|
168
|
+
|
|
169
|
+
export type UpdateWorkoutData = {
|
|
170
|
+
body: Workout;
|
|
171
|
+
path: {
|
|
172
|
+
workoutId: number;
|
|
173
|
+
};
|
|
174
|
+
query?: never;
|
|
175
|
+
url: '/training-api/workout/{workoutId}';
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export type UpdateWorkoutResponses = {
|
|
179
|
+
/**
|
|
180
|
+
* No Content
|
|
181
|
+
*/
|
|
182
|
+
204: void;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export type UpdateWorkoutResponse = UpdateWorkoutResponses[keyof UpdateWorkoutResponses];
|
|
186
|
+
|
|
187
|
+
export type DeleteWorkoutV2Data = {
|
|
188
|
+
body?: never;
|
|
189
|
+
path: {
|
|
190
|
+
workoutId: number;
|
|
191
|
+
};
|
|
192
|
+
query?: never;
|
|
193
|
+
url: '/training-api/workout/v2/{workoutId}';
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export type DeleteWorkoutV2Responses = {
|
|
197
|
+
/**
|
|
198
|
+
* No Content
|
|
199
|
+
*/
|
|
200
|
+
204: void;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export type DeleteWorkoutV2Response = DeleteWorkoutV2Responses[keyof DeleteWorkoutV2Responses];
|
|
204
|
+
|
|
205
|
+
export type GetWorkoutV2Data = {
|
|
206
|
+
body?: never;
|
|
207
|
+
path: {
|
|
208
|
+
workoutId: number;
|
|
209
|
+
};
|
|
210
|
+
query?: never;
|
|
211
|
+
url: '/training-api/workout/v2/{workoutId}';
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export type GetWorkoutV2Errors = {
|
|
215
|
+
/**
|
|
216
|
+
* Forbidden
|
|
217
|
+
*/
|
|
218
|
+
403: ConnectErrorBody;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type GetWorkoutV2Error = GetWorkoutV2Errors[keyof GetWorkoutV2Errors];
|
|
222
|
+
|
|
223
|
+
export type GetWorkoutV2Responses = {
|
|
224
|
+
/**
|
|
225
|
+
* OK
|
|
226
|
+
*/
|
|
227
|
+
200: WorkoutV2;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export type GetWorkoutV2Response = GetWorkoutV2Responses[keyof GetWorkoutV2Responses];
|
|
231
|
+
|
|
232
|
+
export type UpdateWorkoutV2Data = {
|
|
233
|
+
body: WorkoutV2;
|
|
234
|
+
path: {
|
|
235
|
+
workoutId: number;
|
|
236
|
+
};
|
|
237
|
+
query?: never;
|
|
238
|
+
url: '/training-api/workout/v2/{workoutId}';
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export type UpdateWorkoutV2Responses = {
|
|
242
|
+
/**
|
|
243
|
+
* No Content
|
|
244
|
+
*/
|
|
245
|
+
204: void;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export type UpdateWorkoutV2Response = UpdateWorkoutV2Responses[keyof UpdateWorkoutV2Responses];
|
|
249
|
+
|
|
250
|
+
export type CreateWorkoutV2Data = {
|
|
251
|
+
body: WorkoutV2;
|
|
252
|
+
path?: never;
|
|
253
|
+
query?: never;
|
|
254
|
+
url: '/workoutportal/workout/v2';
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export type CreateWorkoutV2Responses = {
|
|
258
|
+
/**
|
|
259
|
+
* OK
|
|
260
|
+
*/
|
|
261
|
+
200: WorkoutV2;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export type CreateWorkoutV2Response = CreateWorkoutV2Responses[keyof CreateWorkoutV2Responses];
|
|
265
|
+
|
|
266
|
+
export type CreateWorkoutData = {
|
|
267
|
+
body: Workout;
|
|
268
|
+
path?: never;
|
|
269
|
+
query?: never;
|
|
270
|
+
url: '/training-api/workout';
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export type CreateWorkoutResponses = {
|
|
274
|
+
/**
|
|
275
|
+
* OK
|
|
276
|
+
*/
|
|
277
|
+
200: Workout;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
export type CreateWorkoutResponse = CreateWorkoutResponses[keyof CreateWorkoutResponses];
|
|
281
|
+
|
|
282
|
+
export type DeleteWorkoutScheduleData = {
|
|
283
|
+
body?: never;
|
|
284
|
+
path: {
|
|
285
|
+
workoutScheduleId: number;
|
|
286
|
+
};
|
|
287
|
+
query?: never;
|
|
288
|
+
url: '/training-api/schedule/{workoutScheduleId}';
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export type DeleteWorkoutScheduleResponses = {
|
|
292
|
+
/**
|
|
293
|
+
* No Content
|
|
294
|
+
*/
|
|
295
|
+
204: void;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export type DeleteWorkoutScheduleResponse = DeleteWorkoutScheduleResponses[keyof DeleteWorkoutScheduleResponses];
|
|
299
|
+
|
|
300
|
+
export type GetWorkoutScheduleData = {
|
|
301
|
+
body?: never;
|
|
302
|
+
path: {
|
|
303
|
+
workoutScheduleId: number;
|
|
304
|
+
};
|
|
305
|
+
query?: never;
|
|
306
|
+
url: '/training-api/schedule/{workoutScheduleId}';
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export type GetWorkoutScheduleErrors = {
|
|
310
|
+
/**
|
|
311
|
+
* Forbidden
|
|
312
|
+
*/
|
|
313
|
+
403: ConnectErrorBody;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export type GetWorkoutScheduleError = GetWorkoutScheduleErrors[keyof GetWorkoutScheduleErrors];
|
|
317
|
+
|
|
318
|
+
export type GetWorkoutScheduleResponses = {
|
|
319
|
+
/**
|
|
320
|
+
* OK
|
|
321
|
+
*/
|
|
322
|
+
200: WorkoutSchedule;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export type GetWorkoutScheduleResponse = GetWorkoutScheduleResponses[keyof GetWorkoutScheduleResponses];
|
|
326
|
+
|
|
327
|
+
export type UpdateWorkoutScheduleData = {
|
|
328
|
+
body: WorkoutSchedule;
|
|
329
|
+
path: {
|
|
330
|
+
workoutScheduleId: number;
|
|
331
|
+
};
|
|
332
|
+
query?: never;
|
|
333
|
+
url: '/training-api/schedule/{workoutScheduleId}';
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export type UpdateWorkoutScheduleResponses = {
|
|
337
|
+
/**
|
|
338
|
+
* No Content
|
|
339
|
+
*/
|
|
340
|
+
204: void;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export type UpdateWorkoutScheduleResponse = UpdateWorkoutScheduleResponses[keyof UpdateWorkoutScheduleResponses];
|
|
344
|
+
|
|
345
|
+
export type QueryWorkoutScheduleByDatesData = {
|
|
346
|
+
body?: never;
|
|
347
|
+
path?: never;
|
|
348
|
+
query: {
|
|
349
|
+
startDate: string;
|
|
350
|
+
endDate: string;
|
|
351
|
+
};
|
|
352
|
+
url: '/training-api/schedule';
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export type QueryWorkoutScheduleByDatesErrors = {
|
|
356
|
+
/**
|
|
357
|
+
* Forbidden
|
|
358
|
+
*/
|
|
359
|
+
403: ConnectErrorBody;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
export type QueryWorkoutScheduleByDatesError = QueryWorkoutScheduleByDatesErrors[keyof QueryWorkoutScheduleByDatesErrors];
|
|
363
|
+
|
|
364
|
+
export type QueryWorkoutScheduleByDatesResponses = {
|
|
365
|
+
/**
|
|
366
|
+
* OK
|
|
367
|
+
*/
|
|
368
|
+
200: Array<WorkoutSchedule>;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
export type QueryWorkoutScheduleByDatesResponse = QueryWorkoutScheduleByDatesResponses[keyof QueryWorkoutScheduleByDatesResponses];
|
|
372
|
+
|
|
373
|
+
export type CreateWorkoutScheduleData = {
|
|
374
|
+
body: WorkoutSchedule;
|
|
375
|
+
path?: never;
|
|
376
|
+
query?: never;
|
|
377
|
+
url: '/training-api/schedule';
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export type CreateWorkoutScheduleResponses = {
|
|
381
|
+
/**
|
|
382
|
+
* OK
|
|
383
|
+
*/
|
|
384
|
+
200: number;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export type CreateWorkoutScheduleResponse = CreateWorkoutScheduleResponses[keyof CreateWorkoutScheduleResponses];
|