@gooin/garmin-connect 1.6.1 → 1.6.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 +1 -1
- package/dist/common/HttpClient.d.ts +2 -0
- package/dist/common/HttpClient.js +430 -249
- package/dist/common/HttpClient.js.map +1 -1
- package/dist/garmin/GarminConnect.d.ts +11 -1
- package/dist/garmin/GarminConnect.js +293 -105
- package/dist/garmin/GarminConnect.js.map +1 -1
- package/dist/garmin/UrlClass.d.ts +3 -1
- package/dist/garmin/UrlClass.js +141 -58
- package/dist/garmin/UrlClass.js.map +1 -1
- package/dist/garmin/types.d.ts +110 -0
- package/dist/garmin/workouts/Running.js +53 -36
- package/dist/garmin/workouts/Running.js.map +1 -1
- package/dist/utils.js +5 -5
- package/dist/utils.js.map +1 -1
- package/package.json +2 -4
package/dist/garmin/UrlClass.js
CHANGED
|
@@ -1,64 +1,147 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UrlClass = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var UrlClass = /** @class */ (function () {
|
|
5
|
+
function UrlClass(domain) {
|
|
6
|
+
if (domain === void 0) { domain = 'garmin.com'; }
|
|
6
7
|
this.domain = domain;
|
|
7
|
-
this.GC_MODERN =
|
|
8
|
-
this.GARMIN_SSO_ORIGIN =
|
|
9
|
-
this.GC_API =
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
8
|
+
this.GC_MODERN = "https://connect.".concat(this.domain, "/modern");
|
|
9
|
+
this.GARMIN_SSO_ORIGIN = "https://sso.".concat(this.domain);
|
|
10
|
+
this.GC_API = "https://connectapi.".concat(this.domain);
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(UrlClass.prototype, "GARMIN_SSO", {
|
|
13
|
+
get: function () {
|
|
14
|
+
return "".concat(this.GARMIN_SSO_ORIGIN, "/sso");
|
|
15
|
+
},
|
|
16
|
+
enumerable: false,
|
|
17
|
+
configurable: true
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(UrlClass.prototype, "GARMIN_SSO_EMBED", {
|
|
20
|
+
get: function () {
|
|
21
|
+
return "".concat(this.GARMIN_SSO_ORIGIN, "/sso/embed");
|
|
22
|
+
},
|
|
23
|
+
enumerable: false,
|
|
24
|
+
configurable: true
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(UrlClass.prototype, "BASE_URL", {
|
|
27
|
+
get: function () {
|
|
28
|
+
return "".concat(this.GC_MODERN, "/proxy");
|
|
29
|
+
},
|
|
30
|
+
enumerable: false,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(UrlClass.prototype, "SIGNIN_URL", {
|
|
34
|
+
get: function () {
|
|
35
|
+
return "".concat(this.GARMIN_SSO, "/signin");
|
|
36
|
+
},
|
|
37
|
+
enumerable: false,
|
|
38
|
+
configurable: true
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(UrlClass.prototype, "LOGIN_URL", {
|
|
41
|
+
get: function () {
|
|
42
|
+
return "".concat(this.GARMIN_SSO, "/login");
|
|
43
|
+
},
|
|
44
|
+
enumerable: false,
|
|
45
|
+
configurable: true
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(UrlClass.prototype, "OAUTH_URL", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return "".concat(this.GC_API, "/oauth-service/oauth");
|
|
50
|
+
},
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(UrlClass.prototype, "USER_SETTINGS", {
|
|
55
|
+
get: function () {
|
|
56
|
+
return "".concat(this.GC_API, "/userprofile-service/userprofile/user-settings/");
|
|
57
|
+
},
|
|
58
|
+
enumerable: false,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(UrlClass.prototype, "USER_PROFILE", {
|
|
62
|
+
get: function () {
|
|
63
|
+
return "".concat(this.GC_API, "/userprofile-service/socialProfile");
|
|
64
|
+
},
|
|
65
|
+
enumerable: false,
|
|
66
|
+
configurable: true
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(UrlClass.prototype, "ACTIVITIES", {
|
|
69
|
+
get: function () {
|
|
70
|
+
return "".concat(this.GC_API, "/activitylist-service/activities/search/activities");
|
|
71
|
+
},
|
|
72
|
+
enumerable: false,
|
|
73
|
+
configurable: true
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(UrlClass.prototype, "ACTIVITY", {
|
|
76
|
+
get: function () {
|
|
77
|
+
return "".concat(this.GC_API, "/activity-service/activity/");
|
|
78
|
+
},
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(UrlClass.prototype, "STAT_ACTIVITIES", {
|
|
83
|
+
get: function () {
|
|
84
|
+
return "".concat(this.GC_API, "/fitnessstats-service/activity");
|
|
85
|
+
},
|
|
86
|
+
enumerable: false,
|
|
87
|
+
configurable: true
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(UrlClass.prototype, "DOWNLOAD_ZIP", {
|
|
90
|
+
get: function () {
|
|
91
|
+
return "".concat(this.GC_API, "/download-service/files/activity/");
|
|
92
|
+
},
|
|
93
|
+
enumerable: false,
|
|
94
|
+
configurable: true
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(UrlClass.prototype, "DOWNLOAD_GPX", {
|
|
97
|
+
get: function () {
|
|
98
|
+
return "".concat(this.GC_API, "/download-service/export/gpx/activity/");
|
|
99
|
+
},
|
|
100
|
+
enumerable: false,
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(UrlClass.prototype, "DOWNLOAD_TCX", {
|
|
104
|
+
get: function () {
|
|
105
|
+
return "".concat(this.GC_API, "/download-service/export/tcx/activity/");
|
|
106
|
+
},
|
|
107
|
+
enumerable: false,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(UrlClass.prototype, "DOWNLOAD_KML", {
|
|
111
|
+
get: function () {
|
|
112
|
+
return "".concat(this.GC_API, "/download-service/export/kml/activity/");
|
|
113
|
+
},
|
|
114
|
+
enumerable: false,
|
|
115
|
+
configurable: true
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(UrlClass.prototype, "UPLOAD", {
|
|
118
|
+
get: function () {
|
|
119
|
+
return "".concat(this.GC_API, "/upload-service/upload/");
|
|
120
|
+
},
|
|
121
|
+
enumerable: false,
|
|
122
|
+
configurable: true
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(UrlClass.prototype, "IMPORT_DATA", {
|
|
125
|
+
get: function () {
|
|
126
|
+
return "".concat(this.GC_API, "/modern/import-data");
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
131
|
+
UrlClass.prototype.WORKOUT = function (id) {
|
|
132
|
+
if (id) {
|
|
133
|
+
return "".concat(this.GC_API, "/workout-service/workout/").concat(id);
|
|
134
|
+
}
|
|
135
|
+
return "".concat(this.GC_API, "/workout-service/workout");
|
|
136
|
+
};
|
|
137
|
+
Object.defineProperty(UrlClass.prototype, "WORKOUTS", {
|
|
138
|
+
get: function () {
|
|
139
|
+
return "".concat(this.GC_API, "/workout-service/workouts");
|
|
140
|
+
},
|
|
141
|
+
enumerable: false,
|
|
142
|
+
configurable: true
|
|
143
|
+
});
|
|
144
|
+
return UrlClass;
|
|
145
|
+
}());
|
|
63
146
|
exports.UrlClass = UrlClass;
|
|
64
147
|
//# sourceMappingURL=UrlClass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlClass.js","sourceRoot":"","sources":["../../src/garmin/UrlClass.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"UrlClass.js","sourceRoot":"","sources":["../../src/garmin/UrlClass.ts"],"names":[],"mappings":";;;AAEA;IAKI,kBAAY,MAAmC;QAAnC,uBAAA,EAAA,qBAAmC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,0BAAmB,IAAI,CAAC,MAAM,YAAS,CAAC;QACzD,IAAI,CAAC,iBAAiB,GAAG,sBAAe,IAAI,CAAC,MAAM,CAAE,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,6BAAsB,IAAI,CAAC,MAAM,CAAE,CAAC;IACtD,CAAC;IACD,sBAAI,gCAAU;aAAd;YACI,OAAO,UAAG,IAAI,CAAC,iBAAiB,SAAM,CAAC;QAC3C,CAAC;;;OAAA;IACD,sBAAI,sCAAgB;aAApB;YACI,OAAO,UAAG,IAAI,CAAC,iBAAiB,eAAY,CAAC;QACjD,CAAC;;;OAAA;IACD,sBAAI,8BAAQ;aAAZ;YACI,OAAO,UAAG,IAAI,CAAC,SAAS,WAAQ,CAAC;QACrC,CAAC;;;OAAA;IACD,sBAAI,gCAAU;aAAd;YACI,OAAO,UAAG,IAAI,CAAC,UAAU,YAAS,CAAC;QACvC,CAAC;;;OAAA;IACD,sBAAI,+BAAS;aAAb;YACI,OAAO,UAAG,IAAI,CAAC,UAAU,WAAQ,CAAC;QACtC,CAAC;;;OAAA;IACD,sBAAI,+BAAS;aAAb;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,yBAAsB,CAAC;QAChD,CAAC;;;OAAA;IACD,sBAAI,mCAAa;aAAjB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,oDAAiD,CAAC;QAC3E,CAAC;;;OAAA;IACD,sBAAI,kCAAY;aAAhB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,uCAAoC,CAAC;QAC9D,CAAC;;;OAAA;IACD,sBAAI,gCAAU;aAAd;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,uDAAoD,CAAC;QAC9E,CAAC;;;OAAA;IACD,sBAAI,8BAAQ;aAAZ;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,gCAA6B,CAAC;QACvD,CAAC;;;OAAA;IACD,sBAAI,qCAAe;aAAnB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,mCAAgC,CAAC;QAC1D,CAAC;;;OAAA;IACD,sBAAI,kCAAY;aAAhB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,sCAAmC,CAAC;QAC7D,CAAC;;;OAAA;IACD,sBAAI,kCAAY;aAAhB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,2CAAwC,CAAC;QAClE,CAAC;;;OAAA;IACD,sBAAI,kCAAY;aAAhB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,2CAAwC,CAAC;QAClE,CAAC;;;OAAA;IACD,sBAAI,kCAAY;aAAhB;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,2CAAwC,CAAC;QAClE,CAAC;;;OAAA;IACD,sBAAI,4BAAM;aAAV;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,4BAAyB,CAAC;QACnD,CAAC;;;OAAA;IACD,sBAAI,iCAAW;aAAf;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,wBAAqB,CAAC;QAC/C,CAAC;;;OAAA;IACD,0BAAO,GAAP,UAAQ,EAAgB;QACpB,IAAI,EAAE,EAAE;YACJ,OAAO,UAAG,IAAI,CAAC,MAAM,sCAA4B,EAAE,CAAE,CAAC;SACzD;QACD,OAAO,UAAG,IAAI,CAAC,MAAM,6BAA0B,CAAC;IACpD,CAAC;IACD,sBAAI,8BAAQ;aAAZ;YACI,OAAO,UAAG,IAAI,CAAC,MAAM,8BAA2B,CAAC;QACrD,CAAC;;;OAAA;IACL,eAAC;AAAD,CAAC,AAvED,IAuEC;AAvEY,4BAAQ"}
|
package/dist/garmin/types.d.ts
CHANGED
|
@@ -708,3 +708,113 @@ export interface ICountActivities {
|
|
|
708
708
|
all: Record<string, any>;
|
|
709
709
|
};
|
|
710
710
|
}
|
|
711
|
+
export interface IWorkout {
|
|
712
|
+
workoutId?: number;
|
|
713
|
+
ownerId?: number;
|
|
714
|
+
workoutName: string;
|
|
715
|
+
description?: string;
|
|
716
|
+
updateDate: Date;
|
|
717
|
+
createdDate: Date;
|
|
718
|
+
sportType: ISportType;
|
|
719
|
+
trainingPlanId: null;
|
|
720
|
+
author: IAuthor;
|
|
721
|
+
estimatedDurationInSecs: number;
|
|
722
|
+
estimatedDistanceInMeters: null;
|
|
723
|
+
estimateType: null;
|
|
724
|
+
estimatedDistanceUnit: IUnit;
|
|
725
|
+
poolLength: number;
|
|
726
|
+
poolLengthUnit: IUnit;
|
|
727
|
+
workoutProvider: string;
|
|
728
|
+
workoutSourceId: string;
|
|
729
|
+
consumer: null;
|
|
730
|
+
atpPlanId: null;
|
|
731
|
+
workoutNameI18nKey: null;
|
|
732
|
+
descriptionI18nKey: null;
|
|
733
|
+
shared: boolean;
|
|
734
|
+
estimated: boolean;
|
|
735
|
+
}
|
|
736
|
+
export interface IWorkoutDetail extends IWorkout {
|
|
737
|
+
workoutSegments: IWorkoutSegment[];
|
|
738
|
+
}
|
|
739
|
+
export interface IAuthor {
|
|
740
|
+
userProfilePk: null;
|
|
741
|
+
displayName: null;
|
|
742
|
+
fullName: null;
|
|
743
|
+
profileImgNameLarge: null;
|
|
744
|
+
profileImgNameMedium: null;
|
|
745
|
+
profileImgNameSmall: null;
|
|
746
|
+
userPro: boolean;
|
|
747
|
+
vivokidUser: boolean;
|
|
748
|
+
}
|
|
749
|
+
export interface IUnit {
|
|
750
|
+
unitId: null;
|
|
751
|
+
unitKey: null;
|
|
752
|
+
factor: null;
|
|
753
|
+
}
|
|
754
|
+
export interface ISportType {
|
|
755
|
+
sportTypeId: number;
|
|
756
|
+
sportTypeKey: string;
|
|
757
|
+
displayOrder?: number;
|
|
758
|
+
}
|
|
759
|
+
export interface IWorkoutSegment {
|
|
760
|
+
segmentOrder: number;
|
|
761
|
+
sportType: ISportType;
|
|
762
|
+
workoutSteps: IWorkoutStep[];
|
|
763
|
+
}
|
|
764
|
+
export interface IWorkoutStep {
|
|
765
|
+
type: string;
|
|
766
|
+
stepId: number;
|
|
767
|
+
stepOrder: number;
|
|
768
|
+
stepType: IStepType;
|
|
769
|
+
childStepId: null;
|
|
770
|
+
description: null;
|
|
771
|
+
endCondition: IEndCondition;
|
|
772
|
+
endConditionValue: number | null;
|
|
773
|
+
preferredEndConditionUnit: IUnit | null;
|
|
774
|
+
endConditionCompare: null;
|
|
775
|
+
targetType: ITargetType;
|
|
776
|
+
targetValueOne: null;
|
|
777
|
+
targetValueTwo: null;
|
|
778
|
+
targetValueUnit: null;
|
|
779
|
+
zoneNumber: null;
|
|
780
|
+
secondaryTargetType: null;
|
|
781
|
+
secondaryTargetValueOne: null;
|
|
782
|
+
secondaryTargetValueTwo: null;
|
|
783
|
+
secondaryTargetValueUnit: null;
|
|
784
|
+
secondaryZoneNumber: null;
|
|
785
|
+
endConditionZone: null;
|
|
786
|
+
strokeType: IStrokeType;
|
|
787
|
+
equipmentType: IEquipmentType;
|
|
788
|
+
category: null;
|
|
789
|
+
exerciseName: null;
|
|
790
|
+
workoutProvider: null;
|
|
791
|
+
providerExerciseSourceId: null;
|
|
792
|
+
weightValue: null;
|
|
793
|
+
weightUnit: null;
|
|
794
|
+
}
|
|
795
|
+
export interface IEndCondition {
|
|
796
|
+
conditionTypeId: number;
|
|
797
|
+
conditionTypeKey: string;
|
|
798
|
+
displayOrder: number;
|
|
799
|
+
displayable: boolean;
|
|
800
|
+
}
|
|
801
|
+
export interface IEquipmentType {
|
|
802
|
+
equipmentTypeId: number;
|
|
803
|
+
equipmentTypeKey: null;
|
|
804
|
+
displayOrder: number;
|
|
805
|
+
}
|
|
806
|
+
export interface IStepType {
|
|
807
|
+
stepTypeId: number;
|
|
808
|
+
stepTypeKey: string;
|
|
809
|
+
displayOrder: number;
|
|
810
|
+
}
|
|
811
|
+
export interface IStrokeType {
|
|
812
|
+
strokeTypeId: number;
|
|
813
|
+
strokeTypeKey: null;
|
|
814
|
+
displayOrder: number;
|
|
815
|
+
}
|
|
816
|
+
export interface ITargetType {
|
|
817
|
+
workoutTargetTypeId: number;
|
|
818
|
+
workoutTargetTypeKey: string;
|
|
819
|
+
displayOrder: number;
|
|
820
|
+
}
|
|
@@ -3,45 +3,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
var RunningTemplate_1 = __importDefault(require("./templates/RunningTemplate"));
|
|
7
|
+
var Running = /** @class */ (function () {
|
|
8
|
+
function Running() {
|
|
9
9
|
this.data = (0, RunningTemplate_1.default)();
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
Object.defineProperty(Running.prototype, "name", {
|
|
12
|
+
get: function () {
|
|
13
|
+
return this.data.workoutName;
|
|
14
|
+
},
|
|
15
|
+
set: function (name) {
|
|
16
|
+
this.data.workoutName = "".concat(name);
|
|
17
|
+
},
|
|
18
|
+
enumerable: false,
|
|
19
|
+
configurable: true
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(Running.prototype, "distance", {
|
|
22
|
+
get: function () {
|
|
23
|
+
return (this.data.workoutSegments[0].workoutSteps[0].endConditionValue || 0);
|
|
24
|
+
},
|
|
25
|
+
set: function (meters) {
|
|
26
|
+
this.data.workoutSegments[0].workoutSteps[0].endConditionValue =
|
|
27
|
+
Math.round(meters);
|
|
28
|
+
},
|
|
29
|
+
enumerable: false,
|
|
30
|
+
configurable: true
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(Running.prototype, "workoutId", {
|
|
33
|
+
get: function () {
|
|
34
|
+
return this.data.workoutId;
|
|
35
|
+
},
|
|
36
|
+
set: function (workoutId) {
|
|
37
|
+
this.data.workoutId = workoutId;
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(Running.prototype, "description", {
|
|
43
|
+
get: function () {
|
|
44
|
+
return this.data.description;
|
|
45
|
+
},
|
|
46
|
+
set: function (description) {
|
|
47
|
+
this.data.description = description;
|
|
48
|
+
},
|
|
49
|
+
enumerable: false,
|
|
50
|
+
configurable: true
|
|
51
|
+
});
|
|
52
|
+
Running.prototype.isValid = function () {
|
|
37
53
|
return !!(this.name && this.distance);
|
|
38
|
-
}
|
|
39
|
-
toJson() {
|
|
54
|
+
};
|
|
55
|
+
Running.prototype.toJson = function () {
|
|
40
56
|
return this.data;
|
|
41
|
-
}
|
|
42
|
-
toString() {
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
57
|
+
};
|
|
58
|
+
Running.prototype.toString = function () {
|
|
59
|
+
return "".concat(this.name, ", ").concat((this.distance / 1000).toFixed(2), "km");
|
|
60
|
+
};
|
|
61
|
+
return Running;
|
|
62
|
+
}());
|
|
46
63
|
exports.default = Running;
|
|
47
64
|
//# sourceMappingURL=Running.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Running.js","sourceRoot":"","sources":["../../../src/garmin/workouts/Running.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Running.js","sourceRoot":"","sources":["../../../src/garmin/workouts/Running.ts"],"names":[],"mappings":";;;;;AAAA,gFAAwE;AAExE;IAEI;QACI,IAAI,CAAC,IAAI,GAAG,IAAA,yBAAQ,GAAE,CAAC;IAC3B,CAAC;IAED,sBAAI,yBAAI;aAAR;YACI,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QACjC,CAAC;aAED,UAAS,IAAI;YACT,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,UAAG,IAAI,CAAE,CAAC;QACtC,CAAC;;;OAJA;IAMD,sBAAI,6BAAQ;aAAZ;YACI,OAAO,CACH,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB,IAAI,CAAC,CACtE,CAAC;QACN,CAAC;aAED,UAAa,MAAc;YACvB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,iBAAiB;gBAC1D,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;;;OALA;IAOD,sBAAI,8BAAS;aAAb;YACI,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAC/B,CAAC;aAED,UAAc,SAAS;YACnB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QACpC,CAAC;;;OAJA;IAMD,sBAAI,gCAAW;aAAf;YACI,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QACjC,CAAC;aAED,UAAgB,WAAW;YACvB,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QACxC,CAAC;;;OAJA;IAMD,yBAAO,GAAP;QACI,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,wBAAM,GAAN;QACI,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,0BAAQ,GAAR;QACI,OAAO,UAAG,IAAI,CAAC,IAAI,eAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAI,CAAC;IAClE,CAAC;IACL,cAAC;AAAD,CAAC,AApDD,IAoDC"}
|
package/dist/utils.js
CHANGED
|
@@ -24,20 +24,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.writeToFile = exports.createDirectory = exports.checkIsDirectory = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
var fs = __importStar(require("node:fs"));
|
|
28
|
+
var checkIsDirectory = function (filePath) {
|
|
29
29
|
return fs.existsSync(filePath) && fs.lstatSync(filePath).isDirectory();
|
|
30
30
|
};
|
|
31
31
|
exports.checkIsDirectory = checkIsDirectory;
|
|
32
|
-
|
|
32
|
+
var createDirectory = function (directoryPath) {
|
|
33
33
|
fs.mkdirSync(directoryPath);
|
|
34
34
|
};
|
|
35
35
|
exports.createDirectory = createDirectory;
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
37
|
-
|
|
37
|
+
var writeToFile = function (filePath, data) {
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39
39
|
// @ts-ignore
|
|
40
|
-
fs.writeFileSync(filePath, data, (error)
|
|
40
|
+
fs.writeFileSync(filePath, data, function (error) {
|
|
41
41
|
if (error)
|
|
42
42
|
throw error;
|
|
43
43
|
});
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAA8B;AAGvB,IAAM,gBAAgB,GAAG,UAAC,QAAgB;IAC7C,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3E,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,IAAM,eAAe,GAAG,UAAC,aAAqB;IACjD,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AAChC,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF,6EAA6E;AACtE,IAAM,WAAW,GAAG,UAAC,QAAgB,EAAE,IAAS;IACnD,6DAA6D;IAC7D,aAAa;IACb,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAC,KAAK;QACnC,IAAI,KAAK;YAAE,MAAM,KAAK,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooin/garmin-connect",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Makes it simple to interface with Garmin Connect to get or set any data point",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -55,14 +55,12 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"app-root-path": "^3.1.0",
|
|
57
57
|
"axios": "^1.5.1",
|
|
58
|
-
"cloudscraper": "^4.6.0",
|
|
59
58
|
"crypto": "^1.0.1",
|
|
60
59
|
"form-data": "^4.0.0",
|
|
61
60
|
"lodash": "^4.17.21",
|
|
62
61
|
"luxon": "^3.4.3",
|
|
63
62
|
"oauth-1.0a": "^2.2.6",
|
|
64
|
-
"qs": "^6.11.2"
|
|
65
|
-
"request": "^2.88.2"
|
|
63
|
+
"qs": "^6.11.2"
|
|
66
64
|
},
|
|
67
65
|
"pre-commit": "pretty"
|
|
68
66
|
}
|