@hedia/types 3.12.4-alpha.350 → 3.12.5-alpha.352

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.
@@ -31,12 +31,12 @@ const CONSTANTS = exports.CONSTANTS = {
31
31
  ACTIVITY_DURATION_MAX: 120,
32
32
  /** The minimum insulin sensitivity setting in mmol/L per unit. (0.277) */
33
33
  INSULIN_SENSITIVITY_MIN: 0.277,
34
- /** The maximum insulin sensitivity setting in mmol/L per unit. (21.815, equal to 393 mg/dL per unit) */
35
- INSULIN_SENSITIVITY_MAX: 21.815,
34
+ /** The maximum insulin sensitivity setting in mmol/L per unit. (10.935) */
35
+ INSULIN_SENSITIVITY_MAX: 10.935,
36
36
  /** The minimum insulin-to-carbs ratio. (1.4 g/U) */
37
37
  INSULIN_TO_CARBS_RATIO_MIN: 1.4,
38
- /** The maximum insulin-to-carbs ratio. (100 g/U) */
39
- INSULIN_TO_CARBS_RATIO_MAX: 100,
38
+ /** The maximum insulin-to-carbs ratio. (50 g/U) */
39
+ INSULIN_TO_CARBS_RATIO_MAX: 50,
40
40
  /** The minimum valid glucose target in mmol/L. (4.385 mmol/L) */
41
41
  TARGET_GLUCOSE_MIN: 4.385,
42
42
  /** The maximum valid glucose target in mmol/L. (10 mmol/L) */
@@ -1 +1 @@
1
- {"version":3,"names":["CONSTANTS","exports","GLUCOSE_INPUT_MIN_MMOLL","GLUCOSE_INPUT_MAX_MMOLL","CARBOHYDRATES_INPUT_MIN","CARBOHYDRATES_INPUT_MAX","INSULIN_DOSE_MIN","INSULIN_DOSE_MAX","BOLUS_SECONDS_MIN","BOLUS_SECONDS_MAX","ACTIVITY_REDUCTION_MAX","ACTIVITY_REDUCTION_MIN","ACTIVITY_DURATION_MIN","ACTIVITY_DURATION_MAX","INSULIN_SENSITIVITY_MIN","INSULIN_SENSITIVITY_MAX","INSULIN_TO_CARBS_RATIO_MIN","INSULIN_TO_CARBS_RATIO_MAX","TARGET_GLUCOSE_MIN","TARGET_GLUCOSE_MAX","ACTIVITY_TARGET_GLUCOSE_MIN","ACTIVITY_TARGET_GLUCOSE_MAX","MGDL_PER_MMOLL_BGL","MMOLL_PER_MGDL_BGL","SEVERE_HYPERGLYCEMIA_MAX","SEVERE_HYPOGLYCEMIA_MIN","LEVEL_ONE_HYPOGLYCEMIA_MAX","LEVEL_ONE_HYPOGLYCEMIA_MIN","LEVEL_TWO_HYPOGLYCEMIA_MAX","LEVEL_TWO_HYPOGLYCEMIA_MIN","LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN","LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX","HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN","HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX","ActivityErrors","GlucoseErrors"],"sourceRoot":"../../../src","sources":["boluscalculator/boluscalculator.ts"],"mappings":";;;;;;AAGO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxB;EACAE,uBAAuB,EAAE,GAAG;EAE5B;EACAC,uBAAuB,EAAE,QAAQ;EAEjC;EACAC,uBAAuB,EAAE,CAAC;EAE1B;EACAC,uBAAuB,EAAE,GAAG;EAE5B;EACAC,gBAAgB,EAAE,CAAC;EAEnB;EACAC,gBAAgB,EAAE,EAAE;EAEpB;EACAC,iBAAiB,EAAE,CAAC;EAEpB;EACAC,iBAAiB,EAAE,KAAK;EAExB;EACAC,sBAAsB,EAAE,CAAC;EAEzB;EACAC,sBAAsB,EAAE,CAAC;EAEzB;EACAC,qBAAqB,EAAE,CAAC;EAExB;EACAC,qBAAqB,EAAE,GAAG;EAE1B;EACAC,uBAAuB,EAAE,KAAK;EAE9B;EACAC,uBAAuB,EAAE,MAAM;EAE/B;EACAC,0BAA0B,EAAE,GAAG;EAE/B;EACAC,0BAA0B,EAAE,GAAG;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,kBAAkB,EAAE,EAAE;EAEtB;EACAC,2BAA2B,EAAE,KAAK;EAElC;EACAC,2BAA2B,EAAE,IAAI;EAEjC;EACAC,kBAAkB,EAAE,OAAO;EAE3B;EACAC,kBAAkB,EAAE,oBAAoB;EAExC;EACAC,wBAAwB,EAAE,QAAQ;EAElC;EACAC,uBAAuB,EAAE,EAAE;EAE3B;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,GAAG;EAE/B;EACAC,gCAAgC,EAAE,GAAG;EAErC;EACAC,gCAAgC,EAAE,CAAC;EAEnC;EACAC,iCAAiC,EAAE,MAAM;EAEzC;EACAC,iCAAiC,EAAE;AACpC,CAAC;;AAED;AAAA,IACYC,cAAc,GAAAjC,OAAA,CAAAiC,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAO1B;AAAA,IACYC,aAAa,GAAAlC,OAAA,CAAAkC,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAkDzB;AAUA;AAYA;AAkBA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["CONSTANTS","exports","GLUCOSE_INPUT_MIN_MMOLL","GLUCOSE_INPUT_MAX_MMOLL","CARBOHYDRATES_INPUT_MIN","CARBOHYDRATES_INPUT_MAX","INSULIN_DOSE_MIN","INSULIN_DOSE_MAX","BOLUS_SECONDS_MIN","BOLUS_SECONDS_MAX","ACTIVITY_REDUCTION_MAX","ACTIVITY_REDUCTION_MIN","ACTIVITY_DURATION_MIN","ACTIVITY_DURATION_MAX","INSULIN_SENSITIVITY_MIN","INSULIN_SENSITIVITY_MAX","INSULIN_TO_CARBS_RATIO_MIN","INSULIN_TO_CARBS_RATIO_MAX","TARGET_GLUCOSE_MIN","TARGET_GLUCOSE_MAX","ACTIVITY_TARGET_GLUCOSE_MIN","ACTIVITY_TARGET_GLUCOSE_MAX","MGDL_PER_MMOLL_BGL","MMOLL_PER_MGDL_BGL","SEVERE_HYPERGLYCEMIA_MAX","SEVERE_HYPOGLYCEMIA_MIN","LEVEL_ONE_HYPOGLYCEMIA_MAX","LEVEL_ONE_HYPOGLYCEMIA_MIN","LEVEL_TWO_HYPOGLYCEMIA_MAX","LEVEL_TWO_HYPOGLYCEMIA_MIN","LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN","LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX","HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN","HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX","ActivityErrors","GlucoseErrors"],"sourceRoot":"../../../src","sources":["boluscalculator/boluscalculator.ts"],"mappings":";;;;;;AAGO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxB;EACAE,uBAAuB,EAAE,GAAG;EAE5B;EACAC,uBAAuB,EAAE,QAAQ;EAEjC;EACAC,uBAAuB,EAAE,CAAC;EAE1B;EACAC,uBAAuB,EAAE,GAAG;EAE5B;EACAC,gBAAgB,EAAE,CAAC;EAEnB;EACAC,gBAAgB,EAAE,EAAE;EAEpB;EACAC,iBAAiB,EAAE,CAAC;EAEpB;EACAC,iBAAiB,EAAE,KAAK;EAExB;EACAC,sBAAsB,EAAE,CAAC;EAEzB;EACAC,sBAAsB,EAAE,CAAC;EAEzB;EACAC,qBAAqB,EAAE,CAAC;EAExB;EACAC,qBAAqB,EAAE,GAAG;EAE1B;EACAC,uBAAuB,EAAE,KAAK;EAE9B;EACAC,uBAAuB,EAAE,MAAM;EAE/B;EACAC,0BAA0B,EAAE,GAAG;EAE/B;EACAC,0BAA0B,EAAE,EAAE;EAE9B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,kBAAkB,EAAE,EAAE;EAEtB;EACAC,2BAA2B,EAAE,KAAK;EAElC;EACAC,2BAA2B,EAAE,IAAI;EAEjC;EACAC,kBAAkB,EAAE,OAAO;EAE3B;EACAC,kBAAkB,EAAE,oBAAoB;EAExC;EACAC,wBAAwB,EAAE,QAAQ;EAElC;EACAC,uBAAuB,EAAE,EAAE;EAE3B;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,KAAK;EAEjC;EACAC,0BAA0B,EAAE,GAAG;EAE/B;EACAC,gCAAgC,EAAE,GAAG;EAErC;EACAC,gCAAgC,EAAE,CAAC;EAEnC;EACAC,iCAAiC,EAAE,MAAM;EAEzC;EACAC,iCAAiC,EAAE;AACpC,CAAC;;AAED;AAAA,IACYC,cAAc,GAAAjC,OAAA,CAAAiC,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAO1B;AAAA,IACYC,aAAa,GAAAlC,OAAA,CAAAkC,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAkDzB;AAUA;AAYA;AAkBA;AACA;AACA;AACA","ignoreList":[]}
@@ -27,11 +27,11 @@ export declare const CONSTANTS: {
27
27
  ACTIVITY_DURATION_MAX: number;
28
28
  /** The minimum insulin sensitivity setting in mmol/L per unit. (0.277) */
29
29
  INSULIN_SENSITIVITY_MIN: number;
30
- /** The maximum insulin sensitivity setting in mmol/L per unit. (21.815, equal to 393 mg/dL per unit) */
30
+ /** The maximum insulin sensitivity setting in mmol/L per unit. (10.935) */
31
31
  INSULIN_SENSITIVITY_MAX: number;
32
32
  /** The minimum insulin-to-carbs ratio. (1.4 g/U) */
33
33
  INSULIN_TO_CARBS_RATIO_MIN: number;
34
- /** The maximum insulin-to-carbs ratio. (100 g/U) */
34
+ /** The maximum insulin-to-carbs ratio. (50 g/U) */
35
35
  INSULIN_TO_CARBS_RATIO_MAX: number;
36
36
  /** The minimum valid glucose target in mmol/L. (4.385 mmol/L) */
37
37
  TARGET_GLUCOSE_MIN: number;
@@ -1 +1 @@
1
- {"version":3,"file":"boluscalculator.d.ts","sourceRoot":"","sources":["../../../src/boluscalculator/boluscalculator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,SAAS;IACrB,oFAAoF;;IAGpF,yFAAyF;;IAGzF,sEAAsE;;IAGtE,wEAAwE;;IAGxE,mDAAmD;;IAGnD,oDAAoD;;IAGpD,qDAAqD;;IAGrD,oEAAoE;;IAGpE,gEAAgE;;IAGhE,gEAAgE;;IAGhE,8DAA8D;;IAG9D,gEAAgE;;IAGhE,0EAA0E;;IAG1E,wGAAwG;;IAGxG,oDAAoD;;IAGpD,oDAAoD;;IAGpD,iEAAiE;;IAGjE,8DAA8D;;IAG9D,0EAA0E;;IAG1E,yEAAyE;;IAGzE,yGAAyG;;IAGzG,sHAAsH;;IAGtH,kHAAkH;;IAGlH,gHAAgH;;IAGhH,iHAAiH;;IAGjH,iHAAiH;;IAGjH,qHAAqH;;IAGrH,mHAAmH;;IAGnH,uIAAuI;;IAGvI,oIAAoI;;IAGpI,0IAA0I;;IAG1I,wIAAwI;;CAExI,CAAC;AAEF,iEAAiE;AACjE,oBAAY,cAAc;IACzB,kBAAkB,0BAA0B;IAC5C,eAAe,uCAAuC;IACtD,gBAAgB,+BAA+B;IAC/C,gBAAgB,+BAA+B;CAC/C;AAED,gEAAgE;AAChE,oBAAY,aAAa;IACxB,qBAAqB,4BAA4B;IACjD,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7C,oBAAoB,6BAA6B;CACjD;AAED,UAAU,kBAAkB;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAC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2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,2GAA2G;IAC3G,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gEAAgE;IAChE,kBAAkB,EAAE,IAAI,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "3.12.4-alpha.350",
3
+ "version": "3.12.5-alpha.352",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/index.d.ts",
7
7
  "engines": {
8
8
  "node": ">=22.14.0"
9
9
  },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+ssh://git@github.com:hedia-team/hedia-types.git"
13
- },
10
+ "repository": "github:hedia-team/hedia-types",
14
11
  "files": [
15
- "lib"
12
+ "lib",
13
+ "src"
16
14
  ],
15
+ "sideEffects": false,
17
16
  "scripts": {
18
17
  "tsc": "tsc --noEmit",
19
18
  "eslint": "eslint .",
@@ -24,10 +23,8 @@
24
23
  "validate": "npm run tsc && npm run eslint && npm run prettier && npm run pkg-json-lint && npm audit --audit-level=critical",
25
24
  "prepack": "bob build"
26
25
  },
27
- "keywords": [],
28
26
  "author": "Hedia",
29
- "license": "ISC",
30
- "homepage": "https://github.com/hedia-team/hedia-types#readme",
27
+ "license": "UNLICENSED",
31
28
  "devDependencies": {
32
29
  "@hedia/eslint-config": "6.0.7",
33
30
  "@hedia/prettier-config": "1.2.9",
@@ -0,0 +1,83 @@
1
+ export interface IActivityEntry {
2
+ uuid: string;
3
+ type: ActivityEnum | null;
4
+ activityIntensity: ActivityIntensity | null;
5
+ durationSeconds: number;
6
+ startTimestamp: string | null;
7
+ deleted: boolean;
8
+ uuidOld?: IActivityEntry["uuid"];
9
+ overwrittenByUUID?: IActivityEntry["uuid"];
10
+ }
11
+
12
+ /** Enum that represents a set of insulin reduction fraction settings that can vary by the duration of the activity */
13
+ export enum ActivityReductionIntervals {
14
+ fromZero = "fromZero",
15
+ fromThirty = "fromThirty",
16
+ fromFortysix = "fromFortysix",
17
+ fromSixtyone = "fromSixtyone",
18
+ }
19
+
20
+ /** Enum used to indicate the category or intensity of a physical activity. */
21
+ export enum ActivityIntensity {
22
+ light = "light",
23
+ moderate = "moderate",
24
+ hard = "hard",
25
+ }
26
+
27
+ /** Enum used to indicate the type of physical activity performed by the user. */
28
+ export enum ActivityEnum {
29
+ Run = "Run",
30
+ Walk = "Walk",
31
+ Cycling = "Cycling",
32
+ Swim = "Swim",
33
+ Other = "Other",
34
+ Sport = "Sport",
35
+ Workout = "Workout",
36
+ }
37
+
38
+ /**
39
+ * Represents whether the reduction fraction is a number or it is null.
40
+ * For the settings of hard physical activities over 45 minutes the value is null.
41
+ * For physical activities over 60 minutes the value is also null
42
+ * A null value represents that it is not supported by HDA but users can still set it.
43
+ */
44
+ type ReductionValue<
45
+ Intensity extends ActivityIntensity,
46
+ Interval extends ActivityReductionIntervals,
47
+ > = Interval extends ActivityReductionIntervals.fromSixtyone
48
+ ? number | null
49
+ : Intensity extends ActivityIntensity.hard
50
+ ? Interval extends ActivityReductionIntervals.fromFortysix
51
+ ? number | null
52
+ : number
53
+ : number;
54
+
55
+ type ActivityReductionMatrix = {
56
+ [I in ActivityIntensity]: {
57
+ [J in ActivityReductionIntervals]: ReductionValue<I, J>;
58
+ };
59
+ };
60
+
61
+ type PostReductionValue<Interval extends ActivityReductionIntervals> =
62
+ Interval extends ActivityReductionIntervals.fromSixtyone ? number | null : number;
63
+
64
+ interface ActivityPostReduction {
65
+ post: { [Interval in ActivityReductionIntervals]: PostReductionValue<Interval> };
66
+ }
67
+
68
+ /** Type that represents the user’s settings related to physical activity. */
69
+ export interface ActivitySettings extends ActivityPostReduction, ActivityReductionMatrix {
70
+ target: number;
71
+ updatedAt?: string; // ISO string
72
+ }
73
+
74
+ /**
75
+ * Legacy activity settings type that allows fromSixtyone to be undefined for types backward compatibility
76
+ * TODO: Can be removed when 3.5.0 is the minimum supported version.
77
+ */
78
+ export type LegacyActivitySettings = Omit<ActivitySettings, "hard" | "moderate" | "light" | "post"> & {
79
+ hard: Omit<ActivitySettings["hard"], "fromSixtyone"> & { fromSixtyone?: number | null };
80
+ moderate: Omit<ActivitySettings["moderate"], "fromSixtyone"> & { fromSixtyone?: number | null };
81
+ light: Omit<ActivitySettings["light"], "fromSixtyone"> & { fromSixtyone?: number | null };
82
+ post: Omit<ActivitySettings["post"], "fromSixtyone"> & { fromSixtyone?: number | null };
83
+ };
@@ -0,0 +1,226 @@
1
+ import type { ActivityIntensity, ActivitySettings } from "../activity/activity";
2
+ import type { BloodGlucoseUnit } from "../enums";
3
+
4
+ export const CONSTANTS = {
5
+ /** The minimum blood glucose level that may be entered by the user. (1.1 mmol/L) */
6
+ GLUCOSE_INPUT_MIN_MMOLL: 1.1,
7
+
8
+ /** The maximum blood glucose level that may be entered by the user. (33.30449 mmol/L) */
9
+ GLUCOSE_INPUT_MAX_MMOLL: 33.30449,
10
+
11
+ /** The lower limit for the amount of carbohydrates in grams. (0 g) */
12
+ CARBOHYDRATES_INPUT_MIN: 0,
13
+
14
+ /** The upper limit for the amount of carbohydrates in grams. (300 g) */
15
+ CARBOHYDRATES_INPUT_MAX: 300,
16
+
17
+ /** The minimum insulin dose in units. (0 units) */
18
+ INSULIN_DOSE_MIN: 0,
19
+
20
+ /** The maximum insulin dose in units. (60 units) */
21
+ INSULIN_DOSE_MAX: 60,
22
+
23
+ /** The minimum age of boluses in seconds. (0 sec) */
24
+ BOLUS_SECONDS_MIN: 0,
25
+
26
+ /** The maximum age of boluses in seconds. (14400 sec or 4 hours) */
27
+ BOLUS_SECONDS_MAX: 14400,
28
+
29
+ /** The maximum reduction factor for a physical activity. (1) */
30
+ ACTIVITY_REDUCTION_MAX: 1,
31
+
32
+ /** The minimum reduction factor for a physical activity. (0) */
33
+ ACTIVITY_REDUCTION_MIN: 0,
34
+
35
+ /** The minimum duration of an activity in minutes. (1 min) */
36
+ ACTIVITY_DURATION_MIN: 1,
37
+
38
+ /** The maximum duration of an activity in minutes. (120 min) */
39
+ ACTIVITY_DURATION_MAX: 120,
40
+
41
+ /** The minimum insulin sensitivity setting in mmol/L per unit. (0.277) */
42
+ INSULIN_SENSITIVITY_MIN: 0.277,
43
+
44
+ /** The maximum insulin sensitivity setting in mmol/L per unit. (10.935) */
45
+ INSULIN_SENSITIVITY_MAX: 10.935,
46
+
47
+ /** The minimum insulin-to-carbs ratio. (1.4 g/U) */
48
+ INSULIN_TO_CARBS_RATIO_MIN: 1.4,
49
+
50
+ /** The maximum insulin-to-carbs ratio. (50 g/U) */
51
+ INSULIN_TO_CARBS_RATIO_MAX: 50,
52
+
53
+ /** The minimum valid glucose target in mmol/L. (4.385 mmol/L) */
54
+ TARGET_GLUCOSE_MIN: 4.385,
55
+
56
+ /** The maximum valid glucose target in mmol/L. (10 mmol/L) */
57
+ TARGET_GLUCOSE_MAX: 10,
58
+
59
+ /** The minimum valid activity glucose target in mmol/L. (4.995 mmol/L) */
60
+ ACTIVITY_TARGET_GLUCOSE_MIN: 4.995,
61
+
62
+ /** The maximum valid activity glucose target in mmol/L. (13.9 mmol/L) */
63
+ ACTIVITY_TARGET_GLUCOSE_MAX: 13.9,
64
+
65
+ /** The conversion factor to multiply a blood glucose value with to go from mmol/L to mg/dL. (18.0156) */
66
+ MGDL_PER_MMOLL_BGL: 18.0156,
67
+
68
+ /** The conversion factor to multiply a blood glucose value with to go from mg/dL to mmol/L. (0.055507449099669176) */
69
+ MMOLL_PER_MGDL_BGL: 0.055507449099669176,
70
+
71
+ /** The maximum glucose value for providing the severe hyperglycemia attention message in mmol/L. (33.3 mmol/L) */
72
+ SEVERE_HYPERGLYCEMIA_MAX: 33.30449,
73
+
74
+ /** The minimum glucose value for providing the severe hyperglycemia attention message in mmol/L. (20 mmol/L) */
75
+ SEVERE_HYPOGLYCEMIA_MIN: 20,
76
+
77
+ /** The maximum glucose value for providing the mild hyperglycemia attention message in mmol/L. (3.831 mmol/L) */
78
+ LEVEL_ONE_HYPOGLYCEMIA_MAX: 3.831,
79
+
80
+ /** The minimum glucose value for providing the mild hyperglycemia attention message in mmol/L. (2.942 mmol/L) */
81
+ LEVEL_ONE_HYPOGLYCEMIA_MIN: 2.997,
82
+
83
+ /** The maximum glucose value for providing the moderate hyperglycemia attention message in mmol/L. (2.942 mmol/L) */
84
+ LEVEL_TWO_HYPOGLYCEMIA_MAX: 2.942,
85
+
86
+ /** The minimum glucose value for providing the moderate hyperglycemia attention message in mmol/L. (1.1 mmol/L) */
87
+ LEVEL_TWO_HYPOGLYCEMIA_MIN: 1.1,
88
+
89
+ /** The minimum glucose value in mmol/L for providing the low glucose message when having an active physical activity. (1.1 mmol/L) */
90
+ LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN: 1.1,
91
+
92
+ /** The maximum glucose value in mmol/L for providing the low glucose message when having an active physical activity. (5 mmol/L) */
93
+ LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX: 5,
94
+
95
+ /** The minimum glucose value in mmol/L for providing the high glucose message when having an active physical activity. (13.932 mmol/L) */
96
+ HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN: 13.932,
97
+
98
+ /** The maximum glucose value in mmol/L for providing the high glucose message when having an active physical activity. (33.3 mmol/L) */
99
+ HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX: 33.30449,
100
+ };
101
+
102
+ /** Enum for differentiating between Activity types of errors. */
103
+ export enum ActivityErrors {
104
+ OutOfRangeDuration = "Duration Out of range",
105
+ InvalidInterval = "Invalid activity settings interval",
106
+ InvalidReduction = "Invalid activity Reduction",
107
+ MissingIntensity = "Missing activity intensity",
108
+ }
109
+
110
+ /** Enum for differentiating between Glucose types of errors. */
111
+ export enum GlucoseErrors {
112
+ MissingGlucoseReading = "Missing glucose reading",
113
+ InvalidGlucoseUnit = "Invalid glucose unit",
114
+ InvalidGlucoseValue = "Invalid glucose value",
115
+ OutOfRangeCurrentBGL = "Current BGL out of range",
116
+ }
117
+
118
+ interface BaseGlucoseReading {
119
+ id: string;
120
+ value: number;
121
+ unit: BloodGlucoseUnit;
122
+ timestamp: number;
123
+ }
124
+
125
+ type DeviceGlucoseReading = BaseGlucoseReading & {
126
+ source: "device";
127
+ deviceName: string;
128
+ };
129
+
130
+ type ExternalGlucoseReading = BaseGlucoseReading & {
131
+ source: "external";
132
+ sampleId: string;
133
+ sourceId: string;
134
+ sourceName: string;
135
+ deviceName: string;
136
+ };
137
+
138
+ type ForecastGlucoseReading = BaseGlucoseReading & {
139
+ source: "forecast";
140
+ sampleId: string;
141
+ sourceId: string;
142
+ sourceName: string;
143
+ };
144
+
145
+ type CgmGlucoseReading = BaseGlucoseReading & {
146
+ source: "cgm";
147
+ sourceName: string;
148
+ };
149
+
150
+ type ManualGlucoseReading = BaseGlucoseReading & {
151
+ source: "manual";
152
+ };
153
+
154
+ export type GlucoseReading =
155
+ | DeviceGlucoseReading
156
+ | ExternalGlucoseReading
157
+ | ForecastGlucoseReading
158
+ | CgmGlucoseReading
159
+ | ManualGlucoseReading;
160
+
161
+ /** Represents a single bolus of fast-acting insulin that has been administered within the past 4 hours. */
162
+ export interface IRecentBolus {
163
+ /** The number of seconds that has passed since the bolus in question was administered. */
164
+ secondsPassed: number;
165
+ /** The amount of insulin that was administered with the bolus in question. */
166
+ insulinDose: number;
167
+ /** The unique identifier (UUID) of the bolus event. */
168
+ id: string;
169
+ }
170
+
171
+ /** Details about a physical activity. */
172
+ export interface IActivityParams {
173
+ /** The duration of the physical activity in minutes. */
174
+ activityDuration: number;
175
+ /** The intensity of the activity */
176
+ activityIntensity: ActivityIntensity | null;
177
+ /** The user’s current settings for physical activity */
178
+ activitySettings: ActivitySettings;
179
+ /** Start date and time for the activity */
180
+ activityDate: Date;
181
+ }
182
+
183
+ /** IRecommendationParams contains data that is used to calculate a recommendation. */
184
+ export interface IRecommendationParams {
185
+ /** The user’s current blood glucose level in mmol/L */
186
+ glucoseReading: GlucoseReading;
187
+ /** The blood glucose level in mmol/L that the user should ideally have at this time of day according to their settings/preferences. */
188
+ targetBGL: number;
189
+ /** The user’s current insulin sensitivity in (mmol/L)/IU according to their settings/preferences. */
190
+ insulinSensitivity: number;
191
+ /** The amount of carbohydrates in grams that the user has entered that they are going to eat. */
192
+ carbohydrates: number;
193
+ /** The user’s current insulin-to-carbs ratio in g/IU according to their settings/preferences. */
194
+ carbohydrateRatio: number;
195
+ /** A possibly empty array of IRecentBolus objects. */
196
+ recentBoluses: IRecentBolus[];
197
+ /** Information about the activity that the user is doing including their activity settings */
198
+ activity: IActivityParams | null;
199
+ }
200
+
201
+ /**
202
+ * The result of a recommendation calculation is returned by the calculateRecommendation() function as an object that implements this interface.
203
+ * Note that only one of bolus and carbRecommendation may be positive. If one is non-zero then the other must be zero.
204
+ */
205
+ export interface IRecommendationResult {
206
+ /** The recommended amount of insulin measured in units. */
207
+ bolus: number;
208
+ /**
209
+ * Indicates whether or not the insulin recommendation (given in the bolus property) was capped because the underlying recommendation exceeded the safety limit.
210
+ * If it is true then we know that the recommendation would have been higher and can show and appropriate message to the user.
211
+ */
212
+ wasLimited: boolean;
213
+ /** The number of carbs that the user is recommended to eat */
214
+ carbRecommendation: number;
215
+ /**
216
+ * Indicates how much the insulin recommendation was reduced due to physical activity.
217
+ * A value of 0.75 would indicate that the recommended insulin was reduced by 25%.
218
+ */
219
+ activityReduction: number | null;
220
+ /** The estimated amount of active insulin (IOB) in IU. */
221
+ activeInsulin: number;
222
+ /** The unique identifiers (UUIDs) of the recent boluses that were used to calculate the active insulin. */
223
+ recentBolusesIds: string[];
224
+ /** The date and time when the recommendation was calculated. */
225
+ recommendationDate: Date;
226
+ }
package/src/enums.ts ADDED
@@ -0,0 +1,498 @@
1
+ /** Represents a unit for measuring blood glucose levels. */
2
+ export enum BloodGlucoseUnit {
3
+ MMOL_L = "mmol/l",
4
+ MG_DL = "mg/dl",
5
+ }
6
+
7
+ /** Represents a unit for measuring blood ketone levels. */
8
+ export enum BloodKetonesUnit {
9
+ MMOL_L = "mmol/l",
10
+ MG_DL = "mg/dl",
11
+ }
12
+
13
+ /** Represents a unit for measuring insulin intake */
14
+ export enum InsulinUnit {
15
+ IU = "IU",
16
+ }
17
+
18
+ /** Represents a language that the app can be displayed in. */
19
+ export enum Languages {
20
+ da = "Dansk",
21
+ en = "English",
22
+ de = "Deutsch",
23
+ es = "Español",
24
+ fr = "Français",
25
+ it = "Italiano",
26
+ sv = "Svenska",
27
+ }
28
+
29
+ /** Enum containing constants for seconds, minutes, hours, or days in milliseconds */
30
+ export enum Milliseconds {
31
+ Second = 1000,
32
+ Minute = 60000,
33
+ Hour = 3600000,
34
+ Day = 86400000,
35
+ }
36
+
37
+ /** Enum containing the possible ketone levels of the user */
38
+ export enum KetoneLevels {
39
+ None = "None",
40
+ Normal = "Normal",
41
+ SlightlyIncreased = "SlightlyIncreased",
42
+ Moderate = "Moderate",
43
+ High = "High",
44
+ }
45
+
46
+ /**
47
+ * Enum containing constants for displaying colour indicators regarding the blood ketone levels of the user.
48
+ * Blood ketones ranges and the color scheme can be found at:
49
+ * https://hedia.atlassian.net/wiki/spaces/QMS/pages/827785277/QF-73-3-1+Ketones+and+current+functions+in+HDA#4.0-Ketone-procedure-in-HDA
50
+ */
51
+ export const KetonesRGB: Record<KetoneLevels, string> = {
52
+ [KetoneLevels.None]: "#171931",
53
+ [KetoneLevels.Normal]: "#DFB38F",
54
+ [KetoneLevels.SlightlyIncreased]: "#DB988D",
55
+ [KetoneLevels.Moderate]: "#A96660",
56
+ [KetoneLevels.High]: "#773751",
57
+ };
58
+
59
+ export enum StatusCode {
60
+ /**
61
+ * The server has received the request headers and the client should proceed to send the request body
62
+ * (in the case of a request for which a body needs to be sent; for example, a POST request).
63
+ * Sending a large request body to a server after a request
64
+ * has been rejected for inappropriate headers would be inefficient.
65
+ * To have a server check the request's headers, a client
66
+ * must send Expect: 100-continue as a header in its initial request
67
+ * and receive a 100 Continue status code in response before
68
+ * sending the body. The response 417 Expectation Failed indicates the request should not be continued.
69
+ */
70
+ CONTINUE = 100,
71
+
72
+ /**
73
+ * The requester has asked the server to switch protocols and the server has agreed to do so.
74
+ */
75
+ SWITCHING_PROTOCOLS = 101,
76
+
77
+ /**
78
+ * A WebDAV request may contain many sub-requests involving
79
+ * file operations, requiring a long time to complete the request.
80
+ * This code indicates that the server has received and is processing the request, but no response is available yet.
81
+ * This prevents the client from timing out and assuming the request was lost.
82
+ */
83
+ PROCESSING = 102,
84
+
85
+ /**
86
+ * Standard response for successful HTTP requests.
87
+ * The actual response will depend on the request method used.
88
+ * In a GET request, the response will contain an entity corresponding to the requested resource.
89
+ * In a POST request, the response will contain an entity describing or containing the result of the action.
90
+ */
91
+ OK = 200,
92
+
93
+ /**
94
+ * The request has been fulfilled, resulting in the creation of a new resource.
95
+ */
96
+ CREATED = 201,
97
+
98
+ /**
99
+ * The request has been accepted for processing, but the processing has not been completed.
100
+ * The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
101
+ */
102
+ ACCEPTED = 202,
103
+
104
+ /**
105
+ * SINCE HTTP/1.1
106
+ * The server is a transforming proxy that received a 200 OK from its origin,
107
+ * but is returning a modified version of the origin's response.
108
+ */
109
+ NON_AUTHORITATIVE_INFORMATION = 203,
110
+
111
+ /**
112
+ * The server successfully processed the request and is not returning any content.
113
+ */
114
+ NO_CONTENT = 204,
115
+
116
+ /**
117
+ * The server successfully processed the request, but is not returning any content.
118
+ * Unlike a 204 response, this response requires that the requester reset the document view.
119
+ */
120
+ RESET_CONTENT = 205,
121
+
122
+ /**
123
+ * The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
124
+ * The range header is used by HTTP clients to enable resuming of interrupted downloads,
125
+ * or split a download into multiple simultaneous streams.
126
+ */
127
+ PARTIAL_CONTENT = 206,
128
+
129
+ /**
130
+ * The message body that follows is an XML message and can contain a number of separate response codes,
131
+ * depending on how many sub-requests were made.
132
+ */
133
+ MULTI_STATUS = 207,
134
+
135
+ /**
136
+ * The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,
137
+ * and are not being included again.
138
+ */
139
+ ALREADY_REPORTED = 208,
140
+
141
+ /**
142
+ * The server has fulfilled a request for the resource,
143
+ * and the response is a representation of the result of
144
+ * one or more instance-manipulations applied to the current instance.
145
+ */
146
+ IM_USED = 226,
147
+
148
+ /**
149
+ * Indicates multiple options for the resource from which the
150
+ * client may choose (via agent-driven content negotiation).
151
+ * For example, this code could be used to present multiple video format options,
152
+ * to list files with different filename extensions, or to suggest word-sense disambiguation.
153
+ */
154
+ MULTIPLE_CHOICES = 300,
155
+
156
+ /**
157
+ * This and all future requests should be directed to the given URI.
158
+ */
159
+ MOVED_PERMANENTLY = 301,
160
+
161
+ /**
162
+ * This is an example of industry practice contradicting the standard.
163
+ * The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
164
+ * (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
165
+ * with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
166
+ * to distinguish between the two behaviours. However, some Web applications and frameworks
167
+ * use the 302 status code as if it were the 303.
168
+ */
169
+ FOUND = 302,
170
+
171
+ /**
172
+ * SINCE HTTP/1.1
173
+ * The response to the request can be found under another URI using a GET method.
174
+ * When received in response to a POST (or PUT/DELETE), the client should presume that
175
+ * the server has received the data and should issue a redirect with a separate GET message.
176
+ */
177
+ SEE_OTHER = 303,
178
+
179
+ /**
180
+ * Indicates that the resource has not been modified since the
181
+ * version specified by the request headers If-Modified-Since or If-None-Match.
182
+ * In such case, there is no need to retransmit the resource
183
+ * since the client still has a previously-downloaded copy.
184
+ */
185
+ NOT_MODIFIED = 304,
186
+
187
+ /**
188
+ * SINCE HTTP/1.1
189
+ * The requested resource is available only through a proxy, the address for which is provided in the response.
190
+ * Many HTTP clients (such as Mozilla and Internet Explorer) do not
191
+ * correctly handle responses with this status code, primarily for security reasons.
192
+ */
193
+ USE_PROXY = 305,
194
+
195
+ /**
196
+ * No longer used. Originally meant "Subsequent requests should use the specified proxy."
197
+ */
198
+ SWITCH_PROXY = 306,
199
+
200
+ /**
201
+ * SINCE HTTP/1.1
202
+ * In this case, the request should be repeated with another URI;
203
+ * however, future requests should still use the original URI.
204
+ * In contrast to how 302 was historically implemented,
205
+ * the request method is not allowed to be changed when reissuing the original request.
206
+ * For example, a POST request should be repeated using another POST request.
207
+ */
208
+ TEMPORARY_REDIRECT = 307,
209
+
210
+ /**
211
+ * The request and all future requests should be repeated using another URI.
212
+ * 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
213
+ * So, for example, submitting a form to a permanently redirected resource may continue smoothly.
214
+ */
215
+ PERMANENT_REDIRECT = 308,
216
+
217
+ /**
218
+ * The server cannot or will not process the request due to an apparent client error
219
+ * (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
220
+ */
221
+ BAD_REQUEST = 400,
222
+
223
+ /**
224
+ * Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
225
+ * been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
226
+ * requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
227
+ * "unauthenticated",i.e. the user does not have the necessary credentials.
228
+ */
229
+ UNAUTHORIZED = 401,
230
+
231
+ /**
232
+ * Reserved for future use. The original intention was that this code might be used as part of some form of digital
233
+ * cash or micro payment scheme, but that has not happened, and this code is not usually used.
234
+ * Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
235
+ */
236
+ PAYMENT_REQUIRED = 402,
237
+
238
+ /**
239
+ * The request was valid, but the server is refusing action.
240
+ * The user might not have the necessary permissions for a resource.
241
+ */
242
+ FORBIDDEN = 403,
243
+
244
+ /**
245
+ * The requested resource could not be found but may be available in the future.
246
+ * Subsequent requests by the client are permissible.
247
+ */
248
+ NOT_FOUND = 404,
249
+
250
+ /**
251
+ * A request method is not supported for the requested resource;
252
+ * for example, a GET request on a form that requires data to be
253
+ * presented via POST, or a PUT request on a read-only resource.
254
+ */
255
+ METHOD_NOT_ALLOWED = 405,
256
+
257
+ /**
258
+ * The requested resource is capable of generating only content
259
+ * not acceptable according to the Accept headers sent in the request.
260
+ */
261
+ NOT_ACCEPTABLE = 406,
262
+
263
+ /**
264
+ * The client must first authenticate itself with the proxy.
265
+ */
266
+ PROXY_AUTHENTICATION_REQUIRED = 407,
267
+
268
+ /**
269
+ * The server timed out waiting for the request.
270
+ * According to HTTP specifications:
271
+ * "The client did not produce a request within the time that
272
+ * the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
273
+ */
274
+ REQUEST_TIMEOUT = 408,
275
+
276
+ /**
277
+ * Indicates that the request could not be processed because of conflict in the request,
278
+ * such as an edit conflict between multiple simultaneous updates.
279
+ */
280
+ CONFLICT = 409,
281
+
282
+ /**
283
+ * Indicates that the resource requested is no longer available and will not be available again.
284
+ * This should be used when a resource has been intentionally removed and the resource should be purged.
285
+ * Upon receiving a 410 status code, the client should not request the resource in the future.
286
+ * Clients such as search engines should remove the resource from their indices.
287
+ * Most use cases do not require clients and search engines
288
+ * to purge the resource, and a "404 Not Found" may be used instead.
289
+ */
290
+ GONE = 410,
291
+
292
+ /**
293
+ * The request did not specify the length of its content, which is required by the requested resource.
294
+ */
295
+ LENGTH_REQUIRED = 411,
296
+
297
+ /**
298
+ * The server does not meet one of the preconditions that the requester put on the request.
299
+ */
300
+ PRECONDITION_FAILED = 412,
301
+
302
+ /**
303
+ * The request is larger than the server is willing or
304
+ * able to process. Previously called "Request Entity Too Large".
305
+ */
306
+ PAYLOAD_TOO_LARGE = 413,
307
+
308
+ /**
309
+ * The URI provided was too long for the server to process.
310
+ * Often the result of too much data being encoded as a query-string of a GET request,
311
+ * in which case it should be converted to a POST request.
312
+ * Called "Request-URI Too Long" previously.
313
+ */
314
+ URI_TOO_LONG = 414,
315
+
316
+ /**
317
+ * The request entity has a media type which the server or resource does not support.
318
+ * For example, the client uploads an image as image/svg+xml,
319
+ * but the server requires that images use a different format.
320
+ */
321
+ UNSUPPORTED_MEDIA_TYPE = 415,
322
+
323
+ /**
324
+ * The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
325
+ * For example, if the client asked for a part of the file that lies beyond the end of the file.
326
+ * Called "Requested Range Not Satisfiable" previously.
327
+ */
328
+ RANGE_NOT_SATISFIABLE = 416,
329
+
330
+ /**
331
+ * The server cannot meet the requirements of the Expect request-header field.
332
+ */
333
+ EXPECTATION_FAILED = 417,
334
+ /**
335
+ * The request was directed at a server that is not able to
336
+ * produce a response (for example because a connection reuse).
337
+ */
338
+ MISDIRECTED_REQUEST = 421,
339
+
340
+ /**
341
+ * The request was well-formed but was unable to be followed due to semantic errors.
342
+ */
343
+ UNPROCESSABLE_ENTITY = 422,
344
+
345
+ /**
346
+ * The resource that is being accessed is locked.
347
+ */
348
+ LOCKED = 423,
349
+
350
+ /**
351
+ * The request failed due to failure of a previous request (e.g., a PROPPATCH).
352
+ */
353
+ FAILED_DEPENDENCY = 424,
354
+
355
+ /**
356
+ * The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
357
+ */
358
+ UPGRADE_REQUIRED = 426,
359
+
360
+ /**
361
+ * The origin server requires the request to be conditional.
362
+ * Intended to prevent "the 'lost update' problem, where a client
363
+ * GETs a resource's state, modifies it, and PUTs it back to the server,
364
+ * when meanwhile a third party has modified the state on the server, leading to a conflict."
365
+ */
366
+ PRECONDITION_REQUIRED = 428,
367
+
368
+ /**
369
+ * The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
370
+ */
371
+ TOO_MANY_REQUESTS = 429,
372
+
373
+ /**
374
+ * The server is unwilling to process the request because either an individual header field,
375
+ * or all the header fields collectively, are too large.
376
+ */
377
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
378
+
379
+ /**
380
+ * A server operator has received a legal demand to deny access to a resource or to a set of resources
381
+ * that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
382
+ */
383
+ UNAVAILABLE_FOR_LEGAL_REASONS = 451,
384
+
385
+ /**
386
+ * A generic error message, given when an unexpected condition
387
+ * was encountered and no more specific message is suitable.
388
+ */
389
+ INTERNAL_SERVER_ERROR = 500,
390
+
391
+ /**
392
+ * The server either does not recognize the request method, or it lacks the ability to fulfill the request.
393
+ * Usually this implies future availability (e.g., a new feature of a web-service API).
394
+ */
395
+ NOT_IMPLEMENTED = 501,
396
+
397
+ /**
398
+ * The server was acting as a gateway or proxy and received an invalid response from the upstream server.
399
+ */
400
+ BAD_GATEWAY = 502,
401
+
402
+ /**
403
+ * The server is currently unavailable (because it is overloaded or down for maintenance).
404
+ * Generally, this is a temporary state.
405
+ */
406
+ SERVICE_UNAVAILABLE = 503,
407
+
408
+ /**
409
+ * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
410
+ */
411
+ GATEWAY_TIMEOUT = 504,
412
+
413
+ /**
414
+ * The server does not support the HTTP protocol version used in the request
415
+ */
416
+ HTTP_VERSION_NOT_SUPPORTED = 505,
417
+
418
+ /**
419
+ * Transparent content negotiation for the request results in a circular reference.
420
+ */
421
+ VARIANT_ALSO_NEGOTIATES = 506,
422
+
423
+ /**
424
+ * The server is unable to store the representation needed to complete the request.
425
+ */
426
+ INSUFFICIENT_STORAGE = 507,
427
+
428
+ /**
429
+ * Further extensions to the request are required for the server to fulfill it.
430
+ */
431
+ NOT_EXTENDED = 510,
432
+
433
+ /**
434
+ * The client needs to authenticate to gain network access.
435
+ * Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
436
+ * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
437
+ */
438
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
439
+
440
+ /**
441
+ * Client token expired, new token available from server.
442
+ */
443
+ TOKEN_EXPIRED = 666,
444
+ }
445
+
446
+ export enum HTTPRequestMethod {
447
+ /**
448
+ * The "CONNECT" method establishes a tunnel to the server identified by the
449
+ * target resource.
450
+ */
451
+ CONNECT = "CONNECT",
452
+
453
+ /**
454
+ * The "DELETE" method deletes the specified resource.
455
+ */
456
+ DELETE = "DELETE",
457
+
458
+ /**
459
+ * The "GET" method requests a representation of the specified resource.
460
+ * Requests using GET should only retrieve data.
461
+ */
462
+ GET = "GET",
463
+
464
+ /**
465
+ * The "HEAD" method asks for a response identical to that of a GET request,
466
+ * but without the response body.
467
+ */
468
+ HEAD = "HEAD",
469
+
470
+ /**
471
+ * The "OPTIONS" method is used to describe the communication options for the
472
+ * target resource.
473
+ */
474
+ OPTIONS = "OPTIONS",
475
+
476
+ /**
477
+ * The PATCH method is used to apply partial modifications to a resource.
478
+ */
479
+ PATCH = "PATCH",
480
+
481
+ /**
482
+ * The "POST" method is used to submit an entity to the specified resource,
483
+ * often causing a change in state or side effects on the server.
484
+ */
485
+ POST = "POST",
486
+
487
+ /**
488
+ * The "PUT" method replaces all current representations of the target
489
+ * resource with the request payload.
490
+ */
491
+ PUT = "PUT",
492
+
493
+ /**
494
+ * The "TRACE" method performs a message loop-back test along the path to the
495
+ * target resource.
496
+ */
497
+ TRACE = "TRACE",
498
+ }
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./activity/activity";
2
+ export * from "./boluscalculator/boluscalculator";
3
+ export * from "./logbook/logbook";
4
+ export * from "./userdetails/userdetails";
5
+ export * from "./usersettings/usersettings";
6
+ export * from "./enums";
@@ -0,0 +1,195 @@
1
+ /** Used to differentiate the different moods that users can select. */
2
+ export enum MoodEnum {
3
+ Sad = 1,
4
+ SemiSad = 2,
5
+ Neutral = 3,
6
+ SemiHappy = 4,
7
+ Happy = 5,
8
+ }
9
+
10
+ export interface IEditedUUID {
11
+ oldUUID: string;
12
+ newUUID: string;
13
+ }
14
+ // Used for the app to know what payload needs to be sent
15
+ export interface IClientSyncObject {
16
+ last_sync_timestamp: string;
17
+ created: ILogbookEntry[];
18
+ edited: IEditedUUID[];
19
+ deleted: string[];
20
+ }
21
+ // Response object from the server after sync
22
+ export interface IBackendSyncObject {
23
+ last_sync_timestamp: string;
24
+ created: ILogbookEntry[];
25
+ deleted: string[];
26
+ }
27
+
28
+ /**
29
+ * Legacy logbook entry type used for supporting older app versions.
30
+ * TODO: Remove carbohydrates_modified_suggested_grams when 3.5.0 is minimum supported version.
31
+ * TODO: Remove mood when 3.5.0 is minimum supported version.
32
+ */
33
+ export type LegacyLogbookEntry = ILogbookEntry & {
34
+ carbohydrates_modified_suggested_grams?: number | null;
35
+ mood?: MoodEnum | null;
36
+ smart_pen_sync_timestamp?: string;
37
+ };
38
+
39
+ export interface ILogbookEntry {
40
+ /** Unique id for each logbook*/
41
+ uuid: string;
42
+ /**
43
+ * The timestamp at which this logbook entry should be displayed in to the user.
44
+ * This may differ from client_timestamp if the user created the logbook entry manually after the fact
45
+ * or they edited the entry timestamp of the logbook entry after it was first created.
46
+ */
47
+ entry_timestamp: Date; // The date where the entry appears when the user look at their logbook in the app
48
+ /**
49
+ * The timestamp at which this logbook entry was saved in the server's database.
50
+ * This can be expected to be the time of the first syncrhonization after the logbook entry was created on the client.
51
+ */
52
+ server_timestamp: Date | null;
53
+ /**
54
+ * The timestamp at which the logbook entry was created on the client.
55
+ * This may differ from entry_timestamp if the user created the logbook entry manually after the fact
56
+ * or they edited the entry timestamp of the logbook entry after it was first created.
57
+ */
58
+ client_timestamp: Date;
59
+ /**
60
+ * When the user makes changes to an existing logbook entry, the changes will be saved as a completely new logbook entry.
61
+ * For the old entry, this field will then be updated with the uuid of the new version of the logbook entry.
62
+ * The value is null by default (that is if the entry hasn't been replaced with a newer version).
63
+ * Logbook entries that don't contain null in this field are considered outdated and should generally be excluded when computing statistics and the like.
64
+ */
65
+ overwritten_by_id: string | null;
66
+ /**
67
+ * The uuid of the settings object that was used on the client when the logbook entry was created.
68
+ * Note that if the user updates their settings later this field will not be updated.
69
+ * This allows us to know exactly which settings were used to make an old insulin calculation
70
+ */
71
+ settings_uuid: string;
72
+ /** The version of the app that was used to create the logbook entry. e.g. "2.7.3" */
73
+ client_version: string;
74
+ /** For keeping track of which version of the server that was used when the logbook entry was synchronized and saved to the database. */
75
+ server_version: number | null;
76
+ /**
77
+ * For keeping track of which os and os version the app was running on when the logbook entry was created.
78
+ * For android this is the API level, e.g. "android 28" or "android 24".
79
+ * For iOS this is the version of the os, e.g. "ios 13.3.1" or "ios 13.5.1"
80
+ */
81
+ device_and_os: string;
82
+ /**
83
+ * The exact result of the insulin recommendation calculation without rounding.
84
+ * Should be 0 if the user made a calculation and didn't get a recommendation
85
+ * (because it was recommended that they should eat additional carbohydrates instead).
86
+ */
87
+ insulin_suggested_units: number | null;
88
+ /**
89
+ * The value in the insulin field when the logbook entry was saved.
90
+ * By default the value in the insulin field is the suggested amount of insulin that has been rounded based on the user's injection method,
91
+ * so most often that is the value that will be saved in this field.
92
+ * If the user has changed the value of the field, then that is of course the value that will be saved here.
93
+ */
94
+ insulin_entered_units: number | null;
95
+ /**
96
+ * The amount of carbohydrates used as input for a calculation (the user entered this carbohydrate amount in the calculation flow).
97
+ */
98
+ carbohydrates_input_grams: number | null;
99
+ /**
100
+ * The amount of extra carbohydrates that was recommended to the user if they made a calculation.
101
+ * If they were recommended to take insulin instead this should be 0.
102
+ * Should be <null> if they did not get a recommendation at all (e.g. because they made a manual entry instead)
103
+ */
104
+ carbohydrates_suggested_grams: number | null;
105
+ /**
106
+ * @obsolete The total amount (sum) of carbohydrates that the user ingested for this logbook entry including from the food database,
107
+ * manual entry of carbohydrates, and additional carbohydrates that they are eating.
108
+ */
109
+ carbohydrates_entered_grams: number | null;
110
+ /**
111
+ * The amount of carbohydrates that was entered in the “additional carbohydrates” field on the recommendation screen if the user got a carbohydrate recommendation.
112
+ * The field defaults to null if the user did not modify it.
113
+ */
114
+ carbohydrates_overwritten_suggested_grams: number | null;
115
+ /**
116
+ * The user's blood glucose level in mmol/L (millimolar) for the logbook entry.
117
+ * Should be <null> if the user didn't actually enter their BGL for the logbook entry.
118
+ */
119
+ blood_glucose_millimolar: number | null;
120
+ /**
121
+ * The user's blood ketones level in mmol/L (millimolar) for the logbook entry.
122
+ * Should be <null> if the user didn't actually enter their BGL for the logbook entry.
123
+ */
124
+ blood_ketones_millimolar: number | null;
125
+ /**
126
+ * The uuid of the event (physical activity) that was associated with the logbook entry.
127
+ * Should be <null> if no event is associated with the logbook entry.
128
+ */
129
+ event_uuid: string | null;
130
+ /**
131
+ * We never actually delete logbook entries, but this field indicates if a logbook entry should be considered removed by the user.
132
+ * The value is <null> by default.
133
+ * If an entry is removed then this field is updated with the timestamp when it was removed.
134
+ */
135
+ is_deleted: Date | null;
136
+ /**
137
+ * Indicates the timezone of the client device at the time when the logbook entry was created as an offset from UTC.
138
+ * Example values: "+01:00", "-05:00", "+05:30", "+08:00".
139
+ * Can be used in combination with entry_timestamp and client_timestamp (which are both in UTC)
140
+ * to determine what time those timestamps represented in the users local time.
141
+ */
142
+ utc_timezone_offset: string | null;
143
+ /**
144
+ * The timezone identifier of the client device at the time when the logbook entry was created.
145
+ */
146
+ timezone: string;
147
+ /**
148
+ * The reduction in insulin recommendation due to physical activity.
149
+ * Should be <null> if the user didn't do a calculation for this logbook entry
150
+ * or if no activity was taken into account in the calculation.
151
+ * A value of 0.75 would indicate that the recommended insulin was reduced by 25%.
152
+ */
153
+ activity_reduction: number | null;
154
+ /**
155
+ * The amount of active insulin (IOB) at the time when the logbook entry was created.
156
+ * Should be <null> if the user didn't make a calculation for this logbook entry.
157
+ */
158
+ active_insulin: number | null;
159
+ /**
160
+ * The unique identifiers (UUIDs) of the recent boluses that were used to calculate the active insulin.
161
+ */
162
+ active_insulin_source_logbook_ids: string[];
163
+ /**
164
+ * Indicates the id of the external blood glucose sample that was used for this logbook entry
165
+ */
166
+ blood_glucose_millimolar_sample_id: string | null;
167
+ /**
168
+ * Indicates whether this logbook entry was created using the bolus calculation feature (true) or was a manual entry (false).
169
+ */
170
+ is_bolus_calculation: boolean;
171
+ /**
172
+ * Indicates the id of the source glucose sample has come from.
173
+ */
174
+ glucose_sample_source_id: string | null;
175
+ /**
176
+ * The id of the note that is associated with this logbook entry.
177
+ */
178
+ note_id: string | null;
179
+ /**
180
+ * The id of the carbohydrates sample that is associated with this logbook entry.
181
+ */
182
+ carbohydrates_sample_id: string | null;
183
+ /**
184
+ * The amount of carbohydrates that the user manually entered either in calculation flow or while creating logbook.
185
+ */
186
+ carbohydrates_manual_grams: number | null;
187
+ /**
188
+ * The amount of carbohydrates that the user entered through food items (visual search or/and food library) in calculation flow.
189
+ */
190
+ carbohydrates_food_grams: number | null;
191
+ /**
192
+ * The id of the food intake that is associated with this logbook entry.
193
+ */
194
+ food_intake_id: string | null;
195
+ }
@@ -0,0 +1,9 @@
1
+ import type { Languages } from "../enums";
2
+
3
+ export interface IUserDetails {
4
+ id: string;
5
+ name?: string;
6
+ email: string;
7
+ country?: string;
8
+ language?: keyof typeof Languages;
9
+ }
@@ -0,0 +1,160 @@
1
+ import type { ActivitySettings, LegacyActivitySettings } from "../activity/activity";
2
+ import type { BloodGlucoseUnit, BloodKetonesUnit } from "../enums";
3
+
4
+ /**
5
+ * Legacy user settings notifications type that includes device identifiers
6
+ * TODO: Can be removed when 3.5.0 is the minimum supported version.
7
+ */
8
+ export type LegacyUserSettingsNotifications = Omit<IUserSettings, "notifications"> & {
9
+ medicineNotification: IMedicineNotification;
10
+ remeasurementNotification: IRemeasurementNotification;
11
+ deviceIdentifiers?: INotificationDeviceIdentifier[];
12
+ };
13
+
14
+ /**
15
+ * Legacy BGL targets type that uses LegacyBGLInterval
16
+ * TODO: Can be removed when 3.5.0 is the minimum supported version.
17
+ */
18
+ export type LegacyBGLTargets = Omit<IBGLTargets, "targetBGLIntervals" | "overallTargetBGL"> & {
19
+ targetBGLIntervals?: LegacyBGLInterval[];
20
+ overallTargetBGL?: LegacyBGLInterval;
21
+ use?: Usage;
22
+ };
23
+
24
+ /**
25
+ * Legacy BGL interval type that may contain low and high properties
26
+ * for backward compatibility with data saved before these fields were removed.
27
+ * TODO: Can be removed when 3.5.0 is the minimum supported version.
28
+ */
29
+ export type LegacyBGLInterval = IBGLInterval & {
30
+ low?: number;
31
+ high?: number;
32
+ };
33
+
34
+ /**
35
+ * User settings type that allows for legacy activity settings and legacy glucose targets
36
+ * TODO: Remove activity when 3.5.0 is minimum supported version.
37
+ * TODO: Remove glucoseLevelTargets when 3.5.0 is minimum supported version.
38
+ * TODO: Remove gender when 3.4.0 is minimum supported version.
39
+ * TODO: Remove insulinDependent when 3.5.0 is minimum supported version.
40
+ * TODO: Remove email when 3.5.0 is minimum supported version.
41
+ */
42
+ export type LegacyUserSettings = Omit<IUserSettings, "activity" | "glucoseLevelTargets" | "notifications"> & {
43
+ activity?: LegacyActivitySettings;
44
+ glucoseLevelTargets?: LegacyBGLTargets;
45
+ notifications?: LegacyUserSettingsNotifications;
46
+ gender?: BiologicalSex;
47
+ insulinDependent?: boolean;
48
+ email?: string;
49
+ };
50
+
51
+ export interface IUserSettings {
52
+ activity?: ActivitySettings;
53
+ biologicalSex?: BiologicalSex;
54
+ birthday?: string; //ISO
55
+ bloodGlucoseUnits?: BloodGlucoseUnit;
56
+ bloodKetonesUnit?: BloodKetonesUnit;
57
+ created?: string; //ISO
58
+ diabetesType?: DiabetesType;
59
+ fastActingInsulin?: FastActingInsulin;
60
+ glucoseLevelTargets?: IBGLTargets;
61
+ height?: number; //cm
62
+ longActingInsulin?: LongActingInsulin;
63
+ notifications?: IUSerSettingsNotifications;
64
+ parameters?: IParameters;
65
+ treatmentType?: InjectionMethod;
66
+ uuid?: string;
67
+ uuidOld?: string;
68
+ weight?: number; //kg
69
+ }
70
+
71
+ export interface IUSerSettingsNotifications {
72
+ medicineNotification: IMedicineNotification;
73
+ remeasurementNotification: IRemeasurementNotification;
74
+ }
75
+
76
+ export interface INotifications {
77
+ toggle: boolean;
78
+ }
79
+ export interface IMedicineNotification extends INotifications {
80
+ dailyReminderTime: string;
81
+ }
82
+ export interface IRemeasurementNotification extends INotifications {
83
+ remeasurement: number;
84
+ }
85
+ export interface IInterval {
86
+ startTime: string; // "00:00" format
87
+ }
88
+
89
+ export interface IParameters {
90
+ parameterIntervals: IParameterInterval[];
91
+ overallParameters: IParameterInterval;
92
+ use?: Usage;
93
+ updatedAt?: string; // ISO string
94
+ }
95
+
96
+ export interface IParameterInterval extends IInterval {
97
+ insulinSensitivity: number;
98
+ carbohydrateRatio: number;
99
+ }
100
+
101
+ export interface IBGLTargets {
102
+ targetBGLIntervals?: IBGLInterval[];
103
+ overallTargetBGL?: IBGLInterval;
104
+ use?: Usage;
105
+ updatedAt?: string; // ISO string
106
+ }
107
+
108
+ export interface IBGLInterval extends IInterval {
109
+ target: number;
110
+ }
111
+
112
+ export interface INotificationDeviceIdentifier {
113
+ token: string;
114
+ timestamp: number;
115
+ }
116
+
117
+ export enum Usage {
118
+ Overall = "overall",
119
+ Intervals = "intervals",
120
+ }
121
+
122
+ export enum FastActingInsulin {
123
+ Novorapid = "Novorapid",
124
+ Fiasp = "Fiasp",
125
+ Humalog = "Humalog",
126
+ Apidra = "Apidra",
127
+ Other = "Other",
128
+ None = "None",
129
+ }
130
+
131
+ export enum LongActingInsulin {
132
+ Lantus = "Lantus",
133
+ Basaglar = "Basaglar",
134
+ Tuojeo = "Tuojeo",
135
+ Levemir = "Levemir",
136
+ Tresiba = "Tresiba",
137
+ Other = "Other",
138
+ None = "None",
139
+ }
140
+
141
+ export enum DiabetesType {
142
+ Type1 = 1,
143
+ Type2 = 2,
144
+ }
145
+
146
+ export enum BiologicalSex {
147
+ Male = "Male",
148
+ Female = "Female",
149
+ Unspecified = "Unspecified",
150
+ }
151
+
152
+ /**
153
+ * String enum for differentiating between different methods by which someone can inject insulin into the body.
154
+ * Mainly used to determine how insulin amounts should be rounded.
155
+ */
156
+ export enum InjectionMethod {
157
+ PenHalf = "Pen-half",
158
+ PenWhole = "Pen-whole",
159
+ Pump = "Pump",
160
+ }