@taphealth/kafka 1.5.2 → 1.5.4
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/events/daily-task-created.d.ts +6 -0
- package/dist/events/daily-task-created.js +2 -0
- package/dist/events/notification.d.ts +2 -2
- package/dist/topics.d.ts +2 -1
- package/dist/topics.js +1 -0
- package/dist/types/daily-task.d.ts +40 -0
- package/dist/types/daily-task.js +23 -0
- package/package.json +1 -1
|
@@ -6,11 +6,11 @@ export interface NotificationEvent {
|
|
|
6
6
|
module: string;
|
|
7
7
|
type: NotificationType;
|
|
8
8
|
userId: string;
|
|
9
|
-
content
|
|
9
|
+
content?: string;
|
|
10
10
|
channel: NotificationChannel;
|
|
11
11
|
dueTime: Date;
|
|
12
12
|
priority: number;
|
|
13
|
-
|
|
13
|
+
metadata?: {
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
};
|
|
16
16
|
};
|
package/dist/topics.d.ts
CHANGED
|
@@ -37,5 +37,6 @@ export declare enum Topics {
|
|
|
37
37
|
MealLogged = "meal-logged",
|
|
38
38
|
DailyPlanCreated = "daily-plan-created",
|
|
39
39
|
ExerciseLogged = "exercise-logged",
|
|
40
|
-
UserTierUpdated = "user-tier-updated"
|
|
40
|
+
UserTierUpdated = "user-tier-updated",
|
|
41
|
+
DailyTaskCreated = "daily-task-created"
|
|
41
42
|
}
|
package/dist/topics.js
CHANGED
|
@@ -42,4 +42,5 @@ var Topics;
|
|
|
42
42
|
Topics["DailyPlanCreated"] = "daily-plan-created";
|
|
43
43
|
Topics["ExerciseLogged"] = "exercise-logged";
|
|
44
44
|
Topics["UserTierUpdated"] = "user-tier-updated";
|
|
45
|
+
Topics["DailyTaskCreated"] = "daily-task-created";
|
|
45
46
|
})(Topics || (exports.Topics = Topics = {}));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface IDailyTask {
|
|
2
|
+
userId: string;
|
|
3
|
+
date: Date;
|
|
4
|
+
status: DailyTaskStatus;
|
|
5
|
+
type: DailyTaskType;
|
|
6
|
+
description: string;
|
|
7
|
+
parentChallengeId: string;
|
|
8
|
+
parentHabitId: string;
|
|
9
|
+
evaluationCriteria: IEvaluationCriteria;
|
|
10
|
+
targetCount: number;
|
|
11
|
+
currentCount: number;
|
|
12
|
+
}
|
|
13
|
+
export declare enum DailyTaskStatus {
|
|
14
|
+
PENDING = 0,
|
|
15
|
+
COMPLETED = 1
|
|
16
|
+
}
|
|
17
|
+
export declare enum DailyTaskType {
|
|
18
|
+
PRIMARY_HABIT = 0,
|
|
19
|
+
SECONDARY_HABIT = 1,// For "Refocus Sprints" on derailed habits
|
|
20
|
+
MAINTENANCE = 2
|
|
21
|
+
}
|
|
22
|
+
export interface IEvaluationCriteria {
|
|
23
|
+
eventType: KafkaEventType;
|
|
24
|
+
conditions: ICondition[];
|
|
25
|
+
targetCount?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ICondition {
|
|
28
|
+
field: string;
|
|
29
|
+
operator: ConditionOperator;
|
|
30
|
+
value?: any;
|
|
31
|
+
}
|
|
32
|
+
export type ConditionOperator = "eq" | "gt" | "lt" | "gte" | "lte" | "isTrue" | "isFalse";
|
|
33
|
+
export declare enum KafkaEventType {
|
|
34
|
+
MEAL_LOGGED = "meal-logged",
|
|
35
|
+
GLUCOSE_LOGGED = "glucose-logged",
|
|
36
|
+
EXERCISE_LOGGED = "exercise-logged",
|
|
37
|
+
STEPS_LOGGED = "steps-logged",
|
|
38
|
+
SLEEP_LOGGED = "sleep-logged",
|
|
39
|
+
WEIGHT_LOGGED = "weight-logged"
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KafkaEventType = exports.DailyTaskType = exports.DailyTaskStatus = void 0;
|
|
4
|
+
var DailyTaskStatus;
|
|
5
|
+
(function (DailyTaskStatus) {
|
|
6
|
+
DailyTaskStatus[DailyTaskStatus["PENDING"] = 0] = "PENDING";
|
|
7
|
+
DailyTaskStatus[DailyTaskStatus["COMPLETED"] = 1] = "COMPLETED";
|
|
8
|
+
})(DailyTaskStatus || (exports.DailyTaskStatus = DailyTaskStatus = {}));
|
|
9
|
+
var DailyTaskType;
|
|
10
|
+
(function (DailyTaskType) {
|
|
11
|
+
DailyTaskType[DailyTaskType["PRIMARY_HABIT"] = 0] = "PRIMARY_HABIT";
|
|
12
|
+
DailyTaskType[DailyTaskType["SECONDARY_HABIT"] = 1] = "SECONDARY_HABIT";
|
|
13
|
+
DailyTaskType[DailyTaskType["MAINTENANCE"] = 2] = "MAINTENANCE";
|
|
14
|
+
})(DailyTaskType || (exports.DailyTaskType = DailyTaskType = {}));
|
|
15
|
+
var KafkaEventType;
|
|
16
|
+
(function (KafkaEventType) {
|
|
17
|
+
KafkaEventType["MEAL_LOGGED"] = "meal-logged";
|
|
18
|
+
KafkaEventType["GLUCOSE_LOGGED"] = "glucose-logged";
|
|
19
|
+
KafkaEventType["EXERCISE_LOGGED"] = "exercise-logged";
|
|
20
|
+
KafkaEventType["STEPS_LOGGED"] = "steps-logged";
|
|
21
|
+
KafkaEventType["SLEEP_LOGGED"] = "sleep-logged";
|
|
22
|
+
KafkaEventType["WEIGHT_LOGGED"] = "weight-logged";
|
|
23
|
+
})(KafkaEventType || (exports.KafkaEventType = KafkaEventType = {}));
|