@sports-alliance/sports-lib 7.0.12 → 7.1.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/check-metrics.js +30 -0
- package/find-values.js +33 -0
- package/inspect-devices.js +21 -0
- package/inspect-session.js +27 -0
- package/lib/cjs/activities/devices/device.d.ts +1 -0
- package/lib/cjs/activities/devices/device.interface.d.ts +1 -0
- package/lib/cjs/activities/devices/device.js +1 -0
- package/lib/cjs/activities/devices/device.json.interface.d.ts +1 -0
- package/lib/cjs/data/data.age.d.ts +6 -0
- package/lib/cjs/data/data.age.js +12 -0
- package/lib/cjs/data/data.avg-flow.d.ts +5 -0
- package/lib/cjs/data/data.avg-flow.js +9 -0
- package/lib/cjs/data/data.avg-grit.d.ts +5 -0
- package/lib/cjs/data/data.avg-grit.js +9 -0
- package/lib/cjs/data/data.avg-respiration-rate.d.ts +5 -0
- package/lib/cjs/data/data.avg-respiration-rate.js +9 -0
- package/lib/cjs/data/data.avg-vam.d.ts +5 -0
- package/lib/cjs/data/data.avg-vam.js +9 -0
- package/lib/cjs/data/data.est-sweat-loss.d.ts +6 -0
- package/lib/cjs/data/data.est-sweat-loss.js +12 -0
- package/lib/cjs/data/data.flow.d.ts +5 -0
- package/lib/cjs/data/data.flow.js +9 -0
- package/lib/cjs/data/data.gender.d.ts +4 -0
- package/lib/cjs/data/data.gender.js +8 -0
- package/lib/cjs/data/data.grit.d.ts +5 -0
- package/lib/cjs/data/data.grit.js +9 -0
- package/lib/cjs/data/data.height.d.ts +6 -0
- package/lib/cjs/data/data.height.js +12 -0
- package/lib/cjs/data/data.jump-count.d.ts +6 -0
- package/lib/cjs/data/data.jump-count.js +12 -0
- package/lib/cjs/data/data.jump-event.d.ts +12 -0
- package/lib/cjs/data/data.jump-event.js +16 -0
- package/lib/cjs/data/data.left-pedal-smoothness.d.ts +6 -0
- package/lib/cjs/data/data.left-pedal-smoothness.js +12 -0
- package/lib/cjs/data/data.left-torque-effectiveness.d.ts +6 -0
- package/lib/cjs/data/data.left-torque-effectiveness.js +12 -0
- package/lib/cjs/data/data.max-respiration-rate.d.ts +5 -0
- package/lib/cjs/data/data.max-respiration-rate.js +9 -0
- package/lib/cjs/data/data.min-respiration-rate.d.ts +5 -0
- package/lib/cjs/data/data.min-respiration-rate.js +9 -0
- package/lib/cjs/data/data.primary-benefit.d.ts +6 -0
- package/lib/cjs/data/data.primary-benefit.js +12 -0
- package/lib/cjs/data/data.resting-calories.d.ts +5 -0
- package/lib/cjs/data/data.resting-calories.js +9 -0
- package/lib/cjs/data/data.right-pedal-smoothness.d.ts +6 -0
- package/lib/cjs/data/data.right-pedal-smoothness.js +12 -0
- package/lib/cjs/data/data.right-torque-effectiveness.d.ts +6 -0
- package/lib/cjs/data/data.right-torque-effectiveness.js +12 -0
- package/lib/cjs/data/data.store.js +54 -2
- package/lib/cjs/data/data.total-flow.d.ts +5 -0
- package/lib/cjs/data/data.total-flow.js +9 -0
- package/lib/cjs/data/data.total-grit.d.ts +5 -0
- package/lib/cjs/data/data.total-grit.js +9 -0
- package/lib/cjs/data/data.training-load-peak.d.ts +5 -0
- package/lib/cjs/data/data.training-load-peak.js +9 -0
- package/lib/cjs/data/data.weight.d.ts +6 -0
- package/lib/cjs/data/data.weight.js +12 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.d.ts +3 -1
- package/lib/cjs/events/adapters/importers/fit/importer.fit.js +209 -1
- package/lib/cjs/events/adapters/importers/fit/importer.fit.mapper.js +42 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.mtb.spec.d.ts +1 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.mtb.spec.js +217 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.road.spec.d.ts +1 -0
- package/lib/cjs/events/adapters/importers/fit/importer.fit.road.spec.js +103 -0
- package/lib/cjs/geodesy/adapters/geolib.adapter.js +4 -9
- package/lib/cjs/index.d.ts +4 -0
- package/lib/cjs/index.js +4 -0
- package/lib/esm/activities/devices/device.d.ts +1 -0
- package/lib/esm/activities/devices/device.interface.d.ts +1 -0
- package/lib/esm/activities/devices/device.json.interface.d.ts +1 -0
- package/lib/esm/data/data.age.d.ts +6 -0
- package/lib/esm/data/data.avg-flow.d.ts +5 -0
- package/lib/esm/data/data.avg-grit.d.ts +5 -0
- package/lib/esm/data/data.avg-respiration-rate.d.ts +5 -0
- package/lib/esm/data/data.avg-vam.d.ts +5 -0
- package/lib/esm/data/data.est-sweat-loss.d.ts +6 -0
- package/lib/esm/data/data.flow.d.ts +5 -0
- package/lib/esm/data/data.gender.d.ts +4 -0
- package/lib/esm/data/data.grit.d.ts +5 -0
- package/lib/esm/data/data.height.d.ts +6 -0
- package/lib/esm/data/data.jump-count.d.ts +6 -0
- package/lib/esm/data/data.jump-event.d.ts +12 -0
- package/lib/esm/data/data.left-pedal-smoothness.d.ts +6 -0
- package/lib/esm/data/data.left-torque-effectiveness.d.ts +6 -0
- package/lib/esm/data/data.max-respiration-rate.d.ts +5 -0
- package/lib/esm/data/data.min-respiration-rate.d.ts +5 -0
- package/lib/esm/data/data.primary-benefit.d.ts +6 -0
- package/lib/esm/data/data.resting-calories.d.ts +5 -0
- package/lib/esm/data/data.right-pedal-smoothness.d.ts +6 -0
- package/lib/esm/data/data.right-torque-effectiveness.d.ts +6 -0
- package/lib/esm/data/data.total-flow.d.ts +5 -0
- package/lib/esm/data/data.total-grit.d.ts +5 -0
- package/lib/esm/data/data.training-load-peak.d.ts +5 -0
- package/lib/esm/data/data.weight.d.ts +6 -0
- package/lib/esm/events/adapters/importers/fit/importer.fit.d.ts +3 -1
- package/lib/esm/events/adapters/importers/fit/importer.fit.mtb.spec.d.ts +1 -0
- package/lib/esm/events/adapters/importers/fit/importer.fit.road.spec.d.ts +1 -0
- package/lib/esm/index.d.ts +4 -0
- package/lib/esm/index.js +515 -6
- package/package.json +2 -2
package/lib/esm/index.js
CHANGED
|
@@ -3739,6 +3739,281 @@ var DataGradeSmooth = class extends DataPercent {
|
|
|
3739
3739
|
}
|
|
3740
3740
|
};
|
|
3741
3741
|
|
|
3742
|
+
// src/data/data.weight.ts
|
|
3743
|
+
var DataWeight = class extends DataNumber {
|
|
3744
|
+
static {
|
|
3745
|
+
this.type = "Weight";
|
|
3746
|
+
}
|
|
3747
|
+
static {
|
|
3748
|
+
this.unit = "kg";
|
|
3749
|
+
}
|
|
3750
|
+
getDisplayValue() {
|
|
3751
|
+
return this.getValue().toFixed(1);
|
|
3752
|
+
}
|
|
3753
|
+
};
|
|
3754
|
+
|
|
3755
|
+
// src/data/data.height.ts
|
|
3756
|
+
var DataHeight = class extends DataNumber {
|
|
3757
|
+
static {
|
|
3758
|
+
this.type = "Height";
|
|
3759
|
+
}
|
|
3760
|
+
static {
|
|
3761
|
+
this.unit = "m";
|
|
3762
|
+
}
|
|
3763
|
+
getDisplayValue() {
|
|
3764
|
+
return this.getValue().toFixed(2);
|
|
3765
|
+
}
|
|
3766
|
+
};
|
|
3767
|
+
|
|
3768
|
+
// src/data/data.age.ts
|
|
3769
|
+
var DataAge = class extends DataNumber {
|
|
3770
|
+
static {
|
|
3771
|
+
this.type = "Age";
|
|
3772
|
+
}
|
|
3773
|
+
static {
|
|
3774
|
+
this.unit = "years";
|
|
3775
|
+
}
|
|
3776
|
+
getDisplayValue() {
|
|
3777
|
+
return this.getValue().toString();
|
|
3778
|
+
}
|
|
3779
|
+
};
|
|
3780
|
+
|
|
3781
|
+
// src/data/data.gender.ts
|
|
3782
|
+
var DataGender = class extends DataString {
|
|
3783
|
+
static {
|
|
3784
|
+
this.type = "Gender";
|
|
3785
|
+
}
|
|
3786
|
+
};
|
|
3787
|
+
|
|
3788
|
+
// src/data/data.avg-flow.ts
|
|
3789
|
+
var DataAvgFlow = class extends DataNumber {
|
|
3790
|
+
static {
|
|
3791
|
+
this.type = "Avg Flow";
|
|
3792
|
+
}
|
|
3793
|
+
static {
|
|
3794
|
+
this.unit = "";
|
|
3795
|
+
}
|
|
3796
|
+
};
|
|
3797
|
+
|
|
3798
|
+
// src/data/data.avg-grit.ts
|
|
3799
|
+
var DataAvgGrit = class extends DataNumber {
|
|
3800
|
+
static {
|
|
3801
|
+
this.type = "Avg Grit";
|
|
3802
|
+
}
|
|
3803
|
+
static {
|
|
3804
|
+
this.unit = "";
|
|
3805
|
+
}
|
|
3806
|
+
};
|
|
3807
|
+
|
|
3808
|
+
// src/data/data.avg-respiration-rate.ts
|
|
3809
|
+
var DataAvgRespirationRate = class extends DataNumber {
|
|
3810
|
+
static {
|
|
3811
|
+
this.type = "Avg Respiration Rate";
|
|
3812
|
+
}
|
|
3813
|
+
static {
|
|
3814
|
+
this.unit = "br/min";
|
|
3815
|
+
}
|
|
3816
|
+
};
|
|
3817
|
+
|
|
3818
|
+
// src/data/data.avg-vam.ts
|
|
3819
|
+
var DataAvgVAM = class extends DataNumber {
|
|
3820
|
+
static {
|
|
3821
|
+
this.type = "Avg VAM";
|
|
3822
|
+
}
|
|
3823
|
+
static {
|
|
3824
|
+
this.unit = "m/h";
|
|
3825
|
+
}
|
|
3826
|
+
};
|
|
3827
|
+
|
|
3828
|
+
// src/data/data.est-sweat-loss.ts
|
|
3829
|
+
var DataEstSweatLoss = class extends DataNumber {
|
|
3830
|
+
static {
|
|
3831
|
+
this.type = "Est Sweat Loss";
|
|
3832
|
+
}
|
|
3833
|
+
static {
|
|
3834
|
+
this.unit = "ml";
|
|
3835
|
+
}
|
|
3836
|
+
constructor(value) {
|
|
3837
|
+
super(value);
|
|
3838
|
+
}
|
|
3839
|
+
};
|
|
3840
|
+
|
|
3841
|
+
// src/data/data.flow.ts
|
|
3842
|
+
var DataFlow = class extends DataNumber {
|
|
3843
|
+
static {
|
|
3844
|
+
this.type = "Flow";
|
|
3845
|
+
}
|
|
3846
|
+
static {
|
|
3847
|
+
this.unit = "";
|
|
3848
|
+
}
|
|
3849
|
+
};
|
|
3850
|
+
|
|
3851
|
+
// src/data/data.grit.ts
|
|
3852
|
+
var DataGrit = class extends DataNumber {
|
|
3853
|
+
static {
|
|
3854
|
+
this.type = "Grit";
|
|
3855
|
+
}
|
|
3856
|
+
static {
|
|
3857
|
+
this.unit = "";
|
|
3858
|
+
}
|
|
3859
|
+
};
|
|
3860
|
+
|
|
3861
|
+
// src/data/data.jump-count.ts
|
|
3862
|
+
var DataJumpCount = class extends DataNumber {
|
|
3863
|
+
static {
|
|
3864
|
+
this.type = "Jump Count";
|
|
3865
|
+
}
|
|
3866
|
+
static {
|
|
3867
|
+
this.unit = "";
|
|
3868
|
+
}
|
|
3869
|
+
constructor(jumpCount) {
|
|
3870
|
+
super(jumpCount);
|
|
3871
|
+
}
|
|
3872
|
+
};
|
|
3873
|
+
|
|
3874
|
+
// src/data/data.jump-event.ts
|
|
3875
|
+
var DataJumpEvent = class extends DataEvent {
|
|
3876
|
+
constructor(timestamp, jumpData) {
|
|
3877
|
+
super(timestamp);
|
|
3878
|
+
this.jumpData = jumpData;
|
|
3879
|
+
}
|
|
3880
|
+
static {
|
|
3881
|
+
this.type = "Jump Event";
|
|
3882
|
+
}
|
|
3883
|
+
toJSON() {
|
|
3884
|
+
const json = super.toJSON();
|
|
3885
|
+
return {
|
|
3886
|
+
...json,
|
|
3887
|
+
jumpData: this.jumpData
|
|
3888
|
+
};
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
|
|
3892
|
+
// src/data/data.left-pedal-smoothness.ts
|
|
3893
|
+
var DataLeftPedalSmoothness = class extends DataNumber {
|
|
3894
|
+
static {
|
|
3895
|
+
this.type = "Left Pedal Smoothness";
|
|
3896
|
+
}
|
|
3897
|
+
static {
|
|
3898
|
+
this.unit = "%";
|
|
3899
|
+
}
|
|
3900
|
+
getDisplayValue() {
|
|
3901
|
+
return Math.round(this.getValue());
|
|
3902
|
+
}
|
|
3903
|
+
};
|
|
3904
|
+
|
|
3905
|
+
// src/data/data.left-torque-effectiveness.ts
|
|
3906
|
+
var DataLeftTorqueEffectiveness = class extends DataNumber {
|
|
3907
|
+
static {
|
|
3908
|
+
this.type = "Left Torque Effectiveness";
|
|
3909
|
+
}
|
|
3910
|
+
static {
|
|
3911
|
+
this.unit = "%";
|
|
3912
|
+
}
|
|
3913
|
+
getDisplayValue() {
|
|
3914
|
+
return Math.round(this.getValue());
|
|
3915
|
+
}
|
|
3916
|
+
};
|
|
3917
|
+
|
|
3918
|
+
// src/data/data.max-respiration-rate.ts
|
|
3919
|
+
var DataMaxRespirationRate = class extends DataNumber {
|
|
3920
|
+
static {
|
|
3921
|
+
this.type = "Max Respiration Rate";
|
|
3922
|
+
}
|
|
3923
|
+
static {
|
|
3924
|
+
this.unit = "br/min";
|
|
3925
|
+
}
|
|
3926
|
+
};
|
|
3927
|
+
|
|
3928
|
+
// src/data/data.min-respiration-rate.ts
|
|
3929
|
+
var DataMinRespirationRate = class extends DataNumber {
|
|
3930
|
+
static {
|
|
3931
|
+
this.type = "Min Respiration Rate";
|
|
3932
|
+
}
|
|
3933
|
+
static {
|
|
3934
|
+
this.unit = "br/min";
|
|
3935
|
+
}
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3938
|
+
// src/data/data.primary-benefit.ts
|
|
3939
|
+
var DataPrimaryBenefit = class extends DataNumber {
|
|
3940
|
+
static {
|
|
3941
|
+
this.type = "Primary Benefit";
|
|
3942
|
+
}
|
|
3943
|
+
static {
|
|
3944
|
+
this.unit = "";
|
|
3945
|
+
}
|
|
3946
|
+
constructor(value) {
|
|
3947
|
+
super(value);
|
|
3948
|
+
}
|
|
3949
|
+
};
|
|
3950
|
+
|
|
3951
|
+
// src/data/data.resting-calories.ts
|
|
3952
|
+
var DataRestingCalories = class extends DataNumber {
|
|
3953
|
+
static {
|
|
3954
|
+
this.type = "Resting Calories";
|
|
3955
|
+
}
|
|
3956
|
+
static {
|
|
3957
|
+
this.unit = "kcal";
|
|
3958
|
+
}
|
|
3959
|
+
};
|
|
3960
|
+
|
|
3961
|
+
// src/data/data.right-pedal-smoothness.ts
|
|
3962
|
+
var DataRightPedalSmoothness = class extends DataNumber {
|
|
3963
|
+
static {
|
|
3964
|
+
this.type = "Right Pedal Smoothness";
|
|
3965
|
+
}
|
|
3966
|
+
static {
|
|
3967
|
+
this.unit = "%";
|
|
3968
|
+
}
|
|
3969
|
+
getDisplayValue() {
|
|
3970
|
+
return Math.round(this.getValue());
|
|
3971
|
+
}
|
|
3972
|
+
};
|
|
3973
|
+
|
|
3974
|
+
// src/data/data.right-torque-effectiveness.ts
|
|
3975
|
+
var DataRightTorqueEffectiveness = class extends DataNumber {
|
|
3976
|
+
static {
|
|
3977
|
+
this.type = "Right Torque Effectiveness";
|
|
3978
|
+
}
|
|
3979
|
+
static {
|
|
3980
|
+
this.unit = "%";
|
|
3981
|
+
}
|
|
3982
|
+
getDisplayValue() {
|
|
3983
|
+
return Math.round(this.getValue());
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3986
|
+
|
|
3987
|
+
// src/data/data.total-flow.ts
|
|
3988
|
+
var DataTotalFlow = class extends DataNumber {
|
|
3989
|
+
static {
|
|
3990
|
+
this.type = "Total Flow";
|
|
3991
|
+
}
|
|
3992
|
+
static {
|
|
3993
|
+
this.unit = "";
|
|
3994
|
+
}
|
|
3995
|
+
};
|
|
3996
|
+
|
|
3997
|
+
// src/data/data.total-grit.ts
|
|
3998
|
+
var DataTotalGrit = class extends DataNumber {
|
|
3999
|
+
static {
|
|
4000
|
+
this.type = "Total Grit";
|
|
4001
|
+
}
|
|
4002
|
+
static {
|
|
4003
|
+
this.unit = "";
|
|
4004
|
+
}
|
|
4005
|
+
};
|
|
4006
|
+
|
|
4007
|
+
// src/data/data.training-load-peak.ts
|
|
4008
|
+
var DataTrainingLoadPeak = class extends DataNumber {
|
|
4009
|
+
static {
|
|
4010
|
+
this.type = "Training Load Peak";
|
|
4011
|
+
}
|
|
4012
|
+
static {
|
|
4013
|
+
this.unit = "";
|
|
4014
|
+
}
|
|
4015
|
+
};
|
|
4016
|
+
|
|
3742
4017
|
// src/data/data.store.ts
|
|
3743
4018
|
var DataTotalTrainingEffectLegacy = class extends DataAerobicTrainingEffect {
|
|
3744
4019
|
static {
|
|
@@ -4010,7 +4285,31 @@ var DataStore = {
|
|
|
4010
4285
|
DataTargetSpeedZone,
|
|
4011
4286
|
DataTargetDistance,
|
|
4012
4287
|
DataTargetTime,
|
|
4013
|
-
DataTotalTrainingEffectLegacy
|
|
4288
|
+
DataTotalTrainingEffectLegacy,
|
|
4289
|
+
DataWeight,
|
|
4290
|
+
DataHeight,
|
|
4291
|
+
DataAge,
|
|
4292
|
+
DataGender,
|
|
4293
|
+
DataAvgFlow,
|
|
4294
|
+
DataAvgGrit,
|
|
4295
|
+
DataAvgRespirationRate,
|
|
4296
|
+
DataAvgVAM,
|
|
4297
|
+
DataEstSweatLoss,
|
|
4298
|
+
DataFlow,
|
|
4299
|
+
DataGrit,
|
|
4300
|
+
DataJumpCount,
|
|
4301
|
+
DataJumpEvent,
|
|
4302
|
+
DataLeftPedalSmoothness,
|
|
4303
|
+
DataLeftTorqueEffectiveness,
|
|
4304
|
+
DataMaxRespirationRate,
|
|
4305
|
+
DataMinRespirationRate,
|
|
4306
|
+
DataPrimaryBenefit,
|
|
4307
|
+
DataRestingCalories,
|
|
4308
|
+
DataRightPedalSmoothness,
|
|
4309
|
+
DataRightTorqueEffectiveness,
|
|
4310
|
+
DataTotalFlow,
|
|
4311
|
+
DataTotalGrit,
|
|
4312
|
+
DataTrainingLoadPeak
|
|
4014
4313
|
};
|
|
4015
4314
|
var DynamicDataLoader = class _DynamicDataLoader {
|
|
4016
4315
|
static {
|
|
@@ -4029,7 +4328,11 @@ var DynamicDataLoader = class _DynamicDataLoader {
|
|
|
4029
4328
|
DataPace.type,
|
|
4030
4329
|
DataGradeAdjustedSpeed.type,
|
|
4031
4330
|
DataGradeAdjustedPace.type,
|
|
4032
|
-
DataSpeed.type
|
|
4331
|
+
DataSpeed.type,
|
|
4332
|
+
DataWeight.type,
|
|
4333
|
+
DataHeight.type,
|
|
4334
|
+
DataAge.type,
|
|
4335
|
+
DataGender.type
|
|
4033
4336
|
];
|
|
4034
4337
|
}
|
|
4035
4338
|
static {
|
|
@@ -4874,9 +5177,7 @@ var Stream = class {
|
|
|
4874
5177
|
};
|
|
4875
5178
|
|
|
4876
5179
|
// src/geodesy/adapters/geolib.adapter.ts
|
|
4877
|
-
import getPreciseDistance from "geolib
|
|
4878
|
-
import getDistance from "geolib/es/getDistance";
|
|
4879
|
-
import findNearest from "geolib/es/findNearest";
|
|
5180
|
+
import { getPreciseDistance, getDistance, findNearest } from "geolib";
|
|
4880
5181
|
var GeoLibAdapter = class {
|
|
4881
5182
|
constructor() {
|
|
4882
5183
|
this.findNearest = findNearest;
|
|
@@ -9323,6 +9624,42 @@ var FITSampleMapper = [
|
|
|
9323
9624
|
getSampleValue: (sample) => {
|
|
9324
9625
|
return sample.vertical_ratio;
|
|
9325
9626
|
}
|
|
9627
|
+
},
|
|
9628
|
+
{
|
|
9629
|
+
dataType: DataGrit.type,
|
|
9630
|
+
getSampleValue: (sample) => {
|
|
9631
|
+
return sample.grit;
|
|
9632
|
+
}
|
|
9633
|
+
},
|
|
9634
|
+
{
|
|
9635
|
+
dataType: DataFlow.type,
|
|
9636
|
+
getSampleValue: (sample) => {
|
|
9637
|
+
return sample.flow;
|
|
9638
|
+
}
|
|
9639
|
+
},
|
|
9640
|
+
{
|
|
9641
|
+
dataType: DataLeftTorqueEffectiveness.type,
|
|
9642
|
+
getSampleValue: (sample) => {
|
|
9643
|
+
return sample.left_torque_effectiveness;
|
|
9644
|
+
}
|
|
9645
|
+
},
|
|
9646
|
+
{
|
|
9647
|
+
dataType: DataRightTorqueEffectiveness.type,
|
|
9648
|
+
getSampleValue: (sample) => {
|
|
9649
|
+
return sample.right_torque_effectiveness;
|
|
9650
|
+
}
|
|
9651
|
+
},
|
|
9652
|
+
{
|
|
9653
|
+
dataType: DataLeftPedalSmoothness.type,
|
|
9654
|
+
getSampleValue: (sample) => {
|
|
9655
|
+
return sample.left_pedal_smoothness;
|
|
9656
|
+
}
|
|
9657
|
+
},
|
|
9658
|
+
{
|
|
9659
|
+
dataType: DataRightPedalSmoothness.type,
|
|
9660
|
+
getSampleValue: (sample) => {
|
|
9661
|
+
return sample.right_pedal_smoothness;
|
|
9662
|
+
}
|
|
9326
9663
|
}
|
|
9327
9664
|
];
|
|
9328
9665
|
|
|
@@ -9388,6 +9725,7 @@ var Device = class {
|
|
|
9388
9725
|
antTransmissionType: this.antTransmissionType || null,
|
|
9389
9726
|
antNetwork: this.antNetwork || null,
|
|
9390
9727
|
sourceType: this.sourceType || null,
|
|
9728
|
+
antId: this.antId || null,
|
|
9391
9729
|
cumOperatingTime: this.cumOperatingTime || null
|
|
9392
9730
|
};
|
|
9393
9731
|
}
|
|
@@ -9655,6 +9993,21 @@ var EventImporterFIT = class {
|
|
|
9655
9993
|
}
|
|
9656
9994
|
}
|
|
9657
9995
|
});
|
|
9996
|
+
if (fitDataObject.jumps && fitDataObject.jumps.length) {
|
|
9997
|
+
fitDataObject.jumps.filter((jump) => {
|
|
9998
|
+
const timestamp = new Date(jump.timestamp);
|
|
9999
|
+
const margin = 24 * 60 * 60 * 1e3;
|
|
10000
|
+
return timestamp.getTime() >= activity.startDate.getTime() - margin && timestamp.getTime() <= activity.endDate.getTime() + margin;
|
|
10001
|
+
}).forEach((jump) => {
|
|
10002
|
+
activity.addEvent(
|
|
10003
|
+
new DataJumpEvent(activity.getDateIndex(jump.timestamp), {
|
|
10004
|
+
distance: jump.distance,
|
|
10005
|
+
height: jump.height,
|
|
10006
|
+
score: jump.score
|
|
10007
|
+
})
|
|
10008
|
+
);
|
|
10009
|
+
});
|
|
10010
|
+
}
|
|
9658
10011
|
const isLengthsBased = this.isLengthsBased(sessionObject);
|
|
9659
10012
|
const samples = isLengthsBased ? this.generateSamplesFromLengths(sessionObject, options) : fitDataObject.records.filter((record) => {
|
|
9660
10013
|
return record.timestamp >= activity.startDate && record.timestamp <= activity.endDate;
|
|
@@ -9780,6 +10133,9 @@ var EventImporterFIT = class {
|
|
|
9780
10133
|
device.antTransmissionType = deviceInfo.ant_transmission_type;
|
|
9781
10134
|
device.antNetwork = deviceInfo.ant_network;
|
|
9782
10135
|
device.sourceType = deviceInfo.source_type;
|
|
10136
|
+
if (deviceInfo.ant_id) {
|
|
10137
|
+
device.antId = deviceInfo.ant_id;
|
|
10138
|
+
}
|
|
9783
10139
|
device.cumOperatingTime = deviceInfo.cum_operating_time;
|
|
9784
10140
|
return device;
|
|
9785
10141
|
});
|
|
@@ -9866,6 +10222,88 @@ var EventImporterFIT = class {
|
|
|
9866
10222
|
options
|
|
9867
10223
|
);
|
|
9868
10224
|
this.getStatsFromObject(sessionObject, activity, false).forEach((stat) => activity.addStat(stat));
|
|
10225
|
+
if (fitDataObject.jumps && fitDataObject.jumps.length) {
|
|
10226
|
+
const jumpWithMets = fitDataObject.jumps.find((j) => j.enhanced_mets);
|
|
10227
|
+
if (jumpWithMets) {
|
|
10228
|
+
activity.addStat(new DataVO2Max(jumpWithMets.enhanced_mets * 3.5));
|
|
10229
|
+
}
|
|
10230
|
+
}
|
|
10231
|
+
if (fitDataObject.user_profile) {
|
|
10232
|
+
const userProfile = fitDataObject.user_profile;
|
|
10233
|
+
if (isNumberOrString(userProfile.weight)) {
|
|
10234
|
+
activity.addStat(new DataWeight(userProfile.weight));
|
|
10235
|
+
}
|
|
10236
|
+
if (isNumberOrString(userProfile.height)) {
|
|
10237
|
+
activity.addStat(new DataHeight(userProfile.height));
|
|
10238
|
+
}
|
|
10239
|
+
if (isNumberOrString(userProfile.age)) {
|
|
10240
|
+
activity.addStat(new DataAge(userProfile.age));
|
|
10241
|
+
}
|
|
10242
|
+
if (userProfile.gender) {
|
|
10243
|
+
activity.addStat(new DataGender(userProfile.gender));
|
|
10244
|
+
}
|
|
10245
|
+
}
|
|
10246
|
+
if (fitDataObject.time_in_zone && fitDataObject.time_in_zone.length) {
|
|
10247
|
+
const sessionTimeInZone = fitDataObject.time_in_zone.find(
|
|
10248
|
+
(z) => z.reference_mesg === 18 && (z.reference_index === 0 || z.reference_index === void 0)
|
|
10249
|
+
);
|
|
10250
|
+
if (sessionTimeInZone && sessionTimeInZone.time_in_hr_zone && Array.isArray(sessionTimeInZone.time_in_hr_zone)) {
|
|
10251
|
+
const hrZones = sessionTimeInZone.time_in_hr_zone;
|
|
10252
|
+
const hrZoneBoundaries = sessionTimeInZone.hr_zone_high_boundary;
|
|
10253
|
+
if (!activity.getStat(DataHeartRateZoneOneDuration.type)) {
|
|
10254
|
+
if (hrZones[0] !== void 0 && hrZones[0] !== null) {
|
|
10255
|
+
activity.addStat(new DataHeartRateZoneOneDuration(hrZones[0]));
|
|
10256
|
+
}
|
|
10257
|
+
if (hrZones[1] !== void 0 && hrZones[1] !== null) {
|
|
10258
|
+
activity.addStat(new DataHeartRateZoneTwoDuration(hrZones[1]));
|
|
10259
|
+
}
|
|
10260
|
+
if (hrZones[2] !== void 0 && hrZones[2] !== null) {
|
|
10261
|
+
activity.addStat(new DataHeartRateZoneThreeDuration(hrZones[2]));
|
|
10262
|
+
}
|
|
10263
|
+
if (hrZones[3] !== void 0 && hrZones[3] !== null) {
|
|
10264
|
+
activity.addStat(new DataHeartRateZoneFourDuration(hrZones[3]));
|
|
10265
|
+
}
|
|
10266
|
+
if (hrZones[4] !== void 0 && hrZones[4] !== null) {
|
|
10267
|
+
activity.addStat(new DataHeartRateZoneFiveDuration(hrZones[4]));
|
|
10268
|
+
}
|
|
10269
|
+
}
|
|
10270
|
+
const existingHrZones = activity.intensityZones.find((iz) => iz.type === DataHeartRate.type);
|
|
10271
|
+
if (!existingHrZones && Array.isArray(hrZoneBoundaries) && hrZoneBoundaries.length > 0) {
|
|
10272
|
+
const hrIntensityZones = new IntensityZones(DataHeartRate.type);
|
|
10273
|
+
hrIntensityZones.zone1Duration = hrZones[0] || 0;
|
|
10274
|
+
hrIntensityZones.zone2Duration = hrZones[1] || 0;
|
|
10275
|
+
hrIntensityZones.zone3Duration = hrZones[2] || 0;
|
|
10276
|
+
hrIntensityZones.zone4Duration = hrZones[3] || 0;
|
|
10277
|
+
hrIntensityZones.zone5Duration = hrZones[4] || 0;
|
|
10278
|
+
if (isNumber(hrZoneBoundaries[0]) && hrZoneBoundaries[0] !== 255) {
|
|
10279
|
+
hrIntensityZones.zone2LowerLimit = hrZoneBoundaries[0];
|
|
10280
|
+
}
|
|
10281
|
+
if (isNumber(hrZoneBoundaries[1]) && hrZoneBoundaries[1] !== 255) {
|
|
10282
|
+
hrIntensityZones.zone3LowerLimit = hrZoneBoundaries[1];
|
|
10283
|
+
}
|
|
10284
|
+
if (isNumber(hrZoneBoundaries[2]) && hrZoneBoundaries[2] !== 255) {
|
|
10285
|
+
hrIntensityZones.zone4LowerLimit = hrZoneBoundaries[2];
|
|
10286
|
+
}
|
|
10287
|
+
if (isNumber(hrZoneBoundaries[3]) && hrZoneBoundaries[3] !== 255) {
|
|
10288
|
+
hrIntensityZones.zone5LowerLimit = hrZoneBoundaries[3];
|
|
10289
|
+
}
|
|
10290
|
+
activity.intensityZones.push(hrIntensityZones);
|
|
10291
|
+
} else if (existingHrZones && Array.isArray(hrZoneBoundaries) && hrZoneBoundaries.length > 0) {
|
|
10292
|
+
if (!existingHrZones.zone2LowerLimit && isNumber(hrZoneBoundaries[0]) && hrZoneBoundaries[0] !== 255) {
|
|
10293
|
+
existingHrZones.zone2LowerLimit = hrZoneBoundaries[0];
|
|
10294
|
+
}
|
|
10295
|
+
if (!existingHrZones.zone3LowerLimit && isNumber(hrZoneBoundaries[1]) && hrZoneBoundaries[1] !== 255) {
|
|
10296
|
+
existingHrZones.zone3LowerLimit = hrZoneBoundaries[1];
|
|
10297
|
+
}
|
|
10298
|
+
if (!existingHrZones.zone4LowerLimit && isNumber(hrZoneBoundaries[2]) && hrZoneBoundaries[2] !== 255) {
|
|
10299
|
+
existingHrZones.zone4LowerLimit = hrZoneBoundaries[2];
|
|
10300
|
+
}
|
|
10301
|
+
if (!existingHrZones.zone5LowerLimit && isNumber(hrZoneBoundaries[3]) && hrZoneBoundaries[3] !== 255) {
|
|
10302
|
+
existingHrZones.zone5LowerLimit = hrZoneBoundaries[3];
|
|
10303
|
+
}
|
|
10304
|
+
}
|
|
10305
|
+
}
|
|
10306
|
+
}
|
|
9869
10307
|
return activity;
|
|
9870
10308
|
}
|
|
9871
10309
|
}
|
|
@@ -9967,6 +10405,9 @@ var EventImporterFIT = class {
|
|
|
9967
10405
|
if (isNumberOrString(object.max_heart_rate)) {
|
|
9968
10406
|
stats.push(new DataHeartRateMax(object.max_heart_rate));
|
|
9969
10407
|
}
|
|
10408
|
+
if (object.vo2_max_cycling && object.vo2_max_cycling > 10) {
|
|
10409
|
+
stats.push(new DataVO2Max(object.vo2_max_cycling));
|
|
10410
|
+
}
|
|
9970
10411
|
if (isNumberOrString(object.avg_cadence)) {
|
|
9971
10412
|
stats.push(new DataCadenceAvg(object.avg_cadence));
|
|
9972
10413
|
}
|
|
@@ -9979,6 +10420,14 @@ var EventImporterFIT = class {
|
|
|
9979
10420
|
if (isNumberOrString(object.avg_power)) {
|
|
9980
10421
|
stats.push(new DataPowerAvg(object.avg_power));
|
|
9981
10422
|
}
|
|
10423
|
+
if (isNumberOrString(object.total_flow)) {
|
|
10424
|
+
}
|
|
10425
|
+
if (isNumberOrString(object.avg_grit)) {
|
|
10426
|
+
stats.push(new DataAvgGrit(object.avg_grit));
|
|
10427
|
+
}
|
|
10428
|
+
if (isNumberOrString(object.avg_flow)) {
|
|
10429
|
+
stats.push(new DataAvgFlow(object.avg_flow));
|
|
10430
|
+
}
|
|
9982
10431
|
if (isNumberOrString(object.min_power)) {
|
|
9983
10432
|
stats.push(new DataPowerMin(object.min_power));
|
|
9984
10433
|
}
|
|
@@ -10043,7 +10492,9 @@ var EventImporterFIT = class {
|
|
|
10043
10492
|
if (isNumberOrString(object.total_training_effect)) {
|
|
10044
10493
|
stats.push(new DataAerobicTrainingEffect(object.total_training_effect));
|
|
10045
10494
|
}
|
|
10046
|
-
if (isNumberOrString(object.
|
|
10495
|
+
if (isNumberOrString(object.total_anaerobic_training_effect)) {
|
|
10496
|
+
stats.push(new DataAnaerobicTrainingEffect(object.total_anaerobic_training_effect));
|
|
10497
|
+
} else if (isNumberOrString(object.total_anaerobic_effect)) {
|
|
10047
10498
|
stats.push(new DataAnaerobicTrainingEffect(object.total_anaerobic_effect));
|
|
10048
10499
|
}
|
|
10049
10500
|
if (isNumberOrString(object.estimated_vo2_max)) {
|
|
@@ -10103,6 +10554,60 @@ var EventImporterFIT = class {
|
|
|
10103
10554
|
const avgStrideLengthMeters = object.avg_step_length / 1e3;
|
|
10104
10555
|
stats.push(new DataAvgStrideLength(Math.round(avgStrideLengthMeters * 100) / 100));
|
|
10105
10556
|
}
|
|
10557
|
+
if (isNumberOrString(object.avg_respiration_rate) || isNumberOrString(object.enhanced_avg_respiration_rate)) {
|
|
10558
|
+
stats.push(
|
|
10559
|
+
new DataAvgRespirationRate(object.enhanced_avg_respiration_rate || object.avg_respiration_rate)
|
|
10560
|
+
);
|
|
10561
|
+
}
|
|
10562
|
+
if (isNumberOrString(object.max_respiration_rate) || isNumberOrString(object.enhanced_max_respiration_rate)) {
|
|
10563
|
+
stats.push(
|
|
10564
|
+
new DataMaxRespirationRate(object.enhanced_max_respiration_rate || object.max_respiration_rate)
|
|
10565
|
+
);
|
|
10566
|
+
}
|
|
10567
|
+
if (isNumberOrString(object.min_respiration_rate) || isNumberOrString(object.enhanced_min_respiration_rate)) {
|
|
10568
|
+
stats.push(
|
|
10569
|
+
new DataMinRespirationRate(object.enhanced_min_respiration_rate || object.min_respiration_rate)
|
|
10570
|
+
);
|
|
10571
|
+
}
|
|
10572
|
+
if (isNumberOrString(object.total_grit)) {
|
|
10573
|
+
stats.push(new DataTotalGrit(object.total_grit));
|
|
10574
|
+
}
|
|
10575
|
+
if (isNumberOrString(object.avg_flow)) {
|
|
10576
|
+
stats.push(new DataAvgFlow(object.avg_flow));
|
|
10577
|
+
}
|
|
10578
|
+
if (isNumberOrString(object.est_sweat_loss)) {
|
|
10579
|
+
stats.push(new DataEstSweatLoss(object.est_sweat_loss));
|
|
10580
|
+
}
|
|
10581
|
+
if (isNumberOrString(object.primary_benefit)) {
|
|
10582
|
+
stats.push(new DataPrimaryBenefit(object.primary_benefit));
|
|
10583
|
+
}
|
|
10584
|
+
if (object.sport_profile_name) {
|
|
10585
|
+
stats.push(new DataSportProfileName(object.sport_profile_name));
|
|
10586
|
+
}
|
|
10587
|
+
if (isNumberOrString(object.jump_count)) {
|
|
10588
|
+
stats.push(new DataJumpCount(object.jump_count));
|
|
10589
|
+
}
|
|
10590
|
+
if (isNumberOrString(object.training_load_peak)) {
|
|
10591
|
+
stats.push(new DataTrainingLoadPeak(object.training_load_peak));
|
|
10592
|
+
}
|
|
10593
|
+
if (isNumber(object.start_position_lat) && isNumber(object.start_position_long)) {
|
|
10594
|
+
stats.push(new DataStartPosition({
|
|
10595
|
+
latitudeDegrees: object.start_position_lat,
|
|
10596
|
+
longitudeDegrees: object.start_position_long
|
|
10597
|
+
}));
|
|
10598
|
+
}
|
|
10599
|
+
if (isNumber(object.end_position_lat) && isNumber(object.end_position_long)) {
|
|
10600
|
+
stats.push(new DataEndPosition({
|
|
10601
|
+
latitudeDegrees: object.end_position_lat,
|
|
10602
|
+
longitudeDegrees: object.end_position_long
|
|
10603
|
+
}));
|
|
10604
|
+
}
|
|
10605
|
+
if (isNumberOrString(object.resting_calories)) {
|
|
10606
|
+
stats.push(new DataRestingCalories(object.resting_calories));
|
|
10607
|
+
}
|
|
10608
|
+
if (isNumberOrString(object.avg_vam)) {
|
|
10609
|
+
stats.push(new DataAvgVAM(object.avg_vam));
|
|
10610
|
+
}
|
|
10106
10611
|
return stats;
|
|
10107
10612
|
}
|
|
10108
10613
|
static getCreatorFromFitDataObject(fitDataObject) {
|
|
@@ -11889,6 +12394,8 @@ export {
|
|
|
11889
12394
|
DataIBI,
|
|
11890
12395
|
DataLatitudeDegrees,
|
|
11891
12396
|
DataLeftBalance,
|
|
12397
|
+
DataLeftPedalSmoothness,
|
|
12398
|
+
DataLeftTorqueEffectiveness,
|
|
11892
12399
|
DataLongitudeDegrees,
|
|
11893
12400
|
DataMovingTime,
|
|
11894
12401
|
DataPace,
|
|
@@ -11906,6 +12413,8 @@ export {
|
|
|
11906
12413
|
DataRPE,
|
|
11907
12414
|
DataRecoveryTime,
|
|
11908
12415
|
DataRightBalance,
|
|
12416
|
+
DataRightPedalSmoothness,
|
|
12417
|
+
DataRightTorqueEffectiveness,
|
|
11909
12418
|
DataSeaLevelPressure,
|
|
11910
12419
|
DataSpeed,
|
|
11911
12420
|
DataSpeedAvg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sports-alliance/sports-lib",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "A Library to for importing / exporting and processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gpx",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"fast-xml-parser": "^5.3.3",
|
|
57
|
-
"fit-file-parser": "
|
|
57
|
+
"fit-file-parser": "2.2.1",
|
|
58
58
|
"geolib": "^3.3.4",
|
|
59
59
|
"gpx-builder": "^3.7.8",
|
|
60
60
|
"kalmanjs": "^1.1.0",
|