@nikthegeek/dreamsforlittles-shared 0.1.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/access.d.ts +1342 -0
- package/dist/access.js +115 -0
- package/dist/access.js.map +1 -0
- package/dist/admin.d.ts +1689 -0
- package/dist/admin.js +97 -0
- package/dist/admin.js.map +1 -0
- package/dist/allergy-ladders.d.ts +798 -0
- package/dist/allergy-ladders.js +158 -0
- package/dist/allergy-ladders.js.map +1 -0
- package/dist/analysis.d.ts +397 -0
- package/dist/analysis.js +15 -0
- package/dist/analysis.js.map +1 -0
- package/dist/api.d.ts +42 -0
- package/dist/api.js +12 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +212 -0
- package/dist/auth.js +19 -0
- package/dist/auth.js.map +1 -0
- package/dist/billing.d.ts +18 -0
- package/dist/billing.js +60 -0
- package/dist/billing.js.map +1 -0
- package/dist/coach.d.ts +511 -0
- package/dist/coach.js +43 -0
- package/dist/coach.js.map +1 -0
- package/dist/enums.d.ts +28 -0
- package/dist/enums.js +89 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.js +46 -0
- package/dist/errors.js.map +1 -0
- package/dist/family.d.ts +2428 -0
- package/dist/family.js +192 -0
- package/dist/family.js.map +1 -0
- package/dist/files.d.ts +98 -0
- package/dist/files.js +31 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/invites.d.ts +284 -0
- package/dist/invites.js +35 -0
- package/dist/invites.js.map +1 -0
- package/package.json +28 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { idSchema, isoDateStringSchema, nullableIsoDateStringSchema } from "./api.js";
|
|
3
|
+
export const allergyLadderStageStatusSchema = z.enum(["upNext", "inProgress", "completed"]);
|
|
4
|
+
export const allergyLadderStageIconSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
type: z.enum(["preset", "emoji", "uri"]),
|
|
7
|
+
value: z.string().min(1)
|
|
8
|
+
})
|
|
9
|
+
.strict();
|
|
10
|
+
export const allergyLadderStageSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
stageId: idSchema,
|
|
13
|
+
order: z.number().int().nonnegative(),
|
|
14
|
+
title: z.string().min(1),
|
|
15
|
+
description: z.string().nullable().optional(),
|
|
16
|
+
icon: allergyLadderStageIconSchema.nullable().optional(),
|
|
17
|
+
status: allergyLadderStageStatusSchema,
|
|
18
|
+
startedAt: nullableIsoDateStringSchema.optional(),
|
|
19
|
+
completedAt: nullableIsoDateStringSchema.optional(),
|
|
20
|
+
linkedSolidsEntryIds: z.array(idSchema),
|
|
21
|
+
lastUpdatedAt: nullableIsoDateStringSchema.optional(),
|
|
22
|
+
reactionSummary: z.string().nullable().optional(),
|
|
23
|
+
activeReminderCount: z.number().int().nonnegative().optional()
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
export const allergyLadderSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
id: idSchema,
|
|
29
|
+
familyUserId: idSchema,
|
|
30
|
+
babyId: idSchema,
|
|
31
|
+
title: z.string().min(1),
|
|
32
|
+
description: z.string().nullable().optional(),
|
|
33
|
+
icon: z.string().nullable().optional(),
|
|
34
|
+
isArchived: z.boolean(),
|
|
35
|
+
activeStageId: idSchema.nullable().optional(),
|
|
36
|
+
stages: z.array(allergyLadderStageSchema).min(1),
|
|
37
|
+
notes: z.string().nullable().optional(),
|
|
38
|
+
createdAt: isoDateStringSchema,
|
|
39
|
+
updatedAt: isoDateStringSchema
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
export const allergyLadderStageWriteSchema = z
|
|
43
|
+
.object({
|
|
44
|
+
stageId: idSchema.optional(),
|
|
45
|
+
title: z.string().min(1),
|
|
46
|
+
description: z.string().nullable().optional(),
|
|
47
|
+
icon: allergyLadderStageIconSchema.nullable().optional()
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
export const allergyLadderWriteRequestSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
babyId: idSchema.optional(),
|
|
53
|
+
familyUserId: idSchema.optional(),
|
|
54
|
+
title: z.string().min(1).optional(),
|
|
55
|
+
description: z.string().nullable().optional(),
|
|
56
|
+
icon: z.string().nullable().optional(),
|
|
57
|
+
notes: z.string().nullable().optional(),
|
|
58
|
+
isArchived: z.boolean().optional(),
|
|
59
|
+
stages: z.array(allergyLadderStageWriteSchema).min(1).optional()
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
export const allergyLadderCreateRequestSchema = allergyLadderWriteRequestSchema.extend({
|
|
63
|
+
babyId: idSchema,
|
|
64
|
+
title: z.string().min(1),
|
|
65
|
+
stages: z.array(allergyLadderStageWriteSchema).min(1)
|
|
66
|
+
});
|
|
67
|
+
export const allergyLadderStageStatusRequestSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
status: allergyLadderStageStatusSchema
|
|
70
|
+
})
|
|
71
|
+
.strict();
|
|
72
|
+
export const allergyLaddersQuerySchema = z
|
|
73
|
+
.object({
|
|
74
|
+
familyUserId: idSchema.optional(),
|
|
75
|
+
babyId: idSchema,
|
|
76
|
+
includeArchived: z
|
|
77
|
+
.union([z.literal("true"), z.literal("false"), z.boolean()])
|
|
78
|
+
.optional()
|
|
79
|
+
.transform((value) => value === true || value === "true")
|
|
80
|
+
})
|
|
81
|
+
.strict();
|
|
82
|
+
export const allergyLaddersResponseSchema = z.object({
|
|
83
|
+
ladders: z.array(allergyLadderSchema)
|
|
84
|
+
});
|
|
85
|
+
export const allergyLadderResponseSchema = z.object({
|
|
86
|
+
ladder: allergyLadderSchema
|
|
87
|
+
});
|
|
88
|
+
export const allergyLadderPresets = [
|
|
89
|
+
{
|
|
90
|
+
id: "milk-classic",
|
|
91
|
+
title: "Milk ladder",
|
|
92
|
+
summary: "Move from highly baked dairy to fresh milk in five gentle stages.",
|
|
93
|
+
description: "A gradual plan for reintroducing milk, starting with well-baked dairy and finishing with sips of fresh milk.",
|
|
94
|
+
icon: "🥛",
|
|
95
|
+
stages: [
|
|
96
|
+
{
|
|
97
|
+
title: "Baked milk muffin",
|
|
98
|
+
description: "Offer a muffin or biscuit baked with milk so the proteins are thoroughly cooked.",
|
|
99
|
+
icon: "🧁"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: "Pancake pieces",
|
|
103
|
+
description: "Serve small bites of pancakes or waffles that include milk in the batter.",
|
|
104
|
+
icon: "🥞"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: "Yogurt or cheese",
|
|
108
|
+
description: "Try a spoonful of yogurt or a thin slice of firm cheese to add gentle dairy exposure.",
|
|
109
|
+
icon: "🧀"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: "Warm milk with cereal",
|
|
113
|
+
description: "Pour warmed milk over cereal or porridge to increase milk exposure while still warmed.",
|
|
114
|
+
icon: "🥣"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: "Fresh milk sips",
|
|
118
|
+
description: "Finish with small sips of fresh milk offered in a cup.",
|
|
119
|
+
icon: "🥛"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "egg-classic",
|
|
125
|
+
title: "Egg ladder",
|
|
126
|
+
summary: "Reintroduce egg from well-baked goods to lightly cooked servings.",
|
|
127
|
+
description: "A structured egg ladder that begins with highly baked egg and ends with soft cooked yolk.",
|
|
128
|
+
icon: "🥚",
|
|
129
|
+
stages: [
|
|
130
|
+
{
|
|
131
|
+
title: "Baked egg muffin",
|
|
132
|
+
description: "Start with muffins or cupcakes baked with egg where the proteins are well cooked.",
|
|
133
|
+
icon: "🧁"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: "Egg pancakes",
|
|
137
|
+
description: "Offer small squares of pancakes or waffles that contain egg.",
|
|
138
|
+
icon: "🥞"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: "Eggy noodles or toast",
|
|
142
|
+
description: "Try egg noodles or slices of French toast with the egg cooked through.",
|
|
143
|
+
icon: "🍜"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
title: "Scrambled egg pieces",
|
|
147
|
+
description: "Provide small pieces of fully cooked scrambled egg or omelette.",
|
|
148
|
+
icon: "🍳"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: "Soft boiled egg",
|
|
152
|
+
description: "Finish with slices of soft boiled or poached egg with a slightly runny yolk.",
|
|
153
|
+
icon: "🥚"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
//# sourceMappingURL=allergy-ladders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allergy-ladders.js","sourceRoot":"","sources":["../src/allergy-ladders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEtF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AAE5F,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC;KAC1C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC,CAAC,M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erySchema: z.ZodObject<{
|
|
3
|
+
familyUserId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
babyId: z.ZodString;
|
|
5
|
+
from: z.ZodString;
|
|
6
|
+
to: z.ZodString;
|
|
7
|
+
activityType: z.ZodOptional<z.ZodEnum<["breastfeed", "bottles", "sleep", "nappies", "pumping", "medication", "solids"]>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
babyId: string;
|
|
10
|
+
from: string;
|
|
11
|
+
to: string;
|
|
12
|
+
familyUserId?: string | undefined;
|
|
13
|
+
activityType?: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids" | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
babyId: string;
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
familyUserId?: string | undefined;
|
|
19
|
+
activityType?: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids" | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const analysisActivitiesResponseSchema: z.ZodObject<{
|
|
22
|
+
activities: z.ZodArray<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
familyUserId: z.ZodString;
|
|
25
|
+
babyId: z.ZodString;
|
|
26
|
+
activityType: z.ZodEnum<["breastfeed", "bottles", "sleep", "nappies", "pumping", "medication", "solids"]>;
|
|
27
|
+
note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
details: z.ZodUnion<[z.ZodObject<{
|
|
29
|
+
date: z.ZodString;
|
|
30
|
+
start: z.ZodString;
|
|
31
|
+
end: z.ZodString;
|
|
32
|
+
side: z.ZodEnum<["left", "right"]>;
|
|
33
|
+
}, "strict", z.ZodTypeAny, {
|
|
34
|
+
date: string;
|
|
35
|
+
start: string;
|
|
36
|
+
end: string;
|
|
37
|
+
side: "left" | "right";
|
|
38
|
+
}, {
|
|
39
|
+
date: string;
|
|
40
|
+
start: string;
|
|
41
|
+
end: string;
|
|
42
|
+
side: "left" | "right";
|
|
43
|
+
}>, z.ZodObject<{
|
|
44
|
+
date: z.ZodString;
|
|
45
|
+
time: z.ZodString;
|
|
46
|
+
amount: z.ZodNumber;
|
|
47
|
+
unit: z.ZodEnum<["ml", "oz"]>;
|
|
48
|
+
type: z.ZodEnum<["breastmilk", "formula"]>;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
type: "breastmilk" | "formula";
|
|
51
|
+
date: string;
|
|
52
|
+
time: string;
|
|
53
|
+
amount: number;
|
|
54
|
+
unit: "ml" | "oz";
|
|
55
|
+
}, {
|
|
56
|
+
type: "breastmilk" | "formula";
|
|
57
|
+
date: string;
|
|
58
|
+
time: string;
|
|
59
|
+
amount: number;
|
|
60
|
+
unit: "ml" | "oz";
|
|
61
|
+
}>, z.ZodObject<{
|
|
62
|
+
date: z.ZodString;
|
|
63
|
+
start: z.ZodString;
|
|
64
|
+
end: z.ZodString;
|
|
65
|
+
type: z.ZodEnum<["day", "night"]>;
|
|
66
|
+
mood: z.ZodEnum<["content", "restless", "unsettled", "wired"]>;
|
|
67
|
+
environment: z.ZodEnum<["co-sleeping", "contact-napping", "baby-cot", "motion-nap", "other"]>;
|
|
68
|
+
timeToSleep: z.ZodEnum<["less-than-10-mins", "10-to-20-mins", "20-to-30-mins", "30-to-40-mins", "more-than-60-mins"]>;
|
|
69
|
+
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
type: "day" | "night";
|
|
71
|
+
date: string;
|
|
72
|
+
start: string;
|
|
73
|
+
end: string;
|
|
74
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
75
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
76
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
77
|
+
}, {
|
|
78
|
+
type: "day" | "night";
|
|
79
|
+
date: string;
|
|
80
|
+
start: string;
|
|
81
|
+
end: string;
|
|
82
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
83
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
84
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
85
|
+
}>, z.ZodObject<{
|
|
86
|
+
date: z.ZodString;
|
|
87
|
+
time: z.ZodString;
|
|
88
|
+
type: z.ZodArray<z.ZodEnum<["wet", "dirty"]>, "many">;
|
|
89
|
+
imageURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
}, "strict", z.ZodTypeAny, {
|
|
91
|
+
type: ("dirty" | "wet")[];
|
|
92
|
+
date: string;
|
|
93
|
+
time: string;
|
|
94
|
+
imageURL?: string | null | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
type: ("dirty" | "wet")[];
|
|
97
|
+
date: string;
|
|
98
|
+
time: string;
|
|
99
|
+
imageURL?: string | null | undefined;
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
date: z.ZodString;
|
|
102
|
+
start: z.ZodString;
|
|
103
|
+
end: z.ZodString;
|
|
104
|
+
side: z.ZodEnum<["left", "right"]>;
|
|
105
|
+
amount: z.ZodNumber;
|
|
106
|
+
unit: z.ZodEnum<["ml", "oz"]>;
|
|
107
|
+
}, "strict", z.ZodTypeAny, {
|
|
108
|
+
date: string;
|
|
109
|
+
start: string;
|
|
110
|
+
end: string;
|
|
111
|
+
side: "left" | "right";
|
|
112
|
+
amount: number;
|
|
113
|
+
unit: "ml" | "oz";
|
|
114
|
+
}, {
|
|
115
|
+
date: string;
|
|
116
|
+
start: string;
|
|
117
|
+
end: string;
|
|
118
|
+
side: "left" | "right";
|
|
119
|
+
amount: number;
|
|
120
|
+
unit: "ml" | "oz";
|
|
121
|
+
}>, z.ZodObject<{
|
|
122
|
+
date: z.ZodString;
|
|
123
|
+
time: z.ZodString;
|
|
124
|
+
medicationName: z.ZodString;
|
|
125
|
+
}, "strict", z.ZodTypeAny, {
|
|
126
|
+
date: string;
|
|
127
|
+
time: string;
|
|
128
|
+
medicationName: string;
|
|
129
|
+
}, {
|
|
130
|
+
date: string;
|
|
131
|
+
time: string;
|
|
132
|
+
medicationName: string;
|
|
133
|
+
}>, z.ZodObject<{
|
|
134
|
+
date: z.ZodString;
|
|
135
|
+
time: z.ZodString;
|
|
136
|
+
allergicReaction: z.ZodBoolean;
|
|
137
|
+
allergicReactionNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
138
|
+
accidentalExposure: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
accidentalExposureNote: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
ladderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
ladderStageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
142
|
+
}, "strict", z.ZodTypeAny, {
|
|
143
|
+
date: string;
|
|
144
|
+
time: string;
|
|
145
|
+
allergicReaction: boolean;
|
|
146
|
+
allergicReactionNote?: string | null | undefined;
|
|
147
|
+
accidentalExposure?: boolean | undefined;
|
|
148
|
+
accidentalExposureNote?: string | null | undefined;
|
|
149
|
+
ladderId?: string | null | undefined;
|
|
150
|
+
ladderStageId?: string | null | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
date: string;
|
|
153
|
+
time: string;
|
|
154
|
+
allergicReaction: boolean;
|
|
155
|
+
allergicReactionNote?: string | null | undefined;
|
|
156
|
+
accidentalExposure?: boolean | undefined;
|
|
157
|
+
accidentalExposureNote?: string | null | undefined;
|
|
158
|
+
ladderId?: string | null | undefined;
|
|
159
|
+
ladderStageId?: string | null | undefined;
|
|
160
|
+
}>]>;
|
|
161
|
+
occurredAt: z.ZodString;
|
|
162
|
+
createdAt: z.ZodString;
|
|
163
|
+
updatedAt: z.ZodString;
|
|
164
|
+
createdByUserId: z.ZodString;
|
|
165
|
+
updatedByUserId: z.ZodString;
|
|
166
|
+
}, "strip", z.ZodTypeAny, {
|
|
167
|
+
details: {
|
|
168
|
+
date: string;
|
|
169
|
+
start: string;
|
|
170
|
+
end: string;
|
|
171
|
+
side: "left" | "right";
|
|
172
|
+
} | {
|
|
173
|
+
type: "breastmilk" | "formula";
|
|
174
|
+
date: string;
|
|
175
|
+
time: string;
|
|
176
|
+
amount: number;
|
|
177
|
+
unit: "ml" | "oz";
|
|
178
|
+
} | {
|
|
179
|
+
type: "day" | "night";
|
|
180
|
+
date: string;
|
|
181
|
+
start: string;
|
|
182
|
+
end: string;
|
|
183
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
184
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
185
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
186
|
+
} | {
|
|
187
|
+
type: ("dirty" | "wet")[];
|
|
188
|
+
date: string;
|
|
189
|
+
time: string;
|
|
190
|
+
imageURL?: string | null | undefined;
|
|
191
|
+
} | {
|
|
192
|
+
date: string;
|
|
193
|
+
start: string;
|
|
194
|
+
end: string;
|
|
195
|
+
side: "left" | "right";
|
|
196
|
+
amount: number;
|
|
197
|
+
unit: "ml" | "oz";
|
|
198
|
+
} | {
|
|
199
|
+
date: string;
|
|
200
|
+
time: string;
|
|
201
|
+
medicationName: string;
|
|
202
|
+
} | {
|
|
203
|
+
date: string;
|
|
204
|
+
time: string;
|
|
205
|
+
allergicReaction: boolean;
|
|
206
|
+
allergicReactionNote?: string | null | undefined;
|
|
207
|
+
accidentalExposure?: boolean | undefined;
|
|
208
|
+
accidentalExposureNote?: string | null | undefined;
|
|
209
|
+
ladderId?: string | null | undefined;
|
|
210
|
+
ladderStageId?: string | null | undefined;
|
|
211
|
+
};
|
|
212
|
+
id: string;
|
|
213
|
+
familyUserId: string;
|
|
214
|
+
createdAt: string;
|
|
215
|
+
updatedAt: string;
|
|
216
|
+
babyId: string;
|
|
217
|
+
updatedByUserId: string;
|
|
218
|
+
activityType: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids";
|
|
219
|
+
occurredAt: string;
|
|
220
|
+
createdByUserId: string;
|
|
221
|
+
note?: string | null | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
details: {
|
|
224
|
+
date: string;
|
|
225
|
+
start: string;
|
|
226
|
+
end: string;
|
|
227
|
+
side: "left" | "right";
|
|
228
|
+
} | {
|
|
229
|
+
type: "breastmilk" | "formula";
|
|
230
|
+
date: string;
|
|
231
|
+
time: string;
|
|
232
|
+
amount: number;
|
|
233
|
+
unit: "ml" | "oz";
|
|
234
|
+
} | {
|
|
235
|
+
type: "day" | "night";
|
|
236
|
+
date: string;
|
|
237
|
+
start: string;
|
|
238
|
+
end: string;
|
|
239
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
240
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
241
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
242
|
+
} | {
|
|
243
|
+
type: ("dirty" | "wet")[];
|
|
244
|
+
date: string;
|
|
245
|
+
time: string;
|
|
246
|
+
imageURL?: string | null | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
date: string;
|
|
249
|
+
start: string;
|
|
250
|
+
end: string;
|
|
251
|
+
side: "left" | "right";
|
|
252
|
+
amount: number;
|
|
253
|
+
unit: "ml" | "oz";
|
|
254
|
+
} | {
|
|
255
|
+
date: string;
|
|
256
|
+
time: string;
|
|
257
|
+
medicationName: string;
|
|
258
|
+
} | {
|
|
259
|
+
date: string;
|
|
260
|
+
time: string;
|
|
261
|
+
allergicReaction: boolean;
|
|
262
|
+
allergicReactionNote?: string | null | undefined;
|
|
263
|
+
accidentalExposure?: boolean | undefined;
|
|
264
|
+
accidentalExposureNote?: string | null | undefined;
|
|
265
|
+
ladderId?: string | null | undefined;
|
|
266
|
+
ladderStageId?: string | null | undefined;
|
|
267
|
+
};
|
|
268
|
+
id: string;
|
|
269
|
+
familyUserId: string;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
updatedAt: string;
|
|
272
|
+
babyId: string;
|
|
273
|
+
updatedByUserId: string;
|
|
274
|
+
activityType: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids";
|
|
275
|
+
occurredAt: string;
|
|
276
|
+
createdByUserId: string;
|
|
277
|
+
note?: string | null | undefined;
|
|
278
|
+
}>, "many">;
|
|
279
|
+
}, "strip", z.ZodTypeAny, {
|
|
280
|
+
activities: {
|
|
281
|
+
details: {
|
|
282
|
+
date: string;
|
|
283
|
+
start: string;
|
|
284
|
+
end: string;
|
|
285
|
+
side: "left" | "right";
|
|
286
|
+
} | {
|
|
287
|
+
type: "breastmilk" | "formula";
|
|
288
|
+
date: string;
|
|
289
|
+
time: string;
|
|
290
|
+
amount: number;
|
|
291
|
+
unit: "ml" | "oz";
|
|
292
|
+
} | {
|
|
293
|
+
type: "day" | "night";
|
|
294
|
+
date: string;
|
|
295
|
+
start: string;
|
|
296
|
+
end: string;
|
|
297
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
298
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
299
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
300
|
+
} | {
|
|
301
|
+
type: ("dirty" | "wet")[];
|
|
302
|
+
date: string;
|
|
303
|
+
time: string;
|
|
304
|
+
imageURL?: string | null | undefined;
|
|
305
|
+
} | {
|
|
306
|
+
date: string;
|
|
307
|
+
start: string;
|
|
308
|
+
end: string;
|
|
309
|
+
side: "left" | "right";
|
|
310
|
+
amount: number;
|
|
311
|
+
unit: "ml" | "oz";
|
|
312
|
+
} | {
|
|
313
|
+
date: string;
|
|
314
|
+
time: string;
|
|
315
|
+
medicationName: string;
|
|
316
|
+
} | {
|
|
317
|
+
date: string;
|
|
318
|
+
time: string;
|
|
319
|
+
allergicReaction: boolean;
|
|
320
|
+
allergicReactionNote?: string | null | undefined;
|
|
321
|
+
accidentalExposure?: boolean | undefined;
|
|
322
|
+
accidentalExposureNote?: string | null | undefined;
|
|
323
|
+
ladderId?: string | null | undefined;
|
|
324
|
+
ladderStageId?: string | null | undefined;
|
|
325
|
+
};
|
|
326
|
+
id: string;
|
|
327
|
+
familyUserId: string;
|
|
328
|
+
createdAt: string;
|
|
329
|
+
updatedAt: string;
|
|
330
|
+
babyId: string;
|
|
331
|
+
updatedByUserId: string;
|
|
332
|
+
activityType: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids";
|
|
333
|
+
occurredAt: string;
|
|
334
|
+
createdByUserId: string;
|
|
335
|
+
note?: string | null | undefined;
|
|
336
|
+
}[];
|
|
337
|
+
}, {
|
|
338
|
+
activities: {
|
|
339
|
+
details: {
|
|
340
|
+
date: string;
|
|
341
|
+
start: string;
|
|
342
|
+
end: string;
|
|
343
|
+
side: "left" | "right";
|
|
344
|
+
} | {
|
|
345
|
+
type: "breastmilk" | "formula";
|
|
346
|
+
date: string;
|
|
347
|
+
time: string;
|
|
348
|
+
amount: number;
|
|
349
|
+
unit: "ml" | "oz";
|
|
350
|
+
} | {
|
|
351
|
+
type: "day" | "night";
|
|
352
|
+
date: string;
|
|
353
|
+
start: string;
|
|
354
|
+
end: string;
|
|
355
|
+
mood: "content" | "restless" | "unsettled" | "wired";
|
|
356
|
+
environment: "co-sleeping" | "contact-napping" | "baby-cot" | "motion-nap" | "other";
|
|
357
|
+
timeToSleep: "less-than-10-mins" | "10-to-20-mins" | "20-to-30-mins" | "30-to-40-mins" | "more-than-60-mins";
|
|
358
|
+
} | {
|
|
359
|
+
type: ("dirty" | "wet")[];
|
|
360
|
+
date: string;
|
|
361
|
+
time: string;
|
|
362
|
+
imageURL?: string | null | undefined;
|
|
363
|
+
} | {
|
|
364
|
+
date: string;
|
|
365
|
+
start: string;
|
|
366
|
+
end: string;
|
|
367
|
+
side: "left" | "right";
|
|
368
|
+
amount: number;
|
|
369
|
+
unit: "ml" | "oz";
|
|
370
|
+
} | {
|
|
371
|
+
date: string;
|
|
372
|
+
time: string;
|
|
373
|
+
medicationName: string;
|
|
374
|
+
} | {
|
|
375
|
+
date: string;
|
|
376
|
+
time: string;
|
|
377
|
+
allergicReaction: boolean;
|
|
378
|
+
allergicReactionNote?: string | null | undefined;
|
|
379
|
+
accidentalExposure?: boolean | undefined;
|
|
380
|
+
accidentalExposureNote?: string | null | undefined;
|
|
381
|
+
ladderId?: string | null | undefined;
|
|
382
|
+
ladderStageId?: string | null | undefined;
|
|
383
|
+
};
|
|
384
|
+
id: string;
|
|
385
|
+
familyUserId: string;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
updatedAt: string;
|
|
388
|
+
babyId: string;
|
|
389
|
+
updatedByUserId: string;
|
|
390
|
+
activityType: "breastfeed" | "bottles" | "sleep" | "nappies" | "pumping" | "medication" | "solids";
|
|
391
|
+
occurredAt: string;
|
|
392
|
+
createdByUserId: string;
|
|
393
|
+
note?: string | null | undefined;
|
|
394
|
+
}[];
|
|
395
|
+
}>;
|
|
396
|
+
export type AnalysisActivitiesQuery = z.infer<typeof analysisActivitiesQuerySchema>;
|
|
397
|
+
export type AnalysisActivitiesResponse = z.infer<typeof analysisActivitiesResponseSchema>;
|
package/dist/analysis.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { activityTypeSchema } from "./enums.js";
|
|
3
|
+
import { activitySchema } from "./family.js";
|
|
4
|
+
import { idSchema, isoDateStringSchema } from "./api.js";
|
|
5
|
+
export const analysisActivitiesQuerySchema = z.object({
|
|
6
|
+
familyUserId: idSchema.optional(),
|
|
7
|
+
babyId: idSchema,
|
|
8
|
+
from: isoDateStringSchema,
|
|
9
|
+
to: isoDateStringSchema,
|
|
10
|
+
activityType: activityTypeSchema.optional()
|
|
11
|
+
});
|
|
12
|
+
export const analysisActivitiesResponseSchema = z.object({
|
|
13
|
+
activities: z.array(activitySchema)
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.js","sourceRoot":"","sources":["../src/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,YAAY,EAAE,QAAQ,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,mBAAmB;IACzB,EAAE,EAAE,mBAAmB;IACvB,YAAY,EAAE,kBAAkB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;CACpC,CAAC,CAAC"}
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const idSchema: z.ZodString;
|
|
3
|
+
export declare const isoDateStringSchema: z.ZodString;
|
|
4
|
+
export declare const nullableIsoDateStringSchema: z.ZodNullable<z.ZodString>;
|
|
5
|
+
export declare const successEnvelope: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
|
|
6
|
+
data: T;
|
|
7
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
8
|
+
data: T;
|
|
9
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
10
|
+
data: T;
|
|
11
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
12
|
+
export declare const errorEnvelopeSchema: z.ZodObject<{
|
|
13
|
+
error: z.ZodObject<{
|
|
14
|
+
code: z.ZodEnum<["INVALID_AUTHENTICATION", "DENIED_PERMISSION", "INACTIVE_BILLING", "SUSPENDED_ORGANIZATION", "EXPIRED_INVITE", "REVOKED_INVITE", "FULL_INVITE", "COACH_SEAT_LIMIT_REACHED", "CONFLICTING_FAMILY_ASSIGNMENT", "INVALID_INPUT", "MISSING_RECORD"]>;
|
|
15
|
+
message: z.ZodString;
|
|
16
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
code: "INVALID_AUTHENTICATION" | "DENIED_PERMISSION" | "INACTIVE_BILLING" | "SUSPENDED_ORGANIZATION" | "EXPIRED_INVITE" | "REVOKED_INVITE" | "FULL_INVITE" | "COACH_SEAT_LIMIT_REACHED" | "CONFLICTING_FAMILY_ASSIGNMENT" | "INVALID_INPUT" | "MISSING_RECORD";
|
|
19
|
+
message: string;
|
|
20
|
+
details?: Record<string, unknown> | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
code: "INVALID_AUTHENTICATION" | "DENIED_PERMISSION" | "INACTIVE_BILLING" | "SUSPENDED_ORGANIZATION" | "EXPIRED_INVITE" | "REVOKED_INVITE" | "FULL_INVITE" | "COACH_SEAT_LIMIT_REACHED" | "CONFLICTING_FAMILY_ASSIGNMENT" | "INVALID_INPUT" | "MISSING_RECORD";
|
|
23
|
+
message: string;
|
|
24
|
+
details?: Record<string, unknown> | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
error: {
|
|
28
|
+
code: "INVALID_AUTHENTICATION" | "DENIED_PERMISSION" | "INACTIVE_BILLING" | "SUSPENDED_ORGANIZATION" | "EXPIRED_INVITE" | "REVOKED_INVITE" | "FULL_INVITE" | "COACH_SEAT_LIMIT_REACHED" | "CONFLICTING_FAMILY_ASSIGNMENT" | "INVALID_INPUT" | "MISSING_RECORD";
|
|
29
|
+
message: string;
|
|
30
|
+
details?: Record<string, unknown> | undefined;
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
error: {
|
|
34
|
+
code: "INVALID_AUTHENTICATION" | "DENIED_PERMISSION" | "INACTIVE_BILLING" | "SUSPENDED_ORGANIZATION" | "EXPIRED_INVITE" | "REVOKED_INVITE" | "FULL_INVITE" | "COACH_SEAT_LIMIT_REACHED" | "CONFLICTING_FAMILY_ASSIGNMENT" | "INVALID_INPUT" | "MISSING_RECORD";
|
|
35
|
+
message: string;
|
|
36
|
+
details?: Record<string, unknown> | undefined;
|
|
37
|
+
};
|
|
38
|
+
}>;
|
|
39
|
+
export type SuccessEnvelope<T> = {
|
|
40
|
+
data: T;
|
|
41
|
+
};
|
|
42
|
+
export type ErrorEnvelope = z.infer<typeof errorEnvelopeSchema>;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { apiErrorSchema } from "./errors.js";
|
|
3
|
+
export const idSchema = z.string().min(1);
|
|
4
|
+
export const isoDateStringSchema = z.string().datetime();
|
|
5
|
+
export const nullableIsoDateStringSchema = isoDateStringSchema.nullable();
|
|
6
|
+
export const successEnvelope = (dataSchema) => z.object({
|
|
7
|
+
data: dataSchema
|
|
8
|
+
});
|
|
9
|
+
export const errorEnvelopeSchema = z.object({
|
|
10
|
+
error: apiErrorSchema
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;AAE1E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAyB,UAAa,EAAE,EAAE,CACvE,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,UAAU;CACjB,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,cAAc;CACtB,CAAC,CAAC"}
|