@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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foods.d.ts","sourceRoot":"","sources":["../src/foods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,cAAc,sDAAoD,CAAC;AAChF,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,qBAAqB;;;;;;EAAqC,CAAC;AACxE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKxC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;CAWkB,CAAC"}
package/dist/foods.js ADDED
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ import { apiSuccessSchema, idSchema, isoDateSchema, localDaySchema, } from "./common";
3
+ export const mealTypeSchema = z.enum(["breakfast", "lunch", "dinner", "snack"]);
4
+ export const nutrientsSchema = z.object({
5
+ calories: z.number(),
6
+ proteinG: z.number(),
7
+ carbsG: z.number(),
8
+ fatG: z.number(),
9
+ });
10
+ export const foodLogEntrySchema = z.object({
11
+ id: idSchema,
12
+ foodItemId: idSchema.nullable(),
13
+ name: z.string(),
14
+ meal: mealTypeSchema,
15
+ day: localDaySchema,
16
+ servings: z.number().positive(),
17
+ servingUnit: z.string().nullable(),
18
+ nutrients: nutrientsSchema,
19
+ loggedAt: isoDateSchema,
20
+ });
21
+ export const dailyTotalsSchema = z.object({
22
+ day: localDaySchema,
23
+ calories: z.number(),
24
+ proteinG: z.number(),
25
+ carbsG: z.number(),
26
+ fatG: z.number(),
27
+ });
28
+ export const mealGroupSchema = z.object({
29
+ meal: mealTypeSchema,
30
+ label: z.string(),
31
+ calories: z.number(),
32
+ entries: z.array(foodLogEntrySchema),
33
+ });
34
+ export const foodLogDayQuerySchema = z.object({ date: localDaySchema });
35
+ export const foodLogDayResponseSchema = apiSuccessSchema(z.object({
36
+ day: localDaySchema,
37
+ groups: z.array(mealGroupSchema),
38
+ isEmptyDay: z.boolean(),
39
+ }));
40
+ export const foodLogHistoryQuerySchema = z.object({
41
+ cursor: z.string().optional(),
42
+ from: localDaySchema.optional(),
43
+ to: localDaySchema.optional(),
44
+ });
45
+ export const historyDaySchema = z.object({
46
+ day: localDaySchema,
47
+ isLocked: z.boolean(),
48
+ lockReason: z.enum(["free_history_limit"]).nullable(),
49
+ groups: z.array(mealGroupSchema),
50
+ });
51
+ export const foodLogHistoryResponseSchema = apiSuccessSchema(z.object({
52
+ days: z.array(historyDaySchema),
53
+ historyLimitDays: z.number().int(),
54
+ }));
55
+ export const foodRoutes = {
56
+ logDay: {
57
+ method: "GET",
58
+ path: "/api/v1/foods/log/day",
59
+ auth: "user",
60
+ },
61
+ logHistory: {
62
+ method: "GET",
63
+ path: "/api/v1/foods/log/history",
64
+ auth: "user",
65
+ },
66
+ };
67
+ //# sourceMappingURL=foods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foods.js","sourceRoot":"","sources":["../src/foods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE;QACN,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,MAAM;KACb;IACD,UAAU,EAAE;QACV,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,MAAM;KACb;CACsC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,9 @@ export * from "./common";
2
2
  export * from "./users";
3
3
  export * from "./auth";
4
4
  export * from "./admin";
5
+ export * from "./dashboard";
6
+ export * from "./foods";
7
+ export * from "./metrics";
8
+ export * from "./settings";
9
+ export * from "./subscriptions";
5
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -2,4 +2,9 @@ export * from "./common";
2
2
  export * from "./users";
3
3
  export * from "./auth";
4
4
  export * from "./admin";
5
+ export * from "./dashboard";
6
+ export * from "./foods";
7
+ export * from "./metrics";
8
+ export * from "./settings";
9
+ export * from "./subscriptions";
5
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,130 @@
1
+ import { z } from "zod";
2
+ export declare const waterQuerySchema: z.ZodObject<{
3
+ date: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ date: string;
6
+ }, {
7
+ date: string;
8
+ }>;
9
+ export declare const waterSchema: z.ZodObject<{
10
+ day: z.ZodString;
11
+ totalMl: z.ZodNumber;
12
+ targetMl: z.ZodNumber;
13
+ glassMl: z.ZodNumber;
14
+ glasses: z.ZodNumber;
15
+ targetGlasses: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ day: string;
18
+ totalMl: number;
19
+ targetMl: number;
20
+ glassMl: number;
21
+ glasses: number;
22
+ targetGlasses: number;
23
+ }, {
24
+ day: string;
25
+ totalMl: number;
26
+ targetMl: number;
27
+ glassMl: number;
28
+ glasses: number;
29
+ targetGlasses: number;
30
+ }>;
31
+ export type Water = z.infer<typeof waterSchema>;
32
+ export declare const waterResponseSchema: z.ZodObject<{
33
+ success: z.ZodLiteral<true>;
34
+ data: z.ZodObject<{
35
+ water: z.ZodObject<{
36
+ day: z.ZodString;
37
+ totalMl: z.ZodNumber;
38
+ targetMl: z.ZodNumber;
39
+ glassMl: z.ZodNumber;
40
+ glasses: z.ZodNumber;
41
+ targetGlasses: z.ZodNumber;
42
+ }, "strip", z.ZodTypeAny, {
43
+ day: string;
44
+ totalMl: number;
45
+ targetMl: number;
46
+ glassMl: number;
47
+ glasses: number;
48
+ targetGlasses: number;
49
+ }, {
50
+ day: string;
51
+ totalMl: number;
52
+ targetMl: number;
53
+ glassMl: number;
54
+ glasses: number;
55
+ targetGlasses: number;
56
+ }>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ water: {
59
+ day: string;
60
+ totalMl: number;
61
+ targetMl: number;
62
+ glassMl: number;
63
+ glasses: number;
64
+ targetGlasses: number;
65
+ };
66
+ }, {
67
+ water: {
68
+ day: string;
69
+ totalMl: number;
70
+ targetMl: number;
71
+ glassMl: number;
72
+ glasses: number;
73
+ targetGlasses: number;
74
+ };
75
+ }>;
76
+ responseCode: z.ZodNumber;
77
+ message: z.ZodString;
78
+ }, "strip", z.ZodTypeAny, {
79
+ message: string;
80
+ success: true;
81
+ responseCode: number;
82
+ data: {
83
+ water: {
84
+ day: string;
85
+ totalMl: number;
86
+ targetMl: number;
87
+ glassMl: number;
88
+ glasses: number;
89
+ targetGlasses: number;
90
+ };
91
+ };
92
+ }, {
93
+ message: string;
94
+ success: true;
95
+ responseCode: number;
96
+ data: {
97
+ water: {
98
+ day: string;
99
+ totalMl: number;
100
+ targetMl: number;
101
+ glassMl: number;
102
+ glasses: number;
103
+ targetGlasses: number;
104
+ };
105
+ };
106
+ }>;
107
+ export declare const addWaterPayloadSchema: z.ZodObject<{
108
+ day: z.ZodString;
109
+ amountMl: z.ZodNumber;
110
+ }, "strip", z.ZodTypeAny, {
111
+ day: string;
112
+ amountMl: number;
113
+ }, {
114
+ day: string;
115
+ amountMl: number;
116
+ }>;
117
+ export type AddWaterPayload = z.infer<typeof addWaterPayloadSchema>;
118
+ export declare const metricRoutes: {
119
+ waterGet: {
120
+ method: "GET";
121
+ path: "/api/v1/metrics/water";
122
+ auth: "user";
123
+ };
124
+ waterAdd: {
125
+ method: "POST";
126
+ path: "/api/v1/metrics/water";
127
+ auth: "user";
128
+ };
129
+ };
130
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;EAAqC,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;EAOtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqD,CAAC;AAEtF,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,YAAY;;;;;;;;;;;CAWgB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import { apiSuccessSchema, localDaySchema } from "./common";
3
+ export const waterQuerySchema = z.object({ date: localDaySchema });
4
+ export const waterSchema = z.object({
5
+ day: localDaySchema,
6
+ totalMl: z.number(),
7
+ targetMl: z.number(),
8
+ glassMl: z.number(),
9
+ glasses: z.number(),
10
+ targetGlasses: z.number(),
11
+ });
12
+ export const waterResponseSchema = apiSuccessSchema(z.object({ water: waterSchema }));
13
+ export const addWaterPayloadSchema = z.object({
14
+ day: localDaySchema,
15
+ amountMl: z.number().int().positive(),
16
+ });
17
+ export const metricRoutes = {
18
+ waterGet: {
19
+ method: "GET",
20
+ path: "/api/v1/metrics/water",
21
+ auth: "user",
22
+ },
23
+ waterAdd: {
24
+ method: "POST",
25
+ path: "/api/v1/metrics/water",
26
+ auth: "user",
27
+ },
28
+ };
29
+ //# sourceMappingURL=metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.js","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