trackswap 0.2.2 → 0.2.3

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 CHANGED
@@ -69,10 +69,6 @@ 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
-
76
72
  ~~~ts
77
73
  const document = await trackSwap.decode(fitBuffer, {
78
74
  fit: {
@@ -29,7 +29,6 @@ export declare class FITEncoder {
29
29
  private buildEventsFromLaps;
30
30
  private buildActivityFromSession;
31
31
  private parseTimestamp;
32
- private convertToSemicircles;
33
32
  private validateRequiredFields;
34
33
  private writeMesg;
35
34
  get blob(): Blob;
@@ -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' | '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';
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';
6
6
  export type HealthMessagePointerV1 = {
7
7
  messageName: string;
8
8
  messageIndex: number;
@@ -79,7 +79,6 @@ 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>;
83
82
  warnings: FITDiagnosticWarningV1[];
84
83
  unknownMessages?: Record<string, unknown[]>;
85
84
  };
@@ -110,7 +109,7 @@ export type FITDocumentParseOptions = {
110
109
  };
111
110
  };
112
111
  export type FITMessages = Record<string, unknown[] | undefined>;
113
- export declare const TRACKSWAP_HEALTH_PARSER_VERSION = "trackswap-0.2.2-health-ir-v1";
112
+ export declare const TRACKSWAP_HEALTH_PARSER_VERSION = "trackswap-0.2.0-health-ir-v1";
114
113
  export declare function detectFITKinds(messages: FITMessages): FITPrimaryKind[];
115
114
  export declare function buildHealthDocumentFromMessages(messages: FITMessages, options?: FITDocumentParseOptions, environment?: {
116
115
  sdkProfileVersion?: string;
@@ -118,5 +117,5 @@ export declare function buildHealthDocumentFromMessages(messages: FITMessages, o
118
117
  export declare class HealthStructurePlugin extends BaseFITStructurePlugin {
119
118
  name: string;
120
119
  priority: number;
121
- structureData(messages: FITMessages, context: FITContext): Partial<import('./types.js').FITFileType>;
120
+ structureData(messages: FITMessages, context: FITContext): Partial<import("./types.js").FITFileType>;
122
121
  }