node-strava / node-strava-v3

API wrapper for Strava's v3 API, in Node
MIT License
356 stars 109 forks source link

Support creating/updating sport type of activity #132

Closed pro-sumer closed 1 year ago

pro-sumer commented 2 years ago

Strava recently introduced a new activity property sport_type of type SportType that can be used to indicate the sport type when creating or updating activities:

An enumeration of the sport types an activity may have. Distinct from ActivityType in that it has new types (e.g. MountainBikeRide)

May be one of the following values: AlpineSki, BackcountrySki, Canoeing, Crossfit, EBikeRide, Elliptical, EMountainBikeRide, Golf, GravelRide, Handcycle, Hike, IceSkate, InlineSkate, Kayaking, Kitesurf, MountainBikeRide, NordicSki, Ride, RockClimbing, RollerSki, Rowing, Run, Sail, Skateboard, Snowboard, Snowshoe, Soccer, StairStepper, StandUpPaddling, Surfing, Swim, TrailRun, Velomobile, VirtualRide, VirtualRun, Walk, WeightTraining, Wheelchair, Windsurf, Workout, Yoga

Test note: I have added a test case for testing updating a sport type, but I have not executed the test suite... (I don't want to risk the data in my Strava account nor the account itself). However, I did successfully update all (several hundreds) previously recorded rides on my MTB bikes to have the new sport type MountainBikeRide. I verified random samples (checked that its icon is now a bike with a mountain on top and that the ride is listed as a "Mountain Bike Ride").

Fixes #130

markstos commented 1 year ago

Thanks. Release today in v2.2.0.