@hedia/types 1.1.0 → 1.1.1

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/index.d.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/dist/index.js CHANGED
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var measurements_1 = require("./types/measurements");
4
- exports.BloodGlucoseUnit = measurements_1.BloodGlucoseUnit;
5
- exports.BloodKetonesUnit = measurements_1.BloodKetonesUnit;
6
- var enums_1 = require("./types/enums");
7
- exports.StatusCode = enums_1.StatusCode;
13
+ __exportStar(require("./types/measurements"), exports);
14
+ __exportStar(require("./types/enums"), exports);
15
+ __exportStar(require("./types/types"), exports);
8
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;AAAA,qDAA0E;AAAjE,0CAAA,gBAAgB,CAAA;AAAE,0CAAA,gBAAgB,CAAA;AAC3C,uCAA2C;AAAlC,6BAAA,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC;AACrC,gDAA8B;AAC9B,gDAA8B"}
@@ -1,3 +1,80 @@
1
+ export declare enum Languages {
2
+ da = "Dansk",
3
+ en = "English"
4
+ }
5
+ export declare enum Usage {
6
+ Overall = "overall",
7
+ Intervals = "intervals"
8
+ }
9
+ export declare enum FastActingInsulin {
10
+ Novorapid = "Novorapid",
11
+ Fiasp = "Fiasp",
12
+ Humalog = "Humalog",
13
+ Apidra = "Apidra",
14
+ Other = "Other",
15
+ None = "None"
16
+ }
17
+ export declare enum ActivityReductionIntervals {
18
+ fromZero = "fromZero",
19
+ fromThirty = "fromThirty",
20
+ fromFortysix = "fromFortysix"
21
+ }
22
+ export declare enum ActivityReduction {
23
+ light = "light",
24
+ moderate = "moderate",
25
+ hard = "hard",
26
+ post = "post"
27
+ }
28
+ export declare enum Milliseconds {
29
+ Second = 1000,
30
+ Minute = 60000,
31
+ Hour = 3600000,
32
+ Day = 86400000
33
+ }
34
+ export declare enum LongActingInsulin {
35
+ Lantus = "Lantus",
36
+ Basaglar = "Basaglar",
37
+ Tuojeo = "Tuojeo",
38
+ Levemir = "Levemir",
39
+ Tresiba = "Tresiba",
40
+ Other = "Other",
41
+ None = "None"
42
+ }
43
+ export declare enum DiabetesType {
44
+ Type1 = 1,
45
+ Type2 = 2
46
+ }
47
+ export declare enum Gender {
48
+ Male = "Male",
49
+ Female = "Female"
50
+ }
51
+ export declare enum InjectionMethod {
52
+ PenHalf = "Pen-half",
53
+ PenWhole = "Pen-whole",
54
+ Pump = "Pump"
55
+ }
56
+ export declare enum MoodEnum {
57
+ Sad = 1,
58
+ SemiSad = 2,
59
+ Neutral = 3,
60
+ SemiHappy = 4,
61
+ Happy = 5
62
+ }
63
+ export declare enum KetoneLevels {
64
+ Negative = 0,
65
+ Normal = 1,
66
+ SlightlyIncreased = 2,
67
+ Moderate = 3,
68
+ High = 4
69
+ }
70
+ export declare enum KetoneColours {
71
+ None = "rgb(15,18,49)",
72
+ Negative = "rgb(222,194,145)",
73
+ Normal = "rgb(223,179,143)",
74
+ SlightlyIncreased = "rgb(219, 152, 141)",
75
+ Moderate = "rgb(169, 102, 96)",
76
+ High = "rgb(119,55,81)"
77
+ }
1
78
  export declare enum StatusCode {
2
79
  /**
3
80
  * The server has received the request headers and the client should proceed to send the request body
@@ -320,5 +397,54 @@ export declare enum StatusCode {
320
397
  * Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
321
398
  * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
322
399
  */
323
- NETWORK_AUTHENTICATION_REQUIRED = 511
400
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
401
+ /**
402
+ * Client token expired, new token available from server.
403
+ */
404
+ TOKEN_EXPIRED = 666
405
+ }
406
+ export declare enum HTTPRequestMethod {
407
+ /**
408
+ * The `CONNECT` method establishes a tunnel to the server identified by the
409
+ * target resource.
410
+ */
411
+ CONNECT = "CONNECT",
412
+ /**
413
+ * The `DELETE` method deletes the specified resource.
414
+ */
415
+ DELETE = "DELETE",
416
+ /**
417
+ * The `GET` method requests a representation of the specified resource.
418
+ * Requests using GET should only retrieve data.
419
+ */
420
+ GET = "GET",
421
+ /**
422
+ * The `HEAD` method asks for a response identical to that of a GET request,
423
+ * but without the response body.
424
+ */
425
+ HEAD = "HEAD",
426
+ /**
427
+ * The `OPTIONS` method is used to describe the communication options for the
428
+ * target resource.
429
+ */
430
+ OPTIONS = "OPTIONS",
431
+ /**
432
+ * The PATCH method is used to apply partial modifications to a resource.
433
+ */
434
+ PATCH = "PATCH",
435
+ /**
436
+ * The `POST` method is used to submit an entity to the specified resource,
437
+ * often causing a change in state or side effects on the server.
438
+ */
439
+ POST = "POST",
440
+ /**
441
+ * The `PUT` method replaces all current representations of the target
442
+ * resource with the request payload.
443
+ */
444
+ PUT = "PUT",
445
+ /**
446
+ * The `TRACE` method performs a message loop-back test along the path to the
447
+ * target resource.
448
+ */
449
+ TRACE = "TRACE"
324
450
  }
@@ -1,5 +1,96 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HTTPRequestMethod = exports.StatusCode = exports.KetoneColours = exports.KetoneLevels = exports.MoodEnum = exports.InjectionMethod = exports.Gender = exports.DiabetesType = exports.LongActingInsulin = exports.Milliseconds = exports.ActivityReduction = exports.ActivityReductionIntervals = exports.FastActingInsulin = exports.Usage = exports.Languages = void 0;
4
+ var Languages;
5
+ (function (Languages) {
6
+ Languages["da"] = "Dansk";
7
+ Languages["en"] = "English";
8
+ })(Languages = exports.Languages || (exports.Languages = {}));
9
+ var Usage;
10
+ (function (Usage) {
11
+ Usage["Overall"] = "overall";
12
+ Usage["Intervals"] = "intervals";
13
+ })(Usage = exports.Usage || (exports.Usage = {}));
14
+ var FastActingInsulin;
15
+ (function (FastActingInsulin) {
16
+ FastActingInsulin["Novorapid"] = "Novorapid";
17
+ FastActingInsulin["Fiasp"] = "Fiasp";
18
+ FastActingInsulin["Humalog"] = "Humalog";
19
+ FastActingInsulin["Apidra"] = "Apidra";
20
+ FastActingInsulin["Other"] = "Other";
21
+ FastActingInsulin["None"] = "None";
22
+ })(FastActingInsulin = exports.FastActingInsulin || (exports.FastActingInsulin = {}));
23
+ var ActivityReductionIntervals;
24
+ (function (ActivityReductionIntervals) {
25
+ ActivityReductionIntervals["fromZero"] = "fromZero";
26
+ ActivityReductionIntervals["fromThirty"] = "fromThirty";
27
+ ActivityReductionIntervals["fromFortysix"] = "fromFortysix";
28
+ })(ActivityReductionIntervals = exports.ActivityReductionIntervals || (exports.ActivityReductionIntervals = {}));
29
+ var ActivityReduction;
30
+ (function (ActivityReduction) {
31
+ ActivityReduction["light"] = "light";
32
+ ActivityReduction["moderate"] = "moderate";
33
+ ActivityReduction["hard"] = "hard";
34
+ ActivityReduction["post"] = "post";
35
+ })(ActivityReduction = exports.ActivityReduction || (exports.ActivityReduction = {}));
36
+ var Milliseconds;
37
+ (function (Milliseconds) {
38
+ Milliseconds[Milliseconds["Second"] = 1000] = "Second";
39
+ Milliseconds[Milliseconds["Minute"] = 60000] = "Minute";
40
+ Milliseconds[Milliseconds["Hour"] = 3600000] = "Hour";
41
+ Milliseconds[Milliseconds["Day"] = 86400000] = "Day";
42
+ })(Milliseconds = exports.Milliseconds || (exports.Milliseconds = {}));
43
+ var LongActingInsulin;
44
+ (function (LongActingInsulin) {
45
+ LongActingInsulin["Lantus"] = "Lantus";
46
+ LongActingInsulin["Basaglar"] = "Basaglar";
47
+ LongActingInsulin["Tuojeo"] = "Tuojeo";
48
+ LongActingInsulin["Levemir"] = "Levemir";
49
+ LongActingInsulin["Tresiba"] = "Tresiba";
50
+ LongActingInsulin["Other"] = "Other";
51
+ LongActingInsulin["None"] = "None";
52
+ })(LongActingInsulin = exports.LongActingInsulin || (exports.LongActingInsulin = {}));
53
+ var DiabetesType;
54
+ (function (DiabetesType) {
55
+ DiabetesType[DiabetesType["Type1"] = 1] = "Type1";
56
+ DiabetesType[DiabetesType["Type2"] = 2] = "Type2";
57
+ })(DiabetesType = exports.DiabetesType || (exports.DiabetesType = {}));
58
+ var Gender;
59
+ (function (Gender) {
60
+ Gender["Male"] = "Male";
61
+ Gender["Female"] = "Female";
62
+ })(Gender = exports.Gender || (exports.Gender = {}));
63
+ var InjectionMethod;
64
+ (function (InjectionMethod) {
65
+ InjectionMethod["PenHalf"] = "Pen-half";
66
+ InjectionMethod["PenWhole"] = "Pen-whole";
67
+ InjectionMethod["Pump"] = "Pump";
68
+ })(InjectionMethod = exports.InjectionMethod || (exports.InjectionMethod = {}));
69
+ var MoodEnum;
70
+ (function (MoodEnum) {
71
+ MoodEnum[MoodEnum["Sad"] = 1] = "Sad";
72
+ MoodEnum[MoodEnum["SemiSad"] = 2] = "SemiSad";
73
+ MoodEnum[MoodEnum["Neutral"] = 3] = "Neutral";
74
+ MoodEnum[MoodEnum["SemiHappy"] = 4] = "SemiHappy";
75
+ MoodEnum[MoodEnum["Happy"] = 5] = "Happy";
76
+ })(MoodEnum = exports.MoodEnum || (exports.MoodEnum = {}));
77
+ var KetoneLevels;
78
+ (function (KetoneLevels) {
79
+ KetoneLevels[KetoneLevels["Negative"] = 0] = "Negative";
80
+ KetoneLevels[KetoneLevels["Normal"] = 1] = "Normal";
81
+ KetoneLevels[KetoneLevels["SlightlyIncreased"] = 2] = "SlightlyIncreased";
82
+ KetoneLevels[KetoneLevels["Moderate"] = 3] = "Moderate";
83
+ KetoneLevels[KetoneLevels["High"] = 4] = "High";
84
+ })(KetoneLevels = exports.KetoneLevels || (exports.KetoneLevels = {}));
85
+ var KetoneColours;
86
+ (function (KetoneColours) {
87
+ KetoneColours["None"] = "rgb(15,18,49)";
88
+ KetoneColours["Negative"] = "rgb(222,194,145)";
89
+ KetoneColours["Normal"] = "rgb(223,179,143)";
90
+ KetoneColours["SlightlyIncreased"] = "rgb(219, 152, 141)";
91
+ KetoneColours["Moderate"] = "rgb(169, 102, 96)";
92
+ KetoneColours["High"] = "rgb(119,55,81)";
93
+ })(KetoneColours = exports.KetoneColours || (exports.KetoneColours = {}));
3
94
  var StatusCode;
4
95
  (function (StatusCode) {
5
96
  /**
@@ -324,5 +415,55 @@ var StatusCode;
324
415
  * to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
325
416
  */
326
417
  StatusCode[StatusCode["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
418
+ /**
419
+ * Client token expired, new token available from server.
420
+ */
421
+ StatusCode[StatusCode["TOKEN_EXPIRED"] = 666] = "TOKEN_EXPIRED";
327
422
  })(StatusCode = exports.StatusCode || (exports.StatusCode = {}));
423
+ var HTTPRequestMethod;
424
+ (function (HTTPRequestMethod) {
425
+ /**
426
+ * The `CONNECT` method establishes a tunnel to the server identified by the
427
+ * target resource.
428
+ */
429
+ HTTPRequestMethod["CONNECT"] = "CONNECT";
430
+ /**
431
+ * The `DELETE` method deletes the specified resource.
432
+ */
433
+ HTTPRequestMethod["DELETE"] = "DELETE";
434
+ /**
435
+ * The `GET` method requests a representation of the specified resource.
436
+ * Requests using GET should only retrieve data.
437
+ */
438
+ HTTPRequestMethod["GET"] = "GET";
439
+ /**
440
+ * The `HEAD` method asks for a response identical to that of a GET request,
441
+ * but without the response body.
442
+ */
443
+ HTTPRequestMethod["HEAD"] = "HEAD";
444
+ /**
445
+ * The `OPTIONS` method is used to describe the communication options for the
446
+ * target resource.
447
+ */
448
+ HTTPRequestMethod["OPTIONS"] = "OPTIONS";
449
+ /**
450
+ * The PATCH method is used to apply partial modifications to a resource.
451
+ */
452
+ HTTPRequestMethod["PATCH"] = "PATCH";
453
+ /**
454
+ * The `POST` method is used to submit an entity to the specified resource,
455
+ * often causing a change in state or side effects on the server.
456
+ */
457
+ HTTPRequestMethod["POST"] = "POST";
458
+ /**
459
+ * The `PUT` method replaces all current representations of the target
460
+ * resource with the request payload.
461
+ */
462
+ HTTPRequestMethod["PUT"] = "PUT";
463
+ /**
464
+ * The `TRACE` method performs a message loop-back test along the path to the
465
+ * target resource.
466
+ */
467
+ HTTPRequestMethod["TRACE"] = "TRACE";
468
+ })(HTTPRequestMethod = exports.HTTPRequestMethod || (exports.HTTPRequestMethod = {}));
328
469
  //# sourceMappingURL=enums.js.map
@@ -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;I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AV,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,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BloodKetonesUnit = exports.BloodGlucoseUnit = void 0;
3
4
  var Units;
4
5
  (function (Units) {
5
6
  Units["MMOL_L"] = "mmol/l";
@@ -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,76 @@
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
+ export declare type ActivityReductionSettings = {
29
+ [key in keyof typeof ActivityReduction]: ActivityReductionIntervalSettings;
30
+ };
31
+ export declare type ActivityReductionIntervalSettings = {
32
+ [key in keyof typeof ActivityReductionIntervals]: number;
33
+ };
34
+ export interface IUSerSettingsNotifications {
35
+ medicineNotification: IMedicineNotification;
36
+ remeasurementNotification: IRemeasurementNotification;
37
+ }
38
+ export interface INotifications {
39
+ toggle: boolean;
40
+ }
41
+ export interface IMedicineNotification extends INotifications {
42
+ dailyReminderTime: string;
43
+ }
44
+ export interface IRemeasurementNotification extends INotifications {
45
+ remeasurement: number;
46
+ }
47
+ export interface IUserDetails {
48
+ name?: string;
49
+ email?: string;
50
+ research_consent?: Date | boolean;
51
+ newsletter_consent?: Date | boolean;
52
+ country?: string;
53
+ language?: keyof typeof Languages;
54
+ }
55
+ export interface IInterval {
56
+ startTime?: string;
57
+ }
58
+ export interface IParameters {
59
+ parameterIntervals: Array<IParameterInterval>;
60
+ overallParameters: IParameterInterval;
61
+ use?: Usage;
62
+ }
63
+ export interface IParameterInterval extends IInterval {
64
+ insulinSensitivity?: number;
65
+ carbohydrateRatio?: number;
66
+ }
67
+ export interface IBGLTargets {
68
+ targetBGLIntervals?: Array<IBGLInterval>;
69
+ overallTargetBGL?: IBGLInterval;
70
+ use?: Usage;
71
+ }
72
+ export interface IBGLInterval extends IInterval {
73
+ low: number;
74
+ target: number;
75
+ high: number;
76
+ }
@@ -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.1",
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,94 @@
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
+ export type ActivityReductionSettings = {
37
+ [key in keyof typeof ActivityReduction]: ActivityReductionIntervalSettings;
38
+ };
39
+ export type ActivityReductionIntervalSettings = {
40
+ [key in keyof typeof ActivityReductionIntervals]: number;
41
+ };
42
+
43
+ export interface IUSerSettingsNotifications {
44
+ medicineNotification: IMedicineNotification;
45
+ remeasurementNotification: IRemeasurementNotification;
46
+ }
47
+ export interface INotifications {
48
+ toggle: boolean;
49
+ }
50
+ export interface IMedicineNotification extends INotifications {
51
+ dailyReminderTime: string;
52
+ }
53
+ export interface IRemeasurementNotification extends INotifications {
54
+ remeasurement: number;
55
+ }
56
+
57
+ export interface IUserDetails {
58
+ name?: string;
59
+ email?: string;
60
+ research_consent?: Date | boolean;
61
+ newsletter_consent?: Date | boolean;
62
+ country?: string;
63
+ language?: keyof typeof Languages;
64
+ }
65
+
66
+ export interface IInterval {
67
+ startTime?: string; //"00:00" format
68
+ }
69
+
70
+ // TODO: Delete when we have all people changed from old managers to new.???
71
+ export interface IParameters {
72
+ parameterIntervals: Array<IParameterInterval>;
73
+ overallParameters: IParameterInterval;
74
+ use?: Usage;
75
+ }
76
+
77
+ export interface IParameterInterval extends IInterval {
78
+ insulinSensitivity?: number;
79
+ carbohydrateRatio?: number;
80
+ }
81
+
82
+ // TODO: Delete when we have all people changed from old managers to new.???
83
+ export interface IBGLTargets {
84
+ targetBGLIntervals?: Array<IBGLInterval>;
85
+ overallTargetBGL?: IBGLInterval;
86
+ use?: Usage;
87
+ }
88
+
89
+ // TODO: Delete when we have all people changed from old managers to new.???
90
+ export interface IBGLInterval extends IInterval {
91
+ low: number;
92
+ target: number;
93
+ high: number;
94
+ }