@beorchid-llc/thrivo-contracts 0.5.5 → 0.6.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.
@@ -0,0 +1,130 @@
1
+ import { z } from "zod";
2
+ export declare const moodSchema: z.ZodEnum<["great", "good", "ok", "low", "bad"]>;
3
+ export type Mood = z.infer<typeof moodSchema>;
4
+ export declare const checkinSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ mood: z.ZodEnum<["great", "good", "ok", "low", "bad"]>;
7
+ day: z.ZodString;
8
+ note: z.ZodNullable<z.ZodString>;
9
+ /** Server-selected psychology tip returned for the chosen mood / day. */
10
+ tip: z.ZodNullable<z.ZodString>;
11
+ createdAt: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ id: string;
14
+ createdAt: string;
15
+ mood: "great" | "good" | "ok" | "low" | "bad";
16
+ day: string;
17
+ note: string | null;
18
+ tip: string | null;
19
+ }, {
20
+ id: string;
21
+ createdAt: string;
22
+ mood: "great" | "good" | "ok" | "low" | "bad";
23
+ day: string;
24
+ note: string | null;
25
+ tip: string | null;
26
+ }>;
27
+ export type Checkin = z.infer<typeof checkinSchema>;
28
+ export declare const createCheckinPayload: z.ZodObject<{
29
+ mood: z.ZodEnum<["great", "good", "ok", "low", "bad"]>;
30
+ day: z.ZodString;
31
+ note: z.ZodOptional<z.ZodString>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ mood: "great" | "good" | "ok" | "low" | "bad";
34
+ day: string;
35
+ note?: string | undefined;
36
+ }, {
37
+ mood: "great" | "good" | "ok" | "low" | "bad";
38
+ day: string;
39
+ note?: string | undefined;
40
+ }>;
41
+ export type CreateCheckinPayload = z.infer<typeof createCheckinPayload>;
42
+ export declare const checkinResponse: z.ZodObject<{
43
+ checkin: z.ZodObject<{
44
+ id: z.ZodString;
45
+ mood: z.ZodEnum<["great", "good", "ok", "low", "bad"]>;
46
+ day: z.ZodString;
47
+ note: z.ZodNullable<z.ZodString>;
48
+ /** Server-selected psychology tip returned for the chosen mood / day. */
49
+ tip: z.ZodNullable<z.ZodString>;
50
+ createdAt: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id: string;
53
+ createdAt: string;
54
+ mood: "great" | "good" | "ok" | "low" | "bad";
55
+ day: string;
56
+ note: string | null;
57
+ tip: string | null;
58
+ }, {
59
+ id: string;
60
+ createdAt: string;
61
+ mood: "great" | "good" | "ok" | "low" | "bad";
62
+ day: string;
63
+ note: string | null;
64
+ tip: string | null;
65
+ }>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ checkin: {
68
+ id: string;
69
+ createdAt: string;
70
+ mood: "great" | "good" | "ok" | "low" | "bad";
71
+ day: string;
72
+ note: string | null;
73
+ tip: string | null;
74
+ };
75
+ }, {
76
+ checkin: {
77
+ id: string;
78
+ createdAt: string;
79
+ mood: "great" | "good" | "ok" | "low" | "bad";
80
+ day: string;
81
+ note: string | null;
82
+ tip: string | null;
83
+ };
84
+ }>;
85
+ export type CheckinResponse = z.infer<typeof checkinResponse>;
86
+ export declare const checkinListResponse: z.ZodObject<{
87
+ checkins: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ mood: z.ZodEnum<["great", "good", "ok", "low", "bad"]>;
90
+ day: z.ZodString;
91
+ note: z.ZodNullable<z.ZodString>;
92
+ /** Server-selected psychology tip returned for the chosen mood / day. */
93
+ tip: z.ZodNullable<z.ZodString>;
94
+ createdAt: z.ZodString;
95
+ }, "strip", z.ZodTypeAny, {
96
+ id: string;
97
+ createdAt: string;
98
+ mood: "great" | "good" | "ok" | "low" | "bad";
99
+ day: string;
100
+ note: string | null;
101
+ tip: string | null;
102
+ }, {
103
+ id: string;
104
+ createdAt: string;
105
+ mood: "great" | "good" | "ok" | "low" | "bad";
106
+ day: string;
107
+ note: string | null;
108
+ tip: string | null;
109
+ }>, "many">;
110
+ }, "strip", z.ZodTypeAny, {
111
+ checkins: {
112
+ id: string;
113
+ createdAt: string;
114
+ mood: "great" | "good" | "ok" | "low" | "bad";
115
+ day: string;
116
+ note: string | null;
117
+ tip: string | null;
118
+ }[];
119
+ }, {
120
+ checkins: {
121
+ id: string;
122
+ createdAt: string;
123
+ mood: "great" | "good" | "ok" | "low" | "bad";
124
+ day: string;
125
+ note: string | null;
126
+ tip: string | null;
127
+ }[];
128
+ }>;
129
+ export type CheckinListResponse = z.infer<typeof checkinListResponse>;
130
+ //# sourceMappingURL=checkins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkins.d.ts","sourceRoot":"","sources":["../src/checkins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,UAAU,kDAAgD,CAAC;AACxE,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,aAAa;;;;;IAKxB,yEAAyE;;;;;;;;;;;;;;;;;EAGzE,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,eAAe;;;;;;QAb1B,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaR,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB;;;;;;QAhB9B,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBM,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import { idSchema, isoDateSchema, localDaySchema } from "./common";
3
+ // Canonical mood values. These MUST match the `mood` Postgres enum
4
+ // (db/schema/_enums.ts: great | good | ok | low | bad) — the value is stored
5
+ // as-is, while the UI is free to render its own label (e.g. "Okay" for "ok").
6
+ export const moodSchema = z.enum(["great", "good", "ok", "low", "bad"]);
7
+ export const checkinSchema = z.object({
8
+ id: idSchema,
9
+ mood: moodSchema,
10
+ day: localDaySchema,
11
+ note: z.string().nullable(),
12
+ /** Server-selected psychology tip returned for the chosen mood / day. */
13
+ tip: z.string().nullable(),
14
+ createdAt: isoDateSchema,
15
+ });
16
+ export const createCheckinPayload = z.object({
17
+ mood: moodSchema,
18
+ day: localDaySchema,
19
+ note: z.string().max(500).optional(),
20
+ });
21
+ export const checkinResponse = z.object({ checkin: checkinSchema });
22
+ export const checkinListResponse = z.object({ checkins: z.array(checkinSchema) });
23
+ //# sourceMappingURL=checkins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkins.js","sourceRoot":"","sources":["../src/checkins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEnE,mEAAmE;AACnE,6EAA6E;AAC7E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGxE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,yEAAyE;IACzE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;AAGpE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC"}