@demind-inc/core 1.11.4 → 1.11.7
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/featureFlags.types.d.ts +1 -0
- package/dist/models/User.d.ts +12 -12
- package/dist/models/User.js +21 -18
- package/lib/featureFlags.types.ts +1 -0
- package/lib/models/User.ts +50 -59
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ export interface FeatureFlags {
|
|
|
26
26
|
FF_ai_scheduler_adjust_v2?: boolean;
|
|
27
27
|
FF_paywall_202602_ab_test?: boolean;
|
|
28
28
|
FF_lifestack_v3?: boolean;
|
|
29
|
+
FF_lifestack_v4?: boolean;
|
|
29
30
|
FF_native_health_sdk?: boolean;
|
|
30
31
|
FF_promo_code_hide?: boolean;
|
|
31
32
|
team_plan_beta_users?: {
|
package/dist/models/User.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentReference } from
|
|
2
|
-
import { Chronotype, PeaksDipsPhase } from
|
|
3
|
-
import { DeviceConnectedFrom } from
|
|
1
|
+
import { DocumentReference } from '@google-cloud/firestore';
|
|
2
|
+
import { Chronotype, PeaksDipsPhase } from '../types';
|
|
3
|
+
import { DeviceConnectedFrom } from './DeviceGroup';
|
|
4
4
|
export interface User {
|
|
5
5
|
userId: string;
|
|
6
6
|
email?: string;
|
|
@@ -82,8 +82,8 @@ export interface OnboardingStatus {
|
|
|
82
82
|
initialSync?: OnboardingStatusOption;
|
|
83
83
|
tutorial?: OnboardingStatusOption;
|
|
84
84
|
}
|
|
85
|
-
export type OnboardingStatusOption =
|
|
86
|
-
export type AuthProvider =
|
|
85
|
+
export type OnboardingStatusOption = 'notAnswered' | 'answered' | 'skipped';
|
|
86
|
+
export type AuthProvider = 'google' | 'apple';
|
|
87
87
|
export interface Subscription {
|
|
88
88
|
productId: string;
|
|
89
89
|
subscribedDate: string;
|
|
@@ -105,7 +105,7 @@ export interface Subscription {
|
|
|
105
105
|
discountId: string;
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
export type SubscriptionRecurring =
|
|
108
|
+
export type SubscriptionRecurring = 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'LIFETIME';
|
|
109
109
|
export interface GrantSubscription {
|
|
110
110
|
productId: string;
|
|
111
111
|
purchaseDate?: string;
|
|
@@ -116,15 +116,15 @@ export interface ConvertedReferralCampaign {
|
|
|
116
116
|
campaignId: string;
|
|
117
117
|
rewardfulClientId?: string;
|
|
118
118
|
}
|
|
119
|
-
export type StripeLookupkey =
|
|
120
|
-
export declare const stripeLookupKeySet: Record<
|
|
119
|
+
export type StripeLookupkey = 'beta_monthly_staging' | 'beta_yearly_staging' | 'basic_monthly_staging' | 'basic_yearly_staging' | 'basic_lifetime_staging' | 'basic_weekly_staging' | 'beta_monthly_prod' | 'beta_yearly_prod' | 'basic_monthly_prod' | 'basic_yearly_prod' | 'basic_weekly_prod' | 'basic_lifetime_prod' | 'basic_monthly_price_up_202512_staging' | 'basic_yearly_price_up_202512_staging' | 'basic_monthly_price_up_202512_prod' | 'basic_yearly_price_up_202512_prod' | 'basic_monthly_price_up_202610_staging' | 'basic_monthly_price_up_202610_prod';
|
|
120
|
+
export declare const stripeLookupKeySet: Record<'beta' | 'basic' | 'basic_price_up_202512' | 'basic_price_up_202610', StripeLookupkey[]>;
|
|
121
121
|
export interface SubscriptionPrice {
|
|
122
122
|
currency: string;
|
|
123
123
|
amount: number;
|
|
124
124
|
}
|
|
125
|
-
export type SubscriptionDeviceFrom =
|
|
126
|
-
export type SubscriptionStatus =
|
|
127
|
-
export type UserAccessType =
|
|
125
|
+
export type SubscriptionDeviceFrom = 'web' | 'mobile';
|
|
126
|
+
export type SubscriptionStatus = 'active' | 'freeTrial' | 'expired' | 'unsubscribed';
|
|
127
|
+
export type UserAccessType = 'alpha' | 'early' | 'beta' | 'basic' | 'internal' | 'free';
|
|
128
128
|
export interface FreeTrial {
|
|
129
129
|
startDate: string;
|
|
130
130
|
endDate: string;
|
|
@@ -142,7 +142,7 @@ export interface CalendarNotification {
|
|
|
142
142
|
enabled: boolean;
|
|
143
143
|
remindTimeBefore: CalendarNotificationBefore;
|
|
144
144
|
}
|
|
145
|
-
export type CalendarNotificationBefore =
|
|
145
|
+
export type CalendarNotificationBefore = '5m' | '15m' | '30m' | '1h';
|
|
146
146
|
export interface UserConnectedDevice {
|
|
147
147
|
deviceName: string;
|
|
148
148
|
terraUserId: string;
|
package/dist/models/User.js
CHANGED
|
@@ -2,28 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stripeLookupKeySet = void 0;
|
|
4
4
|
exports.stripeLookupKeySet = {
|
|
5
|
-
beta: [
|
|
6
|
-
"beta_monthly_staging",
|
|
7
|
-
"beta_yearly_staging",
|
|
8
|
-
"beta_monthly_prod",
|
|
9
|
-
"beta_yearly_prod",
|
|
10
|
-
],
|
|
5
|
+
beta: ['beta_monthly_staging', 'beta_yearly_staging', 'beta_monthly_prod', 'beta_yearly_prod'],
|
|
11
6
|
basic: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
'basic_monthly_staging',
|
|
8
|
+
'basic_yearly_staging',
|
|
9
|
+
'basic_lifetime_staging',
|
|
15
10
|
//"basic_weekly_staging", //Remove weekly plan as of 2025-11-06 https://www.notion.so/demind-inc/Paywall-Monthly-no-trial-vs-Yearly-trial-29d7c97113e680118193e3fd28acf3ab
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
'basic_monthly_prod',
|
|
12
|
+
'basic_yearly_prod',
|
|
13
|
+
'basic_lifetime_prod',
|
|
19
14
|
//"basic_weekly_prod",
|
|
20
15
|
],
|
|
21
16
|
basic_price_up_202512: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
'basic_monthly_price_up_202512_staging',
|
|
18
|
+
'basic_yearly_price_up_202512_staging',
|
|
19
|
+
'basic_lifetime_staging',
|
|
20
|
+
'basic_monthly_price_up_202512_prod',
|
|
21
|
+
'basic_yearly_price_up_202512_prod',
|
|
22
|
+
'basic_lifetime_prod',
|
|
23
|
+
],
|
|
24
|
+
basic_price_up_202610: [
|
|
25
|
+
'basic_monthly_price_up_202610_staging',
|
|
26
|
+
'basic_yearly_price_up_202512_staging',
|
|
27
|
+
'basic_lifetime_staging',
|
|
28
|
+
'basic_monthly_price_up_202610_prod',
|
|
29
|
+
'basic_yearly_price_up_202512_prod',
|
|
30
|
+
'basic_lifetime_prod',
|
|
28
31
|
],
|
|
29
32
|
};
|
|
@@ -26,6 +26,7 @@ export interface FeatureFlags {
|
|
|
26
26
|
FF_ai_scheduler_adjust_v2?: boolean;
|
|
27
27
|
FF_paywall_202602_ab_test?: boolean;
|
|
28
28
|
FF_lifestack_v3?: boolean;
|
|
29
|
+
FF_lifestack_v4?: boolean;
|
|
29
30
|
FF_native_health_sdk?: boolean;
|
|
30
31
|
FF_promo_code_hide?: boolean;
|
|
31
32
|
team_plan_beta_users?: {
|
package/lib/models/User.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DocumentReference } from
|
|
2
|
-
import { Chronotype, PeaksDipsPhase } from
|
|
3
|
-
import { DeviceConnectedFrom } from
|
|
1
|
+
import { DocumentReference } from '@google-cloud/firestore';
|
|
2
|
+
import { Chronotype, PeaksDipsPhase } from '../types';
|
|
3
|
+
import { DeviceConnectedFrom } from './DeviceGroup';
|
|
4
4
|
|
|
5
5
|
export interface User {
|
|
6
6
|
userId: string;
|
|
@@ -91,8 +91,8 @@ export interface OnboardingStatus {
|
|
|
91
91
|
tutorial?: OnboardingStatusOption; // @deprecated
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export type OnboardingStatusOption =
|
|
95
|
-
export type AuthProvider =
|
|
94
|
+
export type OnboardingStatusOption = 'notAnswered' | 'answered' | 'skipped';
|
|
95
|
+
export type AuthProvider = 'google' | 'apple';
|
|
96
96
|
|
|
97
97
|
export interface Subscription {
|
|
98
98
|
productId: string;
|
|
@@ -116,11 +116,7 @@ export interface Subscription {
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
export type SubscriptionRecurring =
|
|
120
|
-
| "MONTHLY"
|
|
121
|
-
| "ANNUAL"
|
|
122
|
-
| "WEEKLY"
|
|
123
|
-
| "LIFETIME";
|
|
119
|
+
export type SubscriptionRecurring = 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'LIFETIME';
|
|
124
120
|
|
|
125
121
|
export interface GrantSubscription {
|
|
126
122
|
productId: string;
|
|
@@ -135,50 +131,55 @@ export interface ConvertedReferralCampaign {
|
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
export type StripeLookupkey =
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
134
|
+
| 'beta_monthly_staging'
|
|
135
|
+
| 'beta_yearly_staging'
|
|
136
|
+
| 'basic_monthly_staging'
|
|
137
|
+
| 'basic_yearly_staging'
|
|
138
|
+
| 'basic_lifetime_staging'
|
|
139
|
+
| 'basic_weekly_staging'
|
|
140
|
+
| 'beta_monthly_prod'
|
|
141
|
+
| 'beta_yearly_prod'
|
|
142
|
+
| 'basic_monthly_prod'
|
|
143
|
+
| 'basic_yearly_prod'
|
|
144
|
+
| 'basic_weekly_prod'
|
|
145
|
+
| 'basic_lifetime_prod'
|
|
146
|
+
| 'basic_monthly_price_up_202512_staging'
|
|
147
|
+
| 'basic_yearly_price_up_202512_staging'
|
|
148
|
+
| 'basic_monthly_price_up_202512_prod'
|
|
149
|
+
| 'basic_yearly_price_up_202512_prod'
|
|
150
|
+
| 'basic_monthly_price_up_202610_staging'
|
|
151
|
+
| 'basic_monthly_price_up_202610_prod';
|
|
154
152
|
|
|
155
153
|
export const stripeLookupKeySet: Record<
|
|
156
|
-
|
|
154
|
+
'beta' | 'basic' | 'basic_price_up_202512' | 'basic_price_up_202610',
|
|
157
155
|
StripeLookupkey[]
|
|
158
156
|
> = {
|
|
159
|
-
beta: [
|
|
160
|
-
"beta_monthly_staging",
|
|
161
|
-
"beta_yearly_staging",
|
|
162
|
-
"beta_monthly_prod",
|
|
163
|
-
"beta_yearly_prod",
|
|
164
|
-
],
|
|
157
|
+
beta: ['beta_monthly_staging', 'beta_yearly_staging', 'beta_monthly_prod', 'beta_yearly_prod'],
|
|
165
158
|
basic: [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
159
|
+
'basic_monthly_staging',
|
|
160
|
+
'basic_yearly_staging',
|
|
161
|
+
'basic_lifetime_staging',
|
|
169
162
|
//"basic_weekly_staging", //Remove weekly plan as of 2025-11-06 https://www.notion.so/demind-inc/Paywall-Monthly-no-trial-vs-Yearly-trial-29d7c97113e680118193e3fd28acf3ab
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
'basic_monthly_prod',
|
|
164
|
+
'basic_yearly_prod',
|
|
165
|
+
'basic_lifetime_prod',
|
|
173
166
|
//"basic_weekly_prod",
|
|
174
167
|
],
|
|
175
168
|
basic_price_up_202512: [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
169
|
+
'basic_monthly_price_up_202512_staging',
|
|
170
|
+
'basic_yearly_price_up_202512_staging',
|
|
171
|
+
'basic_lifetime_staging',
|
|
172
|
+
'basic_monthly_price_up_202512_prod',
|
|
173
|
+
'basic_yearly_price_up_202512_prod',
|
|
174
|
+
'basic_lifetime_prod',
|
|
175
|
+
],
|
|
176
|
+
basic_price_up_202610: [
|
|
177
|
+
'basic_monthly_price_up_202610_staging',
|
|
178
|
+
'basic_yearly_price_up_202512_staging',
|
|
179
|
+
'basic_lifetime_staging',
|
|
180
|
+
'basic_monthly_price_up_202610_prod',
|
|
181
|
+
'basic_yearly_price_up_202512_prod',
|
|
182
|
+
'basic_lifetime_prod',
|
|
182
183
|
],
|
|
183
184
|
};
|
|
184
185
|
|
|
@@ -187,21 +188,11 @@ export interface SubscriptionPrice {
|
|
|
187
188
|
amount: number;
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
export type SubscriptionDeviceFrom =
|
|
191
|
+
export type SubscriptionDeviceFrom = 'web' | 'mobile';
|
|
191
192
|
|
|
192
|
-
export type SubscriptionStatus =
|
|
193
|
-
| "active"
|
|
194
|
-
| "freeTrial"
|
|
195
|
-
| "expired"
|
|
196
|
-
| "unsubscribed";
|
|
193
|
+
export type SubscriptionStatus = 'active' | 'freeTrial' | 'expired' | 'unsubscribed';
|
|
197
194
|
|
|
198
|
-
export type UserAccessType =
|
|
199
|
-
| "alpha"
|
|
200
|
-
| "early"
|
|
201
|
-
| "beta"
|
|
202
|
-
| "basic"
|
|
203
|
-
| "internal"
|
|
204
|
-
| "free";
|
|
195
|
+
export type UserAccessType = 'alpha' | 'early' | 'beta' | 'basic' | 'internal' | 'free';
|
|
205
196
|
|
|
206
197
|
export interface FreeTrial {
|
|
207
198
|
startDate: string;
|
|
@@ -223,7 +214,7 @@ export interface CalendarNotification {
|
|
|
223
214
|
remindTimeBefore: CalendarNotificationBefore;
|
|
224
215
|
}
|
|
225
216
|
|
|
226
|
-
export type CalendarNotificationBefore =
|
|
217
|
+
export type CalendarNotificationBefore = '5m' | '15m' | '30m' | '1h';
|
|
227
218
|
|
|
228
219
|
export interface UserConnectedDevice {
|
|
229
220
|
deviceName: string;
|