@gooin/garmin-connect 1.6.9 → 1.6.10
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/dist/common/HttpClient.d.ts +37 -37
- package/dist/common/HttpClient.js +345 -332
- package/dist/common/HttpClient.js.map +1 -1
- package/dist/garmin/GarminConnect.d.ts +84 -84
- package/dist/garmin/GarminConnect.js +470 -470
- package/dist/garmin/UrlClass.d.ts +43 -43
- package/dist/garmin/UrlClass.js +124 -124
- package/dist/garmin/common/DateUtils.d.ts +6 -6
- package/dist/garmin/common/DateUtils.js +37 -37
- package/dist/garmin/common/HydrationUtils.d.ts +2 -2
- package/dist/garmin/common/HydrationUtils.js +15 -15
- package/dist/garmin/common/WeightUtils.d.ts +1 -1
- package/dist/garmin/common/WeightUtils.js +8 -8
- package/dist/garmin/types/activity.d.ts +408 -408
- package/dist/garmin/types/activity.js +26 -26
- package/dist/garmin/types/course.d.ts +146 -146
- package/dist/garmin/types/course.js +2 -2
- package/dist/garmin/types/golf.d.ts +67 -67
- package/dist/garmin/types/golf.js +2 -2
- package/dist/garmin/types/heartrate.d.ts +22 -22
- package/dist/garmin/types/heartrate.js +1 -1
- package/dist/garmin/types/hydration.d.ts +28 -28
- package/dist/garmin/types/hydration.js +1 -1
- package/dist/garmin/types/index.d.ts +541 -541
- package/dist/garmin/types/index.js +16 -16
- package/dist/garmin/types/sleep.d.ts +120 -120
- package/dist/garmin/types/sleep.js +2 -2
- package/dist/garmin/types/weight.d.ts +42 -42
- package/dist/garmin/types/weight.js +2 -2
- package/dist/garmin/workouts/Running.d.ts +16 -16
- package/dist/garmin/workouts/Running.js +46 -46
- package/dist/garmin/workouts/templates/RunningTemplate.d.ts +68 -68
- package/dist/garmin/workouts/templates/RunningTemplate.js +77 -77
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +36 -36
- package/package.json +1 -1
- package/dist/common/CFClient.d.ts +0 -22
- package/dist/common/CFClient.js +0 -137
- package/dist/common/CFClient.js.map +0 -1
- package/dist/common/DateUtils.d.ts +0 -1
- package/dist/common/DateUtils.js +0 -11
- package/dist/common/DateUtils.js.map +0 -1
- package/dist/garmin/GarminConnect copy.d.ts +0 -76
- package/dist/garmin/GarminConnect copy.js +0 -397
- package/dist/garmin/GarminConnect copy.js.map +0 -1
- package/dist/garmin/GarminConnect_new.d.ts +0 -76
- package/dist/garmin/GarminConnect_new.js +0 -397
- package/dist/garmin/GarminConnect_new.js.map +0 -1
- package/dist/garmin/GarminConnect_old.d.ts +0 -75
- package/dist/garmin/GarminConnect_old.js +0 -386
- package/dist/garmin/GarminConnect_old.js.map +0 -1
- package/dist/garmin/Urls copy.d.ts +0 -66
- package/dist/garmin/Urls copy.js +0 -109
- package/dist/garmin/Urls copy.js.map +0 -1
- package/dist/garmin/Urls.d.ts +0 -64
- package/dist/garmin/Urls.js +0 -104
- package/dist/garmin/Urls.js.map +0 -1
- package/dist/garmin/types.d.ts +0 -927
- package/dist/garmin/types.js +0 -17
- package/dist/garmin/types.js.map +0 -1
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { GCCourseId, GCWorkoutId, GarminDomain } from './types';
|
|
2
|
-
export declare class UrlClass {
|
|
3
|
-
private domain;
|
|
4
|
-
GC_MODERN: string;
|
|
5
|
-
GARMIN_SSO_ORIGIN: string;
|
|
6
|
-
GC_API: string;
|
|
7
|
-
constructor(domain?: GarminDomain);
|
|
8
|
-
get GARMIN_SSO(): string;
|
|
9
|
-
get GARMIN_SSO_EMBED(): string;
|
|
10
|
-
get BASE_URL(): string;
|
|
11
|
-
get SIGNIN_URL(): string;
|
|
12
|
-
get LOGIN_URL(): string;
|
|
13
|
-
get OAUTH_URL(): string;
|
|
14
|
-
get USER_SETTINGS(): string;
|
|
15
|
-
get USER_PROFILE(): string;
|
|
16
|
-
get ACTIVITIES(): string;
|
|
17
|
-
get ACTIVITY(): string;
|
|
18
|
-
get STAT_ACTIVITIES(): string;
|
|
19
|
-
get DOWNLOAD_ZIP(): string;
|
|
20
|
-
get DOWNLOAD_GPX(): string;
|
|
21
|
-
get DOWNLOAD_TCX(): string;
|
|
22
|
-
get DOWNLOAD_KML(): string;
|
|
23
|
-
get UPLOAD(): string;
|
|
24
|
-
get DOWNLOAD_WELLNESS(): string;
|
|
25
|
-
get IMPORT_DATA(): string;
|
|
26
|
-
get DAILY_STEPS(): string;
|
|
27
|
-
get DAILY_SLEEP(): string;
|
|
28
|
-
get DAILY_WEIGHT(): string;
|
|
29
|
-
get UPDATE_WEIGHT(): string;
|
|
30
|
-
get DAILY_HYDRATION(): string;
|
|
31
|
-
get HYDRATION_LOG(): string;
|
|
32
|
-
get GOLF_SCORECARD_SUMMARY(): string;
|
|
33
|
-
get GOLF_SCORECARD_DETAIL(): string;
|
|
34
|
-
get DAILY_HEART_RATE(): string;
|
|
35
|
-
WORKOUT(id?: GCWorkoutId): string;
|
|
36
|
-
get WORKOUTS(): string;
|
|
37
|
-
get SCHEDULE_WORKOUTS(): string;
|
|
38
|
-
CALENDAR(yaer: number, month: number): string;
|
|
39
|
-
COURSE(id?: GCCourseId): string;
|
|
40
|
-
get COURSE_FAVORITE(): string;
|
|
41
|
-
get COURSE_OWNER(): string;
|
|
42
|
-
get CONSENT_GRANT(): string;
|
|
43
|
-
}
|
|
1
|
+
import { GCCourseId, GCWorkoutId, GarminDomain } from './types';
|
|
2
|
+
export declare class UrlClass {
|
|
3
|
+
private domain;
|
|
4
|
+
GC_MODERN: string;
|
|
5
|
+
GARMIN_SSO_ORIGIN: string;
|
|
6
|
+
GC_API: string;
|
|
7
|
+
constructor(domain?: GarminDomain);
|
|
8
|
+
get GARMIN_SSO(): string;
|
|
9
|
+
get GARMIN_SSO_EMBED(): string;
|
|
10
|
+
get BASE_URL(): string;
|
|
11
|
+
get SIGNIN_URL(): string;
|
|
12
|
+
get LOGIN_URL(): string;
|
|
13
|
+
get OAUTH_URL(): string;
|
|
14
|
+
get USER_SETTINGS(): string;
|
|
15
|
+
get USER_PROFILE(): string;
|
|
16
|
+
get ACTIVITIES(): string;
|
|
17
|
+
get ACTIVITY(): string;
|
|
18
|
+
get STAT_ACTIVITIES(): string;
|
|
19
|
+
get DOWNLOAD_ZIP(): string;
|
|
20
|
+
get DOWNLOAD_GPX(): string;
|
|
21
|
+
get DOWNLOAD_TCX(): string;
|
|
22
|
+
get DOWNLOAD_KML(): string;
|
|
23
|
+
get UPLOAD(): string;
|
|
24
|
+
get DOWNLOAD_WELLNESS(): string;
|
|
25
|
+
get IMPORT_DATA(): string;
|
|
26
|
+
get DAILY_STEPS(): string;
|
|
27
|
+
get DAILY_SLEEP(): string;
|
|
28
|
+
get DAILY_WEIGHT(): string;
|
|
29
|
+
get UPDATE_WEIGHT(): string;
|
|
30
|
+
get DAILY_HYDRATION(): string;
|
|
31
|
+
get HYDRATION_LOG(): string;
|
|
32
|
+
get GOLF_SCORECARD_SUMMARY(): string;
|
|
33
|
+
get GOLF_SCORECARD_DETAIL(): string;
|
|
34
|
+
get DAILY_HEART_RATE(): string;
|
|
35
|
+
WORKOUT(id?: GCWorkoutId): string;
|
|
36
|
+
get WORKOUTS(): string;
|
|
37
|
+
get SCHEDULE_WORKOUTS(): string;
|
|
38
|
+
CALENDAR(yaer: number, month: number): string;
|
|
39
|
+
COURSE(id?: GCCourseId): string;
|
|
40
|
+
get COURSE_FAVORITE(): string;
|
|
41
|
+
get COURSE_OWNER(): string;
|
|
42
|
+
get CONSENT_GRANT(): string;
|
|
43
|
+
}
|
package/dist/garmin/UrlClass.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlClass = void 0;
|
|
4
|
-
class UrlClass {
|
|
5
|
-
constructor(domain = 'garmin.com') {
|
|
6
|
-
this.domain = domain;
|
|
7
|
-
this.GC_MODERN = `https://connect.${this.domain}/modern`;
|
|
8
|
-
this.GARMIN_SSO_ORIGIN = `https://sso.${this.domain}`;
|
|
9
|
-
this.GC_API = `https://connectapi.${this.domain}`;
|
|
10
|
-
}
|
|
11
|
-
get GARMIN_SSO() {
|
|
12
|
-
return `${this.GARMIN_SSO_ORIGIN}/sso`;
|
|
13
|
-
}
|
|
14
|
-
get GARMIN_SSO_EMBED() {
|
|
15
|
-
return `${this.GARMIN_SSO_ORIGIN}/sso/embed`;
|
|
16
|
-
}
|
|
17
|
-
get BASE_URL() {
|
|
18
|
-
return `${this.GC_MODERN}/proxy`;
|
|
19
|
-
}
|
|
20
|
-
get SIGNIN_URL() {
|
|
21
|
-
return `${this.GARMIN_SSO}/signin`;
|
|
22
|
-
}
|
|
23
|
-
get LOGIN_URL() {
|
|
24
|
-
return `${this.GARMIN_SSO}/login`;
|
|
25
|
-
}
|
|
26
|
-
get OAUTH_URL() {
|
|
27
|
-
return `${this.GC_API}/oauth-service/oauth`;
|
|
28
|
-
}
|
|
29
|
-
get USER_SETTINGS() {
|
|
30
|
-
return `${this.GC_API}/userprofile-service/userprofile/user-settings/`;
|
|
31
|
-
}
|
|
32
|
-
get USER_PROFILE() {
|
|
33
|
-
return `${this.GC_API}/userprofile-service/socialProfile`;
|
|
34
|
-
}
|
|
35
|
-
get ACTIVITIES() {
|
|
36
|
-
return `${this.GC_API}/activitylist-service/activities/search/activities`;
|
|
37
|
-
}
|
|
38
|
-
get ACTIVITY() {
|
|
39
|
-
return `${this.GC_API}/activity-service/activity/`;
|
|
40
|
-
}
|
|
41
|
-
get STAT_ACTIVITIES() {
|
|
42
|
-
return `${this.GC_API}/fitnessstats-service/activity`;
|
|
43
|
-
}
|
|
44
|
-
get DOWNLOAD_ZIP() {
|
|
45
|
-
return `${this.GC_API}/download-service/files/activity/`;
|
|
46
|
-
}
|
|
47
|
-
get DOWNLOAD_GPX() {
|
|
48
|
-
return `${this.GC_API}/download-service/export/gpx/activity/`;
|
|
49
|
-
}
|
|
50
|
-
get DOWNLOAD_TCX() {
|
|
51
|
-
return `${this.GC_API}/download-service/export/tcx/activity/`;
|
|
52
|
-
}
|
|
53
|
-
get DOWNLOAD_KML() {
|
|
54
|
-
return `${this.GC_API}/download-service/export/kml/activity/`;
|
|
55
|
-
}
|
|
56
|
-
get UPLOAD() {
|
|
57
|
-
return `${this.GC_API}/upload-service/upload/`;
|
|
58
|
-
}
|
|
59
|
-
get DOWNLOAD_WELLNESS() {
|
|
60
|
-
return `${this.GC_API}/download-service/files/wellness/`;
|
|
61
|
-
}
|
|
62
|
-
get IMPORT_DATA() {
|
|
63
|
-
return `${this.GC_API}/modern/import-data`;
|
|
64
|
-
}
|
|
65
|
-
get DAILY_STEPS() {
|
|
66
|
-
return `${this.GC_API}/usersummary-service/stats/steps/daily/`;
|
|
67
|
-
}
|
|
68
|
-
get DAILY_SLEEP() {
|
|
69
|
-
return `${this.GC_API}/sleep-service/sleep/dailySleepData`;
|
|
70
|
-
}
|
|
71
|
-
get DAILY_WEIGHT() {
|
|
72
|
-
return `${this.GC_API}/weight-service/weight/dayview`;
|
|
73
|
-
}
|
|
74
|
-
get UPDATE_WEIGHT() {
|
|
75
|
-
return `${this.GC_API}/weight-service/user-weight`;
|
|
76
|
-
}
|
|
77
|
-
get DAILY_HYDRATION() {
|
|
78
|
-
return `${this.GC_API}/usersummary-service/usersummary/hydration/allData`;
|
|
79
|
-
}
|
|
80
|
-
get HYDRATION_LOG() {
|
|
81
|
-
return `${this.GC_API}/usersummary-service/usersummary/hydration/log`;
|
|
82
|
-
}
|
|
83
|
-
get GOLF_SCORECARD_SUMMARY() {
|
|
84
|
-
return `${this.GC_API}/gcs-golfcommunity/api/v2/scorecard/summary`;
|
|
85
|
-
}
|
|
86
|
-
get GOLF_SCORECARD_DETAIL() {
|
|
87
|
-
return `${this.GC_API}/gcs-golfcommunity/api/v2/scorecard/detail`;
|
|
88
|
-
}
|
|
89
|
-
get DAILY_HEART_RATE() {
|
|
90
|
-
return `${this.GC_API}/wellness-service/wellness/dailyHeartRate`;
|
|
91
|
-
}
|
|
92
|
-
WORKOUT(id) {
|
|
93
|
-
if (id) {
|
|
94
|
-
return `${this.GC_API}/workout-service/workout/${id}`;
|
|
95
|
-
}
|
|
96
|
-
return `${this.GC_API}/workout-service/workout`;
|
|
97
|
-
}
|
|
98
|
-
get WORKOUTS() {
|
|
99
|
-
return `${this.GC_API}/workout-service/workouts`;
|
|
100
|
-
}
|
|
101
|
-
get SCHEDULE_WORKOUTS() {
|
|
102
|
-
return `${this.GC_API}/workout-service/schedule/`;
|
|
103
|
-
}
|
|
104
|
-
// Garmin use month 0-11, not real month.
|
|
105
|
-
CALENDAR(yaer, month) {
|
|
106
|
-
return `${this.GC_API}/calendar-service/year/${yaer}/month/${month}`;
|
|
107
|
-
}
|
|
108
|
-
COURSE(id) {
|
|
109
|
-
if (id) {
|
|
110
|
-
return `${this.GC_API}/course-service/course/${id}`;
|
|
111
|
-
}
|
|
112
|
-
return `${this.GC_API}/course-service/course`;
|
|
113
|
-
}
|
|
114
|
-
get COURSE_FAVORITE() {
|
|
115
|
-
return `${this.GC_API}/course-service/course/favorites`;
|
|
116
|
-
}
|
|
117
|
-
get COURSE_OWNER() {
|
|
118
|
-
return `${this.GC_API}/web-gateway/course/owner/`;
|
|
119
|
-
}
|
|
120
|
-
get CONSENT_GRANT() {
|
|
121
|
-
return `${this.GC_API}/gdprconsent-service/consent/grant`;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.UrlClass = UrlClass;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UrlClass = void 0;
|
|
4
|
+
class UrlClass {
|
|
5
|
+
constructor(domain = 'garmin.com') {
|
|
6
|
+
this.domain = domain;
|
|
7
|
+
this.GC_MODERN = `https://connect.${this.domain}/modern`;
|
|
8
|
+
this.GARMIN_SSO_ORIGIN = `https://sso.${this.domain}`;
|
|
9
|
+
this.GC_API = `https://connectapi.${this.domain}`;
|
|
10
|
+
}
|
|
11
|
+
get GARMIN_SSO() {
|
|
12
|
+
return `${this.GARMIN_SSO_ORIGIN}/sso`;
|
|
13
|
+
}
|
|
14
|
+
get GARMIN_SSO_EMBED() {
|
|
15
|
+
return `${this.GARMIN_SSO_ORIGIN}/sso/embed`;
|
|
16
|
+
}
|
|
17
|
+
get BASE_URL() {
|
|
18
|
+
return `${this.GC_MODERN}/proxy`;
|
|
19
|
+
}
|
|
20
|
+
get SIGNIN_URL() {
|
|
21
|
+
return `${this.GARMIN_SSO}/signin`;
|
|
22
|
+
}
|
|
23
|
+
get LOGIN_URL() {
|
|
24
|
+
return `${this.GARMIN_SSO}/login`;
|
|
25
|
+
}
|
|
26
|
+
get OAUTH_URL() {
|
|
27
|
+
return `${this.GC_API}/oauth-service/oauth`;
|
|
28
|
+
}
|
|
29
|
+
get USER_SETTINGS() {
|
|
30
|
+
return `${this.GC_API}/userprofile-service/userprofile/user-settings/`;
|
|
31
|
+
}
|
|
32
|
+
get USER_PROFILE() {
|
|
33
|
+
return `${this.GC_API}/userprofile-service/socialProfile`;
|
|
34
|
+
}
|
|
35
|
+
get ACTIVITIES() {
|
|
36
|
+
return `${this.GC_API}/activitylist-service/activities/search/activities`;
|
|
37
|
+
}
|
|
38
|
+
get ACTIVITY() {
|
|
39
|
+
return `${this.GC_API}/activity-service/activity/`;
|
|
40
|
+
}
|
|
41
|
+
get STAT_ACTIVITIES() {
|
|
42
|
+
return `${this.GC_API}/fitnessstats-service/activity`;
|
|
43
|
+
}
|
|
44
|
+
get DOWNLOAD_ZIP() {
|
|
45
|
+
return `${this.GC_API}/download-service/files/activity/`;
|
|
46
|
+
}
|
|
47
|
+
get DOWNLOAD_GPX() {
|
|
48
|
+
return `${this.GC_API}/download-service/export/gpx/activity/`;
|
|
49
|
+
}
|
|
50
|
+
get DOWNLOAD_TCX() {
|
|
51
|
+
return `${this.GC_API}/download-service/export/tcx/activity/`;
|
|
52
|
+
}
|
|
53
|
+
get DOWNLOAD_KML() {
|
|
54
|
+
return `${this.GC_API}/download-service/export/kml/activity/`;
|
|
55
|
+
}
|
|
56
|
+
get UPLOAD() {
|
|
57
|
+
return `${this.GC_API}/upload-service/upload/`;
|
|
58
|
+
}
|
|
59
|
+
get DOWNLOAD_WELLNESS() {
|
|
60
|
+
return `${this.GC_API}/download-service/files/wellness/`;
|
|
61
|
+
}
|
|
62
|
+
get IMPORT_DATA() {
|
|
63
|
+
return `${this.GC_API}/modern/import-data`;
|
|
64
|
+
}
|
|
65
|
+
get DAILY_STEPS() {
|
|
66
|
+
return `${this.GC_API}/usersummary-service/stats/steps/daily/`;
|
|
67
|
+
}
|
|
68
|
+
get DAILY_SLEEP() {
|
|
69
|
+
return `${this.GC_API}/sleep-service/sleep/dailySleepData`;
|
|
70
|
+
}
|
|
71
|
+
get DAILY_WEIGHT() {
|
|
72
|
+
return `${this.GC_API}/weight-service/weight/dayview`;
|
|
73
|
+
}
|
|
74
|
+
get UPDATE_WEIGHT() {
|
|
75
|
+
return `${this.GC_API}/weight-service/user-weight`;
|
|
76
|
+
}
|
|
77
|
+
get DAILY_HYDRATION() {
|
|
78
|
+
return `${this.GC_API}/usersummary-service/usersummary/hydration/allData`;
|
|
79
|
+
}
|
|
80
|
+
get HYDRATION_LOG() {
|
|
81
|
+
return `${this.GC_API}/usersummary-service/usersummary/hydration/log`;
|
|
82
|
+
}
|
|
83
|
+
get GOLF_SCORECARD_SUMMARY() {
|
|
84
|
+
return `${this.GC_API}/gcs-golfcommunity/api/v2/scorecard/summary`;
|
|
85
|
+
}
|
|
86
|
+
get GOLF_SCORECARD_DETAIL() {
|
|
87
|
+
return `${this.GC_API}/gcs-golfcommunity/api/v2/scorecard/detail`;
|
|
88
|
+
}
|
|
89
|
+
get DAILY_HEART_RATE() {
|
|
90
|
+
return `${this.GC_API}/wellness-service/wellness/dailyHeartRate`;
|
|
91
|
+
}
|
|
92
|
+
WORKOUT(id) {
|
|
93
|
+
if (id) {
|
|
94
|
+
return `${this.GC_API}/workout-service/workout/${id}`;
|
|
95
|
+
}
|
|
96
|
+
return `${this.GC_API}/workout-service/workout`;
|
|
97
|
+
}
|
|
98
|
+
get WORKOUTS() {
|
|
99
|
+
return `${this.GC_API}/workout-service/workouts`;
|
|
100
|
+
}
|
|
101
|
+
get SCHEDULE_WORKOUTS() {
|
|
102
|
+
return `${this.GC_API}/workout-service/schedule/`;
|
|
103
|
+
}
|
|
104
|
+
// Garmin use month 0-11, not real month.
|
|
105
|
+
CALENDAR(yaer, month) {
|
|
106
|
+
return `${this.GC_API}/calendar-service/year/${yaer}/month/${month}`;
|
|
107
|
+
}
|
|
108
|
+
COURSE(id) {
|
|
109
|
+
if (id) {
|
|
110
|
+
return `${this.GC_API}/course-service/course/${id}`;
|
|
111
|
+
}
|
|
112
|
+
return `${this.GC_API}/course-service/course`;
|
|
113
|
+
}
|
|
114
|
+
get COURSE_FAVORITE() {
|
|
115
|
+
return `${this.GC_API}/course-service/course/favorites`;
|
|
116
|
+
}
|
|
117
|
+
get COURSE_OWNER() {
|
|
118
|
+
return `${this.GC_API}/web-gateway/course/owner/`;
|
|
119
|
+
}
|
|
120
|
+
get CONSENT_GRANT() {
|
|
121
|
+
return `${this.GC_API}/gdprconsent-service/consent/grant`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.UrlClass = UrlClass;
|
|
125
125
|
//# sourceMappingURL=UrlClass.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function toDateString(date: Date): string;
|
|
2
|
-
export declare function calculateTimeDifference(sleepStartTimestampGMT: number, sleepEndTimestampGMT: number): {
|
|
3
|
-
hours: number;
|
|
4
|
-
minutes: number;
|
|
5
|
-
};
|
|
6
|
-
export declare function getLocalTimestamp(date: Date, timezone: string): string;
|
|
1
|
+
export declare function toDateString(date: Date): string;
|
|
2
|
+
export declare function calculateTimeDifference(sleepStartTimestampGMT: number, sleepEndTimestampGMT: number): {
|
|
3
|
+
hours: number;
|
|
4
|
+
minutes: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function getLocalTimestamp(date: Date, timezone: string): string;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLocalTimestamp = exports.calculateTimeDifference = exports.toDateString = void 0;
|
|
4
|
-
function toDateString(date) {
|
|
5
|
-
const offset = date.getTimezoneOffset();
|
|
6
|
-
const offsetDate = new Date(date.getTime() - offset * 60 * 1000);
|
|
7
|
-
const [dateString] = offsetDate.toISOString().split('T');
|
|
8
|
-
return dateString;
|
|
9
|
-
}
|
|
10
|
-
exports.toDateString = toDateString;
|
|
11
|
-
function calculateTimeDifference(sleepStartTimestampGMT, sleepEndTimestampGMT) {
|
|
12
|
-
// Calculate time difference in seconds
|
|
13
|
-
const timeDifferenceInSeconds = (sleepEndTimestampGMT - sleepStartTimestampGMT) / 1000;
|
|
14
|
-
// Convert time difference to hours and minutes
|
|
15
|
-
const hours = Math.floor(timeDifferenceInSeconds / 3600);
|
|
16
|
-
const minutes = Math.floor((timeDifferenceInSeconds % 3600) / 60);
|
|
17
|
-
return {
|
|
18
|
-
hours,
|
|
19
|
-
minutes
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
exports.calculateTimeDifference = calculateTimeDifference;
|
|
23
|
-
function getLocalTimestamp(date, timezone) {
|
|
24
|
-
// Get the current local date timestamp in ISO format
|
|
25
|
-
const localTimestampISO = date.toISOString().substring(0, 23);
|
|
26
|
-
// Convert the ISO timestamp to local timezone while maintaining the same format
|
|
27
|
-
const localTimestamp = new Date(localTimestampISO).toLocaleString('en-US', {
|
|
28
|
-
timeZone: timezone,
|
|
29
|
-
hour12: false
|
|
30
|
-
});
|
|
31
|
-
// Format the local timestamp as `YYYY-MM-DDTHH:MM:SS.SSS`
|
|
32
|
-
const formattedLocalTimestamp = new Date(localTimestamp)
|
|
33
|
-
.toISOString()
|
|
34
|
-
.substring(0, 23);
|
|
35
|
-
return formattedLocalTimestamp;
|
|
36
|
-
}
|
|
37
|
-
exports.getLocalTimestamp = getLocalTimestamp;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLocalTimestamp = exports.calculateTimeDifference = exports.toDateString = void 0;
|
|
4
|
+
function toDateString(date) {
|
|
5
|
+
const offset = date.getTimezoneOffset();
|
|
6
|
+
const offsetDate = new Date(date.getTime() - offset * 60 * 1000);
|
|
7
|
+
const [dateString] = offsetDate.toISOString().split('T');
|
|
8
|
+
return dateString;
|
|
9
|
+
}
|
|
10
|
+
exports.toDateString = toDateString;
|
|
11
|
+
function calculateTimeDifference(sleepStartTimestampGMT, sleepEndTimestampGMT) {
|
|
12
|
+
// Calculate time difference in seconds
|
|
13
|
+
const timeDifferenceInSeconds = (sleepEndTimestampGMT - sleepStartTimestampGMT) / 1000;
|
|
14
|
+
// Convert time difference to hours and minutes
|
|
15
|
+
const hours = Math.floor(timeDifferenceInSeconds / 3600);
|
|
16
|
+
const minutes = Math.floor((timeDifferenceInSeconds % 3600) / 60);
|
|
17
|
+
return {
|
|
18
|
+
hours,
|
|
19
|
+
minutes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.calculateTimeDifference = calculateTimeDifference;
|
|
23
|
+
function getLocalTimestamp(date, timezone) {
|
|
24
|
+
// Get the current local date timestamp in ISO format
|
|
25
|
+
const localTimestampISO = date.toISOString().substring(0, 23);
|
|
26
|
+
// Convert the ISO timestamp to local timezone while maintaining the same format
|
|
27
|
+
const localTimestamp = new Date(localTimestampISO).toLocaleString('en-US', {
|
|
28
|
+
timeZone: timezone,
|
|
29
|
+
hour12: false
|
|
30
|
+
});
|
|
31
|
+
// Format the local timestamp as `YYYY-MM-DDTHH:MM:SS.SSS`
|
|
32
|
+
const formattedLocalTimestamp = new Date(localTimestamp)
|
|
33
|
+
.toISOString()
|
|
34
|
+
.substring(0, 23);
|
|
35
|
+
return formattedLocalTimestamp;
|
|
36
|
+
}
|
|
37
|
+
exports.getLocalTimestamp = getLocalTimestamp;
|
|
38
38
|
//# sourceMappingURL=DateUtils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function convertMLToOunces(valueInML: number): number;
|
|
2
|
-
export declare function convertOuncesToML(ounces: number): number;
|
|
1
|
+
export declare function convertMLToOunces(valueInML: number): number;
|
|
2
|
+
export declare function convertOuncesToML(ounces: number): number;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertOuncesToML = exports.convertMLToOunces = void 0;
|
|
4
|
-
function convertMLToOunces(valueInML) {
|
|
5
|
-
const conversionFactor = 0.033814;
|
|
6
|
-
const valueInOunces = valueInML * conversionFactor;
|
|
7
|
-
return valueInOunces;
|
|
8
|
-
}
|
|
9
|
-
exports.convertMLToOunces = convertMLToOunces;
|
|
10
|
-
function convertOuncesToML(ounces) {
|
|
11
|
-
const ouncesToMillilitersConversionFactor = 29.5735;
|
|
12
|
-
const milliliters = ounces * ouncesToMillilitersConversionFactor;
|
|
13
|
-
return milliliters;
|
|
14
|
-
}
|
|
15
|
-
exports.convertOuncesToML = convertOuncesToML;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertOuncesToML = exports.convertMLToOunces = void 0;
|
|
4
|
+
function convertMLToOunces(valueInML) {
|
|
5
|
+
const conversionFactor = 0.033814;
|
|
6
|
+
const valueInOunces = valueInML * conversionFactor;
|
|
7
|
+
return valueInOunces;
|
|
8
|
+
}
|
|
9
|
+
exports.convertMLToOunces = convertMLToOunces;
|
|
10
|
+
function convertOuncesToML(ounces) {
|
|
11
|
+
const ouncesToMillilitersConversionFactor = 29.5735;
|
|
12
|
+
const milliliters = ounces * ouncesToMillilitersConversionFactor;
|
|
13
|
+
return milliliters;
|
|
14
|
+
}
|
|
15
|
+
exports.convertOuncesToML = convertOuncesToML;
|
|
16
16
|
//# sourceMappingURL=HydrationUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function gramsToPounds(weightInGrams: number): number;
|
|
1
|
+
export declare function gramsToPounds(weightInGrams: number): number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gramsToPounds = void 0;
|
|
4
|
-
function gramsToPounds(weightInGrams) {
|
|
5
|
-
const gramsPerPound = 453.592;
|
|
6
|
-
return weightInGrams / gramsPerPound;
|
|
7
|
-
}
|
|
8
|
-
exports.gramsToPounds = gramsToPounds;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gramsToPounds = void 0;
|
|
4
|
+
function gramsToPounds(weightInGrams) {
|
|
5
|
+
const gramsPerPound = 453.592;
|
|
6
|
+
return weightInGrams / gramsPerPound;
|
|
7
|
+
}
|
|
8
|
+
exports.gramsToPounds = gramsToPounds;
|
|
9
9
|
//# sourceMappingURL=WeightUtils.js.map
|