@beorchid-llc/thrivo-contracts 0.1.0 → 0.2.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.
- package/dist/users.d.ts +249 -9
- package/dist/users.d.ts.map +1 -1
- package/dist/users.js +40 -1
- package/dist/users.js.map +1 -1
- package/package.json +1 -1
package/dist/users.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const goalSchema: z.ZodEnum<["lose", "maintain", "gain"]>;
|
|
3
|
-
export declare const sexSchema: z.ZodEnum<["male", "female"]>;
|
|
3
|
+
export declare const sexSchema: z.ZodEnum<["male", "female", "prefer_not_to_say"]>;
|
|
4
4
|
export declare const tierSchema: z.ZodEnum<["free", "premium"]>;
|
|
5
|
+
export declare const accountStatusSchema: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
6
|
+
export declare const activityLevelSchema: z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>;
|
|
7
|
+
export declare const activationIntentSchema: z.ZodEnum<["skip", "start_free_trial", "complete"]>;
|
|
5
8
|
export declare const userProfileSchema: z.ZodObject<{
|
|
6
9
|
id: z.ZodString;
|
|
7
10
|
email: z.ZodString;
|
|
8
11
|
name: z.ZodString;
|
|
9
12
|
goal: z.ZodNullable<z.ZodEnum<["lose", "maintain", "gain"]>>;
|
|
10
|
-
sex: z.ZodNullable<z.ZodEnum<["male", "female"]>>;
|
|
13
|
+
sex: z.ZodNullable<z.ZodEnum<["male", "female", "prefer_not_to_say"]>>;
|
|
11
14
|
age: z.ZodNullable<z.ZodNumber>;
|
|
12
15
|
heightCm: z.ZodNullable<z.ZodString>;
|
|
13
16
|
weightKg: z.ZodNullable<z.ZodString>;
|
|
@@ -17,17 +20,22 @@ export declare const userProfileSchema: z.ZodObject<{
|
|
|
17
20
|
targetProteinG: z.ZodNullable<z.ZodNumber>;
|
|
18
21
|
targetCarbsG: z.ZodNullable<z.ZodNumber>;
|
|
19
22
|
targetFatG: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
activityLevel: z.ZodNullable<z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>>;
|
|
24
|
+
manualDailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
20
25
|
notifyAt: z.ZodNullable<z.ZodString>;
|
|
21
26
|
timezone: z.ZodNullable<z.ZodString>;
|
|
22
27
|
tier: z.ZodEnum<["free", "premium"]>;
|
|
28
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
29
|
+
trialEndsAt: z.ZodNullable<z.ZodDate>;
|
|
23
30
|
onboardingStep: z.ZodNumber;
|
|
31
|
+
isOnboarded: z.ZodBoolean;
|
|
24
32
|
createdAt: z.ZodDate;
|
|
25
33
|
}, "strip", z.ZodTypeAny, {
|
|
26
34
|
id: string;
|
|
27
35
|
email: string;
|
|
28
36
|
name: string;
|
|
29
37
|
goal: "lose" | "maintain" | "gain" | null;
|
|
30
|
-
sex: "male" | "female" | null;
|
|
38
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
31
39
|
age: number | null;
|
|
32
40
|
heightCm: string | null;
|
|
33
41
|
weightKg: string | null;
|
|
@@ -37,17 +45,22 @@ export declare const userProfileSchema: z.ZodObject<{
|
|
|
37
45
|
targetProteinG: number | null;
|
|
38
46
|
targetCarbsG: number | null;
|
|
39
47
|
targetFatG: number | null;
|
|
48
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
49
|
+
manualDailyTargetKcal: number | null;
|
|
40
50
|
notifyAt: string | null;
|
|
41
51
|
timezone: string | null;
|
|
42
52
|
tier: "free" | "premium";
|
|
53
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
54
|
+
trialEndsAt: Date | null;
|
|
43
55
|
onboardingStep: number;
|
|
56
|
+
isOnboarded: boolean;
|
|
44
57
|
createdAt: Date;
|
|
45
58
|
}, {
|
|
46
59
|
id: string;
|
|
47
60
|
email: string;
|
|
48
61
|
name: string;
|
|
49
62
|
goal: "lose" | "maintain" | "gain" | null;
|
|
50
|
-
sex: "male" | "female" | null;
|
|
63
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
51
64
|
age: number | null;
|
|
52
65
|
heightCm: string | null;
|
|
53
66
|
weightKg: string | null;
|
|
@@ -57,10 +70,15 @@ export declare const userProfileSchema: z.ZodObject<{
|
|
|
57
70
|
targetProteinG: number | null;
|
|
58
71
|
targetCarbsG: number | null;
|
|
59
72
|
targetFatG: number | null;
|
|
73
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
74
|
+
manualDailyTargetKcal: number | null;
|
|
60
75
|
notifyAt: string | null;
|
|
61
76
|
timezone: string | null;
|
|
62
77
|
tier: "free" | "premium";
|
|
78
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
79
|
+
trialEndsAt: Date | null;
|
|
63
80
|
onboardingStep: number;
|
|
81
|
+
isOnboarded: boolean;
|
|
64
82
|
createdAt: Date;
|
|
65
83
|
}>;
|
|
66
84
|
export type UserProfile = z.infer<typeof userProfileSchema>;
|
|
@@ -70,7 +88,7 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
70
88
|
email: z.ZodString;
|
|
71
89
|
name: z.ZodString;
|
|
72
90
|
goal: z.ZodNullable<z.ZodEnum<["lose", "maintain", "gain"]>>;
|
|
73
|
-
sex: z.ZodNullable<z.ZodEnum<["male", "female"]>>;
|
|
91
|
+
sex: z.ZodNullable<z.ZodEnum<["male", "female", "prefer_not_to_say"]>>;
|
|
74
92
|
age: z.ZodNullable<z.ZodNumber>;
|
|
75
93
|
heightCm: z.ZodNullable<z.ZodString>;
|
|
76
94
|
weightKg: z.ZodNullable<z.ZodString>;
|
|
@@ -80,17 +98,22 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
80
98
|
targetProteinG: z.ZodNullable<z.ZodNumber>;
|
|
81
99
|
targetCarbsG: z.ZodNullable<z.ZodNumber>;
|
|
82
100
|
targetFatG: z.ZodNullable<z.ZodNumber>;
|
|
101
|
+
activityLevel: z.ZodNullable<z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>>;
|
|
102
|
+
manualDailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
83
103
|
notifyAt: z.ZodNullable<z.ZodString>;
|
|
84
104
|
timezone: z.ZodNullable<z.ZodString>;
|
|
85
105
|
tier: z.ZodEnum<["free", "premium"]>;
|
|
106
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
107
|
+
trialEndsAt: z.ZodNullable<z.ZodDate>;
|
|
86
108
|
onboardingStep: z.ZodNumber;
|
|
109
|
+
isOnboarded: z.ZodBoolean;
|
|
87
110
|
createdAt: z.ZodDate;
|
|
88
111
|
}, "strip", z.ZodTypeAny, {
|
|
89
112
|
id: string;
|
|
90
113
|
email: string;
|
|
91
114
|
name: string;
|
|
92
115
|
goal: "lose" | "maintain" | "gain" | null;
|
|
93
|
-
sex: "male" | "female" | null;
|
|
116
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
94
117
|
age: number | null;
|
|
95
118
|
heightCm: string | null;
|
|
96
119
|
weightKg: string | null;
|
|
@@ -100,17 +123,22 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
100
123
|
targetProteinG: number | null;
|
|
101
124
|
targetCarbsG: number | null;
|
|
102
125
|
targetFatG: number | null;
|
|
126
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
127
|
+
manualDailyTargetKcal: number | null;
|
|
103
128
|
notifyAt: string | null;
|
|
104
129
|
timezone: string | null;
|
|
105
130
|
tier: "free" | "premium";
|
|
131
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
132
|
+
trialEndsAt: Date | null;
|
|
106
133
|
onboardingStep: number;
|
|
134
|
+
isOnboarded: boolean;
|
|
107
135
|
createdAt: Date;
|
|
108
136
|
}, {
|
|
109
137
|
id: string;
|
|
110
138
|
email: string;
|
|
111
139
|
name: string;
|
|
112
140
|
goal: "lose" | "maintain" | "gain" | null;
|
|
113
|
-
sex: "male" | "female" | null;
|
|
141
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
114
142
|
age: number | null;
|
|
115
143
|
heightCm: string | null;
|
|
116
144
|
weightKg: string | null;
|
|
@@ -120,10 +148,15 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
120
148
|
targetProteinG: number | null;
|
|
121
149
|
targetCarbsG: number | null;
|
|
122
150
|
targetFatG: number | null;
|
|
151
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
152
|
+
manualDailyTargetKcal: number | null;
|
|
123
153
|
notifyAt: string | null;
|
|
124
154
|
timezone: string | null;
|
|
125
155
|
tier: "free" | "premium";
|
|
156
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
157
|
+
trialEndsAt: Date | null;
|
|
126
158
|
onboardingStep: number;
|
|
159
|
+
isOnboarded: boolean;
|
|
127
160
|
createdAt: Date;
|
|
128
161
|
}>;
|
|
129
162
|
meta: z.ZodOptional<z.ZodObject<{
|
|
@@ -139,7 +172,7 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
139
172
|
email: string;
|
|
140
173
|
name: string;
|
|
141
174
|
goal: "lose" | "maintain" | "gain" | null;
|
|
142
|
-
sex: "male" | "female" | null;
|
|
175
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
143
176
|
age: number | null;
|
|
144
177
|
heightCm: string | null;
|
|
145
178
|
weightKg: string | null;
|
|
@@ -149,10 +182,15 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
149
182
|
targetProteinG: number | null;
|
|
150
183
|
targetCarbsG: number | null;
|
|
151
184
|
targetFatG: number | null;
|
|
185
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
186
|
+
manualDailyTargetKcal: number | null;
|
|
152
187
|
notifyAt: string | null;
|
|
153
188
|
timezone: string | null;
|
|
154
189
|
tier: "free" | "premium";
|
|
190
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
191
|
+
trialEndsAt: Date | null;
|
|
155
192
|
onboardingStep: number;
|
|
193
|
+
isOnboarded: boolean;
|
|
156
194
|
createdAt: Date;
|
|
157
195
|
};
|
|
158
196
|
meta?: z.objectOutputType<{
|
|
@@ -164,7 +202,7 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
164
202
|
email: string;
|
|
165
203
|
name: string;
|
|
166
204
|
goal: "lose" | "maintain" | "gain" | null;
|
|
167
|
-
sex: "male" | "female" | null;
|
|
205
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
168
206
|
age: number | null;
|
|
169
207
|
heightCm: string | null;
|
|
170
208
|
weightKg: string | null;
|
|
@@ -174,10 +212,15 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
174
212
|
targetProteinG: number | null;
|
|
175
213
|
targetCarbsG: number | null;
|
|
176
214
|
targetFatG: number | null;
|
|
215
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
216
|
+
manualDailyTargetKcal: number | null;
|
|
177
217
|
notifyAt: string | null;
|
|
178
218
|
timezone: string | null;
|
|
179
219
|
tier: "free" | "premium";
|
|
220
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
221
|
+
trialEndsAt: Date | null;
|
|
180
222
|
onboardingStep: number;
|
|
223
|
+
isOnboarded: boolean;
|
|
181
224
|
createdAt: Date;
|
|
182
225
|
};
|
|
183
226
|
meta?: z.objectInputType<{
|
|
@@ -185,6 +228,198 @@ export declare const getMeResponseSchema: z.ZodObject<{
|
|
|
185
228
|
}, z.ZodUnknown, "strip"> | undefined;
|
|
186
229
|
}>;
|
|
187
230
|
export type GetMeResponse = z.infer<typeof getMeResponseSchema>;
|
|
231
|
+
export declare const updateProfilePayloadSchema: z.ZodObject<{
|
|
232
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
233
|
+
goal: z.ZodOptional<z.ZodEnum<["lose", "maintain", "gain"]>>;
|
|
234
|
+
currentWeightKg: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
targetWeightKg: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
heightCm: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
ageYears: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
sex: z.ZodOptional<z.ZodEnum<["male", "female", "prefer_not_to_say"]>>;
|
|
239
|
+
activityLevel: z.ZodOptional<z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>>;
|
|
240
|
+
unitSystem: z.ZodOptional<z.ZodEnum<["metric", "imperial"]>>;
|
|
241
|
+
manualDailyTargetKcal: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
notifyAt: z.ZodOptional<z.ZodString>;
|
|
243
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
244
|
+
onboardingStep: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
activationIntent: z.ZodOptional<z.ZodEnum<["skip", "start_free_trial", "complete"]>>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
goal?: "lose" | "maintain" | "gain" | undefined;
|
|
248
|
+
sex?: "male" | "female" | "prefer_not_to_say" | undefined;
|
|
249
|
+
heightCm?: number | undefined;
|
|
250
|
+
targetWeightKg?: number | undefined;
|
|
251
|
+
activityLevel?: "sedentary" | "light" | "moderate" | "active" | "very_active" | undefined;
|
|
252
|
+
manualDailyTargetKcal?: number | undefined;
|
|
253
|
+
notifyAt?: string | undefined;
|
|
254
|
+
timezone?: string | undefined;
|
|
255
|
+
onboardingStep?: number | undefined;
|
|
256
|
+
firstName?: string | undefined;
|
|
257
|
+
currentWeightKg?: number | undefined;
|
|
258
|
+
ageYears?: number | undefined;
|
|
259
|
+
unitSystem?: "metric" | "imperial" | undefined;
|
|
260
|
+
activationIntent?: "skip" | "start_free_trial" | "complete" | undefined;
|
|
261
|
+
}, {
|
|
262
|
+
goal?: "lose" | "maintain" | "gain" | undefined;
|
|
263
|
+
sex?: "male" | "female" | "prefer_not_to_say" | undefined;
|
|
264
|
+
heightCm?: number | undefined;
|
|
265
|
+
targetWeightKg?: number | undefined;
|
|
266
|
+
activityLevel?: "sedentary" | "light" | "moderate" | "active" | "very_active" | undefined;
|
|
267
|
+
manualDailyTargetKcal?: number | undefined;
|
|
268
|
+
notifyAt?: string | undefined;
|
|
269
|
+
timezone?: string | undefined;
|
|
270
|
+
onboardingStep?: number | undefined;
|
|
271
|
+
firstName?: string | undefined;
|
|
272
|
+
currentWeightKg?: number | undefined;
|
|
273
|
+
ageYears?: number | undefined;
|
|
274
|
+
unitSystem?: "metric" | "imperial" | undefined;
|
|
275
|
+
activationIntent?: "skip" | "start_free_trial" | "complete" | undefined;
|
|
276
|
+
}>;
|
|
277
|
+
export type UpdateProfilePayload = z.infer<typeof updateProfilePayloadSchema>;
|
|
278
|
+
export declare const updateProfileResponseSchema: z.ZodObject<{
|
|
279
|
+
data: z.ZodObject<{
|
|
280
|
+
id: z.ZodString;
|
|
281
|
+
email: z.ZodString;
|
|
282
|
+
name: z.ZodString;
|
|
283
|
+
goal: z.ZodNullable<z.ZodEnum<["lose", "maintain", "gain"]>>;
|
|
284
|
+
sex: z.ZodNullable<z.ZodEnum<["male", "female", "prefer_not_to_say"]>>;
|
|
285
|
+
age: z.ZodNullable<z.ZodNumber>;
|
|
286
|
+
heightCm: z.ZodNullable<z.ZodString>;
|
|
287
|
+
weightKg: z.ZodNullable<z.ZodString>;
|
|
288
|
+
targetWeightKg: z.ZodNullable<z.ZodString>;
|
|
289
|
+
tdeeKcal: z.ZodNullable<z.ZodNumber>;
|
|
290
|
+
dailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
291
|
+
targetProteinG: z.ZodNullable<z.ZodNumber>;
|
|
292
|
+
targetCarbsG: z.ZodNullable<z.ZodNumber>;
|
|
293
|
+
targetFatG: z.ZodNullable<z.ZodNumber>;
|
|
294
|
+
activityLevel: z.ZodNullable<z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>>;
|
|
295
|
+
manualDailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
296
|
+
notifyAt: z.ZodNullable<z.ZodString>;
|
|
297
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
298
|
+
tier: z.ZodEnum<["free", "premium"]>;
|
|
299
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
300
|
+
trialEndsAt: z.ZodNullable<z.ZodDate>;
|
|
301
|
+
onboardingStep: z.ZodNumber;
|
|
302
|
+
isOnboarded: z.ZodBoolean;
|
|
303
|
+
createdAt: z.ZodDate;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
id: string;
|
|
306
|
+
email: string;
|
|
307
|
+
name: string;
|
|
308
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
309
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
310
|
+
age: number | null;
|
|
311
|
+
heightCm: string | null;
|
|
312
|
+
weightKg: string | null;
|
|
313
|
+
targetWeightKg: string | null;
|
|
314
|
+
tdeeKcal: number | null;
|
|
315
|
+
dailyTargetKcal: number | null;
|
|
316
|
+
targetProteinG: number | null;
|
|
317
|
+
targetCarbsG: number | null;
|
|
318
|
+
targetFatG: number | null;
|
|
319
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
320
|
+
manualDailyTargetKcal: number | null;
|
|
321
|
+
notifyAt: string | null;
|
|
322
|
+
timezone: string | null;
|
|
323
|
+
tier: "free" | "premium";
|
|
324
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
325
|
+
trialEndsAt: Date | null;
|
|
326
|
+
onboardingStep: number;
|
|
327
|
+
isOnboarded: boolean;
|
|
328
|
+
createdAt: Date;
|
|
329
|
+
}, {
|
|
330
|
+
id: string;
|
|
331
|
+
email: string;
|
|
332
|
+
name: string;
|
|
333
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
334
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
335
|
+
age: number | null;
|
|
336
|
+
heightCm: string | null;
|
|
337
|
+
weightKg: string | null;
|
|
338
|
+
targetWeightKg: string | null;
|
|
339
|
+
tdeeKcal: number | null;
|
|
340
|
+
dailyTargetKcal: number | null;
|
|
341
|
+
targetProteinG: number | null;
|
|
342
|
+
targetCarbsG: number | null;
|
|
343
|
+
targetFatG: number | null;
|
|
344
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
345
|
+
manualDailyTargetKcal: number | null;
|
|
346
|
+
notifyAt: string | null;
|
|
347
|
+
timezone: string | null;
|
|
348
|
+
tier: "free" | "premium";
|
|
349
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
350
|
+
trialEndsAt: Date | null;
|
|
351
|
+
onboardingStep: number;
|
|
352
|
+
isOnboarded: boolean;
|
|
353
|
+
createdAt: Date;
|
|
354
|
+
}>;
|
|
355
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
357
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
358
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
360
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
361
|
+
}, z.ZodUnknown, "strip">>>;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
363
|
+
data: {
|
|
364
|
+
id: string;
|
|
365
|
+
email: string;
|
|
366
|
+
name: string;
|
|
367
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
368
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
369
|
+
age: number | null;
|
|
370
|
+
heightCm: string | null;
|
|
371
|
+
weightKg: string | null;
|
|
372
|
+
targetWeightKg: string | null;
|
|
373
|
+
tdeeKcal: number | null;
|
|
374
|
+
dailyTargetKcal: number | null;
|
|
375
|
+
targetProteinG: number | null;
|
|
376
|
+
targetCarbsG: number | null;
|
|
377
|
+
targetFatG: number | null;
|
|
378
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
379
|
+
manualDailyTargetKcal: number | null;
|
|
380
|
+
notifyAt: string | null;
|
|
381
|
+
timezone: string | null;
|
|
382
|
+
tier: "free" | "premium";
|
|
383
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
384
|
+
trialEndsAt: Date | null;
|
|
385
|
+
onboardingStep: number;
|
|
386
|
+
isOnboarded: boolean;
|
|
387
|
+
createdAt: Date;
|
|
388
|
+
};
|
|
389
|
+
meta?: z.objectOutputType<{
|
|
390
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
391
|
+
}, z.ZodUnknown, "strip"> | undefined;
|
|
392
|
+
}, {
|
|
393
|
+
data: {
|
|
394
|
+
id: string;
|
|
395
|
+
email: string;
|
|
396
|
+
name: string;
|
|
397
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
398
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
399
|
+
age: number | null;
|
|
400
|
+
heightCm: string | null;
|
|
401
|
+
weightKg: string | null;
|
|
402
|
+
targetWeightKg: string | null;
|
|
403
|
+
tdeeKcal: number | null;
|
|
404
|
+
dailyTargetKcal: number | null;
|
|
405
|
+
targetProteinG: number | null;
|
|
406
|
+
targetCarbsG: number | null;
|
|
407
|
+
targetFatG: number | null;
|
|
408
|
+
activityLevel: "sedentary" | "light" | "moderate" | "active" | "very_active" | null;
|
|
409
|
+
manualDailyTargetKcal: number | null;
|
|
410
|
+
notifyAt: string | null;
|
|
411
|
+
timezone: string | null;
|
|
412
|
+
tier: "free" | "premium";
|
|
413
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
414
|
+
trialEndsAt: Date | null;
|
|
415
|
+
onboardingStep: number;
|
|
416
|
+
isOnboarded: boolean;
|
|
417
|
+
createdAt: Date;
|
|
418
|
+
};
|
|
419
|
+
meta?: z.objectInputType<{
|
|
420
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
421
|
+
}, z.ZodUnknown, "strip"> | undefined;
|
|
422
|
+
}>;
|
|
188
423
|
export declare const deleteMeResponseSchema: z.ZodNull;
|
|
189
424
|
export declare const userRoutes: {
|
|
190
425
|
getMe: {
|
|
@@ -192,6 +427,11 @@ export declare const userRoutes: {
|
|
|
192
427
|
path: "/api/v1/users/me";
|
|
193
428
|
auth: "user";
|
|
194
429
|
};
|
|
430
|
+
updateProfile: {
|
|
431
|
+
method: "PATCH";
|
|
432
|
+
path: "/api/v1/users/me/profile";
|
|
433
|
+
auth: "user";
|
|
434
|
+
};
|
|
195
435
|
deleteMe: {
|
|
196
436
|
method: "DELETE";
|
|
197
437
|
path: "/api/v1/users/me";
|
package/dist/users.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU,yCAAuC,CAAC;AAC/D,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU,yCAAuC,CAAC;AAC/D,eAAO,MAAM,SAAS,oDAAkD,CAAC;AACzE,eAAO,MAAM,UAAU,gCAA8B,CAAC;AACtD,eAAO,MAAM,mBAAmB,2DAAyD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,wEAM9B,CAAC;AACH,eAAO,MAAM,sBAAsB,qDAAmD,CAAC;AAEvF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC;AAE/E,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;CAgBkB,CAAC"}
|
package/dist/users.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { apiSuccessSchema } from "./common";
|
|
3
3
|
export const goalSchema = z.enum(["lose", "maintain", "gain"]);
|
|
4
|
-
export const sexSchema = z.enum(["male", "female"]);
|
|
4
|
+
export const sexSchema = z.enum(["male", "female", "prefer_not_to_say"]);
|
|
5
5
|
export const tierSchema = z.enum(["free", "premium"]);
|
|
6
|
+
export const accountStatusSchema = z.enum(["dormant", "free_trial", "free_plan", "paid"]);
|
|
7
|
+
export const activityLevelSchema = z.enum([
|
|
8
|
+
"sedentary",
|
|
9
|
+
"light",
|
|
10
|
+
"moderate",
|
|
11
|
+
"active",
|
|
12
|
+
"very_active",
|
|
13
|
+
]);
|
|
14
|
+
export const activationIntentSchema = z.enum(["skip", "start_free_trial", "complete"]);
|
|
6
15
|
export const userProfileSchema = z.object({
|
|
7
16
|
id: z.string().uuid(),
|
|
8
17
|
email: z.string().email(),
|
|
@@ -18,13 +27,38 @@ export const userProfileSchema = z.object({
|
|
|
18
27
|
targetProteinG: z.number().int().nullable(),
|
|
19
28
|
targetCarbsG: z.number().int().nullable(),
|
|
20
29
|
targetFatG: z.number().int().nullable(),
|
|
30
|
+
activityLevel: activityLevelSchema.nullable(),
|
|
31
|
+
manualDailyTargetKcal: z.number().int().nullable(),
|
|
21
32
|
notifyAt: z.string().nullable(),
|
|
22
33
|
timezone: z.string().nullable(),
|
|
23
34
|
tier: tierSchema,
|
|
35
|
+
accountStatus: accountStatusSchema,
|
|
36
|
+
trialEndsAt: z.coerce.date().nullable(),
|
|
24
37
|
onboardingStep: z.number().int(),
|
|
38
|
+
isOnboarded: z.boolean(),
|
|
25
39
|
createdAt: z.coerce.date(),
|
|
26
40
|
});
|
|
27
41
|
export const getMeResponseSchema = apiSuccessSchema(userProfileSchema);
|
|
42
|
+
export const updateProfilePayloadSchema = z.object({
|
|
43
|
+
firstName: z.string().trim().min(1).optional(),
|
|
44
|
+
goal: goalSchema.optional(),
|
|
45
|
+
currentWeightKg: z.number().positive().optional(),
|
|
46
|
+
targetWeightKg: z.number().positive().optional(),
|
|
47
|
+
heightCm: z.number().positive().optional(),
|
|
48
|
+
ageYears: z.number().int().min(13).optional(),
|
|
49
|
+
sex: sexSchema.optional(),
|
|
50
|
+
activityLevel: activityLevelSchema.optional(),
|
|
51
|
+
unitSystem: z.enum(["metric", "imperial"]).optional(),
|
|
52
|
+
manualDailyTargetKcal: z.number().int().positive().optional(),
|
|
53
|
+
notifyAt: z
|
|
54
|
+
.string()
|
|
55
|
+
.regex(/^\d{2}:\d{2}(:\d{2})?$/)
|
|
56
|
+
.optional(),
|
|
57
|
+
timezone: z.string().min(1).optional(),
|
|
58
|
+
onboardingStep: z.number().int().min(1).optional(),
|
|
59
|
+
activationIntent: activationIntentSchema.optional(),
|
|
60
|
+
});
|
|
61
|
+
export const updateProfileResponseSchema = apiSuccessSchema(userProfileSchema);
|
|
28
62
|
export const deleteMeResponseSchema = z.null();
|
|
29
63
|
export const userRoutes = {
|
|
30
64
|
getMe: {
|
|
@@ -32,6 +66,11 @@ export const userRoutes = {
|
|
|
32
66
|
path: "/api/v1/users/me",
|
|
33
67
|
auth: "user",
|
|
34
68
|
},
|
|
69
|
+
updateProfile: {
|
|
70
|
+
method: "PATCH",
|
|
71
|
+
path: "/api/v1/users/me/profile",
|
|
72
|
+
auth: "user",
|
|
73
|
+
},
|
|
35
74
|
deleteMe: {
|
|
36
75
|
method: "DELETE",
|
|
37
76
|
path: "/api/v1/users/me",
|
package/dist/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../src/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,UAAU,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"users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