@demind-inc/core 1.7.50 → 1.7.52
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/constants.d.ts +3 -0
- package/dist/constants.js +3 -0
- package/dist/models/Metrics.d.ts +45 -0
- package/dist/types.d.ts +5 -1
- package/lib/constants.ts +3 -0
- package/lib/models/Metrics.ts +51 -0
- package/lib/types.ts +6 -0
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const DB_COLLECTION: {
|
|
|
7
7
|
CALENDARS_CATEGORY_LABELS: string;
|
|
8
8
|
METRICS: string;
|
|
9
9
|
SLEEP: string;
|
|
10
|
+
NAP: string;
|
|
10
11
|
PHASE: string;
|
|
11
12
|
EXERCISE: string;
|
|
12
13
|
MEAL: string;
|
|
@@ -45,6 +46,8 @@ export declare const DB_COLLECTION: {
|
|
|
45
46
|
CHAT_GENERAL_SESSION: string;
|
|
46
47
|
SHARED_ACCESS: string;
|
|
47
48
|
EVENT_SERIES: string;
|
|
49
|
+
LOCATION: string;
|
|
50
|
+
WEATHER: string;
|
|
48
51
|
};
|
|
49
52
|
export declare const SLEEP_SUPPORTED_TERRA_PROVIDERS: SupportedTerraProvidersType[];
|
|
50
53
|
export declare const STRESS_SUPPORTED_TERRA_PROVIDERS: SupportedTerraProvidersType[];
|
package/dist/constants.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.DB_COLLECTION = {
|
|
|
8
8
|
CALENDARS_CATEGORY_LABELS: "categoryLabels",
|
|
9
9
|
METRICS: "metrics",
|
|
10
10
|
SLEEP: "sleep",
|
|
11
|
+
NAP: "nap",
|
|
11
12
|
PHASE: "phase",
|
|
12
13
|
EXERCISE: "exercise",
|
|
13
14
|
MEAL: "meal",
|
|
@@ -46,6 +47,8 @@ exports.DB_COLLECTION = {
|
|
|
46
47
|
CHAT_GENERAL_SESSION: "generalSession",
|
|
47
48
|
SHARED_ACCESS: "sharedAccess",
|
|
48
49
|
EVENT_SERIES: "eventSeries",
|
|
50
|
+
LOCATION: "location",
|
|
51
|
+
WEATHER: "weather",
|
|
49
52
|
};
|
|
50
53
|
exports.SLEEP_SUPPORTED_TERRA_PROVIDERS = [
|
|
51
54
|
"FITBIT",
|
package/dist/models/Metrics.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ import { CircadianPhase } from "../types";
|
|
|
3
3
|
export interface Metrics {
|
|
4
4
|
metricId: string;
|
|
5
5
|
sleep?: MetricSleep[];
|
|
6
|
+
nap?: MetricNap[];
|
|
6
7
|
phase?: MetricPhase[];
|
|
7
8
|
exercise?: MetricExercise[];
|
|
8
9
|
meal?: MetricMeal[];
|
|
9
10
|
heartRate?: MetricHeartRate[];
|
|
10
11
|
stress?: MetricStress[];
|
|
11
12
|
movement?: MetricMovement[];
|
|
13
|
+
location?: MetricLocation[];
|
|
14
|
+
weather?: MetricWeather[];
|
|
12
15
|
basicTimezone?: string;
|
|
13
16
|
targetUserId?: string;
|
|
14
17
|
baseCalendarId?: string;
|
|
@@ -21,6 +24,45 @@ export interface MetricSleep {
|
|
|
21
24
|
eventRef?: DocumentReference | null;
|
|
22
25
|
predictedSleep?: PredictedSleep;
|
|
23
26
|
}
|
|
27
|
+
export interface MetricNap {
|
|
28
|
+
metricNapId: string;
|
|
29
|
+
date: string;
|
|
30
|
+
scores?: NapDetail[];
|
|
31
|
+
eventRef?: DocumentReference | null;
|
|
32
|
+
}
|
|
33
|
+
export interface MetricLocation {
|
|
34
|
+
metricLocationId: string;
|
|
35
|
+
date: string;
|
|
36
|
+
location: LocationData[];
|
|
37
|
+
}
|
|
38
|
+
export interface MetricWeather {
|
|
39
|
+
metricWeatherId: string;
|
|
40
|
+
date: string;
|
|
41
|
+
weather: WeatherData[];
|
|
42
|
+
}
|
|
43
|
+
export interface LocationData {
|
|
44
|
+
name?: string;
|
|
45
|
+
lat: number;
|
|
46
|
+
lng: number;
|
|
47
|
+
capturedAt: string;
|
|
48
|
+
rawJson?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface WeatherData {
|
|
51
|
+
location: string;
|
|
52
|
+
current_conditions: {
|
|
53
|
+
summary?: string;
|
|
54
|
+
temperature_f?: number;
|
|
55
|
+
temperature_c?: number;
|
|
56
|
+
};
|
|
57
|
+
daily_forecast: {
|
|
58
|
+
summary?: string;
|
|
59
|
+
high_f?: number;
|
|
60
|
+
high_c?: number;
|
|
61
|
+
low_f?: number;
|
|
62
|
+
low_c?: number;
|
|
63
|
+
};
|
|
64
|
+
rawJson?: string;
|
|
65
|
+
}
|
|
24
66
|
export interface PredictedSleep {
|
|
25
67
|
sleepTime: string;
|
|
26
68
|
wakeTime: string;
|
|
@@ -155,6 +197,9 @@ export interface SleepDetail {
|
|
|
155
197
|
heartRateSummary?: MetricHRSummary;
|
|
156
198
|
temperatureDelta?: number;
|
|
157
199
|
}
|
|
200
|
+
export interface NapDetail extends SleepDetail {
|
|
201
|
+
metadata?: Record<string, unknown>;
|
|
202
|
+
}
|
|
158
203
|
export type SleepStageType = "deep" | "light" | "rem" | "awake";
|
|
159
204
|
export type SleepStage = Record<SleepStageType, number>;
|
|
160
205
|
export type MetricType = "stress" | "heartRate";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalendarEvent, CalendarRoutineFrom, CalendarTaskFrom, EMASatisfaction, EnergyFeedbackType, EventCategorySet, MealType, MetricActivity, MetricHRValueSet, MetricMealDetail, MetricMealSummary, MetricStressValueSet, PhaseStartEndSet, RichContext, RoutineActivity, SleepDetail, TaskItem, TaskPriority, TodoAppFrom } from "./models";
|
|
1
|
+
import { CalendarEvent, CalendarRoutineFrom, CalendarTaskFrom, EMASatisfaction, EnergyFeedbackType, EventCategorySet, MealType, MetricActivity, MetricHRValueSet, MetricMealDetail, MetricMealSummary, MetricStressValueSet, NapDetail, PhaseStartEndSet, RichContext, RoutineActivity, SleepDetail, TaskItem, TaskPriority, TodoAppFrom } from "./models";
|
|
2
2
|
export type SupportedTerraProvidersType = "FITBIT" | "OURA" | "GARMIN" | "WHOOP" | "ULTRAHUMAN" | "STRAVA" | "MYFITNESSPAL";
|
|
3
3
|
export type SupportedTerraSDKType = "APPLE" | "GOOGLE_FIT" | "SAMSUNG_HEALTH" | "FREESTYLE_LIBRE";
|
|
4
4
|
export type CircadianPhase = "default" | "wakeup_low" | "wakeup_normal" | "morning_high" | "morning_normal" | "morning_low" | "evening_high" | "evening_low" | "evening_normal";
|
|
@@ -54,6 +54,10 @@ export interface SleepDetailsByDate {
|
|
|
54
54
|
details: SleepDetail;
|
|
55
55
|
predictedSleep?: Pick<SleepDetail, "awakeTime" | "sleepTime">;
|
|
56
56
|
}
|
|
57
|
+
export interface NapDetailsByDate {
|
|
58
|
+
date: string;
|
|
59
|
+
details: NapDetail[];
|
|
60
|
+
}
|
|
57
61
|
export interface HRDetailsByDate {
|
|
58
62
|
date: string;
|
|
59
63
|
hrDetails: MetricHRValueSet[];
|
package/lib/constants.ts
CHANGED
|
@@ -8,6 +8,7 @@ export const DB_COLLECTION = {
|
|
|
8
8
|
CALENDARS_CATEGORY_LABELS: "categoryLabels",
|
|
9
9
|
METRICS: "metrics",
|
|
10
10
|
SLEEP: "sleep",
|
|
11
|
+
NAP: "nap",
|
|
11
12
|
PHASE: "phase",
|
|
12
13
|
EXERCISE: "exercise",
|
|
13
14
|
MEAL: "meal",
|
|
@@ -46,6 +47,8 @@ export const DB_COLLECTION = {
|
|
|
46
47
|
CHAT_GENERAL_SESSION: "generalSession",
|
|
47
48
|
SHARED_ACCESS: "sharedAccess",
|
|
48
49
|
EVENT_SERIES: "eventSeries",
|
|
50
|
+
LOCATION: "location",
|
|
51
|
+
WEATHER: "weather",
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
export const SLEEP_SUPPORTED_TERRA_PROVIDERS: SupportedTerraProvidersType[] = [
|
package/lib/models/Metrics.ts
CHANGED
|
@@ -4,12 +4,15 @@ import { CircadianPhase } from "../types";
|
|
|
4
4
|
export interface Metrics {
|
|
5
5
|
metricId: string;
|
|
6
6
|
sleep?: MetricSleep[];
|
|
7
|
+
nap?: MetricNap[];
|
|
7
8
|
phase?: MetricPhase[];
|
|
8
9
|
exercise?: MetricExercise[];
|
|
9
10
|
meal?: MetricMeal[];
|
|
10
11
|
heartRate?: MetricHeartRate[];
|
|
11
12
|
stress?: MetricStress[];
|
|
12
13
|
movement?: MetricMovement[];
|
|
14
|
+
location?: MetricLocation[];
|
|
15
|
+
weather?: MetricWeather[];
|
|
13
16
|
basicTimezone?: string;
|
|
14
17
|
targetUserId?: string;
|
|
15
18
|
baseCalendarId?: string;
|
|
@@ -24,6 +27,50 @@ export interface MetricSleep {
|
|
|
24
27
|
predictedSleep?: PredictedSleep;
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
export interface MetricNap {
|
|
31
|
+
metricNapId: string;
|
|
32
|
+
date: string;
|
|
33
|
+
scores?: NapDetail[];
|
|
34
|
+
eventRef?: DocumentReference | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface MetricLocation {
|
|
38
|
+
metricLocationId: string;
|
|
39
|
+
date: string;
|
|
40
|
+
location: LocationData[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface MetricWeather {
|
|
44
|
+
metricWeatherId: string;
|
|
45
|
+
date: string;
|
|
46
|
+
weather: WeatherData[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface LocationData {
|
|
50
|
+
name?: string;
|
|
51
|
+
lat: number;
|
|
52
|
+
lng: number;
|
|
53
|
+
capturedAt: string;
|
|
54
|
+
rawJson?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface WeatherData {
|
|
58
|
+
location: string;
|
|
59
|
+
current_conditions: {
|
|
60
|
+
summary?: string;
|
|
61
|
+
temperature_f?: number;
|
|
62
|
+
temperature_c?: number;
|
|
63
|
+
};
|
|
64
|
+
daily_forecast: {
|
|
65
|
+
summary?: string;
|
|
66
|
+
high_f?: number;
|
|
67
|
+
high_c?: number;
|
|
68
|
+
low_f?: number;
|
|
69
|
+
low_c?: number;
|
|
70
|
+
};
|
|
71
|
+
rawJson?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
27
74
|
export interface PredictedSleep {
|
|
28
75
|
sleepTime: string; // HH:mm
|
|
29
76
|
wakeTime: string; // HH:mm
|
|
@@ -177,6 +224,10 @@ export interface SleepDetail {
|
|
|
177
224
|
temperatureDelta?: number;
|
|
178
225
|
}
|
|
179
226
|
|
|
227
|
+
export interface NapDetail extends SleepDetail {
|
|
228
|
+
metadata?: Record<string, unknown>;
|
|
229
|
+
}
|
|
230
|
+
|
|
180
231
|
export type SleepStageType = "deep" | "light" | "rem" | "awake";
|
|
181
232
|
|
|
182
233
|
export type SleepStage = Record<SleepStageType, number>;
|
package/lib/types.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
MetricMealDetail,
|
|
12
12
|
MetricMealSummary,
|
|
13
13
|
MetricStressValueSet,
|
|
14
|
+
NapDetail,
|
|
14
15
|
PhaseStartEndSet,
|
|
15
16
|
RichContext,
|
|
16
17
|
RoutineActivity,
|
|
@@ -115,6 +116,11 @@ export interface SleepDetailsByDate {
|
|
|
115
116
|
predictedSleep?: Pick<SleepDetail, "awakeTime" | "sleepTime">;
|
|
116
117
|
}
|
|
117
118
|
|
|
119
|
+
export interface NapDetailsByDate {
|
|
120
|
+
date: string;
|
|
121
|
+
details: NapDetail[];
|
|
122
|
+
}
|
|
123
|
+
|
|
118
124
|
export interface HRDetailsByDate {
|
|
119
125
|
date: string;
|
|
120
126
|
hrDetails: MetricHRValueSet[];
|