@beorchid-llc/thrivo-contracts 0.5.4 → 0.5.5
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/auth.d.ts +40 -3
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +30 -3
- package/dist/auth.js.map +1 -1
- package/dist/common.d.ts +1 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +1 -0
- package/dist/common.js.map +1 -1
- package/dist/dashboard.d.ts +366 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +46 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/foods.d.ts +891 -0
- package/dist/foods.d.ts.map +1 -0
- package/dist/foods.js +67 -0
- package/dist/foods.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/metrics.d.ts +130 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +29 -0
- package/dist/metrics.js.map +1 -0
- package/dist/settings.d.ts +749 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +94 -0
- package/dist/settings.js.map +1 -0
- package/dist/subscriptions.d.ts +290 -0
- package/dist/subscriptions.d.ts.map +1 -0
- package/dist/subscriptions.js +63 -0
- package/dist/subscriptions.js.map +1 -0
- package/package.json +22 -1
package/dist/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/** Token pair returned to a client after a successful auth flow (magic-link or Google OAuth). */
|
|
2
|
+
/** Token pair returned to a client after a successful auth flow (email OTP, magic-link, or Google OAuth). */
|
|
3
3
|
export declare const authSessionSchema: z.ZodObject<{
|
|
4
4
|
accessToken: z.ZodString;
|
|
5
5
|
refreshToken: z.ZodString;
|
|
@@ -14,7 +14,31 @@ export declare const authSessionSchema: z.ZodObject<{
|
|
|
14
14
|
refreshExpiresAt: string;
|
|
15
15
|
}>;
|
|
16
16
|
export type AuthSession = z.infer<typeof authSessionSchema>;
|
|
17
|
-
/** POST /auth/
|
|
17
|
+
/** POST /auth/otp/request payload */
|
|
18
|
+
export declare const otpRequestPayloadSchema: z.ZodObject<{
|
|
19
|
+
email: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
email: string;
|
|
22
|
+
}, {
|
|
23
|
+
email: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type OtpRequestPayload = z.infer<typeof otpRequestPayloadSchema>;
|
|
26
|
+
/** POST /auth/otp/verify payload */
|
|
27
|
+
export declare const otpVerifyPayloadSchema: z.ZodObject<{
|
|
28
|
+
email: z.ZodString;
|
|
29
|
+
code: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
code: string;
|
|
32
|
+
email: string;
|
|
33
|
+
}, {
|
|
34
|
+
code: string;
|
|
35
|
+
email: string;
|
|
36
|
+
}>;
|
|
37
|
+
export type OtpVerifyPayload = z.infer<typeof otpVerifyPayloadSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* POST /auth/magic-link/request payload
|
|
40
|
+
* @deprecated Magic-link auth remains API-supported but is hidden in mobile while the UX is revisited.
|
|
41
|
+
*/
|
|
18
42
|
export declare const magicLinkRequestPayloadSchema: z.ZodObject<{
|
|
19
43
|
email: z.ZodString;
|
|
20
44
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -23,7 +47,10 @@ export declare const magicLinkRequestPayloadSchema: z.ZodObject<{
|
|
|
23
47
|
email: string;
|
|
24
48
|
}>;
|
|
25
49
|
export type MagicLinkRequestPayload = z.infer<typeof magicLinkRequestPayloadSchema>;
|
|
26
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* POST /auth/magic-link/verify payload
|
|
52
|
+
* @deprecated Magic-link auth remains API-supported but is hidden in mobile while the UX is revisited.
|
|
53
|
+
*/
|
|
27
54
|
export declare const magicLinkVerifyPayloadSchema: z.ZodObject<{
|
|
28
55
|
token: z.ZodString;
|
|
29
56
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -93,6 +120,16 @@ export declare const userSessionResponseSchema: z.ZodObject<{
|
|
|
93
120
|
}>;
|
|
94
121
|
export type UserSessionResponse = z.infer<typeof userSessionResponseSchema>;
|
|
95
122
|
export declare const authRoutes: {
|
|
123
|
+
requestOtp: {
|
|
124
|
+
method: "POST";
|
|
125
|
+
path: "/api/v1/auth/otp/request";
|
|
126
|
+
auth: "public";
|
|
127
|
+
};
|
|
128
|
+
verifyOtp: {
|
|
129
|
+
method: "POST";
|
|
130
|
+
path: "/api/v1/auth/otp/verify";
|
|
131
|
+
auth: "public";
|
|
132
|
+
};
|
|
96
133
|
requestMagicLink: {
|
|
97
134
|
method: "POST";
|
|
98
135
|
path: "/api/v1/auth/magic-link/request";
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,qCAAqC;AACrC,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,oCAAoC;AACpC,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;EAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,qDAAqD;AACrD,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,kFAAkF;AAClF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2C,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CkB,CAAC"}
|
package/dist/auth.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { accountStatusSchema } from "./users";
|
|
3
|
-
/** Token pair returned to a client after a successful auth flow (magic-link or Google OAuth). */
|
|
3
|
+
/** Token pair returned to a client after a successful auth flow (email OTP, magic-link, or Google OAuth). */
|
|
4
4
|
export const authSessionSchema = z.object({
|
|
5
5
|
accessToken: z.string(),
|
|
6
6
|
refreshToken: z.string(),
|
|
7
7
|
refreshExpiresAt: z.string(), // ISO-8601
|
|
8
8
|
});
|
|
9
|
-
/** POST /auth/
|
|
9
|
+
/** POST /auth/otp/request payload */
|
|
10
|
+
export const otpRequestPayloadSchema = z.object({
|
|
11
|
+
email: z.string().email(),
|
|
12
|
+
});
|
|
13
|
+
/** POST /auth/otp/verify payload */
|
|
14
|
+
export const otpVerifyPayloadSchema = z.object({
|
|
15
|
+
email: z.string().email(),
|
|
16
|
+
code: z.string().regex(/^\d{6}$/),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* POST /auth/magic-link/request payload
|
|
20
|
+
* @deprecated Magic-link auth remains API-supported but is hidden in mobile while the UX is revisited.
|
|
21
|
+
*/
|
|
10
22
|
export const magicLinkRequestPayloadSchema = z.object({
|
|
11
23
|
email: z.string().email(),
|
|
12
24
|
});
|
|
13
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* POST /auth/magic-link/verify payload
|
|
27
|
+
* @deprecated Magic-link auth remains API-supported but is hidden in mobile while the UX is revisited.
|
|
28
|
+
*/
|
|
14
29
|
export const magicLinkVerifyPayloadSchema = z.object({
|
|
15
30
|
token: z.string().min(1),
|
|
16
31
|
});
|
|
@@ -27,11 +42,23 @@ export const userSessionSchema = z.object({
|
|
|
27
42
|
});
|
|
28
43
|
export const userSessionResponseSchema = z.object({ session: userSessionSchema });
|
|
29
44
|
export const authRoutes = {
|
|
45
|
+
requestOtp: {
|
|
46
|
+
method: "POST",
|
|
47
|
+
path: "/api/v1/auth/otp/request",
|
|
48
|
+
auth: "public",
|
|
49
|
+
},
|
|
50
|
+
verifyOtp: {
|
|
51
|
+
method: "POST",
|
|
52
|
+
path: "/api/v1/auth/otp/verify",
|
|
53
|
+
auth: "public",
|
|
54
|
+
},
|
|
55
|
+
// Deprecated: API remains available, but mobile no longer exposes this flow.
|
|
30
56
|
requestMagicLink: {
|
|
31
57
|
method: "POST",
|
|
32
58
|
path: "/api/v1/auth/magic-link/request",
|
|
33
59
|
auth: "public",
|
|
34
60
|
},
|
|
61
|
+
// Deprecated: API remains available, but mobile no longer exposes this flow.
|
|
35
62
|
verifyMagicLink: {
|
|
36
63
|
method: "POST",
|
|
37
64
|
path: "/api/v1/auth/magic-link/verify",
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,WAAW;CAC1C,CAAC,CAAC;AAGH,qCAAqC;AACrC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;CAC1B,CAAC,CAAC;AAGH,oCAAoC;AACpC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;CAClC,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;CAC1B,CAAC,CAAC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AC5B,IAAI,EAAE,QAAQ;KACf;IACD,MAAM,EAAE;QACN,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,QAAQ;KACf;IACD,UAAU,EAAE;QACV,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,MAAM;KACb;IACD,WAAW,EAAE;QACX,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,QAAQ;KACf;CACsC,CAAC"}
|
package/dist/common.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export declare const successEnvelope: typeof apiSuccessSchema;
|
|
|
79
79
|
/** Untyped primitive schemas for ID fields and ISO date strings. */
|
|
80
80
|
export declare const idSchema: z.ZodString;
|
|
81
81
|
export declare const isoDateSchema: z.ZodString;
|
|
82
|
+
export declare const localDaySchema: z.ZodString;
|
|
82
83
|
/** Named time-series point used in admin analytics charts. */
|
|
83
84
|
export declare const timePointSchema: z.ZodObject<{
|
|
84
85
|
date: z.ZodString;
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,kKAU1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,UAAU;;;;;;0BAIC,CAAC;AAEzB,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,wBAAgB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SAAS,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;;;;;;;;;;;;;;;kEAO/D;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;IACR,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,WAAW,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;CACjD,CAAC;AAMF,6FAA6F;AAC7F,eAAO,MAAM,eAAe,yBAAmB,CAAC;AAEhD,oEAAoE;AACpE,eAAO,MAAM,QAAQ,aAAoB,CAAC;AAC1C,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,cAAc,aAA0C,CAAC;AAEtE,8DAA8D;AAC9D,eAAO,MAAM,eAAe;;;;;;;;;EAAoD,CAAC;AACjF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/common.js
CHANGED
|
@@ -41,6 +41,7 @@ export const successEnvelope = apiSuccessSchema;
|
|
|
41
41
|
/** Untyped primitive schemas for ID fields and ISO date strings. */
|
|
42
42
|
export const idSchema = z.string().min(1);
|
|
43
43
|
export const isoDateSchema = z.string();
|
|
44
|
+
export const localDaySchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
44
45
|
/** Named time-series point used in admin analytics charts. */
|
|
45
46
|
export const timePointSchema = z.object({ date: z.string(), value: z.number() });
|
|
46
47
|
//# sourceMappingURL=common.js.map
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|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CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QACxB,IAAI;QACJ,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CAAC;AACL,CAAC;AAiBD,8EAA8E;AAC9E,gDAAgD;AAChD,8EAA8E;AAE9E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAEhD,oEAAoE;AACpE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;AAEtE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const dashboardDateQuerySchema: z.ZodObject<{
|
|
3
|
+
date: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
date: string;
|
|
6
|
+
}, {
|
|
7
|
+
date: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const dashboardCaloriesSchema: z.ZodObject<{
|
|
10
|
+
day: z.ZodString;
|
|
11
|
+
consumedCalories: z.ZodNumber;
|
|
12
|
+
targetCalories: z.ZodNumber;
|
|
13
|
+
remainingCalories: z.ZodNumber;
|
|
14
|
+
percentUsed: z.ZodNumber;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
day: string;
|
|
17
|
+
consumedCalories: number;
|
|
18
|
+
targetCalories: number;
|
|
19
|
+
remainingCalories: number;
|
|
20
|
+
percentUsed: number;
|
|
21
|
+
}, {
|
|
22
|
+
day: string;
|
|
23
|
+
consumedCalories: number;
|
|
24
|
+
targetCalories: number;
|
|
25
|
+
remainingCalories: number;
|
|
26
|
+
percentUsed: number;
|
|
27
|
+
}>;
|
|
28
|
+
export type DashboardCalories = z.infer<typeof dashboardCaloriesSchema>;
|
|
29
|
+
export declare const dashboardCaloriesResponseSchema: z.ZodObject<{
|
|
30
|
+
success: z.ZodLiteral<true>;
|
|
31
|
+
data: z.ZodObject<{
|
|
32
|
+
calories: z.ZodObject<{
|
|
33
|
+
day: z.ZodString;
|
|
34
|
+
consumedCalories: z.ZodNumber;
|
|
35
|
+
targetCalories: z.ZodNumber;
|
|
36
|
+
remainingCalories: z.ZodNumber;
|
|
37
|
+
percentUsed: z.ZodNumber;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
day: string;
|
|
40
|
+
consumedCalories: number;
|
|
41
|
+
targetCalories: number;
|
|
42
|
+
remainingCalories: number;
|
|
43
|
+
percentUsed: number;
|
|
44
|
+
}, {
|
|
45
|
+
day: string;
|
|
46
|
+
consumedCalories: number;
|
|
47
|
+
targetCalories: number;
|
|
48
|
+
remainingCalories: number;
|
|
49
|
+
percentUsed: number;
|
|
50
|
+
}>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
calories: {
|
|
53
|
+
day: string;
|
|
54
|
+
consumedCalories: number;
|
|
55
|
+
targetCalories: number;
|
|
56
|
+
remainingCalories: number;
|
|
57
|
+
percentUsed: number;
|
|
58
|
+
};
|
|
59
|
+
}, {
|
|
60
|
+
calories: {
|
|
61
|
+
day: string;
|
|
62
|
+
consumedCalories: number;
|
|
63
|
+
targetCalories: number;
|
|
64
|
+
remainingCalories: number;
|
|
65
|
+
percentUsed: number;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
responseCode: z.ZodNumber;
|
|
69
|
+
message: z.ZodString;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
message: string;
|
|
72
|
+
success: true;
|
|
73
|
+
responseCode: number;
|
|
74
|
+
data: {
|
|
75
|
+
calories: {
|
|
76
|
+
day: string;
|
|
77
|
+
consumedCalories: number;
|
|
78
|
+
targetCalories: number;
|
|
79
|
+
remainingCalories: number;
|
|
80
|
+
percentUsed: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
message: string;
|
|
85
|
+
success: true;
|
|
86
|
+
responseCode: number;
|
|
87
|
+
data: {
|
|
88
|
+
calories: {
|
|
89
|
+
day: string;
|
|
90
|
+
consumedCalories: number;
|
|
91
|
+
targetCalories: number;
|
|
92
|
+
remainingCalories: number;
|
|
93
|
+
percentUsed: number;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
97
|
+
export declare const macroSummarySchema: z.ZodObject<{
|
|
98
|
+
day: z.ZodString;
|
|
99
|
+
consumed: z.ZodObject<Pick<{
|
|
100
|
+
day: z.ZodString;
|
|
101
|
+
calories: z.ZodNumber;
|
|
102
|
+
proteinG: z.ZodNumber;
|
|
103
|
+
carbsG: z.ZodNumber;
|
|
104
|
+
fatG: z.ZodNumber;
|
|
105
|
+
}, "proteinG" | "carbsG" | "fatG">, "strip", z.ZodTypeAny, {
|
|
106
|
+
proteinG: number;
|
|
107
|
+
carbsG: number;
|
|
108
|
+
fatG: number;
|
|
109
|
+
}, {
|
|
110
|
+
proteinG: number;
|
|
111
|
+
carbsG: number;
|
|
112
|
+
fatG: number;
|
|
113
|
+
}>;
|
|
114
|
+
target: z.ZodObject<{
|
|
115
|
+
proteinG: z.ZodNumber;
|
|
116
|
+
carbsG: z.ZodNumber;
|
|
117
|
+
fatG: z.ZodNumber;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
proteinG: number;
|
|
120
|
+
carbsG: number;
|
|
121
|
+
fatG: number;
|
|
122
|
+
}, {
|
|
123
|
+
proteinG: number;
|
|
124
|
+
carbsG: number;
|
|
125
|
+
fatG: number;
|
|
126
|
+
}>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
day: string;
|
|
129
|
+
consumed: {
|
|
130
|
+
proteinG: number;
|
|
131
|
+
carbsG: number;
|
|
132
|
+
fatG: number;
|
|
133
|
+
};
|
|
134
|
+
target: {
|
|
135
|
+
proteinG: number;
|
|
136
|
+
carbsG: number;
|
|
137
|
+
fatG: number;
|
|
138
|
+
};
|
|
139
|
+
}, {
|
|
140
|
+
day: string;
|
|
141
|
+
consumed: {
|
|
142
|
+
proteinG: number;
|
|
143
|
+
carbsG: number;
|
|
144
|
+
fatG: number;
|
|
145
|
+
};
|
|
146
|
+
target: {
|
|
147
|
+
proteinG: number;
|
|
148
|
+
carbsG: number;
|
|
149
|
+
fatG: number;
|
|
150
|
+
};
|
|
151
|
+
}>;
|
|
152
|
+
export type MacroSummary = z.infer<typeof macroSummarySchema>;
|
|
153
|
+
export declare const dashboardMacrosResponseSchema: z.ZodObject<{
|
|
154
|
+
success: z.ZodLiteral<true>;
|
|
155
|
+
data: z.ZodObject<{
|
|
156
|
+
macros: z.ZodObject<{
|
|
157
|
+
day: z.ZodString;
|
|
158
|
+
consumed: z.ZodObject<Pick<{
|
|
159
|
+
day: z.ZodString;
|
|
160
|
+
calories: z.ZodNumber;
|
|
161
|
+
proteinG: z.ZodNumber;
|
|
162
|
+
carbsG: z.ZodNumber;
|
|
163
|
+
fatG: z.ZodNumber;
|
|
164
|
+
}, "proteinG" | "carbsG" | "fatG">, "strip", z.ZodTypeAny, {
|
|
165
|
+
proteinG: number;
|
|
166
|
+
carbsG: number;
|
|
167
|
+
fatG: number;
|
|
168
|
+
}, {
|
|
169
|
+
proteinG: number;
|
|
170
|
+
carbsG: number;
|
|
171
|
+
fatG: number;
|
|
172
|
+
}>;
|
|
173
|
+
target: z.ZodObject<{
|
|
174
|
+
proteinG: z.ZodNumber;
|
|
175
|
+
carbsG: z.ZodNumber;
|
|
176
|
+
fatG: z.ZodNumber;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
proteinG: number;
|
|
179
|
+
carbsG: number;
|
|
180
|
+
fatG: number;
|
|
181
|
+
}, {
|
|
182
|
+
proteinG: number;
|
|
183
|
+
carbsG: number;
|
|
184
|
+
fatG: number;
|
|
185
|
+
}>;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
day: string;
|
|
188
|
+
consumed: {
|
|
189
|
+
proteinG: number;
|
|
190
|
+
carbsG: number;
|
|
191
|
+
fatG: number;
|
|
192
|
+
};
|
|
193
|
+
target: {
|
|
194
|
+
proteinG: number;
|
|
195
|
+
carbsG: number;
|
|
196
|
+
fatG: number;
|
|
197
|
+
};
|
|
198
|
+
}, {
|
|
199
|
+
day: string;
|
|
200
|
+
consumed: {
|
|
201
|
+
proteinG: number;
|
|
202
|
+
carbsG: number;
|
|
203
|
+
fatG: number;
|
|
204
|
+
};
|
|
205
|
+
target: {
|
|
206
|
+
proteinG: number;
|
|
207
|
+
carbsG: number;
|
|
208
|
+
fatG: number;
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
macros: {
|
|
213
|
+
day: string;
|
|
214
|
+
consumed: {
|
|
215
|
+
proteinG: number;
|
|
216
|
+
carbsG: number;
|
|
217
|
+
fatG: number;
|
|
218
|
+
};
|
|
219
|
+
target: {
|
|
220
|
+
proteinG: number;
|
|
221
|
+
carbsG: number;
|
|
222
|
+
fatG: number;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
}, {
|
|
226
|
+
macros: {
|
|
227
|
+
day: string;
|
|
228
|
+
consumed: {
|
|
229
|
+
proteinG: number;
|
|
230
|
+
carbsG: number;
|
|
231
|
+
fatG: number;
|
|
232
|
+
};
|
|
233
|
+
target: {
|
|
234
|
+
proteinG: number;
|
|
235
|
+
carbsG: number;
|
|
236
|
+
fatG: number;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
}>;
|
|
240
|
+
responseCode: z.ZodNumber;
|
|
241
|
+
message: z.ZodString;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
message: string;
|
|
244
|
+
success: true;
|
|
245
|
+
responseCode: number;
|
|
246
|
+
data: {
|
|
247
|
+
macros: {
|
|
248
|
+
day: string;
|
|
249
|
+
consumed: {
|
|
250
|
+
proteinG: number;
|
|
251
|
+
carbsG: number;
|
|
252
|
+
fatG: number;
|
|
253
|
+
};
|
|
254
|
+
target: {
|
|
255
|
+
proteinG: number;
|
|
256
|
+
carbsG: number;
|
|
257
|
+
fatG: number;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
}, {
|
|
262
|
+
message: string;
|
|
263
|
+
success: true;
|
|
264
|
+
responseCode: number;
|
|
265
|
+
data: {
|
|
266
|
+
macros: {
|
|
267
|
+
day: string;
|
|
268
|
+
consumed: {
|
|
269
|
+
proteinG: number;
|
|
270
|
+
carbsG: number;
|
|
271
|
+
fatG: number;
|
|
272
|
+
};
|
|
273
|
+
target: {
|
|
274
|
+
proteinG: number;
|
|
275
|
+
carbsG: number;
|
|
276
|
+
fatG: number;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
}>;
|
|
281
|
+
export declare const streakSummarySchema: z.ZodObject<{
|
|
282
|
+
currentStreakDays: z.ZodNumber;
|
|
283
|
+
longestStreakDays: z.ZodNumber;
|
|
284
|
+
lastLoggedDay: z.ZodNullable<z.ZodString>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
currentStreakDays: number;
|
|
287
|
+
longestStreakDays: number;
|
|
288
|
+
lastLoggedDay: string | null;
|
|
289
|
+
}, {
|
|
290
|
+
currentStreakDays: number;
|
|
291
|
+
longestStreakDays: number;
|
|
292
|
+
lastLoggedDay: string | null;
|
|
293
|
+
}>;
|
|
294
|
+
export type StreakSummary = z.infer<typeof streakSummarySchema>;
|
|
295
|
+
export declare const dashboardStreakResponseSchema: z.ZodObject<{
|
|
296
|
+
success: z.ZodLiteral<true>;
|
|
297
|
+
data: z.ZodObject<{
|
|
298
|
+
streak: z.ZodObject<{
|
|
299
|
+
currentStreakDays: z.ZodNumber;
|
|
300
|
+
longestStreakDays: z.ZodNumber;
|
|
301
|
+
lastLoggedDay: z.ZodNullable<z.ZodString>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
currentStreakDays: number;
|
|
304
|
+
longestStreakDays: number;
|
|
305
|
+
lastLoggedDay: string | null;
|
|
306
|
+
}, {
|
|
307
|
+
currentStreakDays: number;
|
|
308
|
+
longestStreakDays: number;
|
|
309
|
+
lastLoggedDay: string | null;
|
|
310
|
+
}>;
|
|
311
|
+
}, "strip", z.ZodTypeAny, {
|
|
312
|
+
streak: {
|
|
313
|
+
currentStreakDays: number;
|
|
314
|
+
longestStreakDays: number;
|
|
315
|
+
lastLoggedDay: string | null;
|
|
316
|
+
};
|
|
317
|
+
}, {
|
|
318
|
+
streak: {
|
|
319
|
+
currentStreakDays: number;
|
|
320
|
+
longestStreakDays: number;
|
|
321
|
+
lastLoggedDay: string | null;
|
|
322
|
+
};
|
|
323
|
+
}>;
|
|
324
|
+
responseCode: z.ZodNumber;
|
|
325
|
+
message: z.ZodString;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
message: string;
|
|
328
|
+
success: true;
|
|
329
|
+
responseCode: number;
|
|
330
|
+
data: {
|
|
331
|
+
streak: {
|
|
332
|
+
currentStreakDays: number;
|
|
333
|
+
longestStreakDays: number;
|
|
334
|
+
lastLoggedDay: string | null;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
}, {
|
|
338
|
+
message: string;
|
|
339
|
+
success: true;
|
|
340
|
+
responseCode: number;
|
|
341
|
+
data: {
|
|
342
|
+
streak: {
|
|
343
|
+
currentStreakDays: number;
|
|
344
|
+
longestStreakDays: number;
|
|
345
|
+
lastLoggedDay: string | null;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
}>;
|
|
349
|
+
export declare const dashboardRoutes: {
|
|
350
|
+
calories: {
|
|
351
|
+
method: "GET";
|
|
352
|
+
path: "/api/v1/dashboard/calories";
|
|
353
|
+
auth: "user";
|
|
354
|
+
};
|
|
355
|
+
macros: {
|
|
356
|
+
method: "GET";
|
|
357
|
+
path: "/api/v1/dashboard/macros";
|
|
358
|
+
auth: "user";
|
|
359
|
+
};
|
|
360
|
+
streak: {
|
|
361
|
+
method: "GET";
|
|
362
|
+
path: "/api/v1/dashboard/streak";
|
|
363
|
+
auth: "user";
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;;;;EAAqC,CAAC;AAE3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEzC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAgBa,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiSuccessSchema, localDaySchema } from "./common";
|
|
3
|
+
import { dailyTotalsSchema } from "./foods";
|
|
4
|
+
export const dashboardDateQuerySchema = z.object({ date: localDaySchema });
|
|
5
|
+
export const dashboardCaloriesSchema = z.object({
|
|
6
|
+
day: localDaySchema,
|
|
7
|
+
consumedCalories: z.number(),
|
|
8
|
+
targetCalories: z.number(),
|
|
9
|
+
remainingCalories: z.number(),
|
|
10
|
+
percentUsed: z.number(),
|
|
11
|
+
});
|
|
12
|
+
export const dashboardCaloriesResponseSchema = apiSuccessSchema(z.object({ calories: dashboardCaloriesSchema }));
|
|
13
|
+
export const macroSummarySchema = z.object({
|
|
14
|
+
day: localDaySchema,
|
|
15
|
+
consumed: dailyTotalsSchema.pick({ proteinG: true, carbsG: true, fatG: true }),
|
|
16
|
+
target: z.object({
|
|
17
|
+
proteinG: z.number(),
|
|
18
|
+
carbsG: z.number(),
|
|
19
|
+
fatG: z.number(),
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
22
|
+
export const dashboardMacrosResponseSchema = apiSuccessSchema(z.object({ macros: macroSummarySchema }));
|
|
23
|
+
export const streakSummarySchema = z.object({
|
|
24
|
+
currentStreakDays: z.number(),
|
|
25
|
+
longestStreakDays: z.number(),
|
|
26
|
+
lastLoggedDay: localDaySchema.nullable(),
|
|
27
|
+
});
|
|
28
|
+
export const dashboardStreakResponseSchema = apiSuccessSchema(z.object({ streak: streakSummarySchema }));
|
|
29
|
+
export const dashboardRoutes = {
|
|
30
|
+
calories: {
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: "/api/v1/dashboard/calories",
|
|
33
|
+
auth: "user",
|
|
34
|
+
},
|
|
35
|
+
macros: {
|
|
36
|
+
method: "GET",
|
|
37
|
+
path: "/api/v1/dashboard/macros",
|
|
38
|
+
auth: "user",
|
|
39
|
+
},
|
|
40
|
+
streak: {
|
|
41
|
+
method: "GET",
|
|
42
|
+
path: "/api/v1/dashboard/streak",
|
|
43
|
+
auth: "user",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAsB,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,cAAc;IACnB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAGH,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