@flow-js/garmin-connect 1.6.6 → 1.6.7

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.
@@ -19,167 +19,91 @@ export interface MonthCalendar {
19
19
  numOfDaysInMonth: number;
20
20
  numOfDaysInPrevMonth: number;
21
21
  startDayOfMonth: number;
22
- calendarItems: Array<{
23
- id: number;
24
- groupId: number | null;
25
- trainingPlanId: number | null;
26
- activityTypeId: number | null;
27
- wellnessActivityUuid: string | null;
28
- duration: number | null;
29
- distance: number | null;
30
- calories: number | null;
31
- floorsClimbed: number | null;
32
- avgRespirationRate: number | null;
33
- unitOfPoolLength: string | null;
34
- courseId: number | null;
35
- courseName: string | null;
36
- sportTypeKey: string | null;
37
- url: string | null;
38
- isStart: boolean | null;
39
- recurrenceId: number | null;
40
- isParent: boolean | null;
41
- parentId: number | null;
42
- userBadgeId: number | null;
43
- badgeCategoryTypeId: number | null;
44
- badgeCategoryTypeDesc: string | null;
45
- badgeAwardedDate: string | null;
46
- badgeViewed: boolean | null;
47
- hideBadge: boolean | null;
48
- startTimestampLocal: string | null;
49
- diveNumber: number | null;
50
- maxDepth: number | null;
51
- avgDepth: number | null;
52
- surfaceInterval: number | null;
53
- elapsedDuration: number | null;
54
- lapCount: number | null;
55
- bottomTime: number | null;
56
- atpPlanId: number | null;
57
- workoutId: number | null;
58
- protectedWorkoutSchedule: boolean;
59
- activeSets: number | null;
60
- strokes: number | null;
61
- noOfSplits: number | null;
62
- maxGradeValue: object | null;
63
- totalAscent: number | null;
64
- differenceStress: number | null;
65
- climbDuration: number | null;
66
- maxSpeed: number | null;
67
- averageHR: number | null;
68
- activeSplitSummaryDuration: number | null;
69
- activeSplitSummaryDistance: number | null;
70
- maxSplitDistance: number | null;
71
- maxSplitSpeed: number | null;
72
- location: string | null;
73
- shareableEventUuid: string | null;
74
- splitSummaryMode: string | null;
75
- workoutUuid: string | null;
76
- napStartTimeLocal: string | null;
77
- beginPackWeight: number | null;
78
- hasSplits: boolean | null;
79
- shareableEvent: boolean;
80
- primaryEvent: boolean | null;
81
- autoCalcCalories: boolean | null;
82
- subscribed: boolean | null;
83
- phasedTrainingPlan: boolean | null;
84
- decoDive: boolean | null;
85
- itemType: string;
86
- title: string | null;
87
- date: string;
88
- weight?: number | null;
89
- difference?: number | null;
90
- isRace?: boolean | null;
91
- eventTimeLocal?: {
92
- startTimeHhMm: string;
93
- timeZoneId: string;
94
- } | null;
95
- completionTarget?: {
96
- value: number;
97
- unit: string;
98
- unitType: string;
99
- } | null;
100
- }>;
22
+ calendarItems: Array<CalendarItem>;
101
23
  }
102
24
  export interface WeekCalendar {
103
25
  startDate: string;
104
26
  endDate: string;
105
27
  numOfDaysInMonth: number;
106
- calendarItems: Array<{
107
- id: number;
108
- groupId: number | null;
109
- trainingPlanId: number | null;
110
- activityTypeId: number | null;
111
- wellnessActivityUuid: string | null;
112
- duration: number | null;
113
- distance: number | null;
114
- calories: number | null;
115
- floorsClimbed: number | null;
116
- avgRespirationRate: number | null;
117
- unitOfPoolLength: string | null;
118
- courseId: number | null;
119
- courseName: string | null;
120
- sportTypeKey: string | null;
121
- url: string | null;
122
- isStart: boolean | null;
123
- recurrenceId: number | null;
124
- isParent: boolean | null;
125
- parentId: number | null;
126
- userBadgeId: number | null;
127
- badgeCategoryTypeId: number | null;
128
- badgeCategoryTypeDesc: string | null;
129
- badgeAwardedDate: string | null;
130
- badgeViewed: boolean | null;
131
- hideBadge: boolean | null;
132
- startTimestampLocal: string | null;
133
- diveNumber: number | null;
134
- maxDepth: number | null;
135
- avgDepth: number | null;
136
- surfaceInterval: number | null;
137
- elapsedDuration: number | null;
138
- lapCount: number | null;
139
- bottomTime: number | null;
140
- atpPlanId: number | null;
141
- workoutId: number | null;
142
- protectedWorkoutSchedule: boolean;
143
- activeSets: number | null;
144
- strokes: number | null;
145
- noOfSplits: number | null;
146
- maxGradeValue: object | null;
147
- totalAscent: number | null;
148
- differenceStress: number | null;
149
- climbDuration: number | null;
150
- maxSpeed: number | null;
151
- averageHR: number | null;
152
- activeSplitSummaryDuration: number | null;
153
- activeSplitSummaryDistance: number | null;
154
- maxSplitDistance: number | null;
155
- maxSplitSpeed: number | null;
156
- location: string | null;
157
- shareableEventUuid: string | null;
158
- splitSummaryMode: string | null;
159
- workoutUuid: string | null;
160
- napStartTimeLocal: string | null;
161
- beginPackWeight: number | null;
162
- hasSplits: boolean | null;
163
- shareableEvent: boolean;
164
- primaryEvent: boolean | null;
165
- autoCalcCalories: boolean | null;
166
- subscribed: boolean | null;
167
- phasedTrainingPlan: boolean | null;
168
- decoDive: boolean | null;
169
- itemType: string;
170
- title: string | null;
171
- date: string;
172
- weight?: number | null;
173
- difference?: number | null;
174
- isRace?: boolean | null;
175
- eventTimeLocal?: {
176
- startTimeHhMm: string;
177
- timeZoneId: string;
178
- } | null;
179
- completionTarget?: {
180
- value: number;
181
- unit: string;
182
- unitType: string;
183
- } | null;
184
- }>;
28
+ calendarItems: Array<CalendarItem>;
185
29
  }
30
+ type CalendarItem = {
31
+ id: number;
32
+ groupId: number | null;
33
+ trainingPlanId: number | null;
34
+ activityTypeId: number | null;
35
+ wellnessActivityUuid: string | null;
36
+ duration: number | null;
37
+ distance: number | null;
38
+ calories: number | null;
39
+ floorsClimbed: number | null;
40
+ avgRespirationRate: number | null;
41
+ unitOfPoolLength: string | null;
42
+ courseId: number | null;
43
+ courseName: string | null;
44
+ sportTypeKey: string | null;
45
+ url: string | null;
46
+ isStart: boolean | null;
47
+ recurrenceId: number | null;
48
+ isParent: boolean | null;
49
+ parentId: number | null;
50
+ userBadgeId: number | null;
51
+ badgeCategoryTypeId: number | null;
52
+ badgeCategoryTypeDesc: string | null;
53
+ badgeAwardedDate: string | null;
54
+ badgeViewed: boolean | null;
55
+ hideBadge: boolean | null;
56
+ startTimestampLocal: string | null;
57
+ diveNumber: number | null;
58
+ maxDepth: number | null;
59
+ avgDepth: number | null;
60
+ surfaceInterval: number | null;
61
+ elapsedDuration: number | null;
62
+ lapCount: number | null;
63
+ bottomTime: number | null;
64
+ atpPlanId: number | null;
65
+ workoutId: number | null;
66
+ protectedWorkoutSchedule: boolean;
67
+ activeSets: number | null;
68
+ strokes: number | null;
69
+ noOfSplits: number | null;
70
+ maxGradeValue: object | null;
71
+ totalAscent: number | null;
72
+ differenceStress: number | null;
73
+ climbDuration: number | null;
74
+ maxSpeed: number | null;
75
+ averageHR: number | null;
76
+ activeSplitSummaryDuration: number | null;
77
+ activeSplitSummaryDistance: number | null;
78
+ maxSplitDistance: number | null;
79
+ maxSplitSpeed: number | null;
80
+ location: string | null;
81
+ shareableEventUuid: string | null;
82
+ splitSummaryMode: string | null;
83
+ workoutUuid: string | null;
84
+ napStartTimeLocal: string | null;
85
+ beginPackWeight: number | null;
86
+ hasSplits: boolean | null;
87
+ shareableEvent: boolean;
88
+ primaryEvent: boolean | null;
89
+ autoCalcCalories: boolean | null;
90
+ subscribed: boolean | null;
91
+ phasedTrainingPlan: boolean | null;
92
+ decoDive: boolean | null;
93
+ itemType: string;
94
+ title: string | null;
95
+ date: string;
96
+ weight?: number | null;
97
+ difference?: number | null;
98
+ isRace?: boolean | null;
99
+ eventTimeLocal?: {
100
+ startTimeHhMm: string;
101
+ timeZoneId: string;
102
+ } | null;
103
+ completionTarget?: {
104
+ value: number;
105
+ unit: string;
106
+ unitType: string;
107
+ } | null;
108
+ };
109
+ export {};
@@ -16,7 +16,7 @@ const {
16
16
  NoTarget,
17
17
  StepType,
18
18
  WorkoutType
19
- } = require('garmin-connect');
19
+ } = require('@flow-js/garmin-connect`');
20
20
 
21
21
  (async function () {
22
22
  const GARMIN_USERNAME = process.env.GARMIN_USERNAME;
@@ -1,4 +1,4 @@
1
- const { GarminConnect } = require('garmin-connect');
1
+ const { GarminConnect } = require('@flow-js/garmin-connect`');
2
2
 
3
3
  // Has to be run in an async function to be able to use the await keyword
4
4
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flow-js/garmin-connect",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
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",
@@ -1,16 +0,0 @@
1
- import { IRunningWorkout } from './templates/RunningTemplate';
2
- export default class Running {
3
- private data;
4
- constructor();
5
- get name(): string;
6
- set name(name: string);
7
- get distance(): number;
8
- set distance(meters: number);
9
- get workoutId(): string | undefined;
10
- set workoutId(workoutId: string | undefined);
11
- get description(): string | undefined;
12
- set description(description: string | undefined);
13
- isValid(): boolean;
14
- toJson(): IRunningWorkout;
15
- toString(): string;
16
- }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var RunningTemplate_1 = __importDefault(require("./templates/RunningTemplate"));
7
- var Running = /** @class */ (function () {
8
- function Running() {
9
- this.data = (0, RunningTemplate_1.default)();
10
- }
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 () {
53
- return !!(this.name && this.distance);
54
- };
55
- Running.prototype.toJson = function () {
56
- return this.data;
57
- };
58
- Running.prototype.toString = function () {
59
- return "".concat(this.name, ", ").concat((this.distance / 1000).toFixed(2), "km");
60
- };
61
- return Running;
62
- }());
63
- exports.default = Running;
64
- //# sourceMappingURL=Running.js.map
@@ -1 +0,0 @@
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"}
@@ -1,68 +0,0 @@
1
- export interface ISportType {
2
- sportTypeId: number;
3
- sportTypeKey: SportTypeKey;
4
- }
5
- declare enum SportTypeKey {
6
- running = "running"
7
- }
8
- export interface IRunningWorkout {
9
- workoutId: string | undefined;
10
- description: string | undefined;
11
- sportType: ISportType;
12
- workoutName: string;
13
- workoutSegments: IWorkoutSegment[];
14
- }
15
- export interface IWorkoutSegment {
16
- segmentOrder: number;
17
- sportType: ISportType;
18
- workoutSteps: IWorkoutStep[];
19
- }
20
- export interface IWorkoutStep {
21
- type: WorkoutStepType;
22
- stepId: unknown;
23
- stepOrder: number;
24
- childStepId: unknown;
25
- description: string | null;
26
- stepType: IStepType;
27
- endCondition: IEndCondition;
28
- preferredEndConditionUnit: IPreferredEndConditionUnit;
29
- endConditionValue: number | null;
30
- endConditionCompare: null;
31
- endConditionZone: null;
32
- targetType: ITargetType;
33
- targetValueOne: null;
34
- targetValueTwo: null;
35
- zoneNumber: null;
36
- }
37
- declare enum WorkoutStepType {
38
- executableStepDTO = "ExecutableStepDTO"
39
- }
40
- export interface IStepType {
41
- stepTypeId: number;
42
- stepTypeKey: StepTypeKey;
43
- }
44
- declare enum StepTypeKey {
45
- interval = "interval"
46
- }
47
- export interface IEndCondition {
48
- conditionTypeKey: ConditionTypeKey;
49
- conditionTypeId: number;
50
- }
51
- declare enum ConditionTypeKey {
52
- distance = "distance"
53
- }
54
- export interface IPreferredEndConditionUnit {
55
- unitKey: UnitKey;
56
- }
57
- declare enum UnitKey {
58
- kilometer = "kilometer"
59
- }
60
- export interface ITargetType {
61
- workoutTargetTypeId: number;
62
- workoutTargetTypeKey: WorkoutTargetTypeKey;
63
- }
64
- declare enum WorkoutTargetTypeKey {
65
- noTarget = "no.target"
66
- }
67
- export default function (): IRunningWorkout;
68
- export {};
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var SportTypeKey;
4
- (function (SportTypeKey) {
5
- SportTypeKey["running"] = "running";
6
- })(SportTypeKey || (SportTypeKey = {}));
7
- var WorkoutStepType;
8
- (function (WorkoutStepType) {
9
- WorkoutStepType["executableStepDTO"] = "ExecutableStepDTO";
10
- })(WorkoutStepType || (WorkoutStepType = {}));
11
- var StepTypeKey;
12
- (function (StepTypeKey) {
13
- StepTypeKey["interval"] = "interval";
14
- })(StepTypeKey || (StepTypeKey = {}));
15
- var ConditionTypeKey;
16
- (function (ConditionTypeKey) {
17
- ConditionTypeKey["distance"] = "distance";
18
- })(ConditionTypeKey || (ConditionTypeKey = {}));
19
- var UnitKey;
20
- (function (UnitKey) {
21
- UnitKey["kilometer"] = "kilometer";
22
- })(UnitKey || (UnitKey = {}));
23
- var WorkoutTargetTypeKey;
24
- (function (WorkoutTargetTypeKey) {
25
- WorkoutTargetTypeKey["noTarget"] = "no.target";
26
- })(WorkoutTargetTypeKey || (WorkoutTargetTypeKey = {}));
27
- function default_1() {
28
- return {
29
- description: undefined,
30
- workoutId: undefined,
31
- sportType: {
32
- sportTypeId: 1,
33
- sportTypeKey: SportTypeKey.running
34
- },
35
- workoutName: '',
36
- workoutSegments: [
37
- {
38
- segmentOrder: 1,
39
- sportType: {
40
- sportTypeId: 1,
41
- sportTypeKey: SportTypeKey.running
42
- },
43
- workoutSteps: [
44
- {
45
- type: WorkoutStepType.executableStepDTO,
46
- stepId: null,
47
- stepOrder: 1,
48
- childStepId: null,
49
- description: null,
50
- stepType: {
51
- stepTypeId: 3,
52
- stepTypeKey: StepTypeKey.interval
53
- },
54
- endCondition: {
55
- conditionTypeKey: ConditionTypeKey.distance,
56
- conditionTypeId: 3
57
- },
58
- preferredEndConditionUnit: {
59
- unitKey: UnitKey.kilometer
60
- },
61
- endConditionValue: null,
62
- endConditionCompare: null,
63
- endConditionZone: null,
64
- targetType: {
65
- workoutTargetTypeId: 1,
66
- workoutTargetTypeKey: WorkoutTargetTypeKey.noTarget
67
- },
68
- targetValueOne: null,
69
- targetValueTwo: null,
70
- zoneNumber: null
71
- }
72
- ]
73
- }
74
- ]
75
- };
76
- }
77
- exports.default = default_1;
78
- //# sourceMappingURL=RunningTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RunningTemplate.js","sourceRoot":"","sources":["../../../../src/garmin/workouts/templates/RunningTemplate.ts"],"names":[],"mappings":";;AAKA,IAAK,YAEJ;AAFD,WAAK,YAAY;IACb,mCAAmB,CAAA;AACvB,CAAC,EAFI,YAAY,KAAZ,YAAY,QAEhB;AAkCD,IAAK,eAEJ;AAFD,WAAK,eAAe;IAChB,0DAAuC,CAAA;AAC3C,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAOD,IAAK,WAEJ;AAFD,WAAK,WAAW;IACZ,oCAAqB,CAAA;AACzB,CAAC,EAFI,WAAW,KAAX,WAAW,QAEf;AAOD,IAAK,gBAEJ;AAFD,WAAK,gBAAgB;IACjB,yCAAqB,CAAA;AACzB,CAAC,EAFI,gBAAgB,KAAhB,gBAAgB,QAEpB;AAMD,IAAK,OAEJ;AAFD,WAAK,OAAO;IACR,kCAAuB,CAAA;AAC3B,CAAC,EAFI,OAAO,KAAP,OAAO,QAEX;AAOD,IAAK,oBAEJ;AAFD,WAAK,oBAAoB;IACrB,8CAAsB,CAAA;AAC1B,CAAC,EAFI,oBAAoB,KAApB,oBAAoB,QAExB;AAED;IACI,OAAO;QACH,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE;YACP,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,YAAY,CAAC,OAAO;SACrC;QACD,WAAW,EAAE,EAAE;QACf,eAAe,EAAE;YACb;gBACI,YAAY,EAAE,CAAC;gBACf,SAAS,EAAE;oBACP,WAAW,EAAE,CAAC;oBACd,YAAY,EAAE,YAAY,CAAC,OAAO;iBACrC;gBACD,YAAY,EAAE;oBACV;wBACI,IAAI,EAAE,eAAe,CAAC,iBAAiB;wBACvC,MAAM,EAAE,IAAI;wBACZ,SAAS,EAAE,CAAC;wBACZ,WAAW,EAAE,IAAI;wBACjB,WAAW,EAAE,IAAI;wBACjB,QAAQ,EAAE;4BACN,UAAU,EAAE,CAAC;4BACb,WAAW,EAAE,WAAW,CAAC,QAAQ;yBACpC;wBACD,YAAY,EAAE;4BACV,gBAAgB,EAAE,gBAAgB,CAAC,QAAQ;4BAC3C,eAAe,EAAE,CAAC;yBACrB;wBACD,yBAAyB,EAAE;4BACvB,OAAO,EAAE,OAAO,CAAC,SAAS;yBAC7B;wBACD,iBAAiB,EAAE,IAAI;wBACvB,mBAAmB,EAAE,IAAI;wBACzB,gBAAgB,EAAE,IAAI;wBACtB,UAAU,EAAE;4BACR,mBAAmB,EAAE,CAAC;4BACtB,oBAAoB,EAAE,oBAAoB,CAAC,QAAQ;yBACtD;wBACD,cAAc,EAAE,IAAI;wBACpB,cAAc,EAAE,IAAI;wBACpB,UAAU,EAAE,IAAI;qBACnB;iBACJ;aACJ;SACJ;KACJ,CAAC;AACN,CAAC;AAjDD,4BAiDC"}