trackswap 0.2.1 → 0.2.2
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/README.md +4 -0
- package/dist/FIT/health.d.ts +5 -4
- package/dist/index.cjs +5 -5
- package/dist/index.js +29 -29
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,6 +69,10 @@ FIT 文件只解码一次,活动与健康数据作为同一 `TrackDocument`
|
|
|
69
69
|
- `summaries`:日汇总、睡眠汇总及设备汇总;
|
|
70
70
|
- `diagnostics`:FIT SDK profile、无效值、未知消息和解析警告。
|
|
71
71
|
|
|
72
|
+
标准化边界由 TrackSwap 负责:FIT epoch、`timestamp_16`、Garmin sentinel、
|
|
73
|
+
字段 scale/unit、时区偏移和 HSA 数组展开均不会泄漏给业务调用方。所有时区偏移
|
|
74
|
+
统一使用秒;sentinel 只保留在 `status`/`attributes.rawValue`,不会伪装成有效测量值。
|
|
75
|
+
|
|
72
76
|
~~~ts
|
|
73
77
|
const document = await trackSwap.decode(fitBuffer, {
|
|
74
78
|
fit: {
|
package/dist/FIT/health.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseFITStructurePlugin } from "./base.js";
|
|
2
2
|
import type { FITContext } from "./types.js";
|
|
3
3
|
export type FITPrimaryKind = 'activity' | 'health' | 'workout' | 'course' | 'device' | 'unknown';
|
|
4
|
-
export type HealthMetricCode = 'heart_rate_bpm' | 'resting_heart_rate_bpm' | 'resting_heart_rate_7_day_bpm' | 'steps' | 'distance_m' | 'active_time_s' | 'active_energy_kcal' | 'total_energy_kcal' | 'stress_level' | 'respiration_rate_bpm' | 'spo2_percent' | 'body_battery_level' | 'body_battery_charged' | 'body_battery_drained' | 'hrv_rmssd_ms' | 'temperature_c' | 'skin_temperature_deviation_c' | 'skin_temperature_7_day_deviation_c' | 'skin_temperature_nightly_c' | 'ascent_m' | 'descent_m' | `vendor:${string}`;
|
|
5
|
-
export type HealthValueStatus = 'valid' | 'invalid' | 'off_wrist' | 'motion' | 'low_confidence' | 'gap' | 'unknown';
|
|
4
|
+
export type HealthMetricCode = 'heart_rate_bpm' | 'resting_heart_rate_bpm' | 'resting_heart_rate_7_day_bpm' | 'steps' | 'distance_m' | 'active_time_s' | 'moderate_activity_time_s' | 'vigorous_activity_time_s' | 'active_energy_kcal' | 'total_energy_kcal' | 'stress_level' | 'respiration_rate_bpm' | 'spo2_percent' | 'body_battery_level' | 'body_battery_charged' | 'body_battery_drained' | 'hrv_rmssd_ms' | 'temperature_c' | 'wrist_temperature_c' | 'skin_temperature_deviation_c' | 'skin_temperature_7_day_deviation_c' | 'skin_temperature_nightly_c' | 'ascent_m' | 'descent_m' | `vendor:${string}`;
|
|
5
|
+
export type HealthValueStatus = 'valid' | 'invalid' | 'off_wrist' | 'motion' | 'low_confidence' | 'not_enough_data' | 'recovering' | 'unidentified' | 'gap' | 'unknown';
|
|
6
6
|
export type HealthMessagePointerV1 = {
|
|
7
7
|
messageName: string;
|
|
8
8
|
messageIndex: number;
|
|
@@ -79,6 +79,7 @@ export type FITDiagnosticsV1 = {
|
|
|
79
79
|
recognizedMessageCounts: Record<string, number>;
|
|
80
80
|
unknownMessageCounts: Record<string, number>;
|
|
81
81
|
invalidValueCounts: Record<string, number>;
|
|
82
|
+
warningCounts: Record<string, number>;
|
|
82
83
|
warnings: FITDiagnosticWarningV1[];
|
|
83
84
|
unknownMessages?: Record<string, unknown[]>;
|
|
84
85
|
};
|
|
@@ -109,7 +110,7 @@ export type FITDocumentParseOptions = {
|
|
|
109
110
|
};
|
|
110
111
|
};
|
|
111
112
|
export type FITMessages = Record<string, unknown[] | undefined>;
|
|
112
|
-
export declare const TRACKSWAP_HEALTH_PARSER_VERSION = "trackswap-0.2.
|
|
113
|
+
export declare const TRACKSWAP_HEALTH_PARSER_VERSION = "trackswap-0.2.2-health-ir-v1";
|
|
113
114
|
export declare function detectFITKinds(messages: FITMessages): FITPrimaryKind[];
|
|
114
115
|
export declare function buildHealthDocumentFromMessages(messages: FITMessages, options?: FITDocumentParseOptions, environment?: {
|
|
115
116
|
sdkProfileVersion?: string;
|
|
@@ -117,5 +118,5 @@ export declare function buildHealthDocumentFromMessages(messages: FITMessages, o
|
|
|
117
118
|
export declare class HealthStructurePlugin extends BaseFITStructurePlugin {
|
|
118
119
|
name: string;
|
|
119
120
|
priority: number;
|
|
120
|
-
structureData(messages: FITMessages, context: FITContext): Partial<import(
|
|
121
|
+
structureData(messages: FITMessages, context: FITContext): Partial<import('./types.js').FITFileType>;
|
|
121
122
|
}
|