fit-file-parser 2.3.3 → 3.0.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/binary.js +13 -5
- package/dist/cjs/binary.js +13 -5
- package/dist/cjs/fit-parser.js +18 -1
- package/dist/cjs/fit.js +436 -0
- package/dist/cjs/fit_types.d.ts +70 -1
- package/dist/cjs/type_generator.js +5 -0
- package/dist/fit-parser.js +18 -1
- package/dist/fit.js +436 -0
- package/dist/fit_types.d.ts +70 -1
- package/dist/type_generator.js +5 -0
- package/package.json +1 -1
package/dist/fit_types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface MessageIndex {
|
|
|
16
16
|
selected: boolean;
|
|
17
17
|
}
|
|
18
18
|
export type File = 'device' | 'settings' | 'sport' | 'activity' | 'workout' | 'course' | 'schedules' | 'weight' | 'totals' | 'goals' | 'blood_pressure' | 'monitoring_a' | 'activity_summary' | 'monitoring_daily' | 'monitoring_b' | 'segment' | 'segment_list' | 'exd_configuration' | 'mfg_range_min' | 'mfg_range_max';
|
|
19
|
-
export type MesgNum = 'file_id' | 'capabilities' | 'device_settings' | 'user_profile' | 'hrm_profile' | 'sdm_profile' | 'bike_profile' | 'zones_target' | 'hr_zone' | 'power_zone' | 'met_zone' | 'sport' | 'goal' | 'session' | 'lap' | 'record' | 'event' | 'device_info' | 'workout' | 'workout_step' | 'schedule' | 'weight_scale' | 'course' | 'course_point' | 'totals' | 'activity' | 'software' | 'file_capabilities' | 'mesg_capabilities' | 'field_capabilities' | 'file_creator' | 'blood_pressure' | 'speed_zone' | 'monitoring' | 'training_file' | 'hrv' | 'ant_rx' | 'ant_tx' | 'ant_channel_id' | 'length' | 'monitoring_info' | 'pad' | 'slave_device' | 'connectivity' | 'weather_conditions' | 'weather_alert' | 'cadence_zone' | 'hr' | 'activity_metrics' | 'segment_lap' | 'memo_glob' | 'segment_id' | 'segment_leaderboard_entry' | 'segment_point' | 'segment_file' | 'workout_session' | 'watchface_settings' | 'gps_metadata' | 'camera_event' | 'timestamp_correlation' | 'gyroscope_data' | 'accelerometer_data' | 'three_d_sensor_calibration' | 'video_frame' | 'obdii_data' | 'nmea_sentence' | 'aviation_attitude' | 'video' | 'video_title' | 'video_description' | 'video_clip' | 'exd_screen_configuration' | 'exd_data_field_configuration' | 'exd_data_concept_configuration' | 'field_description' | 'developer_data_id' | 'magnetometer_data' | 'barometer_data' | 'one_d_sensor_calibration' | 'time_in_zone' | 'set' | 'stress_level' | 'dive_settings' | 'dive_gas' | 'dive_alarm' | 'exercise_title' | 'dive_summary' | 'jump' | 'climb_pro' | 'tank_update' | 'tank_summary' | 'o_hr_settings' | 'mfg_range_min' | 'mfg_range_max' | 'definition';
|
|
19
|
+
export type MesgNum = 'file_id' | 'capabilities' | 'device_settings' | 'user_profile' | 'hrm_profile' | 'sdm_profile' | 'bike_profile' | 'zones_target' | 'hr_zone' | 'power_zone' | 'met_zone' | 'sport' | 'goal' | 'session' | 'lap' | 'record' | 'event' | 'device_info' | 'workout' | 'workout_step' | 'schedule' | 'weight_scale' | 'course' | 'course_point' | 'totals' | 'activity' | 'software' | 'file_capabilities' | 'mesg_capabilities' | 'field_capabilities' | 'file_creator' | 'blood_pressure' | 'speed_zone' | 'monitoring' | 'training_file' | 'hrv' | 'user_metrics' | 'ant_rx' | 'ant_tx' | 'ant_channel_id' | 'length' | 'monitoring_info' | 'pad' | 'slave_device' | 'connectivity' | 'weather_conditions' | 'weather_alert' | 'cadence_zone' | 'hr' | 'activity_metrics' | 'segment_lap' | 'memo_glob' | 'segment_id' | 'segment_leaderboard_entry' | 'segment_point' | 'segment_file' | 'workout_session' | 'watchface_settings' | 'gps_metadata' | 'camera_event' | 'timestamp_correlation' | 'gyroscope_data' | 'accelerometer_data' | 'three_d_sensor_calibration' | 'video_frame' | 'obdii_data' | 'nmea_sentence' | 'aviation_attitude' | 'video' | 'video_title' | 'video_description' | 'video_clip' | 'exd_screen_configuration' | 'exd_data_field_configuration' | 'exd_data_concept_configuration' | 'field_description' | 'developer_data_id' | 'magnetometer_data' | 'barometer_data' | 'one_d_sensor_calibration' | 'time_in_zone' | 'set' | 'stress_level' | 'dive_settings' | 'dive_gas' | 'dive_alarm' | 'exercise_title' | 'dive_summary' | 'jump' | 'split' | 'split_summary' | 'climb_pro' | 'tank_update' | 'tank_summary' | 'o_hr_settings' | 'mfg_range_min' | 'mfg_range_max' | 'definition';
|
|
20
20
|
export type Checksum = 'clear' | 'ok';
|
|
21
21
|
export type FileFlags = '0' | 'read' | 'write' | 'erase';
|
|
22
22
|
export type MesgCount = 'num_per_file' | 'max_per_file' | 'max_per_file_type';
|
|
@@ -105,6 +105,7 @@ export type SegmentLapStatus = 'end' | 'fail';
|
|
|
105
105
|
export type SegmentLeaderboardType = 'overall' | 'personal_best' | 'connections' | 'group' | 'challenger' | 'kom' | 'qom' | 'pr' | 'goal' | 'rival' | 'club_leader';
|
|
106
106
|
export type SegmentDeleteStatus = 'do_not_delete' | 'delete_one' | 'delete_all';
|
|
107
107
|
export type SegmentSelectionType = 'starred' | 'suggested';
|
|
108
|
+
export type SplitType = 'ascent_split' | 'descent_split' | 'interval_active' | 'interval_rest' | 'interval_warmup' | 'interval_cooldown' | 'interval_recovery' | 'interval_other' | 'climb_active' | 'climb_rest' | 'surf_active' | 'run_active' | 'run_rest' | 'workout_round' | 'rwd_run' | 'rwd_walk' | 'windsurf_active' | 'rwd_stand' | 'transition' | 'ski_lift_split' | 'ski_run_split';
|
|
108
109
|
export type SourceType = 'ant' | 'antplus' | 'bluetooth' | 'bluetooth_low_energy' | 'wifi' | 'local';
|
|
109
110
|
export type DisplayOrientation = 'auto' | 'portrait' | 'landscape' | 'portrait_flipped' | 'landscape_flipped';
|
|
110
111
|
export type WorkoutEquipment = 'none' | 'swim_fins' | 'swim_kickboard' | 'swim_paddles' | 'swim_pull_buoy' | 'swim_snorkel';
|
|
@@ -465,6 +466,9 @@ export interface ParsedSession {
|
|
|
465
466
|
workout_feel?: number;
|
|
466
467
|
workout_rpe?: number;
|
|
467
468
|
resting_calories?: number;
|
|
469
|
+
beginning_potential_stamina?: number;
|
|
470
|
+
ending_potential_stamina?: number;
|
|
471
|
+
min_stamina?: number;
|
|
468
472
|
timestamp: string;
|
|
469
473
|
message_index?: MessageIndex;
|
|
470
474
|
laps?: ParsedLap[];
|
|
@@ -648,6 +652,8 @@ export interface ParsedRecord {
|
|
|
648
652
|
n2_load?: number;
|
|
649
653
|
grit?: number;
|
|
650
654
|
flow?: number;
|
|
655
|
+
potential_stamina?: number;
|
|
656
|
+
stamina?: number;
|
|
651
657
|
timestamp: string;
|
|
652
658
|
}
|
|
653
659
|
export interface ParsedEvent {
|
|
@@ -762,6 +768,8 @@ export interface ParsedActivity {
|
|
|
762
768
|
developer_data_ids?: ParsedDeveloperDataId[];
|
|
763
769
|
field_descriptions?: ParsedFieldDescription[];
|
|
764
770
|
sports?: ParsedSport[];
|
|
771
|
+
splits?: ParsedSplit[];
|
|
772
|
+
split_summaries?: ParsedSplitSummary[];
|
|
765
773
|
}
|
|
766
774
|
export interface ParsedSoftware {
|
|
767
775
|
version?: number;
|
|
@@ -841,6 +849,22 @@ export interface ParsedMonitoring {
|
|
|
841
849
|
export interface ParsedHrv {
|
|
842
850
|
time?: number[];
|
|
843
851
|
}
|
|
852
|
+
export interface ParsedUserMetrics {
|
|
853
|
+
vo2_max?: number;
|
|
854
|
+
age?: number;
|
|
855
|
+
height?: number;
|
|
856
|
+
weight?: number;
|
|
857
|
+
gender?: Gender;
|
|
858
|
+
max_heart_rate?: number;
|
|
859
|
+
remaining_recovery_time?: number;
|
|
860
|
+
lthr?: number;
|
|
861
|
+
ltpower?: number;
|
|
862
|
+
ltspeed?: number;
|
|
863
|
+
start_of_activity?: string;
|
|
864
|
+
first_vo2_max?: number;
|
|
865
|
+
end_of_previous_activity?: string;
|
|
866
|
+
timestamp: string;
|
|
867
|
+
}
|
|
844
868
|
export interface ParsedLength {
|
|
845
869
|
event?: Event;
|
|
846
870
|
event_type?: EventType;
|
|
@@ -994,6 +1018,48 @@ export interface ParsedJump {
|
|
|
994
1018
|
enhanced_speed?: number;
|
|
995
1019
|
timestamp: string;
|
|
996
1020
|
}
|
|
1021
|
+
export interface ParsedSplit {
|
|
1022
|
+
split_type?: SplitType;
|
|
1023
|
+
total_elapsed_time?: number;
|
|
1024
|
+
total_timer_time?: number;
|
|
1025
|
+
total_distance?: number;
|
|
1026
|
+
avg_speed?: number;
|
|
1027
|
+
start_time: string;
|
|
1028
|
+
total_ascent?: number;
|
|
1029
|
+
total_descent?: number;
|
|
1030
|
+
start_position_lat?: number;
|
|
1031
|
+
start_position_long?: number;
|
|
1032
|
+
end_position_lat?: number;
|
|
1033
|
+
end_position_long?: number;
|
|
1034
|
+
max_speed?: number;
|
|
1035
|
+
avg_vert_speed?: number;
|
|
1036
|
+
end_time?: string;
|
|
1037
|
+
total_calories?: number;
|
|
1038
|
+
start_elevation?: number;
|
|
1039
|
+
active_time?: number;
|
|
1040
|
+
beginning_potential_stamina?: number;
|
|
1041
|
+
ending_potential_stamina?: number;
|
|
1042
|
+
min_stamina?: number;
|
|
1043
|
+
total_moving_time?: number;
|
|
1044
|
+
message_index?: MessageIndex;
|
|
1045
|
+
}
|
|
1046
|
+
export interface ParsedSplitSummary {
|
|
1047
|
+
split_type?: SplitType;
|
|
1048
|
+
num_splits?: number;
|
|
1049
|
+
total_timer_time?: number;
|
|
1050
|
+
total_distance?: number;
|
|
1051
|
+
avg_speed?: number;
|
|
1052
|
+
max_speed?: number;
|
|
1053
|
+
total_ascent?: number;
|
|
1054
|
+
total_descent?: number;
|
|
1055
|
+
avg_heart_rate?: number;
|
|
1056
|
+
max_heart_rate?: number;
|
|
1057
|
+
avg_vert_speed?: number;
|
|
1058
|
+
total_calories?: number;
|
|
1059
|
+
active_time?: number;
|
|
1060
|
+
total_moving_time?: number;
|
|
1061
|
+
message_index?: MessageIndex;
|
|
1062
|
+
}
|
|
997
1063
|
export interface ParsedTankUpdate {
|
|
998
1064
|
sensor?: number;
|
|
999
1065
|
pressure?: number;
|
|
@@ -1038,6 +1104,9 @@ export interface ParsedFit {
|
|
|
1038
1104
|
tank_updates?: ParsedTankUpdate[];
|
|
1039
1105
|
tank_summaries?: ParsedTankSummary[];
|
|
1040
1106
|
jumps?: ParsedJump[];
|
|
1107
|
+
splits?: ParsedSplit[];
|
|
1108
|
+
split_summaries?: ParsedSplitSummary[];
|
|
1041
1109
|
time_in_zone?: ParsedTimeInZone[];
|
|
1042
1110
|
activity_metrics?: ParsedActivityMetrics[];
|
|
1111
|
+
user_metrics?: ParsedUserMetrics[];
|
|
1043
1112
|
}
|
package/dist/type_generator.js
CHANGED
|
@@ -160,6 +160,8 @@ function generateAdditionalFields(msg) {
|
|
|
160
160
|
developer_data_ids: 'parsed_developer_data_id',
|
|
161
161
|
field_descriptions: 'parsed_field_description',
|
|
162
162
|
sports: 'parsed_sport',
|
|
163
|
+
splits: 'parsed_split',
|
|
164
|
+
split_summaries: 'parsed_split_summary',
|
|
163
165
|
};
|
|
164
166
|
return Object.keys(props).map(prop => generateArrayProperty(prop, ts.factory.createTypeReferenceNode(snakeToCamel(props[prop]))));
|
|
165
167
|
}
|
|
@@ -189,8 +191,11 @@ export function generateFitType() {
|
|
|
189
191
|
tank_updates: 'parsed_tank_update',
|
|
190
192
|
tank_summaries: 'parsed_tank_summary',
|
|
191
193
|
jumps: 'parsed_jump',
|
|
194
|
+
splits: 'parsed_split',
|
|
195
|
+
split_summaries: 'parsed_split_summary',
|
|
192
196
|
time_in_zone: 'parsed_time_in_zone',
|
|
193
197
|
activity_metrics: 'parsed_activity_metrics',
|
|
198
|
+
user_metrics: 'parsed_user_metrics',
|
|
194
199
|
};
|
|
195
200
|
const referenceProperties = {
|
|
196
201
|
file_creator: 'parsed_file_creator',
|