@demind-inc/core 1.7.84 → 1.8.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/models/RichContext.d.ts +66 -58
- package/dist/models/Routine.d.ts +1 -22
- package/lib/models/RichContext.ts +83 -73
- package/lib/models/Routine.ts +1 -32
- package/package.json +1 -1
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { MealType, MealFoodAmount, MetricMealDetailMacros, MetricMealDetailMicros } from "./Metrics";
|
|
2
|
-
export type SignalSource = "location" | "weather" | "energy" | "sleep" | "screen_time" | "commute" | "menstrual_cycle" | "steps" | "medication" | (string & {});
|
|
2
|
+
export type SignalSource = "location" | "meal" | "weather" | "energy" | "sleep" | "screen_time" | "commute" | "menstrual_cycle" | "steps" | "medication" | (string & {});
|
|
3
3
|
export interface Location {
|
|
4
4
|
name: string;
|
|
5
|
-
lat: number
|
|
6
|
-
lng: number
|
|
5
|
+
lat: number;
|
|
6
|
+
lng: number;
|
|
7
|
+
osm_id?: number;
|
|
8
|
+
osm_type?: string;
|
|
9
|
+
category?: string;
|
|
10
|
+
distance_m?: number;
|
|
11
|
+
walk_min?: number;
|
|
12
|
+
opening_hours?: string;
|
|
13
|
+
website?: string;
|
|
14
|
+
phone?: string;
|
|
15
|
+
map_url?: string;
|
|
7
16
|
}
|
|
8
17
|
export interface Signal {
|
|
9
18
|
signal_source: SignalSource;
|
|
@@ -46,52 +55,58 @@ export interface SleepSummaryPayload {
|
|
|
46
55
|
ideal_sleep_time_tonight?: string;
|
|
47
56
|
heart_rate_summary?: HeartRateSummary;
|
|
48
57
|
}
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
58
|
+
export interface RichContextEnergyZone {
|
|
59
|
+
label: string;
|
|
60
|
+
start: string;
|
|
61
|
+
end: string;
|
|
62
|
+
level: "peak" | "calm" | "low" | "recovering" | (string & {});
|
|
63
|
+
}
|
|
64
|
+
export type MealSignalData = MealSuggestionPayload;
|
|
65
|
+
export interface EnergySignalData {
|
|
66
|
+
zone?: string | null;
|
|
67
|
+
zones?: RichContextEnergyZone[];
|
|
68
|
+
hrv?: number | null;
|
|
69
|
+
sleep_score?: number | null;
|
|
70
|
+
readiness_score?: number | null;
|
|
71
|
+
}
|
|
72
|
+
export interface SleepSignalData extends SleepSummaryPayload {
|
|
73
|
+
}
|
|
74
|
+
export interface WeatherSignalData {
|
|
75
|
+
condition?: string | null;
|
|
76
|
+
temp_c?: number | null;
|
|
77
|
+
feels_like_c?: number | null;
|
|
78
|
+
uv_index?: number | null;
|
|
79
|
+
rain_probability?: number | null;
|
|
80
|
+
timeline?: Array<Record<string, unknown>>;
|
|
81
|
+
}
|
|
82
|
+
export interface ScreenTimeSignalData {
|
|
83
|
+
total_min?: number | null;
|
|
84
|
+
last_2h_min?: number | null;
|
|
85
|
+
top_app?: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface CommuteSignalData {
|
|
88
|
+
duration_min?: number | null;
|
|
89
|
+
mode?: string | null;
|
|
90
|
+
origin?: string | null;
|
|
91
|
+
destination?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface StepsSignalData {
|
|
94
|
+
today?: number | null;
|
|
95
|
+
goal?: number | null;
|
|
96
|
+
percent_complete?: number | null;
|
|
97
|
+
}
|
|
98
|
+
export interface MenstrualCycleSignalData {
|
|
99
|
+
phase?: string | null;
|
|
100
|
+
day_in_cycle?: number | null;
|
|
101
|
+
energy_modifier?: number | null;
|
|
102
|
+
}
|
|
103
|
+
export interface MedicationSignalData {
|
|
104
|
+
name?: string | null;
|
|
105
|
+
dose?: string | null;
|
|
106
|
+
taken_today?: boolean | null;
|
|
107
|
+
next_due_at?: string | null;
|
|
108
|
+
}
|
|
109
|
+
export type SignalData = MealSignalData | EnergySignalData | SleepSignalData | WeatherSignalData | ScreenTimeSignalData | CommuteSignalData | StepsSignalData | MenstrualCycleSignalData | MedicationSignalData;
|
|
95
110
|
export type ActionType = "start_timer" | "open_map" | "open_url" | "log_metric" | "dismiss" | (string & {});
|
|
96
111
|
export type ActionPayload = {
|
|
97
112
|
duration_min: number;
|
|
@@ -153,13 +168,8 @@ export type ContentPayload = {
|
|
|
153
168
|
stream_url: string | null;
|
|
154
169
|
} | {
|
|
155
170
|
current_zone: "peak" | "calm" | "low" | "recovering";
|
|
156
|
-
zones:
|
|
157
|
-
|
|
158
|
-
start: string;
|
|
159
|
-
end: string;
|
|
160
|
-
level: "peak" | "calm" | "low";
|
|
161
|
-
}[];
|
|
162
|
-
} | SleepSummaryPayload | {
|
|
171
|
+
zones: RichContextEnergyZone[];
|
|
172
|
+
} | SleepSummaryPayload | Location | {
|
|
163
173
|
label: string;
|
|
164
174
|
value: number;
|
|
165
175
|
unit: string;
|
|
@@ -185,8 +195,6 @@ export interface Content {
|
|
|
185
195
|
export interface RichContext {
|
|
186
196
|
signals: Signal[];
|
|
187
197
|
location: Location | null;
|
|
188
|
-
reminder_min: number | null;
|
|
189
198
|
action: Action | null;
|
|
190
199
|
content: Content | Content[] | null;
|
|
191
|
-
mealContent?: MealSuggestionPayload;
|
|
192
200
|
}
|
package/dist/models/Routine.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface RoutineActivity {
|
|
|
14
14
|
shouldAutoSuggest?: boolean;
|
|
15
15
|
suggestReason?: string;
|
|
16
16
|
category?: EventCategorySet;
|
|
17
|
-
recurring:
|
|
17
|
+
recurring: RoutineActivityRecurring;
|
|
18
18
|
default?: boolean;
|
|
19
19
|
hidden?: boolean;
|
|
20
20
|
selected?: boolean;
|
|
@@ -25,24 +25,3 @@ export type RoutineActivityRecurring = {
|
|
|
25
25
|
enabled: boolean;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export type RoutineCustomRecurrenceWeekly = {
|
|
29
|
-
type: "weekly";
|
|
30
|
-
interval: number;
|
|
31
|
-
daysOfWeek: RoutineActivityRecurringDay[];
|
|
32
|
-
startDate: string;
|
|
33
|
-
};
|
|
34
|
-
export type RoutineCustomRecurrenceMonthlyDate = {
|
|
35
|
-
type: "monthly-date";
|
|
36
|
-
interval: number;
|
|
37
|
-
daysOfMonth: number[];
|
|
38
|
-
startDate: string;
|
|
39
|
-
};
|
|
40
|
-
export type RoutineCustomRecurrenceMonthlyWeekday = {
|
|
41
|
-
type: "monthly-weekday";
|
|
42
|
-
interval: number;
|
|
43
|
-
weekOfMonth: -1 | 1 | 2 | 3 | 4;
|
|
44
|
-
dayOfWeek: RoutineActivityRecurringDay;
|
|
45
|
-
startDate: string;
|
|
46
|
-
};
|
|
47
|
-
export type RoutineCustomRecurrence = RoutineCustomRecurrenceWeekly | RoutineCustomRecurrenceMonthlyDate | RoutineCustomRecurrenceMonthlyWeekday;
|
|
48
|
-
export type RoutineRecurring = RoutineActivityRecurring | RoutineCustomRecurrence;
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
|
|
8
8
|
export type SignalSource =
|
|
9
9
|
| "location"
|
|
10
|
+
| "meal"
|
|
10
11
|
| "weather"
|
|
11
12
|
| "energy"
|
|
12
13
|
| "sleep"
|
|
@@ -19,8 +20,17 @@ export type SignalSource =
|
|
|
19
20
|
|
|
20
21
|
export interface Location {
|
|
21
22
|
name: string;
|
|
22
|
-
lat: number
|
|
23
|
-
lng: number
|
|
23
|
+
lat: number;
|
|
24
|
+
lng: number;
|
|
25
|
+
osm_id?: number;
|
|
26
|
+
osm_type?: string;
|
|
27
|
+
category?: string;
|
|
28
|
+
distance_m?: number;
|
|
29
|
+
walk_min?: number;
|
|
30
|
+
opening_hours?: string;
|
|
31
|
+
website?: string;
|
|
32
|
+
phone?: string;
|
|
33
|
+
map_url?: string;
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
export interface Signal {
|
|
@@ -72,70 +82,76 @@ export interface SleepSummaryPayload {
|
|
|
72
82
|
heart_rate_summary?: HeartRateSummary;
|
|
73
83
|
}
|
|
74
84
|
|
|
85
|
+
export interface RichContextEnergyZone {
|
|
86
|
+
label: string;
|
|
87
|
+
start: string;
|
|
88
|
+
end: string;
|
|
89
|
+
level: "peak" | "calm" | "low" | "recovering" | (string & {});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type MealSignalData = MealSuggestionPayload;
|
|
93
|
+
|
|
94
|
+
export interface EnergySignalData {
|
|
95
|
+
zone?: string | null;
|
|
96
|
+
zones?: RichContextEnergyZone[];
|
|
97
|
+
hrv?: number | null;
|
|
98
|
+
sleep_score?: number | null;
|
|
99
|
+
readiness_score?: number | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SleepSignalData extends SleepSummaryPayload {}
|
|
103
|
+
|
|
104
|
+
export interface WeatherSignalData {
|
|
105
|
+
condition?: string | null;
|
|
106
|
+
temp_c?: number | null;
|
|
107
|
+
feels_like_c?: number | null;
|
|
108
|
+
uv_index?: number | null;
|
|
109
|
+
rain_probability?: number | null;
|
|
110
|
+
timeline?: Array<Record<string, unknown>>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ScreenTimeSignalData {
|
|
114
|
+
total_min?: number | null;
|
|
115
|
+
last_2h_min?: number | null;
|
|
116
|
+
top_app?: string | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface CommuteSignalData {
|
|
120
|
+
duration_min?: number | null;
|
|
121
|
+
mode?: string | null;
|
|
122
|
+
origin?: string | null;
|
|
123
|
+
destination?: string | null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface StepsSignalData {
|
|
127
|
+
today?: number | null;
|
|
128
|
+
goal?: number | null;
|
|
129
|
+
percent_complete?: number | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface MenstrualCycleSignalData {
|
|
133
|
+
phase?: string | null;
|
|
134
|
+
day_in_cycle?: number | null;
|
|
135
|
+
energy_modifier?: number | null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface MedicationSignalData {
|
|
139
|
+
name?: string | null;
|
|
140
|
+
dose?: string | null;
|
|
141
|
+
taken_today?: boolean | null;
|
|
142
|
+
next_due_at?: string | null;
|
|
143
|
+
}
|
|
144
|
+
|
|
75
145
|
export type SignalData =
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
// weather
|
|
86
|
-
condition: string;
|
|
87
|
-
temp_c: number | null;
|
|
88
|
-
feels_like_c: number | null;
|
|
89
|
-
rain_probability: number | null;
|
|
90
|
-
uv_index: number | null;
|
|
91
|
-
timeline?: Array<{
|
|
92
|
-
timestamp: string;
|
|
93
|
-
temperature_f?: number;
|
|
94
|
-
temperature_c?: number;
|
|
95
|
-
summary?: string;
|
|
96
|
-
}>;
|
|
97
|
-
}
|
|
98
|
-
| {
|
|
99
|
-
// energy
|
|
100
|
-
zone: "peak" | "calm" | "low" | "recovering";
|
|
101
|
-
hrv: number | null;
|
|
102
|
-
sleep_score: number | null;
|
|
103
|
-
readiness_score: number | null;
|
|
104
|
-
}
|
|
105
|
-
| SleepSummaryPayload
|
|
106
|
-
| {
|
|
107
|
-
// screen_time
|
|
108
|
-
total_min: number;
|
|
109
|
-
last_2h_min: number | null;
|
|
110
|
-
top_app: string | null;
|
|
111
|
-
}
|
|
112
|
-
| {
|
|
113
|
-
// commute
|
|
114
|
-
duration_min: number;
|
|
115
|
-
mode: "transit" | "driving" | "walking" | "cycling";
|
|
116
|
-
origin: string | null;
|
|
117
|
-
destination: string | null;
|
|
118
|
-
}
|
|
119
|
-
| {
|
|
120
|
-
// menstrual_cycle
|
|
121
|
-
phase: "menstrual" | "follicular" | "ovulatory" | "luteal";
|
|
122
|
-
day_in_cycle: number;
|
|
123
|
-
energy_modifier: number;
|
|
124
|
-
}
|
|
125
|
-
| {
|
|
126
|
-
// steps
|
|
127
|
-
today: number;
|
|
128
|
-
goal: number;
|
|
129
|
-
percent_complete: number;
|
|
130
|
-
}
|
|
131
|
-
| {
|
|
132
|
-
// medication
|
|
133
|
-
name: string;
|
|
134
|
-
dose: string | null;
|
|
135
|
-
taken_today: boolean;
|
|
136
|
-
next_due_at: string | null;
|
|
137
|
-
}
|
|
138
|
-
| Record<string, unknown>;
|
|
146
|
+
| MealSignalData
|
|
147
|
+
| EnergySignalData
|
|
148
|
+
| SleepSignalData
|
|
149
|
+
| WeatherSignalData
|
|
150
|
+
| ScreenTimeSignalData
|
|
151
|
+
| CommuteSignalData
|
|
152
|
+
| StepsSignalData
|
|
153
|
+
| MenstrualCycleSignalData
|
|
154
|
+
| MedicationSignalData;
|
|
139
155
|
|
|
140
156
|
export type ActionType =
|
|
141
157
|
| "start_timer"
|
|
@@ -240,14 +256,10 @@ export type ContentPayload =
|
|
|
240
256
|
| {
|
|
241
257
|
// energy_summary
|
|
242
258
|
current_zone: "peak" | "calm" | "low" | "recovering";
|
|
243
|
-
zones:
|
|
244
|
-
label: string;
|
|
245
|
-
start: string;
|
|
246
|
-
end: string;
|
|
247
|
-
level: "peak" | "calm" | "low";
|
|
248
|
-
}[];
|
|
259
|
+
zones: RichContextEnergyZone[];
|
|
249
260
|
}
|
|
250
261
|
| SleepSummaryPayload
|
|
262
|
+
| Location
|
|
251
263
|
| {
|
|
252
264
|
// metric_bar
|
|
253
265
|
label: string;
|
|
@@ -280,8 +292,6 @@ export interface Content {
|
|
|
280
292
|
export interface RichContext {
|
|
281
293
|
signals: Signal[];
|
|
282
294
|
location: Location | null;
|
|
283
|
-
reminder_min: number | null;
|
|
284
295
|
action: Action | null;
|
|
285
296
|
content: Content | Content[] | null;
|
|
286
|
-
mealContent?: MealSuggestionPayload
|
|
287
297
|
}
|
package/lib/models/Routine.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface RoutineActivity {
|
|
|
16
16
|
shouldAutoSuggest?: boolean;
|
|
17
17
|
suggestReason?: string;
|
|
18
18
|
category?: EventCategorySet;
|
|
19
|
-
recurring:
|
|
19
|
+
recurring: RoutineActivityRecurring;
|
|
20
20
|
default?: boolean;
|
|
21
21
|
hidden?: boolean;
|
|
22
22
|
selected?: boolean;
|
|
@@ -34,34 +34,3 @@ export type RoutineActivityRecurringDay =
|
|
|
34
34
|
export type RoutineActivityRecurring = {
|
|
35
35
|
[day in RoutineActivityRecurringDay]: { enabled: boolean };
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
// --- Custom recurrence variants ---
|
|
39
|
-
|
|
40
|
-
export type RoutineCustomRecurrenceWeekly = {
|
|
41
|
-
type: "weekly";
|
|
42
|
-
interval: number;
|
|
43
|
-
daysOfWeek: RoutineActivityRecurringDay[];
|
|
44
|
-
startDate: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type RoutineCustomRecurrenceMonthlyDate = {
|
|
48
|
-
type: "monthly-date";
|
|
49
|
-
interval: number;
|
|
50
|
-
daysOfMonth: number[];
|
|
51
|
-
startDate: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export type RoutineCustomRecurrenceMonthlyWeekday = {
|
|
55
|
-
type: "monthly-weekday";
|
|
56
|
-
interval: number;
|
|
57
|
-
weekOfMonth: -1 | 1 | 2 | 3 | 4;
|
|
58
|
-
dayOfWeek: RoutineActivityRecurringDay;
|
|
59
|
-
startDate: string;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type RoutineCustomRecurrence =
|
|
63
|
-
| RoutineCustomRecurrenceWeekly
|
|
64
|
-
| RoutineCustomRecurrenceMonthlyDate
|
|
65
|
-
| RoutineCustomRecurrenceMonthlyWeekday;
|
|
66
|
-
|
|
67
|
-
export type RoutineRecurring = RoutineActivityRecurring | RoutineCustomRecurrence;
|