@krampa/common 0.7.0 → 0.9.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-value-types.d.ts +4 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/notification-types.d.ts +23 -0
- package/dist/notification-types.js +17 -0
- package/package.json +1 -1
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
* Shared between frontend and backend for type safety
|
|
4
4
|
*/
|
|
5
5
|
import { GOAL_TYPES } from "./goal-types";
|
|
6
|
-
export type
|
|
7
|
-
startWeight: number;
|
|
6
|
+
export type WeightValue = {
|
|
8
7
|
targetWeight: number;
|
|
9
8
|
};
|
|
10
|
-
export type WeightMaintain = {
|
|
11
|
-
maintenanceWeight: number;
|
|
12
|
-
};
|
|
13
9
|
export type WorkoutCardioValue = {
|
|
14
10
|
activityName: string;
|
|
15
11
|
weeklyTarget: number;
|
|
@@ -31,15 +27,15 @@ export type StepsGoalValue = {
|
|
|
31
27
|
type BaseGoal = {};
|
|
32
28
|
export type WeightLossGoal = BaseGoal & {
|
|
33
29
|
type: typeof GOAL_TYPES.WEIGHT_LOSS;
|
|
34
|
-
value:
|
|
30
|
+
value: WeightValue;
|
|
35
31
|
};
|
|
36
32
|
export type WeightGainGoal = BaseGoal & {
|
|
37
33
|
type: typeof GOAL_TYPES.WEIGHT_GAIN;
|
|
38
|
-
value:
|
|
34
|
+
value: WeightValue;
|
|
39
35
|
};
|
|
40
36
|
export type WeightMaintainGoal = BaseGoal & {
|
|
41
37
|
type: typeof GOAL_TYPES.WEIGHT_MAINTAIN;
|
|
42
|
-
value:
|
|
38
|
+
value: WeightValue;
|
|
43
39
|
};
|
|
44
40
|
export type WorkoutStrengthGoal = BaseGoal & {
|
|
45
41
|
type: typeof GOAL_TYPES.WORKOUT_STRENGTH;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,3 +22,4 @@ __exportStar(require("./goal-types"), exports);
|
|
|
22
22
|
__exportStar(require("./goal-value-types"), exports);
|
|
23
23
|
__exportStar(require("./invite-status"), exports);
|
|
24
24
|
__exportStar(require("./challenge-status"), exports);
|
|
25
|
+
__exportStar(require("./notification-types"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification types for FCM push notifications
|
|
3
|
+
*/
|
|
4
|
+
export declare enum NotificationType {
|
|
5
|
+
CHALLENGE_STARTED = "challenge_started",
|
|
6
|
+
CHALLENGE_INVITATION = "challenge_invitation",
|
|
7
|
+
CHALLENGE_ACCEPTED = "challenge_accepted",
|
|
8
|
+
CHALLENGE_DECLINED = "challenge_declined",
|
|
9
|
+
CHALLENGE_ENDED = "challenge_ended",
|
|
10
|
+
NEW_LOG_ENTRY = "new_log_entry",
|
|
11
|
+
GOAL_ACHIEVED = "goal_achieved",
|
|
12
|
+
GOALS_SUBMITTED = "goals_submitted"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Notification payload sent to FCM
|
|
16
|
+
*/
|
|
17
|
+
export interface NotificationPayload {
|
|
18
|
+
type: NotificationType;
|
|
19
|
+
challengeId?: number;
|
|
20
|
+
userId?: number;
|
|
21
|
+
message?: string;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Notification types for FCM push notifications
|
|
6
|
+
*/
|
|
7
|
+
var NotificationType;
|
|
8
|
+
(function (NotificationType) {
|
|
9
|
+
NotificationType["CHALLENGE_STARTED"] = "challenge_started";
|
|
10
|
+
NotificationType["CHALLENGE_INVITATION"] = "challenge_invitation";
|
|
11
|
+
NotificationType["CHALLENGE_ACCEPTED"] = "challenge_accepted";
|
|
12
|
+
NotificationType["CHALLENGE_DECLINED"] = "challenge_declined";
|
|
13
|
+
NotificationType["CHALLENGE_ENDED"] = "challenge_ended";
|
|
14
|
+
NotificationType["NEW_LOG_ENTRY"] = "new_log_entry";
|
|
15
|
+
NotificationType["GOAL_ACHIEVED"] = "goal_achieved";
|
|
16
|
+
NotificationType["GOALS_SUBMITTED"] = "goals_submitted";
|
|
17
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|