@demind-inc/core 1.2.42 → 1.2.45

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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,8 +5,6 @@ export interface Metrics {
5
5
  phase?: MetricPhase[];
6
6
  basicTimezone?: string;
7
7
  targetUserId?: string;
8
- devices?: string[];
9
- terraManufacturers?: string[];
10
8
  }
11
9
  export interface MetricSleep {
12
10
  metricSleepId: string;
@@ -1,10 +1,12 @@
1
1
  import { DocumentReference } from "@google-cloud/firestore";
2
2
  import { Chronotype } from "../types";
3
+ import { DeviceConnectedFrom } from "./DeviceGroup";
3
4
  export interface User {
4
5
  userId: string;
5
6
  email?: string;
6
7
  photoUrl?: string;
7
8
  connectedDevices?: UserConnectedDevice[];
9
+ devicesGroupId?: string;
8
10
  calendarIds?: string[];
9
11
  metricId?: string;
10
12
  createdAt?: string;
@@ -102,4 +104,3 @@ export interface UserConnectedDevice {
102
104
  priority?: number;
103
105
  from?: DeviceConnectedFrom;
104
106
  }
105
- export type DeviceConnectedFrom = "APPLE_HEALTH" | "TERRA";
@@ -9,3 +9,4 @@ export * from "./TodoTasks";
9
9
  export * from "./Preference";
10
10
  export * from "./CalendlyIntegrations";
11
11
  export * from "./DataTrend";
12
+ export * from "./DeviceGroup";
@@ -25,3 +25,4 @@ __exportStar(require("./TodoTasks"), exports);
25
25
  __exportStar(require("./Preference"), exports);
26
26
  __exportStar(require("./CalendlyIntegrations"), exports);
27
27
  __exportStar(require("./DataTrend"), exports);
28
+ __exportStar(require("./DeviceGroup"), exports);
package/dist/types.d.ts CHANGED
@@ -37,6 +37,7 @@ export interface ScheduledActionOptions {
37
37
  export interface SleepDetailsByDate {
38
38
  date: string;
39
39
  details: SleepDetail;
40
+ detailedDevices?: string[];
40
41
  }
41
42
  export interface PhaseDetailsByDate {
42
43
  date: string;
@@ -0,0 +1,21 @@
1
+
2
+ export interface DeviceGroup {
3
+ deviceGroupId: string;
4
+ userId: string;
5
+ metricId: string;
6
+ sleepPriorities: DevicePriorities;
7
+ stressPriorities: DevicePriorities;
8
+ devices:
9
+ }
10
+
11
+ export type DevicePriorities = Record<string, number>;
12
+
13
+ export interface Device {
14
+ deviceId: string;
15
+ terraManufacturer: string;
16
+ terraUserId: string;
17
+ from: DeviceConnectedFrom;
18
+ detailedSources?: string[]
19
+ }
20
+
21
+ export type DeviceConnectedFrom = "APPLE_HEALTH" | "TERRA";
@@ -6,8 +6,6 @@ export interface Metrics {
6
6
  phase?: MetricPhase[];
7
7
  basicTimezone?: string;
8
8
  targetUserId?: string;
9
- devices?: string[]; // e.g., Ultrahuman
10
- terraManufacturers?: string[]; // e.g., Apple Health -- same as ConnectedDevice.deviceName
11
9
  }
12
10
 
13
11
  export interface MetricSleep {
@@ -1,11 +1,13 @@
1
1
  import { DocumentReference } from "@google-cloud/firestore";
2
2
  import { Chronotype, ReferralCampaign } from "../types";
3
+ import { DeviceConnectedFrom } from "./DeviceGroup";
3
4
 
4
5
  export interface User {
5
6
  userId: string;
6
7
  email?: string;
7
8
  photoUrl?: string;
8
- connectedDevices?: UserConnectedDevice[];
9
+ connectedDevices?: UserConnectedDevice[]; // Deprecated
10
+ devicesGroupId?: string;
9
11
  calendarIds?: string[];
10
12
  metricId?: string;
11
13
  createdAt?: string;
@@ -152,5 +154,3 @@ export interface UserConnectedDevice {
152
154
  priority?: number;
153
155
  from?: DeviceConnectedFrom;
154
156
  }
155
-
156
- export type DeviceConnectedFrom = "APPLE_HEALTH" | "TERRA";
@@ -9,3 +9,4 @@ export * from "./TodoTasks";
9
9
  export * from "./Preference";
10
10
  export * from "./CalendlyIntegrations";
11
11
  export * from "./DataTrend";
12
+ export * from "./DeviceGroup";
package/lib/types.ts CHANGED
@@ -66,6 +66,7 @@ export interface ScheduledActionOptions {
66
66
  export interface SleepDetailsByDate {
67
67
  date: string;
68
68
  details: SleepDetail;
69
+ detailedDevices?: string[];
69
70
  }
70
71
 
71
72
  export interface PhaseDetailsByDate {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demind-inc/core",
3
- "version": "1.2.42",
3
+ "version": "1.2.45",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {