@demind-inc/core 1.11.5 → 1.11.8
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/User.d.ts +12 -12
- package/dist/models/User.js +13 -18
- package/lib/models/User.ts +42 -59
- package/package.json +1 -1
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', 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,23 @@
|
|
|
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_202610_staging',
|
|
18
|
+
'basic_yearly_price_up_202512_staging',
|
|
19
|
+
'basic_lifetime_staging',
|
|
20
|
+
'basic_monthly_price_up_202610_prod',
|
|
21
|
+
'basic_yearly_price_up_202512_prod',
|
|
22
|
+
'basic_lifetime_prod',
|
|
28
23
|
],
|
|
29
24
|
};
|
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,47 @@ 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',
|
|
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_202610_staging',
|
|
170
|
+
'basic_yearly_price_up_202512_staging',
|
|
171
|
+
'basic_lifetime_staging',
|
|
172
|
+
'basic_monthly_price_up_202610_prod',
|
|
173
|
+
'basic_yearly_price_up_202512_prod',
|
|
174
|
+
'basic_lifetime_prod',
|
|
182
175
|
],
|
|
183
176
|
};
|
|
184
177
|
|
|
@@ -187,21 +180,11 @@ export interface SubscriptionPrice {
|
|
|
187
180
|
amount: number;
|
|
188
181
|
}
|
|
189
182
|
|
|
190
|
-
export type SubscriptionDeviceFrom =
|
|
183
|
+
export type SubscriptionDeviceFrom = 'web' | 'mobile';
|
|
191
184
|
|
|
192
|
-
export type SubscriptionStatus =
|
|
193
|
-
| "active"
|
|
194
|
-
| "freeTrial"
|
|
195
|
-
| "expired"
|
|
196
|
-
| "unsubscribed";
|
|
185
|
+
export type SubscriptionStatus = 'active' | 'freeTrial' | 'expired' | 'unsubscribed';
|
|
197
186
|
|
|
198
|
-
export type UserAccessType =
|
|
199
|
-
| "alpha"
|
|
200
|
-
| "early"
|
|
201
|
-
| "beta"
|
|
202
|
-
| "basic"
|
|
203
|
-
| "internal"
|
|
204
|
-
| "free";
|
|
187
|
+
export type UserAccessType = 'alpha' | 'early' | 'beta' | 'basic' | 'internal' | 'free';
|
|
205
188
|
|
|
206
189
|
export interface FreeTrial {
|
|
207
190
|
startDate: string;
|
|
@@ -223,7 +206,7 @@ export interface CalendarNotification {
|
|
|
223
206
|
remindTimeBefore: CalendarNotificationBefore;
|
|
224
207
|
}
|
|
225
208
|
|
|
226
|
-
export type CalendarNotificationBefore =
|
|
209
|
+
export type CalendarNotificationBefore = '5m' | '15m' | '30m' | '1h';
|
|
227
210
|
|
|
228
211
|
export interface UserConnectedDevice {
|
|
229
212
|
deviceName: string;
|