@demind-inc/core 1.0.72 → 1.0.74

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,18 +1,21 @@
1
+ import { CircadianPhase } from "../types";
1
2
  export interface Metrics {
2
3
  metricId: string;
3
4
  sleep?: MetricsSleep;
4
- stress?: {
5
- dailyScores: DailyMetricScore[];
6
- };
7
- heartRate?: {
8
- dailyScores: DailyMetricScore[];
9
- };
5
+ phase?: MetricPhase;
10
6
  }
11
7
  export interface MetricsSleep {
12
8
  scores?: DateFrame<SleepDetail>;
13
9
  didInitialSync?: boolean;
14
10
  avgDurationMin?: number;
15
11
  }
12
+ export type PhaseStartEndSet = Omit<Record<CircadianPhase, {
13
+ start: string;
14
+ end: string;
15
+ }>, "default">;
16
+ export interface MetricPhase {
17
+ data: DateFrame<PhaseStartEndSet>;
18
+ }
16
19
  export interface SleepDetail {
17
20
  durationMin?: number;
18
21
  sleepTime?: string;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EnergyFeedbackType, SleepDetail } from "./models";
1
+ import { EnergyFeedbackType, PhaseStartEndSet, SleepDetail } from "./models";
2
2
  export type SupportedTerraProvidersType = "FITBIT" | "OURA" | "GARMIN" | "APPLE_HEALTH";
3
3
  export type CircadianPhase = "default" | "wakeup_low" | "wakeup_normal" | "morning_high" | "morning_normal" | "morning_low" | "evening_high" | "evening_low" | "evening_normal";
4
4
  export type TimePhase = "morning" | "midday" | "evening";
@@ -15,10 +15,6 @@ export interface EventEnergySet {
15
15
  energy: EnergyFeedbackType;
16
16
  }
17
17
  export type Chronotype = "morning" | "night" | "hybrid";
18
- export type CircadianPhaseStartEndSet = Record<CircadianPhase, {
19
- start: string;
20
- end: string;
21
- }>;
22
18
  export interface HeatmapDataType {
23
19
  x: string;
24
20
  y: string;
@@ -42,3 +38,7 @@ export interface SleepDetailsByDate {
42
38
  date: string;
43
39
  details: SleepDetail;
44
40
  }
41
+ export interface PhaseDetailsByDate {
42
+ date: string;
43
+ details: PhaseStartEndSet;
44
+ }
@@ -1,12 +1,9 @@
1
+ import { CircadianPhase } from "../types";
2
+
1
3
  export interface Metrics {
2
4
  metricId: string;
3
5
  sleep?: MetricsSleep;
4
- stress?: {
5
- dailyScores: DailyMetricScore[];
6
- };
7
- heartRate?: {
8
- dailyScores: DailyMetricScore[];
9
- };
6
+ phase?: MetricPhase;
10
7
  }
11
8
 
12
9
  export interface MetricsSleep {
@@ -15,6 +12,15 @@ export interface MetricsSleep {
15
12
  avgDurationMin?: number;
16
13
  }
17
14
 
15
+ export type PhaseStartEndSet = Omit<
16
+ Record<CircadianPhase, { start: string; end: string }>,
17
+ "default"
18
+ >;
19
+
20
+ export interface MetricPhase {
21
+ data: DateFrame<PhaseStartEndSet>;
22
+ }
23
+
18
24
  export interface SleepDetail {
19
25
  durationMin?: number;
20
26
  sleepTime?: string;
package/lib/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EnergyFeedbackType, SleepDetail } from "./models";
1
+ import { EnergyFeedbackType, PhaseStartEndSet, SleepDetail } from "./models";
2
2
 
3
3
  export type SupportedTerraProvidersType =
4
4
  | "FITBIT"
@@ -35,11 +35,6 @@ export interface EventEnergySet {
35
35
 
36
36
  export type Chronotype = "morning" | "night" | "hybrid";
37
37
 
38
- export type CircadianPhaseStartEndSet = Record<
39
- CircadianPhase,
40
- { start: string; end: string }
41
- >;
42
-
43
38
  export interface HeatmapDataType {
44
39
  x: string;
45
40
  y: string;
@@ -66,3 +61,8 @@ export interface SleepDetailsByDate {
66
61
  date: string;
67
62
  details: SleepDetail;
68
63
  }
64
+
65
+ export interface PhaseDetailsByDate {
66
+ date: string;
67
+ details: PhaseStartEndSet;
68
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demind-inc/core",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {