@hedia/types 1.1.0 → 1.1.2

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 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../types/enums.ts"],"names":[],"mappings":";;AAAA,IAAY,UA4XX;AA5XD,WAAY,UAAU;IACrB;;;;;;;;;OASG;IACH,qDAAc,CAAA;IAEd;;OAEG;IACH,2EAAyB,CAAA;IAEzB;;;;;OAKG;IACH,yDAAgB,CAAA;IAEhB;;;;;OAKG;IACH,yCAAQ,CAAA;IAER;;OAEG;IACH,mDAAa,CAAA;IAEb;;;OAGG;IACH,qDAAc,CAAA;IAEd;;;;OAIG;IACH,+FAAmC,CAAA;IAEnC;;OAEG;IACH,yDAAgB,CAAA;IAEhB;;;OAGG;IACH,+DAAmB,CAAA;IAEnB;;;;OAIG;IACH,mEAAqB,CAAA;IAErB;;;OAGG;IACH,6DAAkB,CAAA;IAElB;;;OAGG;IACH,qEAAsB,CAAA;IAEtB;;;;OAIG;IACH,mDAAa,CAAA;IAEb;;;;;OAKG;IACH,qEAAsB,CAAA;IAEtB;;OAEG;IACH,uEAAuB,CAAA;IAEvB;;;;;;;OAOG;IACH,+CAAW,CAAA;IAEX;;;;;OAKG;IACH,uDAAe,CAAA;IAEf;;;;;OAKG;IACH,6DAAkB,CAAA;IAElB;;;;;OAKG;IACH,uDAAe,CAAA;IAEf;;OAEG;IACH,6DAAkB,CAAA;IAElB;;;;;;;OAOG;IACH,yEAAwB,CAAA;IAExB;;;;OAIG;IACH,yEAAwB,CAAA;IAExB;;;OAGG;IACH,2DAAiB,CAAA;IAEjB;;;;;OAKG;IACH,6DAAkB,CAAA;IAElB;;;;OAIG;IACH,qEAAsB,CAAA;IAEtB;;;OAGG;IACH,uDAAe,CAAA;IAEf;;;OAGG;IACH,uDAAe,CAAA;IAEf;;;;OAIG;IACH,yEAAwB,CAAA;IAExB;;;OAGG;IACH,iEAAoB,C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A;IAEZ;;OAEG;IACH,uEAAuB,CAAA;IAEvB;;OAEG;IACH,qEAAsB,CAAA;IAEtB;;;;;OAKG;IACH,+EAA2B,CAAA;IAE3B;;OAEG;IACH,uEAAuB,CAAA;IAEvB;;;OAGG;IACH,mGAAqC,CAAA;IAErC;;;OAGG;IACH,+FAAmC,CAAA;IAEnC;;;OAGG;IACH,+EAA2B,CAAA;IAE3B;;;OAGG;IACH,mEAAqB,CAAA;IAErB;;OAEG;IACH,2DAAiB,CAAA;IAEjB;;;OAGG;IACH,2EAAyB,CAAA;IAEzB;;OAEG;IACH,mEAAqB,CAAA;IAErB;;OAEG;IACH,yFAAgC,CAAA;IAEhC;;OAEG;IACH,mFAA6B,CAAA;IAE7B;;OAEG;IACH,6EAA0B,CAAA;IAE1B;;OAEG;IACH,6DAAkB,CAAA;IAElB;;;;OAIG;IACH,mGAAqC,CAAA;IAErC;;OAEG;IACH,+DAAmB,CAAA;AACpB,CAAC,EAjYW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAiYrB;AAED,IAAY,iBAoDX;AApDD,WAAY,iBAAiB;IAC5B;;;OAGG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,sCAAiB,CAAA;IAEjB;;;OAGG;IACH,gCAAW,CAAA;IAEX;;;OAGG;IACH,kCAAa,CAAA;IAEb;;;OAGG;IACH,wCAAmB,CAAA;IAEnB;;OAEG;IACH,oCAAe,CAAA;IAEf;;;OAGG;IACH,kCAAa,CAAA;IAEb;;;OAGG;IACH,gCAAW,CAAA;IAEX;;;OAGG;IACH,oCAAe,CAAA;AAChB,CAAC,EApDW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAoD5B"}
@@ -1,8 +1,8 @@
1
- export declare enum BloodGlucoseUnit {
2
- MMOL_L = "mmol/l",
3
- MG_DL = "mg/dl"
4
- }
5
- export declare enum BloodKetonesUnit {
6
- MMOL_L = "mmol/l",
7
- MG_DL = "mg/dl"
8
- }
1
+ export declare enum BloodGlucoseUnit {
2
+ MMOL_L = "mmol/l",
3
+ MG_DL = "mg/dl"
4
+ }
5
+ export declare enum BloodKetonesUnit {
6
+ MMOL_L = "mmol/l",
7
+ MG_DL = "mg/dl"
8
+ }
@@ -1,18 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var Units;
4
- (function (Units) {
5
- Units["MMOL_L"] = "mmol/l";
6
- Units["MG_DL"] = "mg/dl";
7
- })(Units || (Units = {}));
8
- var BloodGlucoseUnit;
9
- (function (BloodGlucoseUnit) {
10
- BloodGlucoseUnit["MMOL_L"] = "mmol/l";
11
- BloodGlucoseUnit["MG_DL"] = "mg/dl";
12
- })(BloodGlucoseUnit = exports.BloodGlucoseUnit || (exports.BloodGlucoseUnit = {}));
13
- var BloodKetonesUnit;
14
- (function (BloodKetonesUnit) {
15
- BloodKetonesUnit["MMOL_L"] = "mmol/l";
16
- BloodKetonesUnit["MG_DL"] = "mg/dl";
17
- })(BloodKetonesUnit = exports.BloodKetonesUnit || (exports.BloodKetonesUnit = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BloodKetonesUnit = exports.BloodGlucoseUnit = void 0;
4
+ var Units;
5
+ (function (Units) {
6
+ Units["MMOL_L"] = "mmol/l";
7
+ Units["MG_DL"] = "mg/dl";
8
+ })(Units || (Units = {}));
9
+ var BloodGlucoseUnit;
10
+ (function (BloodGlucoseUnit) {
11
+ BloodGlucoseUnit["MMOL_L"] = "mmol/l";
12
+ BloodGlucoseUnit["MG_DL"] = "mg/dl";
13
+ })(BloodGlucoseUnit = exports.BloodGlucoseUnit || (exports.BloodGlucoseUnit = {}));
14
+ var BloodKetonesUnit;
15
+ (function (BloodKetonesUnit) {
16
+ BloodKetonesUnit["MMOL_L"] = "mmol/l";
17
+ BloodKetonesUnit["MG_DL"] = "mg/dl";
18
+ })(BloodKetonesUnit = exports.BloodKetonesUnit || (exports.BloodKetonesUnit = {}));
18
19
  //# sourceMappingURL=measurements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../types/measurements.ts"],"names":[],"mappings":";;AAAA,IAAK,KAGJ;AAHD,WAAK,KAAK;IACN,0BAAiB,CAAA;IACjB,wBAAe,CAAA;AACnB,CAAC,EAHI,KAAK,KAAL,KAAK,QAGT;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B"}
1
+ {"version":3,"file":"measurements.js","sourceRoot":"","sources":["../../types/measurements.ts"],"names":[],"mappings":";;;AAAA,IAAK,KAGJ;AAHD,WAAK,KAAK;IACN,0BAAiB,CAAA;IACjB,wBAAe,CAAA;AACnB,CAAC,EAHI,KAAK,KAAL,KAAK,QAGT;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AACD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B"}
@@ -0,0 +1,79 @@
1
+ import { DiabetesType, InjectionMethod, Gender, Usage, ActivityReduction, ActivityReductionIntervals, Languages } from "./enums";
2
+ import { BloodGlucoseUnit, BloodKetonesUnit } from "./measurements";
3
+ export interface IUserSettings {
4
+ [key: string]: unknown;
5
+ diabetesType?: DiabetesType;
6
+ insulinDependent?: boolean;
7
+ gender?: Gender;
8
+ height?: number;
9
+ email?: string;
10
+ weight?: number;
11
+ birthday?: string;
12
+ treatmentType?: InjectionMethod;
13
+ bloodGlucoseUnits?: BloodGlucoseUnit;
14
+ bloodKetonesUnit?: BloodKetonesUnit;
15
+ parameters?: IParameters;
16
+ glucoseLevelTargets?: IBGLTargets;
17
+ fastActingInsulin?: string | null;
18
+ longActingInsulin?: string | null;
19
+ uuidOld?: string;
20
+ uuid?: string;
21
+ created?: string;
22
+ activity?: ActivitySettings;
23
+ notifications?: IUSerSettingsNotifications;
24
+ }
25
+ export declare type ActivitySettings = ActivityReductionSettings & {
26
+ target: number;
27
+ };
28
+ declare type ActivityReductionKey = keyof typeof ActivityReduction;
29
+ declare type ActivityReductionIntervalsKey = keyof typeof ActivityReductionIntervals;
30
+ export declare type ActivityReductionSettings = {
31
+ [key in ActivityReductionKey]: ActivityReductionIntervalSettings<key, "hard", "fromFortysix">;
32
+ };
33
+ export declare type ActivityReductionIntervalSettings<K extends ActivityReductionKey, T extends ActivityReductionKey, U extends ActivityReductionIntervalsKey> = {
34
+ [key in ActivityReductionIntervalsKey]: K extends T ? (key extends U ? null | number : number) : number;
35
+ };
36
+ export interface IUSerSettingsNotifications {
37
+ medicineNotification: IMedicineNotification;
38
+ remeasurementNotification: IRemeasurementNotification;
39
+ }
40
+ export interface INotifications {
41
+ toggle: boolean;
42
+ }
43
+ export interface IMedicineNotification extends INotifications {
44
+ dailyReminderTime: string;
45
+ }
46
+ export interface IRemeasurementNotification extends INotifications {
47
+ remeasurement: number;
48
+ }
49
+ export interface IUserDetails {
50
+ name?: string;
51
+ email?: string;
52
+ research_consent?: Date | boolean;
53
+ newsletter_consent?: Date | boolean;
54
+ country?: string;
55
+ language?: keyof typeof Languages;
56
+ }
57
+ export interface IInterval {
58
+ startTime?: string;
59
+ }
60
+ export interface IParameters {
61
+ parameterIntervals: Array<IParameterInterval>;
62
+ overallParameters: IParameterInterval;
63
+ use?: Usage;
64
+ }
65
+ export interface IParameterInterval extends IInterval {
66
+ insulinSensitivity?: number;
67
+ carbohydrateRatio?: number;
68
+ }
69
+ export interface IBGLTargets {
70
+ targetBGLIntervals?: Array<IBGLInterval>;
71
+ overallTargetBGL?: IBGLInterval;
72
+ use?: Usage;
73
+ }
74
+ export interface IBGLInterval extends IInterval {
75
+ low: number;
76
+ target: number;
77
+ high: number;
78
+ }
79
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../types/types.ts"],"names":[],"mappings":""}
package/index.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { BloodGlucoseUnit, BloodKetonesUnit } from "./types/measurements";
2
- export { StatusCode } from "./types/enums";
1
+ export * from "./types/measurements";
2
+ export * from "./types/enums";
3
+ export * from "./types/types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -8,8 +8,7 @@
8
8
  "url": "git+ssh://git@github.com:hedia-team/hedia-types.git"
9
9
  },
10
10
  "scripts": {
11
- "tsc": "tsc",
12
- "publish": "tsc && npm version minor --force && npm publish"
11
+ "publish-patch": "npm version patch && npx tsc && npm publish"
13
12
  },
14
13
  "keywords": [],
15
14
  "author": "Hedia",
package/types/enums.ts CHANGED
@@ -1,3 +1,93 @@
1
+ export enum Languages {
2
+ da = `Dansk`,
3
+ en = `English`,
4
+ }
5
+
6
+ export enum Usage {
7
+ Overall = `overall`,
8
+ Intervals = `intervals`,
9
+ }
10
+
11
+ export enum FastActingInsulin {
12
+ Novorapid = `Novorapid`,
13
+ Fiasp = `Fiasp`,
14
+ Humalog = `Humalog`,
15
+ Apidra = `Apidra`,
16
+ Other = `Other`,
17
+ None = `None`,
18
+ }
19
+
20
+ export enum ActivityReductionIntervals {
21
+ fromZero = `fromZero`,
22
+ fromThirty = `fromThirty`,
23
+ fromFortysix = `fromFortysix`,
24
+ }
25
+
26
+ export enum ActivityReduction {
27
+ light = `light`,
28
+ moderate = `moderate`,
29
+ hard = `hard`,
30
+ post = `post`,
31
+ }
32
+
33
+ export enum Milliseconds {
34
+ Second = 1000,
35
+ Minute = 60000,
36
+ Hour = 3600000,
37
+ Day = 86400000,
38
+ }
39
+
40
+ export enum LongActingInsulin {
41
+ Lantus = `Lantus`,
42
+ Basaglar = `Basaglar`,
43
+ Tuojeo = `Tuojeo`,
44
+ Levemir = `Levemir`,
45
+ Tresiba = `Tresiba`,
46
+ Other = `Other`,
47
+ None = `None`,
48
+ }
49
+
50
+ export enum DiabetesType {
51
+ Type1 = 1,
52
+ Type2 = 2,
53
+ }
54
+
55
+ export enum Gender {
56
+ Male = `Male`,
57
+ Female = `Female`,
58
+ }
59
+
60
+ export enum InjectionMethod {
61
+ PenHalf = `Pen-half`,
62
+ PenWhole = `Pen-whole`,
63
+ Pump = `Pump`,
64
+ }
65
+
66
+ export enum MoodEnum {
67
+ Sad = 1,
68
+ SemiSad = 2,
69
+ Neutral = 3,
70
+ SemiHappy = 4,
71
+ Happy = 5,
72
+ }
73
+
74
+ export enum KetoneLevels {
75
+ Negative,
76
+ Normal,
77
+ SlightlyIncreased,
78
+ Moderate,
79
+ High,
80
+ }
81
+
82
+ export enum KetoneColours {
83
+ None = `rgb(15,18,49)`,
84
+ Negative = `rgb(222,194,145)`,
85
+ Normal = `rgb(223,179,143)`,
86
+ SlightlyIncreased = `rgb(219, 152, 141)`,
87
+ Moderate = `rgb(169, 102, 96)`,
88
+ High = `rgb(119,55,81)`,
89
+ }
90
+
1
91
  export enum StatusCode {
2
92
  /**
3
93
  * The server has received the request headers and the client should proceed to send the request body
@@ -378,4 +468,63 @@ export enum StatusCode {
378
468
  * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
379
469
  */
380
470
  NETWORK_AUTHENTICATION_REQUIRED = 511,
471
+
472
+ /**
473
+ * Client token expired, new token available from server.
474
+ */
475
+ TOKEN_EXPIRED = 666,
476
+ }
477
+
478
+ export enum HTTPRequestMethod {
479
+ /**
480
+ * The `CONNECT` method establishes a tunnel to the server identified by the
481
+ * target resource.
482
+ */
483
+ CONNECT = `CONNECT`,
484
+
485
+ /**
486
+ * The `DELETE` method deletes the specified resource.
487
+ */
488
+ DELETE = `DELETE`,
489
+
490
+ /**
491
+ * The `GET` method requests a representation of the specified resource.
492
+ * Requests using GET should only retrieve data.
493
+ */
494
+ GET = `GET`,
495
+
496
+ /**
497
+ * The `HEAD` method asks for a response identical to that of a GET request,
498
+ * but without the response body.
499
+ */
500
+ HEAD = `HEAD`,
501
+
502
+ /**
503
+ * The `OPTIONS` method is used to describe the communication options for the
504
+ * target resource.
505
+ */
506
+ OPTIONS = `OPTIONS`,
507
+
508
+ /**
509
+ * The PATCH method is used to apply partial modifications to a resource.
510
+ */
511
+ PATCH = `PATCH`,
512
+
513
+ /**
514
+ * The `POST` method is used to submit an entity to the specified resource,
515
+ * often causing a change in state or side effects on the server.
516
+ */
517
+ POST = `POST`,
518
+
519
+ /**
520
+ * The `PUT` method replaces all current representations of the target
521
+ * resource with the request payload.
522
+ */
523
+ PUT = `PUT`,
524
+
525
+ /**
526
+ * The `TRACE` method performs a message loop-back test along the path to the
527
+ * target resource.
528
+ */
529
+ TRACE = `TRACE`,
381
530
  }
package/types/types.ts ADDED
@@ -0,0 +1,103 @@
1
+ import {
2
+ DiabetesType,
3
+ InjectionMethod,
4
+ Gender,
5
+ Usage,
6
+ ActivityReduction,
7
+ ActivityReductionIntervals,
8
+ Languages,
9
+ } from "./enums";
10
+ import { BloodGlucoseUnit, BloodKetonesUnit } from "./measurements";
11
+
12
+ export interface IUserSettings {
13
+ [key: string]: unknown; //required to read keys as string
14
+ diabetesType?: DiabetesType; //Diabetes 2, with or without insulin treatment ?
15
+ insulinDependent?: boolean; //Only set if diabetesType=2; true = insulin treatment and false = dont need insulin calculator
16
+ gender?: Gender;
17
+ height?: number; //cm
18
+ email?: string;
19
+ weight?: number; //kg
20
+ birthday?: string; //ISO
21
+ treatmentType?: InjectionMethod;
22
+ bloodGlucoseUnits?: BloodGlucoseUnit;
23
+ bloodKetonesUnit?: BloodKetonesUnit;
24
+ parameters?: IParameters;
25
+ glucoseLevelTargets?: IBGLTargets;
26
+ fastActingInsulin?: string | null;
27
+ longActingInsulin?: string | null;
28
+ uuidOld?: string;
29
+ uuid?: string;
30
+ created?: string; //ISO
31
+ activity?: ActivitySettings;
32
+ notifications?: IUSerSettingsNotifications;
33
+ }
34
+
35
+ export type ActivitySettings = ActivityReductionSettings & { target: number };
36
+
37
+ type ActivityReductionKey = keyof typeof ActivityReduction;
38
+ type ActivityReductionIntervalsKey = keyof typeof ActivityReductionIntervals;
39
+
40
+ export type ActivityReductionSettings = {
41
+ // support for nulling multiple keys, with "hard" | "light" and variants with "fromFortysix" | "fromThirty"
42
+ [key in ActivityReductionKey]: ActivityReductionIntervalSettings<key, "hard", "fromFortysix">;
43
+ };
44
+ export type ActivityReductionIntervalSettings<
45
+ K extends ActivityReductionKey,
46
+ T extends ActivityReductionKey,
47
+ U extends ActivityReductionIntervalsKey
48
+ > = {
49
+ [key in ActivityReductionIntervalsKey]: K extends T ? (key extends U ? null | number : number) : number;
50
+ };
51
+
52
+ export interface IUSerSettingsNotifications {
53
+ medicineNotification: IMedicineNotification;
54
+ remeasurementNotification: IRemeasurementNotification;
55
+ }
56
+ export interface INotifications {
57
+ toggle: boolean;
58
+ }
59
+ export interface IMedicineNotification extends INotifications {
60
+ dailyReminderTime: string;
61
+ }
62
+ export interface IRemeasurementNotification extends INotifications {
63
+ remeasurement: number;
64
+ }
65
+
66
+ export interface IUserDetails {
67
+ name?: string;
68
+ email?: string;
69
+ research_consent?: Date | boolean;
70
+ newsletter_consent?: Date | boolean;
71
+ country?: string;
72
+ language?: keyof typeof Languages;
73
+ }
74
+
75
+ export interface IInterval {
76
+ startTime?: string; //"00:00" format
77
+ }
78
+
79
+ // TODO: Delete when we have all people changed from old managers to new.???
80
+ export interface IParameters {
81
+ parameterIntervals: Array<IParameterInterval>;
82
+ overallParameters: IParameterInterval;
83
+ use?: Usage;
84
+ }
85
+
86
+ export interface IParameterInterval extends IInterval {
87
+ insulinSensitivity?: number;
88
+ carbohydrateRatio?: number;
89
+ }
90
+
91
+ // TODO: Delete when we have all people changed from old managers to new.???
92
+ export interface IBGLTargets {
93
+ targetBGLIntervals?: Array<IBGLInterval>;
94
+ overallTargetBGL?: IBGLInterval;
95
+ use?: Usage;
96
+ }
97
+
98
+ // TODO: Delete when we have all people changed from old managers to new.???
99
+ export interface IBGLInterval extends IInterval {
100
+ low: number;
101
+ target: number;
102
+ high: number;
103
+ }