@taphealth/kafka 1.4.31 → 1.4.32

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.
@@ -1,9 +1,13 @@
1
1
  import { Topics } from "../topics";
2
+ import { DailyTask } from "../types/daily-plan";
2
3
  export interface DailyPlanCreatedEvent {
3
4
  topic: Topics.DailyPlanCreated;
4
5
  data: {
5
6
  userId: string;
6
7
  date: Date;
8
+ tasks: {
9
+ [module: string]: DailyTask[];
10
+ };
7
11
  nudgePlan: {
8
12
  dayNumber: number;
9
13
  date: string;
@@ -23,5 +27,39 @@ export interface DailyPlanCreatedEvent {
23
27
  }>;
24
28
  warnings: string[];
25
29
  };
30
+ plan: {
31
+ nutrition: {
32
+ targetCalories: number;
33
+ targetMacros: {
34
+ protein: number;
35
+ carbs: number;
36
+ fats: number;
37
+ fibre: number;
38
+ };
39
+ targetCalorieDistribution: {
40
+ carbs: number;
41
+ protein: number;
42
+ fat: number;
43
+ fibre: number;
44
+ };
45
+ };
46
+ glucose: {
47
+ fasting: boolean;
48
+ postprandial: boolean;
49
+ night: boolean;
50
+ preWorkout: boolean;
51
+ };
52
+ activity: {
53
+ steps: number;
54
+ exercise?: {
55
+ duration: number;
56
+ type: string;
57
+ intensity: string;
58
+ };
59
+ };
60
+ education?: {
61
+ topic?: string;
62
+ };
63
+ };
26
64
  };
27
65
  }
@@ -0,0 +1,40 @@
1
+ export declare enum DailyTaskType {
2
+ DIET_LOGGING = 0,
3
+ STEP_COUNT = 1,
4
+ EXERCISE_LOGGING = 2,
5
+ GLUCOSE_LOGGING = 3
6
+ }
7
+ export declare enum HabitKey {
8
+ GLUCOSE_LOG_TIMELY = 0,
9
+ GLUCOSE_LOG_RANDOM = 1,
10
+ GLUCOSE_CHECK_NOW = 2,
11
+ GLUCOSE_INTERPRET_RANGE = 3,
12
+ DIET_LOG_BREAKFAST = 4,
13
+ DIET_LOG_LUNCH = 5,
14
+ DIET_LOG_DINNER = 6,
15
+ DIET_LOG_SNACK_MORNING = 7,
16
+ DIET_LOG_SNACK_EVENING = 8,
17
+ DIET_LOG_ANY = 9,
18
+ DIET_HEALTHY_CHOICE = 10,
19
+ DIET_PLAN_MEALS = 11,
20
+ STEPS_MEET_DAILY_TARGET = 12,
21
+ STEPS_INCREASE_ACTIVITY = 13,
22
+ STEPS_LOG_MANUAL = 14,
23
+ EXERCISE_LOG_SESSION = 15,
24
+ EXERCISE_COMPLETE_PLANNED = 16,
25
+ EXERCISE_START_NOW = 17,
26
+ EXERCISE_INCREASE_FREQUENCY = 18,
27
+ EXERCISE_SCHEDULE_SESSION = 19
28
+ }
29
+ export interface DailyTask {
30
+ type: DailyTaskType;
31
+ description: string;
32
+ target: {
33
+ unit: string;
34
+ initial: number;
35
+ current: number;
36
+ };
37
+ habitKey: HabitKey;
38
+ isMicroChallenge: boolean;
39
+ currentProgress: number;
40
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HabitKey = exports.DailyTaskType = void 0;
4
+ var DailyTaskType;
5
+ (function (DailyTaskType) {
6
+ DailyTaskType[DailyTaskType["DIET_LOGGING"] = 0] = "DIET_LOGGING";
7
+ DailyTaskType[DailyTaskType["STEP_COUNT"] = 1] = "STEP_COUNT";
8
+ DailyTaskType[DailyTaskType["EXERCISE_LOGGING"] = 2] = "EXERCISE_LOGGING";
9
+ DailyTaskType[DailyTaskType["GLUCOSE_LOGGING"] = 3] = "GLUCOSE_LOGGING";
10
+ })(DailyTaskType || (exports.DailyTaskType = DailyTaskType = {}));
11
+ var HabitKey;
12
+ (function (HabitKey) {
13
+ HabitKey[HabitKey["GLUCOSE_LOG_TIMELY"] = 0] = "GLUCOSE_LOG_TIMELY";
14
+ HabitKey[HabitKey["GLUCOSE_LOG_RANDOM"] = 1] = "GLUCOSE_LOG_RANDOM";
15
+ HabitKey[HabitKey["GLUCOSE_CHECK_NOW"] = 2] = "GLUCOSE_CHECK_NOW";
16
+ HabitKey[HabitKey["GLUCOSE_INTERPRET_RANGE"] = 3] = "GLUCOSE_INTERPRET_RANGE";
17
+ HabitKey[HabitKey["DIET_LOG_BREAKFAST"] = 4] = "DIET_LOG_BREAKFAST";
18
+ HabitKey[HabitKey["DIET_LOG_LUNCH"] = 5] = "DIET_LOG_LUNCH";
19
+ HabitKey[HabitKey["DIET_LOG_DINNER"] = 6] = "DIET_LOG_DINNER";
20
+ HabitKey[HabitKey["DIET_LOG_SNACK_MORNING"] = 7] = "DIET_LOG_SNACK_MORNING";
21
+ HabitKey[HabitKey["DIET_LOG_SNACK_EVENING"] = 8] = "DIET_LOG_SNACK_EVENING";
22
+ HabitKey[HabitKey["DIET_LOG_ANY"] = 9] = "DIET_LOG_ANY";
23
+ HabitKey[HabitKey["DIET_HEALTHY_CHOICE"] = 10] = "DIET_HEALTHY_CHOICE";
24
+ HabitKey[HabitKey["DIET_PLAN_MEALS"] = 11] = "DIET_PLAN_MEALS";
25
+ HabitKey[HabitKey["STEPS_MEET_DAILY_TARGET"] = 12] = "STEPS_MEET_DAILY_TARGET";
26
+ HabitKey[HabitKey["STEPS_INCREASE_ACTIVITY"] = 13] = "STEPS_INCREASE_ACTIVITY";
27
+ HabitKey[HabitKey["STEPS_LOG_MANUAL"] = 14] = "STEPS_LOG_MANUAL";
28
+ HabitKey[HabitKey["EXERCISE_LOG_SESSION"] = 15] = "EXERCISE_LOG_SESSION";
29
+ HabitKey[HabitKey["EXERCISE_COMPLETE_PLANNED"] = 16] = "EXERCISE_COMPLETE_PLANNED";
30
+ HabitKey[HabitKey["EXERCISE_START_NOW"] = 17] = "EXERCISE_START_NOW";
31
+ HabitKey[HabitKey["EXERCISE_INCREASE_FREQUENCY"] = 18] = "EXERCISE_INCREASE_FREQUENCY";
32
+ HabitKey[HabitKey["EXERCISE_SCHEDULE_SESSION"] = 19] = "EXERCISE_SCHEDULE_SESSION";
33
+ })(HabitKey || (exports.HabitKey = HabitKey = {}));
@@ -48,7 +48,7 @@ export interface DiabetesSettings {
48
48
  sugarPostMealLevel: string;
49
49
  sugarPostMealCheckedDate: string;
50
50
  hba1cLevel: string;
51
- hba1cLevelCheckedDate: string;
51
+ hba1cCheckedDate: string;
52
52
  history: string[];
53
53
  diabetesInFamily: boolean;
54
54
  medications: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taphealth/kafka",
3
- "version": "1.4.31",
3
+ "version": "1.4.32",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",