@nativesquare/soma 0.5.0 → 0.7.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 +151 -53
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +162 -69
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +130 -17
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/garmin.d.ts +61 -43
- package/dist/component/garmin.d.ts.map +1 -1
- package/dist/component/garmin.js +208 -122
- package/dist/component/garmin.js.map +1 -1
- package/dist/component/public.d.ts +363 -0
- package/dist/component/public.d.ts.map +1 -1
- package/dist/component/public.js +124 -0
- package/dist/component/public.js.map +1 -1
- package/dist/component/schema.d.ts +7 -9
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +9 -10
- package/dist/component/schema.js.map +1 -1
- package/dist/component/strava.d.ts +0 -1
- package/dist/component/strava.d.ts.map +1 -1
- package/dist/component/strava.js +0 -1
- package/dist/component/strava.js.map +1 -1
- package/dist/component/validators/enums.d.ts +1 -1
- package/dist/garmin/auth.d.ts +55 -46
- package/dist/garmin/auth.d.ts.map +1 -1
- package/dist/garmin/auth.js +82 -122
- package/dist/garmin/auth.js.map +1 -1
- package/dist/garmin/client.d.ts +64 -17
- package/dist/garmin/client.d.ts.map +1 -1
- package/dist/garmin/client.js +143 -29
- package/dist/garmin/client.js.map +1 -1
- package/dist/garmin/index.d.ts +3 -3
- package/dist/garmin/index.d.ts.map +1 -1
- package/dist/garmin/index.js +4 -4
- package/dist/garmin/index.js.map +1 -1
- package/dist/garmin/plannedWorkout.d.ts +12 -0
- package/dist/garmin/plannedWorkout.d.ts.map +1 -0
- package/dist/garmin/plannedWorkout.js +267 -0
- package/dist/garmin/plannedWorkout.js.map +1 -0
- package/dist/garmin/types.d.ts +78 -6
- package/dist/garmin/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +236 -85
- package/src/component/_generated/component.ts +155 -17
- package/src/component/garmin.ts +258 -124
- package/src/component/public.ts +135 -0
- package/src/component/schema.ts +9 -10
- package/src/component/strava.ts +0 -1
- package/src/garmin/auth.test.ts +71 -96
- package/src/garmin/auth.ts +129 -193
- package/src/garmin/client.ts +197 -51
- package/src/garmin/index.ts +13 -14
- package/src/garmin/plannedWorkout.ts +333 -0
- package/src/garmin/types.ts +149 -7
package/src/garmin/types.ts
CHANGED
|
@@ -314,16 +314,158 @@ export type GarminActivityType =
|
|
|
314
314
|
| "FITNESS_EQUIPMENT"
|
|
315
315
|
| (string & {});
|
|
316
316
|
|
|
317
|
-
// ─── OAuth
|
|
317
|
+
// ─── OAuth 2.0 ──────────────────────────────────────────────────────────────
|
|
318
|
+
|
|
319
|
+
export interface GarminOAuth2TokenResponse {
|
|
320
|
+
access_token: string;
|
|
321
|
+
refresh_token: string;
|
|
322
|
+
expires_in: number;
|
|
323
|
+
token_type: string;
|
|
324
|
+
scope: string;
|
|
325
|
+
refresh_token_expires_in: number;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// ─── Training API V2 Types ──────────────────────────────────────────────────
|
|
329
|
+
// Types for the Garmin Connect Training API V2 (workout import/scheduling).
|
|
330
|
+
|
|
331
|
+
export type GarminWorkoutSport =
|
|
332
|
+
| "RUNNING"
|
|
333
|
+
| "CYCLING"
|
|
334
|
+
| "LAP_SWIMMING"
|
|
335
|
+
| "STRENGTH_TRAINING"
|
|
336
|
+
| "CARDIO_TRAINING"
|
|
337
|
+
| "GENERIC"
|
|
338
|
+
| "YOGA"
|
|
339
|
+
| "PILATES"
|
|
340
|
+
| "MULTI_SPORT"
|
|
341
|
+
| (string & {});
|
|
342
|
+
|
|
343
|
+
export type GarminStepIntensity =
|
|
344
|
+
| "REST"
|
|
345
|
+
| "WARMUP"
|
|
346
|
+
| "COOLDOWN"
|
|
347
|
+
| "RECOVERY"
|
|
348
|
+
| "ACTIVE"
|
|
349
|
+
| "INTERVAL"
|
|
350
|
+
| "MAIN"
|
|
351
|
+
| (string & {});
|
|
352
|
+
|
|
353
|
+
export type GarminDurationType =
|
|
354
|
+
| "TIME"
|
|
355
|
+
| "DISTANCE"
|
|
356
|
+
| "HR_LESS_THAN"
|
|
357
|
+
| "HR_GREATER_THAN"
|
|
358
|
+
| "CALORIES"
|
|
359
|
+
| "OPEN"
|
|
360
|
+
| "POWER_LESS_THAN"
|
|
361
|
+
| "POWER_GREATER_THAN"
|
|
362
|
+
| "TIME_AT_VALID_CDA"
|
|
363
|
+
| "FIXED_REST"
|
|
364
|
+
| "REPS"
|
|
365
|
+
| "FIXED_REPETITION"
|
|
366
|
+
| "REPETITION_SWIM_CSS_OFFSET"
|
|
367
|
+
| (string & {});
|
|
368
|
+
|
|
369
|
+
export type GarminTargetType =
|
|
370
|
+
| "SPEED"
|
|
371
|
+
| "HEART_RATE"
|
|
372
|
+
| "CADENCE"
|
|
373
|
+
| "POWER"
|
|
374
|
+
| "GRADE"
|
|
375
|
+
| "RESISTANCE"
|
|
376
|
+
| "POWER_3S"
|
|
377
|
+
| "POWER_10S"
|
|
378
|
+
| "POWER_30S"
|
|
379
|
+
| "POWER_LAP"
|
|
380
|
+
| "SPEED_LAP"
|
|
381
|
+
| "HEART_RATE_LAP"
|
|
382
|
+
| "OPEN"
|
|
383
|
+
| "PACE"
|
|
384
|
+
| (string & {});
|
|
385
|
+
|
|
386
|
+
export type GarminRepeatType =
|
|
387
|
+
| "REPEAT_UNTIL_STEPS_CMPLT"
|
|
388
|
+
| "REPEAT_UNTIL_TIME"
|
|
389
|
+
| "REPEAT_UNTIL_DISTANCE"
|
|
390
|
+
| "REPEAT_UNTIL_CALORIES"
|
|
391
|
+
| "REPEAT_UNTIL_HR_LESS_THAN"
|
|
392
|
+
| "REPEAT_UNTIL_HR_GREATER_THAN"
|
|
393
|
+
| "REPEAT_UNTIL_POWER_LESS_THAN"
|
|
394
|
+
| "REPEAT_UNTIL_POWER_GREATER_THAN"
|
|
395
|
+
| "REPEAT_UNTIL_POWER_LAST_LAP_LESS_THAN"
|
|
396
|
+
| "REPEAT_UNTIL_MAX_POWER_LAST_LAP_LESS_THAN"
|
|
397
|
+
| (string & {});
|
|
398
|
+
|
|
399
|
+
export interface GarminWorkoutStep {
|
|
400
|
+
type: "WorkoutStep";
|
|
401
|
+
stepId?: number;
|
|
402
|
+
stepOrder: number;
|
|
403
|
+
intensity: GarminStepIntensity;
|
|
404
|
+
description?: string | null;
|
|
405
|
+
durationType: GarminDurationType;
|
|
406
|
+
durationValue?: number | null;
|
|
407
|
+
durationValueType?: string | null;
|
|
408
|
+
targetType?: GarminTargetType | null;
|
|
409
|
+
targetValue?: number | null;
|
|
410
|
+
targetValueLow?: number | null;
|
|
411
|
+
targetValueHigh?: number | null;
|
|
412
|
+
targetValueType?: string | null;
|
|
413
|
+
secondaryTargetType?: string | null;
|
|
414
|
+
secondaryTargetValue?: number | null;
|
|
415
|
+
secondaryTargetValueLow?: number | null;
|
|
416
|
+
secondaryTargetValueHigh?: number | null;
|
|
417
|
+
secondaryTargetValueType?: string | null;
|
|
418
|
+
strokeType?: string | null;
|
|
419
|
+
drillType?: string | null;
|
|
420
|
+
equipmentType?: string | null;
|
|
421
|
+
exerciseCategory?: string | null;
|
|
422
|
+
exerciseName?: string | null;
|
|
423
|
+
weightValue?: number | null;
|
|
424
|
+
weightDisplayUnit?: string | null;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export interface GarminWorkoutRepeatStep {
|
|
428
|
+
type: "WorkoutRepeatStep";
|
|
429
|
+
stepId?: number;
|
|
430
|
+
stepOrder: number;
|
|
431
|
+
repeatType: GarminRepeatType;
|
|
432
|
+
repeatValue: number;
|
|
433
|
+
skipLastRestStep?: boolean;
|
|
434
|
+
steps: Array<GarminWorkoutStep | GarminWorkoutRepeatStep>;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export interface GarminWorkoutSegment {
|
|
438
|
+
segmentOrder: number;
|
|
439
|
+
sport: GarminWorkoutSport;
|
|
440
|
+
poolLength?: number | null;
|
|
441
|
+
poolLengthUnit?: string | null;
|
|
442
|
+
estimatedDurationInSecs?: number | null;
|
|
443
|
+
estimatedDistanceInMeters?: number | null;
|
|
444
|
+
steps: Array<GarminWorkoutStep | GarminWorkoutRepeatStep>;
|
|
445
|
+
}
|
|
318
446
|
|
|
319
|
-
export interface
|
|
320
|
-
|
|
321
|
-
|
|
447
|
+
export interface GarminWorkout {
|
|
448
|
+
workoutId?: number;
|
|
449
|
+
ownerId?: number | null;
|
|
450
|
+
workoutName: string;
|
|
451
|
+
description?: string | null;
|
|
452
|
+
updatedDate?: string;
|
|
453
|
+
createdDate?: string;
|
|
454
|
+
sport: GarminWorkoutSport;
|
|
455
|
+
estimatedDurationInSecs?: number | null;
|
|
456
|
+
estimatedDistanceInMeters?: number | null;
|
|
457
|
+
poolLength?: number | null;
|
|
458
|
+
poolLengthUnit?: string | null;
|
|
459
|
+
workoutProvider: string;
|
|
460
|
+
workoutSourceId: string;
|
|
461
|
+
isSessionTransitionEnabled?: boolean;
|
|
462
|
+
segments: GarminWorkoutSegment[];
|
|
322
463
|
}
|
|
323
464
|
|
|
324
|
-
export interface
|
|
325
|
-
|
|
326
|
-
|
|
465
|
+
export interface GarminWorkoutSchedule {
|
|
466
|
+
scheduleId?: number;
|
|
467
|
+
workoutId: number;
|
|
468
|
+
date: string;
|
|
327
469
|
}
|
|
328
470
|
|
|
329
471
|
// ─── API Response Wrappers ──────────────────────────────────────────────────
|