@taphealth/kafka 1.4.30 → 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,13 @@
1
+ import { Topics } from "../topics";
2
+ import { GlucoseRange, GlucoseType } from "../types/glucose";
3
+ export interface GlucoseLoggedEvent {
4
+ topic: Topics.GlucoseLogged;
5
+ data: {
6
+ userId: string;
7
+ date: string;
8
+ type: GlucoseType;
9
+ glucoseReading: number;
10
+ glucoseRange: GlucoseRange;
11
+ isCritical: boolean;
12
+ };
13
+ }
package/dist/index.d.ts CHANGED
@@ -28,8 +28,7 @@ export * from "./events/education-created";
28
28
  export * from "./events/education-generate";
29
29
  export * from "./events/exercise-generate";
30
30
  export * from "./events/exercise-created";
31
- export * from "./events/glucose-created";
32
- export * from "./events/glucose-generate";
31
+ export * from "./events/glucose-logged";
33
32
  export * from "./events/activity-logged";
34
33
  export * from "./events/steps-logging";
35
34
  export * from "./events/reward-created";
package/dist/index.js CHANGED
@@ -44,8 +44,7 @@ __exportStar(require("./events/education-created"), exports);
44
44
  __exportStar(require("./events/education-generate"), exports);
45
45
  __exportStar(require("./events/exercise-generate"), exports);
46
46
  __exportStar(require("./events/exercise-created"), exports);
47
- __exportStar(require("./events/glucose-created"), exports);
48
- __exportStar(require("./events/glucose-generate"), exports);
47
+ __exportStar(require("./events/glucose-logged"), exports);
49
48
  __exportStar(require("./events/activity-logged"), exports);
50
49
  __exportStar(require("./events/steps-logging"), exports);
51
50
  __exportStar(require("./events/reward-created"), exports);
package/dist/topics.d.ts CHANGED
@@ -18,8 +18,7 @@ export declare enum Topics {
18
18
  EducationGenerate = "education-generate",
19
19
  ExerciseCreated = "exercise-created",
20
20
  ExerciseGenerate = "exercise-generate",
21
- GlucoseCreated = "glucose-created",
22
- GlucoseGenerate = "glucose-generate",
21
+ GlucoseLogged = "glucose-logged",
23
22
  ActivityLogged = "activity-logged",
24
23
  RewardCreated = "reward-created",
25
24
  StepsLogging = "steps-logging",
package/dist/topics.js CHANGED
@@ -22,8 +22,7 @@ var Topics;
22
22
  Topics["EducationGenerate"] = "education-generate";
23
23
  Topics["ExerciseCreated"] = "exercise-created";
24
24
  Topics["ExerciseGenerate"] = "exercise-generate";
25
- Topics["GlucoseCreated"] = "glucose-created";
26
- Topics["GlucoseGenerate"] = "glucose-generate";
25
+ Topics["GlucoseLogged"] = "glucose-logged";
27
26
  Topics["ActivityLogged"] = "activity-logged";
28
27
  Topics["RewardCreated"] = "reward-created";
29
28
  Topics["StepsLogging"] = "steps-logging";
@@ -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.30",
3
+ "version": "1.4.32",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,15 +0,0 @@
1
- import { Topics } from "../topics";
2
- import { GlucoseType } from "../types/glucose";
3
- export interface GlucoseCreatedEvent {
4
- topic: Topics.GlucoseCreated;
5
- data: {
6
- userId: string;
7
- scheduledDate: string;
8
- schedules: {
9
- date: Date;
10
- type: GlucoseType;
11
- dueTime: string;
12
- hasLogged: boolean;
13
- }[];
14
- };
15
- }
@@ -1,7 +0,0 @@
1
- import { Topics } from "../topics";
2
- export interface GlucoseGenerateEvent {
3
- topic: Topics.GlucoseGenerate;
4
- data: {
5
- userId: string;
6
- };
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });