@krampa/common 0.1.2 → 0.2.0
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/goal-types.d.ts +6 -10
- package/dist/goal-types.js +10 -19
- package/package.json +1 -1
package/dist/goal-types.d.ts
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Goal type constants for Krampa fitness challenge app
|
|
3
|
-
* These types follow a category/subtype pattern (e.g., "weight/loss", "
|
|
3
|
+
* These types follow a category/subtype pattern (e.g., "weight/loss", "workout/cardio")
|
|
4
4
|
*/
|
|
5
5
|
export declare const GOAL_TYPES: {
|
|
6
6
|
readonly WEIGHT_LOSS: "weight/loss";
|
|
7
7
|
readonly WEIGHT_GAIN: "weight/gain";
|
|
8
8
|
readonly WEIGHT_MAINTAIN: "weight/maintain";
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
9
|
+
readonly WORKOUT_GENERAL: "workout/general";
|
|
10
|
+
readonly WORKOUT_CARDIO: "workout/cardio";
|
|
11
|
+
readonly WORKOUT_OTHER: "workout/other";
|
|
12
12
|
readonly ACHIEVEMENT_PR: "achievement/pr";
|
|
13
|
-
readonly ACHIEVEMENT_STEPS: "
|
|
13
|
+
readonly ACHIEVEMENT_STEPS: "steps/daily";
|
|
14
14
|
readonly MEASUREMENT_BODY: "measurement/body";
|
|
15
15
|
readonly CUSTOM_OTHER: "custom/other";
|
|
16
16
|
};
|
|
17
|
-
export declare const GOAL_TYPE_VALUES: readonly ["weight/loss", "weight/gain", "weight/maintain", "
|
|
17
|
+
export declare const GOAL_TYPE_VALUES: readonly ["weight/loss", "weight/gain", "weight/maintain", "workout/general", "workout/cardio", "workout/other", "achievement/pr", "steps/daily", "measurement/body", "custom/other"];
|
|
18
18
|
export type GoalType = (typeof GOAL_TYPE_VALUES)[number];
|
|
19
|
-
export declare const isWeightGoal: (type: string) => boolean;
|
|
20
|
-
export declare const isFrequencyGoal: (type: string) => boolean;
|
|
21
|
-
export declare const isAchievementGoal: (type: string) => boolean;
|
|
22
|
-
export declare const isCardioGoal: (type: string) => boolean;
|
package/dist/goal-types.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Goal type constants for Krampa fitness challenge app
|
|
4
|
-
* These types follow a category/subtype pattern (e.g., "weight/loss", "
|
|
4
|
+
* These types follow a category/subtype pattern (e.g., "weight/loss", "workout/cardio")
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.GOAL_TYPE_VALUES = exports.GOAL_TYPES = void 0;
|
|
8
8
|
// Goal type enum values (matches database enum)
|
|
9
9
|
exports.GOAL_TYPES = {
|
|
10
10
|
// Weight goals
|
|
11
11
|
WEIGHT_LOSS: "weight/loss",
|
|
12
12
|
WEIGHT_GAIN: "weight/gain",
|
|
13
13
|
WEIGHT_MAINTAIN: "weight/maintain",
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
// Workout goals (distance/time embedded in cardio)
|
|
15
|
+
WORKOUT_GENERAL: "workout/general",
|
|
16
|
+
WORKOUT_CARDIO: "workout/cardio",
|
|
17
|
+
WORKOUT_OTHER: "workout/other",
|
|
18
18
|
// Achievement goals
|
|
19
19
|
ACHIEVEMENT_PR: "achievement/pr",
|
|
20
|
-
ACHIEVEMENT_STEPS: "
|
|
20
|
+
ACHIEVEMENT_STEPS: "steps/daily",
|
|
21
21
|
// Other
|
|
22
22
|
MEASUREMENT_BODY: "measurement/body",
|
|
23
23
|
CUSTOM_OTHER: "custom/other",
|
|
@@ -27,20 +27,11 @@ exports.GOAL_TYPE_VALUES = [
|
|
|
27
27
|
exports.GOAL_TYPES.WEIGHT_LOSS,
|
|
28
28
|
exports.GOAL_TYPES.WEIGHT_GAIN,
|
|
29
29
|
exports.GOAL_TYPES.WEIGHT_MAINTAIN,
|
|
30
|
-
exports.GOAL_TYPES.
|
|
31
|
-
exports.GOAL_TYPES.
|
|
32
|
-
exports.GOAL_TYPES.
|
|
30
|
+
exports.GOAL_TYPES.WORKOUT_GENERAL,
|
|
31
|
+
exports.GOAL_TYPES.WORKOUT_CARDIO,
|
|
32
|
+
exports.GOAL_TYPES.WORKOUT_OTHER,
|
|
33
33
|
exports.GOAL_TYPES.ACHIEVEMENT_PR,
|
|
34
34
|
exports.GOAL_TYPES.ACHIEVEMENT_STEPS,
|
|
35
35
|
exports.GOAL_TYPES.MEASUREMENT_BODY,
|
|
36
36
|
exports.GOAL_TYPES.CUSTOM_OTHER,
|
|
37
37
|
];
|
|
38
|
-
// Helper type guards
|
|
39
|
-
const isWeightGoal = (type) => type.startsWith("weight/");
|
|
40
|
-
exports.isWeightGoal = isWeightGoal;
|
|
41
|
-
const isFrequencyGoal = (type) => type.startsWith("frequency/");
|
|
42
|
-
exports.isFrequencyGoal = isFrequencyGoal;
|
|
43
|
-
const isAchievementGoal = (type) => type.startsWith("achievement/");
|
|
44
|
-
exports.isAchievementGoal = isAchievementGoal;
|
|
45
|
-
const isCardioGoal = (type) => type === exports.GOAL_TYPES.FREQUENCY_CARDIO;
|
|
46
|
-
exports.isCardioGoal = isCardioGoal;
|