@demind-inc/core 1.7.83 → 1.8.0

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.
@@ -2,8 +2,17 @@ import type { MealType, MealFoodAmount, MetricMealDetailMacros, MetricMealDetail
2
2
  export type SignalSource = "location" | "weather" | "energy" | "sleep" | "screen_time" | "commute" | "menstrual_cycle" | "steps" | "medication" | (string & {});
3
3
  export interface Location {
4
4
  name: string;
5
- lat: number | null;
6
- lng: number | null;
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,13 +55,7 @@ export interface SleepSummaryPayload {
46
55
  ideal_sleep_time_tonight?: string;
47
56
  heart_rate_summary?: HeartRateSummary;
48
57
  }
49
- export type SignalData = {
50
- name: string;
51
- distance_m: number | null;
52
- lat: number | null;
53
- lng: number | null;
54
- place_type: string | null;
55
- } | {
58
+ export type SignalData = Location | {
56
59
  condition: string;
57
60
  temp_c: number | null;
58
61
  feels_like_c: number | null;
@@ -159,7 +162,7 @@ export type ContentPayload = {
159
162
  end: string;
160
163
  level: "peak" | "calm" | "low";
161
164
  }[];
162
- } | SleepSummaryPayload | {
165
+ } | SleepSummaryPayload | Location | {
163
166
  label: string;
164
167
  value: number;
165
168
  unit: string;
@@ -14,7 +14,7 @@ export interface RoutineActivity {
14
14
  shouldAutoSuggest?: boolean;
15
15
  suggestReason?: string;
16
16
  category?: EventCategorySet;
17
- recurring: RoutineRecurring;
17
+ recurring: RoutineActivityRecurring;
18
18
  default?: boolean;
19
19
  hidden?: boolean;
20
20
  selected?: boolean;
@@ -25,17 +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 RoutineCustomRecurrence = RoutineCustomRecurrenceWeekly | RoutineCustomRecurrenceMonthlyDate;
41
- export type RoutineRecurring = RoutineActivityRecurring | RoutineCustomRecurrence;
@@ -19,8 +19,17 @@ export type SignalSource =
19
19
 
20
20
  export interface Location {
21
21
  name: string;
22
- lat: number | null;
23
- lng: number | null;
22
+ lat: number;
23
+ lng: number;
24
+ osm_id?: number;
25
+ osm_type?: string;
26
+ category?: string;
27
+ distance_m?: number;
28
+ walk_min?: number;
29
+ opening_hours?: string;
30
+ website?: string;
31
+ phone?: string;
32
+ map_url?: string;
24
33
  }
25
34
 
26
35
  export interface Signal {
@@ -73,14 +82,7 @@ export interface SleepSummaryPayload {
73
82
  }
74
83
 
75
84
  export type SignalData =
76
- | {
77
- // location
78
- name: string;
79
- distance_m: number | null;
80
- lat: number | null;
81
- lng: number | null;
82
- place_type: string | null;
83
- }
85
+ | Location
84
86
  | {
85
87
  // weather
86
88
  condition: string;
@@ -248,6 +250,7 @@ export type ContentPayload =
248
250
  }[];
249
251
  }
250
252
  | SleepSummaryPayload
253
+ | Location
251
254
  | {
252
255
  // metric_bar
253
256
  label: string;
@@ -278,10 +281,10 @@ export interface Content {
278
281
  }
279
282
 
280
283
  export interface RichContext {
281
- signals: Signal[];
284
+ signals: Signal[]; // deprecated
282
285
  location: Location | null;
283
286
  reminder_min: number | null;
284
287
  action: Action | null;
285
288
  content: Content | Content[] | null;
286
- mealContent?: MealSuggestionPayload
289
+ mealContent?: MealSuggestionPayload;
287
290
  }
@@ -16,7 +16,7 @@ export interface RoutineActivity {
16
16
  shouldAutoSuggest?: boolean;
17
17
  suggestReason?: string;
18
18
  category?: EventCategorySet;
19
- recurring: RoutineRecurring;
19
+ recurring: RoutineActivityRecurring;
20
20
  default?: boolean;
21
21
  hidden?: boolean;
22
22
  selected?: boolean;
@@ -34,25 +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 RoutineCustomRecurrence =
55
- | RoutineCustomRecurrenceWeekly
56
- | RoutineCustomRecurrenceMonthlyDate;
57
-
58
- export type RoutineRecurring = RoutineActivityRecurring | RoutineCustomRecurrence;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demind-inc/core",
3
- "version": "1.7.83",
3
+ "version": "1.8.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {