@krampa/common 0.10.0 → 0.12.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.
@@ -6,20 +6,9 @@ import { GOAL_TYPES } from "./goal-types";
6
6
  export type WeightValue = {
7
7
  targetWeight: number;
8
8
  };
9
- export type WorkoutCardioValue = {
9
+ export type WorkoutValue = {
10
10
  activityName: string;
11
11
  weeklyTarget: number;
12
- weeklyDistance?: number;
13
- weeklyTime?: number;
14
- workoutTypes: string[];
15
- };
16
- export type WorkoutOtherValue = {
17
- activityName: string;
18
- weeklyTarget: number;
19
- };
20
- export type WorkoutStrengthValue = {
21
- weeklyTarget: number;
22
- workoutTypes: string[];
23
12
  };
24
13
  export type StepsGoalValue = {
25
14
  targetSteps: number;
@@ -37,21 +26,13 @@ export type WeightMaintainGoal = BaseGoal & {
37
26
  type: typeof GOAL_TYPES.WEIGHT_MAINTAIN;
38
27
  value: WeightValue;
39
28
  };
40
- export type WorkoutStrengthGoal = BaseGoal & {
41
- type: typeof GOAL_TYPES.WORKOUT_STRENGTH;
42
- value: WorkoutStrengthValue;
43
- };
44
- export type WorkoutCardioGoal = BaseGoal & {
45
- type: typeof GOAL_TYPES.WORKOUT_CARDIO;
46
- value: WorkoutCardioValue;
47
- };
48
- export type WorkoutOtherGoal = BaseGoal & {
49
- type: typeof GOAL_TYPES.WORKOUT_OTHER;
50
- value: WorkoutOtherValue;
29
+ export type WorkoutGoal = BaseGoal & {
30
+ type: typeof GOAL_TYPES.WORKOUT;
31
+ value: WorkoutValue;
51
32
  };
52
33
  export type StepsGoal = BaseGoal & {
53
34
  type: typeof GOAL_TYPES.STEPS_DAILY;
54
35
  value: StepsGoalValue;
55
36
  };
56
- export type Goal = WeightLossGoal | WeightGainGoal | WeightMaintainGoal | WorkoutStrengthGoal | WorkoutCardioGoal | WorkoutOtherGoal | StepsGoal;
37
+ export type Goal = WeightLossGoal | WeightGainGoal | WeightMaintainGoal | WorkoutGoal | StepsGoal;
57
38
  export {};
@@ -1,3 +1,4 @@
1
+ import { GoalType } from './goal-types';
1
2
  /**
2
3
  * Notification types for FCM push notifications
3
4
  */
@@ -7,17 +8,32 @@ export declare enum NotificationType {
7
8
  CHALLENGE_ACCEPTED = "challenge_accepted",
8
9
  CHALLENGE_DECLINED = "challenge_declined",
9
10
  CHALLENGE_ENDED = "challenge_ended",
11
+ CHALLENGE_EARLY_START = "challenge_early_start",
10
12
  NEW_LOG_ENTRY = "new_log_entry",
11
13
  GOAL_ACHIEVED = "goal_achieved",
12
- GOALS_SUBMITTED = "goals_submitted"
14
+ GOALS_SUBMITTED = "goals_submitted",
15
+ CHEER = "cheer"
13
16
  }
14
17
  /**
15
18
  * Notification payload sent to FCM
16
19
  */
17
20
  export interface NotificationPayload {
18
21
  type: NotificationType;
19
- challengeId?: number;
20
- userId?: number;
21
- message?: string;
22
- [key: string]: any;
22
+ timestamp: string;
23
+ challengeId?: string;
24
+ inviterId?: string;
25
+ inviterName?: string;
26
+ accepterId?: string;
27
+ accepterName?: string;
28
+ declinerId?: string;
29
+ declinerName?: string;
30
+ submitterId?: string;
31
+ submitterName?: string;
32
+ loggerUserId?: string;
33
+ loggerName?: string;
34
+ activityType?: GoalType;
35
+ activityDescription?: string;
36
+ logId?: string;
37
+ cheererId?: string;
38
+ cheererName?: string;
23
39
  }
@@ -11,7 +11,9 @@ var NotificationType;
11
11
  NotificationType["CHALLENGE_ACCEPTED"] = "challenge_accepted";
12
12
  NotificationType["CHALLENGE_DECLINED"] = "challenge_declined";
13
13
  NotificationType["CHALLENGE_ENDED"] = "challenge_ended";
14
+ NotificationType["CHALLENGE_EARLY_START"] = "challenge_early_start";
14
15
  NotificationType["NEW_LOG_ENTRY"] = "new_log_entry";
15
16
  NotificationType["GOAL_ACHIEVED"] = "goal_achieved";
16
17
  NotificationType["GOALS_SUBMITTED"] = "goals_submitted";
18
+ NotificationType["CHEER"] = "cheer";
17
19
  })(NotificationType || (exports.NotificationType = NotificationType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krampa/common",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Shared types and constants for Krampa fitness challenge app",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",