hevy-shared 1.0.603 → 1.0.604
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 +9 -0
- package/built/index.js +8 -1
- package/built/tests/utils.test.js +0 -12
- package/built/utils.js +4 -4
- package/package.json +1 -1
package/built/index.d.ts
CHANGED
|
@@ -579,6 +579,12 @@ export declare const isExerciseType: (x: any) => x is ExerciseType;
|
|
|
579
579
|
export type CustomExerciseType = Exclude<ExerciseType, 'floors_duration' | 'steps_duration'>;
|
|
580
580
|
export declare const customExericseTypes: CustomExerciseType[];
|
|
581
581
|
export declare const isCustomExerciseType: (x: any) => x is CustomExerciseType;
|
|
582
|
+
export declare const trainingGoals: readonly ["strength", "build_muscle", "fat_loss"];
|
|
583
|
+
export declare const trainingLevels: readonly ["beginner", "intermediate", "advanced"];
|
|
584
|
+
export declare const exerciseCategories: readonly ["isolation", "compound", "assistance-compound"];
|
|
585
|
+
export type TrainingGoal = Lookup<typeof trainingGoals>;
|
|
586
|
+
export type TrainingLevel = Lookup<typeof trainingLevels>;
|
|
587
|
+
export type ExerciseCategory = Lookup<typeof exerciseCategories>;
|
|
582
588
|
/**
|
|
583
589
|
* Base properties that all exercise templates must have
|
|
584
590
|
*/
|
|
@@ -625,6 +631,9 @@ export interface LibraryExercise extends BaseExerciseTemplate {
|
|
|
625
631
|
localised_instructions?: {
|
|
626
632
|
[language in InstructionsLanguage]?: string;
|
|
627
633
|
};
|
|
634
|
+
goal: TrainingGoal[] | undefined;
|
|
635
|
+
level: TrainingLevel[] | undefined;
|
|
636
|
+
category: ExerciseCategory | undefined;
|
|
628
637
|
}
|
|
629
638
|
/**
|
|
630
639
|
* Custom exercises are user-created templates with minimal properties
|
package/built/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isWorkoutBiometrics = exports.isHeartRateSamples = exports.isPublicWorkout = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.isSetPersonalRecordType = exports.supportedInstructionsLanguages = exports.isCustomExerciseType = exports.customExericseTypes = exports.isExerciseType = exports.exerciseTypes = exports.isExerciseRepType = exports.exerciseRepTypes = exports.isEquipmentFilter = exports.equipmentFilters = exports.isEquipment = exports.equipments = exports.isMuscleGroupFilter = exports.muscleGroupFilters = exports.isMuscleGroup = exports.muscleGroups = exports.DefaultClientConfiguration = exports.isCoachRole = exports.isErrorResponse = exports.isLivePRVolumeOption = exports.isTimerVolumeOption = exports.isWeekday = exports.orderedWeekdays = exports.isBodyMeasurementUnit = exports.isDistanceUnitShort = exports.isDistanceUnit = exports.isWeightUnit = exports.isLanguage = exports.supportedLanguages = void 0;
|
|
17
|
+
exports.isValidUserWorkoutMetricsType = exports.isBodyMeasurementKey = exports.measurementsList = exports.isWorkoutBiometrics = exports.isHeartRateSamples = exports.isPublicWorkout = exports.isSetType = exports.isRPE = exports.validRpeValues = exports.isSetPersonalRecordType = exports.supportedInstructionsLanguages = exports.exerciseCategories = exports.trainingLevels = exports.trainingGoals = exports.isCustomExerciseType = exports.customExericseTypes = exports.isExerciseType = exports.exerciseTypes = exports.isExerciseRepType = exports.exerciseRepTypes = exports.isEquipmentFilter = exports.equipmentFilters = exports.isEquipment = exports.equipments = exports.isMuscleGroupFilter = exports.muscleGroupFilters = exports.isMuscleGroup = exports.muscleGroups = exports.DefaultClientConfiguration = exports.isCoachRole = exports.isErrorResponse = exports.isLivePRVolumeOption = exports.isTimerVolumeOption = exports.isWeekday = exports.orderedWeekdays = exports.isBodyMeasurementUnit = exports.isDistanceUnitShort = exports.isDistanceUnit = exports.isWeightUnit = exports.isLanguage = exports.supportedLanguages = void 0;
|
|
18
18
|
const typeUtils_1 = require("./typeUtils");
|
|
19
19
|
__exportStar(require("./constants"), exports);
|
|
20
20
|
__exportStar(require("./utils"), exports);
|
|
@@ -185,6 +185,13 @@ exports.isExerciseType = isExerciseType;
|
|
|
185
185
|
exports.customExericseTypes = exports.exerciseTypes.filter((type) => type !== 'floors_duration' && type !== 'steps_duration');
|
|
186
186
|
const isCustomExerciseType = (x) => (0, typeUtils_1.isInArray)(x, exports.customExericseTypes);
|
|
187
187
|
exports.isCustomExerciseType = isCustomExerciseType;
|
|
188
|
+
exports.trainingGoals = ['strength', 'build_muscle', 'fat_loss'];
|
|
189
|
+
exports.trainingLevels = ['beginner', 'intermediate', 'advanced'];
|
|
190
|
+
exports.exerciseCategories = [
|
|
191
|
+
'isolation',
|
|
192
|
+
'compound',
|
|
193
|
+
'assistance-compound',
|
|
194
|
+
];
|
|
188
195
|
exports.supportedInstructionsLanguages = [
|
|
189
196
|
'en',
|
|
190
197
|
'it',
|
|
@@ -392,18 +392,6 @@ describe('utils', () => {
|
|
|
392
392
|
{ format: 'link', text: 'https://example.com' },
|
|
393
393
|
],
|
|
394
394
|
],
|
|
395
|
-
[
|
|
396
|
-
'hey Test - https://www.tiktok.com/@tylerpath/video/7471271437467405614 @test',
|
|
397
|
-
[
|
|
398
|
-
{ format: 'none', text: 'hey Test - ' },
|
|
399
|
-
{
|
|
400
|
-
format: 'link',
|
|
401
|
-
text: 'https://www.tiktok.com/@tylerpath/video/7471271437467405614',
|
|
402
|
-
},
|
|
403
|
-
{ format: 'none', text: ' ' },
|
|
404
|
-
{ format: '@', text: '@test' },
|
|
405
|
-
],
|
|
406
|
-
],
|
|
407
395
|
];
|
|
408
396
|
inputOutputs.forEach((i) => {
|
|
409
397
|
expect((0, utils_1.splitAtUsernamesAndLinks)(i[0])).toEqual(i[1]);
|
package/built/utils.js
CHANGED
|
@@ -586,12 +586,12 @@ const splitAtUsernamesAndLinks = (text) => {
|
|
|
586
586
|
if (index > lastIndex) {
|
|
587
587
|
format.push({ format: 'none', text: text.substring(lastIndex, index) });
|
|
588
588
|
}
|
|
589
|
-
if (match.match(
|
|
590
|
-
format.push({ format: 'link', text: match });
|
|
591
|
-
}
|
|
592
|
-
else if (match.match(mentionsRegex)) {
|
|
589
|
+
if (match.match(mentionsRegex)) {
|
|
593
590
|
format.push({ format: '@', text: match });
|
|
594
591
|
}
|
|
592
|
+
else if (match.match(linksRegex)) {
|
|
593
|
+
format.push({ format: 'link', text: match });
|
|
594
|
+
}
|
|
595
595
|
lastIndex = index + match.length;
|
|
596
596
|
});
|
|
597
597
|
if (lastIndex < text.length) {
|