trackswap 0.0.27 → 0.2.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/README.md +124 -431
- package/dist/FIT/course-plan.d.ts +3 -0
- package/dist/FIT/decoder.d.ts +0 -2
- package/dist/FIT/health.d.ts +121 -0
- package/dist/FIT/index.d.ts +2 -0
- package/dist/FIT/types.d.ts +6 -1
- package/dist/GPX/types.d.ts +1 -1
- package/dist/TCX/encoder.d.ts +5 -0
- package/dist/TCX/types.d.ts +2 -1
- package/dist/TrackSwap.d.ts +13 -50
- package/dist/activity/converters.d.ts +4 -0
- package/dist/activity/encoders.d.ts +5 -1
- package/dist/core/builtin-adapters.d.ts +52 -0
- package/dist/core/format-adapter.d.ts +23 -0
- package/dist/core/format-registry.d.ts +9 -0
- package/dist/document.d.ts +57 -0
- package/dist/errors.d.ts +12 -0
- package/dist/fit-debug.d.ts +3 -0
- package/dist/index.cjs +29 -26
- package/dist/index.d.ts +8 -7
- package/dist/index.js +29 -26
- package/dist/types.d.ts +35 -1
- package/dist/util.d.ts +25 -0
- package/package.json +17 -9
package/dist/types.d.ts
CHANGED
|
@@ -54,6 +54,18 @@ export interface ActivityType extends SessionMesgType {
|
|
|
54
54
|
index: number;
|
|
55
55
|
endTime?: Date;
|
|
56
56
|
laps?: ActivityLapType[];
|
|
57
|
+
activityName?: string;
|
|
58
|
+
comment?: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
source?: string;
|
|
61
|
+
links?: ActivityLinkType[];
|
|
62
|
+
activityNumber?: number;
|
|
63
|
+
gpxExtensions?: ExtensionsType;
|
|
64
|
+
}
|
|
65
|
+
export interface ActivityLinkType {
|
|
66
|
+
href?: string;
|
|
67
|
+
text?: string;
|
|
68
|
+
type?: string;
|
|
57
69
|
}
|
|
58
70
|
export interface ActivityRecordType extends RecordMesgType {
|
|
59
71
|
lapIndex: number;
|
|
@@ -61,8 +73,22 @@ export interface ActivityRecordType extends RecordMesgType {
|
|
|
61
73
|
hdop?: number;
|
|
62
74
|
vdop?: number;
|
|
63
75
|
pdop?: number;
|
|
76
|
+
course?: number;
|
|
77
|
+
magvar?: number;
|
|
78
|
+
geoidheight?: number;
|
|
79
|
+
pointName?: string;
|
|
80
|
+
comment?: string;
|
|
81
|
+
source?: string;
|
|
82
|
+
links?: ActivityLinkType[];
|
|
83
|
+
symbol?: string;
|
|
84
|
+
pointType?: string;
|
|
85
|
+
fix?: string;
|
|
86
|
+
sat?: number;
|
|
87
|
+
ageofdgpsdata?: number;
|
|
88
|
+
dgpsid?: number;
|
|
89
|
+
gpxExtensions?: ExtensionsType;
|
|
64
90
|
turn?: number;
|
|
65
|
-
description?:
|
|
91
|
+
description?: string;
|
|
66
92
|
}
|
|
67
93
|
export interface ActivityLengthType extends LengthMesgType {
|
|
68
94
|
index: number;
|
|
@@ -70,6 +96,14 @@ export interface ActivityLengthType extends LengthMesgType {
|
|
|
70
96
|
export interface ActivityLapType extends LapMesgType {
|
|
71
97
|
index: number;
|
|
72
98
|
endTime?: Date;
|
|
99
|
+
routeName?: string;
|
|
100
|
+
comment?: string;
|
|
101
|
+
description?: string;
|
|
102
|
+
source?: string;
|
|
103
|
+
links?: ActivityLinkType[];
|
|
104
|
+
routeNumber?: number;
|
|
105
|
+
routeType?: string;
|
|
106
|
+
gpxExtensions?: ExtensionsType;
|
|
73
107
|
records: ActivityRecordType[];
|
|
74
108
|
lengths: ActivityLengthType[];
|
|
75
109
|
}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const convertGPXExtensionsMapping: {
|
|
2
|
+
heartrate: string;
|
|
3
|
+
"gpxtpx:hr": string;
|
|
4
|
+
"ns3:hr": string;
|
|
5
|
+
"gpxdata:hr": string;
|
|
6
|
+
"gpxdata:cadence": string;
|
|
7
|
+
"gpxtpx:cad": string;
|
|
8
|
+
"ns3:cad": string;
|
|
9
|
+
cadence: string;
|
|
10
|
+
"gpxtpx:speed": string;
|
|
11
|
+
"ns3:speed": string;
|
|
12
|
+
speed: string;
|
|
13
|
+
power: string;
|
|
14
|
+
"gpxdata:power": string;
|
|
15
|
+
"gpxpx:PowerInWatts": string;
|
|
16
|
+
PowerInWatts: string;
|
|
17
|
+
"gpxtpx:temp": string;
|
|
18
|
+
"gpxtpx:wtemp": string;
|
|
19
|
+
"gpxtpx:atemp": string;
|
|
20
|
+
"gpxx:Temperature": string;
|
|
21
|
+
"gpxx:Depth": string;
|
|
22
|
+
};
|
|
23
|
+
export declare const semicirclesToDegrees: (semicircles: number) => number;
|
|
24
|
+
export declare const FIT_SEMICIRCLE_INVALID_SINT32 = 2147483647;
|
|
25
|
+
export declare function normalizeFitSemicircleToDegrees(raw: unknown, precision?: number): number | undefined;
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trackswap",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "A typed, adapter-based toolkit for decoding, normalizing and transcoding FIT, GPX and TCX data.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.cjs",
|
|
6
7
|
"module": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
@@ -31,15 +32,22 @@
|
|
|
31
32
|
"build:cjs": "NODE_ENV=production FORMAT=cjs node build.config.js",
|
|
32
33
|
"build:dev": "npm run clean && npm run build:types && NODE_ENV=development node build.config.js",
|
|
33
34
|
"build:optimize": "node scripts/optimize-dist.js",
|
|
34
|
-
"
|
|
35
|
-
"build:js": "esbuild src/index.ts --bundle --platform=node --target=node14 --format=esm --outfile=dist/index.js --minify --sourcemap",
|
|
35
|
+
"build:js": "esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js --minify --sourcemap",
|
|
36
36
|
"build:tsc": "tsc && npm run minify",
|
|
37
37
|
"minify": "terser dist/**/*.js --compress --mangle --output dist/index.min.js --source-map",
|
|
38
38
|
"analyze": "NODE_ENV=production ANALYZE=true node build.config.js",
|
|
39
39
|
"start": "node dist/index.js",
|
|
40
40
|
"test:gpx": "cd example/gpx && rm -f output* *.json *_encoded.xml && node test.js",
|
|
41
41
|
"test:fit": "cd example/FIT && rm -rf output && node test.js",
|
|
42
|
-
"
|
|
42
|
+
"test:fit-coords": "npm run build:dev && node scripts/verify-fit-coordinates.mjs",
|
|
43
|
+
"test:tcx-course": "npm run build:dev && node scripts/tcx-course-smoke.mjs",
|
|
44
|
+
"test:routes-fit": "npm run build:dev && node scripts/routes-only-fit-smoke.mjs",
|
|
45
|
+
"test": "npm run test:architecture && npm run test:health && npm run test:garmin-parity",
|
|
46
|
+
"test:architecture": "esbuild test/architecture.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-architecture.test.mjs && node /tmp/trackswap-architecture.test.mjs",
|
|
47
|
+
"test:health": "esbuild test/health-fit.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-health-fit.test.mjs && node /tmp/trackswap-health-fit.test.mjs",
|
|
48
|
+
"test:garmin-parity": "esbuild test/garmin-sdk-parity.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-garmin-sdk-parity.test.mjs && node /tmp/trackswap-garmin-sdk-parity.test.mjs",
|
|
49
|
+
"test:package": "node scripts/verify-package.mjs",
|
|
50
|
+
"prepublishOnly": "npm run build"
|
|
43
51
|
},
|
|
44
52
|
"keywords": [
|
|
45
53
|
"gpx",
|
|
@@ -60,14 +68,14 @@
|
|
|
60
68
|
"license": "MIT",
|
|
61
69
|
"repository": {
|
|
62
70
|
"type": "git",
|
|
63
|
-
"url": "https://github.com/berber1016/trackswap.git"
|
|
71
|
+
"url": "git+https://github.com/berber1016/trackswap.git"
|
|
64
72
|
},
|
|
65
73
|
"homepage": "https://github.com/berber1016/trackswap#readme",
|
|
66
74
|
"bugs": {
|
|
67
75
|
"url": "https://github.com/berber1016/trackswap/issues"
|
|
68
76
|
},
|
|
69
77
|
"engines": {
|
|
70
|
-
"node": ">=
|
|
78
|
+
"node": ">=18.0.0"
|
|
71
79
|
},
|
|
72
80
|
"devDependencies": {
|
|
73
81
|
"@types/node": "^22.15.24",
|