hevy-shared 1.0.997 → 1.0.999
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/built/index.d.ts
CHANGED
|
@@ -887,7 +887,6 @@ export interface Workout {
|
|
|
887
887
|
biometrics?: WorkoutBiometrics;
|
|
888
888
|
is_biometrics_public: boolean;
|
|
889
889
|
trainer_program_id: string | undefined;
|
|
890
|
-
gym: Gym | undefined;
|
|
891
890
|
}
|
|
892
891
|
export interface CustomExerciseImage {
|
|
893
892
|
type: 'image';
|
|
@@ -967,7 +966,6 @@ export interface PostWorkoutRequestWorkout {
|
|
|
967
966
|
biometrics?: WorkoutBiometrics;
|
|
968
967
|
is_biometrics_public: boolean;
|
|
969
968
|
trainer_program_id: string | undefined;
|
|
970
|
-
gym: Gym | undefined;
|
|
971
969
|
}
|
|
972
970
|
export type WorkoutDataImporterReport = {
|
|
973
971
|
state: 'idle';
|
|
@@ -1620,12 +1618,6 @@ export interface UserMetadataResponse {
|
|
|
1620
1618
|
export interface NetworkInfoRequest {
|
|
1621
1619
|
networkType: NetworkType;
|
|
1622
1620
|
}
|
|
1623
|
-
export type Gym = {
|
|
1624
|
-
id: string;
|
|
1625
|
-
name: string;
|
|
1626
|
-
address: string;
|
|
1627
|
-
distanceM: number;
|
|
1628
|
-
};
|
|
1629
1621
|
export interface StripePrice {
|
|
1630
1622
|
product_id: string;
|
|
1631
1623
|
billing_period: 'month' | 'year' | 'pay-once';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExerciseType,
|
|
1
|
+
import { ExerciseType, RPE, SetType, ShareToPlatform, WorkoutBiometrics, WorkoutMedia, WorkoutVisibility } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* Events are used to determine the start time, end time and duration of a
|
|
4
4
|
* `NormalizedWorkout`, in a way that can be persisted to disk.
|
|
@@ -36,7 +36,6 @@ export interface NormalizedWorkout {
|
|
|
36
36
|
clientId: string;
|
|
37
37
|
biometrics?: WorkoutBiometrics;
|
|
38
38
|
trainerProgramId: string | undefined;
|
|
39
|
-
gym: Gym | undefined;
|
|
40
39
|
}
|
|
41
40
|
export interface NormalizedSet {
|
|
42
41
|
index: number;
|
package/built/tests/testUtils.js
CHANGED
|
@@ -370,11 +370,14 @@ describe('utils', () => {
|
|
|
370
370
|
});
|
|
371
371
|
describe('formatDurationInput', () => {
|
|
372
372
|
it('Returns a string in the format of NN:NN or NN:NN:NN', () => {
|
|
373
|
+
expect((0, utils_1.formatDurationInput)('')).toBe('');
|
|
373
374
|
expect((0, utils_1.formatDurationInput)('0')).toBe('');
|
|
374
375
|
expect((0, utils_1.formatDurationInput)('1')).toBe('00:01');
|
|
375
376
|
expect((0, utils_1.formatDurationInput)('60')).toBe(undefined);
|
|
376
377
|
expect((0, utils_1.formatDurationInput)('61')).toBe(undefined);
|
|
377
378
|
expect((0, utils_1.formatDurationInput)('99:99')).toBe('99:99');
|
|
379
|
+
expect((0, utils_1.formatDurationInput)('1:00:00')).toBe('01:00:00');
|
|
380
|
+
expect((0, utils_1.formatDurationInput)('9:59:59')).toBe('09:59:59');
|
|
378
381
|
});
|
|
379
382
|
});
|
|
380
383
|
describe('getEstimatedExercisesDurationSeconds', () => {
|
package/built/utils.js
CHANGED
|
@@ -217,12 +217,12 @@ exports.isValidFormattedTime = isValidFormattedTime;
|
|
|
217
217
|
const formatDurationInput = (value) => {
|
|
218
218
|
if ((0, exports.isValidFormattedTime)(value))
|
|
219
219
|
return value;
|
|
220
|
-
if (!/^[0-9:]+$/i.test(value)) {
|
|
221
|
-
return undefined;
|
|
222
|
-
}
|
|
223
220
|
if (value.length === 0) {
|
|
224
221
|
return value;
|
|
225
222
|
}
|
|
223
|
+
if (!/^[0-9:]+$/i.test(value)) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
226
|
if (value === '0') {
|
|
227
227
|
return '';
|
|
228
228
|
}
|
|
@@ -245,6 +245,10 @@ const formatDurationInput = (value) => {
|
|
|
245
245
|
// 01:234 -> 12:34
|
|
246
246
|
return `${value[1]}${value[3]}:${value[4]}${value[5]}`;
|
|
247
247
|
}
|
|
248
|
+
// x:xx:xx (hour+ with no leading zero)
|
|
249
|
+
if (/^[0-9]:[0-9]{2}:[0-9]{2}$/.test(value)) {
|
|
250
|
+
return `0${value}`;
|
|
251
|
+
}
|
|
248
252
|
if (value.length === 7 && value[0] === '0') {
|
|
249
253
|
// backspace
|
|
250
254
|
// 01:23:4 -> 12:34
|